From 9c634fd767aec36ef97c3a814bf7a29c67d20ee1 Mon Sep 17 00:00:00 2001
From: yl <ykxkd@outlook.com>
Date: 星期五, 29 三月 2024 10:57:35 +0800
Subject: [PATCH] 修改单据重复显示问题,增加工单源单id关联

---
 VueWebApi/DLL/DAL/KanBanManagerentDAL.cs |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/VueWebApi/DLL/DAL/KanBanManagerentDAL.cs b/VueWebApi/DLL/DAL/KanBanManagerentDAL.cs
index 65943ae..aadb785 100644
--- a/VueWebApi/DLL/DAL/KanBanManagerentDAL.cs
+++ b/VueWebApi/DLL/DAL/KanBanManagerentDAL.cs
@@ -57,7 +57,7 @@
                 if (shopcode != null || shopcode != "") //浜х嚎缂栫爜涓嶄负绌�
                 {
                     string[] selects = Array.ConvertAll<string, string>(shopcode.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries), s => s.ToString()); //string鍒嗗壊杞瑂tring[] 
-                    //鏌ヨ浜х嚎涓嬪凡寮�宸ョ殑鍔犲伐鍗曚俊鎭�
+                    //鏌ヨ浜х嚎涓嬪凡寮�宸ョ殑鍔犲伐鍗曚俊鎭�(褰撳勾)
                     sql = @"select *  from ( 
                                     select distinct E.saleOrderCode,A.wo_code,P.plan_qty,M.partcode,M.partname,M.partspec,T.name as uomname,S.good_qty,S.ng_qty,S.bad_qty   from TK_Wrk_Record A
                                     inner join TK_Wrk_Man P on A.wo_code=P.wo_code
@@ -67,7 +67,7 @@
                                     left join (
                                       select wo_code,sum(good_qty) as good_qty,sum(ng_qty) as ng_qty,sum(bad_qty) as bad_qty  from TK_Wrk_Step where isend='Y' group by wo_code
                                     ) S on P.wo_code=S.wo_code
-                                    where P.status<>'CLOSED' and P.status<>'NEW' and P.wkshp_code in @shopcode and A.style='S' and A.step_seq='1'
+                                    where P.status<>'CLOSED' and P.status<>'NEW' and P.wkshp_code in @shopcode and A.style='S' and A.step_seq='1' and year(P.lm_date) = YEAR(GETDATE())
                                     ) as AA where AA.plan_qty>=(AA.good_qty+aa.bad_qty+AA.ng_qty)";
                     var data0 = DapperHelper.selectlist(sql, new { shopcode = selects.ToArray() });
 
@@ -159,7 +159,7 @@
             string[] selects = Array.ConvertAll<string, string>(shopcode.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries), s => s.ToString()); //string鍒嗗壊杞瑂tring[] 
             try
             {
-                //鑾峰彇浠诲姟鍒楄〃淇℃伅
+                //鑾峰彇浠诲姟鍒楄〃淇℃伅(褰撳勾)
                 sql = @"select A.*,ROW_NUMBER() OVER(ORDER BY (case when A.warning<=2 then A.planenddate end) asc ,A.planstartdate asc) AS RowNum from(
                          select  A.status,A.lm_date,E.saleOrderCode,A.wo_code,M.partcode,M.partname,M.partspec,U.name,
                          A.plan_qty,B.good_qty,B.ng_qty,E.planstartdate,E.planenddate, datediff(day,getdate(),E.planenddate) warning
@@ -169,7 +169,7 @@
                          left  join TMateriel_Info M on A.materiel_code=M.partcode
                          left  join TUom U on M.uom_code=U.code
                          where A.status<>'CLOSED' and A.wkshp_code in @shopcode and A.is_delete<>'1' and B.isend='Y'
-                         and A.plan_qty>=(B.good_qty+B.ng_qty+B.bad_qty)
+                         and A.plan_qty>=(B.good_qty+B.ng_qty+B.bad_qty) and year(A.lm_date) = YEAR(GETDATE())
                          )as A ";
                 var data = DapperHelper.selectlist(sql, new { shopcode = selects.ToArray() });
                 mes.code = "200";

--
Gitblit v1.9.3