duhe
2023-08-28 19c616c00b49b4785ff429780f8295ceb8171bd5
WebAPI/Controllers/SCGL/Sc_MESTransFerWorkBillController.cs
@@ -1,4 +1,5 @@
using DBUtility;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
@@ -373,6 +374,8 @@
        {
            try
            {
                List<object> columnNameList = new List<object>();
                //查看权限
                if (!DBUtility.ClsPub.Security_Log("OA_ErrMsgBackBill_Query", 1, false, user))
                {
@@ -383,24 +386,32 @@
                    return objJsonResult;
                }
                ds = Get_TransFerBillList(sWhere);
                if (sWhere == null || sWhere.Equals(""))
                {
                    string sql = "select * from h_v_OA_ErrMsgBackBillList order by 单据号 desc";
                    ds = oCN.RunProcReturn(sql, "p_v_OA_ErrMsgBackBillList");
                }
                else
                {
                    string sql1 = "select * from h_v_OA_ErrMsgBackBillList where 1 = 1 ";
                    string sql = sql1 + sWhere + " order by 单据号 desc";
                    ds = oCN.RunProcReturn(sql, "p_v_OA_ErrMsgBackBillList");
                }
                //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.Tables[0];
                objJsonResult.list = columnNameList;
                return objJsonResult;
                //}
                //else
                //{
                //objJsonResult.code = "0";
                //objJsonResult.count = 0;
                //objJsonResult.Message = "无数据";
                //objJsonResult.data = null;
                //return objJsonResult;
                //}
            }
            catch (Exception ex)
            {