From c21e1950b659a61667f42c22c1eea28bc8e72055 Mon Sep 17 00:00:00 2001
From: username@email.com <yzy2002yzy@163.com>
Date: 星期五, 24 十月 2025 11:17:52 +0800
Subject: [PATCH] 提交

---
 CY_ECommercePlatform/CY.SQLDAL/EC/EC_OrderBasicDAL.cs |  175 ++++++++++++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 163 insertions(+), 12 deletions(-)

diff --git a/CY_ECommercePlatform/CY.SQLDAL/EC/EC_OrderBasicDAL.cs b/CY_ECommercePlatform/CY.SQLDAL/EC/EC_OrderBasicDAL.cs
index 690d966..62d4cd8 100644
--- a/CY_ECommercePlatform/CY.SQLDAL/EC/EC_OrderBasicDAL.cs
+++ b/CY_ECommercePlatform/CY.SQLDAL/EC/EC_OrderBasicDAL.cs
@@ -653,7 +653,7 @@
 
                 if (string.IsNullOrEmpty(ssss.ToString()))
                 {
-                    ssss.Append("'4354654657568345429890'");
+                    ssss.Append("'11111111-1111-1111-1111-111111111111'");
                 }
 
                
@@ -1176,7 +1176,7 @@
                 new SqlParameter("@createTimeEnd",DBNull.Value){SqlDbType=SqlDbType.Date},
                 new SqlParameter("@printType",DBNull.Value){SqlDbType=SqlDbType.Int},
                 new SqlParameter("@orderType",DBNull.Value){SqlDbType=SqlDbType.Int},
-                new SqlParameter("@orderState",DBNull.Value){SqlDbType=SqlDbType.Int},
+                new SqlParameter("@orderState",DBNull.Value){SqlDbType=SqlDbType.VarChar,Size=20},
                 new SqlParameter("@orderPayState",DBNull.Value){SqlDbType=SqlDbType.Int},
                 new SqlParameter("@creater",DBNull.Value){SqlDbType=SqlDbType.VarChar,Size=20},
                 new SqlParameter("@customerLevel",DBNull.Value){SqlDbType=SqlDbType.Int},
