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/obj/Release/VueWebApi.pdb                             |    0 
 /dev/null                                                       |    0 
 VueWebApi/Tools/ScanStartReport.cs                              |    4 ++--
 VueWebApi/obj/Release/Package/PackageTmp/bin/VueWebApi.pdb      |    0 
 VueWebApi/DLL/DAL/KanBanManagerentDAL.cs                        |    8 ++++----
 VueWebApi/obj/Release/VueWebApi.csproj.FileListAbsolute.txt     |    1 -
 VueWebApi/bin/VueWebApi.pdb                                     |    0 
 .vs/VueWebApi/v16/.suo                                          |    0 
 VueWebApi/DLL/DAL/ProductionManagementDAL.cs                    |   16 ++++++++--------
 VueWebApi/Properties/PublishProfiles/FolderProfile1.pubxml.user |   10 +++++-----
 10 files changed, 19 insertions(+), 20 deletions(-)

diff --git a/.vs/VueWebApi/v16/.suo b/.vs/VueWebApi/v16/.suo
index b99470c..856da78 100644
--- a/.vs/VueWebApi/v16/.suo
+++ b/.vs/VueWebApi/v16/.suo
Binary files differ
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";
diff --git a/VueWebApi/DLL/DAL/ProductionManagementDAL.cs b/VueWebApi/DLL/DAL/ProductionManagementDAL.cs
index cb55a30..6e4e477 100644
--- a/VueWebApi/DLL/DAL/ProductionManagementDAL.cs
+++ b/VueWebApi/DLL/DAL/ProductionManagementDAL.cs
@@ -579,7 +579,7 @@
                 var sql = @"select A.id, A.status,A.wotype,A.printcount,A.wo_code,A.materiel_code as partcode,B.partname,B.partspec,A.plan_qty,A.wkshp_code,C.org_name as wkshp_name,
                             A.route_code,E.name as route_name,A.stck_code,F.name as stck_name,A.plan_startdate,A.plan_enddate,A.piroque,A.sourceid,A.m_po,W.saleOrderCode,U.username as lm_user,A.lm_date
                             from TK_Wrk_Man A
-                            left join TKimp_Ewo W on A.m_po=W.wo and A.materiel_code=W.materiel_code
+                            left join TKimp_Ewo W on A.m_po=W.wo and A.materiel_code=W.materiel_code and A.sourceid=W.id
                             left join TMateriel_Info B on A.materiel_code=B.partcode
                             left join TOrganization C on A.wkshp_code=C.org_code
                             left join T_Sec_Stck D on A.stck_code=D.code 
@@ -662,7 +662,7 @@
                 var sql = @"select A.id, A.status,A.wotype,A.wo_code,A.materiel_code as partcode,B.partname,B.partspec,A.plan_qty,A.wkshp_code,C.org_name as wkshp_name,
                             A.route_code,E.name as route_name,A.stck_code,F.name as stck_name,A.plan_startdate,A.plan_enddate,A.piroque,A.sourceid,A.m_po,W.saleOrderCode,U.username as lm_user,A.lm_date,S.bad_qty
                             from TK_Wrk_Man A
-                            left join TKimp_Ewo W on A.m_po=W.wo and A.materiel_code=W.materiel_code
+                            left join TKimp_Ewo W on A.m_po=W.wo and A.materiel_code=W.materiel_code and A.sourceid=W.id
                             left join (select wo_code,sum(bad_qty) as bad_qty from  TK_Wrk_Step where bad_qty>0 group by wo_code) S on A.wo_code=S.wo_code
                             left join TMateriel_Info B on A.materiel_code=B.partcode
                             left join TOrganization C on A.wkshp_code=C.org_code
@@ -1686,7 +1686,7 @@
                         B.m_po,W.saleOrderCode
                         from TK_Wrk_Step A
                         left join TK_Wrk_Man B on A.wo_code=B.wo_code
-                        left join TKimp_Ewo W on B.m_po=W.wo and B.materiel_code=W.materiel_code
+                        left join TKimp_Ewo W on B.m_po=W.wo and B.materiel_code=W.materiel_code and B.sourceid=W.id
                         left join TMateriel_Info M on B.materiel_code=M.partcode
                         left join TStep S on A.step_code=S.stepcode
                         left join TOrganization F on B.wkshp_code=F.org_code
