From e92be6db8ec949c6e14d28905bf034a4f583cd1f Mon Sep 17 00:00:00 2001
From: yangle <admin@YINMOU>
Date: 星期一, 19 十二月 2022 10:55:30 +0800
Subject: [PATCH] 盘点分析维护 器具档案单据 列表维护 器具保养计划单 单据双子列表 器具保养计划单列表加子列表显示
---
WebAPI/Controllers/BaseSet/Gy_MaterialController.cs | 114 ++++++++++++++++++++++++++++++++++++--------------------
1 files changed, 73 insertions(+), 41 deletions(-)
diff --git a/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs b/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs
index a800787..b23dcd5 100644
--- a/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs
+++ b/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs
@@ -132,7 +132,6 @@
{
DataSet ds;
var _value = msg["msg"].ToString();
- cs(_value);
string msg3 = _value.ToString();
string[] sArray = msg3.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
string msg1 = sArray[0].ToString();
@@ -195,32 +194,22 @@
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;
- }
+ //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");
- if (oItem.HNumber.Trim() == "")
- {
- objJsonResult.code = "0";
- objJsonResult.count = 0;
- objJsonResult.Message = "淇濆瓨澶辫触锛佷唬鐮佷负绌猴紒";
- objJsonResult.data = 1;
- return objJsonResult;
- }
//鏂板鏃跺垽鏂�
+ #region 鐖剁骇鏍¢獙鏂规硶锛坅pi璋冪敤鍏堟敞閲婃帀锛岋級
+ /*
if (oItem.HItemID == 0)
{
- if (ds == null || ds.Tables[0].Rows.Count == 0)
- {
-
- }
- else
+ if (ds == null || ds.Tables[0].Rows.Count > 0)
{
objJsonResult.code = "0";
objJsonResult.count = 0;
@@ -276,6 +265,8 @@
}
}
}
+ */
+ #endregion
//寰楀埌鐭唬鐮�
string sShortNumber;
sShortNumber = DBUtility.ClsPub.GetShortNumber(oItem.HNumber.Trim());
@@ -293,13 +284,12 @@
oItem.HLevel = DBUtility.ClsPub.GetLevel(oItem.HNumber.Trim()); //绛夌骇
oBill.oModel = oItem;
}
-
//淇濆瓨
//淇濆瓨瀹屾瘯鍚庡鐞�
bool bResult;
if (oBill.oModel.HItemID == 0)
{
- // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
+ //bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
bResult = oBill.AddNew();
}
else
@@ -334,7 +324,52 @@
}
}
-
+ [Route("Gy_Material/SaveGy_MaterialListApi")]
+ [HttpPost]
+ public object SaveGy_MaterialListApi([FromBody] JObject msg)
+ {
+ var _value = msg["model"].ToString();
+ string msg3 = _value.ToString();
+ string[] sArray = msg3.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
+ string msg1 = sArray[0].ToString();
+ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+ 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);
+ oBill.oModel = lsmain[0];
+ //淇濆瓨
+ bool bResult = oBill.AddNewApi();
+ if (bResult)
+ {
+ objJsonResult.code = "1";
+ 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>
/// 鐗╂枡璁剧疆鍒犻櫎鍔熻兘
@@ -347,6 +382,16 @@
DataSet ds;
try
{
+ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+ if (user == "10000")//api鍚屾鏂瑰紡
+ {
+ oCN.RunProc("delete from Gy_Material where HERPItemID=" + HItemID);
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "* 鏁版嵁鍒犻櫎鎴愬姛锛�";
+ objJsonResult.data = null;
+ return objJsonResult; ;
+ }
//鍒犻櫎鏉冮檺
if (!DBUtility.ClsPub.Security_Log("Gy_Material_Delete", 1, false, user))
{
@@ -356,8 +401,6 @@
objJsonResult.data = null;
return objJsonResult;
}
-
- SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
if (string.IsNullOrWhiteSpace(HItemID))
{
objJsonResult.code = "0";
@@ -437,22 +480,11 @@
ds = oCN.RunProcReturn(sql, "h_v_Gy_MouldFileList");
}
- //if (ds.Tables[0].Rows.Count != 0 || ds != null)
- //{
objJsonResult.code = "1";
objJsonResult.count = 1;
objJsonResult.Message = "Sucess锛�";
objJsonResult.data = ds.Tables[0];
return objJsonResult;
- //}
- //else
- //{
- //objJsonResult.code = "0";
- //objJsonResult.count = 0;
- //objJsonResult.Message = "鏃犳暟鎹�";
- //objJsonResult.data = null;
- //return objJsonResult;
- //}
}
catch (Exception e)
{
@@ -872,7 +904,7 @@
Double HProdQty = mainList[0].HProdQty;
Double HProdWeight = mainList[0].HProdWeight;
string HRemark = mainList[0].HRemark;
- string HMaker = mainList[0].HMaker;
+ string HUpDater = mainList[0].HUpDater;
string HMaterNumber = mainList[0].HMaterNumber;
string HSupNumber = mainList[0].HSupNumber;
long HPrintQty = mainList[0].HPrintQty;
@@ -893,7 +925,7 @@
",HYear='" + HYear.ToString() + "'" +
",HPeriod='" + HPeriod.ToString() + "'" +
",HRemark='" + HRemark + "'" +
- ",HUpDater='" + HMaker + "'" +
+ ",HUpDater='" + HUpDater + "'" +
",HUpDateDate=getdate()" +
//========================================
",HMouldNo='" + HMouldNo + "'" +
@@ -934,7 +966,7 @@
",HNowSupID=" + HNowSupID.ToString() +
",HNowSupTypeID=" + HNowSupTypeID.ToString() +
",HProdWeight=" + HProdWeight.ToString() +
- ",HBarCode=" + HBarCode.ToString() +
+ ",HBarCode='" + HBarCode.ToString() + "'" +
" where HInterID=" + HInterID.ToString());
//淇敼瀛愰」鐩唬鐮�
--
Gitblit v1.9.1