@@ -1339,7 +1339,7 @@
         /// </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)
         {
             try
             {
@@ -1364,6 +1364,9 @@
                 if (!string.IsNullOrEmpty(txtSearchyjname))
                     condition += " and ob.DocumentName like '%" + txtSearchyjname + "%'";
 
+                if (!string.IsNullOrEmpty(BuyerName))
+                    condition += " and ob.BuyerName like '%" + BuyerName + "%'";
+
                 if (!string.IsNullOrEmpty(selCustormerManager))
                     condition += " and oe.CustomerManagerId = '" + selCustormerManager + "'";
 
@@ -1371,7 +1374,17 @@
                     condition += " and oe.BusinessManagerId = '" + selBusinessManager + "'";
 
                 if (!string.IsNullOrEmpty(selOrderStates))
-                    condition += " and ob.OrderState = '" + selOrderStates + "'";
+                {
+                    if(selOrderStates == "0")
+                    {
+                        condition += " and ob.OrderState  in (1,2,3,4)";
+                    }
+                    else if (selOrderStates == "1")
+                    {
+                        condition += " and ob.OrderState in ( 5,6,-1)";
+                    }
+                }
+                   
 
  
 
@@ -1754,6 +1767,44 @@
                     };
                 _dataBase.Query("sp_Order_UpdateOrderState", CommandType.StoredProcedure, sqlParms.ToArray<SqlParameter>());
                 return isWin = 1.Equals(sqlParms[2].Value);
+            }
+            catch (Exception ex)
+            {
+                throw ex;
+            }
+        }
+
+
+
+
+        /// <summary>
+        /// 淇敼璁㈠崟閫佽揣閲戦
+        /// </summary>
+        /// <param name="orderOperate">璁㈠崟鎿嶄綔</param>
+        /// <returns></returns>
+        internal bool UpdateOrderSonghuoJine(int OrderId,decimal? SonghuoJine)
+        {
+           
+            
+            _eC_OrderOperateDAL = null == _eC_OrderOperateDAL ? new EC_OrderOperateDAL(_dataBase) : _eC_OrderOperateDAL;
+            try
+            {
+
+                bool isWin = false;
+               
+
+                IList<SqlParameter> sqlParms = new List<SqlParameter>()
+                    {
+                            new SqlParameter("@orderId",OrderId),
+                            new SqlParameter("@SonghuoJine",SonghuoJine.HasValue?SonghuoJine.Value:0),
+                            
+                    };
+                string sql = "Update [EC_OrderExtend] Set [SonghuoJine]=@SonghuoJine  where [Keyid] =@orderId ";
+
+               
+                    _dataBase.ExecuteSql(sql, sqlParms.ToArray<SqlParameter>());
+   
+                return true;
             }
             catch (Exception ex)
             {
@@ -2626,7 +2677,8 @@
                         new SqlParameter(){ParameterName="@AppointCourierCompany",Value=awbInfo.AppointCourierCompany,SqlDbType=SqlDbType.VarChar,Size=50},
                         new SqlParameter(){ParameterName="@FetchAddress",Value=awbInfo.FetchAddress,SqlDbType=SqlDbType.VarChar,Size=200},
                         new SqlParameter(){ParameterName="@FetchContacts",Value=awbInfo.FetchContacts,SqlDbType=SqlDbType.VarChar,Size=50},
-                        new SqlParameter(){ParameterName="@FetchPhoneNum",Value=awbInfo.FetchPhoneNum,SqlDbType=SqlDbType.VarChar,Size=20}
+                        new SqlParameter(){ParameterName="@FetchPhoneNum",Value=awbInfo.FetchPhoneNum,SqlDbType=SqlDbType.VarChar,Size=20},
+                         new SqlParameter(){ParameterName="@SonghuoJine",Value=awbInfo.SonghuoJine.HasValue?awbInfo.SonghuoJine.Value:0,SqlDbType=SqlDbType.Money}
                     };
                     _dataBase.Query("sp_EC_AwbInfo_DeliverPresswork", CommandType.StoredProcedure, sqlParms.ToArray<SqlParameter>());
                     isWin = 1.Equals(sqlParms[0].Value);
@@ -2643,6 +2695,17 @@
                         else
                             ;
                         isWin = this.UpdateOrderStateUnit(awbInfo.Operate);//淇敼璁㈠崟鐘舵��
+                        if (!isWin)
+                            return false;
+                        else
+                            ;
+
+                        if(awbInfo.Operate.OperateType == 5)
+                            isWin = this.UpdateOrderSonghuoJine(awbInfo.Keyid.Value, awbInfo.SonghuoJine);//淇敼璁㈠崟鐘舵��
+                        else
+                        {
+                            isWin = this.UpdateOrderSonghuoJine(awbInfo.Keyid.Value, 0);//淇敼璁㈠崟鐘舵��
+                        }
                         if (!isWin)
                             return false;
                         else
@@ -3206,7 +3269,7 @@
         /// <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)
+        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)
         {
             try
             {
@@ -3237,10 +3300,7 @@
                 {
                     condition += " and oe.BusinessManagerId = " + BusinessManagerId + "";
                 }
-                if (!string.IsNullOrEmpty(Shejirenyuan))
-                {
-                    condition += " and ( oe.Shejirenyuan = " + Shejirenyuan + " or oe.Shejirenyuanneiye = " + Shejirenyuan + " )";
-                }
+                
                 if (!string.IsNullOrEmpty(BuyerName))
                     condition += " and ob.BuyerName like '%" + BuyerName + "%'";
 
@@ -3255,11 +3315,102 @@
                     }
                     else
                     {
-                        condition += " and oe.ShejiStatus != 1 ";
+                        condition += " and  (oe.ShejiStatus is null or  oe.ShejiStatus != 1) ";
                     }
                 }
 
