From 7bf9e584d675d250165439a32c52530db271ee99 Mon Sep 17 00:00:00 2001
From: zrg <z1873@LAPTOP-EAVL132E>
Date: 星期五, 12 九月 2025 08:33:43 +0800
Subject: [PATCH] 1

---
 WebAPI/DLL/ClsSc_MESStopRestoreWorkBill.cs |   93 +++++++++++++++++++---------------------------
 1 files changed, 39 insertions(+), 54 deletions(-)

diff --git a/WebAPI/DLL/ClsSc_MESStopRestoreWorkBill.cs b/WebAPI/DLL/ClsSc_MESStopRestoreWorkBill.cs
index f578dc3..8e3013f 100644
--- a/WebAPI/DLL/ClsSc_MESStopRestoreWorkBill.cs
+++ b/WebAPI/DLL/ClsSc_MESStopRestoreWorkBill.cs
@@ -185,8 +185,33 @@
             {
                 //
                 oCn.BeginTran();
+
+                omodel.HSourceBillNo_Main = omodel.HMainSourceBillNo;
+                omodel.HSourceBillType_Main = omodel.HMainSourceBillType;
+                omodel.HSourceEntryID_Main = omodel.HMainSourceEntryID;
+                omodel.HSourceInterID_Main = omodel.HMainSourceInterID;
+                // 淇濆瓨鍓嶅鐞�
+                if (!BeforeSave(omodel.HInterID, omodel.HICMOInterID, omodel.HICMOEntryID, omodel.HICMOBillNo, 1, omodel.HSourceID, ref sReturn))
+                {
+                    return false;
+                }
                 //鏇存柊涓昏〃
-                string sql = generateSQLReflection(omodel, "update", "HInterID");
+                string sql = $@"update Sc_MESStopRestoreWorkBillMain set 
+                HPrintQty = {omodel.HPrintQty},HICMOInterID = {omodel.HICMOInterID},HICMOEntryID = {omodel.HICMOEntryID},
+                HICMOBillNo = '{omodel.HICMOBillNo}',HProcExchInterID = {omodel.HProcExchInterID},
+                HProcExchEntryID = {omodel.HProcExchEntryID},HProcExchBillNo = '{omodel.HProcExchBillNo}',
+                HSourceInterID_Main = {omodel.HSourceInterID_Main},HSourceEntryID_Main = {omodel.HSourceEntryID_Main},
+                HSourceBillNo_Main = '{omodel.HSourceBillNo_Main}',HSourceBillType_Main = '{omodel.HSourceBillType_Main}',
+                HMaterID = {omodel.HMaterID},HProcID = {omodel.HProcID},HBeginWorkTime = '{omodel.HBeginWorkTime}',
+                HSourceID = {omodel.HSourceID},HGroupID = {omodel.HGroupID},HDeptID = {omodel.HGroupID},
+                HEmpID = {omodel.HEmpID},HStopReason = '{omodel.HStopReason}',HReportType = '{omodel.HReportType}',
+                HBarCodeMakeDate = '{omodel.HBarCodeMakeDate}',HYear = '{omodel.HYear}',HPeriod = {omodel.HPeriod},
+                HBillType = '{omodel.HBillType}',HBillSubType = '{omodel.HBillSubType}',HDate = '{omodel.HDate}',
+                HCheckItemNowID = {omodel.HCheckItemNowID} ,HCheckItemNextID = {omodel.HCheckItemNextID},
+                HCheckFlowID = {omodel.HCheckFlowID},HRemark = '{omodel.HRemark}',HUpDater = '{omodel.HUpDater}',HUpDateDate = getdate(),
+                HMainSourceBillNo = '{omodel.HMainSourceBillNo}',HMainSourceBillType = '{omodel.HMainSourceBillNo}',
+                HMainSourceInterID = {omodel.HMainSourceInterID},HMainSourceEntryID = {omodel.HMainSourceEntryID}
+                 where HInterID = ${omodel.HInterID}";
                 oCn.RunProcReturn(sql, MvarItemKey);
                 //鍒犻櫎鍏宠仈
                 DeleteRelation(ref sReturn, lngBillKey);
@@ -209,33 +234,14 @@
                     //  "," + oSub.HDotCheckItemID.ToString() + ",'" + oSub.HDotCheckItem + "','" + oSub.HDotCheckPart + "','" + oSub.HClaim + "'," + oSub.HManagerID.ToString() +
                     //  ") ");
                 }
-                //foreach (Model.ClsSc_MESStopRestoreWorkBillSub_Item oSub2 in DetailColl1)
-                //{
-                //    oCn.RunProc("Insert into Sc_MESStopWorkBillSub_Item " +
-                //      " (HInterID,HBillNo_bak,HEntryID,HCloseMan" +
-                //      ",HEntryCloseDate,HCloseType,HRemark,HSourceInterID" +
-                //      ",HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
-                //      ",HMaintainItemID,HMaintainItem,HMaintainPart,HClaim,HManagerID" +
 
