zrg
5 天以前 2209c5b02e7dfdc01cfba0e54e2d2b1da7f830fa
WebAPI/Controllers/MJGL/Sc_MouldReportController.cs
@@ -72,11 +72,7 @@
        #endregion
        #region  器具保养任务(今日待保养、今日已保养、今天全部任务)
        /// <summary>
        /// 返回器具保养任务
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        [Route("Sc_MouldMaintainTaskReport/MaintainList")]
        [HttpGet]
        public object MaintainList(string user)
@@ -86,6 +82,62 @@
                List<object> columnNameList = new List<object>();
                ds = oCN.RunProcReturn("exec h_p_Sc_MouldMaintainTaskReport " + user, "h_p_Sc_MouldMaintainTaskReport");
                if (ds.Tables[0].Rows.Count != 0 || ds != null)
                {
                    //添加列名
                    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;
                    objJsonResult.list = columnNameList;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无数据";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        [Route("Sc_MouldMaintainTaskReport/MaintainList_APP")]
        [HttpGet]
        public object MaintainList_APP(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                Dictionary<object, object> dic = Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<object, object>>(sWhere);
                string HBeginDate = dic["HBeginDate"].ToString();//开始日期
                string HEndDate = dic["HEndDate"].ToString();//结束日期
                ds = oCN.RunProcReturn("exec h_p_Sc_MouldMaintainTaskReport_APP '" + HBeginDate + "','" + HEndDate + "','" + user + "'", "h_p_Sc_MouldMaintainTaskReport_APP");
                if (ds.Tables[0].Rows.Count != 0 || ds != null)
                {
@@ -140,6 +192,60 @@
                List<object> columnNameList = new List<object>();
                ds = oCN.RunProcReturn("exec h_p_Sc_MouldRepairTaskReport " + user, "h_p_Sc_MouldRepairTaskReport");
                if (ds.Tables[0].Rows.Count != 0 || ds != null)
                {
                    //添加列名
                    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;
                    objJsonResult.list = columnNameList;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无数据";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region  故障登记跟踪(待派工、待维修、待验收)
        /// <summary>
        /// 返回故障登记跟踪
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        [Route("Sc_MouldRepairCheckTaskReport/RepairCheckList2")]
        [HttpGet]
        public object RepairCheckList2(string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                ds = oCN.RunProcReturn("exec h_p_Sc_MouldRepairTaskReport_2 " + user, "h_p_Sc_MouldRepairTaskReport_2");
                if (ds.Tables[0].Rows.Count != 0 || ds != null)
                {
@@ -282,5 +388,51 @@
        }
        #endregion
        #region  模具故障维修进度  查询
        [Route("Sc_MouldReport/getSc_MouldConkBookRepairReportList")]
        [HttpGet]
        public object getSc_MouldConkBookRepairReportList(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                if (sWhere == null || sWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn("select * from h_v_Sc_MouldConkBookRepairReprot order by 日期 desc", "h_v_Sc_MouldConkBookRepairReprot");
                }
                else
                {
                    string sql1 = "select * from h_v_Sc_MouldConkBookRepairReprot where 1 = 1 ";
                    string sql = sql1 + sWhere + " order by 日期 desc ";
                    ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldConkBookRepairReprot");
                }
                //添加列名
                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
    }
}