From 2609bffee3a8de0d1e08b1b2c3fa3cfe13064f4e Mon Sep 17 00:00:00 2001
From: duhe <226547893@qq.com>
Date: 星期一, 24 三月 2025 11:40:14 +0800
Subject: [PATCH] 1
---
WebAPI/Controllers/CJGL/Cj_SingleStationController.cs | 99 ++++++++++++++++++++++++++++++++++++++-----------
1 files changed, 76 insertions(+), 23 deletions(-)
diff --git a/WebAPI/Controllers/CJGL/Cj_SingleStationController.cs b/WebAPI/Controllers/CJGL/Cj_SingleStationController.cs
index b8de819..2a48c10 100644
--- a/WebAPI/Controllers/CJGL/Cj_SingleStationController.cs
+++ b/WebAPI/Controllers/CJGL/Cj_SingleStationController.cs
@@ -15,6 +15,7 @@
{
private json objJsonResult = new json();
SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+ Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter();
DataSet ds;
#region 宸ュ簭鍗曞搧涓嶈壇閲囬泦 鐢ㄦ埛鏌ヨ鍏宠仈瀛楁
@@ -183,14 +184,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 +298,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 == "涓嶈壇")
+ {
+ LogService.Write("绫诲瀷:" + oSub.HBadTypeID);
+ //宸ュ簾
+ 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 == "鎶ュ簾")
{
@@ -329,16 +361,27 @@
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)
+
+
+ //瀹㈡埛鍒跺畾
+ string sErr = "";
+ if (oSystemParameter.ShowBill(ref sErr))
{
- objJsonResult.code = "0";
- objJsonResult.count = 0;
- objJsonResult.Message = "鍗″彿:" + HBarCode + ",娴佽浆鍗℃湭寮�宸�!";
- objJsonResult.data = null;
- return objJsonResult;
+ if (oSystemParameter.omodel.WMS_CampanyName == "鏉窞鏂帿灏�")
+ {
+ //鍒ゆ柇褰撳墠娴佽浆鍗℃槸鍚︽槸寮�宸�
+ 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)
@@ -666,8 +709,6 @@
{
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)
@@ -1659,8 +1700,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