From 09bef7222f28abfe5fbb308c610997dc52da5f18 Mon Sep 17 00:00:00 2001
From: dytyqx <1342948614@qq.com>
Date: 星期四, 26 二月 2026 08:11:40 +0800
Subject: [PATCH] 1
---
WebAPI/Controllers/BaseSet/Gy_ConkTypeController.cs | 122 ++++++++++++++++++++++++++++++++++++++--
1 files changed, 114 insertions(+), 8 deletions(-)
diff --git a/WebAPI/Controllers/BaseSet/Gy_ConkTypeController.cs b/WebAPI/Controllers/BaseSet/Gy_ConkTypeController.cs
index 4b70e17..2dde268 100644
--- a/WebAPI/Controllers/BaseSet/Gy_ConkTypeController.cs
+++ b/WebAPI/Controllers/BaseSet/Gy_ConkTypeController.cs
@@ -18,6 +18,7 @@
private json objJsonResult = new json();
SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
DataSet ds;
+ ClsXt_SystemParameter oClsXt_SystemParameter = new ClsXt_SystemParameter();
/// <summary>
/// 杩斿洖鏁呴殰绫诲埆鍒楄〃
@@ -169,7 +170,7 @@
//淇濆瓨鍓嶆帶鍒�=========================================
- string sql1 = "exec h_p_Gy_ConkType_BeforeSaveCtrl " + HMakeEmp + ",'" + 1 + "'";
+ string sql1 = "exec h_p_Gy_ConkType_BeforeSaveCtrl '" + HNumber + "','" + HName + "'," + HUSEORGID + ",1,0";
ds = oCN.RunProcReturn(sql1, "h_p_Gy_ConkType_BeforeSaveCtrl");
if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
{
@@ -185,7 +186,7 @@
{
objJsonResult.code = "0";
objJsonResult.count = 1;
- objJsonResult.Message = "淇濆瓨澶辫触!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
+ objJsonResult.Message = "淇濆瓨澶辫触!鍘熷洜:" + ds.Tables[0].Rows[0]["HBackRemark"].ToString(); ;
objJsonResult.data = null;
oCN.RollBack();
return objJsonResult;
@@ -235,7 +236,7 @@
oCN.BeginTran();
//淇濆瓨鍓嶆帶鍒�=========================================
- string sql1 = "exec h_p_Gy_ConkType_BeforeSaveCtrl " + HMakeEmp + ",'" + 2 + "'";
+ string sql1 = "exec h_p_Gy_ConkType_BeforeSaveCtrl '" + HNumber + "','" + HName + "'," + HUSEORGID + ",3," + HItemID;
ds = oCN.RunProcReturn(sql1, "h_p_Gy_ConkType_BeforeSaveCtrl");
if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
{
@@ -251,7 +252,7 @@
{
objJsonResult.code = "0";
objJsonResult.count = 1;
- objJsonResult.Message = "淇濆瓨澶辫触!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
+ objJsonResult.Message = "淇濆瓨澶辫触!鍘熷洜:" + ds.Tables[0].Rows[0]["HBackRemark"].ToString(); ;
objJsonResult.data = null;
oCN.RollBack();
return objJsonResult;
@@ -306,11 +307,48 @@
oCN.Commit();
}
- objJsonResult.code = "0";
+
+ //鑷姩瀹℃牳鍔熻兘
+ if (HItemID == 0)
+ {
+ ds = oCN.RunProcReturn("select HItemID,HNumber,HName from Gy_ConkType with(nolock) where HNumber='" + HNumber + "' and HUSEORGID = " + HUSEORGID, "Gy_ConkType");
+ if (ds.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "淇濆瓨鎴愬姛锛佽嚜鍔ㄥ鏍稿け璐ユ壘涓嶅埌瀵瑰簲鍗曟嵁";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else if (ds.Tables[0].Rows.Count > 1)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鐩稿悓浣跨敤缁勭粐涓嬶紝鍑虹幇" + ds.Tables[0].Rows.Count + "涓浉鍚岀殑浠g爜锛�" + ds.Tables[0].Rows[0]["HNumber"];
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ string sAutoCheck = oClsXt_SystemParameter.GetSingleSystemParameter("Gy_ConkType_AutoCheck", ref DBUtility.ClsPub.sExeReturnInfo);
+ objJsonResult.Verify = "N";
+ if (sAutoCheck == "Y")
+ {
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "淇濆瓨鎴愬姛";
+ objJsonResult.data = ds.Tables[0].Rows[0]["HItemID"].ToString();
+ objJsonResult.Verify = "Y";
+ return objJsonResult;
+ }
+ }
+ }
+
+ objJsonResult.code = "1";
objJsonResult.count = 1;
objJsonResult.Message = "淇濆瓨鎴愬姛锛�";
//WebAPIController.Add_Log("閫佽揣鍗曚笅鎺�", UserName, "鐢熸垚閫佽揣鍗�");
- objJsonResult.data = 1;
+ objJsonResult.data = null;
return objJsonResult;
}
catch (Exception e)
@@ -336,7 +374,7 @@
try
{
- ds = oCN.RunProcReturn("select * from h_v_Gy_ConkTypeList where HitemID=" + HInterID, "h_v_Gy_ConkTypeList");
+ ds = oCN.RunProcReturn("select * from h_v_Gy_ConkType_Edit where HitemID=" + HInterID, "h_v_Gy_ConkType_Edit");
if (ds == null || ds.Tables[0].Rows.Count == 0)
{
objJsonResult.code = "0";
@@ -364,7 +402,7 @@
}
}
-
+
[Route("DeltetGy_ConkType")]
[HttpGet]
public object DeltetGy_ConkType(string HItemID, string user)
@@ -419,6 +457,17 @@
objJsonResult.Message = "姝ら」鐩凡浣跨敤锛屼笉鑳藉垹闄わ紒";
objJsonResult.data = null;
return objJsonResult;
+ }
+ if (ds.Tables[0].Rows.Count > 0)
+ {
+ if (ds.Tables[0].Rows[0]["HStopEmp"].ToString() != "" || ds.Tables[0].Rows[0]["HCheckEmp"].ToString() != "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁褰撳墠澶勪簬涓嶈兘鍒犻櫎鐘舵�侊紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
}
//鍒犻櫎鍓嶆帶鍒�=========================================
string sql1 = "exec h_p_Gy_ConkType_BeforeDelCtrl " + HItemID + ",'" + user + "'";
@@ -490,6 +539,63 @@
}
}
+ [Route("Gy_ConkType/List_PDA2")]
+ [HttpGet]
+ public object List_PDA(string sWhere, string user, string Mode)
+ {
+ if (string.IsNullOrWhiteSpace(Mode))
+ {
+ return List_PDA(sWhere, user);
+ }
+ try
+ {
+ string errRef = "";
+ List<object> columnNameList = new List<object>();
+
+ if(oClsXt_SystemParameter.ShowBill(ref errRef))
+ {
+ if(oClsXt_SystemParameter.omodel.WMS_CampanyName == "鍗庤垷")
+ {
+ if(Mode == "Module")
+ {
+ sWhere += $" and 鏁呴殰绫诲埆浠g爜 like 'MJ%' ";
+ }
+ else if (Mode == "Equip")
+ {
+ sWhere += $" and 鏁呴殰绫诲埆浠g爜 like 'SB%' ";
+ }
+ }
+ }
+
+ sWhere += $" and 绂佺敤鏍囧織='' ";
+ LogService.Write(sWhere);
+ string sql1 = string.Format(@"select * from h_v_Gy_ConkTypeList where 1=1 ");
+ ds = oCN.RunProcReturn(sql1 + sWhere + " order by 鏁呴殰绫诲埆浠g爜 ", "h_v_Gy_ConkTypeList");
+
+ //娣诲姞鍒楀悕
+ foreach (DataColumn col in ds.Tables[0].Columns)
+ {
+ Type dataType = col.DataType;
+ string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+ columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+ }
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "Sucess锛�";
+ objJsonResult.data = ds.Tables[0];
+ objJsonResult.list = columnNameList;
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "Exception锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
--
Gitblit v1.9.1