From 5d7ba2518694f6694794bebb7389f9a85374720b Mon Sep 17 00:00:00 2001
From: yusijie <ysj@hz-kingdee.com>
Date: 星期二, 20 五月 2025 19:02:17 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API
---
WebAPI/Controllers/WebAPIController.cs | 519 +++++++++++++++++++++++++++++++++++++++++----------------
1 files changed, 374 insertions(+), 145 deletions(-)
diff --git a/WebAPI/Controllers/WebAPIController.cs b/WebAPI/Controllers/WebAPIController.cs
index d49b1f7..88e08d2 100644
--- a/WebAPI/Controllers/WebAPIController.cs
+++ b/WebAPI/Controllers/WebAPIController.cs
@@ -2684,7 +2684,7 @@
}
//鏌ヨ鏁版嵁涓槸鍚﹀瓨鍦ㄩ噸澶嶄唬鐮�
- ds = oCN.RunProcReturn("select * from Gy_BadReason where HStopflag=0 and HNumber='" + oItem.HNumber.Trim() + "'", "Gy_BadReason");
+ ds = oCN.RunProcReturn("select * from Gy_BadReason where HNumber='" + oItem.HNumber.Trim() + "' and HUSEORGID='" + oItem.HUSEORGID + "'", "Gy_BadReason");
if (oItem.HNumber.Trim() == "")
{
objJsonResult.code = "0";
@@ -2692,7 +2692,7 @@
objJsonResult.Message = "淇濆瓨澶辫触锛佷唬鐮佷负绌猴紒";
objJsonResult.data = 1;
return objJsonResult;
- }
+ }
//鏂板鏃跺垽鏂�
if (oItem.HItemID == 0)
{
@@ -2704,7 +2704,7 @@
{
objJsonResult.code = "0";
objJsonResult.count = 0;
- objJsonResult.Message = "淇濆瓨澶辫触锛佷唬鐮侀噸澶嶏紒";
+ objJsonResult.Message = "淇濆瓨澶辫触锛佺浉鍚屼娇鐢ㄧ粍缁囦笅浠g爜涓嶈兘閲嶅锛�";
objJsonResult.data = 1;
return objJsonResult;
}
@@ -2755,6 +2755,23 @@
return objJsonResult;
}
}
+ if (ds.Tables[0].Rows.Count > 1)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨澶辫触锛佺浉鍚屼娇鐢ㄧ粍缁囦笅浠g爜涓嶈兘閲嶅锛�";
+ 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;
}
//寰楀埌鐭唬鐮�
string sShortNumber;
@@ -2865,18 +2882,22 @@
objJsonResult.data = null;
return objJsonResult; ;
}
- //var HStopflag = Convert.ToBoolean(ds.Tables[0].Rows[0]["HStopflag"]);
- //if (HStopflag)
- //{
- // oCN.RollBack();//鍥炴粴浜嬪姟
- // 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;
+ }
//鍒犻櫎鍓嶆帶鍒�=========================================
string sql1 = "exec h_p_Gy_BadReason_BeforeDelCtrl " + HItemID + ",'" + user + "'";
ds = oCN.RunProcReturn(sql1, "h_p_Gy_BadReason_BeforeDelCtrl");
@@ -3360,7 +3381,7 @@
}
//鏌ヨ鏁版嵁涓槸鍚﹀瓨鍦ㄩ噸澶嶄唬鐮�
- ds = oCN.RunProcReturn("select * from Gy_BadType where HStopflag=0 and HNumber='" + oItem.HNumber.Trim() + "'", "Gy_BadType");
+ ds = oCN.RunProcReturn("select * from Gy_BadType where HNumber='" + oItem.HNumber.Trim() + "' and HUSEORGID= '" + oItem.HUSEORGID + "' ", "Gy_BadType");
if (oItem.HNumber.Trim() == "")
{
objJsonResult.code = "0";
@@ -3368,7 +3389,7 @@
objJsonResult.Message = "淇濆瓨澶辫触锛佷唬鐮佷负绌猴紒";
objJsonResult.data = 1;
return objJsonResult;
- }
+ }
//鏂板鏃跺垽鏂�
if (oItem.HItemID == 0)
{
@@ -3380,7 +3401,7 @@
{
objJsonResult.code = "0";
objJsonResult.count = 0;
- objJsonResult.Message = "淇濆瓨澶辫触锛佷唬鐮侀噸澶嶏紒";
+ objJsonResult.Message = "淇濆瓨澶辫触锛佺浉鍚屼娇鐢ㄧ粍缁囦笅浠g爜涓嶈兘閲嶅锛�";
objJsonResult.data = 1;
return objJsonResult;
}
@@ -3431,7 +3452,26 @@
return objJsonResult;
}
}
+ if (ds.Tables[0].Rows.Count > 1)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨澶辫触锛佺浉鍚屼娇鐢ㄧ粍缁囦笅浠g爜涓嶈兘閲嶅锛�";
+ 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;
+ }
+
//寰楀埌鐭唬鐮�
string sShortNumber;
sShortNumber = DBUtility.ClsPub.GetShortNumber(oItem.HNumber.Trim());
@@ -3510,8 +3550,7 @@
[HttpGet]
public object DeltetGy_BadType(string HItemID, string user)
{
- DataSet ds;
- //string ModRightNameCheck = "Sc_ProcessReport_check";
+ DataSet ds;
try
{
//鍒犻櫎鏉冮檺
@@ -3543,17 +3582,22 @@
objJsonResult.data = null;
return objJsonResult; ;
}
- //var HStopflag = Convert.ToBoolean(ds.Tables[0].Rows[0]["HStopflag"]);
- //if (HStopflag)
- //{
- // oCN.RollBack();//鍥炴粴浜嬪姟
- // 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;
+ }
//鍒犻櫎鍓嶆帶鍒�=========================================
string sql1 = "exec h_p_Gy_BadType_BeforeDelCtrl " + HItemID + ",'" + user + "'";
ds = oCN.RunProcReturn(sql1, "h_p_Gy_BadType_BeforeDelCtrl");
@@ -4080,6 +4124,17 @@
}
}
}
+
+ //宸插鏍哥殑涓嶅厑璁镐繚瀛�
+ 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;
+ }
+
//寰楀埌鐭唬鐮�
string sShortNumber;
sShortNumber = DBUtility.ClsPub.GetShortNumber(oItem.HNumber.Trim());
@@ -4115,7 +4170,6 @@
objJsonResult.code = "0";
objJsonResult.count = 1;
objJsonResult.Message = "淇濆瓨鎴愬姛锛�";
- //WebAPIController.Add_Log("閫佽揣鍗曚笅鎺�", UserName, "鐢熸垚閫佽揣鍗�");
objJsonResult.data = 1;
return objJsonResult;
}
@@ -4650,7 +4704,7 @@
}
//鏌ヨ鏁版嵁涓槸鍚﹀瓨鍦ㄩ噸澶嶄唬鐮�
- ds = oCN.RunProcReturn("select * from Gy_BadResult where HStopflag=0 and HNumber='" + oItem.HNumber.Trim() + "'", "Gy_BadResult");
+ ds = oCN.RunProcReturn("select * from Gy_BadResult where HNumber='" + oItem.HNumber.Trim() + "' and HUSEORGID= '" + oItem.HUSEORGID + "' ", "Gy_BadResult");
if (oItem.HNumber.Trim() == "")
{
objJsonResult.code = "0";
@@ -4659,6 +4713,7 @@
objJsonResult.data = 1;
return objJsonResult;
}
+
//鏂板鏃跺垽鏂�
if (oItem.HItemID == 0)
{
@@ -4670,7 +4725,7 @@
{
objJsonResult.code = "0";
objJsonResult.count = 0;
- objJsonResult.Message = "淇濆瓨澶辫触锛佷唬鐮侀噸澶嶏紒";
+ objJsonResult.Message = "淇濆瓨澶辫触锛佺浉鍚屼娇鐢ㄧ粍缁囦笅浠g爜涓嶈兘閲嶅锛�";
objJsonResult.data = 1;
return objJsonResult;
}
@@ -4721,7 +4776,26 @@
return objJsonResult;
}
}
+ if (ds.Tables[0].Rows.Count > 1)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨澶辫触锛佺浉鍚屼娇鐢ㄧ粍缁囦笅浠g爜涓嶈兘閲嶅锛�";
+ 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;
+ }
+
//寰楀埌鐭唬鐮�
string sShortNumber;
sShortNumber = DBUtility.ClsPub.GetShortNumber(oItem.HNumber.Trim());
@@ -4757,7 +4831,6 @@
objJsonResult.code = "0";
objJsonResult.count = 1;
objJsonResult.Message = "淇濆瓨鎴愬姛锛�";
- //WebAPIController.Add_Log("閫佽揣鍗曚笅鎺�", UserName, "鐢熸垚閫佽揣鍗�");
objJsonResult.data = 1;
return objJsonResult;
}
@@ -4832,16 +4905,23 @@
objJsonResult.data = null;
return objJsonResult; ;
}
- //var HStopflag = Convert.ToBoolean(ds.Tables[0].Rows[0]["HStopflag"]);
- //if (HStopflag)
- //{
- // oCN.RollBack();//鍥炴粴浜嬪姟
- // 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;
+ }
//鍒犻櫎鍓嶆帶鍒�=========================================
string sql1 = "exec h_p_Gy_BadResult_BeforeDelCtrl " + HItemID + ",'" + user + "'";
@@ -5259,7 +5339,7 @@
}
//鏌ヨ鏁版嵁涓槸鍚﹀瓨鍦ㄩ噸澶嶄唬鐮�
- ds = oCN.RunProcReturn("select * from Gy_InspectValue where HStopflag=0 and HNumber='" + oItem.HNumber.Trim() + "'", "Gy_InspectValue");
+ ds = oCN.RunProcReturn("select * from Gy_InspectValue where HNumber='" + oItem.HNumber.Trim() + "' and HUSEORGID='" + oItem.HUSEORGID + "'", "Gy_InspectValue");
if (oItem.HNumber.Trim() == "")
{
objJsonResult.code = "0";
@@ -5279,7 +5359,7 @@
{
objJsonResult.code = "0";
objJsonResult.count = 0;
- objJsonResult.Message = "淇濆瓨澶辫触锛佷唬鐮侀噸澶嶏紒";
+ objJsonResult.Message = "淇濆瓨澶辫触锛佺浉鍚屼娇鐢ㄧ粍缁囦笅浠g爜涓嶈兘閲嶅锛�";
objJsonResult.data = 1;
return objJsonResult;
}
@@ -5331,6 +5411,14 @@
}
}
}
+ if (ds.Tables[0].Rows.Count > 0 && ds.Tables[0].Rows[0]["HCheckEmp"].ToString() != "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨澶辫触锛佸凡瀹℃牳涓嶅厑璁镐慨鏀癸紒";
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
//寰楀埌鐭唬鐮�
string sShortNumber;
sShortNumber = DBUtility.ClsPub.GetShortNumber(oItem.HNumber.Trim());
@@ -5356,7 +5444,6 @@
string sExeReturnInfo = "";
if (oBill.oModel.HItemID == 0)
{
- // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
bResult = oBill.AddNew(ref sExeReturnInfo);
}
else
@@ -5368,7 +5455,6 @@
objJsonResult.code = "0";
objJsonResult.count = 1;
objJsonResult.Message = "淇濆瓨鎴愬姛锛�";
- //WebAPIController.Add_Log("閫佽揣鍗曚笅鎺�", UserName, "鐢熸垚閫佽揣鍗�");
objJsonResult.data = 1;
return objJsonResult;
}
@@ -5444,16 +5530,22 @@
objJsonResult.data = null;
return objJsonResult; ;
}
- //var HStopflag = Convert.ToBoolean(ds.Tables[0].Rows[0]["HStopflag"]);
- //if (HStopflag)
- //{
- // oCN.RollBack();//鍥炴粴浜嬪姟
- // 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;
+ }
//鍒犻櫎鍓嶆帶鍒�=========================================
@@ -5798,7 +5890,7 @@
}
//鏌ヨ鏁版嵁涓槸鍚﹀瓨鍦ㄩ噸澶嶄唬鐮�
- ds = oCN.RunProcReturn("select * from Gy_InspectMethod where HStopflag=0 and HNumber='" + oItem.HNumber.Trim() + "'", "Gy_InspectMethod");
+ ds = oCN.RunProcReturn("select * from Gy_InspectMethod where HNumber='" + oItem.HNumber.Trim() + "' and HUSEORGID='" + oItem.HUSEORGID + "'", "Gy_InspectMethod");
if (oItem.HNumber.Trim() == "")
{
objJsonResult.code = "0";
@@ -5818,7 +5910,7 @@
{
objJsonResult.code = "0";
objJsonResult.count = 0;
- objJsonResult.Message = "淇濆瓨澶辫触锛佷唬鐮侀噸澶嶏紒";
+ objJsonResult.Message = "淇濆瓨澶辫触锛佺浉鍚屼娇鐢ㄧ粍缁囦笅浠g爜涓嶈兘閲嶅锛�";
objJsonResult.data = 1;
return objJsonResult;
}
@@ -5870,6 +5962,14 @@
}
}
}
+ if (ds.Tables[0].Rows.Count > 0 && ds.Tables[0].Rows[0]["HCheckEmp"].ToString() != "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨澶辫触锛佸凡瀹℃牳涓嶅厑璁镐慨鏀癸紒";
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
//寰楀埌鐭唬鐮�
string sShortNumber;
sShortNumber = DBUtility.ClsPub.GetShortNumber(oItem.HNumber.Trim());
@@ -5894,7 +5994,6 @@
bool bResult;
if (oBill.oModel.HItemID == 0)
{
- // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
bResult = oBill.AddNew();
}
else
@@ -5906,7 +6005,6 @@
objJsonResult.code = "0";
objJsonResult.count = 1;
objJsonResult.Message = "淇濆瓨鎴愬姛锛�";
- //WebAPIController.Add_Log("閫佽揣鍗曚笅鎺�", UserName, "鐢熸垚閫佽揣鍗�");
objJsonResult.data = 1;
return objJsonResult;
}
@@ -5982,16 +6080,22 @@
objJsonResult.data = null;
return objJsonResult; ;
}
- //var HStopflag = Convert.ToBoolean(ds.Tables[0].Rows[0]["HStopflag"]);
- //if (HStopflag)
- //{
- // oCN.RollBack();//鍥炴粴浜嬪姟
- // 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 Gy_InspectMethod where HItemID=" + HItemID);
oCN.Commit();//鎻愪氦浜嬪姟
@@ -6087,7 +6191,7 @@
}
//鏌ヨ鏁版嵁涓槸鍚﹀瓨鍦ㄩ噸澶嶄唬鐮�
- ds = oCN.RunProcReturn("select * from Gy_QualityStd where HStopflag=0 and HNumber='" + oItem.HNumber.Trim() + "'", "Gy_QualityStd");
+ ds = oCN.RunProcReturn("select * from Gy_QualityStd where HNumber='" + oItem.HNumber.Trim() + "' and HUSEORGID='" + oItem.HUSEORGID + "'", "Gy_QualityStd");
if (oItem.HNumber.Trim() == "")
{
objJsonResult.code = "0";
@@ -6107,7 +6211,7 @@
{
objJsonResult.code = "0";
objJsonResult.count = 0;
- objJsonResult.Message = "淇濆瓨澶辫触锛佷唬鐮侀噸澶嶏紒";
+ objJsonResult.Message = "淇濆瓨澶辫触锛佺浉鍚岀粍缁囦笅浠g爜涓嶈兘閲嶅锛�";
objJsonResult.data = 1;
return objJsonResult;
}
@@ -6159,6 +6263,16 @@
}
}
}
+
+ //宸插鏍镐笉鍏佽淇濆瓨
+ if (ds.Tables[0].Rows.Count > 0 && ds.Tables[0].Rows[0]["HCheckEmp"].ToString() != "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨澶辫触锛佸凡瀹℃牳涓嶅厑璁镐慨鏀癸紒";
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
//寰楀埌鐭唬鐮�
string sShortNumber;
sShortNumber = DBUtility.ClsPub.GetShortNumber(oItem.HNumber.Trim());
@@ -6176,7 +6290,7 @@
oItem.HMakeEmp = msg2; //鍒涘缓浜�
oBill.oModel = oItem;
- }
+ }
//淇濆瓨
//淇濆瓨瀹屾瘯鍚庡鐞�
@@ -6271,16 +6385,22 @@
objJsonResult.data = null;
return objJsonResult; ;
}
- //var HStopflag = Convert.ToBoolean(ds.Tables[0].Rows[0]["HStopflag"]);
- //if (HStopflag)
- //{
- // oCN.RollBack();//鍥炴粴浜嬪姟
- // 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 Gy_QualityStd where HItemID=" + HItemID);
oCN.Commit();//鎻愪氦浜嬪姟
@@ -6376,7 +6496,7 @@
}
//鏌ヨ鏁版嵁涓槸鍚﹀瓨鍦ㄩ噸澶嶄唬鐮�
- ds = oCN.RunProcReturn("select * from Gy_InspectInstruMent where HStopflag=0 and HNumber='" + oItem.HNumber.Trim() + "'", "Gy_InspectInstruMent");
+ ds = oCN.RunProcReturn("select * from Gy_InspectInstruMent where HNumber='" + oItem.HNumber.Trim() + "' and HUSEORGID='" + oItem.HUSEORGID + "'", "Gy_InspectInstruMent");
if (oItem.HNumber.Trim() == "")
{
objJsonResult.code = "0";
@@ -6396,7 +6516,7 @@
{
objJsonResult.code = "0";
objJsonResult.count = 0;
- objJsonResult.Message = "淇濆瓨澶辫触锛佷唬鐮侀噸澶嶏紒";
+ objJsonResult.Message = "淇濆瓨澶辫触锛佺浉鍚屼娇鐢ㄧ粍缁囦笅浠g爜涓嶈兘閲嶅锛�";
objJsonResult.data = 1;
return objJsonResult;
}
@@ -6448,6 +6568,16 @@
}
}
}
+
+ if (ds.Tables[0].Rows.Count > 0 && ds.Tables[0].Rows[0]["HCheckEmp"].ToString() != "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨澶辫触锛佸凡瀹℃牳涓嶅厑璁镐慨鏀癸紒";
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+
//寰楀埌鐭唬鐮�
string sShortNumber;
sShortNumber = DBUtility.ClsPub.GetShortNumber(oItem.HNumber.Trim());
@@ -6473,7 +6603,6 @@
string sExeReturnInfo = "";
if (oBill.oModel.HItemID == 0)
{
- // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
bResult = oBill.AddNew(ref sExeReturnInfo);
}
else
@@ -6485,7 +6614,6 @@
objJsonResult.code = "0";
objJsonResult.count = 1;
objJsonResult.Message = "淇濆瓨鎴愬姛锛�";
- //WebAPIController.Add_Log("閫佽揣鍗曚笅鎺�", UserName, "鐢熸垚閫佽揣鍗�");
objJsonResult.data = 1;
return objJsonResult;
}
@@ -6561,16 +6689,22 @@
objJsonResult.data = null;
return objJsonResult; ;
}
- //var HStopflag = Convert.ToBoolean(ds.Tables[0].Rows[0]["HStopflag"]);
- //if (HStopflag)
- //{
- // oCN.RollBack();//鍥炴粴浜嬪姟
- // 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;
+ }
//鍒犻櫎鍓嶆帶鍒�=========================================
ds = oCN.RunProcReturn("Exec h_p_Gy_InspectInstruMent_BeforeDelCtrl " + HItemID + ",'" + User + "'", "h_p_Gy_InspectInstruMent_BeforeDelCtrl");
@@ -6896,7 +7030,7 @@
}
//鏌ヨ鏁版嵁涓槸鍚﹀瓨鍦ㄩ噸澶嶄唬鐮�
- ds = oCN.RunProcReturn("select * from Gy_InspectBasis where HStopflag=0 and HNumber='" + oItem.HNumber.Trim() + "'", "Gy_InspectBasis");
+ ds = oCN.RunProcReturn("select * from Gy_InspectBasis where HNumber='" + oItem.HNumber.Trim() + "' and HUSEORGID='" + oItem.HUSEORGID + "'", "Gy_InspectBasis");
if (oItem.HNumber.Trim() == "")
{
objJsonResult.code = "0";
@@ -6916,7 +7050,7 @@
{
objJsonResult.code = "0";
objJsonResult.count = 0;
- objJsonResult.Message = "淇濆瓨澶辫触锛佷唬鐮侀噸澶嶏紒";
+ objJsonResult.Message = "淇濆瓨澶辫触锛佺浉鍚岀粍缁囦笅浠g爜涓嶈兘閲嶅锛�";
objJsonResult.data = 1;
return objJsonResult;
}
@@ -6968,6 +7102,14 @@
}
}
}
+ if (ds.Tables[0].Rows.Count > 0 && ds.Tables[0].Rows[0]["HCheckEmp"].ToString() != "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨澶辫触锛佸凡瀹℃牳涓嶅厑璁镐慨鏀癸紒";
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
//寰楀埌鐭唬鐮�
string sShortNumber;
sShortNumber = DBUtility.ClsPub.GetShortNumber(oItem.HNumber.Trim());
@@ -6992,7 +7134,7 @@
bool bResult;
if (oBill.oModel.HItemID == 0)
{
- // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
+
bResult = oBill.AddNew();
}
else
@@ -7004,7 +7146,6 @@
objJsonResult.code = "0";
objJsonResult.count = 1;
objJsonResult.Message = "淇濆瓨鎴愬姛锛�";
- //WebAPIController.Add_Log("閫佽揣鍗曚笅鎺�", UserName, "鐢熸垚閫佽揣鍗�");
objJsonResult.data = 1;
return objJsonResult;
}
@@ -7080,16 +7221,22 @@
objJsonResult.data = null;
return objJsonResult; ;
}
- //var HStopflag = Convert.ToBoolean(ds.Tables[0].Rows[0]["HStopflag"]);
- //if (HStopflag)
- //{
- // oCN.RollBack();//鍥炴粴浜嬪姟
- // 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 Gy_InspectBasis where HItemID=" + HItemID);
oCN.Commit();//鎻愪氦浜嬪姟
@@ -13142,7 +13289,7 @@
}
//鏌ヨ鏁版嵁涓槸鍚﹀瓨鍦ㄩ噸澶嶄唬鐮�
- ds = oCN.RunProcReturn("select * from Gy_BadPhenomena where HStopflag=0 and HNumber='" + oItem.HNumber.Trim() + "'", "Gy_BadPhenomena");
+ ds = oCN.RunProcReturn("select * from Gy_BadPhenomena where HNumber='" + oItem.HNumber.Trim() + "' and HUSEORGID= '" + oItem.HUSEORGID + "' ", "Gy_BadPhenomena");
if (oItem.HNumber.Trim() == "")
{
objJsonResult.code = "0";
@@ -13151,6 +13298,7 @@
objJsonResult.data = 1;
return objJsonResult;
}
+
//鏂板鏃跺垽鏂�
if (oItem.HItemID == 0)
{
@@ -13162,7 +13310,7 @@
{
objJsonResult.code = "0";
objJsonResult.count = 0;
- objJsonResult.Message = "淇濆瓨澶辫触锛佷唬鐮侀噸澶嶏紒";
+ objJsonResult.Message = "淇濆瓨澶辫触锛佺浉鍚屼娇鐢ㄧ粍缁囦笅浠g爜涓嶈兘閲嶅锛�";
objJsonResult.data = 1;
return objJsonResult;
}
@@ -13213,7 +13361,27 @@
return objJsonResult;
}
}
+
+ if (ds.Tables[0].Rows.Count > 1)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨澶辫触锛佺浉鍚屼娇鐢ㄧ粍缁囦笅浠g爜涓嶈兘閲嶅锛�";
+ 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;
+ }
+
//寰楀埌鐭唬鐮�
string sShortNumber;
sShortNumber = DBUtility.ClsPub.GetShortNumber(oItem.HNumber.Trim());
@@ -13238,7 +13406,6 @@
bool bResult;
if (oBill.oModel.HItemID == 0)
{
- // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
bResult = oBill.AddNew(ref DBUtility.ClsPub.sExeReturnInfo);
}
else
@@ -13250,7 +13417,6 @@
objJsonResult.code = "0";
objJsonResult.count = 1;
objJsonResult.Message = "淇濆瓨鎴愬姛锛�";
- //WebAPIController.Add_Log("閫佽揣鍗曚笅鎺�", UserName, "鐢熸垚閫佽揣鍗�");
objJsonResult.data = 1;
return objJsonResult;
}
@@ -14637,7 +14803,7 @@
}
//鏌ヨ鏁版嵁涓槸鍚﹀瓨鍦ㄩ噸澶嶄唬鐮�
- ds = oCN.RunProcReturn("select * from Gy_PreventErrMould where HStopflag=0 and HNumber='" + oItem.HNumber.Trim() + "'", "Gy_PreventErrMould");
+ //ds = oCN.RunProcReturn("select * from Gy_PreventErrMould where HStopflag=0 and HNumber='" + oItem.HNumber.Trim() + "'", "Gy_PreventErrMould");
if (oItem.HNumber.Trim() == "")
{
objJsonResult.code = "0";
@@ -14646,21 +14812,32 @@
objJsonResult.data = 1;
return objJsonResult;
}
+ //鏌ヨ鏁版嵁涓槸鍚﹀瓨鍦ㄩ噸澶嶄唬鐮�
+ ds = oCN.RunProcReturn("Select HItemID from Gy_PreventErrMould Where HItemID<>" + oItem.HItemID + " and HNumber='" + oItem.HNumber.Trim() + "' and HUSEORGID=" + oItem.HUSEORGID, "Gy_PreventErrMould");
+
+ if (ds.Tables[0].Rows.Count > 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨澶辫触锛佷唬鐮侀噸澶嶏紒";
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
//鏂板鏃跺垽鏂�
if (oItem.HItemID == 0)
{
- if (ds == null || ds.Tables[0].Rows.Count == 0)
- {
+ //if (ds == null || ds.Tables[0].Rows.Count == 0)
+ //{
- }
- else
- {
- objJsonResult.code = "0";
- objJsonResult.count = 0;
- objJsonResult.Message = "淇濆瓨澶辫触锛佷唬鐮侀噸澶嶏紒";
- objJsonResult.data = 1;
- return objJsonResult;
- }
+ //}
+ //else
+ //{
+ // objJsonResult.code = "0";
+ // objJsonResult.count = 0;
+ // objJsonResult.Message = "淇濆瓨澶辫触锛佷唬鐮侀噸澶嶏紒";
+ // objJsonResult.data = 1;
+ // return objJsonResult;
+ //}
//妫�鏌ョ埗绾ф槸鍚﹀瓨鍦�
string sParent;
sParent = DBUtility.ClsPub.GetParentCode(oItem.HNumber.Trim());
@@ -14686,6 +14863,18 @@
}
else//缂栬緫鏃跺垽鏂�
{
+ //宸插鏍镐笉鍏佽淇敼
+ DataSet dss;
+ dss = oCN.RunProcReturn("select * from Gy_PreventErrMould where HItemID=" + oItem.HItemID, "Gy_PreventErrMould");
+ //鍒ゆ柇鏄惁鍙紪杈�
+ if (dss.Tables[0].Rows[0]["HCheckEmp"].ToString() != "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "姝ゅ崟鎹姸鎬佸凡缁忓鏍革紝涓嶅厑璁镐慨鏀癸紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
//妫�鏌ョ埗绾ф槸鍚﹀瓨鍦�
string sParent;
sParent = DBUtility.ClsPub.GetParentCode(oItem.HNumber.Trim());
@@ -15275,7 +15464,7 @@
}
//鏌ヨ鏁版嵁涓槸鍚﹀瓨鍦ㄩ噸澶嶄唬鐮�
- ds = oCN.RunProcReturn("select * from Gy_CheckNoteItem where HStopflag=0 and HNumber='" + oItem.HNumber.Trim() + "'", "Gy_CheckNoteItem");
+ //ds = oCN.RunProcReturn("select * from Gy_CheckNoteItem where HStopflag=0 and HNumber='" + oItem.HNumber.Trim() + "'", "Gy_CheckNoteItem");
if (oItem.HNumber.Trim() == "")
{
objJsonResult.code = "0";
@@ -15284,21 +15473,21 @@
objJsonResult.data = 1;
return objJsonResult;
}
+ //鏌ヨ鏁版嵁涓槸鍚﹀瓨鍦ㄩ噸澶嶄唬鐮�
+ ds = oCN.RunProcReturn("Select HItemID from Gy_CheckNoteItem Where HItemID<>" + oItem.HItemID + " and HNumber='" + oItem.HNumber.Trim() + "' and HUSEORGID=" + oItem.HUSEORGID, "Gy_CheckNoteItem");
+
+ if (ds.Tables[0].Rows.Count > 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨澶辫触锛佷唬鐮侀噸澶嶏紒";
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
//鏂板鏃跺垽鏂�
if (oItem.HItemID == 0)
{
- if (ds == null || ds.Tables[0].Rows.Count == 0)
- {
-
- }
- else
- {
- objJsonResult.code = "0";
- objJsonResult.count = 0;
- objJsonResult.Message = "淇濆瓨澶辫触锛佷唬鐮侀噸澶嶏紒";
- objJsonResult.data = 1;
- return objJsonResult;
- }
+
//妫�鏌ョ埗绾ф槸鍚﹀瓨鍦�
string sParent;
sParent = DBUtility.ClsPub.GetParentCode(oItem.HNumber.Trim());
@@ -15324,6 +15513,18 @@
}
else//缂栬緫鏃跺垽鏂�
{
+ //宸插鏍镐笉鍏佽淇敼
+ DataSet dss;
+ dss = oCN.RunProcReturn("select * from Gy_CheckNoteItem where HItemID=" + oItem.HItemID, "Gy_CheckNoteItem");
+ //鍒ゆ柇鏄惁鍙紪杈�
+ if (dss.Tables[0].Rows[0]["HCheckEmp"].ToString() != "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "姝ゅ崟鎹姸鎬佸凡缁忓鏍革紝涓嶅厑璁镐慨鏀癸紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
//妫�鏌ョ埗绾ф槸鍚﹀瓨鍦�
string sParent;
sParent = DBUtility.ClsPub.GetParentCode(oItem.HNumber.Trim());
@@ -16954,7 +17155,7 @@
}
//鏌ヨ鏁版嵁涓槸鍚﹀瓨鍦ㄩ噸澶嶄唬鐮�
- ds = oCN.RunProcReturn("select * from Gy_EnvironmentTestItem where HStopflag=0 and HNumber='" + oItem.HNumber.Trim() + "'", "Gy_EnvironmentTestItem");
+ ds = oCN.RunProcReturn("select * from Gy_EnvironmentTestItem where HNumber='" + oItem.HNumber.Trim() + "' and HUSEORGID='" + oItem.HUSEORGID + "'", "Gy_EnvironmentTestItem");
if (oItem.HNumber.Trim() == "")
{
objJsonResult.code = "0";
@@ -16974,7 +17175,7 @@
{
objJsonResult.code = "0";
objJsonResult.count = 0;
- objJsonResult.Message = "淇濆瓨澶辫触锛佷唬鐮侀噸澶嶏紒";
+ objJsonResult.Message = "淇濆瓨澶辫触锛佺浉鍚岀粍缁囦笅浠g爜涓嶈兘閲嶅锛�";
objJsonResult.data = 1;
return objJsonResult;
}
@@ -17026,6 +17227,16 @@
}
}
}
+ //宸插鏍镐笉鍏佽淇敼
+ if (ds.Tables[0].Rows.Count > 0 && ds.Tables[0].Rows[0]["HCheckEmp"].ToString() != "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨澶辫触锛佸凡瀹℃牳涓嶅厑璁镐慨鏀癸紒";
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+
//寰楀埌鐭唬鐮�
string sShortNumber;
sShortNumber = DBUtility.ClsPub.GetShortNumber(oItem.HNumber.Trim());
@@ -17135,6 +17346,24 @@
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;
+ }
+
//鍒犻櫎鍓嶆帶鍒�=========================================
string sql1 = "exec h_p_Gy_EnvironmentTestItem_BeforeDelCtrl " + HItemID + ",'" + user + "'";
ds = oCN.RunProcReturn(sql1, "h_p_Gy_EnvironmentTestItem_BeforeDelCtrl");
--
Gitblit v1.9.1