From 2496d33f31d0eedfdd81d54fc5547aa3541549e4 Mon Sep 17 00:00:00 2001
From: zrg <z1873@LAPTOP-EAVL132E>
Date: 星期二, 06 一月 2026 13:00:32 +0800
Subject: [PATCH] 优化单品过站增加子表保存

---
 WebAPI/Controllers/CJGL/Cj_SingleStationController.cs |   28 ++++++++++++++--------------
 1 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/WebAPI/Controllers/CJGL/Cj_SingleStationController.cs b/WebAPI/Controllers/CJGL/Cj_SingleStationController.cs
index bd7fe67..bc1f3fa 100644
--- a/WebAPI/Controllers/CJGL/Cj_SingleStationController.cs
+++ b/WebAPI/Controllers/CJGL/Cj_SingleStationController.cs
@@ -1728,11 +1728,11 @@
                     ds = oCN.RunProcReturn("select * from Sc_SourceLineRepairBillSub_Mater where HInterID=" + model.HInterID+ " order by HEntryID  desc", "Sc_SourceLineRepairBillSub_Mater");
 
                     oCN.RunProc($@"insert into Sc_SourceLineRepairBillSub_Mater
-(HInterID,HEntryID,HBillNo_bak,HRemark,HSourceInterID
-,HSourceEntryID,HSourceBillNo,HSourceBillType,HMaterID
-,HUnitID,HBarCode,HBatchNo )values
-({model.HInterID},{(ds.Tables[0].Rows.Count == 0 ? 1 : int.Parse(ds.Tables[0].Rows[0]["HEntryID"].ToString()) + 1)},'{model.HBillNo}','',{temp.HProcExchInterID}
-,{temp.HProcExchEntryID},'{temp.HProcExchBillNo}','',{temp.HMaterID},0,'{temp.HBarCode}','{temp.HBatchNo}')");
+                    (HInterID,HEntryID,HBillNo_bak,HRemark,HSourceInterID
+                    ,HSourceEntryID,HSourceBillNo,HSourceBillType,HMaterID
+                    ,HUnitID,HBarCode,HBatchNo )values
+                    ({model.HInterID},{(ds.Tables[0].Rows.Count == 0 ? 1 : int.Parse(ds.Tables[0].Rows[0]["HEntryID"].ToString()) + 1)},'{model.HBillNo}','',{temp.HProcExchInterID}
+                    ,{temp.HProcExchEntryID},'{temp.HProcExchBillNo}','',{temp.HMaterID},0,'{temp.HBarCode}','{temp.HBatchNo}')");
 
                     //淇敼浜х嚎杩芥函鍗曠粦瀹氱殑鏉$爜鎵瑰彿
                     oCN.RunProc("update Sc_AssemblyBillSub set HBarCode='" + temp.HBarCode + "' where HInterID=" + temp.HInterID + " and HEntryID=" + temp.HEntryID);
@@ -1743,21 +1743,21 @@
                     model = JsonConvert.DeserializeObject<Model.ClsSc_SourceLineRepairBillMain>(sMainStr);
 
                     oCN.RunProc($@"insert into Sc_SourceLineRepairBillMain(HYear, HPeriod, HBillType, HBillSubType, HInterID,
-HDate, HBillNo, HBillStatus, HRemark, HEmpID, HDeptID, HSourceID, HProdOrgID, HMaterID, HWorkStationID,
-HProcess, HIPAddr, HMacAddr, HProdMac, HBarCode,HMaker,HMakeDate,HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo)
-values('{DateTime.Now.Year}','{DateTime.Now.Month}','3748','3748',{model.HInterID}
-,getdate(),'{model.HBillNo}','1','{HResult}',{model.HEmpID},{model.HDeptID},{model.HSourceID},{model.HProdOrgID},{model.HMaterID},0
-,{model.HProcess},'','','','{model.HBarCode}','{user}',getdate(),{model.HICMOInterID},{model.HICMOEntryID},'{model.HICMOBillNo}')");
+                    HDate, HBillNo, HBillStatus, HRemark, HEmpID, HDeptID, HSourceID, HProdOrgID, HMaterID, HWorkStationID,
+                    HProcess, HIPAddr, HMacAddr, HProdMac, HBarCode,HMaker,HMakeDate,HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo)
+                    values('{DateTime.Now.Year}','{DateTime.Now.Month}','3748','3748',{model.HInterID}
+                    ,getdate(),'{model.HBillNo}','1','{HResult}',{model.HEmpID},{model.HDeptID},{model.HSourceID},{model.HProdOrgID},{model.HMaterID},0
+                    ,{model.HProcess},'','','','{model.HBarCode}','{user}',getdate(),{model.HICMOInterID},{model.HICMOEntryID},'{model.HICMOBillNo}')");
 
                     List<Model.ClsSc_SourceLineRepairBillSub> subLsit = new List<Model.ClsSc_SourceLineRepairBillSub>();
                     sMainStr = "[" + sMainStr + "]";
                     subLsit = JsonConvert.DeserializeObject<List<Model.ClsSc_SourceLineRepairBillSub>>(sMainStr);
 
                     oCN.RunProc($@"insert into Sc_SourceLineRepairBillSub
-(HInterID,HEntryID,HBillNo_bak,HRemark,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType
-,HBadReasonID,HBadTypeID,HBadResultID,HBadProcID,HRepairResult,HCreator,HCreateDate)
-values({model.HInterID},1,'{model.HBillNo}','',{subLsit[0].HProcExchInterID},{subLsit[0].HProcExchEntryID},'{subLsit[0].HProcExchBillNo}',''
-,{subLsit[0].HBadReasonID},{subLsit[0].HBadTypeID},{subLsit[0].HBadResultID},{model.HBadProcID},'{HResult}','{subLsit[0].HCreator}',getdate())");
+                    (HInterID,HEntryID,HBillNo_bak,HRemark,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType
+                    ,HBadReasonID,HBadTypeID,HBadResultID,HBadProcID,HRepairResult,HCreator,HCreateDate)
+                    values({model.HInterID},1,'{model.HBillNo}','{model.HRemark}',{subLsit[0].HProcExchInterID},{subLsit[0].HProcExchEntryID},'{subLsit[0].HProcExchBillNo}',''
+                    ,{subLsit[0].HBadReasonID},{subLsit[0].HBadTypeID},{subLsit[0].HBadResultID},{model.HBadProcID},'{HResult}','{subLsit[0].HCreator}',getdate())");
 
                     if (HResult == "OK")
                     {

--
Gitblit v1.9.1