From 916f6b186e8eb682143e548db0d326bf1d96ffcc Mon Sep 17 00:00:00 2001
From: zrg <z18737863051@163.com>
Date: 星期四, 04 一月 2024 17:31:56 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API

---
 WebAPI/DLL/ClsSc_ICMOReportBill.cs |   18 +++++++++++-------
 1 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/WebAPI/DLL/ClsSc_ICMOReportBill.cs b/WebAPI/DLL/ClsSc_ICMOReportBill.cs
index 80e3a4e..227fb56 100644
--- a/WebAPI/DLL/ClsSc_ICMOReportBill.cs
+++ b/WebAPI/DLL/ClsSc_ICMOReportBill.cs
@@ -83,7 +83,7 @@
                       "HCloseMan,HCloseType,HRemark," +
                       "HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
                       ",HSeOrderInterID,HSeOrderEntryID,HSeOrderBillNo" +
-                      ",HICMOInterID,HICMOBillNo,HBarCode" +
+                      ",HICMOInterID,HICMOBillNo,HBarCode,HICMOEntryID" +
                       ") values("
                       + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + "," + oSub.HMaterID.ToString() + ",'" + oSub.HMaterNumber +"'"+
                       "," + oSub.HQty.ToString() + "," + oSub.HUnitID.ToString() + ",'" + oSub.HUnitNumber + "'," + oSub.HTimes.ToString() + "," + oSub.HSourceID.ToString() +
@@ -91,7 +91,7 @@
                       ",'" + oSub.HCloseMan + "'," + 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.HSeOrderInterID.ToString() + "," + oSub.HSeOrderEntryID.ToString() + ",'" + oSub.HSeOrderBillNo + "'" +
-                      "," + oSub.HICMOInterID.ToString() + ",'" + oSub.HICMOBillNo + "','" + oSub.HBarCode + "'" +
+                      "," + oSub.HICMOInterID.ToString() + ",'" + oSub.HICMOBillNo + "','" + oSub.HBarCode + "'," + oSub.HICMOEntryID +
                       ") ");
                 }
                 if (omodel.HCheckType == "鍚堟牸")
@@ -528,6 +528,7 @@
             }
             catch (Exception e)
             {
+                oCn.RollBack();
                 sReturn = e.Message;
                 throw (e);
             }
@@ -563,15 +564,18 @@
             {
                 oCn.BeginTran();
                 //鏌ヨ鐢熶骇姹囨姤鍗曡〃鏁伴噺
-                DataSet ds = oCn.RunProcReturn("select a.HBillNo,b.HSourceInterID,b.HSourceEntryID  from Sc_ICMOReportBillMain a inner join Sc_ICMOReportBillSub b on a.HInterID = b.HInterID where a.HInterID = '" + lngBillKey + "'", "Sc_ICMOReportBillMain");
+                DataSet ds = oCn.RunProcReturn("select a.HBillNo,b.HICMOInterID,b.HICMOEntryID  from Sc_ICMOReportBillMain a inner join Sc_ICMOReportBillSub b on a.HInterID = b.HInterID where a.HInterID = '" + lngBillKey + "'", "Sc_ICMOReportBillMain");
                 string HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString();
-                string HSourceInterID = ds.Tables[0].Rows[0]["HSourceInterID"].ToString();
-                string HSourceEntryID = ds.Tables[0].Rows[0]["HSourceEntryID"].ToString();
+                string HICMOInterID = ds.Tables[0].Rows[0]["HICMOInterID"].ToString();
+                string HICMOEntryID = ds.Tables[0].Rows[0]["HICMOEntryID"].ToString();
                 //
                 //鏇存柊浜ч噺姹囨姤涓存椂琛ㄦ槸鍚︽姤妫�鐢宠鐘舵��
-                string sql1 = string.Format(@"update Sc_ICMOBillWorkQtyStatus_Tmp set HRelationInterID='0' where HICMOReportBillNo='"+ HBillNo + "' and HICMOInterID='"+ HSourceInterID + "' and HICMOEntryID='"+ HSourceEntryID + "'");
+                string sql1 = string.Format(@"update Sc_ICMOBillWorkQtyStatus_Tmp set HRelationInterID='0',HRelationEntryID='0',HICMOReportBillNo=null where HICMOReportBillNo='" + HBillNo + "' and HICMOInterID='"+ HICMOInterID + "' and HICMOEntryID='"+ HICMOEntryID + "'");
                 oCn.RunProc(sql1);
-
+                //鏇存柊璐ㄩ噺姹囨姤涓存椂琛ㄦ槸鍚︽姤妫�鐢宠鐘舵��
+                string sql2 = string.Format(@"update Sc_ICMOBillQualityStatus_Tmp set HRelationInterID='0',HRelationBillNo='' where HRelationBillNo='" + HBillNo + "' and HRelationInterID='" + lngBillKey + "'");
+                oCn.RunProc(sql2);
+              
                 //鍒犻櫎鍏宠仈
                 DeleteRelation(ref sReturn, lngBillKey);
                 //鍒犻櫎鏄庣粏琛�

--
Gitblit v1.9.1