-                return _dataBase.SelectModelPage<Model.EC_OrderBasic>(pagination, " ob.*,oe.BusinessManagerId,oe.shifouDelivery,oe.IsPrintfengqian,oe.DeliveryOrderId,oe.KaipiaoshenqingCreater,oe.KaipiaoshenqingTime,oe.KaipiaoquerenCreater,oe.KaipiaoquerenTime,oe.Kehuqianshou,oe.KehuqianshouCreater,oe.KehuqianshouTime  ,oe.Quchudingdan,oe.QuchudingdanCreater,oe.QuchudingdanTime,oe.PrintPackDeliveryRequir,oe.PrintNum,oe.ExigencyCaseId,oe.Duiyinghetongbianhao,oe.[Shejirenyuan],oe.[Shejileixing] ,oe.[Danshuangmian],oe.[Shejirenyuanneiye],oe.[Shejileixingneiye],oe.[Danshuangmianneiye],oe.[Shejiyaoqiu],oe.[Shejiyaoqiuneiye],oe.[ShejirenyuanName],oe.[ShejirenyuanNameneiye],oe.[ShejiStatus],oe.[ShejileixingName],oe.[ShejileixingNameneiye],oe.[ShejiUnitPrice] ,oe.[ShejiSumPrice],oe.[ShejiUnitPriceneiye],oe.[ShejiSumPriceneiye] ,oe.[Shejicount],oe.[Shejicountneiye] ,pt.PrintName as PrintTypeName ", "  EC_OrderBasic as ob Inner Join [EC_OrderExtend]  as oe On ob.Keyid=oe.Keyid   Left Join SysInquiry_PrintingType as pt On(ob.PrintTypeId=pt.Keyid) ", " ob.CreateTime desc", " CreateTime desc ", condition);
+                if (!string.IsNullOrEmpty(shifoujiesuan))
+                {
+                    if (shifoujiesuan == "1")
+                    {
+                        condition += " and oe.shifoujiesuan = " + shifoujiesuan + "";
+                    }
+                    else
+                    {
+                        condition += " and  (oe.shifoujiesuan is null or   oe.shifoujiesuan!= 1 ) ";
+                    }
+                }
+
+                
+
+                if (string.IsNullOrEmpty(Shejirenyuan))
+                {
+                    string fromss = "  EC_OrderBasic as ob Inner Join [EC_OrderExtend]  as oe On ob.Keyid=oe.Keyid   Left Join SysInquiry_PrintingType as pt On(ob.PrintTypeId=pt.Keyid) " +
+               " where  " + condition;
+                    var ssss = _dataBase.SelectModel<Model.EC_OrderBasic>("  sum(oe.[ShejiSumPrice]) as ShejiSumPrice,sum(oe.ShejiSumPriceneiye) as ShejiSumPriceneiye ,sum(oe.ShejiSumPriceneiye1) as ShejiSumPriceneiye1,sum(oe.ShejiSumPriceneiye2) as ShejiSumPriceneiye2 ", fromss);
+                    if (ssss.Count > 0)
+                    {
+                        var aaaaa = ssss.First();
+                        pagination.heji1 = (aaaaa.ShejiSumPrice.HasValue ? aaaaa.ShejiSumPrice.Value : 0)  + (aaaaa.ShejiSumPriceneiye.HasValue ? aaaaa.ShejiSumPriceneiye.Value : 0) + (aaaaa.ShejiSumPriceneiye1.HasValue ? aaaaa.ShejiSumPriceneiye1.Value : 0) + (aaaaa.ShejiSumPriceneiye2.HasValue ? aaaaa.ShejiSumPriceneiye2.Value : 0);
+
+                    }
+                }
+                else
+                {
+                    decimal heji1 = 0;
+                  var   condition1 = " and  oe.Shejirenyuan = " + Shejirenyuan + "  ";
+
+                    string fromss = "  EC_OrderBasic as ob Inner Join [EC_OrderExtend]  as oe On ob.Keyid=oe.Keyid   Left Join SysInquiry_PrintingType as pt On(ob.PrintTypeId=pt.Keyid) " +
+             " where  " + condition + condition1;
+                    var ssss = _dataBase.SelectModel<Model.EC_OrderBasic>("  sum(oe.[ShejiSumPrice]) as ShejiSumPrice ", fromss);
+                    if (ssss.Count > 0)
+                    {
+                        var aaaaa = ssss.First();
+                        heji1 += (aaaaa.ShejiSumPrice.HasValue ? aaaaa.ShejiSumPrice.Value : 0);
+                    }
+
+
+                     condition1 = " and  oe.Shejirenyuanneiye = " + Shejirenyuan + "  ";
+
+                     fromss = "  EC_OrderBasic as ob Inner Join [EC_OrderExtend]  as oe On ob.Keyid=oe.Keyid   Left Join SysInquiry_PrintingType as pt On(ob.PrintTypeId=pt.Keyid) " +
+             " where  " + condition + condition1;
+                     ssss = _dataBase.SelectModel<Model.EC_OrderBasic>(" sum(oe.ShejiSumPriceneiye) as ShejiSumPriceneiye  ", fromss);
+                    if (ssss.Count > 0)
+                    {
+                        var aaaaa = ssss.First();
+                        heji1 += (aaaaa.ShejiSumPriceneiye.HasValue ? aaaaa.ShejiSumPriceneiye.Value : 0);
+
+                    }
+
+
+                    condition1 = " and   oe.Shejirenyuanneiye1 = " + Shejirenyuan + "  ";
+
+                    fromss = "  EC_OrderBasic as ob Inner Join [EC_OrderExtend]  as oe On ob.Keyid=oe.Keyid   Left Join SysInquiry_PrintingType as pt On(ob.PrintTypeId=pt.Keyid) " +
+            " where  " + condition + condition1;
+                    ssss = _dataBase.SelectModel<Model.EC_OrderBasic>("    sum(oe.ShejiSumPriceneiye1) as ShejiSumPriceneiye1  ", fromss);
+                    if (ssss.Count > 0)
+                    {
+                        var aaaaa = ssss.First();
+                        heji1 += (  aaaaa.ShejiSumPriceneiye1.HasValue ? aaaaa.ShejiSumPriceneiye1.Value : 0);
+
+                    }
+
+
+                    condition1 = " and   oe.Shejirenyuanneiye2 = " + Shejirenyuan + "  ";
+
+                    fromss = "  EC_OrderBasic as ob Inner Join [EC_OrderExtend]  as oe On ob.Keyid=oe.Keyid   Left Join SysInquiry_PrintingType as pt On(ob.PrintTypeId=pt.Keyid) " +
+            " where  " + condition + condition1;
+                    ssss = _dataBase.SelectModel<Model.EC_OrderBasic>("  sum(oe.ShejiSumPriceneiye2) as ShejiSumPriceneiye2 ", fromss);
+                    if (ssss.Count > 0)
+                    {
+                        var aaaaa = ssss.First();
+                        heji1 +=  (aaaaa.ShejiSumPriceneiye2.HasValue ? aaaaa.ShejiSumPriceneiye2.Value : 0) ;
+
+                    }
+
+
+
+
+                    pagination.heji1 = heji1;
+                }
+                   
+
+                if (!string.IsNullOrEmpty(Shejirenyuan))
+                {
+                    condition += " and ( oe.Shejirenyuan = " + Shejirenyuan + " or oe.Shejirenyuanneiye = " + Shejirenyuan + " or oe.Shejirenyuanneiye1 = " + Shejirenyuan + " or oe.Shejirenyuanneiye2 = " + Shejirenyuan + "  )";
+                }
+
+                return _dataBase.SelectModelPage<Model.EC_OrderBasic>(pagination, " ob.*,oe.BusinessManagerId,oe.shifouDelivery,oe.IsPrintfengqian,oe.DeliveryOrderId,oe.KaipiaoshenqingCreater,oe.KaipiaoshenqingTime,oe.KaipiaoquerenCreater,oe.KaipiaoquerenTime,oe.Kehuqianshou,oe.KehuqianshouCreater,oe.KehuqianshouTime  ,oe.Quchudingdan,oe.QuchudingdanCreater,oe.QuchudingdanTime,oe.PrintPackDeliveryRequir,oe.PrintNum,oe.ExigencyCaseId,oe.Duiyinghetongbianhao,oe.[Shejirenyuan],oe.[Shejileixing] ,oe.[Danshuangmian],oe.[Shejirenyuanneiye],oe.[Shejileixingneiye],oe.[Danshuangmianneiye],oe.[Shejiyaoqiu],oe.[Shejiyaoqiuneiye],oe.[ShejirenyuanName],oe.[ShejirenyuanNameneiye],oe.[ShejiStatus],oe.[shifoujiesuan],oe.[ShejileixingName],oe.[ShejileixingNameneiye],oe.[ShejiUnitPrice] ,oe.[ShejiSumPrice],oe.[ShejiUnitPriceneiye],oe.[ShejiSumPriceneiye] ,oe.[Shejicount],oe.[Shejicountneiye],oe.[ShejiUnitPriceneiye1]  ,oe.[ShejiSumPriceneiye1] ,oe.[Shejicountneiye1]  ,oe.[ShejiUnitPriceneiye2]  ,oe.[ShejiSumPriceneiye2] ,oe.[Shejicountneiye2] ,oe.[Shejirenyuanneiye1] ,oe.[ShejirenyuanNameneiye1] ,oe.[Shejileixingneiye1] ,oe.[ShejileixingNameneiye1] ,oe.[Danshuangmianneiye1] ,oe.[Shejiyaoqiuneiye1],oe.[Shejirenyuanneiye2],oe.[ShejirenyuanNameneiye2],oe.[Shejileixingneiye2] ,oe.[ShejileixingNameneiye2],oe.[Danshuangmianneiye2],oe.[Shejiyaoqiuneiye2] ,pt.PrintName as PrintTypeName ", "  EC_OrderBasic as ob Inner Join [EC_OrderExtend]  as oe On ob.Keyid=oe.Keyid   Left Join SysInquiry_PrintingType as pt On(ob.PrintTypeId=pt.Keyid) ", " ob.CreateTime desc", " CreateTime desc ", condition);
             }
             catch (Exception ex)
             {

--
Gitblit v1.9.1