@@ -1809,7 +1809,7 @@
                             B.m_po,W.saleOrderCode
                             from TK_Wrk_Step A
                             left join TK_Wrk_Man B on A.wo_code=B.wo_code
-                            left join TKimp_Ewo W on B.m_po=W.wo and B.materiel_code=W.materiel_code
+                            left join TKimp_Ewo W on B.m_po=W.wo and B.materiel_code=W.materiel_code and B.sourceid=W.id
                             left join TMateriel_Info M on B.materiel_code=M.partcode
                             left join TStep S on A.step_code=S.stepcode
                             left join TOrganization F on B.wkshp_code=F.org_code
@@ -1922,7 +1922,7 @@
                         B.m_po,W.saleOrderCode
                         from TK_Wrk_Step A
                         left join TK_Wrk_Man B on A.wo_code=B.wo_code
-                        left join TKimp_Ewo W on B.m_po=W.wo and B.materiel_code=W.materiel_code
+                        left join TKimp_Ewo W on B.m_po=W.wo and B.materiel_code=W.materiel_code and B.sourceid=W.id
                         left join TMateriel_Info M on B.materiel_code=M.partcode
                         left join TStep S on A.step_code=S.stepcode
                         left join TOrganization F on B.wkshp_code=F.org_code
@@ -1995,7 +1995,7 @@
                         from TK_Wrk_Step A
                         left join  TStep T on A.step_code=T.stepcode
                         left join  TK_Wrk_Man M on A.wo_code=M.wo_code
-                        left join TKimp_Ewo W on M.m_po=W.wo and M.materiel_code=W.materiel_code
+                        left join TKimp_Ewo W on M.m_po=W.wo and M.materiel_code=W.materiel_code and M.sourceid=W.id
                         left join  TMateriel_Info P on M.materiel_code=P.partcode
                         where A.wo_code=@ordercode and A.step_code=@stepcode";
                 dynamicParams.Add("@ordercode", ordercode);
@@ -3537,7 +3537,7 @@
                             ,(select sum(S.ng_qty)  from TK_Wrk_Step S where S.wo_code=A.wo_code and S.isend='Y') as ng_qty
                             ,(select sum(S.bad_qty)  from TK_Wrk_Step S where S.wo_code=A.wo_code and S.isend='Y') as bad_qty
                             from TK_Wrk_Man A
-                            left join TKimp_Ewo W on A.m_po=W.wo and A.materiel_code=W.materiel_code
+                            left join TKimp_Ewo W on A.m_po=W.wo and A.materiel_code=W.materiel_code and A.sourceid=W.id
                             left join TMateriel_Info B on A.materiel_code=B.partcode
                             left join TOrganization C on A.wkshp_code=C.org_code
                             left join T_Sec_Stck D on A.stck_code=D.code 
@@ -5143,7 +5143,7 @@
                             inner join TK_Wrk_Step S on A.wo_code=S.wo_code and A.step_code=S.step_code
                             inner join TK_Wrk_Man M on S.wo_code=M.wo_code
                             inner join TMateriel_Info P on M.materiel_code=P.partcode
-                            left join TKimp_Ewo E on M.sourceid=E.id
+                            left join TKimp_Ewo E on M.sourceid=E.id 
                             left join T_Sec_Stck K on E.stck_code=K.code
                             where A.style='B' and S.isend='Y' and A.good_qty>0
                             union all
diff --git a/VueWebApi/Properties/PublishProfiles/FolderProfile1.pubxml.user b/VueWebApi/Properties/PublishProfiles/FolderProfile1.pubxml.user
index 4581722..77adb24 100644
--- a/VueWebApi/Properties/PublishProfiles/FolderProfile1.pubxml.user
+++ b/VueWebApi/Properties/PublishProfiles/FolderProfile1.pubxml.user
@@ -5,7 +5,7 @@
 <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <PropertyGroup>
     <_PublishTargetUrl>D:\缃戠珯鍙戝竷\MES姝f竻娌�</_PublishTargetUrl>
