From 06bf635016c8cdd691fac8cda56d6b50915a4996 Mon Sep 17 00:00:00 2001 From: yangle <admin@YINMOU> Date: 星期四, 18 五月 2023 08:44:32 +0800 Subject: [PATCH] 流转卡、生产订单、工序进站单、工序出站单只能自己删除自己的单据。(所有模块,做个系统参数,删除人和制单人必须一致) 流转卡列表批量删除批量删除(会误操作),删除的时候先根据生产订单去过滤 --- WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs | 55 +++++++++++++++++++++++++++++++++++++------------------ 1 files changed, 37 insertions(+), 18 deletions(-) diff --git a/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs b/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs index c16c7e4..0c5a398 100644 --- a/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs +++ b/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs @@ -118,6 +118,7 @@ double HWorkTimes = list[0].HWorkTimes;//宸ユ椂 long HQCCheckID = list[0].HQCCheckID;//妫�楠屽憳ID long HPRDOrgID = list[0].HPRDOrgID;//缁勭粐ID + double HmaterOutqty = list[0].HmaterOutqty;//鐧藉澂鍙戝竷 //鍗曟嵁瀹屾暣鎬у垽鏂� if (HProcExchInterID <= 0) { @@ -176,14 +177,6 @@ objJsonResult.data = null; return objJsonResult; } - //if (HEmpID == 0) - //{ - // objJsonResult.code = "0"; - // objJsonResult.count = 0; - // objJsonResult.Message = "鎿嶄綔鍛樻病鏈夐�夋嫨锛�"; - // objJsonResult.data = null; - // return objJsonResult; - //} //if (HQCCheckID == 0) //{ // objJsonResult.code = "0"; @@ -197,8 +190,8 @@ string Ret = ""; if (oSystemParameter.ShowBill(ref Ret)) { - //鍒ゆ柇瀹㈡埛 - if (oSystemParameter.omodel.WMS_CampanyName != "榫欏北姹介厤") //绯荤粺鍙傛暟 + //鍒ゆ柇瀹㈡埛涓嶄负榫欏北姹介厤 + if (oSystemParameter.omodel.WMS_CampanyName != "榫欏北姹介厤"&& oSystemParameter.omodel.WMS_CampanyName != "鐟炰笌绁�") //绯荤粺鍙傛暟 { if (HSourceID == 0) { @@ -207,10 +200,27 @@ objJsonResult.Message = "鐢熶骇璧勬簮娌℃湁閫夋嫨锛�"; objJsonResult.data = null; return objJsonResult; + } + } + //鍒ゆ柇瀹㈡埛涓洪緳灞辨苯閰� + else if (oSystemParameter.omodel.WMS_CampanyName == "榫欏北姹介厤") + { + //鍒ゆ柇鏄惁涓哄宸ヤ綅 + ds = oCN.RunProcReturn("select * from h_v_GetStationOutBill_Detail where 宸ュ簭ID = " + HProcID + " and 鐗╂枡ID = " + HMaterID + " and 娴佽浆鍗″彿 = '" + HProcExchBillNo + "'", "h_v_GetStationOutBill_Detail"); + if (ds != null && ds.Tables[0].Rows.Count <= 1) + { + if (HEmpID == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鎿嶄綔鍛樻病鏈夐�夋嫨锛�"; + objJsonResult.data = null; + return objJsonResult; + } } } - } + //if (HCenterID == 0) //{ // objJsonResult.code = "0"; @@ -293,6 +303,7 @@ ",HSupID,HQty,HPrice,HMoney,HBadCount,HCenterID,HProcNo,HOrderProcNO,HSourceNameList" + ",HMainSourceInterID,HMainSourceBillNo,HMainSourceBillType,HLastSubProc" + ",HEmpID2,HEmpID3,HEmpID4,HEmpID5,HDSQty,HChongQty,HPriceRate,HWorkTimes,HQCCheckID,HMainInterID,HPRDOrgID" + + ",HmaterOutqty" + ") " + " values('" + BillType + "','" + HBillSubType + "'," + HInterID + ",'" + HBillNo + "'," + HBillStatus + ",getdate(),'" + HMaker + "',getdate(),'" + HMouldNum + "'" + "," + HYear + "," + HPeriod + ",'" + HRemark + "','" + HSourceName + "'," + HPieceQty + "," + HWasterQty + "," + HPlanPieceQty + "," + HBadPNL + @@ -302,7 +313,7 @@ "," + HSupID + "," + HQty + "," + HPrice + "," + HMoney + "," + HBadCount + "," + HCenterID + "," + HProcNo + ",'" + HOrderProcNO + "'" + ",'" + HSourceNameList + "'" + "," + HMainSourceInterID + ",'" + HMainSourceBillNo + "','" + HMainSourceBillType + "'," + Convert.ToString(HLastSubProc ? 1 : 0) + "," + HEmpID2 + "," + HEmpID3 + "," + HEmpID4 + "," + HEmpID5 + "," + HDSQty + "," + HChongQty + "," + HPriceRate + "," + HWorkTimes + "," + HQCCheckID + "," + HMainInterID + "," + HPRDOrgID + - ") "); + ","+ HmaterOutqty + ") "); } else if ("Modify".Equals(eventType)) { @@ -1614,14 +1625,22 @@ DAL.ClsSc_StationOutBill oBill = new DAL.ClsSc_StationOutBill(); 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_StationOutBill_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; -- Gitblit v1.9.1