yusijie
2023-02-03 3c1f1bdf22437cf7382cab1aa5b99700c3a5b479
动态列
5个文件已修改
89 ■■■■■ 已修改文件
WebAPI/BLL/WebServer.cs 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/BarCodeController.cs 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/EntrustOrderController.cs 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/POInStockController.cs 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/WebAPIController.cs 46 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/BLL/WebServer.cs
@@ -57,6 +57,19 @@
            return ds;
        }
        /// <summary>
        /// 获取物料列表
        /// </summary>
        /// <param name="sWhere"></param>
        /// <param name="sErr"></param>
        /// <returns></returns>
        public DataSet GetMaterialList(string sWhere, ref string sErr)
        {
            DataSet ds = new DataSet();
            ds = oCn.RunProcReturn("select * from h_v_IF_Material " + sWhere, "h_v_IF_Material");
            //DAL.ClsIF_Department_View dal = new DAL.ClsIF_Department_View();
            return ds;
        }
        /// <summary>
        /// 职员列表
        /// </summary>
        /// <param name="sWhere"></param>
WebAPI/Controllers/BarCodeController.cs
@@ -1,4 +1,5 @@
using DBUtility;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using SQLHelper;
using System;
@@ -1368,6 +1369,14 @@
                Int64 RowTotal = Common.GetRowTotal("h_v_SRM_BarCodeBillList", VsWhere, ref DBUtility.ClsPub.sExeReturnInfo);
                //获取返回数据
                ds = oCn.RunProcReturn("exec h_p_SRM_BarCodeBillList '" + PcWhere + "'", "h_v_SRM_BarCodeBillList");
                //添加列名
                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列对象的列名
                }
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objjson.code = "0";
@@ -1381,6 +1390,7 @@
                    objjson.code = "0";
                    objjson.count = 10000;
                    objjson.Message = "获取成功";
                    objjson.list = columnNameList;
                    objjson.data = ds.Tables[0];
                    return objjson;
                }
WebAPI/Controllers/EntrustOrderController.cs
@@ -1,4 +1,5 @@
using DBUtility;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using SQLHelper;
using System;
@@ -51,10 +52,20 @@
                Int64 RowTotal = Common.GetRowTotal("H_v_SRM_EntrustOrderBillList", VsWhere, ref DBUtility.ClsPub.sExeReturnInfo);
                //获取返回数据
                ds = oCn.RunProcReturn("exec H_p_SRM_EntrustOrderBillList '" + PcWhere + "'", "H_p_SRM_EntrustOrderBillList");
                //添加列名
                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列对象的列名
                }
                objjson.code = "0";
                objjson.count = 10000;
                objjson.Message = "获取成功";
                objjson.data = ds.Tables[0];
                objjson.list = columnNameList;
                return objjson;
            }
            catch (Exception e)
WebAPI/Controllers/POInStockController.cs
@@ -462,6 +462,14 @@
                Int64 RowTotal = Common.GetRowTotal("H_v_SRM_POInStockBillList", VsWhere, ref DBUtility.ClsPub.sExeReturnInfo);
                //获取返回数据
                ds = oCn.RunProcReturn("exec H_p_SRM_POInStockBillList '" + PcWhere + "'", "H_p_SRM_POInStockBillList");
                //添加列名
                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列对象的列名
                }
                LogService.Write("送货单列表加载sql:exec H_p_SRM_POInStockBillList '" + PcWhere + "'");
                LogService.Write("数据查询返回" + sw.Elapsed);
                sw.Stop();//结束计时
@@ -469,6 +477,7 @@
                objjson.count = 10000;
                objjson.Message = "获取成功";
                objjson.data = ds.Tables[0];
                objjson.list = columnNameList;
                return objjson;
            }
            catch (Exception e)
WebAPI/Controllers/WebAPIController.cs
@@ -769,6 +769,52 @@
                return objjson;
            }
        }
        /// <summary>
        /// 获取物料列表
        /// </summary>
        /// <returns></returns>
        [Route("GetMaterialList_Json")]
        [HttpGet]
        public object GetMaterialList_Json(string Material)
        {
            //sWhere = " Where HStopFlag=0  and HEndFlag=1";
            ////sWhere = " Where HStopFlag=0  and HEndFlag=1  and HUSEORGID = " + DBUtility.ClsPub.HORGANIZATIONSID.ToString();
            //if (Material != "")
            //{
            //    sWhere = sWhere + " and ( HNumber like '%" + Material + "%' or HName like '%" + Material + "%' ) ";
            //}
            try
            {
                ds = webserver.GetMaterialList(Material, ref DBUtility.ClsPub.sErrInfo);
                if (ds == null || ds.Tables[0].Rows.Count <= 0)
                {
                    objjson.code = "0";
                    objjson.count = 0;
                    objjson.Message = "获取失败" + DBUtility.ClsPub.sErrInfo;
                    objjson.data = null;
                    return objjson;
                }
                else
                {
                    objjson.code = "0";
                    objjson.count = 1;
                    objjson.Message = "获取成功!";
                    objjson.data = ds.Tables[0];
                    return objjson;
                }
            }
            catch (Exception ex)
            {
                objjson.code = "0";
                objjson.count = 0;
                objjson.Message = "获取失败" + ex.ToString();
                objjson.data = null;
                return objjson;
            }
        }
        #endregion