username@email.com
2025-10-31 1df19350ea2786c4307060ad247862578ab7e3dc
CY_ECommercePlatform/CY.BLL/EC/EC_OrderBasicBLL.cs
@@ -76,13 +76,25 @@
        /// <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)
        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);
            return _eC_OrderBasicDAL.SelectModelPageWorkBook(pagination, _MemberID, txtBeginDate, txtEndDate, txtOrderId, txtSearchyjname, selCustormerManager, selBusinessManager, selOrderStates, BuyerName);
        }
        /// <summary>
@@ -193,6 +205,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>
        /// 根据卖家编号加载下一订单编号方法
        /// </summary>
@@ -211,6 +245,30 @@
        public EC_OrderBasic SelectModelById(int orderId)
        {
            return _eC_OrderBasicDAL.SelectModelById(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>
@@ -295,6 +353,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>
@@ -451,9 +521,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>
@@ -517,6 +587,26 @@
        }
        /// <summary>
        /// 判断某订单是否是另一订单的自动外协订单
        /// </summary>
        /// <param name="orderId"></param>
        /// <returns></returns>
        public bool UpShejiStatus(int Keyid, int ShejiStatus, string Operator)
        {
            return _eC_OrderExtendDAL.UpShejiStatus(Keyid, ShejiStatus, Operator);
        }
        /// <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()
@@ -533,6 +623,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>
        /// 根据新增订单操作,并修改订单状态
@@ -563,7 +665,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))
            {
@@ -650,6 +752,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>
        /// 根据新增订单操作,并修改订单状态