From 146fa02f2ff92f9687fc9e099e2e812f785e04b1 Mon Sep 17 00:00:00 2001
From: zzr99 <1940172413@qq.com>
Date: 星期一, 25 四月 2022 13:32:32 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API

---
 WebAPI/Controllers/SCGL/日计划管理/Sc_WorkBillSortBillController.cs |   44 +++++++++++++++++++++++++++++++++++---------
 1 files changed, 35 insertions(+), 9 deletions(-)

diff --git a/WebAPI/Controllers/SCGL/Sc_WorkBillSortBillController.cs "b/WebAPI/Controllers/SCGL/\346\227\245\350\256\241\345\210\222\347\256\241\347\220\206/Sc_WorkBillSortBillController.cs"
similarity index 76%
rename from WebAPI/Controllers/SCGL/Sc_WorkBillSortBillController.cs
rename to "WebAPI/Controllers/SCGL/\346\227\245\350\256\241\345\210\222\347\256\241\347\220\206/Sc_WorkBillSortBillController.cs"
index c04e494..fbf08e6 100644
--- a/WebAPI/Controllers/SCGL/Sc_WorkBillSortBillController.cs
+++ "b/WebAPI/Controllers/SCGL/\346\227\245\350\256\241\345\210\222\347\256\241\347\220\206/Sc_WorkBillSortBillController.cs"
@@ -138,14 +138,34 @@
                 else if (OperationType == 3)
                 {
                     //淇敼
-                    oCN.RunProc("UpDate Gy_WorkWarehouseBillMain set  " +
-                " HOrgId='" + omdelMian.HPRDORGID + "'" +
-                ",HUpDater='" + omdelMian.HMaker + "'" +
-                ",HUpDateDate='" + DateTime.Now + "'" +
-                " where HInterID=" + omdelMian.HInterID.ToString());
-
-                    //鍒犻櫎瀛愯〃
-                    oCN.RunProc("delete from Gy_WorkWarehouseBillMainSub where HInterID='" + omdelMian.HInterID.ToString() + "' and HEntryID='" + hentryid + "'");
+                    oCN.RunProc($"update Sc_WorkBillSortBillMain set HUpDater='{omdelMian.HMaker}',HUpDateDate=GETDATE()" +
+                                  $", HRemark='{omdelMian.HRemark}', HPrintQty={(omdelMian.HPrintQty == null ? 0 : omdelMian.HPrintQty)}" +
+                                  $", HDeptID={omdelMian.HDeptID}, HSeOrderBillNo='{omdelMian.HSeOrderBillNo}', HSourceQty= {(omdelMian.HSourceQty == null ? 0 : omdelMian.HSourceQty)}" +
+                                  $", HInStockQty={(omdelMian.HInStockQty == null ? 0 : omdelMian.HInStockQty)}, HMaterID={omdelMian.HMaterID}" +
+                                  $", HMaterName= '{omdelMian.HMaterName}', HMaterModel= '{omdelMian.HMaterModel}', HGroupID={omdelMian.HGroupID}" +
+                                  $", HWorkShopID={omdelMian.HWorkShopID}, HRelationQty={(omdelMian.HRelationQty == null ? 0 : omdelMian.HRelationQty)}" +
+                                  $", HUnitID={omdelMian.HUnitID}, HWorkerID={omdelMian.HWorkerID}, HSourceID={omdelMian.HSourceID}" +
+                                  $", HBeginWorkTimes={(omdelMian.HBeginWorkTimes == null ? 0 : omdelMian.HBeginWorkTimes)}, HInStockOwnerTypeID= '{omdelMian.HInStockOwnerTypeID}'" +
+                                  $", HSplitRelationQty={(omdelMian.HSplitRelationQty == null ? 0 : omdelMian.HSplitRelationQty)}, HOrderLev='{omdelMian.HOrderLev}'" +
+                                  $", HWorkQty={(omdelMian.HWorkQty == null ? 0 : omdelMian.HWorkQty)}" +
+                                  $", HSplitPlanQty={(omdelMian.HSplitPlanQty == null ? 0 : omdelMian.HSplitPlanQty)}, HOwnerTypeID='{omdelMian.HOwnerTypeID}'" +
+                                  $", HPlanBeginDate= '{omdelMian.HPlanBeginDate}', HPlanEndDate='{omdelMian.HPlanEndDate}', HICMOBillNo='{omdelMian.HICMOBillNo}'" +
+                                  $", HOwnerID={omdelMian.HOwnerID}, HBatchNo='{omdelMian.HBatchNo}', HYX={(omdelMian.HYX == null ? 0 : omdelMian.HYX)}" +
+                                  $", HProdTimes={(omdelMian.HProdTimes == null ? 0 : omdelMian.HProdTimes)}, HEntrustORGID={omdelMian.HEntrustORGID}" +
+                                  $", HPlanQty={(omdelMian.HPlanQty == null ? 0 : omdelMian.HPlanQty)}, HPreparatDate='{omdelMian.HPreparatDate}'" +
+                                  $", HOrderNeedQty={(omdelMian.HOrderNeedQty == null ? 0 : omdelMian.HOrderNeedQty)}, HOrderCommitDate='{omdelMian.HOrderCommitDate}'" +
+                                  $", HCompleteQty={(omdelMian.HCompleteQty == null ? 0 : omdelMian.HCompleteQty)}" +
+                                  $", HSeOrderBillQty={(omdelMian.HSeOrderBillQty == null ? 0 : omdelMian.HSeOrderBillQty)}, HICMOInterID={(omdelMian.HICMOInterID == null ? 0 : omdelMian.HICMOInterID)}" +
+                                  $", HKTQ={(omdelMian.HKTQ == null ? 0 : omdelMian.HKTQ)}, HStockInORGID={(omdelMian.HStockInORGID == null ? 0 : omdelMian.HStockInORGID)}" +
+                                  $", HDayPlanSumQty={(omdelMian.HDayPlanSumQty == null ? 0 : omdelMian.HDayPlanSumQty)}" +
+                                  $", HSourceBillNo='{omdelMian.HSourceBillNo}', HICMOEntryID={(omdelMian.HICMOEntryID == null ? 0 : omdelMian.HICMOEntryID)}" +
+                                  $", HMainInterID={(omdelMian.HMainInterID == null ? 0 : omdelMian.HMainInterID)}, HProdORGID={omdelMian.HProdORGID}" +
+                                  $", HLeftPlanQty={(omdelMian.HLeftPlanQty == null ? 0 : omdelMian.HLeftPlanQty)}" +
+                                  $", HEmpID={(omdelMian.HEmpID == null ? 0 : omdelMian.HEmpID)}, HInStockOwnerID={omdelMian.HInStockOwnerID}, HICMOEntrySEQ={(omdelMian.HICMOEntrySEQ == null ? 0 : omdelMian.HICMOEntrySEQ)}" +
+                                  $", HICMOBillType='{omdelMian.HICMOBillType}', HCloseCount={(omdelMian.HCloseCount == null ? 0 : omdelMian.HCloseCount)}" +
+                                  $", HOrderType= '{omdelMian.HOrderType}', HSplitQty={(omdelMian.HSplitQty == null ? 0 : omdelMian.HSplitQty)}, HSourceStockInQty={(omdelMian.HSourceStockInQty == null ? 0 : omdelMian.HSourceStockInQty)}" +
+                                  $", HPriority={(omdelMian.HPriority == null ? 0 : omdelMian.HPriority)}, HLocked='{(omdelMian.HLocked == true ? 1 : 0)}'" +
+                                  $", HHangUp='{(omdelMian.HHangUp == true ? 1 : 0)}' where HInterID={omdelMian.HInterID}");
                 }
                 //淇濆瓨瀛愯〃
                 objJsonResult = AddBillSub(msg3, hentryid);
