From c4c02944532a9bfda6de9a0cd85a9dfa631ed003 Mon Sep 17 00:00:00 2001 From: zrg <z18737863051@163.com> Date: 星期六, 17 五月 2025 15:28:19 +0800 Subject: [PATCH] 1 --- WebAPI/Controllers/BaseSet/Gy_MaterialController.cs | 480 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 457 insertions(+), 23 deletions(-) diff --git a/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs b/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs index cd2fed4..caeec5c 100644 --- a/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs +++ b/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs @@ -134,12 +134,14 @@ objJsonResult.data = null; return objJsonResult; } + if (sWhere == null || sWhere.Equals("")) { ds = oCN.RunProcReturn("exec h_p_Gy_MaterialList " + page + "," + size + ",'" + Organization +"'," + "''", "h_p_Gy_MaterialList"); } else { + sWhere = sWhere.Replace("'", "''"); ds = oCN.RunProcReturn("exec h_p_Gy_MaterialList " + page + "," + size + ",'" + Organization + "','" + sWhere + "'", "h_p_Gy_MaterialList"); } @@ -568,6 +570,7 @@ oItem.HShortNumber = sShortNumber;//鐭唬鐮� oItem.HEndFlag = true;//鏈骇鏍囧織 oItem.HLevel = DBUtility.ClsPub.GetLevel(oItem.HNumber.Trim()); //绛夌骇 + oItem.HMakeEmp = msg2; oBill.oModel = oItem; } //淇濆瓨 @@ -1118,11 +1121,11 @@ [HttpGet] public object DeltetGy_Material(string HItemID, string user) { + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + oCN.BeginTran();//寮�濮嬩簨鍔� DataSet ds; try { - SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); - if (user == "10000")//api鍚屾鏂瑰紡 { oCN.RunProc("delete from Gy_Material where HERPItemID=" + HItemID); @@ -1150,7 +1153,7 @@ objJsonResult.data = null; return objJsonResult; } - oCN.BeginTran();//寮�濮嬩簨鍔� + ds = oCN.RunProcReturn("select * from Gy_Material where HItemID=" + HItemID, "Gy_Material"); if (ds == null || ds.Tables[0].Rows.Count == 0) { @@ -1384,7 +1387,49 @@ } #endregion + #region 鑾峰彇褰撳墠鍏徃鍚� + /// <summary> + /// + /// </summary> + /// <param name="HInterID">鍗曟嵁ID</param> + /// <param name="IsAudit">瀹℃牳(0),鍙嶅鏍�(1)</param> + /// <param name="CurUserName">瀹℃牳浜�</param> + /// <returns></returns> + [Route("Xt_getInfo/getCompanyName")] + [HttpGet] + public object getCompanyName() + { + try + { + string sErr = ""; + if(oSystemParameter.ShowBill(ref sErr)) + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = oSystemParameter.omodel.WMS_CampanyName; + objJsonResult.data = oSystemParameter.omodel.WMS_CampanyName; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "褰撳墠鍏徃鍚嶈幏鍙栧け璐ワ紒" ; + objJsonResult.data = null; + } + return objJsonResult; + } + catch (Exception e) + { + oCN.RollBack(); + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion /// <summary> @@ -1432,6 +1477,63 @@ return objJsonResult; } } + + #region 妯″叿鍒楄〃鍒嗛〉鍒楄〃 + [Route("Gy_Mould/page")] + [HttpGet] + public object Gy_MouldPage(string sWhere,string ModRightNameSelect,string user, int page, int size) + { + DataSet ds; + json res = new json(); + try + { + List<object> columnNameList = new List<object>(); + if (!DBUtility.ClsPub.Security_Log(ModRightNameSelect, 1, false, user)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁鏌ョ湅鏉冮檺"; + objJsonResult.data = null; + return objJsonResult; + } + + if (sWhere == null || sWhere.Equals("")) + { + ds = oCN.RunProcReturn("exec h_p_Gy_MouldFileList " + page + "," + size + ",''", "h_p_Gy_MouldFileList"); + } + else + { + sWhere = sWhere.Replace("'", "''"); + ds = oCN.RunProcReturn("exec h_p_Gy_MouldFileList " + page + "," + size + ",'" + sWhere + "'", "h_p_Gy_MouldFileList"); + } + + //娣诲姞鍒楀悕 + 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鍒楀璞$殑鍒楀悕 + } + + res.code = CodeConstant.SUCCEED; + res.count = int.Parse(ds.Tables[1].Rows[0]["count"].ToString()); + res.Message = "Sucess锛�"; + res.list = columnNameList; + res.data = ds.Tables[0]; + return res; + } + catch (Exception e) + { + res.code = CodeConstant.FAIL; + res.count = CountConstant.FAIL; + res.Message = "Exception锛�" + e.ToString(); + res.data = null; + return res; + } + } + #endregion + + #region 鍣ㄥ叿妗f鍒楄〃 鏍戠姸鍥� 璁惧鍒嗙被鏌ヨ @@ -1646,7 +1748,7 @@ { objJsonResult.code = "0"; objJsonResult.count = 0; - objJsonResult.Message = "鏃犲垹闄ゆ潈闄愶紒"; + objJsonResult.Message = "[0000-1-058]鏃犲垹闄ゆ潈闄愶紒"; objJsonResult.data = null; return objJsonResult; } @@ -1657,7 +1759,7 @@ { objJsonResult.code = "0"; objJsonResult.count = 0; - objJsonResult.Message = "鍒犻櫎鏉$爜鍓嶅垽鏂彂鐢熼敊璇紒"; + objJsonResult.Message = "[3899-1-001]鍒犻櫎鏉$爜鍓嶅垽鏂彂鐢熼敊璇紒"; objJsonResult.data = null; return objJsonResult; } @@ -1667,9 +1769,9 @@ { objJsonResult.code = "0"; objJsonResult.count = 0; - objJsonResult.Message = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HRemark"]); + objJsonResult.Message = "[0000-1-007]" + DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HRemark"]); objJsonResult.data = null; - return objJsonResult; + return objJsonResult; } } //Int64 lngBillKey = 0; @@ -1678,7 +1780,7 @@ { objJsonResult.code = "0"; objJsonResult.count = 0; - objJsonResult.Message = "鍗曟嵁ID涓虹┖锛�"; + objJsonResult.Message = "[0000-1-009]鍗曟嵁ID涓虹┖锛�"; objJsonResult.data = null; return objJsonResult; } @@ -1723,7 +1825,7 @@ oCN.Commit(); objJsonResult.code = "1"; objJsonResult.count = 1; - objJsonResult.Message = "鍒犻櫎鎴愬姛"; + objJsonResult.Message = "[0000-1-008]鍒犻櫎鎴愬姛"; objJsonResult.data = null; return objJsonResult; } @@ -1731,7 +1833,7 @@ { objJsonResult.code = "0"; objJsonResult.count = 0; - objJsonResult.Message = "鍗曟嵁鏈壘鍒�"; + objJsonResult.Message = "[0000-1-045]鍗曟嵁鏈壘鍒�"; objJsonResult.data = null; return objJsonResult; } @@ -1741,7 +1843,7 @@ oCN.RollBack(); objJsonResult.code = "0"; objJsonResult.count = 0; - objJsonResult.Message = e.Message; + objJsonResult.Message = "[0000-1-007]" + e.Message; objJsonResult.data = null; return objJsonResult; } @@ -1768,7 +1870,7 @@ { objJsonResult.code = "0"; objJsonResult.count = 0; - objJsonResult.Message = "浣滃簾澶辫触锛佹棤鏉冮檺锛�"; + objJsonResult.Message = "[0000-1-063]浣滃簾澶辫触锛佹棤鏉冮檺锛�"; objJsonResult.data = null; return objJsonResult; } @@ -1777,7 +1879,7 @@ { objJsonResult.code = "0"; objJsonResult.count = 0; - objJsonResult.Message = "HInterID灏忎簬0锛�"; + objJsonResult.Message = "[0000-1-009]HInterID灏忎簬0锛�"; objJsonResult.data = null; return objJsonResult; } @@ -1805,7 +1907,7 @@ objJsonResult.code = "1"; objJsonResult.count = 1; - objJsonResult.Message = "浣滃簾鎴愬姛"; + objJsonResult.Message = "[0000-1-040]浣滃簾鎴愬姛"; objJsonResult.data = null; oCN.Commit(); @@ -1814,7 +1916,7 @@ { objJsonResult.code = "0"; objJsonResult.count = 0; - objJsonResult.Message = "浣滃簾澶辫触!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo; + objJsonResult.Message = "[0000-1-042]浣滃簾澶辫触!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo; objJsonResult.data = null; oCN.RollBack(); @@ -1837,7 +1939,7 @@ objJsonResult.code = "0"; objJsonResult.count = 0; - objJsonResult.Message = "鍙嶄綔搴熷け璐ワ紝鍘熷洜锛氬弽浣滃簾鏉$爜鍓嶅垽鏂彂鐢熼敊璇紒"; + objJsonResult.Message = "[0000-1-042]鍙嶄綔搴熷け璐ワ紝鍘熷洜锛氬弽浣滃簾鏉$爜鍓嶅垽鏂彂鐢熼敊璇紒"; objJsonResult.data = null; return objJsonResult; } @@ -1849,7 +1951,7 @@ objJsonResult.code = "1"; objJsonResult.count = 1; - objJsonResult.Message = "鍙嶄綔搴熷け璐ワ紝鍘熷洜锛�" + DBUtility.ClsPub.isStrNull(DS.Tables[0].Rows[0]["HRemark"]); + objJsonResult.Message = "[0000-1-042]鍙嶄綔搴熷け璐ワ紝鍘熷洜锛�" + DBUtility.ClsPub.isStrNull(DS.Tables[0].Rows[0]["HRemark"]); objJsonResult.data = null; return objJsonResult; } @@ -1871,7 +1973,7 @@ objJsonResult.code = "1"; objJsonResult.count = 1; - objJsonResult.Message = "鍙嶄綔搴熸垚鍔�"; + objJsonResult.Message = "[0000-1-043]鍙嶄綔搴熸垚鍔�"; objJsonResult.data = null; oCN.Commit(); return objJsonResult; @@ -1880,7 +1982,7 @@ { objJsonResult.code = "0"; objJsonResult.count = 0; - objJsonResult.Message = "鍙嶄綔搴熷け璐�!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo; + objJsonResult.Message = "[0000-1-042]鍙嶄綔搴熷け璐�!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo; objJsonResult.data = null; oCN.RollBack(); return objJsonResult; @@ -1893,7 +1995,7 @@ oCN.RollBack(); objJsonResult.code = "0"; objJsonResult.count = 0; - objJsonResult.Message = "浣滃簾澶辫触鎴栬�呭弽浣滃簾澶辫触锛�" + e.ToString(); + objJsonResult.Message = "[0000-1-044]浣滃簾澶辫触鎴栬�呭弽浣滃簾澶辫触锛�" + e.ToString(); objJsonResult.data = null; return objJsonResult; } @@ -2036,6 +2138,9 @@ string HMouldClass = mainList[0].HMouldClass; int HNowWHID = mainList[0].HNowWHID; int HNowSPID = mainList[0].HNowSPID; + string HMouldUseStatus = mainList[0].HMouldUseStatus; + int HCREATEORGID = mainList[0].HCREATEORGID; + int HUSEORGID = mainList[0].HUSEORGID; //淇濆瓨鍓嶆帶鍒�========================================= string HBillNote = ""; @@ -2071,7 +2176,7 @@ ",HPrintQty,HMouldStatus,HWhID,HRoutingID,HCaveQty" + ",HBomID,HVersion,HSPGroupID,HSPID,HDesignLife,HNowSupID,HNowSupTypeID" + ",HUseLife,HLeaveLife,HProdQty,HProdWeight,HMouldOWNER,HSaveLife,HMouldDotCheckRuleInterID,HMouldMaintainRuleInterID,HBarCode,HMadeSupID" + - ",HMouldClass,HNowWHID,HNowSPID,HInitLife) " + + ",HMouldClass,HNowWHID,HNowSPID,HInitLife,HMouldUseStatus,HCREATEORGID,HUSEORGID) " + " values('" + BillType + "','" + BillType + "'," + HInterID + ",'" + HBillNo + "','" + HDate + "'" + "," + HYear + "," + HPeriod + ",'" + HRemark + "','" + HMaker + "',getdate()" + ",'" + HMouldNo + "','" + HName + "','" + HModel + "','" + HModel2 + "','" + HDiameter + "'" + @@ -2081,7 +2186,7 @@ "," + HPrintQty + ",'" + HMouldStatus + "'," + HWHID + "," + HRoutingID + "," + HCaveQty + "," + HBOMID + ",'" + HVersion + "'," + HSPGroupID + "," + HSPID + ",'" + HDesignLife + "','" + HNowSupID + "','" + HNowSupTypeID + "'" + ",'" + HUseLife + "','" + HLeaveLife + "','" + HProdQty + "','" + HProdWeight + "','" + HMouldOWNER + "','" + HSaveLife + "','" + HMouldDotCheckRuleInterID + "','" + HMouldMaintainRuleInterID + "','" + HBarCode + "'," + HMadeSupID + - ",'"+ HMouldClass + "'," + HNowWHID + "," + HNowSPID + ",'" + HInitLife + "') "); + ",'"+ HMouldClass + "'," + HNowWHID + "," + HNowSPID + ",'" + HInitLife + "','" + HMouldUseStatus + "',"+ HCREATEORGID + ","+ HUSEORGID + ") "); //瀛愯〃 oCN.RunProc("Insert into Gy_MouldFileSub " + @@ -2231,9 +2336,33 @@ string HMouldClass = mainList[0].HMouldClass; int HNowWHID = mainList[0].HNowWHID; int HNowSPID = mainList[0].HNowSPID; - + string HMouldUseStatus = mainList[0].HMouldUseStatus; + int HUSEORGID = mainList[0].HUSEORGID; //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙� oCN.BeginTran(); + + //淇濆瓨鍓嶆帶鍒�========================================= + string HBillNote = ""; + ds = oCN.RunProcReturn("Exec h_p_Gy_MouldFileMain_BeforeSaveCtrl " + HInterID.ToString() + ", '" + HBillNo + "','" + HBillNote + "',1 ", "h_p_Gy_MouldFileMain_BeforeSaveCtrl"); + if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "淇濆瓨澶辫触!鍘熷洜:淇濆瓨鍓嶅垽鏂け璐ワ紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴"; + objJsonResult.data = null; + return objJsonResult; + } + + if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "淇濆瓨澶辫触!鍘熷洜:" + ds.Tables[0].Rows[0]["HBackRemark"].ToString(); ; + objJsonResult.data = null; + return objJsonResult; + } + //========================================================= + //涓昏〃 oCN.RunProc("UpDate Gy_MouldFileMain set " + " HBillNo='" + HBillNo + "'" + //鍥哄畾璧嬪��=============== @@ -2254,6 +2383,7 @@ ",HPICNo='" + HPICNo + "'" + ",HWorkMaterModel='" + HWorkMaterModel + "'" + ",HMaterID=" + HMaterID.ToString() + + ",HUSEORGID=" + HUSEORGID.ToString() + ",HMaterNumber='" + HMaterNumber + "'" + ",HMouldClass='" + HMouldClass + "'" + ",HMouldType=" + HMouleTypeID.ToString() + @@ -2288,6 +2418,7 @@ ",HNowWHID=" + HNowWHID + ",HNowSPID=" + HNowSPID + ",HInitLife='" + HInitLife + + "',HMouldUseStatus='" + HMouldUseStatus + "' where HInterID=" + HInterID.ToString()); //淇敼瀛愰」鐩唬鐮� @@ -2299,6 +2430,29 @@ oCN.RunProc("delete from Gy_MouldFileSub_MaintainRule where HInterID='" + HInterID + "'"); oCN.RunProc("delete from Gy_MouldFileSub_DotCheckRule where HInterID='" + HInterID + "'"); objJsonResult = AddBillSub(msg5, msg6, msg7, HInterID, HBillNo); + + + //淇濆瓨鍚庢帶鍒�========================================= + ds = oCN.RunProcReturn("Exec h_p_Gy_MouldFileMain_AfterSaveCtrl " + HInterID.ToString() + ", '" + HBillNo + "','" + HBillNote + "',1 ", "h_p_Gy_MouldFileMain_AfterSaveCtrl"); + if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "淇濆瓨澶辫触!鍘熷洜:淇濆瓨鍓嶅垽鏂け璐ワ紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴"; + objJsonResult.data = null; + return objJsonResult; + } + + if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "淇濆瓨澶辫触!鍘熷洜:" + ds.Tables[0].Rows[0]["HBackRemark"].ToString(); ; + objJsonResult.data = null; + oCN.RollBack(); + return objJsonResult; + } + //========================================================= oCN.Commit(); objJsonResult.code = "1"; @@ -2485,8 +2639,56 @@ } if (oBill.DeleteBill(hmainid, ref DBUtility.ClsPub.sExeReturnInfo)) { + oCN.BeginTran(); + //鍒犻櫎鍓嶆帶鍒�========================================= + ds = oCN.RunProcReturn("Exec h_p_Gy_MouldFile_BeforeDelCtrl " + hmainid + ",'" + User + "'", "h_p_Gy_MouldFile_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; + } + //========================================================= + oCN.RunProc("Delete From Gy_MouldFileSub_MaintainRule where HInterID=" + hmainid); oCN.RunProc("Delete From Gy_MouldFileSub_DotCheckRule where HInterID=" + hmainid); + + //鍒犻櫎鍚庢帶鍒�========================================= + DataSet ds2 = oCN.RunProcReturn("Exec h_p_Gy_MouldFile_AfterDelCtrl " + hmainid + ",'" + User + "'", "h_p_Gy_MouldFile_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; + } + //========================================================= + + oCN.Commit(); //鍐欏叆鏃ュ織 ClsPub.Add_Log("", "鍒犻櫎椤圭洰锛屼唬鐮侊細" + oBill.omodel.HMouldNo + ",鍚嶇О锛�" + oBill.omodel.HName, ClsPub.CurUserName); //鏇存柊涓婄骇涓� 鏈骇 @@ -2860,6 +3062,26 @@ } if (IsAudit == 0) //瀹℃牳鎻愪氦 { + //瀹℃牳鍓嶆帶鍒�========================================= + ds = oCN.RunProcReturn("Exec h_p_Sc_MouldStockBill_BeforeCheckCtrl " + HInterID + ",'" + CurUserName + "'", "h_p_Sc_MouldStockBill_BeforeCheckCtrl"); + if (ds == null) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "瀹℃牳鍓嶅垽鏂け璐ワ紒"; + objJsonResult.data = null; + return objJsonResult; + } + if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "瀹℃牳澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]); + objJsonResult.data = null; + return objJsonResult; + } + //========================================================= + //瀹℃牳鎻愪氦 if (oBill.CheckBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true) { @@ -2877,9 +3099,50 @@ objJsonResult.data = null; return objJsonResult; } + + //瀹℃牳鍚庢帶鍒�========================================= + DataSet ds2 = oCN.RunProcReturn("Exec h_p_Sc_MouldStockBill_AfterCheckCtrl " + HInterID + ",'" + CurUserName + "'", "h_p_Sc_MouldStockBill_AfterCheckCtrl"); + + if (ds2 == null) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "瀹℃牳鍚庡垽鏂け璐ワ紒"; + objJsonResult.data = null; + return objJsonResult; + } + if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "瀹℃牳澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]); + objJsonResult.data = null; + return objJsonResult; + } + //========================================================= } if (IsAudit == 1) //鍙嶅鏍告彁浜� { + //鍙嶅鏍稿墠鎺у埗========================================= + ds = oCN.RunProcReturn("Exec h_p_Sc_MouldStockBill_BeforeUnCheckCtrl " + HInterID + ",'" + CurUserName + "'", "h_p_Sc_MouldStockBill_BeforeUnCheckCtrl"); + if (ds == null) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "瀹℃牳鍓嶅垽鏂け璐ワ紒"; + objJsonResult.data = null; + return objJsonResult; + } + if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "瀹℃牳澶辫触锛�" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]); + objJsonResult.data = null; + return objJsonResult; + } + //========================================================= + //鍙嶅鏍告彁浜bandonCheck if (oBill.AbandonCheck(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true) { @@ -2897,6 +3160,29 @@ objJsonResult.data = null; return objJsonResult; } + + //鍙嶅鏍稿悗鎺у埗========================================= + DataSet ds2 = oCN.RunProcReturn("Exec h_p_Sc_MouldStockBill_AfterUnCheckCtrl " + HInterID + ",'" + CurUserName + "'", "h_p_Sc_MouldStockBill_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; + } + //========================================================= + } return objJsonResult; } @@ -2911,6 +3197,154 @@ } #endregion + #region 妯″叿妗堝叧闂�/鍙嶅叧闂姛鑳� + [Route("Gy_Mould/CloseGy_Mould")] + [HttpGet] + public object CloseGy_Mould(string HInterID, int Type, string user) + { + try + { + //鍒ゆ柇鏄惁鏈夊垹闄ゆ潈闄� + if (!DBUtility.ClsPub.Security_Log("Gy_MouldFile_Close", 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; + } + + ClsPub.CurUserName = user; + DAL.ClsGy_MouldFile oBill = new DAL.ClsGy_MouldFile(); + oCN.BeginTran();//寮�濮嬩簨鍔� + + //Type 1 鍏抽棴 2 鍙嶅叧闂� + if (Type == 1) + { + if (!oBill.CloseBill(int.Parse(HInterID), ref ClsPub.sExeReturnInfo)) + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鍏抽棴澶辫触!鍘熷洜:" + ClsPub.sExeReturnInfo; + objJsonResult.data = null; + return objJsonResult; + } + } + else + { + if (!oBill.CancelClose(int.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 妯″叿妗f浣滃簾/鍙嶄綔搴熷姛鑳� + [Route("Gy_Mould/DeleteGy_Mould")] + [HttpGet] + public object DeleteGy_Mould(string HInterID, int Type, string user) + { + try + { + //鍒ゆ柇鏄惁鏈夊垹闄ゆ潈闄� + if (!DBUtility.ClsPub.Security_Log("Gy_MouldFile_Drop", 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_MouldFile oBill = new DAL.ClsGy_MouldFile(); + ClsPub.CurUserName = user; + + oCN.BeginTran();//寮�濮嬩簨鍔� + + //Type 1 浣滃簾 2 鍙嶄綔搴� + if (Type == 1) + { + if (!oBill.Cancelltion(int.Parse(HInterID), ref ClsPub.sExeReturnInfo)) + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "鍏抽棴澶辫触!鍘熷洜:" + ClsPub.sExeReturnInfo; + objJsonResult.data = null; + return objJsonResult; + } + } + else + { + if (!oBill.AbandonCancelltion(int.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 [妯″叿妗f鎵归噺鐢熸垚] [Route("Gy_Mould/SaveBatchGen_MouldFile")] [HttpGet] -- Gitblit v1.9.1