From 9f7b0ecace9c80ff2a1d95f4343058b3b031bd22 Mon Sep 17 00:00:00 2001
From: dytyqx <1342948614@qq.com>
Date: 星期一, 30 三月 2026 21:39:29 +0800
Subject: [PATCH] 容器管理新增字段子单据类型
---
WebAPI/Controllers/CJGL/Cj_StationEntrustOutBillController.cs | 189 ++++++++++++++++++++++++++++++++---------------
1 files changed, 128 insertions(+), 61 deletions(-)
diff --git a/WebAPI/Controllers/CJGL/Cj_StationEntrustOutBillController.cs b/WebAPI/Controllers/CJGL/Cj_StationEntrustOutBillController.cs
index 97706f7..612daac 100644
--- a/WebAPI/Controllers/CJGL/Cj_StationEntrustOutBillController.cs
+++ b/WebAPI/Controllers/CJGL/Cj_StationEntrustOutBillController.cs
@@ -885,25 +885,25 @@
}
//瀹℃牳鍓嶆帶鍒�================================================================================
- //string sql = "exec h_p_StationEntrustOutBill_WW_BeforeCheckCtrl " + HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'";
- //ds = oCN.RunProcReturn(sql, "h_p_StationEntrustOutBill_WW_BeforeCheckCtrl");
- //if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
- //{
- // objJsonResult.code = "0";
- // objJsonResult.count = 1;
- // objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:瀹℃牳鍓嶅垽鏂け璐ワ紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴";
- // objJsonResult.data = null;
- // return objJsonResult;
- //}
+ string sql = "exec h_p_StationEntrustOutBill_WW_BeforeCheckCtrl " + HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'";
+ ds = oCN.RunProcReturn(sql, "h_p_StationEntrustOutBill_WW_BeforeCheckCtrl");
+ if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:瀹℃牳鍓嶅垽鏂け璐ワ紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
- //if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
- //{
- // objJsonResult.code = "0";
- // objJsonResult.count = 1;
- // objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
- // objJsonResult.data = null;
- // return objJsonResult;
- //}
+ if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
//================================================================================
//瀹℃牳
@@ -965,20 +965,20 @@
}
//瀹℃牳鍚庢帶鍒�================================================================================
- //string sql = "exec h_p_StationEntrustOutBill_WW_AfterCheckCtrl " + lngBillKey + ",'" + HBillNo + "','" + CurUserName + "'";
- //ds = oCN.RunProcReturn(sql, "h_p_StationEntrustOutBill_WW_AfterCheckCtrl");
- //if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
- //{
- // sReturn = "瀹℃牳杩囩▼涓嚭閿欙紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴";
- // oCN.RollBack();
- // return false;
- //}
- //if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
- //{
- // sReturn = ds.Tables[0].Rows[0]["HRemark"].ToString();
- // oCN.RollBack();
- // return false;
- //}
+ string sql = "exec h_p_StationEntrustOutBill_WW_AfterCheckCtrl " + lngBillKey + ",'" + HBillNo + "','" + CurUserName + "'";
+ ds = oCN.RunProcReturn(sql, "h_p_StationEntrustOutBill_WW_AfterCheckCtrl");
+ if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
+ {
+ sReturn = "瀹℃牳杩囩▼涓嚭閿欙紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴";
+ oCN.RollBack();
+ return false;
+ }
+ if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
+ {
+ sReturn = ds.Tables[0].Rows[0]["HRemark"].ToString();
+ oCN.RollBack();
+ return false;
+ }
//================================================================================
@@ -1380,6 +1380,7 @@
}
#endregion
+ //瀹℃牳锛屽甫缂栬緫鍔熻兘
[Route("Cj_StationEntrustOutBill/setOtherProperty")]
[HttpPost]
public object setOtherProperty([FromBody] JObject oMain)
@@ -1392,15 +1393,23 @@
string msg2 = "[" + sArray[0].ToString() + "]";
string user = sArray[1].ToString();
////鍒ゆ柇鏄惁鏈夌紪杈戞潈闄�
- //if (!DBUtility.ClsPub.Security_Log("MES_StationEntrustOutBill_Edit", 1, false, user))
- //{
- // objJsonResult.code = "0";
- // objJsonResult.count = 0;
- // objJsonResult.Message = "鏃犵紪杈戞潈闄�!";
- // objJsonResult.data = null;
- // return objJsonResult;
- //}
-
+ if (!DBUtility.ClsPub.Security_Log("MES_StationEntrustOutBill_Edit", 1, false, user))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏃犵紪杈戞潈闄�!";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //瀹℃牳鏉冮檺
+ if (!DBUtility.ClsPub.Security_Log("MES_StationEntrustOutBill_Check", 1, false, user))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "瀹℃牳澶辫触锛佹棤鏉冮檺锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
List<StationBill> list1 = Newtonsoft.Json.JsonConvert.DeserializeObject<List<StationBill>>(msg2);
long HInterID = list1[0].HInterID;
double HQty= list1[0].HQty;
@@ -1412,33 +1421,91 @@
long HGroupID = list1[0].HGroupID;
long HEmpID = list1[0].HEmpID;
-
+ oCN.BeginTran();
DataSet ds = oCN.RunProcReturn("select * from Sc_StationOutBillMain where HInterID="+ HInterID, "Sc_StationOutBillMain");
- if(ds.Tables.Count>0)
+
+ if(ds.Tables.Count>0 && ds.Tables[0].Rows[0]["HChecker"].ToString()=="")
{
- if(HQty>0)
+ string HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString();
+ int HProcExchInterID = int.Parse(ds.Tables[0].Rows[0]["HProcExchInterID"].ToString());
+ int HProcExchEntryID = int.Parse(ds.Tables[0].Rows[0]["HProcExchEntryID"].ToString());
+ int HProcNo = int.Parse(ds.Tables[0].Rows[0]["HProcNo"].ToString());
+ //瀹℃牳鍓嶆帶鍒�================================================================================
+ string sql = "exec h_p_StationEntrustOutBill_WW_BeforeCheckCtrl " + HInterID + ",'" + HBillNo + "','" + user + "'";
+ ds = oCN.RunProcReturn(sql, "h_p_StationEntrustOutBill_WW_BeforeCheckCtrl");
+ if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
{
- oCN.BeginTran();
- oCN.RunProc($"update Sc_StationOutBillMain set HQty={HQty},HBadCount='{HBadCount}',HWasterQty='{HWasterQty}',HSourceID='{HSourceID}',HCenterID='{HCenterID}',HGroupID={HGroupID},HEmpID={HEmpID} where HInterID={HInterID} ");
- oCN.Commit();
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:瀹℃牳鍓嶅垽鏂け璐ワ紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴";
+ objJsonResult.data = null;
+ return objJsonResult;
}
- set_CheckBill(Convert.ToInt32(HInterID) , user);
+
+ if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //================================================================================
+
+ if (HQty>0)
+ {
+
+ oCN.RunProc($"update Sc_StationOutBillMain set HBillStatus = 2,HQty={HQty},HBadCount='{HBadCount}',HWasterQty='{HWasterQty}',HSourceID='{HSourceID}',HCenterID='{HCenterID}',HGroupID={HGroupID},HEmpID={HEmpID},HChecker='{user}',HCheckDate=getdate() where HInterID={HInterID} ");
+
+ }
+ string sReturn = "";
+ //鑾峰彇绯荤粺鍙傛暟
+ oSystemParameter.ShowBill(ref sReturn);
+ //鍒ゆ柇瀹㈡埛涓哄ぉ鎿� 鍚屾閲戣澏宸ュ簭姹囨姤鍗�
+ if (oSystemParameter.omodel.WMS_CampanyName == "澶╂搸")
+ {
+
+ if (set_SaveStationEntrustOutBill_CLD(HBillNo, HProcExchInterID, HProcExchEntryID, HProcNo, HQty, user, ref DBUtility.ClsPub.sErrInfo))
+ {
+ oCN.Commit();
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = DBUtility.ClsPub.sErrInfo; //鎴愬姛锛�
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = DBUtility.ClsPub.sErrInfo; //澶辫触锛�
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ }
+ oCN.Commit();
objJsonResult.code = "1";
objJsonResult.count = 1;
- objJsonResult.Message = "瀹℃牳鎴愬姛!";
+ objJsonResult.Message = "瀹℃牳淇敼鎴愬姛锛�";
objJsonResult.data = null;
return objJsonResult;
+
+
}
else
{
+ oCN.Commit();
objJsonResult.code = "0";
objJsonResult.count = 0;
- objJsonResult.Message = "鍗曟嵁涓嶅瓨鍦紒";
+ objJsonResult.Message = "鍗曟嵁涓嶅瓨鍦ㄦ垨宸插鏍革紒";
objJsonResult.data = null;
return objJsonResult;
}
+
}
catch (Exception e)
{
@@ -1489,7 +1556,7 @@
try
{
//杩斿洖API閫掑叆鎵�闇�鏁版嵁
- DataSet Ds = oCn.RunProcReturn("exec h_p_MES_StationEntrustOutBill_ProdMateRequest_CLD " + HProcExchInterID.ToString() + "," + HProcExchEntryID.ToString() + "," + HProcNo.ToString() + "," + HQty.ToString(), "h_p_MES_StationEntrustOutBill_ProdMateRequest_CLD");
+ DataSet Ds = oCn.RunProcReturn("exec h_p_MES_StationEntrustOutBill_ProdMateRequest_CLD '" + HBillNo + "'," + HProcExchInterID.ToString() + "," + HProcExchEntryID.ToString() + "," + HProcNo.ToString() + "," + HQty.ToString(), "h_p_MES_StationEntrustOutBill_ProdMateRequest_CLD");
if (Ds == null || Ds.Tables[0].Rows.Count == 0)
{
sErrMsg = "鏈幏鍙栧埌API鎵�闇�閫掑叆鏁版嵁锛�";
@@ -1588,11 +1655,11 @@
"\"FInOperDescr\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FInOperDescr"]) + "\"," +
"\"FOutIsOutSrc\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FOutIsOutSrc"]) + "\"," +
"\"FInSeqNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FInSeqNumber"]) + "\"," +
- //"\"FInPurOrgId\":{ \"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FInPurOrgId"]) + "\" }," +
+ "\"FInPurOrgId\":{ \"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FInPurOrgId"]) + "\" }," +
"\"FInOperNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FInOperNumber"]) + "\"," +
"\"FInWorkCenterId\":{ \"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FInWorkCenterId"]) + "\" }," +
//"FInEmpId": {"FSTAFFNUMBER": ""},
- //"\"FInSupplier\":{ \"FNAME\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FInSupplier"]) + "\" }," +
+ "\"FInSupplier\":{ \"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FInSupplier"]) + "\" }," +
"\"FOperApplyQty\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FOperApplyQty"]) + "\"," +
"\"FTransferQty\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FTransferQty"]) + "\"," +
"\"FApplyQty\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FApplyQty"]) + "\"," +
@@ -1613,22 +1680,22 @@
//"FPreReworkQty": 0,
//"FMatFailQty": 0,
//"FValMatFailQty": 0,
- //"\"FSendCurrency\":{ \"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FSendCurrency"]) + "\" }," +
+ "\"FSendCurrency\":{ \"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FSendCurrency"]) + "\" }," +
"\"FIsInspect\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FIsInspect"]) + "\"," +
"\"FQCSchemeId\":{ \"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FQCSchemeId"]) + "\" }," +
- //"\"FSendProFailPrice\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FSendProFailPrice"]) + "\"," +
+ "\"FSendProFailPrice\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FSendProFailPrice"]) + "\"," +
"\"FReceiveCurrency\":{ \"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FReceiveCurrency"]) + "\" }," +
"\"FReceiveQualifiedPrice\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FReceiveQualifiedPrice"]) + "\"," +
"\"FReceiveProFailPrice\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FReceiveProFailPrice"]) + "\"," +
"\"FReceiveMatFailPrice\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FReceiveMatFailPrice"]) + "\"," +
"\"FReceiveValuationUnitId\":{ \"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FReceiveValuationUnitId"]) + "\" }," +
"\"FReceiveTaxRate\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FReceiveTaxRate"]) + "\"," +
- //"\"FSendMatFailPrice\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FSendMatFailPrice"]) + "\"," +
+ "\"FSendMatFailPrice\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FSendMatFailPrice"]) + "\"," +
//"FOperInspectSelectQty": 0,
"\"FSendValuationUnitId\":{ \"FNumber\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FSendValuationUnitId"]) + "\" }," +
//"FInspectSelectQty": 0,
- //"\"FSendTaxRate\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FSendTaxRate"]) + "\"," +
- //"\"FSendQualifiedPrice\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FSendQualifiedPrice"]) + "\"," +
+ "\"FSendTaxRate\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FSendTaxRate"]) + "\"," +
+ "\"FSendQualifiedPrice\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FSendQualifiedPrice"]) + "\"," +
//"FOperQuaSettleSelQty": 0,
//"FValQuaSettleSelQty": 0,
//"FQuaSettleSelQty": 0,
@@ -1683,9 +1750,9 @@
"\"FReceiveQualifiedTaxPrice\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FReceiveQualifiedTaxPrice"]) + "\"," +
"\"FReceiveProFailTaxPrice\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FReceiveProFailTaxPrice"]) + "\"," +
"\"FReceiveMatFailTaxPrice\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FReceiveMatFailTaxPrice"]) + "\"," +
- //"\"FSendQualifiedTaxPrice\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FSendQualifiedTaxPrice"]) + "\"," +
- //"\"FSendProFailTaxPrice\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FSendProFailTaxPrice"]) + "\"," +
- //"\"FSendMatFailTaxPrice\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FSendMatFailTaxPrice"]) + "\"," +
+ "\"FSendQualifiedTaxPrice\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FSendQualifiedTaxPrice"]) + "\"," +
+ "\"FSendProFailTaxPrice\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FSendProFailTaxPrice"]) + "\"," +
+ "\"FSendMatFailTaxPrice\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FSendMatFailTaxPrice"]) + "\"," +
"\"FRateOperQty\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FRateOperQty"]) + "\"," +
"\"FRateProQty\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FRateProQty"]) + "\"," +
"\"FRateValQty\":\"" + Pub_Class.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["FRateValQty"]) + "\"," +
--
Gitblit v1.9.1