From ef10f06e96034f6ab3db93ea103f2a4d78fcb2b9 Mon Sep 17 00:00:00 2001 From: zrg <z18737863051@163.com> Date: 星期一, 13 五月 2024 17:32:29 +0800 Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API --- WebAPI/Controllers/SCGL/日计划管理/JIT_Cg_PODemandPlanBillController.cs | 113 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 113 insertions(+), 0 deletions(-) diff --git "a/WebAPI/Controllers/SCGL/\346\227\245\350\256\241\345\210\222\347\256\241\347\220\206/JIT_Cg_PODemandPlanBillController.cs" "b/WebAPI/Controllers/SCGL/\346\227\245\350\256\241\345\210\222\347\256\241\347\220\206/JIT_Cg_PODemandPlanBillController.cs" index 4884c4b..49ee536 100644 --- "a/WebAPI/Controllers/SCGL/\346\227\245\350\256\241\345\210\222\347\256\241\347\220\206/JIT_Cg_PODemandPlanBillController.cs" +++ "b/WebAPI/Controllers/SCGL/\346\227\245\350\256\241\345\210\222\347\256\241\347\220\206/JIT_Cg_PODemandPlanBillController.cs" @@ -7,6 +7,7 @@ using System.Web.Http; using WebAPI.Models; using Newtonsoft.Json; +using DBUtility; namespace WebAPI.Controllers.SCGL { @@ -18,6 +19,7 @@ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); JIT_Cg_PODemandPlanBillMain omdelMian = new JIT_Cg_PODemandPlanBillMain(); List<JIT_Cg_PODemandPlanBillSub> omodelsub = new List<JIT_Cg_PODemandPlanBillSub>(); + public DAL.ClsSc_ICMOBill BillOld = new DAL.ClsSc_ICMOBill(); #region 鎻愭枡璁″垝鍗� 鍒楄〃 [Route("JIT_Cg_PODemandPlanBill/JIT_Cg_PODemandPlanBillList")] @@ -260,6 +262,117 @@ } #endregion + #region 鎻愭枡璁″垝鍗� 瀹℃牳/鍙嶅鏍稿姛鑳� + [Route("JIT_Cg_PODemandPlanBill/CheckPODemandPlanBillList")] + [HttpGet] + public object CheckPODemandPlanBillList(string HInterID, int Type, string user) + { + try + { + //鍒ゆ柇鏄惁鏈夊垹闄ゆ潈闄� + if (!DBUtility.ClsPub.Security_Log("Gy_RoutingBill_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; + } + + ClsPub.CurUserName = user; + BillOld.MvarItemKey = "JIT_Cg_PODemandPlanBillMain"; + oCN.BeginTran();//寮�濮嬩簨鍔� + + //Type 1 瀹℃牳 2 鍙嶅鏍� + if (Type == 1) + { + //鍒ゆ柇鍗曟嵁鏄惁宸茬粡瀹℃牳 + DataSet ds; + string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID; + ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); + if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) + { + if (ds.Tables[0].Rows[0]["HChecker"] != null && ds.Tables[0].Rows[0]["HChecker"].ToString() != "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁宸插鏍�!涓嶉渶瑕佸啀瀹℃牳!"; + objJsonResult.data = null; + return objJsonResult; + } + } + //瀹℃牳鍗曟嵁 + if (!BillOld.CheckBill(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 " + BillOld.MvarItemKey + " where HinterID = " + HInterID; + ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); + if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) + { + if (ds.Tables[0].Rows[0]["HChecker"] == null || ds.Tables[0].Rows[0]["HChecker"].ToString() == "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁宸插弽瀹℃牳!涓嶉渶瑕佸啀鍙嶅鏍�!"; + objJsonResult.data = null; + return objJsonResult; + } + } + //鍙嶅鏍稿崟鎹� + if (BillOld.AbandonCheck(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) + { + + } + else + { + 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("JIT_Cg_PODemandPlanBill/ClosePODemandPlanBillList")] [HttpGet] -- Gitblit v1.9.1