From cf89cfc7e1c06a977588c2ae0185ee1b2da5ce90 Mon Sep 17 00:00:00 2001 From: yangle <admin@YINMOU> Date: 星期五, 26 一月 2024 15:18:04 +0800 Subject: [PATCH] 工序流转卡 反审核 审核 方法,增加 调用 反审核 审核 前控制 h_p_Sc_ProcessExchangeBill_BeforeUnCheckCtrl 、h_p_Sc_ProcessExchangeBill_BeforeCheckCtrl 和反审核 审核 后控制 h_p_Sc_ProcessExchangeBill_AfterUnCheckCtrl、h_p_Sc_ProcessExchangeBill_AfterCheckCtrl的 存储过程。 工序返工申请单反审核 审核方法,增加 调用 反审核 审核 前控制 h_p_Sc_ProcExchWorkBackBill_BeforeUnCheckCtrl、h_p_Sc_ProcExchWorkBackBill_BeforeCheckCtrl 和反审核 审核 后控制 h_p_Sc_ProcExchWorkBackBill_AfterUnCheckCtrl、h_p_Sc_ProcExchWorkBackBill_AfterCheckCtrl的 存储过程。 工序返工记录单反审核 审核方法,增加 调用 反审核 审核 前控制 h_p_Sc_ProcExchRecordBackBill_BeforeUnCheckCtrl 、h_p_Sc_ProcExchRecordBackBill_BeforeCheckCtrl 和反审核 审核 后控制 h_p_Sc_ProcExchRecordBackBill_AfterUnCheckCtrl、h_p_Sc_ProcExchRecordBackBill_AfterCheckCtrl的 存储过程。 工序流转卡派工单反审核审核方法,增加调用反审核 审核 前控制h_p_Sc_ProcExchSendWorkBill_BeforeUnCheckCtrl、h_p_Sc_ProcExchSendWorkBill_BeforeCheckCtrl 和反审核审核后控制h_p_Sc_ProcExchSendWorkBill_AfterUnCheckCtrl、h_p_Sc_ProcExchSendWorkBill_AfterCheckCtrl的存储过程。 工序委外派工单反审核审核方法,增加 调用反审核审核前控制h_p_WW_EntrustWorkOrderBill_BeforeUnCheckCtrl 、h_p_WW_EntrustWorkOrderBill_BeforeCheckCtrl和反审核 审核后控制h_p_WW_EntrustWorkOrderBill_AfterUnCheckCtrl、h_p_WW_EntrustWorkOrderBill_AfterCheckCtrl的存储过程。 工序进站接收单反审核审核方法,增加调用反审核审核前控制h_p_Sc_StationInBill_BeforeUnCheckCtrl 、h_p_Sc_StationInBill_BeforeCheckCtrl和反审核审核后控制h_p_Sc_StationInBill_AfterUnCheckCtrl、h_p_Sc_StationInBill_AfterCheckCtrl的存储过程。 工序出站汇报单反审核审核方法,增加调用反审核审核前控制h_p_Sc_StationOutBill_BeforeUnCheckCtrl 、h_p_Sc_StationOutBill_BeforeCheckCtrl和反审核 审核后控制h_p_Sc_StationOutBill_AfterUnCheckCtrl、h_p_Sc_StationOutBill_AfterCheckCtrl的存储过程 --- WebAPI/Controllers/CJGL/Sc_ProcExchWWSendWorkBillController.cs | 262 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 262 insertions(+), 0 deletions(-) diff --git a/WebAPI/Controllers/CJGL/Sc_ProcExchWWSendWorkBillController.cs b/WebAPI/Controllers/CJGL/Sc_ProcExchWWSendWorkBillController.cs index eef40fe..a5e8573 100644 --- a/WebAPI/Controllers/CJGL/Sc_ProcExchWWSendWorkBillController.cs +++ b/WebAPI/Controllers/CJGL/Sc_ProcExchWWSendWorkBillController.cs @@ -240,5 +240,267 @@ } //#endregion + #region 宸ュ簭濮斿娲惧伐鍗曞鏍�/鍙嶅鏍稿姛鑳� + [Route("WW_EntrustWorkOrderBill/CheckSWW_EntrustWorkOrderBill")] + [HttpGet] + public object CheckSWW_EntrustWorkOrderBill(string HInterID, int Type, string user) + { + try + { + //鍒ゆ柇鏄惁鏈夊垹闄ゆ潈闄� 濮斿宸ュ簭娲惧伐鍗昣瀹℃牳 + if (!DBUtility.ClsPub.Security_Log("WW_EntrustProcSendWorkBill_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 = "WW_EntrustWorkOrderBillMain"; + 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; + } + } + + //瀹℃牳鍓嶆帶鍒� + string HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString(); + sql = "exec h_p_WW_EntrustWorkOrderBill_BeforeCheckCtrl " + int.Parse(HInterID) + ",'" + HBillNo + "','" + user + "'"; + ds = oCN.RunProcReturn(sql, "h_p_WW_EntrustWorkOrderBill_BeforeCheckCtrl"); + 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 (!BillOld.CheckBill(Int64.Parse(HInterID), HBillNo, "h_p_WW_EntrustWorkOrderBill_AfterCheckCtrl", user, 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; + } + } + + //鍙嶅鏍稿墠鎺у埗 + string HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString(); + sql = "exec h_p_WW_EntrustWorkOrderBill_BeforeUnCheckCtrl " + int.Parse(HInterID) + ",'" + HBillNo + "','" + user + "'"; + ds = oCN.RunProcReturn(sql, "h_p_WW_EntrustWorkOrderBill_BeforeUnCheckCtrl"); + 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 (BillOld.AbandonCheck(Int64.Parse(HInterID), HBillNo, "h_p_WW_EntrustWorkOrderBill_AfterUnCheckCtrl", user, 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("WW_EntrustWorkOrderBill/CloseWW_EntrustWorkOrderBill")] + [HttpGet] + public object CloseWW_EntrustWorkOrderBill(string HInterID, int Type, string user) + { + try + { + //鍒ゆ柇鏄惁鏈夊垹闄ゆ潈闄� 濮斿宸ュ簭娲惧伐鍗昣鍏抽棴 + if (!DBUtility.ClsPub.Security_Log("WW_EntrustProcSendWorkBill_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; + BillOld.MvarItemKey = "WW_EntrustWorkOrderBillMain"; + 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]["HCloseMan"] != null && ds.Tables[0].Rows[0]["HCloseMan"].ToString() != "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁宸插叧闂�!涓嶉渶瑕佸啀鍏抽棴!"; + objJsonResult.data = null; + return objJsonResult; + } + } + //鍏抽棴鍗曟嵁 + if (!BillOld.CloseBill(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]["HCloseMan"] == null || ds.Tables[0].Rows[0]["HCloseMan"].ToString() == "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁宸插弽鍏抽棴!涓嶉渶瑕佸啀鍙嶅叧闂�!"; + objJsonResult.data = null; + return objJsonResult; + } + } + //鍙嶅叧闂崟鎹� + if (!BillOld.CancelClose(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 + } } \ No newline at end of file -- Gitblit v1.9.1