看板后端(旧版不需要了)
王 垚
2022-09-06 ef207546d2ccc247f2af1aa74118ee9442655bbc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
using MyWebApi.Models;
using MyWebApi.Tools;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
 
namespace MyWebApi.DLL.DAL
{
    public class LoadDataDAL
    {
        #region【业务逻辑层数据过度,流水线看板图型数据】
        public static List<DataTable> LineData(string lineCode, string LineCodeList)
        {
            List<DataTable> list = new List<DataTable>();
            //执行存储过程@lineCodeList
            // 存储过程名称
            string strProcName = "LineProduct_Radio";
            //创建参数
            SqlParameter[] parameters = { new SqlParameter("@lineCode", lineCode), new SqlParameter("@lineCodeList", LineCodeList) };
            //parameters[0].Direction = ParameterDirection.Output;
            list = DBHelper.ExecuteProductDataList(strProcName, parameters);
            return list;
        }
        #endregion
 
        #region【业务逻辑层数据过度,流水线看板列表数据】
        public static List<LineWork> LineTableData(string LineCode, int startNum, int endNum, out int count)
        {
            //执行存储过程@lineCodeList
            // 存储过程名称
            string strProcName = "kb_LineProduct_Table";
            //创建参数
            SqlParameter[] parameters = { 
                new SqlParameter("@lineCode", LineCode),
                new SqlParameter("@startNum", startNum),
                new SqlParameter("@endNum", endNum),
                new SqlParameter("@total", ParameterDirection.Output)
            };
            parameters[3].Direction = ParameterDirection.Output;
            DataTable dt = DBHelper.ExecuteProductData(strProcName, parameters);
            if (dt != null && dt.Rows.Count > 0)
            {
                count = Convert.ToInt32(parameters[3].Value);
                return dt.AsEnumerable().Select(t => new LineWork(t)).ToList();
            }
            count = Convert.ToInt32(parameters[3].Value);
            return new List<LineWork>();
        }
        #endregion
 
        #region[仓库看板看板码表数据]  
        public static DataTable HouseTopData(string houseCode)
        {
            //执行存储过程@lineCodeList
            // 存储过程名称
            string strProcName = "kb_HouseProduct_Radio";
            //创建参数
            SqlParameter[] parameters = { new SqlParameter("@HouseCode", houseCode) };
            //parameters[0].Direction = ParameterDirection.Output;
            DataTable dt = DBHelper.ExecuteProductData(strProcName, parameters);
            return dt;
        }
        #endregion
 
        #region[仓库看板看板详情数据]
        public static DataTable HouseDataTable(string houseCode)
        {
 
            //执行存储过程@lineCodeList
            // 存储过程名称
            string strProcName = "kb_HouseProduct_Table";
            //创建参数
            SqlParameter[] parameters = { new SqlParameter("@HouseCode", houseCode) };
            //parameters[0].Direction = ParameterDirection.Output;
            DataTable dt = DBHelper.ExecuteProductData(strProcName, parameters);
            return dt;
        }
        #endregion
 
        public static List<CallTopTable> EquipMentData()
        {
            //执行存储过程@lineCodeList
            // 存储过程名称
            string strProcName = "select 20 as HICMOBillNO , '60%' as HNUMBER ,12 as HNAME, 4 HMODEL ,2 as HQTY ,1 as HLEFT  ,1 as HSTATUS";
            //创建参数
            //parameters[0].Direction = ParameterDirection.Output;
            DataTable dt = DBHelper.GetTable(strProcName);
            if (dt != null && dt.Rows.Count > 0)
            {
                return dt.AsEnumerable().Select(t => new CallTopTable(t)).ToList();
            }
            return new List<CallTopTable>();
        }
        
 
        #region[叫料看板上列表数据]
        public static List<CallTopTable> CallTableTopData(string CallHouseCode, int startNum, int endNum, out int count)
        {
            //执行存储过程@lineCodeList
            // 存储过程名称
            string strProcName = "kb_CallProduct_Table1";
            //创建参数
            SqlParameter[] parameters = {
                new SqlParameter("@lineCode", CallHouseCode),
                new SqlParameter("@startNum", startNum),
                new SqlParameter("@endNum", endNum),
                new SqlParameter("@total", ParameterDirection.Output)
            };
            parameters[3].Direction = ParameterDirection.Output;
            DataTable dt = DBHelper.ExecuteProductData(strProcName, parameters);
            if (dt != null && dt.Rows.Count > 0)
            {
                count = Convert.ToInt32(parameters[3].Value);
                return dt.AsEnumerable().Select(t => new CallTopTable(t)).ToList();
            }
            count = Convert.ToInt32(parameters[3].Value);
            return new List<CallTopTable>();
        }
        #endregion
 
        #region[叫料看板下列表数据]
        public static List<CallBottomTable> CallTableBottomData(string CallHouseCode, int startNum, int endNum, out int count)
        {
            List<CallBottomTable> list = new List<CallBottomTable>();
            //执行存储过程@lineCodeList
            // 存储过程名称
            string strProcName = "kb_CallProduct_Table2";
            //创建参数
            SqlParameter[] parameters = {
                new SqlParameter("@lineCode", CallHouseCode),
                new SqlParameter("@startNum", startNum),
                new SqlParameter("@endNum", endNum),
                new SqlParameter("@total", ParameterDirection.Output)
            };
            parameters[3].Direction = ParameterDirection.Output;
            DataTable dt = DBHelper.ExecuteProductData(strProcName, parameters);
            if (dt != null && dt.Rows.Count > 0)
            {
                count = Convert.ToInt32(parameters[3].Value);
                return dt.AsEnumerable().Select(t => new CallBottomTable(t)).ToList();
            }
            count = Convert.ToInt32(parameters[3].Value);
            return new List<CallBottomTable>();
        }
        #endregion
 
        #region[叫料看板图型展示数据]
        public static List<DataTable> CallData(string CallHouseCode)
        {
            List<DataTable> list = new List<DataTable>();
            //执行存储过程@kb_CallProduct_Data
            // 存储过程名称
            string strProcName = "kb_CallProduct_Data";
            //创建参数
            SqlParameter[] parameters = { new SqlParameter("@HouseCode", CallHouseCode) };
            //parameters[0].Direction = ParameterDirection.Output;
            list = DBHelper.ExecuteProductDataList(strProcName, parameters);
            return list;
        }
        #endregion
 
        #region 地图数据看板
        /// <summary>
        /// 地图数据看板
        /// </summary>
        /// <returns></returns>
        public static List<DataTable> MyMap ()
        {
            List<DataTable> list = new List<DataTable>();
            //执行存储过程h_p_Xs_SeOrderQtySort
            // 存储过程名称
            string strProcName = "h_p_Xs_SeOrderQtySort";
            //创建参数
            SqlParameter[] parameters = {};
            list  = DBHelper.ExecuteProductDataList(strProcName, parameters);
           
            return list;
        }
        #endregion
    }
}