From 8affd199e02bd37f0dcb16447d1fbcaa34bfa2f8 Mon Sep 17 00:00:00 2001 From: lan <lan@DESKTOP-MG88OFJ> Date: 星期四, 30 五月 2024 10:39:43 +0800 Subject: [PATCH] 1 --- WebAPI/Controllers/Sb_CheckEqpRepairWorkBillController.cs | 191 ++++++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 179 insertions(+), 12 deletions(-) diff --git a/WebAPI/Controllers/Sb_CheckEqpRepairWorkBillController.cs b/WebAPI/Controllers/Sb_CheckEqpRepairWorkBillController.cs index c37b633..718192f 100644 --- a/WebAPI/Controllers/Sb_CheckEqpRepairWorkBillController.cs +++ b/WebAPI/Controllers/Sb_CheckEqpRepairWorkBillController.cs @@ -640,7 +640,30 @@ return objJsonResult; } - bool IsDete = oBill.DeleteBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); + + //鍒犻櫎鍓嶆帶鍒� + DataSet BeforeDs = oCN.RunProcReturn("Exec h_p_Sb_EquipRepairWorkBill_BeforeDelCtrl " + HInterID.ToString() + ",'" + user + "'", "h_p_Sb_EquipRepairWorkBill_BeforeDelCtrl"); + if (BeforeDs == null || BeforeDs.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍒犻櫎鍓嶅垽鏂け璐ワ紒"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + if (DBUtility.ClsPub.isLong(BeforeDs.Tables[0].Rows[0]["HBack"]) == 1) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍒犻櫎澶辫触锛�" + DBUtility.ClsPub.isStrNull(BeforeDs.Tables[0].Rows[0]["HRemark"]); + objJsonResult.data = null; + return objJsonResult; + } + } + + bool IsDete = oBill.DeleteBill(oBill.omodel.HInterID, oBill.omodel.HBillNo, "h_p_Sb_EquipRepairWorkBill_AfterDelCtrl ", user, ref DBUtility.ClsPub.sExeReturnInfo); if (IsDete) { objJsonResult.code = "0"; @@ -977,6 +1000,7 @@ string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); string msg2 = sArray[0].ToString(); string msg3 = sArray[1].ToString(); + string msg4 = sArray[2].ToString(); //string UserName = ""; @@ -1218,7 +1242,30 @@ return objJsonResult; } - bool IsDete = oBill.DeleteBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); + + //鍒犻櫎鍓嶆帶鍒� + DataSet BeforeDs = oCN.RunProcReturn("Exec h_p_Sb_EquipConkBookBill_BeforeDelCtrl " + HInterID.ToString() + ",'" + user + "'", "h_p_Sb_EquipConkBookBill_BeforeDelCtrl "); + if (BeforeDs == null || BeforeDs.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍒犻櫎鍓嶅垽鏂け璐ワ紒"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + if (DBUtility.ClsPub.isLong(BeforeDs.Tables[0].Rows[0]["HBack"]) == 1) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍒犻櫎澶辫触锛�" + DBUtility.ClsPub.isStrNull(BeforeDs.Tables[0].Rows[0]["HRemark"]); + objJsonResult.data = null; + return objJsonResult; + } + } + + bool IsDete = oBill.DeleteBill(oBill.omodel.HInterID, oBill.omodel.HBillNo, "h_p_Sb_EquipConkBookBill_AfterDelCtrl", user, ref DBUtility.ClsPub.sExeReturnInfo); if (IsDete) { objJsonResult.code = "0"; @@ -1268,13 +1315,13 @@ return objJsonResult; } //寰楀埌淇℃伅 - ds = oCN.RunProcReturn("select top 1 * from Gy_EquipFileBillMain where HEquipFileNumber= '" + HBarCode + "'", "Gy_EquipFileBillMain"); + ds = oCN.RunProcReturn("select top 1 * from h_v_Gy_EquipFileBillList where HEquipFileNumber= '" + HBarCode + "'", "Gy_EquipFileBillMain"); //鍐欏叆淇℃伅 if (ds == null || ds.Tables[0].Rows.Count == 0) { objJsonResult.code = "0"; objJsonResult.count = 0; - objJsonResult.Message = "鏈煡璇㈠埌璁惧淇℃伅锛�"; + objJsonResult.Message = "1.鏈煡璇㈠埌璁惧淇℃伅锛� 2.璁惧娌℃湁缁存姢鏁呴殰鐧昏鍗�"; objJsonResult.data = null; return objJsonResult; } @@ -1305,6 +1352,7 @@ string msg1 = _value.ToString(); string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); string msg2 = sArray[0].ToString(); + string msg3 = sArray[1].ToString(); string UserName = ""; @@ -1361,9 +1409,12 @@ oBill.omodel = oItem; } //瀛愯〃浣撴暟鎹� - + //鎸� },{鏉ユ媶鍒嗘暟缁� //鍘绘帀銆愬拰銆� + msg3 = msg3.Substring(1, msg3.Length - 2); + msg3 = msg3.Replace("\\", ""); + msg3 = msg3.Replace("\n", ""); //\n List<Models.ClsSb_EquipRepairWorkBillSub> ls = new List<Models.ClsSb_EquipRepairWorkBillSub>(); - ls = oListModels.getObjectByJson_Sb_EquipRepairWorkBillSubPDA(msg2); + ls = oListModels.getObjectByJson_Sb_EquipRepairWorkBillSubPDA(msg3); int i = 0; foreach (Models.ClsSb_EquipRepairWorkBillSub oItemSub in ls) { @@ -1378,8 +1429,8 @@ oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now); oItemSub.HCloseType = false; //鍏抽棴绫诲瀷 //oItemSub.HRemark = ""; //澶囨敞 - oItemSub.HSourceInterID = 0; // 婧愬崟涓诲唴鐮� - oItemSub.HSourceEntryID = 0; //婧愬崟瀛愬唴鐮� + //oItemSub.HSourceInterID = 0; // 婧愬崟涓诲唴鐮� + //oItemSub.HSourceEntryID = 0; //婧愬崟瀛愬唴鐮� //oItemSub.HSourceBillNo = ""; //婧愬崟鍗曞彿 //oItemSub.HSourceBillType = ""; //婧愬崟绫诲瀷 //oItemSub.HRelationQty = 0; //鍏宠仈鏁伴噺 @@ -1436,6 +1487,7 @@ [HttpGet] public object CheckSb_EqpConkBookBill(string HInterID, int Type, string user) { + string sql = ""; try { //鍒ゆ柇鏄惁鏈夊垹闄ゆ潈闄� @@ -1458,12 +1510,47 @@ } ClsPub.CurUserName = user; + ds = oCN.RunProcReturn("select * from Sb_EquipConkBookBillMain where HInterID = " + int.Parse(HInterID), "Sb_EquipConkBookBillMain"); + string HBillNo = ""; + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁涓嶅瓨鍦�!"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString(); + } oCN.BeginTran();//寮�濮嬩簨鍔� //Type 1 瀹℃牳 2 鍙嶅鏍� if (Type == 1) { - if (!BillOld2.CheckBill(int.Parse(HInterID), ref ClsPub.sExeReturnInfo)) + //瀹℃牳鍓嶆帶鍒� + sql = "exec h_p_Sb_EquipConkBookBill_BeforeCheckCtrl " + int.Parse(HInterID) + ",'" + HBillNo + "','" + user + "'"; + ds = oCN.RunProcReturn(sql, "h_p_Sb_EquipConkBookBill_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 (!BillOld2.CheckBill(int.Parse(HInterID), HBillNo, "h_p_Sb_EquipConkBookBill_AfterCheckCtrl", user, ref ClsPub.sExeReturnInfo)) { objJsonResult.code = "0"; objJsonResult.count = 1; @@ -1474,7 +1561,29 @@ } else { - if (BillOld2.AbandonCheck(int.Parse(HInterID), ref ClsPub.sExeReturnInfo)) + //鍙嶅鏍稿墠鎺у埗 + sql = "exec h_p_Sb_EquipConkBookBill_BeforeUnCheckCtrl " + int.Parse(HInterID) + ",'" + HBillNo + "','" + user + "'"; + ds = oCN.RunProcReturn(sql, "h_p_Sb_EquipConkBookBill_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 (BillOld2.AbandonCheck(int.Parse(HInterID), HBillNo, "h_p_Sb_EquipConkBookBill_AfterUnCheckCtrl", user, ref ClsPub.sExeReturnInfo)) { SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); } @@ -1587,6 +1696,7 @@ [HttpGet] public object CheckSb_EquipRepairWorkBill(string HInterID, int Type, string user) { + string sql = ""; try { //鍒ゆ柇鏄惁鏈夊垹闄ゆ潈闄� @@ -1609,12 +1719,48 @@ } ClsPub.CurUserName = user; + ds = oCN.RunProcReturn("select * from Sb_EquipRepairWorkBillMain where HInterID = " + int.Parse(HInterID), "Sb_EquipRepairWorkBillMain"); + string HBillNo = ""; + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁涓嶅瓨鍦�!"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString(); + } oCN.BeginTran();//寮�濮嬩簨鍔� //Type 1 瀹℃牳 2 鍙嶅鏍� if (Type == 1) { - if (!BillOld3.CheckBill(int.Parse(HInterID), ref ClsPub.sExeReturnInfo)) + //瀹℃牳鍓嶆帶鍒� + sql = "exec h_p_Sb_EquipRepairWorkBill_BeforeCheckCtrl " + int.Parse(HInterID) + ",'" + HBillNo + "','" + user + "'"; + ds = oCN.RunProcReturn(sql, "h_p_Sb_EquipRepairWorkBill_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 (!BillOld3.CheckBill(int.Parse(HInterID), HBillNo, "h_p_Sb_EquipRepairWorkBill_AfterCheckCtrl", user, ref ClsPub.sExeReturnInfo)) { objJsonResult.code = "0"; objJsonResult.count = 1; @@ -1625,7 +1771,28 @@ } else { - if (BillOld3.AbandonCheck(int.Parse(HInterID), ref ClsPub.sExeReturnInfo)) + //鍙嶅鏍稿墠鎺у埗 + sql = "exec h_p_Sb_EquipRepairWorkBill_BeforeUnCheckCtrl " + int.Parse(HInterID) + ",'" + HBillNo + "','" + user + "'"; + ds = oCN.RunProcReturn(sql, "h_p_Sb_EquipRepairWorkBill_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 (BillOld3.AbandonCheck(int.Parse(HInterID), HBillNo, "h_p_Sb_EquipRepairWorkBill_AfterUnCheckCtrl", user, ref ClsPub.sExeReturnInfo)) { SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); } -- Gitblit v1.9.1