-    <History>True|2024-03-15T07:13:35.2362618Z;True|2023-11-22T10:45:30.7546341+08:00;True|2023-11-22T10:39:54.0192245+08:00;True|2023-11-20T10:49:12.5383967+08:00;True|2023-11-14T09:40:54.4312378+08:00;True|2023-11-14T09:40:10.8006338+08:00;True|2023-11-14T09:13:25.3929022+08:00;True|2023-11-14T09:10:50.7065424+08:00;True|2023-11-14T08:40:49.3427048+08:00;True|2023-11-13T17:14:18.8132307+08:00;True|2023-11-13T17:03:53.7755485+08:00;True|2023-11-13T16:59:15.1429785+08:00;True|2023-11-13T16:54:21.4762275+08:00;True|2023-11-13T16:11:03.4596175+08:00;True|2023-11-13T15:20:57.4191158+08:00;True|2023-11-10T13:01:23.2795198+08:00;True|2023-11-09T16:18:47.9473781+08:00;True|2023-11-09T14:46:45.7310735+08:00;True|2023-11-09T14:36:57.4272880+08:00;True|2023-11-02T18:28:55.6712926+08:00;True|2023-11-02T18:25:31.3074727+08:00;True|2023-11-02T16:25:20.2217266+08:00;True|2023-11-02T14:59:12.9729377+08:00;True|2023-11-02T14:03:21.3142180+08:00;True|2023-11-02T13:10:06.4259793+08:00;True|2023-11-02T13:04:59.2726100+08:00;True|2023-10-30T17:10:12.6270482+08:00;True|2023-10-30T14:52:35.6311299+08:00;True|2023-10-30T11:08:33.1712753+08:00;True|2023-10-13T12:07:07.3822225+08:00;True|2023-10-10T10:34:01.3167190+08:00;True|2023-10-10T10:28:48.9531906+08:00;True|2023-10-10T09:54:43.0218459+08:00;True|2023-10-10T09:43:57.3542420+08:00;True|2023-09-27T07:47:41.5372303+08:00;True|2023-09-21T18:22:16.9575605+08:00;True|2023-09-21T18:09:09.2828591+08:00;True|2023-09-21T17:57:05.3919457+08:00;True|2023-09-21T17:40:17.7722883+08:00;True|2023-09-21T17:24:20.7004108+08:00;True|2023-09-21T17:14:30.5230341+08:00;True|2023-09-21T15:14:11.3019288+08:00;True|2023-09-20T09:47:15.7375677+08:00;True|2023-09-12T14:37:37.0665432+08:00;True|2023-08-16T16:52:02.7063729+08:00;True|2023-08-11T10:35:11.9236725+08:00;True|2023-08-07T10:34:44.0844087+08:00;True|2023-08-07T10:28:56.2230477+08:00;True|2023-07-31T11:18:06.9546379+08:00;True|2023-07-03T10:38:22.8080444+08:00;True|2023-06-26T08:15:27.3611577+08:00;True|2023-06-25T15:36:41.8736654+08:00;True|2023-06-25T14:33:49.5287543+08:00;True|2023-06-13T10:24:59.6876648+08:00;</History>
+    <History>True|2024-03-29T02:46:12.2566656Z;True|2024-03-29T10:40:10.3715856+08:00;True|2024-03-28T16:16:12.1944105+08:00;True|2024-03-28T16:15:45.8310071+08:00;True|2024-03-15T15:13:35.2362618+08:00;True|2023-11-22T10:45:30.7546341+08:00;True|2023-11-22T10:39:54.0192245+08:00;True|2023-11-20T10:49:12.5383967+08:00;True|2023-11-14T09:40:54.4312378+08:00;True|2023-11-14T09:40:10.8006338+08:00;True|2023-11-14T09:13:25.3929022+08:00;True|2023-11-14T09:10:50.7065424+08:00;True|2023-11-14T08:40:49.3427048+08:00;True|2023-11-13T17:14:18.8132307+08:00;True|2023-11-13T17:03:53.7755485+08:00;True|2023-11-13T16:59:15.1429785+08:00;True|2023-11-13T16:54:21.4762275+08:00;True|2023-11-13T16:11:03.4596175+08:00;True|2023-11-13T15:20:57.4191158+08:00;True|2023-11-10T13:01:23.2795198+08:00;True|2023-11-09T16:18:47.9473781+08:00;True|2023-11-09T14:46:45.7310735+08:00;True|2023-11-09T14:36:57.4272880+08:00;True|2023-11-02T18:28:55.6712926+08:00;True|2023-11-02T18:25:31.3074727+08:00;True|2023-11-02T16:25:20.2217266+08:00;True|2023-11-02T14:59:12.9729377+08:00;True|2023-11-02T14:03:21.3142180+08:00;True|2023-11-02T13:10:06.4259793+08:00;True|2023-11-02T13:04:59.2726100+08:00;True|2023-10-30T17:10:12.6270482+08:00;True|2023-10-30T14:52:35.6311299+08:00;True|2023-10-30T11:08:33.1712753+08:00;True|2023-10-13T12:07:07.3822225+08:00;True|2023-10-10T10:34:01.3167190+08:00;True|2023-10-10T10:28:48.9531906+08:00;True|2023-10-10T09:54:43.0218459+08:00;True|2023-10-10T09:43:57.3542420+08:00;True|2023-09-27T07:47:41.5372303+08:00;True|2023-09-21T18:22:16.9575605+08:00;True|2023-09-21T18:09:09.2828591+08:00;True|2023-09-21T17:57:05.3919457+08:00;True|2023-09-21T17:40:17.7722883+08:00;True|2023-09-21T17:24:20.7004108+08:00;True|2023-09-21T17:14:30.5230341+08:00;True|2023-09-21T15:14:11.3019288+08:00;True|2023-09-20T09:47:15.7375677+08:00;True|2023-09-12T14:37:37.0665432+08:00;True|2023-08-16T16:52:02.7063729+08:00;True|2023-08-11T10:35:11.9236725+08:00;True|2023-08-07T10:34:44.0844087+08:00;True|2023-08-07T10:28:56.2230477+08:00;True|2023-07-31T11:18:06.9546379+08:00;True|2023-07-03T10:38:22.8080444+08:00;True|2023-06-26T08:15:27.3611577+08:00;True|2023-06-25T15:36:41.8736654+08:00;True|2023-06-25T14:33:49.5287543+08:00;True|2023-06-13T10:24:59.6876648+08:00;</History>
   </PropertyGroup>
   <ItemGroup>
     <File Include="Areas/HelpPage/HelpPage.css">