-                //      ") values("
-                //      + omodel.HInterID.ToString() + ",'" + oSub2.HBillNo_bak + "'," + oSub2.HEntryID.ToString() + ",'" + oSub2.HCloseMan + "'" +
-                //      ",getdate()," + Convert.ToString(oSub2.HCloseType ? 1 : 0) + ",'" + oSub2.HRemark + "'," + oSub2.HSourceInterID.ToString() +
-                //      "," + oSub2.HSourceEntryID.ToString() + ",'" + oSub2.HSourceBillNo + "','" + oSub2.HSourceBillType + "'," + oSub2.HRelationQty.ToString() + "," + oSub2.HRelationMoney.ToString() +
-                //      "," + oSub2.HMaintainItemID.ToString() + ",'" + oSub2.HMaintainItem + "','" + oSub2.HMaintainPart + "','" + oSub2.HClaim + "'," + oSub2.HManagerID.ToString() +
-                //      ") ");
-                //}
-                //
-                //foreach (Model.ClsSc_MESStopRestoreWorkBillSub oSub in DetailColl)
-                //{
-                //    Ds = oCn.RunProcReturn("exec h_p_Sc_MESStopWorkBill_Qty " + oSub.HICMOInterID, "");
-                //    if (Ds.Tables[0].Rows.Count == 0)
-                //        return;
-                //    if (DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBool"]) == "Y")
-                //    {
-                //        sReturn = "姹囨姤鏁伴噺瓒呰繃璁″垝鏁伴噺锛佷笉鍏佽淇濆瓨";
-                //        return false;
-                //    }
-                //}
+                //淇濆瓨鍚庢帶鍒�
+                if (!AfterSave(omodel.HInterID, omodel.HICMOInterID, omodel.HICMOEntryID, omodel.HICMOBillNo, 2, ref sReturn))
+                {
+                    oCn.RollBack();
+                    return false;
+                }
+
                 sReturn = "淇敼鍗曟嵁鎴愬姛锛�";
                 oCn.Commit();
                 return true;
@@ -315,34 +321,13 @@
                     //  "," + oSub.HDotCheckItemID.ToString() + ",'" + oSub.HDotCheckItem + "','" + oSub.HDotCheckPart + "','" + oSub.HClaim + "'," + oSub.HManagerID.ToString() +
                     //  ") ");
                 }
-                //foreach (Model.ClsSc_MESStopRestoreWorkBillSub_Item oSub2 in DetailColl1)
-                //{
-                //    oCn.RunProc("Insert into Sc_MESStopWorkBillSub_Item " +
-                //      " (HInterID,HBillNo_bak,HEntryID,HCloseMan" +
-                //      ",HEntryCloseDate,HCloseType,HRemark,HSourceInterID" +
-                //      ",HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
-                //      ",HMaintainItemID,HMaintainItem,HMaintainPart,HClaim,HManagerID" +
 
-                //      ") values("
-                //      + omodel.HInterID.ToString() + ",'" + oSub2.HBillNo_bak + "'," + oSub2.HEntryID.ToString() + ",'" + oSub2.HCloseMan + "'" +
-                //      ",getdate()," + Convert.ToString(oSub2.HCloseType ? 1 : 0) + ",'" + oSub2.HRemark + "'," + oSub2.HSourceInterID.ToString() +
-                //      "," + oSub2.HSourceEntryID.ToString() + ",'" + oSub2.HSourceBillNo + "','" + oSub2.HSourceBillType + "'," + oSub2.HRelationQty.ToString() + "," + oSub2.HRelationMoney.ToString() +
-                //      "," + oSub2.HMaintainItemID.ToString() + ",'" + oSub2.HMaintainItem + "','" + oSub2.HMaintainPart + "','" + oSub2.HClaim + "'," + oSub2.HManagerID.ToString() +
-                //      ") ");
-                //}
-                //
-                //foreach (Model.ClsSc_MESStopRestoreWorkBillSub oSub in DetailColl)
-                //{
-                //    Ds = oCn.RunProcReturn("exec h_p_Sc_MESStopWorkBill_Qty " + oSub.HICMOInterID, "");
-                //    if (Ds.Tables[0].Rows.Count == 0)
-                //        return;
-                //    if (DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBool"]) == "Y")
-                //    {
-                //        sReturn = "姹囨姤鏁伴噺瓒呰繃璁″垝鏁伴噺锛佷笉鍏佽淇濆瓨";
-                //        return false;
-                //    }
-                //}
-                //
+                //淇濆瓨鍚庢帶鍒�
+                if (!AfterSave(omodel.HInterID, omodel.HICMOInterID, omodel.HICMOEntryID, omodel.HICMOBillNo, 1, ref sReturn))
+                {
+                    oCn.RollBack();
+                    return false;
+                }
 
                 // 淇濆瓨鍚庡鐞�
                 sReturn = omodel.HInterID.ToString(); ;

--
Gitblit v1.9.1