From 5286b614c84f8f82f81772cdb32c2dc5a0d26e0f Mon Sep 17 00:00:00 2001
From: yxj <yxj@hz-kingdee.com>
Date: 星期五, 28 十一月 2025 16:59:20 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API
---
WebAPI/Controllers/BaseSet/Gy_MaterialController.cs | 1115 ++++++++++++++++++++++++++++++++++++++++++++++++----------
1 files changed, 915 insertions(+), 200 deletions(-)
diff --git a/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs b/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs
index 4d4d311..b493f57 100644
--- a/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs
+++ b/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs
@@ -317,6 +317,33 @@
}
#endregion
+ #region 鑾峰彇杞﹂棿鍙�
+ [Route("Gy_Material/Get_HDepartment")]
+ [HttpGet]
+ public object Get_HDepartment()
+ {
+ try
+ {
+ DataSet oDs = new DataSet();
+ //==========
+ oDs = oCN.RunProcReturn("select top(20) HItemID , HName from Gy_Department", "Gy_Department");
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鑾峰彇鎴愬姛锛�";
+ objJsonResult.data = oDs.Tables[0];
+ return objJsonResult; ;
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍒犻櫎澶辫触锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
/// <summary>
/// 鑾峰彇椤圭洰鍒楄〃
/// </summary>
@@ -570,6 +597,7 @@
oItem.HShortNumber = sShortNumber;//鐭唬鐮�
oItem.HEndFlag = true;//鏈骇鏍囧織
oItem.HLevel = DBUtility.ClsPub.GetLevel(oItem.HNumber.Trim()); //绛夌骇
+ oItem.HMakeEmp = msg2;
oBill.oModel = oItem;
}
//淇濆瓨
@@ -582,6 +610,18 @@
}
else
{
+ //宸插鏍镐笉鍏佽淇敼
+ DataSet dss;
+ dss = oCN.RunProcReturn("select * from Gy_Material where HItemID=" + oBill.oModel.HItemID, "Gy_Material");
+ //鍒ゆ柇鏄惁鍙紪杈�
+ if (dss.Tables[0].Rows[0]["HCheckEmp"].ToString() != "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "姝ゅ崟鎹姸鎬佸凡缁忓鏍革紝涓嶅厑璁镐慨鏀癸紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
bResult = oBill.ModifyByID(oBill.oModel.HItemID);
}
if (bResult)
@@ -612,6 +652,320 @@
}
}
+ #region 淇濆瓨鐗╂枡_鎵归噺
+ /// <summary>
+ /// 淇濆瓨鐗╂枡
+ /// </summary>
+ /// <param name="msg"></param>
+ /// <returns></returns>
+ [Route("Gy_Material/SaveGy_MaterialList_Batch")]
+ [HttpPost]
+ public object SaveGy_MaterialList_Batch([FromBody] JObject msg)
+ {
+ DataSet ds;
+ var _value = msg["msg"].ToString();
+ string msg3 = _value.ToString();
+ string[] sArray = msg3.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
+ string msg1 = sArray[0].ToString();
+ string msg2 = sArray[1].ToString();
+ string msg_HUSEORGID = sArray[2].ToString();
+ bool bResult = false;
+ Int64 HItemID = 0;
+ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+
+ //缂栬緫鏉冮檺
+ if (!DBUtility.ClsPub.Security_Log_second("Gy_Material_Edit", 1, false, msg2))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏃犱繚瀛樻潈闄愶紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ //鑾峰彇鏈�澶D鍊艰祴鍊�
+ DataSet Maxds = oCN.RunProcReturn("select MAX(HItemID) HItemID from Gy_Material ", "Gy_Material");
+ if (Maxds != null || Maxds.Tables[0].Rows.Count > 0)
+ {
+ //HItemID= Maxds.Tables[0].Rows[0]["HItemID"]
+ var maxid = Convert.ToInt32(Maxds.Tables[0].Rows[0]["HItemID"]);
+ maxid += 1;
+ HItemID = maxid;
+ }
+ ListModels oListModels = new ListModels();
+
+ try
+ {
+ DLL.ClsGy_Material_Ctl oBill = new DLL.ClsGy_Material_Ctl();
+ List<Models.ClsGy_Material_Model> lsmain = new List<Models.ClsGy_Material_Model>();
+ msg1 = msg1.Replace("\\", "");
+ msg1 = msg1.Replace("\n", ""); //\n
+ lsmain = oListModels.getObjectByJson_Gy_Material(msg1);
+ foreach (ClsGy_Material_Model oItem in lsmain)
+ {
+ if (oItem.HNumber.Trim() == "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨澶辫触锛佷唬鐮佷笉鑳戒负绌猴紒";
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ if (oItem.HName.Trim() == "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨澶辫触锛佸悕绉颁笉鑳戒负绌猴紒";
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ if (oItem.HMaterTypeID == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨澶辫触锛佺墿鏂欏垎绫讳笉鑳戒负绌猴紒";
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ //if (!DBUtility.ClsPub.AllowNumber(oItem.HNumber.Trim()))
+ //{
+ // objJsonResult.code = "0";
+ // objJsonResult.count = 0;
+ // objJsonResult.Message = "淇濆瓨澶辫触锛佷唬鐮佷腑涓嶈兘鍑虹幇杩炵画鈥�.鈥欏苟涓旈浣嶆湯浣嶄笉鑳戒负鈥�.鈥欙紒";
+ // objJsonResult.data = 1;
+ // return objJsonResult;
+ //}
+ //鏌ヨ鏁版嵁涓槸鍚﹀瓨鍦ㄩ噸澶嶄唬鐮�
+ ds = oCN.RunProcReturn("select * from Gy_Material where HStopflag=0 and HNumber='" + oItem.HNumber.Trim() + "'", "Gy_Material");
+ //鏂板鏃跺垽鏂�
+ #region 鐖剁骇鏍¢獙鏂规硶锛坅pi璋冪敤鍏堟敞閲婃帀锛岋級
+ /*
+ if (oItem.HItemID == 0)
+ {
+ if (ds == null || ds.Tables[0].Rows.Count > 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨澶辫触锛佷唬鐮侀噸澶嶏紒";
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ //妫�鏌ョ埗绾ф槸鍚﹀瓨鍦�
+ string sParent;
+ sParent = DBUtility.ClsPub.GetParentCode(oItem.HNumber.Trim());
+ if (sParent.Trim() == "")
+ {
+ oBill.oModel.HParentID = 0;
+ }
+ else
+ {
+ if (oBill.HavParentCode(sParent.Trim(), HItemID))
+ {
+ oBill.oModel.HParentID = oBill.oModel.HItemID;
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨澶辫触锛佷笂绾т唬鐮佷笉瀛樺湪鎴栬绂佺敤锛�";
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ }
+ }
+ else//缂栬緫鏃跺垽鏂�
+ {
+ //妫�鏌ョ埗绾ф槸鍚﹀瓨鍦�
+ string sParent;
+ sParent = DBUtility.ClsPub.GetParentCode(oItem.HNumber.Trim());
+ if (sParent.Trim() == "")
+ {
+ oBill.oModel.HParentID = 0;
+ }
+ else
+ {
+ if (oBill.HavParentCode(sParent.Trim(), oItem.HItemID))
+ {
+ oBill.oModel.HParentID = oBill.oModel.HItemID;
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨澶辫触锛佷笂绾т唬鐮佷笉瀛樺湪鎴栬绂佺敤锛�";
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ }
+ }
+ */
+ #endregion
+ //寰楀埌鐭唬鐮�
+ string sShortNumber;
+ sShortNumber = DBUtility.ClsPub.GetShortNumber(oItem.HNumber.Trim());
+ if (sShortNumber.Trim() == "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨澶辫触锛佺煭浠g爜涓虹┖锛�";
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ oItem.HUSEORGID = Convert.ToInt32(msg_HUSEORGID); //缁勭粐id
+ oItem.HShortNumber = sShortNumber;//鐭唬鐮�
+ oItem.HEndFlag = true;//鏈骇鏍囧織
+ oItem.HLevel = DBUtility.ClsPub.GetLevel(oItem.HNumber.Trim()); //绛夌骇
+ oItem.HModifyEmp = msg2;
+ oBill.oModel = oItem;
+
+ if (oBill.oModel.HItemID == 0)
+ {
+ //bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
+ bResult = oBill.AddNew();
+ }
+ else
+ {
+ bResult = oBill.ModifyByIDDynamic(oBill.oModel.HItemID);
+ }
+ }
+ //淇濆瓨
+ //淇濆瓨瀹屾瘯鍚庡鐞�
+
+ /*if (oBill.oModel.HItemID == 0)
+ {
+ //bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
+ bResult = oBill.AddNew();
+ }
+ else
+ {
+ bResult = oBill.ModifyByID(oBill.oModel.HItemID);
+ }*/
+ if (bResult)
+ {
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "淇濆瓨鎴愬姛锛�";
+ //WebAPIController.Add_Log("閫佽揣鍗曚笅鎺�", UserName, "鐢熸垚閫佽揣鍗�");
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.sExeReturnInfo;
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨澶辫触锛�" + e.ToString();
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+ #region 淇濆瓨鐗╂枡_鎵归噺
+ /// <summary>
+ /// 淇濆瓨鐗╂枡
+ /// </summary>
+ /// <param name="msg"></param>
+ /// <returns></returns>
+ [Route("Gy_Material/SaveGy_MaterialList_Modify")]
+ [HttpPost]
+ public object SaveGy_MaterialList_Modify([FromBody] JObject msg)
+ {
+ DataSet ds;
+ var _value = msg["msg"].ToString();
+ string msg3 = _value.ToString();
+ string[] sArray = msg3.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
+ string msg1 = sArray[0].ToString();
+ string msg2 = sArray[1].ToString();
+ string msg_HUSEORGID = sArray[2].ToString();
+ string msg_itemIdList = sArray[3].ToString();
+ string msg_UpdateInfo = sArray[4].ToString();
+ bool bResult = false;
+ Int64 HItemID = 0;
+ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+
+ //缂栬緫鏉冮檺
+ if (!DBUtility.ClsPub.Security_Log_second("Gy_Material_Edit", 1, false, msg2))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏃犱繚瀛樻潈闄愶紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ //鑾峰彇鏈�澶D鍊艰祴鍊�
+ DataSet Maxds = oCN.RunProcReturn("select MAX(HItemID) HItemID from Gy_Material ", "Gy_Material");
+ if (Maxds != null || Maxds.Tables[0].Rows.Count > 0)
+ {
+ //HItemID= Maxds.Tables[0].Rows[0]["HItemID"]
+ var maxid = Convert.ToInt32(Maxds.Tables[0].Rows[0]["HItemID"]);
+ maxid += 1;
+ HItemID = maxid;
+ }
+ ListModels oListModels = new ListModels();
+
+ try
+ {
+ DLL.ClsGy_Material_Ctl oBill = new DLL.ClsGy_Material_Ctl();
+ List<Models.ClsGy_Material_Model> lsmain = new List<Models.ClsGy_Material_Model>();
+ msg1 = msg1.Replace("\\", "");
+ msg1 = msg1.Replace("\n", ""); //\n
+ lsmain = oListModels.getObjectByJson_Gy_Material(msg1);
+ JObject jobject = JObject.Parse(msg_UpdateInfo);
+ var paramStr = "";
+ foreach (var property in jobject.Properties())
+ {
+ string key = property.Name;
+ string value = property.Value.ToString();
+
+ // 鎷兼帴鏍煎紡: key=value
+ paramStr += string.Format("{0}='{1}',", key, value);
+ // 鍒犻櫎鏈�鍚庝竴涓�楀彿
+
+ }
+ paramStr = paramStr.Substring(0, paramStr.Length - 1);
+
+ bResult = oBill.ModifyByIDListDynamic(msg_itemIdList, paramStr, lsmain);
+
+
+ if (bResult)
+ {
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "淇濆瓨鎴愬姛锛�";
+ //WebAPIController.Add_Log("閫佽揣鍗曚笅鎺�", UserName, "鐢熸垚閫佽揣鍗�");
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.sExeReturnInfo;
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨澶辫触锛�" + e.ToString();
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
[Route("Gy_Material/SaveGy_MaterialListApi")]
[HttpPost]
public object SaveGy_MaterialListApi([FromBody] JObject msg)
@@ -628,8 +982,10 @@
List<Models.ClsGy_Material_Model> lsmain = new List<Models.ClsGy_Material_Model>();
msg1 = msg1.Replace("\\", "");
msg1 = msg1.Replace("\n", ""); //\n
- lsmain = oListModels.getObjectByJson_Gy_Material(msg1);
+ lsmain = oListModels.getObjectByJson_Gy_Material(msg1);
+
oBill.oModel = lsmain[0];
+ LogService.Write("鐗╂枡锛�"+ msg1);
//淇濆瓨
bool bResult = oBill.AddNewApi();
if (bResult)
@@ -1452,12 +1808,12 @@
}
if (sWhere == null || sWhere.Equals(""))
{
- ds = oCN.RunProcReturn("select * from h_v_Gy_MouldFileList " + sWhere + "order by 鏃ユ湡 desc", "h_v_Gy_MouldFileList");
+ ds = oCN.RunProcReturn("select * from h_v_Gy_MouldFileList " + sWhere + "order by 鏉$爜缂栧彿 desc", "h_v_Gy_MouldFileList");
}
else
{
string sql1 = "select * from h_v_Gy_MouldFileList where 1 = 1 ";
- string sql = sql1 + sWhere + "order by 鏃ユ湡 desc";
+ string sql = sql1 + sWhere + "order by 鏉$爜缂栧彿 desc";
ds = oCN.RunProcReturn(sql, "h_v_Gy_MouldFileList");
}
@@ -1747,7 +2103,7 @@
{
objJsonResult.code = "0";
objJsonResult.count = 0;
- objJsonResult.Message = "鏃犲垹闄ゆ潈闄愶紒";
+ objJsonResult.Message = "[0000-1-058]鏃犲垹闄ゆ潈闄愶紒";
objJsonResult.data = null;
return objJsonResult;
}
@@ -1758,7 +2114,7 @@
{
objJsonResult.code = "0";
objJsonResult.count = 0;
- objJsonResult.Message = "鍒犻櫎鏉$爜鍓嶅垽鏂彂鐢熼敊璇紒";
+ objJsonResult.Message = "[3899-1-001]鍒犻櫎鏉$爜鍓嶅垽鏂彂鐢熼敊璇紒";
objJsonResult.data = null;
return objJsonResult;
}
@@ -1768,9 +2124,9 @@
{
objJsonResult.code = "0";
objJsonResult.count = 0;
- objJsonResult.Message = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HRemark"]);
+ objJsonResult.Message = "[0000-1-007]" + DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HRemark"]);
objJsonResult.data = null;
- return objJsonResult;
+ return objJsonResult;
}
}
//Int64 lngBillKey = 0;
@@ -1779,7 +2135,7 @@
{
objJsonResult.code = "0";
objJsonResult.count = 0;
- objJsonResult.Message = "鍗曟嵁ID涓虹┖锛�";
+ objJsonResult.Message = "[0000-1-009]鍗曟嵁ID涓虹┖锛�";
objJsonResult.data = null;
return objJsonResult;
}
@@ -1824,7 +2180,7 @@
oCN.Commit();
objJsonResult.code = "1";
objJsonResult.count = 1;
- objJsonResult.Message = "鍒犻櫎鎴愬姛";
+ objJsonResult.Message = "[0000-1-008]鍒犻櫎鎴愬姛";
objJsonResult.data = null;
return objJsonResult;
}
@@ -1832,7 +2188,7 @@
{
objJsonResult.code = "0";
objJsonResult.count = 0;
- objJsonResult.Message = "鍗曟嵁鏈壘鍒�";
+ objJsonResult.Message = "[0000-1-045]鍗曟嵁鏈壘鍒�";
objJsonResult.data = null;
return objJsonResult;
}
@@ -1842,7 +2198,7 @@
oCN.RollBack();
objJsonResult.code = "0";
objJsonResult.count = 0;
- objJsonResult.Message = e.Message;
+ objJsonResult.Message = "[0000-1-007]" + e.Message;
objJsonResult.data = null;
return objJsonResult;
}
@@ -1869,7 +2225,7 @@
{
objJsonResult.code = "0";
objJsonResult.count = 0;
- objJsonResult.Message = "浣滃簾澶辫触锛佹棤鏉冮檺锛�";
+ objJsonResult.Message = "[0000-1-063]浣滃簾澶辫触锛佹棤鏉冮檺锛�";
objJsonResult.data = null;
return objJsonResult;
}
@@ -1878,7 +2234,7 @@
{
objJsonResult.code = "0";
objJsonResult.count = 0;
- objJsonResult.Message = "HInterID灏忎簬0锛�";
+ objJsonResult.Message = "[0000-1-009]HInterID灏忎簬0锛�";
objJsonResult.data = null;
return objJsonResult;
}
@@ -1890,6 +2246,24 @@
//杩涜闇�瑕佽繘琛岀殑浣滃簾/鍙嶄綔搴熸搷浣�
if (IsAudit == 0) //浣滃簾鎻愪氦
{
+ string sql_deleteBeforeCtrl = "exec h_p_Gy_BarCodeBill_Cancelltion_Before " + HInterID;
+ DataSet ds_deleteBeforeCtrl = oCN.RunProcReturn(sql_deleteBeforeCtrl, "h_p_Gy_BarCodeBill_Cancelltion_Before");
+ if (ds_deleteBeforeCtrl == null || ds_deleteBeforeCtrl.Tables.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "浣滃簾澶辫触锛氭潯鐮佷綔搴熷墠鎺у埗澶辫触锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }else if(ds_deleteBeforeCtrl.Tables[0].Rows[0]["HBack"].ToString() != "0")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "浣滃簾澶辫触锛�" + ds_deleteBeforeCtrl.Tables[0].Rows[0]["HRemark"].ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
oCN.BeginTran();
//浣滃簾鏉$爜
@@ -1906,7 +2280,7 @@
objJsonResult.code = "1";
objJsonResult.count = 1;
- objJsonResult.Message = "浣滃簾鎴愬姛";
+ objJsonResult.Message = "[0000-1-040]浣滃簾鎴愬姛";
objJsonResult.data = null;
oCN.Commit();
@@ -1915,7 +2289,7 @@
{
objJsonResult.code = "0";
objJsonResult.count = 0;
- objJsonResult.Message = "浣滃簾澶辫触!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo;
+ objJsonResult.Message = "[0000-1-042]浣滃簾澶辫触!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo;
objJsonResult.data = null;
oCN.RollBack();
@@ -1938,7 +2312,7 @@
objJsonResult.code = "0";
objJsonResult.count = 0;
- objJsonResult.Message = "鍙嶄綔搴熷け璐ワ紝鍘熷洜锛氬弽浣滃簾鏉$爜鍓嶅垽鏂彂鐢熼敊璇紒";
+ objJsonResult.Message = "[0000-1-042]鍙嶄綔搴熷け璐ワ紝鍘熷洜锛氬弽浣滃簾鏉$爜鍓嶅垽鏂彂鐢熼敊璇紒";
objJsonResult.data = null;
return objJsonResult;
}
@@ -1950,7 +2324,7 @@
objJsonResult.code = "1";
objJsonResult.count = 1;
- objJsonResult.Message = "鍙嶄綔搴熷け璐ワ紝鍘熷洜锛�" + DBUtility.ClsPub.isStrNull(DS.Tables[0].Rows[0]["HRemark"]);
+ objJsonResult.Message = "[0000-1-042]鍙嶄綔搴熷け璐ワ紝鍘熷洜锛�" + DBUtility.ClsPub.isStrNull(DS.Tables[0].Rows[0]["HRemark"]);
objJsonResult.data = null;
return objJsonResult;
}
@@ -1972,7 +2346,7 @@
objJsonResult.code = "1";
objJsonResult.count = 1;
- objJsonResult.Message = "鍙嶄綔搴熸垚鍔�";
+ objJsonResult.Message = "[0000-1-043]鍙嶄綔搴熸垚鍔�";
objJsonResult.data = null;
oCN.Commit();
return objJsonResult;
@@ -1981,7 +2355,7 @@
{
objJsonResult.code = "0";
objJsonResult.count = 0;
- objJsonResult.Message = "鍙嶄綔搴熷け璐�!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo;
+ objJsonResult.Message = "[0000-1-042]鍙嶄綔搴熷け璐�!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo;
objJsonResult.data = null;
oCN.RollBack();
return objJsonResult;
@@ -1994,7 +2368,188 @@
oCN.RollBack();
objJsonResult.code = "0";
objJsonResult.count = 0;
- objJsonResult.Message = "浣滃簾澶辫触鎴栬�呭弽浣滃簾澶辫触锛�" + e.ToString();
+ objJsonResult.Message = "[0000-1-044]浣滃簾澶辫触鎴栬�呭弽浣滃簾澶辫触锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+ #region 鏉$爜涓绘。缁存姢 鎵归噺浣滃簾/鎵归噺鍙嶄綔搴�
+ /// <summary>
+ /// </summary>
+ /// <param name="HInterID">鍗曟嵁ID</param>
+ /// <param name="IsAudit">浣滃簾(0),鍙嶄綔搴�(1)</param>
+ /// <param name="CurUserName">浣滃簾浜�</param>
+ /// <returns></returns>
+ [Route("Gy_BarCodeBillList/DeleteBatchGy_BarCodeBillList")]
+ [HttpGet]
+ public object DeleteBatchGy_BarCodeBillList(string HInterID, int IsAudit, string CurUserName)
+ {
+ string ModRightNameCheck = "Gy_BarCodeBillList_Delete";
+ DBUtility.ClsPub.CurUserName = CurUserName;
+ try
+ {
+ //妫�鏌ユ潈闄�
+ if (!DBUtility.ClsPub.Security_Log_second(ModRightNameCheck, 1, false, CurUserName))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "[0000-1-063]浣滃簾/鍙嶄綔搴熷け璐ワ紒鏃犳潈闄愶紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //HInterID鏁版嵁鍒ゆ柇
+ if (HInterID.Length<=0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏈�夋嫨闇�瑕佷綔搴�/鍙嶄綔搴� 鐨勬潯鐮�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+
+ Int64 lngBillKey = 0;
+ lngBillKey = DBUtility.ClsPub.isLong(HInterID); //瀵笻InterID杩涜绫诲瀷鐨勮浆鎹�
+
+ //杩涜闇�瑕佽繘琛岀殑浣滃簾/鍙嶄綔搴熸搷浣�
+ if (IsAudit == 0) //浣滃簾鎻愪氦
+ {
+ string sql_deleteBeforeCtrl = "exec h_p_Gy_BarCodeBill_Cancelltion_Before '" + HInterID + "'";
+ DataSet ds_deleteBeforeCtrl = oCN.RunProcReturn(sql_deleteBeforeCtrl, "h_p_Gy_BarCodeBill_Cancelltion_Before");
+ if (ds_deleteBeforeCtrl == null || ds_deleteBeforeCtrl.Tables.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "浣滃簾澶辫触锛氭潯鐮佷綔搴熷墠鎺у埗澶辫触锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else if (ds_deleteBeforeCtrl.Tables[0].Rows[0]["HBack"].ToString() != "0")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "浣滃簾澶辫触锛�" + ds_deleteBeforeCtrl.Tables[0].Rows[0]["HRemark"].ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ oCN.BeginTran();
+
+ //浣滃簾鏉$爜
+ oCN.RunProc("update Gy_BarCodeBill set HStopflag=1,HDeleteMan='" + CurUserName + "',HDeleteDate=getdate() where HItemID in (" + HInterID + ")", ref DBUtility.ClsPub.sExeReturnInfo);
+
+ string sql = "select * from Gy_BarCodeBill where HItemID in (" + HInterID + ")";
+ ds = oCN.RunProcReturn(sql, "Gy_BarCodeBill");
+ if (ds != null && ds.Tables[0].Rows.Count > 0)
+ {
+ string HBarCode = "";
+ for(int i = 0; i < ds.Tables[0].Rows.Count; i++)
+ {
+ HBarCode = ds.Tables[0].Rows[0]["HBarCode"].ToString() + "锛�";
+ }
+
+
+ //娣诲姞鎿嶄綔鏃ュ織
+ oCN.RunProc("Insert into System_log (GeginDate, userid, WorkstationName, WorkList, SystemName, NetuserName, State) select GETDATE(),'" + CurUserName + "','" + DBUtility.ClsPub.ComputerName + "','浣滃簾鏉$爜锛�" + HBarCode + "','WMS绯荤粺-鏉$爜妗f鍒楄〃妯″潡','" + DBUtility.ClsPub.IPAddress + "','浣滃簾'", ref DBUtility.ClsPub.sExeReturnInfo);
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "[0000-1-040]浣滃簾鎴愬姛";
+ objJsonResult.data = null;
+
+ oCN.Commit();
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "[0000-1-042]浣滃簾澶辫触!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo;
+ objJsonResult.data = null;
+
+ oCN.RollBack();
+ }
+
+
+ return objJsonResult;
+ }
+ if (IsAudit == 1) //鍙嶅叧闂彁浜�
+ {
+ oCN.BeginTran();
+
+ //#region 鍙嶄綔搴熸潯鐮佸墠杩涜鍒ゆ柇
+ ////鍙嶄綔搴熸潯鐮佸墠杩涜鍒ゆ柇------------------------------------------------------------------------------------------------------------------------------------------------------
+ ////--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ //DataSet DS = oCN.RunProcReturn("exec h_p_Gy_BarCodeBill_UnCancelltion '" + HInterID + "','N'", "h_p_Gy_BarCodeBill_UnCancelltion", ref DBUtility.ClsPub.sExeReturnInfo);
+ //if (DS == null || DS.Tables[0].Rows.Count <= 0)
+ //{
+ // oCN.RollBack();
+
+ // objJsonResult.code = "0";
+ // objJsonResult.count = 0;
+ // objJsonResult.Message = "[0000-1-042]鍙嶄綔搴熷け璐ワ紝鍘熷洜锛氬弽浣滃簾鏉$爜鍓嶅垽鏂彂鐢熼敊璇紒";
+ // objJsonResult.data = null;
+ // return objJsonResult;
+ //}
+ //else
+ //{
+ // if (DBUtility.ClsPub.isStrNull(DS.Tables[0].Rows[0][0]) == "1")
+ // {
+ // oCN.RollBack();
+
+ // objJsonResult.code = "1";
+ // objJsonResult.count = 1;
+ // objJsonResult.Message = "[0000-1-042]鍙嶄綔搴熷け璐ワ紝鍘熷洜锛�" + DBUtility.ClsPub.isStrNull(DS.Tables[0].Rows[0]["HRemark"]);
+ // objJsonResult.data = null;
+ // return objJsonResult;
+ // }
+ //}
+ ////--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ ////--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ //#endregion
+
+ //鍙嶄綔搴熸潯鐮�
+ oCN.RunProc("update Gy_BarCodeBill set HStopflag=0,HDeleteMan='',HDeleteDate=null where HItemID in (" + HInterID + ")", ref DBUtility.ClsPub.sExeReturnInfo);
+
+ //澧炲姞鎿嶄綔鏃ュ織
+ string sql = "select * from Gy_BarCodeBill where HItemID in (" + HInterID + ")";
+ ds = oCN.RunProcReturn(sql, "Gy_BarCodeBill");
+ if (ds != null && ds.Tables[0].Rows.Count > 0)
+ {
+ string HBarCode = "";
+ for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
+ {
+ HBarCode = ds.Tables[0].Rows[0]["HBarCode"].ToString() + "锛�";
+ }
+
+ oCN.RunProc("Insert into System_log (GeginDate, userid, WorkstationName, WorkList, SystemName, NetuserName, State) select GETDATE(),'" + CurUserName + "','" + DBUtility.ClsPub.ComputerName + "','鍙嶄綔搴熸潯鐮侊細" + HBarCode + "','WMS绯荤粺-鏉$爜妗f鍒楄〃妯″潡','" + DBUtility.ClsPub.IPAddress + "','鍙嶄綔搴�'", ref DBUtility.ClsPub.sExeReturnInfo);
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "[0000-1-043]鍙嶄綔搴熸垚鍔�";
+ objJsonResult.data = null;
+ oCN.Commit();
+ return objJsonResult;
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "[0000-1-042]鍙嶄綔搴熷け璐�!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo;
+ objJsonResult.data = null;
+ oCN.RollBack();
+ return objJsonResult;
+ }
+ }
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "[0000-1-044]浣滃簾澶辫触鎴栬�呭弽浣滃簾澶辫触锛�" + e.ToString();
objJsonResult.data = null;
return objJsonResult;
}
@@ -2140,6 +2695,12 @@
string HMouldUseStatus = mainList[0].HMouldUseStatus;
int HCREATEORGID = mainList[0].HCREATEORGID;
int HUSEORGID = mainList[0].HUSEORGID;
+ bool HTransPackFlag = mainList[0].HTransPackFlag; //鍛ㄨ浆瀹瑰櫒鏍囪
+ bool HSendPackFlag = mainList[0].HSendPackFlag; //鍙戣揣瀹瑰櫒鏍囪
+ int HMouldLength = mainList[0].HMouldLength; //闀�
+ int HMouldWidth = mainList[0].HMouldWidth; //瀹�
+ int HMouldHeight = mainList[0].HMouldHeight; //楂�
+ int HMouldFoldHeight = mainList[0].HMouldFoldHeight; //鎶樺彔楂樺害
//淇濆瓨鍓嶆帶鍒�=========================================
string HBillNote = "";
@@ -2175,17 +2736,20 @@
",HPrintQty,HMouldStatus,HWhID,HRoutingID,HCaveQty" +
",HBomID,HVersion,HSPGroupID,HSPID,HDesignLife,HNowSupID,HNowSupTypeID" +
",HUseLife,HLeaveLife,HProdQty,HProdWeight,HMouldOWNER,HSaveLife,HMouldDotCheckRuleInterID,HMouldMaintainRuleInterID,HBarCode,HMadeSupID" +
- ",HMouldClass,HNowWHID,HNowSPID,HInitLife,HMouldUseStatus,HCREATEORGID,HUSEORGID) " +
- " values('" + BillType + "','" + BillType + "'," + HInterID + ",'" + HBillNo + "','" + HDate + "'" +
- "," + HYear + "," + HPeriod + ",'" + HRemark + "','" + HMaker + "',getdate()" +
- ",'" + HMouldNo + "','" + HName + "','" + HModel + "','" + HModel2 + "','" + HDiameter + "'" +
- ",'" + HSubjoin + "','" + HSubjoin2 + "','" + HPICNo + "','" + HWorkMaterModel + "'" +
- "," + HMaterID + ",'" + HMaterNumber + "'," + HMouleTypeID + "," + HUnitID +
- ",'" + HOutComDate + "','" + HOutComNo + "'," + HDeptID + "," + HSupID + ",'" + HSupNumber + "'" +
- "," + HPrintQty + ",'" + HMouldStatus + "'," + HWHID + "," + HRoutingID + "," + HCaveQty +
- "," + HBOMID + ",'" + HVersion + "'," + HSPGroupID + "," + HSPID + ",'" + HDesignLife + "','" + HNowSupID + "','" + HNowSupTypeID + "'" +
- ",'" + HUseLife + "','" + HLeaveLife + "','" + HProdQty + "','" + HProdWeight + "','" + HMouldOWNER + "','" + HSaveLife + "','" + HMouldDotCheckRuleInterID + "','" + HMouldMaintainRuleInterID + "','" + HBarCode + "'," + HMadeSupID +
- ",'"+ HMouldClass + "'," + HNowWHID + "," + HNowSPID + ",'" + HInitLife + "','" + HMouldUseStatus + "',"+ HCREATEORGID + ","+ HUSEORGID + ") ");
+ ",HMouldClass,HNowWHID,HNowSPID,HInitLife,HMouldUseStatus,HCREATEORGID,HUSEORGID " +
+ ",HMouldLength,HMouldWidth,HMouldHeight,HMouldFoldHeight,HTransPackFlag,HSendPackFlag ) " +
+
+ " values('" + BillType + "','" + BillType + "'," + HInterID + ",'" + HBillNo + "','" + HDate + "'" +
+ "," + HYear + "," + HPeriod + ",'" + HRemark + "','" + HMaker + "',getdate()" +
+ ",'" + HMouldNo + "','" + HName + "','" + HModel + "','" + HModel2 + "','" + HDiameter + "'" +
+ ",'" + HSubjoin + "','" + HSubjoin2 + "','" + HPICNo + "','" + HWorkMaterModel + "'" +
+ "," + HMaterID + ",'" + HMaterNumber + "'," + HMouleTypeID + "," + HUnitID +
+ ",'" + HOutComDate + "','" + HOutComNo + "'," + HDeptID + "," + HSupID + ",'" + HSupNumber + "'" +
+ "," + HPrintQty + ",'" + HMouldStatus + "'," + HWHID + "," + HRoutingID + "," + HCaveQty +
+ "," + HBOMID + ",'" + HVersion + "'," + HSPGroupID + "," + HSPID + ",'" + HDesignLife + "','" + HNowSupID + "','" + HNowSupTypeID + "'" +
+ ",'" + HUseLife + "','" + HLeaveLife + "','" + HProdQty + "','" + HProdWeight + "','" + HMouldOWNER + "','" + HSaveLife + "','" + HMouldDotCheckRuleInterID + "','" + HMouldMaintainRuleInterID + "','" + HBarCode + "'," + HMadeSupID +
+ ",'" + HMouldClass + "'," + HNowWHID + "," + HNowSPID + ",'" + HInitLife + "','" + HMouldUseStatus + "'," + HCREATEORGID + "," + HUSEORGID +
+ "," + HMouldLength + "," + HMouldWidth + "," + HMouldHeight + "," + HMouldFoldHeight + "," + Convert.ToString(HTransPackFlag ? 1 : 0) + "," + Convert.ToString(HSendPackFlag ? 1 : 0) + ") ");
//瀛愯〃
oCN.RunProc("Insert into Gy_MouldFileSub " +
@@ -2337,6 +2901,13 @@
int HNowSPID = mainList[0].HNowSPID;
string HMouldUseStatus = mainList[0].HMouldUseStatus;
int HUSEORGID = mainList[0].HUSEORGID;
+ DateTime HNextMainDate = mainList[0].HNextMainDate;
+ bool HTransPackFlag = mainList[0].HTransPackFlag; //鍛ㄨ浆瀹瑰櫒鏍囪
+ bool HSendPackFlag = mainList[0].HSendPackFlag; //鍙戣揣瀹瑰櫒鏍囪
+ int HMouldLength = mainList[0].HMouldLength; //闀�
+ int HMouldWidth = mainList[0].HMouldWidth; //瀹�
+ int HMouldHeight = mainList[0].HMouldHeight; //楂�
+ int HMouldFoldHeight = mainList[0].HMouldFoldHeight; //鎶樺彔楂樺害
//鑻AINDI閲嶅鍒欓噸鏂拌幏鍙�
oCN.BeginTran();
@@ -2362,63 +2933,70 @@
}
//=========================================================
- //涓昏〃
+ //涓昏〃
oCN.RunProc("UpDate Gy_MouldFileMain set " +
- " HBillNo='" + HBillNo + "'" + //鍥哄畾璧嬪��===============
- ",HDate='" + HDate + "'" +
- ",HYear='" + HYear.ToString() + "'" +
- ",HPeriod='" + HPeriod.ToString() + "'" +
- ",HRemark='" + HRemark + "'" +
- ",HUpDater='" + HUpDater + "'" +
- ",HUpDateDate=getdate()" +
- //========================================
- ",HMouldNo='" + HMouldNo + "'" +
- ",HName='" + HName + "'" +
- ",HModel='" + HModel + "'" +
- ",HModel2='" + HModel2 + "'" +
- ",HDiameter='" + HDiameter + "'" +
- ",HSubjoin='" + HSubjoin + "'" +
- ",HSubjoin2='" + HSubjoin2 + "'" +
- ",HPICNo='" + HPICNo + "'" +
- ",HWorkMaterModel='" + HWorkMaterModel + "'" +
- ",HMaterID=" + HMaterID.ToString() +
- ",HUSEORGID=" + HUSEORGID.ToString() +
- ",HMaterNumber='" + HMaterNumber + "'" +
- ",HMouldClass='" + HMouldClass + "'" +
- ",HMouldType=" + HMouleTypeID.ToString() +
- ",HUnitID=" + HUnitID.ToString() +
- ",HOutComDate='" + HOutComDate + "'" +
- ",HOutComNo='" + HOutComNo + "'" +
- ",HDeptID=" + HDeptID.ToString() +
- ",HSupID=" + HSupID.ToString() +
- ",HSupNumber='" + HSupNumber + "'" +
- ",HPrintQty=" + HPrintQty.ToString() +
- ",HMouldStatus='" + HMouldStatus + "'" +
- ",HSaveLife='" + HSaveLife + "'" +
- ",HWhID=" + HWHID.ToString() +
- ",HRoutingID=" + HRoutingID.ToString() +
- ",HBomID=" + HBOMID.ToString() +
- ",HVersion='" + HVersion + "'" +
- ",HSPGroupID=" + HSPGroupID.ToString() +
- ",HSPID=" + HSPID.ToString() +
- ",HDesignLife=" + HDesignLife.ToString() +
- ",HCaveQty=" + HCaveQty.ToString() +
- ",HUseLife=" + HUseLife.ToString() +
- ",HLeaveLife=" + HLeaveLife.ToString() +
- ",HProdQty=" + HProdQty.ToString() +
- ",HMouldDotCheckRuleInterID=" + HMouldDotCheckRuleInterID.ToString() +
- ",HMouldMaintainRuleInterID=" + HMouldMaintainRuleInterID.ToString() +
- ",HMouldOWNER='" + HMouldOWNER + "'" +
- ",HNowSupID=" + HNowSupID.ToString() +
- ",HNowSupTypeID=" + HNowSupTypeID.ToString() +
- ",HProdWeight=" + HProdWeight.ToString() +
- ",HBarCode='" + HBarCode.ToString() + "'" +
- ",HMadeSupID=" + HMadeSupID +
- ",HNowWHID=" + HNowWHID +
- ",HNowSPID=" + HNowSPID +
- ",HInitLife='" + HInitLife +
- "',HMouldUseStatus='" + HMouldUseStatus +
- "' where HInterID=" + HInterID.ToString());
+ " HBillNo='" + HBillNo + "'" + //鍥哄畾璧嬪��===============
+ ",HDate='" + HDate + "'" +
+ ",HYear='" + HYear.ToString() + "'" +
+ ",HPeriod='" + HPeriod.ToString() + "'" +
+ ",HRemark='" + HRemark + "'" +
+ ",HUpDater='" + HUpDater + "'" +
+ ",HUpDateDate=getdate()" +
+ //========================================
+ ",HMouldNo='" + HMouldNo + "'" +
+ ",HName='" + HName + "'" +
+ ",HModel='" + HModel + "'" +
+ ",HModel2='" + HModel2 + "'" +
+ ",HDiameter='" + HDiameter + "'" +
+ ",HSubjoin='" + HSubjoin + "'" +
+ ",HSubjoin2='" + HSubjoin2 + "'" +
+ ",HPICNo='" + HPICNo + "'" +
+ ",HWorkMaterModel='" + HWorkMaterModel + "'" +
+ ",HMaterID=" + HMaterID.ToString() +
+ ",HUSEORGID=" + HUSEORGID.ToString() +
+ ",HMaterNumber='" + HMaterNumber + "'" +
+ ",HMouldClass='" + HMouldClass + "'" +
+ ",HMouldType=" + HMouleTypeID.ToString() +
+ ",HUnitID=" + HUnitID.ToString() +
+ ",HOutComDate='" + HOutComDate + "'" +
+ ",HOutComNo='" + HOutComNo + "'" +
+ ",HDeptID=" + HDeptID.ToString() +
+ ",HSupID=" + HSupID.ToString() +
+ ",HSupNumber='" + HSupNumber + "'" +
+ ",HPrintQty=" + HPrintQty.ToString() +
+ ",HMouldStatus='" + HMouldStatus + "'" +
+ ",HSaveLife='" + HSaveLife + "'" +
+ ",HWhID=" + HWHID.ToString() +
+ ",HRoutingID=" + HRoutingID.ToString() +
+ ",HBomID=" + HBOMID.ToString() +
+ ",HVersion='" + HVersion + "'" +
+ ",HSPGroupID=" + HSPGroupID.ToString() +
+ ",HSPID=" + HSPID.ToString() +
+ ",HDesignLife=" + HDesignLife.ToString() +
+ ",HCaveQty=" + HCaveQty.ToString() +
+ ",HUseLife=" + HUseLife.ToString() +
+ ",HLeaveLife=" + HLeaveLife.ToString() +
+ ",HProdQty=" + HProdQty.ToString() +
+ ",HMouldDotCheckRuleInterID=" + HMouldDotCheckRuleInterID.ToString() +
+ ",HMouldMaintainRuleInterID=" + HMouldMaintainRuleInterID.ToString() +
+ ",HMouldOWNER='" + HMouldOWNER + "'" +
+ ",HNowSupID=" + HNowSupID.ToString() +
+ ",HNowSupTypeID=" + HNowSupTypeID.ToString() +
+ ",HProdWeight=" + HProdWeight.ToString() +
+ ",HBarCode='" + HBarCode.ToString() + "'" +
+ ",HMadeSupID=" + HMadeSupID +
+ ",HNowWHID=" + HNowWHID +
+ ",HNowSPID=" + HNowSPID +
+ ",HTransPackFlag=" + Convert.ToString(HTransPackFlag ? 1 : 0) +
+ ",HSendPackFlag=" + Convert.ToString(HSendPackFlag ? 1 : 0) +
+ ",HMouldLength=" + HMouldLength +
+ ",HMouldWidth=" + HMouldWidth +
+ ",HMouldHeight=" + HMouldHeight +
+ ",HMouldFoldHeight=" + HMouldFoldHeight +
+ ",HInitLife='" + HInitLife +
+ "',HNextMainDate='" + HNextMainDate +
+ "',HMouldUseStatus='" + HMouldUseStatus +
+ "' where HInterID=" + HInterID.ToString());
//淇敼瀛愰」鐩唬鐮�
//oCN.RunProc("exec h_p_Gy_UpdateNumber Gy_Department,'" + HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo);
@@ -2636,6 +3214,17 @@
objJsonResult.data = null;
return objJsonResult;
}
+
+ ds = oCN.RunProcReturn("select * from Gy_MouldFileMain where HInterID = " + hmainid + " and ISNULL(HChecker,'') <> ''", "Gy_MouldFileMain");
+ if (ds.Tables[0].Rows.Count > 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍒犻櫎澶辫触锛佸崟鎹凡瀹℃牳锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
if (oBill.DeleteBill(hmainid, ref DBUtility.ClsPub.sExeReturnInfo))
{
oCN.BeginTran();
@@ -2782,7 +3371,7 @@
#region [鍚屾鍩虹璧勬枡]
[Route("Gy_Material/Gy_MaterialViewApi")]
[HttpGet]
- public json Gy_MaterialViewApi(string Number, string Type)
+ public json Gy_MaterialViewApi(string Number, string Type, string HUseOrgID)
{
string sql = string.Empty;
string sReturn = "";
@@ -2840,14 +3429,24 @@
{
#region [鍏湁浜戞ā寮忥紝璋冪敤WEBAPI鐨勬柟寮忚繘琛屾洿鏂癩
var json = new
+ // {
+ // CreateOrgId = 0,
+ // Number = Number,
+ // Id = ""
+ // };
{
- CreateOrgId = 0,
- Number = Number,
- Id = ""
+ FormId= "BD_MATERIAL",
+ FieldKeys= "FMASTERID,FNUMBER,FNAME,FSPECIFICATION,FFORBIDSTATUS,FErpClsID,FBaseUnitId,FLENGTH,FWIDTH,FHEIGHT,FNETWEIGHT,FGROSSWEIGHT,FOldNumber,FSTOCKPLACEID,FPLANMODE,FCREATEDATE,FCREATEORGID,FUSEORGID,FISBATCHMANAGE,FCheckIncoming,FIsEnable1,FIsKFPeriod,FAuxUnitID,FSNUNIT,FBaseUnitId,FSaleUnitId,FSalePriceUnitId,FPerUnitStandHour,FStdLaborPrePareTime,FStdMachinePrepareTime",
+ FilterString= $@"FNUMBER='{Number}' AND FUSEORGID={HUseOrgID}",
+ OrderString= "",
+ TopRowCount= 0,
+ StartRow= 0,
+ Limit= 0
};
- #region [閲戣澏閮ㄥ垎]
- //鐧诲綍閲戣澏
- var loginRet = InvokeHelper.Login();
+
+ #region [閲戣澏閮ㄥ垎]
+ //鐧诲綍閲戣澏
+ var loginRet = InvokeHelper.Login();
var isSuccess = JObject.Parse(loginRet)["LoginResultType"].Value<int>();
//鍒ゆ柇鏄惁鐧诲綍鎴愬姛
if (isSuccess < 0)
@@ -2859,14 +3458,22 @@
return objJsonResult;
}
//鏌ョ湅 鑾峰彇鏁版嵁
- var _result = InvokeHelper.View("BD_MATERIAL", JsonConvert.SerializeObject(json));
- var _saveObj = JObject.Parse(_result);
+ var _result = InvokeHelper.Query("BD_MATERIAL", JsonConvert.SerializeObject(json));
+ var _saveObj = JArray.Parse(_result);
//鍒ゆ柇鏁版嵁鏄惁鑾峰彇鎴愬姛
- if (_saveObj["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() != "TRUE")
+ // if (_saveObj["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() != "TRUE")
+ // {
+ // objJsonResult.code = "0";
+ // objJsonResult.count = 0;
+ // objJsonResult.Message = "閲戣澏鐗╂枡鍚屾澶辫触jsonRoot锛�" + _result;
+ // objJsonResult.data = null;
+ // return objJsonResult;
+ // }
+ if (_saveObj.Count == 0)
{
objJsonResult.code = "0";
objJsonResult.count = 0;
- objJsonResult.Message = "閲戣澏鐗╂枡鍚屾澶辫触jsonRoot锛�" + _result;
+ objJsonResult.Message = "閲戣澏瀹㈡埛鍚屾澶辫触锛屼娇鐢ㄧ粍缁囧搴旂殑鐗╂枡浠g爜鏃犲搴旂殑鐗╂枡";
objJsonResult.data = null;
return objJsonResult;
}
@@ -2882,47 +3489,89 @@
#region [琛ㄦ暟鎹祴鍊糫
var jsonData = new
+ // {
+ // HItemID = _saveObj["Result"]["Result"]["Id"],
+ // HERPItemID = _saveObj["Result"]["Result"]["Id"],
+ // HNumber = _saveObj["Result"]["Result"]["Number"],
+ // HName = _saveObj["Result"]["Result"]["Name"][1]["Value"],
+ // HModel = _saveObj["Result"]["Result"]["Specification"][0]["Value"],
+ // HShortNumber = _saveObj["Result"]["Result"]["Number"],
+ // HParentID = 0,
+ // HLevel = 1,
+ // HEndFlag = 1,
+ // HStopflag = _saveObj["Result"]["Result"]["ForbidStatus"].ToString() == "A" ? 0 : 1 ,
+ // HRemark = "CLD-ERP瀵煎叆",
+ // HMaterClsID = _saveObj["Result"]["Result"]["MaterialBase"][0]["ErpClsID"],
+ // HUnitID = _saveObj["Result"]["Result"]["MaterialBase"][0]["BaseUnitId_Id"],
+ // HUnitGroupID = 0,
+ // HLength = _saveObj["Result"]["Result"]["MaterialBase"][0]["LENGTH"],
+ // HWidth = _saveObj["Result"]["Result"]["MaterialBase"][0]["WIDTH"],
+ // HHeight = _saveObj["Result"]["Result"]["MaterialBase"][0]["HEIGHT"],
+ // HJQty = _saveObj["Result"]["Result"]["MaterialBase"][0]["NETWEIGHT"],
+ // HMQty = _saveObj["Result"]["Result"]["MaterialBase"][0]["GROSSWEIGHT"],
+ // HOldMaterNumber = _saveObj["Result"]["Result"]["OldNumber"],
+ // HWHID = 0,
+ // HSPID = _saveObj["Result"]["Result"]["MaterialStock"][0]["StockPlaceId_Id"],
+ // HPlanMode = _saveObj["Result"]["Result"]["MaterialPlan"][0]["PlanMode"],
+ // HUseFlag = "鏈楠�",
+ // HMakeTime = _saveObj["Result"]["Result"]["CreateDate"],
+ // HMinPickQty = 0,
+ // HCREATEORGID = _saveObj["Result"]["Result"]["CreateOrgId_Id"],
+ // HUSEORGID = _saveObj["Result"]["Result"]["UseOrgId_Id"],
+ // HBatchManager = _saveObj["Result"]["Result"]["MaterialStock"][0]["IsBatchManage"].ToString() == "false" ? 0 : 1,
+ // HCHECKINCOMING = _saveObj["Result"]["Result"]["MaterialQM"][0]["CheckIncoming"].ToString() == "false" ? 0 : 1,
+ // HAuxPropFlag = _saveObj["Result"]["Result"]["MaterialAuxPty"][0]["IsEnable1"].ToString() == "false" ? 0 : 1,
+ // HISKFPERIOD = _saveObj["Result"]["Result"]["MaterialStock"][0]["IsKFPeriod"].ToString() == "false" ? 0 : 1,
+ // HAuxUnitID = _saveObj["Result"]["Result"]["MaterialStock"][0]["AuxUnitID_Id"],
+ // HSNUnitID = _saveObj["Result"]["Result"]["MaterialStock"][0]["SNUnit_Id"],
+ // HBASEUNITID = _saveObj["Result"]["Result"]["MaterialBase"][0]["BaseUnitId_Id"],
+ // HSALEUNITID = _saveObj["Result"]["Result"]["MaterialSale"][0]["SaleUnitId_Id"],
+ // HSALEPRICEUNITID = _saveObj["Result"]["Result"]["MaterialSale"][0]["SalePriceUnitId_Id"],
+ // HPERUNITSTANDHOUR = _saveObj["Result"]["Result"]["MaterialProduce"][0]["PerUnitStandHour"],
+ // HSTDLABORPREPARETIME = _saveObj["Result"]["Result"]["MaterialProduce"][0]["StdLaborPrePareTime"],
+ // HSTDMACHINEPREPARETIME = _saveObj["Result"]["Result"]["MaterialProduce"][0]["StdMachinePrepareTime"]
+ // };
{
- HItemID = _saveObj["Result"]["Result"]["Id"],
- HERPItemID = _saveObj["Result"]["Result"]["Id"],
- HNumber = _saveObj["Result"]["Result"]["Number"],
- HName = _saveObj["Result"]["Result"]["Name"][1]["Value"],
- HModel = _saveObj["Result"]["Result"]["Specification"][0]["Value"],
- HShortNumber = _saveObj["Result"]["Result"]["Number"],
- HParentID = 0,
- HLevel = 1,
- HEndFlag = 1,
- HStopflag = _saveObj["Result"]["Result"]["ForbidStatus"].ToString() == "A" ? 0 : 1 ,
- HRemark = "CLD-ERP瀵煎叆",
- HMaterClsID = _saveObj["Result"]["Result"]["MaterialBase"][0]["ErpClsID"],
- HUnitID = _saveObj["Result"]["Result"]["MaterialBase"][0]["BaseUnitId_Id"],
- HUnitGroupID = 0,
- HLength = _saveObj["Result"]["Result"]["MaterialBase"][0]["LENGTH"],
- HWidth = _saveObj["Result"]["Result"]["MaterialBase"][0]["WIDTH"],
- HHeight = _saveObj["Result"]["Result"]["MaterialBase"][0]["HEIGHT"],
- HJQty = _saveObj["Result"]["Result"]["MaterialBase"][0]["NETWEIGHT"],
- HMQty = _saveObj["Result"]["Result"]["MaterialBase"][0]["GROSSWEIGHT"],
- HOldMaterNumber = _saveObj["Result"]["Result"]["OldNumber"],
- HWHID = 0,
- HSPID = _saveObj["Result"]["Result"]["MaterialStock"][0]["StockPlaceId_Id"],
- HPlanMode = _saveObj["Result"]["Result"]["MaterialPlan"][0]["PlanMode"],
- HUseFlag = "鏈楠�",
- HMakeTime = _saveObj["Result"]["Result"]["CreateDate"],
- HMinPickQty = 0,
- HCREATEORGID = _saveObj["Result"]["Result"]["CreateOrgId_Id"],
- HUSEORGID = _saveObj["Result"]["Result"]["UseOrgId_Id"],
- HBatchManager = _saveObj["Result"]["Result"]["MaterialStock"][0]["IsBatchManage"].ToString() == "false" ? 0 : 1,
- HCHECKINCOMING = _saveObj["Result"]["Result"]["MaterialQM"][0]["CheckIncoming"].ToString() == "false" ? 0 : 1,
- HAuxPropFlag = _saveObj["Result"]["Result"]["MaterialAuxPty"][0]["IsEnable1"].ToString() == "false" ? 0 : 1,
- HISKFPERIOD = _saveObj["Result"]["Result"]["MaterialStock"][0]["IsKFPeriod"].ToString() == "false" ? 0 : 1,
- HAuxUnitID = _saveObj["Result"]["Result"]["MaterialStock"][0]["AuxUnitID_Id"],
- HSNUnitID = _saveObj["Result"]["Result"]["MaterialStock"][0]["SNUnit_Id"],
- HBASEUNITID = _saveObj["Result"]["Result"]["MaterialBase"][0]["BaseUnitId_Id"],
- HSALEUNITID = _saveObj["Result"]["Result"]["MaterialSale"][0]["SaleUnitId_Id"],
- HSALEPRICEUNITID = _saveObj["Result"]["Result"]["MaterialSale"][0]["SalePriceUnitId_Id"],
- HPERUNITSTANDHOUR = _saveObj["Result"]["Result"]["MaterialProduce"][0]["PerUnitStandHour"],
- HSTDLABORPREPARETIME = _saveObj["Result"]["Result"]["MaterialProduce"][0]["StdLaborPrePareTime"],
- HSTDMACHINEPREPARETIME = _saveObj["Result"]["Result"]["MaterialProduce"][0]["StdMachinePrepareTime"]
+ HItemID = _saveObj[0][0], // 瀵瑰簲FMASTERID
+ HERPItemID = _saveObj[0][0], // 瀵瑰簲FMASTERID
+ HNumber = _saveObj[0][1], // 瀵瑰簲FNUMBER
+ HName = _saveObj[0][2], // 瀵瑰簲FNAME
+ HModel = _saveObj[0][3], // 瀵瑰簲FSPECIFICATION
+ HShortNumber = _saveObj[0][1], // 瀵瑰簲FNUMBER
+ HParentID = 0,
+ HLevel = 1,
+ HEndFlag = 1,
+ HStopflag = _saveObj[0][4].ToString() == "A" ? 0 : 1, // 瀵瑰簲FFORBIDSTATUS
+ HRemark = "CLD-ERP瀵煎叆",
+ HMaterClsID = _saveObj[0][5], // 瀵瑰簲FErpClsID
+ HUnitID = _saveObj[0][6], // 瀵瑰簲FBaseUnitId
+ HUnitGroupID = 0,
+ HLength = _saveObj[0][7], // 瀵瑰簲FLENGTH
+ HWidth = _saveObj[0][8], // 瀵瑰簲FWIDTH
+ HHeight = _saveObj[0][9], // 瀵瑰簲FHEIGHT
+ HJQty = _saveObj[0][10], // 瀵瑰簲FNETWEIGHT
+ HMQty = _saveObj[0][11], // 瀵瑰簲FGROSSWEIGHT
+ HOldMaterNumber = _saveObj[0][12], // 瀵瑰簲FOldNumber
+ HWHID = 0,
+ HSPID = _saveObj[0][13], // 瀵瑰簲FSTOCKPLACEID
+ HPlanMode = _saveObj[0][14], // 瀵瑰簲FPLANMODE
+ HUseFlag = "鏈楠�",
+ HMakeTime = _saveObj[0][15], // 瀵瑰簲FCREATEDATE
+ HMinPickQty = 0,
+ HCREATEORGID = _saveObj[0][16], // 瀵瑰簲FCREATEORGID
+ HUSEORGID = _saveObj[0][17], // 瀵瑰簲FUSEORGID
+ HBatchManager = (bool)_saveObj[0][18] ? 1 : 0, // 瀵瑰簲FISBATCHMANAGE
+ HCHECKINCOMING = (bool)_saveObj[0][19] ? 1 : 0, // 瀵瑰簲FCheckIncoming
+ HAuxPropFlag = (bool)_saveObj[0][20] ? 1 : 0, // 瀵瑰簲FIsEnable1
+ HISKFPERIOD = (bool)_saveObj[0][21] ? 1 : 0, // 瀵瑰簲FIsKFPeriod
+ HAuxUnitID = _saveObj[0][22], // 瀵瑰簲FAuxUnitID
+ HSNUnitID = _saveObj[0][23], // 瀵瑰簲FSNUNIT
+ HBASEUNITID = _saveObj[0][24], // 瀵瑰簲FBaseUnitId
+ HSALEUNITID = _saveObj[0][25], // 瀵瑰簲FSaleUnitId
+ HSALEPRICEUNITID = _saveObj[0][26], // 瀵瑰簲FSalePriceUnitId
+ HPERUNITSTANDHOUR = _saveObj[0][27], // 瀵瑰簲FPerUnitStandHour
+ HSTDLABORPREPARETIME = _saveObj[0][28], // 瀵瑰簲FStdLaborPrePareTime
+ HSTDMACHINEPREPARETIME = _saveObj[0][29] // 瀵瑰簲FStdMachinePrepareTime
};
#endregion
// 鍒犻櫎涓昏〃瀵瑰簲鏁版嵁
@@ -3749,11 +4398,11 @@
if (!tb2.Columns.Contains("鐘舵��"))
error += "娌℃湁鎵惧埌銆愮姸鎬併�戠殑鏍囬,";
- if (!tb2.Columns.Contains("榛樿浠撳簱"))
- error += "娌℃湁鎵惧埌銆愰粯璁や粨搴撱�戠殑鏍囬,";
+ //if (!tb2.Columns.Contains("榛樿浠撳簱"))
+ // error += "娌℃湁鎵惧埌銆愰粯璁や粨搴撱�戠殑鏍囬,";
- if (!tb2.Columns.Contains("榛樿浠撲綅"))
- error += "娌℃湁鎵惧埌銆愰粯璁や粨浣嶃�戠殑鏍囬,";
+ //if (!tb2.Columns.Contains("榛樿浠撲綅"))
+ // error += "娌℃湁鎵惧埌銆愰粯璁や粨浣嶃�戠殑鏍囬,";
if (!tb2.Columns.Contains("鐗堟湰鍙�"))
error += "娌℃湁鎵惧埌銆愮増鏈彿銆戠殑鏍囬,";
@@ -3906,67 +4555,83 @@
{
tb2.Rows[i]["HDeptID"] = ds.Tables[0].Rows[0]["HItemID"].ToString();
}
- //鏌ヨ浠撳簱
- ds = oCN.RunProcReturn("select * from Gy_Warehouse where HName='" + HWHName + "' and HUSEORGID=" + HORGid + "", "Gy_Warehouse");
+ if (HWHName != "")
+ {
+ //鏌ヨ浠撳簱
+ ds = oCN.RunProcReturn("select * from Gy_Warehouse where HName='" + HWHName + "' and HUSEORGID=" + HORGid + "", "Gy_Warehouse");
- if (ds.Tables[0].Rows.Count == 0)
- {
- objJsonResult.code = "0";
- objJsonResult.count = 0;
- objJsonResult.Message = "绗�" + index + "琛�,璇�" + HORGName + "缁勭粐,浠撳簱:" + HWHName + ",涓嶅瓨鍦紒";
- objJsonResult.data = null;
- return objJsonResult;
- }
- else
- {
- tb2.Rows[i]["HWHID"] = ds.Tables[0].Rows[0]["HItemID"].ToString();
- }
- string HWHID = tb2.Rows[i]["HWHID"].ToString();
- //鏌ヨ浠撲綅
- ds = oCN.RunProcReturn("select * from Gy_StockPlace where HName='" + HSPName + "'and HSPGroupID=" + HWHID+ " and HUSEORGID=" + HORGid + "", "Gy_Warehouse");
+ if (ds.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "绗�" + index + "琛�,璇�" + HORGName + "缁勭粐,浠撳簱:" + HWHName + ",涓嶅瓨鍦紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ tb2.Rows[i]["HWHID"] = ds.Tables[0].Rows[0]["HItemID"].ToString();
+ }
+
+ string HWHID = tb2.Rows[i]["HWHID"].ToString();
+ if (HWHID != "")
+ {
+ //鏌ヨ浠撲綅
+ ds = oCN.RunProcReturn("select * from Gy_StockPlace where HName='" + HSPName + "'and HSPGroupID=" + HWHID + " and HUSEORGID=" + HORGid + "", "Gy_StockPlace");
- if (ds.Tables[0].Rows.Count == 0)
- {
- objJsonResult.code = "0";
- objJsonResult.count = 0;
- objJsonResult.Message = "绗�" + index + "琛�,璇�" + HORGName + "缁勭粐,浠撲綅:" + HSPName + ",涓嶅瓨鍦紒";
- objJsonResult.data = null;
- return objJsonResult;
+ if (ds.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "绗�" + index + "琛�,璇�" + HORGName + "缁勭粐,浠撲綅:" + HSPName + ",涓嶅瓨鍦紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ tb2.Rows[i]["HSPID"] = ds.Tables[0].Rows[0]["HItemID"].ToString();
+ }
+ }
+
}
- else
+ if(HSupName!="")
{
- tb2.Rows[i]["HSPID"] = ds.Tables[0].Rows[0]["HItemID"].ToString();
+ ds = oCN.RunProcReturn("select * from Gy_Supplier where HNumber='" + HSupNumber + "' and HUSEORGID=" + HORGid + "", "Gy_Supplier");
+
+ if (ds.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "绗�" + index + "琛�,璇�" + HORGName + "缁勭粐,渚涘簲鍟�:" + HSupName + ",涓嶅瓨鍦紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ tb2.Rows[i]["HSupID"] = ds.Tables[0].Rows[0]["HItemID"].ToString();
+ }
}
//鏌ヨ渚涘簲鍟�
- ds = oCN.RunProcReturn("select * from Gy_Supplier where HNumber='" + HSupNumber + "' and HUSEORGID=" + HORGid + "", "Gy_Supplier");
+ if(HMadeSupName!="")
+ {
+ //鏌ヨ鍒堕�犲晢
+ ds = oCN.RunProcReturn("select * from Gy_Supplier where HName='" + HMadeSupName + "' and HUSEORGID=" + HORGid + "", "Gy_Supplier");
- if (ds.Tables[0].Rows.Count == 0)
- {
- objJsonResult.code = "0";
- objJsonResult.count = 0;
- objJsonResult.Message = "绗�" + index + "琛�,璇�" + HORGName + "缁勭粐,渚涘簲鍟�:" + HSupName + ",涓嶅瓨鍦紒";
- objJsonResult.data = null;
- return objJsonResult;
+ if (ds.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "绗�" + index + "琛�,璇�" + HORGName + "缁勭粐,鍒堕�犲晢:" + HMadeSupName + ",涓嶅瓨鍦紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ tb2.Rows[i]["HMadeSupID"] = ds.Tables[0].Rows[0]["HItemID"].ToString();
+ }
}
- else
- {
- tb2.Rows[i]["HSupID"] = ds.Tables[0].Rows[0]["HItemID"].ToString();
- }
- //鏌ヨ鍒堕�犲晢
- ds = oCN.RunProcReturn("select * from Gy_Supplier where HName='" + HMadeSupName + "' and HUSEORGID=" + HORGid + "", "Gy_Supplier");
-
- if (ds.Tables[0].Rows.Count == 0)
- {
- objJsonResult.code = "0";
- objJsonResult.count = 0;
- objJsonResult.Message = "绗�" + index + "琛�,璇�" + HORGName + "缁勭粐,鍒堕�犲晢:" + HMadeSupName + ",涓嶅瓨鍦紒";
- objJsonResult.data = null;
- return objJsonResult;
- }
- else
- {
- tb2.Rows[i]["HMadeSupID"] = ds.Tables[0].Rows[0]["HItemID"].ToString();
- }
+
+
//鍣ㄥ叿妗f鍚嶇О
if (HMouldName == "")
@@ -4076,15 +4741,19 @@
long HUnitID = int.Parse(item["HUnitID"].ToString());
DateTime HOutComDate = DateTime.Now;
string HOutComNo = item["鍣ㄥ叿鍑哄巶缂栧彿"].ToString();
- long HDeptID = int.Parse(item["HDeptID"].ToString());
- long HSupID = int.Parse(item["HSupID"].ToString());
+ var HDeptID_temp = item["HDeptID"].ToString() == "" ? "0" : item["HDeptID"].ToString();
+ long HDeptID = int.Parse(HDeptID_temp);
+ var HSupID_temp = item["HSupID"].ToString() == "" ? "0" : item["HSupID"].ToString();
+ long HSupID = int.Parse(HSupID_temp);
string HMouldStatus = item["鐘舵��"].ToString();
- long HWHID = int.Parse(item["HWHID"].ToString());
+ var HWHID_TEMP = item["HWHID"].ToString() == "" ? "0" : item["HWHID"].ToString();
+ long HWHID = int.Parse(HWHID_TEMP);
long HRoutingID = 0;//宸ヨ壓璺嚎id
long HBOMID = 0;
string HVersion = "";//鐗堟湰
long HSPGroupID = 0;//榛樿浠撲綅缁�
- long HSPID = int.Parse(item["HSPID"].ToString());//浠撲綅id
+ var HSPID_temp = item["HSPID"].ToString() == "" ? "0" : item["HSPID"].ToString();
+ long HSPID = int.Parse(HSPID_temp);//浠撲綅id
Double HDesignLife = item["璁捐瀵垮懡"].ToString()=="" ? 0: double.Parse(item["璁捐瀵垮懡"].ToString());
Double HUseLife = item["浣跨敤瀵垮懡"].ToString() == "" ? 0 : double.Parse(item["浣跨敤瀵垮懡"].ToString());
Double HInitLife = 0;//涓婄嚎鍒濆鍖栧鍛�
@@ -4143,7 +4812,7 @@
"," + HPrintQty + ",'" + HMouldStatus + "'," + HWHID + "," + HRoutingID + "," + HCaveQty +
"," + HBOMID + ",'" + HVersion + "'," + HSPGroupID + "," + HSPID + ",'" + HDesignLife + "','" + HNowSupID + "','" + HNowSupTypeID + "'" +
",'" + HUseLife + "','" + HLeaveLife + "','" + HProdQty + "','" + HProdWeight + "','" + HMouldOWNER + "','" + HSaveLife + "','" + HMouldDotCheckRuleInterID + "','" + HMouldMaintainRuleInterID + "','" + HBarCode + "'," + HMadeSupID +
- ",'" + HMouldClass + "'," + HNowWHID + "," + HNowSPID + ",'" + HInitLife + "') ");
+ ",'" + HMouldClass + "'," + HNowWHID + "," + HNowSPID + ",'" + HInitLife + " ) ");
}
else
{
@@ -4227,5 +4896,51 @@
#endregion
#endregion
+
+ //鏍规嵁鏉$爜鎵剧墿鏂欎俊鎭�
+ [Route("Gy_Material/findMaterialByNumber")]
+ [HttpGet]
+ public object findMaterialByNumber(string HbarCode,string HSTOCKORGID)
+ {
+ try
+ {
+ ds = oCN.RunProcReturn($"select * from Gy_BarCodeBill where HBarCode='{HbarCode}' ", "Gy_Material");
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鎴愬姛";
+ objJsonResult.data = ds.Tables[0];
+ return objJsonResult;
+ }
+ catch (Exception)
+ {
+
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍒濆鍖栧け璐ワ紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+
+
+ [Route("Gy_BarCodeBillList/GetBarCodeBillPermission")]
+ [HttpGet]
+ public object GetBarCodeBillPermission(string user)
+ {
+ if (!DBUtility.ClsPub.Security_Log("Gy_BarCodeBillList_Print", 1, false, user))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏃犳潈闄愭煡璇�!";
+ objJsonResult.data = 0;
+ return objJsonResult;
+ }
+ else
+ {
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+
+ }
}
}
\ No newline at end of file
--
Gitblit v1.9.1