| | |
| | | { |
| | | 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"); |
| | | } |
| | | ds = oCN.RunProcReturn("exec h_p_Sb_EquipmentLoadReportListt '" + HDeptID + "','" + HWorkCenterID + "'", "h_p_Sb_EquipmentLoadReportListt"); |
| | | |
| | | //添加列名 |
| | | foreach (DataColumn col in ds.Tables[0].Columns) |
| | |
| | | } |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | //获取保养项目编辑数据 |
| | | string sql = "select 保养项目ID HMaintainItemID, 保养项目代码 HMaintainItemNumber,保养项目名称 HMaintainItem,保养部位 HMaintainPart,具体要求 HClaim,HManagerID,负责人代码 HManagerNumber,负责人 HManagerName,表体备注 HRemark from h_v_Sb_EquipMaintainBillSub_Item where 1 = 1 " + Swhere + ""; |
| | | string sql = "select 保养项目ID HMaintainItemID, 保养项目代码 HMaintainItemNumber,保养项目名称 HMaintainItem,保养部位 HMaintainPart,具体要求 HClaim,HManagerID,负责人代码 HManagerNumber,负责人 HManagerName,表体备注 HRemark,保养结果 HMaintainResult from h_v_Sb_EquipMaintainBillSub_Item where 1 = 1 " + Swhere + ""; |
| | | ds = oCN.RunProcReturn(sql, "h_v_Sb_EquipMaintainBillSub_Item"); |
| | | //获取配件项目编辑数据 |
| | | string sql1 = "select HMaterID, 配件代码 HMaterNumber,配件名称 HMaterName,单位ID HUnitID,单位代码 HUnitNumber,单位名称 HUnitName,实际用量 HQty,标准用量 HQtyMust,表体备注 HRemark,负责人ID HManagerID,负责人代码 HManagerNumber,负责人 HManagerName from h_v_Sb_EquipMaintainBillList where 1 = 1 " + Swhere + ""; |
| | |
| | | #endregion |
| | | |
| | | #endregion |
| | | |
| | | #region 设备保养逾期预警报表 |
| | | |
| | | [Route("Sb_EquipMaintainWarning/Report")] |
| | | [HttpGet] |
| | | public object Report(string HYear, string HEquipTypeID, string user) |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | //if (!DBUtility.ClsPub.Security_Log("Gy_EquipFileList", 1, false, user)) |
| | | //{ |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "没有查看权限"; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | //} |
| | | if (HYear == null || HYear.Equals("")) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "请选择有效年份"; |
| | | objJsonResult.data = ""; |
| | | objJsonResult.list = columnNameList; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | string sql = "exec h_p_Sb_EquipMaintainWarningReport " + HYear + "," + HEquipTypeID; |
| | | ds = oCN.RunProcReturn(sql, "h_p_Sb_EquipMaintainWarningReport"); |
| | | } |
| | | |
| | | //添加列名 |
| | | 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));//获取到DataColumn列对象的列名 |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucess!"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | 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 |
| | | } |
| | | } |