From 49f60ae2d2a6b5bc9623ed41e22c57412852e49c Mon Sep 17 00:00:00 2001
From: chenhaozhe <cgz@hz-kingdee.com>
Date: 星期五, 06 三月 2026 13:27:07 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API
---
WebAPI/Controllers/基础资料/基础资料/Gy_MaintainBillController.cs | 648 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 640 insertions(+), 8 deletions(-)
diff --git "a/WebAPI/Controllers/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/Gy_MaintainBillController.cs" "b/WebAPI/Controllers/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/Gy_MaintainBillController.cs"
index 4a9b9ac..30ebfba 100644
--- "a/WebAPI/Controllers/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/Gy_MaintainBillController.cs"
+++ "b/WebAPI/Controllers/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/Gy_MaintainBillController.cs"
@@ -81,6 +81,87 @@
}
#endregion
+ #region 缁翠慨楠屾敹椤圭洰鍒嗙被 鏍戝舰鍥�(鏍规嵁浠g爜灞曞紑鏍戠姸鍥�)
+ public class TreeModel
+ {
+ public string id { get; set; }
+ public string title { get; set; }
+ public List<TreeModel> children = new List<TreeModel>();
+ }
+ [Route("Gy_Maintain/Gy_MaintainTreeList")]
+ [HttpGet]
+ public object Gy_RepairClassTreeList()
+ {
+ try
+ {
+ string sql1 = string.Format("select hitemid,hnumber,hname from Gy_MaintainClass order by hnumber");
+
+ ds = oCN.RunProcReturn(sql1, "Gy_RepairClass");
+
+ List<TreeModel> treeModels = new List<TreeModel>();
+ TreeModel first = new TreeModel();
+ first.id = "0";
+ first.title = "淇濆吇椤圭洰鍒嗙被璁剧疆";
+ treeModels.Add(first);
+
+ foreach (DataRow row in ds.Tables[0].Rows)
+ {
+ var strLen = row["hnumber"].ToString().Split('.');
+ if (strLen.Length == 1)
+ {
+ TreeModel tree = new TreeModel();
+ tree.id = row["hitemid"].ToString();
+ tree.title = row["hname"].ToString();
+ treeModels[0].children.Add(tree);
+ }
+ }
+ digui(ds.Tables[0], treeModels[0].children, 2);
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "Sucess锛�";
+ objJsonResult.data = Newtonsoft.Json.JsonConvert.SerializeObject(treeModels);
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "Exception锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+
+ /// <summary>
+ /// 閫掑綊鍑芥暟
+ /// </summary>
+ public void digui(DataTable dt, List<TreeModel> tree, int num)
+ {
+ for (int m = 0; m < tree.Count; m++)
+ {
+ tree[m].children = new List<TreeModel>();
+ for (int i = 0; i < dt.Rows.Count; i++)//绗竴娆″惊鐜紝寰楀埌鎵�鏈夋牴鑺傜偣鐨勫瓙闆�
+ {
+ var strLen = dt.Rows[i]["hnumber"].ToString().Split('.');
+ if (strLen.Length == num && dt.Rows[i]["hnumber"].ToString().Contains(tree[m].id + "."))
+ {
+ TreeModel tbjson = new TreeModel();
+ tbjson.id = dt.Rows[i]["hitemid"].ToString();
+ tbjson.title = dt.Rows[i]["hname"].ToString();
+ tree[m].children.Add(tbjson);
+ }
+ }
+ var strLens = tree[m].id.Split('.');
+ for (int i = 0; i < tree[m].children.Count; i++)
+ {
+ digui(dt, tree[m].children, strLens.Length + 2);//鍐嶆鐢ㄥ瓙闆嗗幓寰幆锛屾嬁鍑哄瓙闆嗙殑瀛愰泦
+ }
+ }
+
+ }
+ #endregion
+
#region 淇濆吇椤圭洰鍒犻櫎
[Route("Gy_Maintain/DeleteMaintain")]
[HttpGet]
@@ -100,7 +181,53 @@
ds = oCN.RunProcReturn("Select * from Gy_Maintain Where HItemID='" + HItemID + "'", "Gy_Maintain", ref DBUtility.ClsPub.sExeReturnInfo);
if (ds.Tables[0].Rows.Count != 0)
{
+ //鍒犻櫎鍓嶆帶鍒�=========================================
+ ds = oCN.RunProcReturn("Exec h_p_Gy_Maintain_BeforeDelCtrl " + HItemID + ",'" + User + "'", "h_p_Gy_Maintain_BeforeDelCtrl");
+
+ if (ds == null)
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍒犻櫎鍓嶅垽鏂け璐ワ紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍒犻櫎澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //=========================================================
+
ds = oCN.RunProcReturn("Delete from Gy_Maintain Where HItemID='" + HItemID + "'", "Gy_Maintain", ref DBUtility.ClsPub.sExeReturnInfo);
+
+ //鍒犻櫎鍚庢帶鍒�=========================================
+ DataSet ds2 = oCN.RunProcReturn("Exec h_p_Gy_Maintain_AfterDelCtrl " + HItemID + ",'" + User + "'", "h_p_Gy_Maintain_AfterDelCtrl");
+ if (ds2 == null)
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍒犻櫎鍚庡垽鏂け璐ワ紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍒犻櫎澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //=========================================================
+
objJsonResult.code = "1";
objJsonResult.count = 1;
objJsonResult.Message = "鍒犻櫎鎴愬姛";
@@ -134,7 +261,7 @@
{
try
{
- ds = oCN.RunProcReturn("select * from Gy_Maintain where HItemID=" + HInterID, "Gy_Maintain");
+ ds = oCN.RunProcReturn("select * from h_v_Gy_Maintain where HItemID=" + HInterID, "h_v_Gy_Maintain");
objJsonResult.code = "1";
objJsonResult.count = 1;
@@ -180,6 +307,10 @@
string HRemark = list[0].HRemark;
bool HStopflag = list[0].HStopflag;
string HUseFlag = list[0].HUseFlag;
+ string HModifyEmp = msg4;
+ string HMaintainType = list[0].HMaintainType;
+ long HUSEORGID = list[0].HUSEORGID;
+ long HMaintainClassID = list[0].HMaintainClassID;
//鍒ゆ柇鏉冮檺
if (!ClsPub.Security_Log("Gy_Maintain_Edit", 1, false, msg4))
@@ -213,17 +344,69 @@
//鑻AINDI閲嶅鍒欓噸鏂拌幏鍙�
oCN.BeginTran();
+
+
+ //淇濆瓨鍓嶆帶鍒�=========================================
+ DataSet ds = oCN.RunProcReturn("Exec h_p_Gy_Maintain_BeforeSaveCtrl " + msg3 + ",'1'", "h_p_Gy_Maintain_BeforeSaveCtrl");
+ if (ds == null)
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨鍓嶅垽鏂け璐ワ紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //=========================================================
+
//涓昏〃
oCN.RunProc("Update Gy_Maintain set " +
" HNumber='" + HNumber + "'" +
",HName='" + HName + "'" +
+ ",HModifyEmp='" + HModifyEmp + "'" +
+ ",HMaintainType='" + HMaintainType + "'" +
+ ",HModifyTime=getdate()" +
+ ",HUSEORGID='" + HUSEORGID + "'" +
+ ",HMaintainClassID='" + HMaintainClassID + "'" +
",HShortNumber='" + HShortNumber + "'" +
",HHelpCode='" + HHelpCode + "'" +
",HStopflag='" + HStopflag + "'" +
",HRemark= '" + HRemark + "' Where HItemID=" + HItemID, ref DBUtility.ClsPub.sExeReturnInfo);
//淇敼瀛愰」鐩唬鐮�
//oCN.RunProc("exec h_p_Gy_UpdateNumber Gy_RepairCheck,'" + HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo);
-
+
+ //淇濆瓨鍚庢帶鍒�=========================================
+ DataSet ds2 = oCN.RunProcReturn("Exec h_p_Gy_Maintain_AfterSaveCtrl " + msg3 + ",'1'", "h_p_Gy_Maintain_AfterSaveCtrl");
+ if (ds2 == null)
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨鍚庡垽鏂け璐ワ紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+
+ }
+ if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]);
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //=========================================================
+
oCN.Commit();
objJsonResult.code = "1";
objJsonResult.count = 1;
@@ -254,13 +437,14 @@
string msg1 = _value.ToString();
string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
string msg2 = sArray[0].ToString();
- string msg3 = sArray[1].ToString();//褰撳墠浜�
+ string msg3 = sArray[2].ToString();//褰撳墠浜�
+ string msg4 = sArray[1].ToString();
//鍙嶅簭鍒楀寲
msg2 = "[" + msg2.ToString() + "]";
- List<Models.ClsGy_Maintain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Models.ClsGy_Maintain>>(msg2);
+ var list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Models.ClsGy_Maintain>>(msg2);
string HNumber = list[0].HNumber;
string HName = list[0].HName;
string HShortNumber = list[0].HNumber;
@@ -271,6 +455,11 @@
string HUseFlag = list[0].HUseFlag;
bool HEndFlag = list[0].HEndFlag;
int HParentID = list[0].HParentID;
+ string HMakeEmp = list[0].HMakeEmp;
+ string HMaintainType = list[0].HMaintainType;
+ long HUSEORGID = list[0].HUSEORGID;
+ long HCREATEORGID = list[0].HCREATEORGID;
+ long HMaintainClassID = list[0].HMaintainClassID;
//鍒ゆ柇鏉冮檺
if (!ClsPub.Security_Log("Gy_Maintain_Edit", 1, false, msg3))
@@ -291,18 +480,81 @@
return objJsonResult;
}
+ // 鏂板鏃跺垽鏂槸鍚﹀瓨鍦ㄩ噸澶嶄唬鐮�
+ var dsRepeatCheck = oCN.RunProcReturn($@"
+ select top 1 HItemID from Gy_Maintain where HStopflag = 0 and HNumber = '{HNumber}'
+ ", "Gy_Maintain");
+
+ if(dsRepeatCheck.Tables[0].Rows.Count > 0)
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "浠g爜閲嶅锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
//鑻AINDI閲嶅鍒欓噸鏂拌幏鍙�
oCN.BeginTran();
+
+ //淇濆瓨鍓嶆帶鍒�=========================================
+ DataSet ds = oCN.RunProcReturn("Exec h_p_Gy_Maintain_BeforeSaveCtrl " + msg3 + ",'1'", "h_p_Gy_Maintain_BeforeSaveCtrl");
+ if (ds == null)
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨鍓嶅垽鏂け璐ワ紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //=========================================================
+
//涓昏〃
oCN.RunProc("Insert into Gy_Maintain " +
" (HNumber,HName,HHelpCode,HShortNumber,HParentID" +
- ",HLevel,HEndFlag,HStopflag,HRemark) " +
+ ",HLevel,HEndFlag,HStopflag,HRemark" +
+ ",HMakeEmp,HMakeTime,HUSEORGID,HCREATEORGID,HUseFlag,HMaintainType,HMaintainClassID) " +
" Values('" + HNumber + "','" + HName + "','" + HHelpCode + "','" + HShortNumber + "'," + HParentID.ToString()+","
- + HLevel + ",1," + Convert.ToString(HStopflag ? 1 : 0) + ",'" + HRemark + "')", ref DBUtility.ClsPub.sExeReturnInfo);
+ + HLevel + ",1," + Convert.ToString(HStopflag ? 1 : 0) + ",'" + HRemark + "'" +
+ ",'" + HMakeEmp + "',getdate()," + HUSEORGID + "," + HCREATEORGID + ",'" + HUseFlag + "','" + HMaintainType + "',"+ HMaintainClassID + ")", ref DBUtility.ClsPub.sExeReturnInfo);
//淇敼涓婄骇涓洪潪鏈骇浠g爜
//oCN.RunProc("Update Gy_MouldType set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo);
+
+ //淇濆瓨鍚庢帶鍒�=========================================
+ DataSet ds2 = oCN.RunProcReturn("Exec h_p_Gy_Maintain_AfterSaveCtrl " + msg3 + ",'1'", "h_p_Gy_Maintain_AfterSaveCtrl");
+ if (ds2 == null)
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "淇濆瓨鍚庡垽鏂け璐ワ紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+
+ }
+ if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]);
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //=========================================================
+
oCN.Commit();
objJsonResult.code = "1";
objJsonResult.count = 1;
@@ -322,7 +574,110 @@
}
#endregion
- #region 淇濆吇椤圭洰瀹℃牳/鍙嶅鏍�
+ //#region 淇濆吇椤圭洰瀹℃牳/鍙嶅鏍�
+ //[Route("Gy_Maintain/AuditGy_Maintain")]
+ //[HttpGet]
+ //public object AuditGy_Maintain(string HInterID, int Type, string user)
+ //{
+ // try
+ // {
+ // //鍒ゆ柇鏄惁鏈夊鏍告潈闄�
+ // if (!DBUtility.ClsPub.Security_Log("Gy_Maintain_Check", 1, false, user))
+ // {
+ // objJsonResult.code = "0";
+ // objJsonResult.count = 0;
+ // objJsonResult.Message = "鏃犳潈闄愬鏍�!";
+ // objJsonResult.data = null;
+ // return objJsonResult;
+ // }
+
+ // if (string.IsNullOrWhiteSpace(HInterID))
+ // {
+ // objJsonResult.code = "0";
+ // objJsonResult.count = 0;
+ // objJsonResult.Message = "HInterID涓虹┖锛�";
+ // objJsonResult.data = null;
+ // return objJsonResult;
+ // }
+ // DAL.ClsGy_Maintain_Ctl oBill = new DAL.ClsGy_Maintain_Ctl();
+ // ClsPub.CurUserName = user;
+ // oCN.BeginTran();//寮�濮嬩簨鍔�
+
+ // //Type 1 瀹℃牳 2 鍙嶅鏍�
+ // if (Type == 1)
+ // {
+ // //鍒ゆ柇鍗曟嵁鏄惁宸茬粡瀹℃牳
+ // DataSet ds;
+ // string sql = "select * from Gy_Maintain where HItemID = " + HInterID;
+ // ds = oCN.RunProcReturn(sql, oBill.MvarItemKey);
+ // if (ds.Tables[0].Rows[0]["HCheckEmp"] != null && ds.Tables[0].Rows[0]["HCheckEmp"].ToString() != "")
+ // {
+ // objJsonResult.code = "0";
+ // objJsonResult.count = 0;
+ // objJsonResult.Message = "鍗曟嵁宸插鏍�!涓嶈兘鍐嶆瀹℃牳锛�";
+ // objJsonResult.data = null;
+ // return objJsonResult;
+ // }
+ // //瀹℃牳鍗曟嵁
+ // if (!oBill.AuditByID2(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo))
+ // {
+ // objJsonResult.code = "0";
+ // objJsonResult.count = 1;
+ // objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + ClsPub.sExeReturnInfo;
+ // objJsonResult.data = null;
+ // return objJsonResult;
+ // }
+ // }
+
+ // else
+ // {
+ // //鍒ゆ柇鍗曟嵁鏄惁宸茬粡鍙嶅鏍�
+ // DataSet ds;
+ // string sql = "select * from Gy_Maintain where HItemID = " + HInterID;
+ // ds = oCN.RunProcReturn(sql, oBill.MvarItemKey);
+ // if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
+ // {
+ // if (ds.Tables[0].Rows[0]["HCheckEmp"] == null || ds.Tables[0].Rows[0]["HCheckEmp"].ToString() == "")
+ // {
+ // objJsonResult.code = "0";
+ // objJsonResult.count = 0;
+ // objJsonResult.Message = "鍗曟嵁鏈鏍�!涓嶉渶瑕佸弽瀹℃牳!";
+ // objJsonResult.data = null;
+ // return objJsonResult;
+ // }
+ // //鍙嶅鏍稿崟鎹�
+ // if (!oBill.DeAuditByID2(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo))
+ // {
+ // objJsonResult.code = "0";
+ // objJsonResult.count = 1;
+ // objJsonResult.Message = "鍙嶅鏍稿け璐�!鍘熷洜:" + ClsPub.sExeReturnInfo;
+ // objJsonResult.data = null;
+ // return objJsonResult;
+ // }
+ // }
+ // }
+
+ // 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
+
+ #region 缁翠慨楠屾敹椤圭洰瀹℃牳/鍙嶅鏍�
[Route("Gy_Maintain/AuditGy_Maintain")]
[HttpGet]
public object AuditGy_Maintain(string HInterID, int Type, string user)
@@ -366,6 +721,29 @@
objJsonResult.data = null;
return objJsonResult;
}
+
+ //瀹℃牳鍓嶆帶鍒�=========================================
+ ds = oCN.RunProcReturn("Exec h_p_Gy_Maintain_BeforeCheckCtrl " + HInterID + ",'" + user + "'", "h_p_Gy_Maintain_BeforeCheckCtrl");
+ if (ds == null)
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "瀹℃牳鍓嶅垽鏂け璐ワ紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "瀹℃牳澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //=========================================================
+
//瀹℃牳鍗曟嵁
if (!oBill.AuditByID2(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo))
{
@@ -375,6 +753,29 @@
objJsonResult.data = null;
return objJsonResult;
}
+
+ //瀹℃牳鍚庢帶鍒�=========================================
+ DataSet ds2 = oCN.RunProcReturn("Exec h_p_Gy_Maintain_AfterCheckCtrl " + HInterID + ",'" + user + "'", "h_p_Gy_Maintain_AfterCheckCtrl");
+ if (ds2 == null)
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "瀹℃牳鍚庡垽鏂け璐ワ紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "瀹℃牳澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //=========================================================
+
}
else
@@ -393,6 +794,29 @@
objJsonResult.data = null;
return objJsonResult;
}
+
+ //鍙嶅鏍稿墠鎺у埗=========================================
+ ds = oCN.RunProcReturn("Exec h_p_Gy_Maintain_BeforeUnCheckCtrl " + HInterID + ",'" + user + "'", "h_p_Gy_Maintain_BeforeUnCheckCtrl");
+ if (ds == null)
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "瀹℃牳鍓嶅垽鏂け璐ワ紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "瀹℃牳澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //=========================================================
+
//鍙嶅鏍稿崟鎹�
if (!oBill.DeAuditByID2(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo))
{
@@ -402,6 +826,29 @@
objJsonResult.data = null;
return objJsonResult;
}
+
+
+ //鍙嶅鏍稿悗鎺у埗=========================================
+ DataSet ds2 = oCN.RunProcReturn("Exec h_p_Gy_Maintain_AfterUnCheckCtrl " + HInterID + ",'" + user + "'", "h_p_Gy_Maintain_AfterUnCheckCtrl");
+ if (ds2 == null)
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "瀹℃牳鍚庡垽鏂け璐ワ紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "瀹℃牳澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //=========================================================
}
}
@@ -419,6 +866,191 @@
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = "鎵ц澶辫触锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+
+ #region 缁翠慨楠屾敹椤圭洰绂佺敤銆佸弽绂佺敤
+ /// <summary>
+ ///
+ /// </summary>
+ /// <param name="HInterID">鍗曟嵁ID</param>
+ /// <param name="IsStop">绂佺敤(0),鍙嶇鐢�(1)</param>
+ /// <param name="CurUserName">瀹℃牳浜�</param>
+ /// <returns></returns>
+ [Route("Gy_Maintain/StopGy_Maintain")]
+ [HttpGet]
+ public object StopGy_Maintain(int HInterID, int IsStop, string CurUserName)
+ {
+ try
+ {
+ //绂佺敤鏉冮檺
+ if (!DBUtility.ClsPub.Security_Log_second("Gy_Maintain_Stop", 1, false, CurUserName))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "绂佺敤澶辫触锛佹棤鏉冮檺锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ var ds = oCN.RunProcReturn("select * from Gy_Maintain where HItemID=" + HInterID, "Gy_Material");
+ if (ds.Tables[0].Rows.Count > 0)
+ {
+ if (IsStop == 0) //绂佺敤鍒ゆ柇
+ {
+ if (ds.Tables[0].Rows[0]["HStopEmp"].ToString() != "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁宸茬鐢�!涓嶈兘鍐嶆绂佺敤锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ if (IsStop == 1) //鍙嶇鐢ㄥ垽鏂�
+ {
+ if (ds.Tables[0].Rows[0]["HStopEmp"].ToString() == "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁鏈鐢�!涓嶉渶瑕佸弽绂佺敤!";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍗曟嵁涓嶅瓨鍦�!";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ oCN.BeginTran();
+
+ if (IsStop == 0) //绂佺敤鍒ゆ柇
+ {
+ //绂佺敤鍓嶆帶鍒�=========================================
+ ds = oCN.RunProcReturn("Exec h_p_Gy_Maintain_BeforeStopCtrl " + HInterID + ",'" + CurUserName + "'", "h_p_Gy_Maintain_BeforeStopCtrl");
+ if (ds == null)
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "绂佺敤鍓嶅垽鏂け璐ワ紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "绂佺敤澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //=========================================================
+
+ oCN.RunProc("update Gy_Maintain set HStopEmp='" + CurUserName + "',HStopTime=getdate(),HStopflag=1 where HItemID=" + HInterID);
+
+ //绂佺敤鍚庢帶鍒�=========================================
+ DataSet ds2 = oCN.RunProcReturn("Exec h_p_Gy_Maintain_AfterStopCtrl " + HInterID + ",'" + CurUserName + "'", "h_p_Gy_Maintain_AfterStopCtrl");
+ if (ds2 == null)
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "绂佺敤鍚庡垽鏂け璐ワ紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "绂佺敤澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //=========================================================
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "绂佺敤鎴愬姛";
+ objJsonResult.data = null;
+ }
+ if (IsStop == 1) //鍙嶇鐢ㄥ垽鏂�
+ {
+ //鍙嶇鐢ㄥ墠鎺у埗=========================================
+ ds = oCN.RunProcReturn("Exec h_p_Gy_Maintain_BeforeUnStopCtrl " + HInterID + ",'" + CurUserName + "'", "h_p_Gy_Maintain_BeforeUnStopCtrl");
+ if (ds == null)
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "绂佺敤鍓嶅垽鏂け璐ワ紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "绂佺敤澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //=========================================================
+
+ oCN.RunProc("update Gy_Maintain set HStopEmp='',HStopTime=null,HStopflag=0 where HItemID=" + HInterID);
+
+
+ //鍙嶇鐢ㄥ悗鎺у埗=========================================
+ DataSet ds2 = oCN.RunProcReturn("Exec h_p_Gy_Maintain_AfterUnStopCtrl " + HInterID + ",'" + CurUserName + "'", "h_p_Gy_Maintain_AfterUnStopCtrl");
+ if (ds2 == null)
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "绂佺敤鍚庡垽鏂け璐ワ紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "绂佺敤澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //=========================================================
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍙嶇鐢ㄦ垚鍔�";
+ objJsonResult.data = null;
+ }
+ oCN.Commit();
+
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ oCN.RollBack();
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "绂佺敤澶辫触鎴栬�呭弽绂佺敤澶辫触锛�" + e.ToString();
objJsonResult.data = null;
return objJsonResult;
}
@@ -482,7 +1114,7 @@
error += "娌℃湁鎵惧埌銆愮偣妫�椤圭洰浠g爜銆戠殑鏍囬,";
if (!tb2.Columns.Contains("淇濆吇椤圭洰鍚嶇О"))
- error += "娌℃湁鎵惧埌銆愮偣妫�椤圭洰鍚嶇О銆戠殑鏍囬,";
+ error += "娌℃湁鎵惧埌銆愪繚鍏婚」鐩悕绉般�戠殑鏍囬,";
if (error.Length > 0)
{
--
Gitblit v1.9.1