yusijie
2024-11-22 3697b0dda739b38c33406d6e164714167e9ad5b5
WebAPI/Controllers/SBGL/Sb_EquipRepairSendWorkBillController.cs
@@ -1,4 +1,5 @@
using DBUtility;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
@@ -76,6 +77,60 @@
        }
        #endregion
        #region 设备派工单分页查询
        [Route("Sb_EquipRepairSendWorkBill/GetEquipRepairSendWorkBillListPage")]
        [HttpGet]
        public object GetEquipRepairSendWorkBillListPage(string sWhere, string user, int page, int size)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                //编辑权限
                if (!DBUtility.ClsPub.Security_Log_second("Sb_EquipRepairSendWorkBillList", 3, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无查看权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                sWhere = sWhere.Replace("'", "''");
                if (sWhere == null || sWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn("exec h_p_Sb_EquipRepairSendWorkBillListPage " + page + "," + size + ",''", "h_p_Sb_EquipRepairSendWorkBillListPage");
                }
                else
                {
                    ds = oCN.RunProcReturn("exec h_p_Sb_EquipRepairSendWorkBillListPage " + page + "," + size + ",'" + sWhere + "'", "h_p_Sb_EquipRepairSendWorkBillListPage");
                }
                //添加列名
                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 = int.Parse(ds.Tables[1].Rows[0]["count"].ToString());
                objJsonResult.Message = "Sucess!";
                objJsonResult.list = columnNameList;
                objJsonResult.data = ds.Tables[0];
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region 设备维修派工单 添加/修改
        [Route("Sb_EquipRepairSendWorkBill/AddEquipRepairSendWorkBill")]
        [HttpPost]