From e4ee60ed94d24e394a7895daa9fb98df813e5953 Mon Sep 17 00:00:00 2001
From: username@email.com <yzy2002yzy@163.com>
Date: 星期五, 12 十二月 2025 14:44:24 +0800
Subject: [PATCH] 提交
---
CY_ECommercePlatform/CY.BLL/EC/EC_OrderBasicBLL.cs | 332 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 328 insertions(+), 4 deletions(-)
diff --git a/CY_ECommercePlatform/CY.BLL/EC/EC_OrderBasicBLL.cs b/CY_ECommercePlatform/CY.BLL/EC/EC_OrderBasicBLL.cs
index c6c67a2..bfa8fd8 100644
--- a/CY_ECommercePlatform/CY.BLL/EC/EC_OrderBasicBLL.cs
+++ b/CY_ECommercePlatform/CY.BLL/EC/EC_OrderBasicBLL.cs
@@ -29,6 +29,9 @@
using CY.Model;
using CY.IDAL;
using CY.Infrastructure.Query;
+using CY.Model.Inquiry;
+using CY.Infrastructure.Common;
+using CY.IDAL.EC;
namespace CY.BLL.EC
{
@@ -38,10 +41,15 @@
public class EC_OrderBasicBLL
{
IEC_OrderBasicDAL _eC_OrderBasicDAL = null;
-
+ IEC_OrderPrintParameterDAL _eC_OrderPrintParameterDAL = null;
+ IEC_OrderExtendDAL _eC_OrderExtendDAL = null;
+ IPay_TradingSingleDAL _pay_TradingSingleDAL = null;
public EC_OrderBasicBLL()
{
_eC_OrderBasicDAL = AbstractFactory.Factory.GetDALByInterfaceName(AbstractFactory.DALInterface.IEC_OrderBasicDAL) as IEC_OrderBasicDAL;
+ _eC_OrderPrintParameterDAL = AbstractFactory.Factory.GetDALByInterfaceName(AbstractFactory.DALInterface.IEC_OrderPrintParameterDAL) as IEC_OrderPrintParameterDAL;
+ _eC_OrderExtendDAL = AbstractFactory.Factory.GetDALByInterfaceName(AbstractFactory.DALInterface.IEC_OrderExtendDAL) as IEC_OrderExtendDAL;
+ _pay_TradingSingleDAL = AbstractFactory.Factory.GetDALByInterfaceName(AbstractFactory.DALInterface.IPay_TradingSingleDAL) as IPay_TradingSingleDAL;
}
/// <summary>
@@ -64,6 +72,29 @@
public IEnumerable<EC_OrderBasic> SelectModelPage_Seller(Infrastructure.Query.Pagination pagination, Dictionary<int, object> searchParam)
{
return _eC_OrderBasicDAL.SelectModelPage_Seller(pagination, searchParam);
+ }
+
+
+ /// <summary>
+ /// 鍒嗛〉鏌ヨ
+ /// </summary>
+ /// <param name="pagination"></param>
+ /// <param name="MemberId"></param>
+ /// <returns></returns>
+ public IEnumerable<Model.EC_OrderBasic> SelectModelPageSheji(Infrastructure.Query.Pagination pagination, Guid MemberId, string BeginCreateTime, string EndCreateTime, string SellerOrderId, string PrintTypeId, string BusinessManagerId, string Shejirenyuan, string BuyerName, string DocumentName, string ShejiStatus, string shifoujiesuan)
+ {
+ return _eC_OrderBasicDAL.SelectModelPageSheji(pagination, MemberId, BeginCreateTime, EndCreateTime, SellerOrderId, PrintTypeId, BusinessManagerId, Shejirenyuan, BuyerName, DocumentName, ShejiStatus, shifoujiesuan);
+ }
+
+
+ /// <summary>
+ /// 浣滀笟鏈�佽揣鍒嗛〉鏌ヨ
+ /// </summary>
+ /// <param name="pagination"></param>
+ /// <returns></returns>
+ public IEnumerable<EC_OrderBasic> SelectModelPageWorkBook(Infrastructure.Query.Pagination pagination, Guid _MemberID, string txtBeginDate, string txtEndDate, string txtOrderId, string txtSearchyjname, string selCustormerManager, string selBusinessManager, string selOrderStates, string BuyerName)
+ {
+ return _eC_OrderBasicDAL.SelectModelPageWorkBook(pagination, _MemberID, txtBeginDate, txtEndDate, txtOrderId, txtSearchyjname, selCustormerManager, selBusinessManager, selOrderStates, BuyerName);
}
/// <summary>
@@ -154,6 +185,16 @@
}
/// <summary>
+ /// 淇敼璁㈠崟鐘舵��(闈炴敮浠樼姸鎬佷笖涓嶅彲淇敼涓烘湭鍙楃悊鍜屽凡鍙楃悊)
+ /// </summary>
+ /// <param name="orderOperate">璁㈠崟鎿嶄綔</param>
+ /// <returns></returns>
+ public bool UpSurplusPrintNum(int? Keyid, int? SurplusPrintNum, string Operator)
+ {
+ return _eC_OrderExtendDAL.UpSurplusPrintNumsql(Keyid, SurplusPrintNum, Operator);
+ }
+
+ /// <summary>
/// 鏍规嵁缂栧彿鎵归噺鍒犻櫎鏁版嵁
/// </summary>
/// <param name="currentOperator">褰撳墠鎿嶄綔浜�</param>
@@ -163,6 +204,28 @@
{
return _eC_OrderBasicDAL.DeleteDataByIds(currentOperator, ids);
}
+
+
+ /// <summary>
+ /// 鏍规嵁缂栧彿鎵归噺鍒犻櫎鏁版嵁
+ /// </summary>
+ /// <param name="currentOperator">褰撳墠鎿嶄綔浜�</param>
+ /// <param name="ids">缂栧彿闆嗗悎</param>
+ /// <returns></returns>
+ public bool DeleteDatashejiByIds(string currentOperator, string[] ids)
+ {
+ foreach(var id in ids)
+ {
+ Model.EC_OrderBasic trueModel = new Model.EC_OrderBasic();
+ trueModel.Keyid = id.ToInt32();
+ trueModel.Operator = currentOperator;
+ _eC_OrderBasicDAL.DeleteModelsheji(trueModel);
+ }
+
+
+ return true;
+ }
+
/// <summary>
/// 鏍规嵁鍗栧缂栧彿鍔犺浇涓嬩竴璁㈠崟缂栧彿鏂规硶
@@ -184,6 +247,41 @@
return _eC_OrderBasicDAL.SelectModelById(orderId);
}
+
+ /// <summary>
+ /// 鏍规嵁缂栧彿鑾峰彇璁捐璁㈠崟淇℃伅
+ /// </summary>
+ /// <param name="orderId">璁㈠崟鍞竴缂栧彿</param>
+ /// <returns></returns>
+ public EC_OrderBasic SelectModelByxiadanId(int orderId)
+ {
+ return _eC_OrderBasicDAL.SelectModelByxiadanId(orderId);
+ }
+
+
+ /// <summary>
+ /// 鏍规嵁缂栧彿鑾峰彇璁㈠崟淇℃伅
+ /// </summary>
+ /// <param name="orderId">璁㈠崟鍞竴缂栧彿</param>
+ /// <returns></returns>
+ public Pay_TradingSingle GetPayTradingById(int orderId)
+ {
+ return _pay_TradingSingleDAL.GetOrderByIds(orderId).FirstOrDefault();
+ }
+
+
+
+
+ /// <summary>
+ /// 鏍规嵁缂栧彿鑾峰彇璁㈠崟淇℃伅
+ /// </summary>
+ /// <param name="orderId">璁㈠崟鍞竴缂栧彿</param>
+ /// <returns></returns>
+ public EC_OrderExtend GetModelByKeyid(int orderId)
+ {
+ return _eC_OrderExtendDAL.GetModelByKeyid(orderId);
+ }
+
/// <summary>
/// 鏍规嵁璁㈠崟缂栧彿鑾峰彇璁㈠崟
/// </summary>
@@ -192,6 +290,17 @@
public IEnumerable<EC_OrderBasic> GetOrderByIds(string orderIds)
{
return _eC_OrderBasicDAL.GetOrderByIds(orderIds);
+ }
+
+
+ /// <summary>
+ /// 鏍规嵁璁㈠崟缂栧彿鑾峰彇璁㈠崟
+ /// </summary>
+ /// <param name="orderIds">璁㈠崟缂栧彿</param>
+ /// <returns></returns>
+ public IEnumerable<EC_OrderBasic> GetOrderByPrintTypeId(int PrintTypeId)
+ {
+ return _eC_OrderBasicDAL.GetOrderByPrintTypeId(PrintTypeId);
}
/// <summary>
@@ -266,6 +375,18 @@
public bool ReceiveMoneyToAccount(int orderId, OA_FirmAccountRecord firmAccountRecord)
{
return _eC_OrderBasicDAL.ReceiveMoneyToAccount(orderId, firmAccountRecord);
+ }
+
+
+ /// <summary>
+ /// 鏀舵(绾夸笅杞处銆佺幇閲�)
+ /// </summary>
+ /// <param name="orderId">璁㈠崟缂栧彿</param>
+ /// <param name="firmAccountRecord">鎿嶄綔璁板綍</param>
+ /// <returns></returns>
+ public bool ReceiveMoneyToQueren(int orderId, OA_FirmAccountRecord firmAccountRecord)
+ {
+ return _eC_OrderBasicDAL.ReceiveMoneyToQueren(orderId, firmAccountRecord);
}
/// <summary>
@@ -422,9 +543,9 @@
/// <param name="OutOrderId"></param>
/// <param name="RelationType"></param>
/// <returns></returns>
- public IEnumerable<EC_OrderBasic> SelectAferOfOutOrder(Infrastructure.Query.Pagination pagination, Guid MemberId, DateTime? StartCreatTime, DateTime? EndCreatTime, DateTime? StartReturnTime, DateTime? EndReturnTime, string Creater, string OutFirm, string WorkStates, string OutOrderId, int? RelationType)
+ public IEnumerable<EC_OrderBasic> SelectAferOfOutOrder(Infrastructure.Query.Pagination pagination, Guid MemberId, DateTime? StartCreatTime, DateTime? EndCreatTime, DateTime? StartReturnTime, DateTime? EndReturnTime, string Creater, string OutFirm, string WorkStates, string OutOrderId, int? RelationType, string PayState = null)
{
- return _eC_OrderBasicDAL.SelectAferOfOutOrder(pagination, MemberId, StartCreatTime, EndCreatTime, StartReturnTime, EndReturnTime, Creater, OutFirm, WorkStates, OutOrderId, RelationType);
+ return _eC_OrderBasicDAL.SelectAferOfOutOrder(pagination, MemberId, StartCreatTime, EndCreatTime, StartReturnTime, EndReturnTime, Creater, OutFirm, WorkStates, OutOrderId, RelationType, PayState);
}
/// <summary>
@@ -488,6 +609,26 @@
}
/// <summary>
+ /// 鍒ゆ柇鏌愯鍗曟槸鍚︽槸鍙︿竴璁㈠崟鐨勮嚜鍔ㄥ鍗忚鍗�
+ /// </summary>
+ /// <param name="orderId"></param>
+ /// <returns></returns>
+ public bool UpShejiStatus(int Keyid, int ShejiStatus, string Operator, int XiadanKeyid)
+ {
+ return _eC_OrderExtendDAL.UpShejiStatus(Keyid, ShejiStatus, Operator, XiadanKeyid);
+ }
+
+ /// <summary>
+ /// 鍒ゆ柇鏌愯鍗曟槸鍚︽槸鍙︿竴璁㈠崟鐨勮嚜鍔ㄥ鍗忚鍗�
+ /// </summary>
+ /// <param name="orderId"></param>
+ /// <returns></returns>
+ public bool UpShejijiesuanStatus(int Keyid, int ShejiStatus, string Operator)
+ {
+ return _eC_OrderExtendDAL.UpShejijiesuanStatus(Keyid, ShejiStatus, Operator);
+ }
+
+ /// <summary>
/// WEB鏈嶅姟鑷姩瀹屾垚璁㈠崟
/// </summary>
public void AutoCompleteOrderByWebService()
@@ -504,6 +645,18 @@
{
return _eC_OrderBasicDAL.DeleteOutOrder(OrderId);
}
+
+
+ /// <summary>
+ /// 鍒犻櫎澶栧崗璁㈠崟
+ /// </summary>
+ /// <param name="OrderId"></param>
+ /// <returns></returns>
+ public bool UpdateOldOrderSurplusPrintNum(int outOrderId)
+ {
+ return _eC_OrderBasicDAL.UpdateOldOrderSurplusPrintNum(outOrderId);
+ }
+
/// <summary>
/// 鏍规嵁鏂板璁㈠崟鎿嶄綔锛屽苟淇敼璁㈠崟鐘舵��
@@ -534,7 +687,7 @@
/// <returns></returns>
public IEnumerable<EC_OrderBasic> GetModelPageListForPrepayments(Pagination pa, string DeliveryTime, string Province, string City, string County, string BuyerName, string BusinessManagerId, string SellerOrderId, string DocumentName, Guid SellerId)
{
- string Condition = " and ( ob.[OrderState] ='2' or ob.[OrderState] ='3' and SellerId='"+ SellerId + "' )";
+ string Condition = " and ( ob.[OrderState] ='1' or ob.[OrderState] ='2' or ob.[OrderState] ='3' ) and SellerId='" + SellerId + "' ";
if (!string.IsNullOrEmpty(DeliveryTime))
{
@@ -621,6 +774,100 @@
+ /// <summary>
+ /// 鏌ヨ瀹㈡埛棰勪粯娆惧垪琛�
+ /// </summary>
+ /// <param name="pa"></param>
+ /// <returns></returns>
+ public IEnumerable<EC_OrderBasic> GetModelPageListForSonghuoyanchis(Pagination pa, string DeliveryTime, string Province, string City, string County, string BuyerName, string BusinessManagerId, string SellerOrderId, string DocumentName, Guid SellerId)
+ {
+ string Condition = " and ( ob.[OrderState] ='1' or ob.[OrderState] ='2' or ob.[OrderState] ='3' or ob.[OrderState] ='4' ) and SellerId='" + SellerId + "' ";
+
+ if (!string.IsNullOrEmpty(DeliveryTime))
+ {
+ if (DeliveryTime == "鏄庡ぉ")
+ {
+ Condition += " and ( DATEDIFF(DAY,GETDATE(),ob.[DeliveryTime])=1 or DATEDIFF(DAY,GETDATE(),oe.[DelayTime])=1 )";
+ }
+ else if (DeliveryTime == "鍚庡ぉ")
+ {
+ Condition += " and ( DATEDIFF(DAY,GETDATE(),ob.[DeliveryTime])=2 or DATEDIFF(DAY,GETDATE(),oe.[DelayTime])=2 )";
+ }
+ else if (DeliveryTime == "3澶�")
+ {
+ Condition += " and ( DATEDIFF(DAY,GETDATE(),ob.[DeliveryTime])=3 or DATEDIFF(DAY,GETDATE(),oe.[DelayTime])=3 )";
+ }
+ else if (DeliveryTime == "4澶�")
+ {
+ Condition += " and ( DATEDIFF(DAY,GETDATE(),ob.[DeliveryTime])=4 or DATEDIFF(DAY,GETDATE(),oe.[DelayTime])=4 )";
+ }
+ else if (DeliveryTime == "5澶�")
+ {
+ Condition += " and ( DATEDIFF(DAY,GETDATE(),ob.[DeliveryTime])=5 or DATEDIFF(DAY,GETDATE(),oe.[DelayTime])=5) ";
+ }
+ else if (DeliveryTime == "6澶�")
+ {
+ Condition += " and ( DATEDIFF(DAY,GETDATE(),ob.[DeliveryTime])=6 or DATEDIFF(DAY,GETDATE(),oe.[DelayTime])=6) ";
+ }
+ else if (DeliveryTime == "7澶�")
+ {
+ Condition += " and ( DATEDIFF(DAY,GETDATE(),ob.[DeliveryTime])=7 or DATEDIFF(DAY,GETDATE(),oe.[DelayTime])=7 )";
+ }
+ else if (DeliveryTime == "涓�鍛ㄥ悗")
+ {
+ Condition += " and ( DATEDIFF(DAY,GETDATE(),ob.[DeliveryTime]) >7 or DATEDIFF(DAY,GETDATE(),oe.[DelayTime])>7 )";
+ }
+ else if (DeliveryTime == "閫炬湡")
+ {
+ Condition += " and ( DATEDIFF(DAY,GETDATE(),ob.[DeliveryTime])<=0 or DATEDIFF(DAY,GETDATE(),oe.[DelayTime])<=0 )";
+ }
+
+ }
+
+ if (!string.IsNullOrEmpty(Province))
+ Condition += string.Format(" and CustomerCommunications.Province='{0}'", Province);
+
+ if (!string.IsNullOrEmpty(City))
+ Condition += string.Format(" and CustomerCommunications.City='{0}'", City);
+
+ if (!string.IsNullOrEmpty(County))
+ Condition += string.Format(" and CustomerCommunications.County='{0}'", County);
+
+ if (!string.IsNullOrEmpty(BuyerName))
+ {
+ Condition += " and ob.BuyerName like '%" + BuyerName + "%'";
+ }
+ if (!string.IsNullOrEmpty(BusinessManagerId))
+ {
+ Condition += string.Format(" and oe.BusinessManagerId='{0}'", BusinessManagerId);
+ }
+
+
+
+ if (!string.IsNullOrEmpty(SellerOrderId))
+ {
+ Condition += " and ob.SellerOrderId like '%" + SellerOrderId + "%'"; ;
+ }
+ if (!string.IsNullOrEmpty(DocumentName))
+ {
+ Condition += " and ob.DocumentName like '%" + DocumentName + "%'"; ;
+ }
+
+
+ Query query = new Query();
+ IList<Criterion> criterias = new List<Criterion>()
+ {
+ new Criterion("", Condition),
+
+ new Criterion("orderBy"," [DeliveryTime] DESC ")
+ };
+ query.Criteria = criterias;
+ return _eC_OrderBasicDAL.SelectModelPage_weiwangong(query, pa);
+ }
+
+
+
+
/// <summary>
/// 鏍规嵁鏂板璁㈠崟鎿嶄綔锛屽苟淇敼璁㈠崟鐘舵��
@@ -645,5 +892,82 @@
{
return _eC_OrderBasicDAL.GetEC_OrderBasicListBydeliverorderId(deliverorderId, FirmId);
}
+
+
+ /// <summary>
+ /// 閲嶆柊璁$畻璁㈠崟鐨勯噾棰�
+ /// </summary>
+ /// <param name="orderOperate"></param>
+ /// <returns></returns>
+ public bool UpdateorderJine(int orderId)
+ {
+ CoreCmsPlanOrderBLL _PlanOrderBLL = new CoreCmsPlanOrderBLL();
+ CoreCmsPlanOrderItemBLL _coreCmsPlanOrderItemBLL = new CoreCmsPlanOrderItemBLL();
+
+ var eC_OrderBasic = this.SelectModelById(orderId);
+ EC_OrderPrintParameterBLL _OrderPrintParameterBLL = new EC_OrderPrintParameterBLL();
+ var eC_OrderPrintParameter = _OrderPrintParameterBLL.GetModel(orderId);
+ InquiryCommonModel model = SerializationHelper.DeSerialize(typeof(InquiryCommonModel), eC_OrderPrintParameter.PrintParameter) as InquiryCommonModel;
+
+ //eC_OrderBasic.SumPrice =12 ;
+ //eC_OrderBasic.UnitPrice = 12;
+ var sss = model.InquiryWorkBookList;
+
+ var coreCmsPlanOrders = _PlanOrderBLL.GetModelByorderid(orderId).ToList();
+
+
+ decimal SumPrice = 0;
+ int num = 0;
+
+ var coreCmsPlanOrders2 = new List<CoreCmsPlanOrderItem>();
+
+ foreach (var coreCmsPlanOrder in coreCmsPlanOrders)
+ {
+ var coreCmsPlanOrders1 = _coreCmsPlanOrderItemBLL.GetModelsByOrderid(coreCmsPlanOrder.id).ToList();
+ coreCmsPlanOrders2.AddRange(coreCmsPlanOrders1);
+
+ num += coreCmsPlanOrders1.Sum(x=>x.nums);
+ SumPrice += coreCmsPlanOrders1.Sum(x => x.amount);
+
+ }
+
+ eC_OrderBasic.SumPrice = SumPrice;
+ if (num > 0)
+ {
+ eC_OrderBasic.UnitPrice = Math.Round(SumPrice / new decimal(num), 4);
+ }
+ else
+ {
+ eC_OrderBasic.UnitPrice = 0;
+ }
+
+
+
+ model.PrintCount = num;
+ foreach ( var inquiryWorkBookModel in model.InquiryWorkBookList)
+ {
+ var sssssss = coreCmsPlanOrders2.Where(x => x.name == inquiryWorkBookModel.WorkBookNameTxt && x.specification == inquiryWorkBookModel.WorkBookSizeTxt).ToList();
+ inquiryWorkBookModel.WorkBookCount = sssssss.Sum(x=>x.nums).ToString2();
+ inquiryWorkBookModel.WorkBookMoney = sssssss.Sum(x=>x.amount).ToString2();
+ }
+
+
+ var isWin = _eC_OrderBasicDAL.Updatejinedanjia(eC_OrderBasic.Keyid.Value, eC_OrderBasic.SumPrice.Value, eC_OrderBasic.UnitPrice.Value, num);
+
+ eC_OrderPrintParameter.PrintParameter = SerializationHelper.Serialize(model);
+ isWin = _eC_OrderPrintParameterDAL.UpdateModel(eC_OrderPrintParameter);
+
+
+ var pay_TradingSingles = _pay_TradingSingleDAL.GetOrderByIds(eC_OrderBasic.Keyid.Value).FirstOrDefault() ;
+ if (pay_TradingSingles != null)
+ {
+ pay_TradingSingles.TradingMoney = eC_OrderBasic.SumPrice.Value;
+ pay_TradingSingles.PayableMoney = eC_OrderBasic.SumPrice.Value;
+ isWin = _pay_TradingSingleDAL.UpdateModel(pay_TradingSingles);
+ }
+
+ return isWin;
+ }
+
}
}
--
Gitblit v1.9.1