yangle
2025-04-09 e23acb240c108e12894a8ed68b87c42ddd29a7bf
WebAPI/Controllers/Sc_MouldRepairInBillListController.cs
@@ -932,6 +932,95 @@
        #endregion
        #region 器具寿命耗用分析报表
        /// <summary>
        /// 器具寿命耗用分析报表
        /// </summary>
        /// <returns></returns>
        [Route("Sc_MouldRepairInBillList/Get_Sc_MouldLifeUsePicReport_list")]
        [HttpGet]
        public object Get_Sc_MouldLifeUsePicReport_list(string sWhere)
        {
            try
            {
                Dictionary<object, object> dic = Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<object, object>>(sWhere);
                string HBeginDate = dic["HBeginDate"].ToString();//开始日期
                string HEndDate = dic["HEndDate"].ToString();//结束日期
                string HMouldNo = dic["HMouldNo"].ToString();//模具编码
                string HName = dic["HName"].ToString();//模具名称
                ds = oCN.RunProcReturn("exec h_P_Sc_MouldLifeUsePicReport '" + HBeginDate + "'," + HEndDate + ",'" + HMouldNo + "','" + HName + "'", "h_P_Sc_MouldLifeUsePicReport");
                List<object> columnNameList = new List<object>();
                //添加列名
                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 = "0";
                objJsonResult.count = 1;
                objJsonResult.Message = "成功!";
                objJsonResult.data = ds.Tables[0];
                objJsonResult.list = columnNameList;
                return objJsonResult;
                //}
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "返回报表信息失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region 获取模具寿命
        [Route("Sc_MouldRepairInBillList/Get_HMouldLifeUsePic")]
        [HttpGet]
        public object Get_HMouldLifeUsePic(string HItemID)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                ds = oCN.RunProcReturn("select * from h_v_Gy_MouldFile_Life where HInterID="+ HItemID, "h_v_Gy_MouldFile_Life");
                //添加列名
                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
        /// <summary>
        /// 模具维修验收单列表
        /// </summary>