WebAPI/Controllers/WebAPIController.cs
@@ -20930,6 +20930,80 @@
            }
        }
        #region
        [Route("Web/GetMouldBillsList")]
        [HttpGet]
        public object GetMouldBillsList(string sWhere, string Type, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                string HView = "";
                switch (Type)
                {
                    case "RC": // 模具维修检验单
                        HView = "h_v_Sc_MouldRepairCheckBillList";
                        break;
                    case "PG": // 模具维修派工单
                        HView = "h_v_Sc_MouldRepairSendWorkBill";
                        break;
                    default:
                        objjson.code = "0";
                        objjson.count = 0;
                        objjson.Message = "设备模块类型错误!";
                        objjson.data = null;
                        return objjson;
                }
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                ds = oCN.RunProcReturn("select ManagerFlag from gy_czygl where czymc='" + user.Trim() + "'", "gy_czygl");
                if (!(bool)ds.Tables[0].Rows[0]["ManagerFlag"])  //是否管理员
                {
                    //不是管理员
                    sWhere += " and 制单人 = '" + user + "'";
                }
                string sql = string.Format(@"select * from " + HView + " where 1 = 1 " + sWhere + " order by 日期 desc, hmainid desc");
                ds = oCN.RunProcReturn(sql, HView);
                //添加列名
                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列对象的列名
                }
                if (ds == null || ds.Tables[0].Rows.Count <= 0)
                {
                    objjson.code = "1";
                    objjson.count = 1;
                    objjson.Message = "获取失败,查无数据";
                    objjson.data = null;
                    objjson.list = columnNameList;
                    return objjson;
                }
                else
                {
                    objjson.code = "1";
                    objjson.count = 1;
                    objjson.Message = "获取成功!";
                    objjson.data = ds.Tables[0];
                    objjson.list = columnNameList;
                    return objjson;
                }
            }
            catch (Exception ex)
            {
                objjson.code = "0";
                objjson.count = 0;
                objjson.Message = "获取失败" + ex.ToString();
                objjson.data = null;
                return objjson;
            }
        }
        #endregion
        /// <summary>
        /// 查询各类设备单据列表(设备点检,设备维修,设备保养......)
        /// </summary>
@@ -20965,6 +21039,9 @@
                    case "XJ":
                        HView = "h_v_Sb_EquipPatrolCheckBillList";
                        break;
                    case "PG": // 设备维修派工单
                        HView = "h_v_Sb_EquipRepairSendWorkBillList";
                        break;
                    default:
                        objjson.code = "0";
                        objjson.count = 0;
@@ -20983,7 +21060,7 @@
                }
                string sql = string.Format(@"select * from " + HView + " where 1 = 1 " + sWhere);
                string sql = string.Format(@"select * from " + HView + " where 1 = 1 " + sWhere + " order by 日期 desc, hmainid desc");
                ds = oCN.RunProcReturn(sql, HView);
                //添加列名
                foreach (DataColumn col in ds.Tables[0].Columns)