From c3b14901031d985ef750027d4952264369a1d7b0 Mon Sep 17 00:00:00 2001
From: duhe <226547893@qq.com>
Date: 星期一, 02 三月 2026 10:26:21 +0800
Subject: [PATCH] 1

---
 WebAPI/DLL/ClsSb_EquipRepairWorkBill.cs |   38 +++++++++++++++++++++++++-------------
 1 files changed, 25 insertions(+), 13 deletions(-)

diff --git a/WebAPI/DLL/ClsSb_EquipRepairWorkBill.cs b/WebAPI/DLL/ClsSb_EquipRepairWorkBill.cs
index b550f8c..6fa4673 100644
--- a/WebAPI/DLL/ClsSb_EquipRepairWorkBill.cs
+++ b/WebAPI/DLL/ClsSb_EquipRepairWorkBill.cs
@@ -207,8 +207,10 @@
                  omodel.HMainSourceBillType+"',"+ omodel.HMainSourceInterID.ToString()+","+ omodel.HMainSourceEntryID.ToString() +
                 ",'"+ omodel.HRepairCategory + "','" + omodel.HUrgenLevel + "','" + omodel.HRepairer + "','" + omodel.HIsCapacityImpact + "') ");
                 //鎻掑叆瀛愯〃
+                
                 foreach (Models.ClsSb_EquipRepairWorkBillSub oSub in DetailColl)
                 {
+                    
                     string sql1 = string.Format(@"Insert into Sb_EquipRepairWorkBillSub " +
                        " (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" +
                        ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
@@ -216,22 +218,27 @@
                        ") values("
                        + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HCloseMan + "','" + oSub.HEntryCloseDate + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'" +
                        "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() +
-                      "," + oSub.HRepairID.ToString() + ",'" + oSub.HManagerID.ToString() + "','" + oSub.HRepairExplanation + "'," + oSub.HEmpID.ToString() +
+                      "," + oSub.HRepairID.ToString() + "," + oSub.HManagerID.ToString() + ",'" + oSub.HRepairExplanation + "'," + oSub.HEmpID.ToString() +
                        ")");
-                    oCn.RunProc("Insert into Sb_EquipRepairWorkBillSub " +
-                       " (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" +
-                       ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
-                       ",HRepairID,HManagerID,HRepairExplanation,HEmpID" +
-                       ") values("
-                       + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HCloseMan + "','" + oSub.HEntryCloseDate + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'" +
-                       "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() +
-                      "," + oSub.HRepairID.ToString() + ",'"+ oSub.HManagerID.ToString() + "','" + oSub.HRepairExplanation + "'," + oSub.HEmpID.ToString() +
-                       ") ");
+                    //oCn.RunProc("Insert into Sb_EquipRepairWorkBillSub " +
+                    //   " (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" +
+                    //   ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
+                    //   ",HRepairID,HManagerID,HRepairExplanation,HEmpID" +
+                    //   ") values("
+                    //   + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HCloseMan + "','" + oSub.HEntryCloseDate + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'" +
+                    //   "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() +
+                    //  "," + oSub.HRepairID.ToString() + ",'" + oSub.HManagerID.ToString() + "','" + oSub.HRepairExplanation + "'," + oSub.HEmpID.ToString() +
+                    //   ") ");
+                    oCn.RunProc(sql1);
+
                 }
+
+
 
                 foreach (Model.ClsSb_EquipRepairWorkBillSub_Mater oSub in DetailColl_Mater)
                 {
-                    oCn.RunProc("Insert into Sb_EquipRepairWorkBillSub_Mater " +
+                
+                    string sql = String.Format(@"Insert into Sb_EquipRepairWorkBillSub_Mater " +
                       " (HInterID,HEntryID," +
                       "HCloseMan,HEntryCloseDate,HCloseType,HRemark," +
                       "HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney," +
@@ -241,8 +248,13 @@
                       ",'" + oSub.HCloseMan + "','" + oSub.HEntryCloseDate + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'" +
                       "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() +
                       "," + oSub.HQty.ToString() + "," + oSub.HMaterID.ToString() + "," + oSub.HUnitID.ToString() + "," + oSub.HQtyMust.ToString() +
-                      "," + oSub.HManagerID.ToString() + ") ");
+                      "," + oSub.HManagerID.ToString() + ")");
+                    oCn.RunProc(sql);
+                 
+                
+                
                 }
+
                 //
                 //foreach (Model.ClsSb_EquipRepairWorkBillSub oSub in DetailColl)
                 //{
@@ -258,7 +270,7 @@
                 //
 
                 //=========================淇濆瓨鍚庢帶鍒�  
-                DataSet ds2 = oCn.RunProcReturn("Exec h_p_Sb_EquipRepairWorkBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + $"',{omodel.HMainSourceBillType}", "h_p_Sb_EquipRepairWorkBill_AfterSaveCtrl");
+                DataSet ds2 = oCn.RunProcReturn("Exec h_p_Sb_EquipRepairWorkBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + $"',1", "h_p_Sb_EquipRepairWorkBill_AfterSaveCtrl");
                 if (ds2 == null)
                 {
                     sReturn = "淇濆瓨鍚庢帶鍒跺垽鏂け璐ワ紒";

--
Gitblit v1.9.1