@@ -750,13 +750,13 @@
       <publishTime>12/24/2021 15:38:29</publishTime>
     </File>
     <File Include="bin/VueWebApi.dll">
-      <publishTime>03/15/2024 15:13:27</publishTime>
+      <publishTime>03/29/2024 10:46:03</publishTime>
     </File>
     <File Include="bin/VueWebApi.pdb">
-      <publishTime>03/15/2024 15:13:27</publishTime>
+      <publishTime>03/29/2024 10:46:03</publishTime>
     </File>
     <File Include="bin/VueWebApi.xml">
-      <publishTime>03/15/2024 15:13:27</publishTime>
+      <publishTime>03/29/2024 10:46:02</publishTime>
     </File>
     <File Include="bin/WebActivatorEx.dll">
       <publishTime>02/08/2013 16:42:28</publishTime>
@@ -1161,7 +1161,7 @@
       <publishTime>06/16/2022 13:39:23</publishTime>
     </File>
     <File Include="Web.config">
-      <publishTime>03/15/2024 15:13:34</publishTime>
+      <publishTime>03/29/2024 10:46:10</publishTime>
     </File>
   </ItemGroup>
 </Project>
\ No newline at end of file
diff --git a/VueWebApi/Tools/ScanStartReport.cs b/VueWebApi/Tools/ScanStartReport.cs
index 953c26f..4459f19 100644
--- a/VueWebApi/Tools/ScanStartReport.cs
+++ b/VueWebApi/Tools/ScanStartReport.cs
@@ -68,7 +68,7 @@
                         from TK_Wrk_Step A
                         left join  TStep T on A.step_code=T.stepcode
                         left join  TK_Wrk_Man M on A.wo_code=M.wo_code
-                        left join TKimp_Ewo W on M.m_po=W.wo and M.materiel_code=W.materiel_code
+                        left join TKimp_Ewo W on M.m_po=W.wo and M.materiel_code=W.materiel_code and M.sourceid=W.id
                         left join  TMateriel_Info P on M.materiel_code=P.partcode
                         left join  TOrganization L on M.wkshp_code=L.org_code
                         where A.wo_code=@ordercode and A.step_code=@stepcode";
