From 4c4634e03c9f77dc9762063b071d8ea236bb2ad8 Mon Sep 17 00:00:00 2001
From: YL <YL@LAPTOP-SE03PLUR>
Date: 星期六, 24 七月 2021 00:35:15 +0800
Subject: [PATCH] 制作通用的单据编辑样例模块(生产汇报单列表/编辑),以方便其他开发人员可以借鉴。

---
 WebAPI/Properties/PublishProfiles/FolderProfile.pubxml.user |    6 +++---
 WebAPI/Controllers/SCGL/Sc_QualityReportBillController.cs   |    2 +-
 WebAPI/DLL/ClsSc_ICMOReportBill.cs                          |    7 +++++++
 WebAPI/Models/ClsSc_ICMOReportBillMain.cs                   |    1 -
 WebAPI/Controllers/SCGL/Sc_MESBeginWorkBillController.cs    |   15 ++++++++-------
 5 files changed, 19 insertions(+), 12 deletions(-)

diff --git a/WebAPI/Controllers/SCGL/Sc_MESBeginWorkBillController.cs b/WebAPI/Controllers/SCGL/Sc_MESBeginWorkBillController.cs
index de9c845..5f205ba 100644
--- a/WebAPI/Controllers/SCGL/Sc_MESBeginWorkBillController.cs
+++ b/WebAPI/Controllers/SCGL/Sc_MESBeginWorkBillController.cs
@@ -602,7 +602,7 @@
                 DataSet ds0 = oCN.RunProcReturn("select HPRDORGID,HDeptID from Sc_ICMOBillMain where HBillNo='"+ workcode + "'", "Sc_ICMOBillMain");
 
                 //鏌ヨ浜ч噺姹囨姤涓存椂琛�
-                ds = oCN.RunProcReturn("select top1* from Sc_ICMOBillWorkQtyStatus_Tmp where HICMOReportInterID='"+ HInterID + "' and HICMOReportBillNo='" + ScMaxWork + "'", "Sc_ICMOBillWorkQtyStatus_Tmp");
+                ds = oCN.RunProcReturn("select top 1 * from  Sc_ICMOBillWorkQtyStatus_Tmp where HICMOReportInterID='" + HInterID + "' and HICMOReportBillNo='" + ScMaxWork + "'", "Sc_ICMOBillWorkQtyStatus_Tmp");
                 if (ds.Tables[0].Rows.Count <= 0) 
                 {
                     objJsonResult.code = "0";
@@ -611,24 +611,25 @@
                     objJsonResult.data = null;
                     return objJsonResult;
                 }
-                //璋冪敤WebService鏈嶅姟
+               
                 WebS.ClsSc_ICMOReportBillMain model = new WebS.ClsSc_ICMOReportBillMain();
                 model.HInterID = HInterID;
                 model.HBillNo = ScMaxWork;
-                model.HYear= DBUtility.ClsPub.isLong(DateTime.Now.Year);
-                model.HPeriod = DBUtility.ClsPub.isLong(DateTime.Now.Month);
+                //model.HYear= DBUtility.ClsPub.isLong(DateTime.Now.Year);
+                //model.HPeriod = DBUtility.ClsPub.isLong(DateTime.Now.Month);
+                model.HDate = DateTime.Now;
                 model.HRemark = "";
                 model.HMaker = HMaker;
                 model.HEmpID = 0;
                 model.HGroupID = DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0]["HGroupID"]);
                 model.HDeptID= DBUtility.ClsPub.isLong(ds0.Tables[0].Rows[0]["HDeptID"]);
-                model.HPRDORGID = DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0]["HPRDORGID"]);
+                model.HPRDORGID = DBUtility.ClsPub.isLong(ds0.Tables[0].Rows[0]["HPRDORGID"]);
                 WebS.WebService1 oWebs = new WebS.WebService1();
                 bool flag=oWebs.set_SaveICMOProductReportBill_Layui(model, sHSourceType, ref DBUtility.ClsPub.sErrInfo);
                 if (flag)
                 {
-                    objJsonResult.code = "0";
-                    objJsonResult.count = 0;
+                    objJsonResult.code = "1";
+                    objJsonResult.count = 1;
                     objJsonResult.Message = "淇濆瓨鎴愬姛锛�";
                     objJsonResult.data = 1;
                 }
diff --git a/WebAPI/Controllers/SCGL/Sc_QualityReportBillController.cs b/WebAPI/Controllers/SCGL/Sc_QualityReportBillController.cs
index bf583a6..8ac3bfc 100644
--- a/WebAPI/Controllers/SCGL/Sc_QualityReportBillController.cs
+++ b/WebAPI/Controllers/SCGL/Sc_QualityReportBillController.cs
@@ -263,7 +263,7 @@
                     oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now);
                     oItemSub.HCloseType = false;   //鍏抽棴绫诲瀷
                     //oItemSub.HRemark = "";         //澶囨敞
