From 7cce3c1dbda47d04067ab78a6eebcdbbca9ba246 Mon Sep 17 00:00:00 2001
From: zrg <z18737863051@163.com>
Date: 星期五, 28 二月 2025 09:21:08 +0800
Subject: [PATCH] 1
---
WebAPI/Controllers/CJGL/Cj_SingleStationController.cs | 69 ++++++++++++++++++++++++++++------
1 files changed, 56 insertions(+), 13 deletions(-)
diff --git a/WebAPI/Controllers/CJGL/Cj_SingleStationController.cs b/WebAPI/Controllers/CJGL/Cj_SingleStationController.cs
index 9a53e47..99408a2 100644
--- a/WebAPI/Controllers/CJGL/Cj_SingleStationController.cs
+++ b/WebAPI/Controllers/CJGL/Cj_SingleStationController.cs
@@ -183,14 +183,31 @@
if (ds.Tables[0].Rows.Count == 0)//鏂板
{
- //涓昏〃
- oCN.RunProc(@"Insert Into Sc_QualityReportBillMain
-(HBillType,HBillSubType,HBillStatus,HInterID,HBillNo,HDate
-,HYear,HPeriod,HRemark,HMaker,HMakeDate
-,HEmpID,HGroupID,HDeptID,HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo)
+ if (HResult== "寰憰鍝�")
+ {
+ //涓昏〃
+ oCN.RunProc(@"Insert Into Sc_QualityReportBillMain
+ (HBillType,HBillSubType,HBillStatus,HInterID,HBillNo,HDate
+ ,HYear,HPeriod,HRemark,HMaker,HMakeDate
+ ,HEmpID,HGroupID,HDeptID,HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo)
+ values('3717','3717-1',1," + HInterID + ",'" + HBillNo + "','" + HDate + "'" +
+ "," + DateTime.Now.Year + "," + DateTime.Now.Month + ",'" + HRemark + "','" + HMaker + "',getdate()" +
+ ",'" + HEmpID + "'," + HGroupID + "," + HDeptID + "," + HMainSourceInterID + "," + HMainSourceEntryID + ",'" + HMainSourceBillNo + "') ");
+ //閲嶆柊缁橦Result璧嬪��
+ HResult = "";
+ }
+ else
+ {
+ //涓昏〃
+ oCN.RunProc(@"Insert Into Sc_QualityReportBillMain
+ (HBillType,HBillSubType,HBillStatus,HInterID,HBillNo,HDate
+ ,HYear,HPeriod,HRemark,HMaker,HMakeDate
+ ,HEmpID,HGroupID,HDeptID,HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo)
values('3717','3717',1," + HInterID + ",'" + HBillNo + "','" + HDate + "'" +
- "," + DateTime.Now.Year + "," + DateTime.Now.Month + ",'" + HRemark + "','" + HMaker + "',getdate()" +
- ",'" + HEmpID + "'," + HGroupID + "," + HDeptID + "," + HMainSourceInterID + "," + HMainSourceEntryID + ",'" + HMainSourceBillNo + "') ");
+ "," + DateTime.Now.Year + "," + DateTime.Now.Month + ",'" + HRemark + "','" + HMaker + "',getdate()" +
+ ",'" + HEmpID + "'," + HGroupID + "," + HDeptID + "," + HMainSourceInterID + "," + HMainSourceEntryID + ",'" + HMainSourceBillNo + "') ");
+ }
+
}
@@ -280,18 +297,32 @@
(HInterID,HENTRYID,HBillNo_bak,HEmpID,HBarCode,HBadReasonID,HAddr,HMaker,HMakeDate
,HMaterID,HUnitID,HRemark,HSourceID,HICMOInterID,HICMOEntryID,HICMOBillNo,HReportType
,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney
-,HQty,HResult,HProcExchInterID,HProcExchEntryID,HProcExchBillNo)
+,HQty,HResult,HProcExchInterID,HProcExchEntryID,HProcExchBillNo,HProcID)
values({HInterID},1,'{oSub.HBillNo_bak}',{oSub.HEmpID},'{oSub.HBarCode}',{oSub.HBadReasonID},'','{oSub.HMaker}','{oSub.HMakeDate}'
,{oSub.HMaterID},{oSub.HUnitID},'{oSub.HRemark}',{oSub.HSourceID},{oSub.HICMOInterID},{oSub.HICMOEntryID},'{oSub.HICMOBillNo}',{oSub.HReportType}
,0,0,'','',0,0
-,1,'{HResult}',{oSub.HProcExchInterID},{oSub.HProcExchEntryID},'{oSub.HProcExchBillNo}')");
+,1,'{HResult}',{oSub.HProcExchInterID},{oSub.HProcExchEntryID},'{oSub.HProcExchBillNo}',{oSub.HProcID})");
//淇敼鏉$爜琛ㄧ殑鐘舵��
oCN.RunProc("update Gy_BarCodeBill set HStatus='"+ HResult + "' where HBarCode='"+ oSub.HBarCode + "'");
//淇敼鍑虹珯鍗曠殑 涓嶈壇 鎶ュ簾鏁伴噺
- if (HResult == "涓嶈壇") {
- oCN.RunProc("update Sc_StationOutBillMain set HBadCount+=1 where HProcExchBillNo='" + oSub.HProcExchBillNo + "' and HProcID=" + oSub.HProcID + " and HInterID=" + linterid);
+ if (HResult == "涓嶈壇" && (oSub.HBadTypeID == 3 || oSub.HBadTypeID == 4 || oSub.HBadTypeID == 6))
+ {
+ //宸ュ簾
+ if (oSub.HBadTypeID == 3)
+ {
+ oCN.RunProc("update Sc_StationOutBillMain set HBadCount+=1,HWasterQty_Work+=1 where HProcExchBillNo='" + oSub.HProcExchBillNo + "' and HProcID=" + oSub.HProcID + " and HInterID=" + linterid);
+ }//鏂欏簾
+ else if (oSub.HBadTypeID == 4)
+ {
+ oCN.RunProc("update Sc_StationOutBillMain set HBadCount+=1,HWasterQty_Mater+=1 where HProcExchBillNo='" + oSub.HProcExchBillNo + "' and HProcID=" + oSub.HProcID + " and HInterID=" + linterid);
+ }//杩斿伐
+ else if (oSub.HBadTypeID == 6)
+ {
+ oCN.RunProc("update Sc_StationOutBillMain set HBadCount+=1,HBackWorkQty+=1 where HProcExchBillNo='" + oSub.HProcExchBillNo + "' and HProcID=" + oSub.HProcID + " and HInterID=" + linterid);
+ }
+
}
else if (HResult == "鎶ュ簾")
{
@@ -1657,8 +1688,20 @@
if (dataSet.Tables[0].Rows.Count > 0)
{
string HOutInterID = dataSet.Tables[0].Rows[0][0].ToString();
-
- oCN.RunProc("update Sc_StationOutBillMain set HBadCount-=1 where HInterID='" + HOutInterID + "'");
+ //鏂帿灏旂殑鎯呭喌 鍒� 宸ュ簾鏂欏簾 杩斿伐
+ //宸ュ簾
+ if (subLsit[0].HBadTypeID == 3)
+ {
+ oCN.RunProc("update Sc_StationOutBillMain set HBadCount-=1,HWasterQty_Work-=1 where HInterID='" + HOutInterID + "'");
+ }//鏂欏簾
+ else if (subLsit[0].HBadTypeID == 4)
+ {
+ oCN.RunProc("update Sc_StationOutBillMain set HBadCount-=1,HWasterQty_Mater-=1 where HInterID='" + HOutInterID + "'");
+ }//杩斿伐
+ else if (subLsit[0].HBadTypeID == 6)
+ {
+ oCN.RunProc("update Sc_StationOutBillMain set HBadCount-=1,HBackWorkQty-=1 where HInterID='" + HOutInterID + "'");
+ }
}
else
{
--
Gitblit v1.9.1