From 92cc987c52cc28414e04f95a4656ac39ad925d54 Mon Sep 17 00:00:00 2001 From: duhe <226547893@qq.com> Date: 星期四, 28 三月 2024 10:09:06 +0800 Subject: [PATCH] 1 --- WebAPI/Controllers/SBGL/Sb_EquipMaintainBillController.cs | 72 ++++++++++++++++++++++++++++++++++- 1 files changed, 69 insertions(+), 3 deletions(-) diff --git a/WebAPI/Controllers/SBGL/Sb_EquipMaintainBillController.cs b/WebAPI/Controllers/SBGL/Sb_EquipMaintainBillController.cs index 41b4d1b..92b41ba 100644 --- a/WebAPI/Controllers/SBGL/Sb_EquipMaintainBillController.cs +++ b/WebAPI/Controllers/SBGL/Sb_EquipMaintainBillController.cs @@ -140,6 +140,50 @@ #endregion + #region 璁惧璐熻嵎鍒嗘瀽琛� + [Route("Sb_EquipMaintainReport/Sb_EquipmentLoadReportList")] + [HttpGet] + public object Sb_EquipmentLoadReportList(string HDeptID, string HWorkCenterID, string user) + { + try + { + List<object> columnNameList = new List<object>(); + + if (HDeptID == "0" || HDeptID.Equals("")|| HWorkCenterID == "0" || HWorkCenterID.Equals("")) + { + ds = oCN.RunProcReturn("exec h_p_Sb_EquipmentLoadReportListt '0','0'", "h_p_Sb_EquipmentLoadReportListt"); + } + else + { + ds = oCN.RunProcReturn("exec h_p_Sb_EquipmentLoadReportListt '" + HDeptID + "','" + HWorkCenterID + "'", "h_p_Sb_EquipmentLoadReportListt"); + } + + //娣诲姞鍒楀悕 + foreach (DataColumn col in ds.Tables[0].Columns) + { + Type dataType = col.DataType; + string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; + columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕 + } + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds; + objJsonResult.list = columnNameList; + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + #region sql璇彞 @@ -366,7 +410,29 @@ return objJsonResult; } - bool IsDete = oBill.DeleteBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); + //鍒犻櫎鍓嶆帶鍒� + DataSet BeforeDs = oCN.RunProcReturn("Exec h_p_Sb_EquipMaintainBill_BeforeDelCtrl " + HInterID.ToString() + ",'" + user + "'", "h_p_Sb_EquipMaintainBill_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_EquipMaintainBill_AfterDelCtrl", user, ref DBUtility.ClsPub.sExeReturnInfo); if (IsDete) { objJsonResult.code = "0"; @@ -621,8 +687,8 @@ item.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now); item.HCloseType = false; //鍏抽棴绫诲瀷 //oItemSub.HRemark = ""; //澶囨敞 - item.HSourceInterID = 0; // 婧愬崟涓诲唴鐮� - item.HSourceEntryID = 0; //婧愬崟瀛愬唴鐮� + //item.HSourceInterID = 0; // 婧愬崟涓诲唴鐮� + //item.HSourceEntryID = 0; //婧愬崟瀛愬唴鐮� //oItemSub.HSourceBillNo = ""; //婧愬崟鍗曞彿 //oItemSub.HSourceBillType = ""; //婧愬崟绫诲瀷 item.HRelationQty = 0; //鍏宠仈鏁伴噺 -- Gitblit v1.9.1