From 3652ccd21dffadf73d58ab241938c49c1929ff5b Mon Sep 17 00:00:00 2001 From: llj <132905093+newwwwwwtree@users.noreply.github.com> Date: 星期一, 04 八月 2025 10:30:59 +0800 Subject: [PATCH] 页面过滤条件:开始时间和结束时间(根据检验信息中的创建时间进行过滤)、站台(检验信息中的检验工序)、料号(PNL布局信息名称)、批次(lot号) 2.柱状图:x轴lot号,y轴良品率。根据开始时间和结束时间、站台、料号 过滤检验信息并去重(一个PNL里的PCS不能有重复记录),然后根据料号、批次分组合计得到该料号每个批次的不良PCS的数量合计。然后获取该料号每个批次中PNL条码的数量(PNL条码不能重复)并乘PNL布局信息中子表的记录数(该料号中的PCS数量)得到每个批次的PCS总数。对每个批次进行((PCS总数-不良PCS数量)/PCS总数 *100)得到每个批次的良品率。 3.饼状图:根据开始时间和结束时间、站台、料号 过滤检验信息并去重(一个PNL里的PCS不能有重复记录),然后根据检验信息中的不良原因分组统计各个原因的数量。在饼状图显示 4.表格:根据开始时间和结束时间、站台、料号 过滤检验信息,表头包含(站台、料号、PNL条码、PCS号、正反面、不良原因),并针对表头字段进行去重 --- WebAPI/Controllers/SBGL/Sb_EquipStopBillController.cs | 221 ++++++++++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 195 insertions(+), 26 deletions(-) diff --git a/WebAPI/Controllers/SBGL/Sb_EquipStopBillController.cs b/WebAPI/Controllers/SBGL/Sb_EquipStopBillController.cs index 21e5a4c..718a532 100644 --- a/WebAPI/Controllers/SBGL/Sb_EquipStopBillController.cs +++ b/WebAPI/Controllers/SBGL/Sb_EquipStopBillController.cs @@ -11,7 +11,7 @@ using System.Windows.Forms; using WebAPI.Models; -namespace WebAPI.Controllers.SBGL +namespace WebAPI.Controllers { public class Sb_EquipStopBillController : ApiController { @@ -21,6 +21,7 @@ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); public DAL.ClsSb_EquipStopBillMain OBill = new DAL.ClsSb_EquipStopBillMain(); public DAL.ClsSb_EquipStopBillMain BillOld = new DAL.ClsSb_EquipStopBillMain(); + Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter(); //鑾峰彇绯荤粺鍙傛暟 #region 璁惧鍋滄満鍗曞垪琛� 鏌ヨ @@ -83,7 +84,7 @@ #region 璁惧鍋滄満鍗曞垎椤垫煡璇� [Route("Sb_EquipStopBill/get锘縎b_EquipStopBillListPage")] [HttpGet] - public object Sb_EquipBeginBillListPage(string sWhere, string user, int page, int size) + public object Sb_EquipStopBillListPage(string sWhere, string user, int page, int size) { try { @@ -161,7 +162,7 @@ return objJsonResult; } - ds = oCN.RunProcReturn("select * from h_v_Sb_EquipStopBillMainList where HInterID = " + HInterID, " h_v_Sb_EquipStopBillMainList"); + ds = oCN.RunProcReturn("select * from h_v_Sb_EquipStopBillMain_Edit where HInterID = " + HInterID, " h_v_Sb_EquipStopBillMain_Edit"); objJsonResult.code = "1"; objJsonResult.count = 1; @@ -293,6 +294,31 @@ } if (bResult) { + //鑷姩瀹℃牳璁剧疆 + if (refSav == "Add") + { + objJsonResult.HInterID = oBill.omodel.HInterID.ToString(); //杩斿洖涓籌D + //绯荤粺鍙傛暟 鑷姩瀹℃牳 + string sReturn = ""; + if (oSystemParameter.ShowBill(ref sReturn) == true) + { + if (oSystemParameter.omodel.Sb_EquipStopBill_AutoCheck == "Y") //绯荤粺鍙傛暟 鑷姩瀹℃牳 + { + objJsonResult.Verify = "Y"; + } + else + { + objJsonResult.Verify = "N"; + } + } + } + else + if (refSav == "Update") + { + objJsonResult.HInterID = oBill.omodel.HInterID.ToString(); //杩斿洖涓籌D + objJsonResult.Verify = "N"; + } + objJsonResult.code = "0"; objJsonResult.count = 1; objJsonResult.Message = "淇濆瓨鎴愬姛锛�"; @@ -345,17 +371,50 @@ return objJsonResult; } - oCN.BeginTran(); + oCN.BeginTran(); + BillOld.MvarItemKey = "Sb_EquipStopBillMain"; + //鍒犻櫎鍓嶆帶鍒�========================================= + string sql1 = "exec h_p_Sb_EquipStopBill_BeforeDelCtrl " + HInterID + ",'" + BillOld.omodel.HBillNo + "','" + user + "'"; + ds = oCN.RunProcReturn(sql1, "h_p_Sb_EquipStopBill_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; + } - oCN.RunProc("delete from Sb_EquipStopBillMain where HInterID = " + HInterID); + 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 = BillOld.DeleteBill(Convert.ToInt32(HInterID), BillOld.omodel.HBillNo, "h_p_Sb_EquipStopBill_AfterDelCtrl", user, ref DBUtility.ClsPub.sExeReturnInfo); + //oCN.RunProc("delete from Sb_EquipStopBillMain where HInterID = " + HInterID); oCN.Commit(); - - objJsonResult.code = "1"; - objJsonResult.count = 1; - objJsonResult.Message = "Sucess锛�"; - objJsonResult.data = null; - return objJsonResult; + if (IsDete) + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "鍒犻櫎鎴愬姛锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo; + objJsonResult.data = null; + return objJsonResult; + } } catch (Exception e) { @@ -439,8 +498,32 @@ objJsonResult.data = null; return objJsonResult; } - //瀹℃牳鍗曟嵁 - if (!BillOld.CheckBill(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) + + //瀹℃牳鍓嶆帶鍒�========================================= + string sql1 = "exec h_p_Sb_EquipStopBill_BeforeCheckCtrl " + HInterID + ",'','" + user + "'"; + ds = oCN.RunProcReturn(sql1, "h_p_Sb_EquipStopBill_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; + 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 (!BillOld.CheckBill(int.Parse(HInterID),"", "h_p_Sb_EquipStopBill_AfterCheckCtrl", user, ref ClsPub.sExeReturnInfo)) { objJsonResult.code = "0"; objJsonResult.count = 1; @@ -482,15 +565,37 @@ objJsonResult.data = null; return objJsonResult; } - //鍙嶅鏍稿崟鎹� - if (!BillOld.AbandonCheck(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) + + //鍙嶅鏍稿墠鎺у埗========================================= + string sql1 = "exec h_p_Sb_EquipStopBill_BeforeUnCheckCtrl " + HInterID + ",'','" + user + "'"; + ds = oCN.RunProcReturn(sql1, "h_p_Sb_EquipStopBill_BeforeUnCheckCtrl"); + if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) { objJsonResult.code = "0"; objJsonResult.count = 1; - objJsonResult.Message = "鍙嶅鏍稿け璐�!鍘熷洜:" + ClsPub.sExeReturnInfo; + 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(int.Parse(HInterID), "", "h_p_Sb_EquipStopBill_AfterUnCheckCtrl", user, ref ClsPub.sExeReturnInfo)) + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + ClsPub.sExeReturnInfo; + objJsonResult.data = null; + return objJsonResult; + } } } @@ -498,7 +603,7 @@ objJsonResult.code = "0"; objJsonResult.count = 1; - objJsonResult.Message = "鎵ц鎴愬姛锛�"; + objJsonResult.Message = "瀹℃牳鎴愬姛锛�"; objJsonResult.data = null; return objJsonResult; ; @@ -507,7 +612,7 @@ { objJsonResult.code = "0"; objJsonResult.count = 0; - objJsonResult.Message = "鎵ц澶辫触锛�" + e.ToString(); + objJsonResult.Message = "瀹℃牳澶辫触锛�" + e.ToString(); objJsonResult.data = null; return objJsonResult; } @@ -586,15 +691,47 @@ objJsonResult.data = null; return objJsonResult; } - //鍏抽棴鍗曟嵁 - if (!BillOld.CloseBill(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) + + string sql2 = ""; + //鍏抽棴鍓嶆帶鍒�===============================================Begin=================================================================== + sql2 = "exec h_p_Sb_EquipStopBill_BeforeCloseCtrl " + HInterID + ",'','" + user + "'"; + ds = oCN.RunProcReturn(sql2, "h_p_Sb_EquipStopBill_BeforeCloseCtrl"); + if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) { objJsonResult.code = "0"; - objJsonResult.count = 1; - objJsonResult.Message = "鍏抽棴澶辫触!鍘熷洜:" + ClsPub.sExeReturnInfo; + objJsonResult.count = 0; + objJsonResult.Message = "鍏抽棴澶辫触!鍘熷洜:鍏抽棴鍓嶅墠鍒ゆ柇澶辫触锛屾棤杩斿洖淇℃伅锛岃涓庣綉缁滅鐞嗕汉鍛樿仈绯�"; + objJsonResult.data = null; + return objJsonResult; + + } + if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍏抽棴澶辫触!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; objJsonResult.data = null; return objJsonResult; } + //鍏抽棴鍓嶆帶鍒�===============================================End=================================================================== + + //鍏抽棴鎻愪氦 + if (BillOld.CloseBill(Convert.ToInt32(HInterID), "", "h_p_Sb_EquipStopBill_AfterCloseCtrl", user, ref DBUtility.ClsPub.sExeReturnInfo) == true) + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "鍏抽棴鎴愬姛"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍏抽棴澶辫触!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo; + objJsonResult.data = null; + return objJsonResult; + } } } else @@ -629,15 +766,47 @@ objJsonResult.data = null; return objJsonResult; } - //鍙嶅叧闂崟鎹� - if (!BillOld.CancelClose(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) + + string sql2 = ""; + //鍙嶅叧闂墠鎺у埗===============================================Begin=================================================================== + sql2 = "exec h_p_Sb_EquipStopBill_BeforeUnCloseCtrl " + HInterID + ",'','" + user + "'"; + ds = oCN.RunProcReturn(sql2, "h_p_Sb_EquipStopBill_BeforeUnCloseCtrl"); + if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) { objJsonResult.code = "0"; - objJsonResult.count = 1; - objJsonResult.Message = "鍙嶅叧闂け璐�!鍘熷洜:" + ClsPub.sExeReturnInfo; + objJsonResult.count = 0; + objJsonResult.Message = "鍙嶅叧闂け璐�!鍘熷洜:鍙嶅叧闂墠鍓嶅垽鏂け璐ワ紝鏃犺繑鍥炰俊鎭紝璇蜂笌缃戠粶绠$悊浜哄憳鑱旂郴"; + objJsonResult.data = null; + return objJsonResult; + + } + if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍙嶅叧闂け璐�!鍘熷洜:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; objJsonResult.data = null; return objJsonResult; } + //鍙嶅叧闂墠鎺у埗===============================================End=================================================================== + + //鍙嶅叧闂彁浜� + if (BillOld.CancelClose(Convert.ToInt32(HInterID), "", "h_p_Sb_EquipStopBill_AfterUnCloseCtrl", user, ref DBUtility.ClsPub.sExeReturnInfo) == true) + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "鍙嶅叧闂垚鍔�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍙嶅叧闂け璐�!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo; + objJsonResult.data = null; + return objJsonResult; + } } } -- Gitblit v1.9.1