@@ -176,6 +196,12 @@
 
         public json AddBillSub(string msg3, int hentryid)
         {
+            //鑾峰彇琛ㄦ牸鏁版嵁
+            ds = oCN.RunProcReturn($"select * from  h_v_JIT_Sc_WorkBillSortBillList where 鍗曟嵁鍙�='{omdelMian.HBillNo}'", "h_v_JIT_Sc_WorkBillSortBillList");
+
+            //鍒犻櫎瀛愯〃
+            oCN.RunProc("delete from Sc_WorkBillSortBillSub where HInterID='" + omdelMian.HInterID.ToString() + "' and HEntryID='" + hentryid + "'");
+
             omodelsub = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Sc_WorkBillSortBillSub>>(msg3);
             int i = 1;
             //鎻掑叆瀛愯〃
@@ -185,7 +211,7 @@
                             ", HRptFinishQty, HTimes, HUseTimes, HBTimes, HETimes" +
                             ", HDateSub, HCloseMan, HEntryCloseDate, HCloseTypeSub, HColumn" +
                             ", HLockedSub, HComplete, HStatusTag, HIsHandModify)" +
-                            $"values({omdelMian.HInterID}, {(hentryid == -1 ? i : hentryid)}, '{oSub.HRemark}', '{oSub.HMasterDate}', {(oSub.HQty == null ? 0: oSub.HQty)}" +
+                            $"values({omdelMian.HInterID}, {(hentryid == -1 ? i : omodelsub.Count==1? hentryid:i==1? hentryid:(i+ds.Tables[0].Rows.Count-1))}, '{oSub.HRemark}', '{oSub.HMasterDate}', {(oSub.HQty == null ? 0: oSub.HQty)}" +
                             $", {(oSub.HRptFinishQty == null ? 0: oSub.HRptFinishQty)}, {(oSub.HTimes == null ? 0: oSub.HTimes)}, {(oSub.HUseTimes == null ? 0: oSub.HUseTimes)}, '{oSub.HBTimes}', '{oSub.HETimes}'" +
                             $", '{oSub.HDateSub}', '{oSub.HCloseMan}', '{oSub.HEntryCloseDate}', {(oSub.HCloseTypeSub == true ? 1 : 0)}, '{oSub.HColumn}'" +
                             $", '{(oSub.HLockedSub == true ? 1 : 0)}', '{oSub.HComplete}', '{(oSub.HStatusTag == true ? 1 : 0)}', '{(oSub.HIsHandModify == true ? 1 : 0)}')");

--
Gitblit v1.9.1