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 | 101 +++++++++++++++++++++++++++++++++++++++++---------
1 files changed, 82 insertions(+), 19 deletions(-)
diff --git a/WebAPI/Controllers/CJGL/Cj_SingleStationController.cs b/WebAPI/Controllers/CJGL/Cj_SingleStationController.cs
index 076d216..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
-,0,'{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 == "鎶ュ簾")
{
@@ -322,9 +353,23 @@
objJsonResult.data = null;
return objJsonResult;
}
-
+ string HProcID = "0";
ds = oCN.RunProcReturn("select * from gy_czygl WITH(NOLOCK) where czymc='" + user + "'", "gy_czygl");
- string HProcID = ds.Tables[0].Rows[0]["HProcID"].ToString();
+ if (ds.Tables[0].Rows.Count > 0)
+ {
+ HProcID = ds.Tables[0].Rows[0]["HProcID"].ToString();
+ }
+
+ //鍒ゆ柇褰撳墠娴佽浆鍗℃槸鍚︽槸寮�宸�
+ ds = oCN.RunProcReturn("select * from Sc_ICMOBillStatus_Tmp where HSourceBillNo='" + HBarCode + "' and HICMOStatus<>'0'", "Sc_ICMOBillStatus_Tmp");
+ if (ds.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗″彿:" + HBarCode + ",娴佽浆鍗℃湭寮�宸�!";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
ds = oCN.RunProcReturn(@"exec h_p_Gy_BarCodeBillBomList '" + HBarCode + "'," + HProcID, "h_p_Gy_BarCodeBillBomList");
if (ds.Tables[0].Rows.Count == 0)
@@ -571,7 +616,7 @@
sMainStr = "[" + sMainStr + "]";
List<StationBill> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<StationBill>>(sMainStr);
- ds = oCN.RunProcReturn("select HCenterID from Sc_ProcessExchangeBillSub WITH(NOLOCK) where HInterID=" + list[0].HProcExchInterID + " and HEntryID=" + list[0].HProcExchEntryID, "Sc_ProcessExchangeBillSub");
+ ds = oCN.RunProcReturn("select HCenterID from Sc_ProcessExchangeBillSub WITH(NOLOCK) where HInterID=" + list[0].HProcExchInterID + " and HEntryID=" + list[0].HProcExchEntryID, "Sc_ProcessExchangeBillSub");
if (ds.Tables[0].Rows.Count > 0)
{
list[0].HCenterID = long.Parse(ds.Tables[0].Rows[0]["HCenterID"].ToString());
@@ -645,7 +690,13 @@
double HmaterOutqty = 0;//鐧藉澂鍙戝竷
double HProcPriceRate = 0;//宸ヤ环绯绘暟
int HTemporaryAreaID = 0;//鏆傛斁鍖�
+ int HShiftsID = 0;
+ DataSet set = oCN.RunProcReturn("exec h_p_Gy_GetWorkShiftInfo " + HDeptID + "," + HCenterID, "h_p_Gy_GetWorkShiftInfo");
+ if (set.Tables[0].Rows.Count > 0)
+ {
+ HShiftsID = int.Parse(set.Tables[0].Rows[0]["HInterID"].ToString());
+ }
ds = oCN.RunProcReturn("select * from Sc_StationOutBillMain a WITH(NOLOCK) left join Sc_StationOutBillSub_SN sn WITH(NOLOCK) on a.HInterID=sn.HInterID where a.HInterID=" + HInterID + " and HBillNo='" + HBillNo + "' and CONVERT(varchar(10),HDate,20) ='" + DateTime.Now.ToString("yyyy-MM-dd") + "' ", "Sc_StationOutBillMain");
if (ds.Tables[0].Rows.Count == 0)
@@ -662,9 +713,9 @@
",HSupID,HQty,HPrice,HMoney,HBadCount,HCenterID,HProcNo,HOrderProcNO,HSourceNameList" +
",HMainSourceInterID,HMainSourceBillNo,HMainSourceBillType,HLastSubProc" +
",HEmpID2,HEmpID3,HEmpID4,HEmpID5,HDSQty,HChongQty,HPriceRate,HWorkTimes,HQCCheckID,HMainInterID,HPRDOrgID" +
- ",HmaterOutqty,HProcPriceRate,HTemporaryAreaID" +
+ ",HmaterOutqty,HProcPriceRate,HTemporaryAreaID,HShiftsID" +
") " +
- " values('" + BillType + "','"+ HBillSubType + "'," + HInterID + ",'" + HBillNo + "'," + HBillStatus + ",getdate(),'" + HMaker + "',getdate(),'" + HMouldNum + "'" +
+ " values('" + BillType + "','" + HBillSubType + "'," + HInterID + ",'" + HBillNo + "'," + HBillStatus + ",getdate(),'" + HMaker + "',getdate(),'" + HMouldNum + "'" +
"," + HYear + "," + HPeriod + ",'" + HRemark + "','" + HSourceName + "'," + HPieceQty + "," + HWasterQty + "," + HPlanPieceQty + "," + HBadPNL +
"," + HICMOInterID + ",'" + HICMOBillNo + "'," + HProcPlanInterID + "," + HProcPlanEntryID + ",'" + HProcPlanBillNo + "'," + HProcExchInterID + "," + HProcExchEntryID +
",'" + HProcExchBillNo + "'," + HMaterID + "," + HProcID + "," + HICMOQty + "," + HPlanQty + ",getdate()," + HSourceID + "," + HPayProcID +
@@ -672,7 +723,7 @@
"," + HSupID + "," + HQty + "," + HPrice + "," + HMoney + "," + HBadCount + "," + HCenterID + "," + HProcNo + ",'" + HOrderProcNO + "'" + ",'" + HSourceNameList + "'" +
"," + HMainSourceInterID + ",'" + HMainSourceBillNo + "','" + HMainSourceBillType + "'," + Convert.ToString(HLastSubProc ? 1 : 0) +
"," + HEmpID2 + "," + HEmpID3 + "," + HEmpID4 + "," + HEmpID5 + "," + HDSQty + "," + HChongQty + "," + HPriceRate + "," + HWorkTimes + "," + HQCCheckID + "," + HMainInterID + "," + HPRDOrgID +
- "," + HmaterOutqty + "," + HProcPriceRate + "," + HTemporaryAreaID + ") ");
+ "," + HmaterOutqty + "," + HProcPriceRate + "," + HTemporaryAreaID + "," + HShiftsID + ") ");
}
@@ -1637,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