From ac37632d4d13832b41d96495d9f586748c5d4277 Mon Sep 17 00:00:00 2001 From: yangle <admin@YINMOU> Date: 星期二, 16 五月 2023 14:25:39 +0800 Subject: [PATCH] 流转卡、生产订单、工序进站单、工序出站单只能自己删除自己的单据。(所有模块,做个系统参数,删除人和制单人必须一致) --- Model/车间管理/ClsSc_ProcessExchangeBillMain.cs | 1 WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs | 2 WebAPI/Controllers/Sc_ProcessMangementController.cs | 22 ++++- WebAPI/Controllers/CJGL/Sc_ProcessExchangeBillController.cs | 154 +++++++++++++++++++------------------ DAL/车间管理/ClsSc_ProcessExchangeBill.cs | 5 WebAPI/Controllers/CJGL/Cj_StationInBillController.cs | 20 +++- 6 files changed, 114 insertions(+), 90 deletions(-) diff --git "a/DAL/\350\275\246\351\227\264\347\256\241\347\220\206/ClsSc_ProcessExchangeBill.cs" "b/DAL/\350\275\246\351\227\264\347\256\241\347\220\206/ClsSc_ProcessExchangeBill.cs" index c467f97..fcb96aa 100644 --- "a/DAL/\350\275\246\351\227\264\347\256\241\347\220\206/ClsSc_ProcessExchangeBill.cs" +++ "b/DAL/\350\275\246\351\227\264\347\256\241\347\220\206/ClsSc_ProcessExchangeBill.cs" @@ -96,6 +96,7 @@ ",HProjectNum='" + omodel.HProjectNum.ToString() + "'" + ",HMateOutBatchNo='" + omodel.HMateOutBatchNo + "'" + ",HBLFlag='" + (omodel.HBLFlag ? 1 : 0) + "'" + + ",HMachineLine='" + omodel.HMachineLine + "'" + ",HXTNumber='" + omodel.HXTNumber + "'" + ",HXTModel='" + omodel.HXTModel + "'" + ",HRemark2='" + omodel.HRemark2 + "'" + @@ -322,7 +323,7 @@ ",HPicNumVer,HPicNumAssemble,HMaterTexture,HProductNum,HVerNum,HPRDORGID,HBLFlag,HCusNumber,HPickLabel,HPickLabelNumber,HXTNumber,HXTModel,HWorkBillSortNo" + ", HRoutingBillID,HMaterModel,HWidth,HWeight,HAuxQty,HAuxUnit,HSplitNo" + ",HHeight,HInches,HAl1Long,HDensity,HTela,HUnderTela,HSizing,HSellDate" + - ",HRemark2,HRemark3,HEmpID,HCusID,HColorRemark,HSplitSumQty,HSplitColorQty) " + + ",HRemark2,HRemark3,HEmpID,HCusID,HColorRemark,HSplitSumQty,HSplitColorQty,HMachineLine) " + " values('" + this.BillType + "','" + this.HBillSubType + "'," + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "','" + omodel.HMaker + "',getdate()," + "" + (omodel.HPrevMainSourceInterID == 0 ? omodel.HInterID : omodel.HPrevMainSourceInterID) + "," + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "','" + omodel.HBatchNo + "'," + omodel.HMainMaterID.ToString() + "," + omodel.HKeyMaterID.ToString() + "," + omodel.HNo.ToString() + ",'" + omodel.HOrderProcNO + "'" + "," + omodel.HWWOrderInterID.ToString() + "," + omodel.HWWOrderEntryID.ToString() + ",'" + omodel.HWWOrderBillNo + "'," + omodel.HICMOInterID.ToString() + "," + omodel.HEquipMentID.ToString() + @@ -336,7 +337,7 @@ ",'" + omodel.HPicNumVer + "','" + omodel.HPicNumAssemble + "','" + omodel.HMaterTexture + "','" + omodel.HProductNum + "','" + omodel.HVerNum + "','"+ omodel.HPRDORGID+ "','" + (omodel.HBLFlag ? 1 : 0) + "','" + omodel.HCusNumber + "','" + omodel.HPickLabel + "','" + omodel.HPickLabelNumber + "','" + omodel.HXTNumber + "','" + omodel.HXTModel + "','" + omodel.HWorkBillSortNo + "',"+ omodel.HRoutingBillID + ",'"+ omodel.HMaterModel + "',"+ omodel.HWidth + ","+ omodel.HWeight + ","+ omodel.HAuxQty + ","+ omodel.HAuxUnit +","+ omodel.HSplitNo +"" + ",'" + omodel.HHeight + "','" + omodel.HInches + "','" + omodel.HAl1Long + "','" + omodel.HDensity + "','" + omodel.HTela + "','" + omodel.HUnderTela + "','" + omodel.HSizing + "','" + omodel.HSellDate + "'" + - ",'"+ omodel.HRemark2 + "','"+ omodel.HRemark3 + "',"+ omodel.HEmpID + "," + omodel.HCusID + ",'"+ omodel.HColorRemark + "',"+ omodel.HSplitSumQty + ","+ omodel.HSplitColorQty + ")"); + ",'"+ omodel.HRemark2 + "','"+ omodel.HRemark3 + "',"+ omodel.HEmpID + "," + omodel.HCusID + ",'"+ omodel.HColorRemark + "',"+ omodel.HSplitSumQty + ","+ omodel.HSplitColorQty + ",'"+ omodel.HMachineLine + "')"); sErr = sErr + "1;"; //鎻掑叆瀛愯〃 foreach (Model.ClsSc_ProcessExchangeBillSub oSub in DetailColl) diff --git "a/Model/\350\275\246\351\227\264\347\256\241\347\220\206/ClsSc_ProcessExchangeBillMain.cs" "b/Model/\350\275\246\351\227\264\347\256\241\347\220\206/ClsSc_ProcessExchangeBillMain.cs" index 82ba036..821d217 100644 --- "a/Model/\350\275\246\351\227\264\347\256\241\347\220\206/ClsSc_ProcessExchangeBillMain.cs" +++ "b/Model/\350\275\246\351\227\264\347\256\241\347\220\206/ClsSc_ProcessExchangeBillMain.cs" @@ -93,6 +93,7 @@ public int HSplitNo;//拆分号 public int HSplitSumQty;//拆分总量 public int HSplitColorQty;//分缸号 + public string HMachineLine;//机台 public string HRemark2;//备注2 public string HRemark3;//底部备注 diff --git a/WebAPI/Controllers/CJGL/Cj_StationInBillController.cs b/WebAPI/Controllers/CJGL/Cj_StationInBillController.cs index 23471f7..f7d177d 100644 --- a/WebAPI/Controllers/CJGL/Cj_StationInBillController.cs +++ b/WebAPI/Controllers/CJGL/Cj_StationInBillController.cs @@ -977,14 +977,22 @@ DAL.ClsSc_StationInBill oBill = new DAL.ClsSc_StationInBill(); if (oBill.ShowBill(HInterID, ref DBUtility.ClsPub.sExeReturnInfo)) { - if (oBill.omodel.HMaker != HDeleteMan && (HDeleteMan != "admin" && HDeleteMan != "Admin")) + string sReturn = ""; + if (oSystemParameter.ShowBill(ref sReturn)) { - objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = "鍙兘鍒犻櫎鏈汉鐨勫崟鎹紒"; - objJsonResult.data = null; - return objJsonResult; + if (oSystemParameter.omodel.MES_StationInBill_DeleteCtl == "Y") + { + if (oBill.omodel.HMaker != HDeleteMan) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍙兘鍒犻櫎鏈汉鐨勫崟鎹紒"; + objJsonResult.data = null; + return objJsonResult; + } + } } + SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); DataSet ds; diff --git a/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs b/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs index 9ac9a4d..a1e3cb7 100644 --- a/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs +++ b/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs @@ -191,7 +191,7 @@ if (oSystemParameter.ShowBill(ref Ret)) { //鍒ゆ柇瀹㈡埛涓嶄负榫欏北姹介厤 - if (oSystemParameter.omodel.WMS_CampanyName != "榫欏北姹介厤") //绯荤粺鍙傛暟 + if (oSystemParameter.omodel.WMS_CampanyName != "榫欏北姹介厤"|| oSystemParameter.omodel.WMS_CampanyName != "鐟炰笌绁�") //绯荤粺鍙傛暟 { if (HSourceID == 0) { diff --git a/WebAPI/Controllers/CJGL/Sc_ProcessExchangeBillController.cs b/WebAPI/Controllers/CJGL/Sc_ProcessExchangeBillController.cs index c4c808d..ba0ce87 100644 --- a/WebAPI/Controllers/CJGL/Sc_ProcessExchangeBillController.cs +++ b/WebAPI/Controllers/CJGL/Sc_ProcessExchangeBillController.cs @@ -805,7 +805,7 @@ /// <returns></returns> [Route("Sc_ProcessExchangeBill/DeltetProcessExchangeBillByID")] [HttpGet] - public object DeltetProcessExchangeBillByID(string HInterID,int HPRDORGID, string user) + public object DeltetProcessExchangeBillByID(string HInterID, int HPRDORGID, string user) { //缂栬緫鏉冮檺 if (!DBUtility.ClsPub.Security_Log("Sc_ProcessExchangeBill_Drop", 1, false, user)) @@ -817,84 +817,91 @@ return objJsonResult; } - Int64 lngBillKey = 0; - lngBillKey = DBUtility.ClsPub.isLong(HInterID); - if (lngBillKey == 0) - { - objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = "鍗曟嵁ID涓虹┖锛�"; - objJsonResult.data = null; - return objJsonResult; - } - - //鍒犻櫎鍓嶅垽鏂叧鑱旀暟閲� - SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); - DataSet ds; - ds = oCn.RunProcReturn("select ct from ( " + - " select 1 ct from Sc_StationInBillMain Where HProcExchInterID=" + lngBillKey + " " + - " union all " + - " select 1 from Sc_StationOutBillMain Where HProcExchInterID=" + lngBillKey + " ) as a ", "Sc_ProcExchReportSub"); - if (ds.Tables[0].Rows.Count != 0) - { - objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = "娴佽浆鍗″凡缁忔湁涓嬫父杩涘嚭绔欏崟鍚庯紝涓嶅厑璁稿垹闄わ紒"; - objJsonResult.data = null; - return objJsonResult; - } - - DAL.ClsSc_ProcessExchangeBill oBill = new DAL.ClsSc_ProcessExchangeBill(); - DBUtility.ClsPub.HOrgID = HPRDORGID; - if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo)) + + string[] HBillNo = HInterID.Split(','); + + foreach (var item in HBillNo) { - string sReturn = ""; - if (oSystemParameter.ShowBill(ref sReturn)) + Int64 lngBillKey = 0; + lngBillKey = DBUtility.ClsPub.isLong(item); + + DBUtility.ClsPub.HOrgID = HPRDORGID; + if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo)) { - if (oSystemParameter.omodel.Sc_ProcessExchangeBill_DeleterAndMakerMustSame == "Y") + if (lngBillKey == 0) { - if (oBill.omodel.HMaker != user) + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁鍙�:"+ oBill .omodel.HBillNo+ "鍗曟嵁ID涓虹┖锛�"; + objJsonResult.data = null; + return objJsonResult; + } + + //鍒犻櫎鍓嶅垽鏂叧鑱旀暟閲� + SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); + DataSet ds; + ds = oCn.RunProcReturn("select ct from ( " + + " select 1 ct from Sc_StationInBillMain Where HProcExchInterID=" + lngBillKey + " " + + " union all " + + " select 1 from Sc_StationOutBillMain Where HProcExchInterID=" + lngBillKey + " ) as a ", "Sc_ProcExchReportSub"); + if (ds.Tables[0].Rows.Count != 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁鍙�:" + oBill.omodel.HBillNo + "娴佽浆鍗″凡缁忔湁涓嬫父杩涘嚭绔欏崟鍚庯紝涓嶅厑璁稿垹闄わ紒"; + objJsonResult.data = null; + return objJsonResult; + } + + string sReturn = ""; + if (oSystemParameter.ShowBill(ref sReturn)) + { + if (oSystemParameter.omodel.Sc_ProcessExchangeBill_DeleterAndMakerMustSame == "Y") { - objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = "鍙兘鍒犻櫎鏈汉鐨勫崟鎹紒"; - objJsonResult.data = null; - return objJsonResult; + if (oBill.omodel.HMaker != user) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁鍙�:" + oBill.omodel.HBillNo + "鍙兘鍒犻櫎鏈汉鐨勫崟鎹紒"; + objJsonResult.data = null; + return objJsonResult; + } } } - } - if (oBill.omodel.HBillStatus > 1) - { - objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = "鍗曟嵁褰撳墠澶勪簬涓嶈兘鍒犻櫎鐘舵��,涓嶈兘鍒犻櫎锛�"; - objJsonResult.data = null; - return objJsonResult; - } - if (oBill.omodel.HChecker != "") - { - objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = "鍗曟嵁宸茬粡瀹℃牳,涓嶈兘鍒犻櫎锛�"; - objJsonResult.data = null; - return objJsonResult; - } - - bool IsDete = oBill.DeleteBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); - if (IsDete) - { - objJsonResult.code = "0"; - objJsonResult.count = 1; - objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo; - objJsonResult.data = null; - return objJsonResult; + if (oBill.omodel.HBillStatus > 1) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁鍙�:" + oBill.omodel.HBillNo + "鍗曟嵁褰撳墠澶勪簬涓嶈兘鍒犻櫎鐘舵��,涓嶈兘鍒犻櫎锛�"; + objJsonResult.data = null; + return objJsonResult; + } + if (oBill.omodel.HChecker != "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁鍙�:" + oBill.omodel.HBillNo + "鍗曟嵁宸茬粡瀹℃牳,涓嶈兘鍒犻櫎锛�"; + objJsonResult.data = null; + return objJsonResult; + } } else { - + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁鏈壘鍒�"; + objJsonResult.data = null; + return objJsonResult; + } + } + foreach (var item in HBillNo) + { + bool IsDete = oBill.DeleteBill(long.Parse(item), ref DBUtility.ClsPub.sExeReturnInfo); + if (!IsDete) + { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo; @@ -902,14 +909,11 @@ return objJsonResult; } } - else - { - objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = "鍗曟嵁鏈壘鍒�"; - objJsonResult.data = null; - return objJsonResult; - } + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo; + objJsonResult.data = null; + return objJsonResult; } #endregion diff --git a/WebAPI/Controllers/Sc_ProcessMangementController.cs b/WebAPI/Controllers/Sc_ProcessMangementController.cs index 56f29a2..77c76a3 100644 --- a/WebAPI/Controllers/Sc_ProcessMangementController.cs +++ b/WebAPI/Controllers/Sc_ProcessMangementController.cs @@ -694,11 +694,21 @@ return objJsonResult; } - //鍒ゆ柇閲戣澏浜戠敓浜ф眹鎶ュ崟 鏁伴噺 鏄惁 澶т簬 鏈亾鍑虹珯鏁伴噺 - ds= oCN.RunProcReturn($@"select sum(FFinishQty)-(select HQty from Sc_StationOutBillMain where HBillNo='{BillNo}') -from AIS20220308151944..T_PRD_MORPT rpt3 -left join AIS20220308151944..T_PRD_MORPTENTRY rpt2 on rpt3.FID = rpt2.FID -where F_bsv_Text=(select HProcExchBillNo from Sc_StationOutBillMain where HBillNo='{BillNo}')", "SumCount"); + + string sErr = ""; + if (oSystemParameter.ShowBill(ref sErr)) + { + if (oSystemParameter.omodel.WMS_CampanyName == "鐟炰笌绁�") + { + //鍒ゆ柇閲戣澏浜戠敓浜ф眹鎶ュ崟 鏁伴噺 鏄惁 澶т簬 鏈亾鍑虹珯鏁伴噺 + ds = oCN.RunProcReturn($@"select sum(FFinishQty)-(select HQty from Sc_StationOutBillMain where HBillNo='{BillNo}') + from AIS20220308151944..T_PRD_MORPT rpt3 + left join AIS20220308151944..T_PRD_MORPTENTRY rpt2 on rpt3.FID = rpt2.FID + where F_bsv_Text=(select HProcExchBillNo from Sc_StationOutBillMain where HBillNo='{BillNo}')", "SumCount"); + } + } + + if (double.Parse(ds.Tables[0].Rows[0][0].ToString()) < 0) { objJsonResult.code = "0"; @@ -740,7 +750,7 @@ FentityModel.Add("FBaseRealQty", item["鏁伴噺"].ToString());// FentityModel.Add("FOwnerTypeId", "BD_OwnerOrg");// FentityModel.Add("FOwnerId", new JObject() { ["FNumber"] = item["HPrdOrgNumber"].ToString() });// - string sErr = ""; + if (oSystemParameter.ShowBill(ref sErr)) { if (oSystemParameter.omodel.WMS_CampanyName == "鐟炰笌绁�") -- Gitblit v1.9.1