From ce58bfdb73054fa181e0731d60f4c2e74798cabb Mon Sep 17 00:00:00 2001
From: llj <132905093+newwwwwwtree@users.noreply.github.com>
Date: 星期一, 13 十月 2025 09:23:38 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API
---
WebAPI/Controllers/WebAPIController.cs | 407 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 395 insertions(+), 12 deletions(-)
diff --git a/WebAPI/Controllers/WebAPIController.cs b/WebAPI/Controllers/WebAPIController.cs
index 6b3c777..e035591 100644
--- a/WebAPI/Controllers/WebAPIController.cs
+++ b/WebAPI/Controllers/WebAPIController.cs
@@ -18335,6 +18335,229 @@
}
#endregion
+ #region 鐧芥爣鍩虹淇℃伅琛� 璁剧疆鍒楄〃/淇濆瓨/缂栬緫/鍒犻櫎鏂规硶
+ /// <summary>
+ /// 淇濆瓨鐧芥爣鍩虹淇℃伅琛�
+ /// </summary>
+ /// <param name="msg"></param>
+ /// <returns></returns>
+ [Route("SaveSc_PackUnionBillBarCode_tempList")]
+ [HttpPost]
+ public object SaveSc_PackUnionBillBarCode_tempList([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();
+
+ //鏌ョ湅鏉冮檺
+ if (!DBUtility.ClsPub.Security_Log("Sc_PackUnionBillBarCode_temp_Edit", 1, false, msg2))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏃犱繚瀛樻潈闄愶紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ Int64 HItemID = 0;
+ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+
+ ListModels oListModels = new ListModels();
+ try
+ {
+ WebAPI.DLL.ClsSc_PackUnionBillBarCode_temp_Ctl oBill = new WebAPI.DLL.ClsSc_PackUnionBillBarCode_temp_Ctl();
+ List<Model.ClsSc_PackUnionBillBarCode_temp_Model> lsmain = new List<Model.ClsSc_PackUnionBillBarCode_temp_Model>();
+ msg1 = msg1.Replace("\\", "");
+ msg1 = msg1.Replace("\n", ""); //\n
+ lsmain = oListModels.getObjectByJson_Sc_PackUnionBillBarCode_temp(msg1);
+ foreach (Model.ClsSc_PackUnionBillBarCode_temp_Model oItem in lsmain)
+ {
+ if (oItem.HMaterNumber.Trim() == "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨澶辫触锛佷唬鐮佷笉鑳戒负绌猴紒";
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ if (oItem.HMaterName.Trim() == "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨澶辫触锛佸悕绉颁笉鑳戒负绌猴紒";
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ if (!DBUtility.ClsPub.AllowNumber(oItem.HMaterNumber.Trim()))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨澶辫触锛佷唬鐮佷腑涓嶈兘鍑虹幇杩炵画鈥�.鈥欏苟涓旈浣嶆湯浣嶄笉鑳戒负鈥�.鈥欙紒";
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ //鏌ヨ鏁版嵁涓槸鍚﹀瓨鍦ㄩ噸澶嶄唬鐮�
+
+ ds = oCN.RunProcReturn("select * from Sc_PackUnionBillBarCode_temp where HMaterNumber='" + oItem.HMaterNumber.Trim() + "' and HUSEORGID= '" + oItem.HUSEORGID + "' ", "Sc_PackUnionBillBarCode_temp");
+ if (oItem.HMaterNumber.Trim() == "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨澶辫触锛佷唬鐮佷负绌猴紒";
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+
+ //宸插鏍哥殑涓嶅厑璁镐繚瀛�
+ if (ds.Tables[0].Rows.Count > 0 && ds.Tables[0].Rows[0]["HCheckEmp"].ToString() != "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁宸插鏍�!涓嶈兘杩涜淇濆瓨锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ oItem.HMakeEmp = msg2; //鍒涘缓浜�
+
+ oBill.oModel = oItem;
+ }
+
+ //淇濆瓨
+ //淇濆瓨瀹屾瘯鍚庡鐞�
+ bool bResult;
+ if (oBill.oModel.HInterID == 0)
+ {
+ bResult = oBill.AddNew(ref DBUtility.ClsPub.sExeReturnInfo);
+ }
+ else
+ {
+ bResult = oBill.ModifyByID(oBill.oModel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
+ }
+ if (bResult)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "淇濆瓨鎴愬姛锛�";
+ 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;
+ }
+ }
+
+ /// <summary>
+ /// 鐧芥爣鍩虹淇℃伅琛ㄨ幏鍙栦俊鎭�
+ /// </summary>
+ /// <returns></returns>
+ [Route("GetSc_PackUnionBillBarCode_tempDetail")]
+ [HttpGet]
+ public ApiResult<DataSet> GetSc_PackUnionBillBarCode_tempDetail(string HID)
+ {
+ var model = LuBaoSevice.GetSc_PackUnionBillBarCode_tempBillDetail(HID);
+ return model;
+ }
+
+ /// <summary>
+ /// 鐧芥爣鍩虹淇℃伅琛� 鍒犻櫎鍔熻兘
+ /// </summary>
+ /// <returns></returns>
+ [Route("DeltetSc_PackUnionBillBarCode_temp")]
+ [HttpGet]
+ public object DeltetSc_PackUnionBillBarCode_temp(string HItemID, string user)
+ {
+ DataSet ds;
+ try
+ {
+ //鍒犻櫎鏉冮檺
+ if (!DBUtility.ClsPub.Security_Log("Sc_PackUnionBillBarCode_temp_Drop", 1, false, user))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏃犲垹闄ゆ潈闄愶紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+ if (string.IsNullOrWhiteSpace(HItemID))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "HItemID涓虹┖锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ oCN.BeginTran();//寮�濮嬩簨鍔�
+ ds = oCN.RunProcReturn("select * from Sc_PackUnionBillBarCode_temp where HInterID=" + HItemID, "Sc_PackUnionBillBarCode_temp");
+ if (ds == null || ds.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "娌℃湁鏁版嵁锛屾棤娉曞垹闄わ紒";
+ objJsonResult.data = null;
+ return objJsonResult; ;
+ }
+
+ if (ds.Tables[0].Rows[0]["HCheckEmp"].ToString() != "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁宸插鏍�!涓嶈兘杩涜鍒犻櫎锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ if (ds.Tables[0].Rows[0]["HStopEmp"].ToString() != "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁宸茬鐢�!涓嶈兘杩涜鍒犻櫎锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+
+ oCN.RunProc("delete from Sc_PackUnionBillBarCode_temp where HInterID=" + HItemID);
+
+
+ oCN.Commit();//鎻愪氦浜嬪姟
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鏁版嵁鍒犻櫎鎴愬姛锛�";
+ objJsonResult.data = null;
+ return objJsonResult; ;
+
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍒犻櫎澶辫触锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+
+
+ #endregion
+
/// <summary>
/// 鐢ㄥ叧鑱斿伐搴忚幏鍙栦俊鎭�
@@ -18653,7 +18876,8 @@
objjson.data = ds.Tables[0];
return objjson;
}
- } catch (Exception e)
+ }
+ catch (Exception e)
{
objjson.code = "0";
objjson.count = 0;
@@ -20279,6 +20503,7 @@
}
else
{
+ sWhere = sWhere.Replace("\"", "''");
ds = oCN.RunProcReturn("exec h_p_IF_BarCodeBillList " + page + "," + size + ",'" + sWhere + "'", "h_p_IF_BarCodeBillList");
}
@@ -21165,7 +21390,7 @@
{
DataSet ds = oCN.RunProcReturn("exec [h_p_Gy_MenuDefineSet_APP_Get] " +
"@HMaker = N'" + HMaker + "'," +
- "@HType = N'" + HType + "'," +
+ "@HType = N'" + HType + "'," +
"@HMenuListName = N'" + HMenuListName + "'"
, "h_p_Gy_MenuDefineSet_APP_Get");
@@ -21220,7 +21445,7 @@
list.ForEach(one =>
{
string sql2 = "insert into Gy_MenuDefineSet_APP( HEntryID, HIndex, HName, HMenuName, HPicNum, HShowMode, HMaker)" +
- "Values('" + one.HEntryID + "','" + one.HIndex + "','" + one.HName + "','" + MenuName + "','"
+ "Values('" + one.HEntryID + "','" + one.HIndex + "','" + one.HName + "','" + MenuName + "','"
+ one.HPicNum + "','" + one.HShowMode + "','" + user + "')";
oCN.RunProcReturn(sql2, "Gy_MenuDefineSet_APP");
});
@@ -21287,7 +21512,7 @@
{
string sql1 = "select HItemID,HPartentID,HNumber,HName,HLevel,Hurl,HType,HPicNum,HShowMode,isnull(HTranslationText_English,HName) HTranslationText_English,isnull(HTranslationText_Spain,HName) HTranslationText_Spain from Gy_MenuDefineSet where HMakeName=" +
"(select top 1 c.GroupName from Gy_Czygl a left join System_UserGroupInfo b on a.Czybm = b.UserId " +
- "left join System_UserGroup c on b.GroupId = c.GroupID where a.Czymc ='"+HMakeName+"' order by len(c.GroupName ))";
+ "left join System_UserGroup c on b.GroupId = c.GroupID where a.Czymc ='" + HMakeName + "' order by len(c.GroupName ))";
ds = oCn.RunProcReturn(sql1, "Gy_MenuDefineSet"); //鏌ヨ鐢ㄦ埛缁戝畾鐨勮鑹� 鏄惁璁剧疆鑿滃崟淇℃伅 鍙栬鑹插悕绉版渶鐭殑涓�涓�
if ((ds.Tables[0] == null || ds.Tables[0].Rows.Count == 0))
{
@@ -21298,8 +21523,8 @@
sql = "Select HitemID,HNumber,HName,HPartentID,HLevel,Hurl,HShowMode,isnull(HTranslationText_English,HName) HTranslationText_English,isnull(HTranslationText_Spain,HName) HTranslationText_Spain,HPicNum from Gy_Menu_1 where HType = '" + HType + "' Order by HPosition,len(HitemID),HitemID ";
ds = oCn.RunProcReturn(sql, "Gy_Menu_1");
}
-
- }
+
+ }
}
for (int i = 0; i < ds.Tables[0].Rows.Count; i++) //灏嗚彍鍗曠殑鏍硅妭鐐逛繚瀛樺埌鍒楄〃menu涓�
@@ -21501,7 +21726,7 @@
{
try
{
-
+
SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
@@ -21593,7 +21818,7 @@
if (HPartentID == "0" || HPartentID == ds.Tables[0].Rows[0]["HItemID"].ToString())
{
string HPosition = ds.Tables[0].Rows[0]["HPosition"].ToString();
- sql = "insert into Gy_MenuDefineSet(HItemID,HPartentID,HNumber,HName,HLevel,Hurl,HType,HMakeName,HPicNum,HPosition,HTranslationText_English,HTranslationText_Spain) values('" + saveDataList[i].HItemID + "','" + HPartentID + "','" + HNumber + "','" + saveDataList[i].HName + "'," + HLevel + ",'" + Hurl + "','" + HType + "','" + HMakeName + "','" + HPicNum + "','" + HPosition + "','"+ HTranslationText_English + "','" + HTranslationText_Spain + "')";
+ sql = "insert into Gy_MenuDefineSet(HItemID,HPartentID,HNumber,HName,HLevel,Hurl,HType,HMakeName,HPicNum,HPosition,HTranslationText_English,HTranslationText_Spain) values('" + saveDataList[i].HItemID + "','" + HPartentID + "','" + HNumber + "','" + saveDataList[i].HName + "'," + HLevel + ",'" + Hurl + "','" + HType + "','" + HMakeName + "','" + HPicNum + "','" + HPosition + "','" + HTranslationText_English + "','" + HTranslationText_Spain + "')";
oCN.RunProc(sql);
}
else
@@ -21637,7 +21862,7 @@
//蹇嵎鏂瑰紡鑷畾涔夎彍鍗曪細鑾峰彇鏍戠粍浠舵暟鎹�
[Route("Web/Xt_UserFastMenu_Display")]
[HttpGet]
- public object Xt_UserFastMenu_Display(string HMakeName, string HType,string HModelAtributos)
+ public object Xt_UserFastMenu_Display(string HMakeName, string HType, string HModelAtributos)
{
try
{
@@ -21759,7 +21984,7 @@
string HCaption = ds.Tables[0].Rows[0]["HName"].ToString();
string HType = ds.Tables[0].Rows[0]["HType"].ToString();
- sql = "insert into Xt_UserFastMenu(HUserID,HSubFuncID,HCaption,HType,HModelAtributos) values('" + HUserID + "','" + HSubFuncID + "','" + HCaption + "','" + HType + "','"+ HModelAtributos + "')";
+ sql = "insert into Xt_UserFastMenu(HUserID,HSubFuncID,HCaption,HType,HModelAtributos) values('" + HUserID + "','" + HSubFuncID + "','" + HCaption + "','" + HType + "','" + HModelAtributos + "')";
oCN.RunProc(sql);
}
}
@@ -21789,7 +22014,7 @@
//蹇嵎鏂瑰紡鑷畾涔夎彍鍗曪細鑾峰彇鏍戠粍浠舵暟鎹�
[Route("Web/Xt_UserFastMenu_Init")]
[HttpGet]
- public object Xt_UserFastMenu_Init(string HMakeName, string HType,string HModelAtributos)
+ public object Xt_UserFastMenu_Init(string HMakeName, string HType, string HModelAtributos)
{
try
{
@@ -22218,6 +22443,116 @@
}
}
+ #region 閫氳繃鍗曟嵁绫诲瀷銆佸崟鎹彿鏌ヨ鍗曟嵁淇℃伅
+ /// <summary>
+ /// 閫氳繃鍗曟嵁绫诲瀷鑾峰彇瀵瑰簲瑙嗗浘骞堕�氳繃鍗曟嵁鍙锋煡璇㈠崟鎹俊鎭�
+ /// </summary>
+ /// <param name="HBillNo"></param>
+ /// <param name="HBillType"></param>
+ /// <param name="HStoreOrgID"></param>
+ /// <returns></returns>
+ [Route("Web/GetBillInfo")]
+ [HttpGet]
+ public object GetBillInfo(string HBillNo, string HBillType, int HStockOrgID)
+ {
+ try
+ {
+ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+
+ ds = oCN.RunProcReturn("exec h_p_Gy_GetBillInfoByHBillTypeAndHBillNo N'" + HBillType + "',N'" + HBillNo +
+ "'," + HStockOrgID, "h_p_Gy_GetBillInfoByHBillTypeAndHBillNo");
+
+ if (ds == null)
+ {
+ objjson.code = "0";
+ objjson.count = 0;
+ objjson.Message = "鑾峰彇澶辫触" + DBUtility.ClsPub.sErrInfo;
+ objjson.data = null;
+ return objjson;
+ }
+ else if ((bool)ds.Tables[1].Rows[0]["returnType"] == false)
+ {
+ objjson.code = "0";
+ objjson.count = 0;
+ objjson.Message = "鑾峰彇澶辫触" + ds.Tables[1].Rows[1]["payload"];
+ objjson.data = null;
+ return objjson;
+ }
+ else
+ {
+ objjson.code = "1";
+ objjson.count = 1;
+ objjson.Message = "鑾峰彇鎴愬姛!";
+ objjson.data = ds.Tables[0];
+ return objjson;
+ }
+ }
+ catch (Exception ex)
+ {
+ objjson.code = "0";
+ objjson.count = 0;
+ objjson.Message = "鑾峰彇澶辫触" + ex.ToString();
+ objjson.data = null;
+ return objjson;
+ }
+ }
+ #endregion
+
+ #region 閫氳繃鍗曟嵁绫诲瀷銆佸崟鎹唴鐮併�佸瓙鍐呯爜鏌ヨ鍗曟嵁淇℃伅
+ /// <summary>
+ /// 閫氳繃鍗曟嵁绫诲瀷鑾峰彇瀵瑰簲瑙嗗浘骞堕�氳繃鍗曟嵁鍙锋煡璇㈠崟鎹俊鎭�
+ /// </summary>
+ /// <param name="HBillNo"></param>
+ /// <param name="HBillType"></param>
+ /// <param name="HStoreOrgID"></param>
+ /// <returns></returns>
+ [Route("Web/GetBillInfo_GenerateBillCode")]
+ [HttpGet]
+ public object GetBillInfo_GenerateBillCode(string HBillType, string HInterID, int HEntryID)
+ {
+ try
+ {
+ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+
+ ds = oCN.RunProcReturn("exec h_p_Gy_GetBillInfo_GenerateCode N'" + HBillType + "'," + HInterID +
+ "," + HEntryID, "h_p_Gy_GetBillInfo_GenerateCode");
+
+ if (ds == null)
+ {
+ objjson.code = "0";
+ objjson.count = 0;
+ objjson.Message = "鑾峰彇澶辫触" + DBUtility.ClsPub.sErrInfo;
+ objjson.data = null;
+ return objjson;
+ }
+ else if ((bool)ds.Tables[1].Rows[0]["returnType"] == false)
+ {
+ objjson.code = "0";
+ objjson.count = 0;
+ objjson.Message = "鑾峰彇澶辫触" + ds.Tables[1].Rows[1]["payload"];
+ objjson.data = null;
+ return objjson;
+ }
+ else
+ {
+ objjson.code = "1";
+ objjson.count = 1;
+ objjson.Message = "鑾峰彇鎴愬姛!";
+ objjson.data = ds.Tables[0];
+ return objjson;
+ }
+ }
+ catch (Exception ex)
+ {
+ objjson.code = "0";
+ objjson.count = 0;
+ objjson.Message = "鑾峰彇澶辫触" + ex.ToString();
+ objjson.data = null;
+ return objjson;
+ }
+ }
+ #endregion
+
/// <summary>
/// 閲戝竻WMS鎺ュ彛
@@ -22279,6 +22614,54 @@
}
}
- }
+ /// <summary>
+ /// 灏忓崼鐢靛櫒鑾峰彇鐗╂枡鏉$爜瀵瑰簲鍗曟嵁
+ /// </summary>
+ /// <param name="sWhere">鑷畾涔夎繃婊ゆ潯浠�</param>
+ /// <param name="HBillType">鍗曟嵁鍙�</param>
+ /// <param name="HSourceBillType">婧愬崟鍙�</param>
+ /// <returns></returns>
+ [Route("web/XiaoWeiBarCodeQuery")]
+ [HttpGet]
+ public object XiaoWeiBarCodeQuery(string sWhere, int HBillType, int HSourceBillType)
+ {
+ try
+ {
+ ds = oCN.RunProcReturn("exec h_p_XiaoWeiBarCodeQuery '" + sWhere + "'," + HBillType + "," + HSourceBillType, "h_p_XiaoWeiBarCodeQuery");
+ if(ds == null || ds.Tables[0].Rows.Count == 0)
+ {
+ objjson.code = "0";
+ objjson.count = 0;
+ objjson.Message = "璇ョ墿鏂欐潯鐮佹棤瀵瑰簲鐨勫崟鎹�";
+ objjson.data = null;
+ return objjson;
+ }else
+ {
+ objjson.code = "1";
+ objjson.count = 1;
+ objjson.Message = "鑾峰彇鎴愬姛!";
+ objjson.data = ds.Tables[0];
+ return objjson;
+ }
+
+
+
+ objjson.code = "1";
+ objjson.count = 1;
+ objjson.Message = "鑾峰彇鎴愬姛!";
+ objjson.data = ds.Tables[0];
+ return objjson;
+ }
+ catch (Exception ex)
+ {
+ objjson.code = "0";
+ objjson.count = 0;
+ objjson.Message = "鑾峰彇澶辫触" + ex.ToString();
+ objjson.data = null;
+ return objjson;
+ }
+ }
+
+ }
}
--
Gitblit v1.9.1