-                    oItemSub.HSourceInterID = 0;     // 婧愬崟涓诲唴鐮�
+                    oItemSub.HSourceInterID =0;     // 婧愬崟涓诲唴鐮�
                     oItemSub.HSourceEntryID = 0;   //婧愬崟瀛愬唴鐮�
                     //oItemSub.HSourceBillNo = "";  //婧愬崟鍗曞彿
                     //oItemSub.HSourceBillType = ""; //婧愬崟绫诲瀷
diff --git a/WebAPI/DLL/ClsSc_ICMOReportBill.cs b/WebAPI/DLL/ClsSc_ICMOReportBill.cs
index d42b486..45c7003 100644
--- a/WebAPI/DLL/ClsSc_ICMOReportBill.cs
+++ b/WebAPI/DLL/ClsSc_ICMOReportBill.cs
@@ -51,6 +51,11 @@
                 ",HUpDater='" + omodel.HMaker + "'" +
                 ",HUpDateDate=getdate()" +
                 //========================================
+                ",HMainSourceBillNo='" + omodel.HMainSourceBillNo + "'" +
+                ",HMainSourceInterID=" + omodel.HMainSourceInterID.ToString() +
+                ",HMainSourceEntryID=" + omodel.HMainSourceEntryID.ToString() +
+                ",HMainSourceBillType=" + omodel.HMainSourceBillType.ToString() +
+
                 ",HDeptID=" + omodel.HDeptID.ToString() +
                 ",HDeptNumber='" + omodel.HDeptNumber +"'"+
                 ",HEmpID=" + omodel.HEmpID.ToString() +
@@ -150,10 +155,12 @@
                 "(HBillType,HBillSubType,HInterID,HBillNo,HDate,HMaker,HMakeDate" + 
                 ",HYear,HPeriod,HRemark,HEmpID,HEmpNumber" +
                 ",HGroupID,HDeptID,HDeptNumber" +
+                ",HMainSourceBillNo,HMainSourceInterID,HMainSourceEntryID,HMainSourceBillType" +
                 ") " +
                 " values('" + this.BillType + "','"  + this.HBillSubType + "'," +omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "','" + omodel.HMaker+ "',getdate()" +
                 "," + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "','" + omodel.HEmpID.ToString() + "','" + omodel.HEmpNumber +
                 "','" + omodel.HGroupID.ToString() + "'," + omodel.HDeptID.ToString() + ",'" + omodel.HDeptNumber + "'"+
+                "','" + omodel.HMainSourceBillNo.ToString() + "'," + omodel.HMainSourceInterID.ToString() + ",'" + omodel.HMainSourceEntryID + "','" + omodel.HMainSourceBillType + "'" +
                 ") ");
                 //鎻掑叆瀛愯〃
                 foreach (Models.ClsSc_ICMOReportBillSub oSub in DetailColl)
diff --git a/WebAPI/Models/ClsSc_ICMOReportBillMain.cs b/WebAPI/Models/ClsSc_ICMOReportBillMain.cs
index 306ef40..f1740fe 100644
--- a/WebAPI/Models/ClsSc_ICMOReportBillMain.cs
+++ b/WebAPI/Models/ClsSc_ICMOReportBillMain.cs
@@ -14,6 +14,5 @@
         public string HCheckType;
         public Int64 HPrintQty;
         public string HWorkShift;
-        
     }
 }
diff --git a/WebAPI/Properties/PublishProfiles/FolderProfile.pubxml.user b/WebAPI/Properties/PublishProfiles/FolderProfile.pubxml.user
index 88b258d..5be70d0 100644
--- a/WebAPI/Properties/PublishProfiles/FolderProfile.pubxml.user
+++ b/WebAPI/Properties/PublishProfiles/FolderProfile.pubxml.user
@@ -162,10 +162,10 @@
       <publishTime>11/24/2014 11:18:48</publishTime>
     </File>
     <File Include="bin/WebAPI.dll">
-      <publishTime>07/21/2021 21:08:19</publishTime>
+      <publishTime>07/24/2021 00:11:41</publishTime>
     </File>
     <File Include="bin/WebAPI.pdb">
-      <publishTime>07/21/2021 21:08:19</publishTime>
+      <publishTime>07/24/2021 00:11:41</publishTime>
     </File>
     <File Include="bin/WebGrease.dll">
       <publishTime>07/17/2013 17:03:52</publishTime>
@@ -336,7 +336,7 @@
       <publishTime>07/21/2021 21:02:08</publishTime>
     </File>
     <File Include="Web.config">
-      <publishTime>07/21/2021 21:08:25</publishTime>
+      <publishTime>07/24/2021 00:11:47</publishTime>
     </File>
   </ItemGroup>
 </Project>
\ No newline at end of file

--
Gitblit v1.9.1