From 4b5e0f4c697d21530264a2f18d6040e9ff3e602f Mon Sep 17 00:00:00 2001
From: 王 垚 <1402714037@qq.com>
Date: 星期四, 08 九月 2022 15:24:33 +0800
Subject: [PATCH] 凯贝
---
WebAPI/DLL/ClsSc_MESBeginWorkBill.cs | 4 +-
DBUtility/业务单据/ClsXt_BaseBillMain.cs | 1
WebAPI/Models/ClsSc_MESBeginWorkBillMain.cs | 3 +
WebAPI/Controllers/SCGL/Sc_MESBeginWorkBillController.cs | 81 +++++++++++++++++++++++++---------------
4 files changed, 55 insertions(+), 34 deletions(-)
diff --git "a/DBUtility/\344\270\232\345\212\241\345\215\225\346\215\256/ClsXt_BaseBillMain.cs" "b/DBUtility/\344\270\232\345\212\241\345\215\225\346\215\256/ClsXt_BaseBillMain.cs"
index 6ad2004..398a4e7 100644
--- "a/DBUtility/\344\270\232\345\212\241\345\215\225\346\215\256/ClsXt_BaseBillMain.cs"
+++ "b/DBUtility/\344\270\232\345\212\241\345\215\225\346\215\256/ClsXt_BaseBillMain.cs"
@@ -45,5 +45,6 @@
public Int64 HPRDORGID;
//有效状态
public bool HUseFlag;
+
}
}
diff --git a/WebAPI/Controllers/SCGL/Sc_MESBeginWorkBillController.cs b/WebAPI/Controllers/SCGL/Sc_MESBeginWorkBillController.cs
index 2131d79..faa72bb 100644
--- a/WebAPI/Controllers/SCGL/Sc_MESBeginWorkBillController.cs
+++ b/WebAPI/Controllers/SCGL/Sc_MESBeginWorkBillController.cs
@@ -201,7 +201,7 @@
/// <returns></returns>
[Route("Sc_MESBeginWorkBill/DeltetMESBeginWorkBill")]
[HttpGet]
- public object DeltetMESBeginWorkBill(string HInterID,string UserName)
+ public object DeltetMESBeginWorkBill(string HInterID, string UserName)
{
DBUtility.ClsPub.CurUserName = UserName;
//缂栬緫鏉冮檺
@@ -287,7 +287,7 @@
[HttpGet]
public object AuditProcessReportList(int HInterID, int IsAudit, string CurUserName)
{
- string ModRightNameCheck = "MES_MESBeginWorkBill_Check";
+ string ModRightNameCheck = "MES_MESBeginWorkBill_Check";
DBUtility.ClsPub.CurUserName = CurUserName;
try
{
@@ -467,7 +467,7 @@
[HttpPost]
public object SaveGetMESBeginWorkFrom([FromBody] JObject msg)
{
-
+
var _value = msg["msg"].ToString();
string msg1 = _value.ToString();
string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
@@ -496,7 +496,7 @@
objJsonResult.data = null;
return objJsonResult;
}
-
+
ListModels oListModels = new ListModels();
try
{
@@ -555,8 +555,19 @@
return objJsonResult;
}
}
-
- DBUtility.ClsPub.CurUserName =oItem.HMaker;
+ ClsXt_SystemParameter oClsXt_SystemParameter = new ClsXt_SystemParameter();
+ string sCapName = oClsXt_SystemParameter.GetSingleSystemParameter("WMS_CampanyName", ref DBUtility.ClsPub.sExeReturnInfo);
+ if (sCapName.Contains("鍑礉"))
+ {
+ DataTable dt = getInfodatanow(oItem.HSourceID.ToString());
+ if (dt.Rows.Count > 0)
+ {
+ DataRow dr = dt.Rows[0];
+ oItem.HRunStatus = dr["runStu"].ToString();
+ oItem.HSourceBeginQty = Convert.ToDecimal(dr["countAll"]);
+ }
+ }
+ DBUtility.ClsPub.CurUserName = oItem.HMaker;
oItem.HBillType = "3787";
oItem.HBillSubType = "3787";
oItem.HBillStatus = 1; //鍗曟嵁鐘舵�侊紙1鏈锛�2瀹℃牳閫氳繃锛�3鍏抽棴锛�4浣滃簾锛�5瀹℃牳閫�鍥�,6瀹℃牳涓�,7宸查槄锛�8宸插洖澶嶏紝9缁撴锛�10楠岃瘉,11涓嬭揪锛�12寮�宸�,13鐢宠瀹℃壒,15鐢宠妫�楠岋紝16 鍒ゅ畾鍚堟牸锛�17鍒ゅ畾涓嶅悎鏍硷級
@@ -579,9 +590,9 @@
bool bResult;
if (oBill.omodel.HInterID == 0)
{
-
+
bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
- if (bResult)
+ if (bResult)
{
objJsonResult.HInterID = DBUtility.ClsPub.sExeReturnInfo; //杩斿洖涓籌D
//绯荤粺鍙傛暟 鑷姩瀹℃牳
@@ -598,7 +609,7 @@
}
}
}
-
+
}
else
{
@@ -607,7 +618,7 @@
}
if (bResult)
{
-
+
objJsonResult.code = "0";
objJsonResult.count = 1;
objJsonResult.Message = "淇濆瓨鎴愬姛锛�";
@@ -633,6 +644,14 @@
}
}
#endregion
+
+ public DataTable getInfodatanow(string hsoucreID)
+ {
+ SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
+ string sql = $" select HMacAddr, runStu, countAll from Gy_Source t1 left join HX_LIOTsys..Info_data_now t2 on t1.HMacAddr = t2.hid where t1.hitemid={hsoucreID}";
+ DataTable dt = oCn.RunProcReturn(sql, "dt").Tables[0];
+ return dt;
+ }
#region 鎶ュ伐骞冲彴楠岃瘉鍗曟嵁鐘舵��
[Route("Sc_MESBeginWorkBill/GetMESBeginWorkBillStaus")]
@@ -709,7 +728,7 @@
return new SQLHelper.ClsCN().RunProcReturn(sql, "Sc_ICMOBillWorkQtyStatus_Tmp");
}
#endregion
-
+
#region 鎶ュ伐骞冲彴浜ч噺姹囬獙璇佹眹鎶ユ暟閲忔槸鍚﹁秴鍑鸿鍒掓暟閲忚緫
/// <summary>
///
@@ -849,7 +868,7 @@
if (bResult)
{
objJsonResult.HInterID = DBUtility.ClsPub.sExeReturnInfo; //杩斿洖涓籌D
- //绯荤粺鍙傛暟 鑷姩瀹℃牳
+ //绯荤粺鍙傛暟 鑷姩瀹℃牳
string sReturn = "";
if (oSystemParameter.ShowBill(ref sReturn) == true)
{
@@ -907,7 +926,7 @@
/// <returns></returns>
[Route("Sc_MESBeginWorkBill/MESProductAuditProcessReportList")]
[HttpGet]
- public object MESProductAuditProcessReportList(int HSourceID,int HSourceInterID,int HSourceEntryID,string HSourceBillNo, int HICMOInterID,int HICMOEntryID, int HInterID, int IsAudit, string CurUserName)
+ public object MESProductAuditProcessReportList(int HSourceID, int HSourceInterID, int HSourceEntryID, string HSourceBillNo, int HICMOInterID, int HICMOEntryID, int HInterID, int IsAudit, string CurUserName)
{
string ModRightNameCheck = "MES_ProcExchReport_Check";
DBUtility.ClsPub.CurUserName = CurUserName;
@@ -915,7 +934,7 @@
{
string StrMessage = "";
//瀹℃牳鏉冮檺
- if (!WebClsPub.Security_Log(ModRightNameCheck, 1, false, CurUserName,ref StrMessage))
+ if (!WebClsPub.Security_Log(ModRightNameCheck, 1, false, CurUserName, ref StrMessage))
{
objJsonResult.code = "0";
objJsonResult.count = 0;
@@ -987,7 +1006,7 @@
if (IsAudit == 0) //瀹℃牳鎻愪氦
{
//瀹℃牳鎻愪氦
- if (oBill.CheckBill(HSourceID, HSourceInterID,HSourceEntryID,HSourceBillNo,HICMOInterID, HICMOEntryID, lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true)
+ if (oBill.CheckBill(HSourceID, HSourceInterID, HSourceEntryID, HSourceBillNo, HICMOInterID, HICMOEntryID, lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true)
{
objJsonResult.code = "1";
objJsonResult.count = 1;
@@ -1040,19 +1059,19 @@
#region 鎶ュ伐骞冲彴浜ч噺姹囨姤鍒犻櫎
[Route("Sc_MESBeginWorkBill/DeltetMESProductReportBill")]
[HttpGet]
- public object DeleteGetLineBindBillList(string HInterID,string HICMOInterID,string HICMOEntryID,string UserName)
+ public object DeleteGetLineBindBillList(string HInterID, string HICMOInterID, string HICMOEntryID, string UserName)
{
try
{
oCN.BeginTran();
//鏌ヨ浜ч噺姹囨姤涓存椂琛ㄦ暟閲�
ds = oCN.RunProcReturn("select isnull(HQty,0) HQty,isnull(HWasterQty,0) HWasterQty,isnull(HBadQty,0) HBadQty from Sc_ICMOBillWorkQtyStatus_Tmp where HInterID='" + HInterID + "' and HICMOInterID='" + HICMOInterID + "' and HICMOEntryID='" + HICMOEntryID + "'", "Sc_ICMOBillWorkQtyStatus_Tmp");
- double HQty =double.Parse(ds.Tables[0].Rows[0]["HQty"].ToString());
+ double HQty = double.Parse(ds.Tables[0].Rows[0]["HQty"].ToString());
double HWasterQty = double.Parse(ds.Tables[0].Rows[0]["HWasterQty"].ToString());
double HBadQty = double.Parse(ds.Tables[0].Rows[0]["HBadQty"].ToString());
double sumqty = HQty + HBadQty + HWasterQty; //姹囨姤鏁伴噺+涓嶈壇+鎶ュ簾
- //鏇存柊浜ч噺瑁呴噺涓存椂琛ㄥ凡姹囨姤鏁伴噺
- string sql1 = string.Format(@"update Sc_ICMOBillStatus_Tmp set HICMOStatus='1',HFinishFlag='0', HRelationInterID=0,HSplitRelationQty=HSplitRelationQty-" + sumqty + ",HDateFinishQty=HDateFinishQty-"+ sumqty + " where HICMOInterID='"+ HICMOInterID + "' and HICMOEntryID='"+ HICMOEntryID + "'");
+ //鏇存柊浜ч噺瑁呴噺涓存椂琛ㄥ凡姹囨姤鏁伴噺
+ string sql1 = string.Format(@"update Sc_ICMOBillStatus_Tmp set HICMOStatus='1',HFinishFlag='0', HRelationInterID=0,HSplitRelationQty=HSplitRelationQty-" + sumqty + ",HDateFinishQty=HDateFinishQty-" + sumqty + " where HICMOInterID='" + HICMOInterID + "' and HICMOEntryID='" + HICMOEntryID + "'");
oCN.RunProc(sql1);
//鏇存柊鍒囨崲鐘舵�佸��
string sql = string.Format(@"delete Sc_ICMOBillWorkQtyStatus_Tmp where HInterID='" + HInterID + "'");
@@ -1081,8 +1100,8 @@
#region 鎶ュ伐骞冲彴鎶ユ鐢宠淇濆瓨
[Route("Sc_MESBeginWorkBill/SaveGetMESProductReportBillList")]
[HttpGet]
- public object SaveGetMESProductReportBillList(string ScMaxWork,string HSourceBillType, string workcode,int HSourceID,int HICMOInterID,int HICMOEntryID,string HMaker,string Czybm)
- {
+ public object SaveGetMESProductReportBillList(string ScMaxWork, string HSourceBillType, string workcode, int HSourceID, int HICMOInterID, int HICMOEntryID, string HMaker, string Czybm)
+ {
ListModels oListModels = new ListModels();
try
{
@@ -1110,9 +1129,9 @@
//}
string sHSourceType = HSourceBillType;
- string BillType = "3711"; //鍗曟嵁绫诲瀷 (鐢熶骇姹囨姤鍗�)
- //寰楀埌mainid
- long HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo);
+ string BillType = "3711"; //鍗曟嵁绫诲瀷 (鐢熶骇姹囨姤鍗�)
+ //寰楀埌mainid
+ long HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo);
//oCN.BeginTran();
//鏍规嵁鍗曞彿銆佽祫婧怚D銆佽鍗曚富ID銆佽鍗曞瓙ID銆佸埗鍗曚汉杩囨护浜ч噺姹囨姤鎶ユ鐢宠鎻愪氦鏁版嵁
//string sql = string.Format(@"update Sc_ICMOBillWorkQtyStatus_Tmp set
@@ -1126,14 +1145,14 @@
//ds = oCN.RunProcReturn("select top 1 * from Sc_ICMOBillWorkQtyStatus_Tmp where HICMOReportInterID='" + HInterID + "' and HICMOReportBillNo='" + ScMaxWork + "'", "Sc_ICMOBillWorkQtyStatus_Tmp");
//if (ds.Tables[0].Rows.Count <= 0)
//{
- //oCN.RollBack();
+ //oCN.RollBack();
// objJsonResult.code = "0";
// objJsonResult.count = 0;
// objJsonResult.Message = "褰撳墠鍗曟嵁鏃犱骇閲忔眹鎶ヨ褰曪紒";
// objJsonResult.data = null;
// return objJsonResult;
//}
-
+
WebS.ClsSc_ICMOReportBillMain model = new WebS.ClsSc_ICMOReportBillMain();
model.HInterID = HInterID;
model.HBillNo = ScMaxWork;
@@ -1148,9 +1167,9 @@
//model.HPRDORGID = DBUtility.ClsPub.isLong(ds0.Tables[0].Rows[0]["HPRDORGID"]);
model.HMainSourceInterID = HICMOInterID;
model.HMainSourceEntryID = HICMOEntryID;
-
+
//oWebs.Timeout = 30000;
- bool flag=oWebs.set_SaveICMOProductReportBill_Layui(model,workcode,HSourceID, sHSourceType, ref DBUtility.ClsPub.sErrInfo);
+ bool flag = oWebs.set_SaveICMOProductReportBill_Layui(model, workcode, HSourceID, sHSourceType, ref DBUtility.ClsPub.sErrInfo);
if (flag)
{
//oCN.Commit();
@@ -1160,12 +1179,12 @@
objJsonResult.data = 1;
return objJsonResult;
}
- else
+ else
{
//oCN.RollBack();
objJsonResult.code = "0";
objJsonResult.count = 0;
- objJsonResult.Message = "淇濆瓨澶辫触锛�"+ flag+ ";"+ DBUtility.ClsPub.sErrInfo;
+ objJsonResult.Message = "淇濆瓨澶辫触锛�" + flag + ";" + DBUtility.ClsPub.sErrInfo;
objJsonResult.data = null;
return objJsonResult;
}
@@ -1184,6 +1203,6 @@
-
+
}
}
diff --git a/WebAPI/DLL/ClsSc_MESBeginWorkBill.cs b/WebAPI/DLL/ClsSc_MESBeginWorkBill.cs
index a45d9db..6e1cf5f 100644
--- a/WebAPI/DLL/ClsSc_MESBeginWorkBill.cs
+++ b/WebAPI/DLL/ClsSc_MESBeginWorkBill.cs
@@ -163,7 +163,7 @@
",HProcExchBillNo,HMaterID,HProcID,HICMOQty,HPlanQty,HBeginWorkTime,HSourceID" +
",HSourceInterID_Main,HSourceEntryID_Main,HSourceBillNo_Main,HSourceBillType_Main" +
",HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo,HMainSourceBillType" +
- ",HGroupID,HDeptID,HEmpID,HBarCode,HAddr,HBarCodeMaker,HBarCodeMakeDate" +
+ ",HGroupID,HDeptID,HEmpID,HBarCode,HAddr,HBarCodeMaker,HBarCodeMakeDate,HRunStatus,HSourceBeginQty" +
") " +
" values('" + this.BillType + "','" + this.HBillSubType + "'," + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "'," + omodel.HBillStatus.ToString() + ",getdate(),'" + omodel.HMaker+ "',getdate()" +
"," + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "'" +
@@ -171,7 +171,7 @@
",'" + omodel.HProcExchBillNo + "'," + omodel.HMaterID.ToString() + "," + omodel.HProcID.ToString() + "," + omodel.HICMOQty.ToString() + "," + omodel.HPlanQty.ToString() + ",getdate()," + omodel.HSourceID.ToString() +
",'" + omodel.HMainSourceInterID.ToString() + "'," + omodel.HMainSourceEntryID.ToString() + ",'" + omodel.HMainSourceBillNo.ToString() + "','" + omodel.HMainSourceBillType.ToString() + "'" +
",'" + omodel.HMainSourceInterID.ToString() + "'," + omodel.HMainSourceEntryID.ToString() + ",'" + omodel.HMainSourceBillNo.ToString() + "','" + omodel.HMainSourceBillType.ToString() + "'" +
- "," + omodel.HGroupID.ToString() + "," + omodel.HDeptID.ToString() + "," + omodel.HEmpID.ToString() + ",'" + omodel.HBarCode + "','" + omodel.HAddr + "','" + omodel.HBarCodeMaker + "',getdate()" +
+ "," + omodel.HGroupID.ToString() + "," + omodel.HDeptID.ToString() + "," + omodel.HEmpID.ToString() + ",'" + omodel.HBarCode + "','" + omodel.HAddr + "','" + omodel.HBarCodeMaker + "',getdate(),'"+ omodel.HRunStatus + "','"+ omodel.HSourceBeginQty.ToString() + "'" +
") ");
//鍐嶆楠岃瘉 淇濆瓨鏄惁 鍚堢悊
diff --git a/WebAPI/Models/ClsSc_MESBeginWorkBillMain.cs b/WebAPI/Models/ClsSc_MESBeginWorkBillMain.cs
index 7acc39c..3ebdd91 100644
--- a/WebAPI/Models/ClsSc_MESBeginWorkBillMain.cs
+++ b/WebAPI/Models/ClsSc_MESBeginWorkBillMain.cs
@@ -31,7 +31,8 @@
public String HBarCodeMaker;
public DateTime HBarCodeMakeDate;
new public string HMainSourceEntryID;
-
+ public string HRunStatus;
+ public decimal HSourceBeginQty;
//public int HSourceInterID_Main;
//public int HSourceEntryID_Main;
//public string HSourceBillNo_Main;
--
Gitblit v1.9.1