From c50c286df3108ce4a48674f15f29954fb3e4cb7f Mon Sep 17 00:00:00 2001
From: username@email.com <yzy2002yzy@163.com>
Date: 星期一, 22 十二月 2025 12:15:37 +0800
Subject: [PATCH] 送货计划增加“完成情况:全部、已送、未送”查询条件,默认“未送”

---
 CY_ECommercePlatform/CY.BLL/OA/CoreDeliverOrderBLL.cs |   48 +++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 37 insertions(+), 11 deletions(-)

diff --git a/CY_ECommercePlatform/CY.BLL/OA/CoreDeliverOrderBLL.cs b/CY_ECommercePlatform/CY.BLL/OA/CoreDeliverOrderBLL.cs
index d93cda7..040e438 100644
--- a/CY_ECommercePlatform/CY.BLL/OA/CoreDeliverOrderBLL.cs
+++ b/CY_ECommercePlatform/CY.BLL/OA/CoreDeliverOrderBLL.cs
@@ -164,9 +164,28 @@
         /// <param name="pa"></param>
         /// <returns></returns>
         public IEnumerable<CoreDeliverOrder> SelectModelPage(Pagination pa, Guid FirmId, int? DriverId, string shipAddress,
-            string BuyerName, string createTimeStart, string createTimeEnd)
+            string BuyerName, string createTimeStart, string createTimeEnd, string OrderState)
         {
-            string Condition = " and b.FirmId ='" + FirmId + "' and a.OrderState = 0 ";
+            string Condition = " and b.FirmId ='" + FirmId + "' and b.DeliverState != 2 ";
+
+            if (!string.IsNullOrEmpty(OrderState))
+            {
+                if (OrderState != "4")
+                {
+                    Condition += " and  a.OrderState = " + OrderState + " ";
+                }
+                else
+                {
+                    Condition += " and a.OrderState  in( 0,1 ) ";
+                }
+            }
+            else
+            {
+                Condition += " and a.OrderState  in( 0,1,2 ) ";
+
+
+            }
+
             if (DriverId.HasValue)
             {
                var oA_Staff  = staffBLL.GetModelByKeyid(DriverId);
@@ -174,10 +193,10 @@
             }
               
             if (!string.IsNullOrEmpty(shipAddress))
-                Condition += " and  b.shipAddress = '" + shipAddress + "'";
+                Condition += " and  b.shipAddress like '%" + shipAddress + "%'";
            
             if (!string.IsNullOrEmpty(BuyerName))
-                Condition += " and  c.BuyerName like '%" + BuyerName + "%'";
+                Condition += " and  c.Keyid  = '" + BuyerName + "'";
             
 
             if (!string.IsNullOrEmpty(createTimeStart))
@@ -193,7 +212,7 @@
             {
                 new Criterion("", Condition),
 
-                new Criterion("orderBy"," MakeTime desc  ")
+                new Criterion("orderBy"," MakeTime ")
             };
             query.Criteria = criterias;
             return _ICoreDeliverOrderDAL.SelectModelPage(query, pa);
@@ -213,7 +232,14 @@
 
             if (!string.IsNullOrEmpty(OrderState))
             {
-                Condition += " and  a.OrderState = " + OrderState + " ";
+                if (OrderState != "4")
+                {
+                    Condition += " and  a.OrderState = " + OrderState + " ";
+                }
+                else
+                {
+                    Condition += " and a.OrderState  in( 0,1 ) ";
+                }
             }
             else
             {
@@ -235,17 +261,17 @@
             }
 
             if (!string.IsNullOrEmpty(shipAddress))
-                Condition += " and  b.shipAddress = '" + shipAddress + "'";
+                Condition += " and  b.shipAddress like '%" + shipAddress + "%'";
 
             if (!string.IsNullOrEmpty(BuyerName))
-                Condition += " and  c.BuyerName like '%" + BuyerName + "%'";
+                Condition += " and  c.Keyid  = '" + BuyerName + "'";
 
 
             if (!string.IsNullOrEmpty(createTimeStart))
-                Condition += " and DATEDIFF(day,a.[MakeTime],'" + createTimeStart + "')<=0 ";
+                Condition += " and DATEDIFF(day,a.[OverTime],'" + createTimeStart + "')<=0 ";
 
             if (!string.IsNullOrEmpty(createTimeEnd))
-                Condition += " and DATEDIFF(day,a.[MakeTime],'" + createTimeEnd + "')>=0 ";
+                Condition += " and DATEDIFF(day,a.[OverTime],'" + createTimeEnd + "')>=0 ";
 
 
 
@@ -254,7 +280,7 @@
             {
                 new Criterion("", Condition),
 
-                new Criterion("orderBy"," MakeTime desc  ")
+                new Criterion("orderBy"," OverTime desc  ")
             };
             query.Criteria = criterias;
             return _ICoreDeliverOrderDAL.SelectModelPage(query, pa);

--
Gitblit v1.9.1