@@ -850,7 +850,7 @@
                         from TK_Wrk_Step A
                         left join  TStep T on A.step_code=T.stepcode
                         left join  TK_Wrk_Man M on A.wo_code=M.wo_code
-                        left join TKimp_Ewo W on M.m_po=W.wo and M.materiel_code=W.materiel_code
+                        left join TKimp_Ewo W on M.m_po=W.wo and M.materiel_code=W.materiel_code and M.sourceid=W.id
                         left join  TMateriel_Info P on M.materiel_code=P.partcode
                         left join  TOrganization L on M.wkshp_code=L.org_code
                         where A.wo_code=@ordercode and A.step_code=@stepcode";
diff --git a/VueWebApi/bin/VueWebApi.pdb b/VueWebApi/bin/VueWebApi.pdb
index 98cd7f2..8e4c829 100644
--- a/VueWebApi/bin/VueWebApi.pdb
+++ b/VueWebApi/bin/VueWebApi.pdb
Binary files differ
diff --git a/VueWebApi/obj/Release/Package/PackageTmp/bin/VueWebApi.pdb b/VueWebApi/obj/Release/Package/PackageTmp/bin/VueWebApi.pdb
index 98cd7f2..8e4c829 100644
--- a/VueWebApi/obj/Release/Package/PackageTmp/bin/VueWebApi.pdb
+++ b/VueWebApi/obj/Release/Package/PackageTmp/bin/VueWebApi.pdb
Binary files differ
diff --git a/VueWebApi/obj/Release/VueWebApi.csproj.AssemblyReference.cache b/VueWebApi/obj/Release/VueWebApi.csproj.AssemblyReference.cache
deleted file mode 100644
index 64f3b1a..0000000
--- a/VueWebApi/obj/Release/VueWebApi.csproj.AssemblyReference.cache
+++ /dev/null
Binary files differ
diff --git a/VueWebApi/obj/Release/VueWebApi.csproj.FileListAbsolute.txt b/VueWebApi/obj/Release/VueWebApi.csproj.FileListAbsolute.txt
index 44908df..64afa43 100644
--- a/VueWebApi/obj/Release/VueWebApi.csproj.FileListAbsolute.txt
+++ b/VueWebApi/obj/Release/VueWebApi.csproj.FileListAbsolute.txt
@@ -868,7 +868,6 @@
 D:\鏂板嚡杩狹ES\MES椤圭洰\MES姝f竻娌砛VueWebApi\VueWebApi\bin\zh-Hans\System.Web.WebPages.resources.dll
 D:\鏂板嚡杩狹ES\MES椤圭洰\MES姝f竻娌砛VueWebApi\VueWebApi\bin\zh-Hans\System.Web.WebPages.Deployment.resources.dll
 D:\鏂板嚡杩狹ES\MES椤圭洰\MES姝f竻娌砛VueWebApi\VueWebApi\bin\zh-Hans\System.Web.WebPages.Razor.resources.dll
-D:\鏂板嚡杩狹ES\MES椤圭洰\MES姝f竻娌砛VueWebApi\VueWebApi\obj\Release\VueWebApi.csproj.AssemblyReference.cache
 D:\鏂板嚡杩狹ES\MES椤圭洰\MES姝f竻娌砛VueWebApi\VueWebApi\obj\Release\VueWebApi.csproj.CoreCompileInputs.cache
 D:\鏂板嚡杩狹ES\MES椤圭洰\MES姝f竻娌砛VueWebApi\VueWebApi\obj\Release\VueWebApi.csproj.CopyComplete
 D:\鏂板嚡杩狹ES\MES椤圭洰\MES姝f竻娌砛VueWebApi\VueWebApi\obj\Release\VueWebApi.dll
diff --git a/VueWebApi/obj/Release/VueWebApi.pdb b/VueWebApi/obj/Release/VueWebApi.pdb
index 98cd7f2..8e4c829 100644
--- a/VueWebApi/obj/Release/VueWebApi.pdb
+++ b/VueWebApi/obj/Release/VueWebApi.pdb
Binary files differ

--
Gitblit v1.9.3