From 9d14f2b7d4899e17bc73d3b80643a40e09774bb3 Mon Sep 17 00:00:00 2001 From: chenhaozhe <cgz@hz-kingdee.com> Date: 星期五, 27 六月 2025 16:24:38 +0800 Subject: [PATCH] PNL布局 增加 审核/禁用 API,修改API 添加 修改人和修改日期信息 PNL检验信息 添加 审核 API,修改API 添加 修改人和修改日期信息 --- WebAPI/Controllers/MJGL/Sc_MouldMaintainRuleBillController.cs | 209 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 207 insertions(+), 2 deletions(-) diff --git a/WebAPI/Controllers/MJGL/Sc_MouldMaintainRuleBillController.cs b/WebAPI/Controllers/MJGL/Sc_MouldMaintainRuleBillController.cs index 95517a5..3b7269e 100644 --- a/WebAPI/Controllers/MJGL/Sc_MouldMaintainRuleBillController.cs +++ b/WebAPI/Controllers/MJGL/Sc_MouldMaintainRuleBillController.cs @@ -194,7 +194,29 @@ return objJsonResult; } - bool IsDete = oBill.DeleteBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); + //鍒犻櫎鍓嶆帶鍒�========================================= + string sql1 = "exec h_p_Sc_MouldMaintainRuleBill_BeforeDelCtrl " + BillOld.omodel.HInterID + ",'" + BillOld.omodel.HBillNo + "','" + user + "'"; + ds = oCN.RunProcReturn(sql1, "h_p_Sc_MouldMaintainRuleBill_BeforeDelCtrl"); + 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]["HRemark"].ToString(); ; + objJsonResult.data = null; + return objJsonResult; + } + //================================================================================== + + bool IsDete = oBill.DeleteBill(oBill.omodel.HInterID, oBill.omodel.HBillNo, "h_p_Sc_MouldMaintainRuleBill_AfterDelCtrl",user, ref DBUtility.ClsPub.sExeReturnInfo); if (IsDete) { objJsonResult.code = "0"; @@ -345,6 +367,7 @@ string msg3 = sArray[1].ToString(); string msg4 = sArray[2].ToString(); string msg5 = sArray[3].ToString(); + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); ListModels oListModels = new ListModels(); try @@ -363,6 +386,8 @@ List<Model.ClsSc_MouldMaintainRuleBillMain> lsmain = new List<Model.ClsSc_MouldMaintainRuleBillMain>(); msg2 = msg2.Replace("\\", ""); msg2 = msg2.Replace("\n", ""); //\n + + //涓昏〃 lsmain = oListModels.getObjectByJson_Sc_MouldMaintainRuleBillMain(msg2); foreach (Model.ClsSc_MouldMaintainRuleBillMain oItem in lsmain) @@ -384,7 +409,23 @@ return objJsonResult; } oBill.omodel = oItem; + + if (oItem.HInterID == 0) + { + // 鍒ゆ柇鏂板鐨勮〃鍗曚笌琛ㄦ牸涓殑琛ㄥ崟鏄惁鏈夐噸澶� + DataSet ds = oCN.RunProcReturn("select * from h_v_Sc_MouldMaintainRuleBillList where 鍗曟嵁鍙� = '" + oItem.HBillNo + "'", "h_v_Sc_MouldMaintainRuleBillList"); + if (ds.Tables[0].Rows.Count > 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛佸崟鎹彿涓嶅緱鏈夐噸澶嶏紒"; + objJsonResult.data = 1; + return objJsonResult; + } + } } + + //淇濆吇椤硅〃浣撴暟鎹� //鎸� },{鏉ユ媶鍒嗘暟缁� //鍘绘帀銆愬拰銆� @@ -440,7 +481,7 @@ //淇濆瓨瀹屾瘯鍚庡鐞� bool bResult; if (oBill.omodel.HInterID == 0) - { + { // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); } @@ -630,6 +671,170 @@ } #endregion + #region 鍣ㄥ叿淇濆吇瑙勭▼浣滃簾/鍙嶄綔搴熷姛鑳� + [Route("Sc_MouldMaintainRuleBill/DeleteSc_MouldMaintainRule")] + [HttpGet] + public object DeleteGy_Mould(string HInterID, int Type, string user) + { + try + { + //鍒ゆ柇鏄惁鏈夊垹闄ゆ潈闄� + if (!DBUtility.ClsPub.Security_Log("Sc_MouldMaintainRuleBill_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.ClsSc_MouldMaintainRuleBill oBill = new DAL.ClsSc_MouldMaintainRuleBill(); + ClsPub.CurUserName = user; + Int64 lngBillKey = 0; + lngBillKey = DBUtility.ClsPub.isLong(HInterID); + //閽堝闇�瑕佽繘琛岀殑鎿嶄綔锛屾楠屽綋鍓嶅崟鎹殑鐘舵�佹槸鍚︽敮鎸侀渶瑕佽繘琛岀殑鎿嶄綔 + if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo)) //鏍规嵁HInterID鑾峰彇璇ュ崟鎹殑鏁版嵁 + { + if (oBill.omodel.HChecker.Trim() != "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁宸插鏍�!涓嶈兘杩涜浣滃簾锛�"; + objJsonResult.data = null; + return objJsonResult; + } + if (Type == 1) //浣滃簾鍒ゆ柇 + { + if (oBill.omodel.HDeleteMan.Trim() != "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁宸蹭綔搴�!涓嶈兘鍐嶄綔搴燂紒"; + objJsonResult.data = null; + return objJsonResult; + } + } + if (Type == 2) //鍙嶄綔搴熷垽鏂� + { + if (oBill.omodel.HDeleteMan.Trim() == "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁鏈綔搴�!涓嶉渶瑕佸弽浣滃簾锛�"; + objJsonResult.data = null; + return objJsonResult; + } + } + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁涓嶅瓨鍦�!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo; + objJsonResult.data = null; + return objJsonResult; + } + + oCN.BeginTran();//寮�濮嬩簨鍔� + + //Type 1 浣滃簾 2 鍙嶄綔搴� + if (Type == 1) + { + //浣滃簾鍓嶆帶鍒�========================================= + string sql1 = "exec h_p_Sc_MouldMaintainRuleBill_BeforeDropCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + user + "'"; + ds = oCN.RunProcReturn(sql1, "h_p_Sc_MouldMaintainRuleBill_BeforeDropCtrl"); + if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "浣滃簾澶辫触!鍘熷洜:浣滃簾鍓嶅垽鏂け璐ワ紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴"; + objJsonResult.data = null; + oCN.RollBack(); + return objJsonResult; + } + + if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "浣滃簾澶辫触!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; + objJsonResult.data = null; + oCN.RollBack(); + return objJsonResult; + } + //================================================================================== + + if (!oBill.Cancelltion(int.Parse(HInterID), oBill.omodel.HBillNo, "h_p_Sc_MouldMaintainRuleBill_AfterDropCtrl", user, ref ClsPub.sExeReturnInfo)) + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "浣滃簾澶辫触!鍘熷洜:" + ClsPub.sExeReturnInfo; + objJsonResult.data = null; + return objJsonResult; + } + } + else + { + //鍙嶄綔搴熷墠鎺у埗========================================= + string sql1 = "exec h_p_Sc_MouldMaintainRuleBill_BeforeUnDropCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + user + "'"; + ds = oCN.RunProcReturn(sql1, "h_p_Sc_MouldMaintainRuleBill_BeforeUnDropCtrl"); + 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]["HRemark"].ToString(); ; + objJsonResult.data = null; + return objJsonResult; + } + //=========================================================== + + if (!oBill.AbandonCancelltion(int.Parse(HInterID), oBill.omodel.HBillNo, "h_p_Sc_MouldMaintainRuleBill_AfterUnDropCtrl", user, 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 鍣ㄥ叿淇濆吇瑙勭▼ 鏂囦欢瀵煎叆淇濆瓨 #region 鍣ㄥ叿淇濆吇瑙勭▼ 鏂囦欢涓婁紶 [Route("Sc_MouldMaintainRuleBill/Sc_MouldMaintainRuleBill_Excel")] -- Gitblit v1.9.1