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
186
187
188
189
190
191
192
193
194
195
196
197
|
| using HH.WMS.Entitys.Algorithm;
| using HH.WMS.Entitys.Basic;
| using HH.WMS.Entitys.Common;
| using HW.Utility.Data;
| using System;
| using System.Collections.Generic;
| using System.Data;
| using System.Data.Common;
| using System.Linq;
| using System.Text;
|
| namespace HW.DAL
| {
| /// <summary>
| /// 货位表数据处理层
| /// </summary>
| /// <returns></returns>
| /// <history>[HanHe(XDL)] CREATED 2018/06/13</history>
| public class TN_AB_STOCK_LOCATIONDAL:BaseDAL
| {
| #region 获取货位集合
| /// <summary>
| /// 根据表名获取货位集合
| /// </summary>
| /// <param name="tableName">表名</param>
| /// <returns>货位集合</returns>
| /// <history>[HanHe(XDL)] CREATED 2018/06/12</history>
| public List<AutoBomLocationEntity> GetStockLocationList(string tableName)
| {
| string sql = @"SELECT CN_S_STOCK_CODE
| ,CN_S_LOCATION_CODE
| ,CN_N_MAX_STORE_NUM
| ,CN_C_IS_DO_PARTITION
| ,CN_S_NOTE
| ,CN_C_IS_ENABLE
| ,CN_S_ROADWAY
| ,CN_S_ROW
| ,CN_S_COL
| ,CN_S_FLOOR
| ,CN_S_TYPE
| ,CN_N_AGV_LOCATION
| ,CN_S_CREATOR
| ,CN_S_CREATOR_BY
| ,S.CN_T_CREATE
| ,CN_S_MODIFY
| ,CN_S_MODIFY_BY
| ,CN_T_MODIFY
| ,CN_S_POSITION
| ,CN_GUID
| ,CN_S_STATUS
| ,CN_S_LOCATION_STATE
| ,CN_S_LOCATION_NAME
| ,CN_S_AREA_CODE
| FROM TN_AB_B_SYNCH_LOG L LEFT JOIN TN_AB_STOCK_LOCATION S
| ON L.CN_S_GUID=S.CN_GUID
| WHERE L.CN_S_TABLE_NAME='" + tableName + "' AND L.CN_N_OP_FLAG IN (1,2)";
| DbCommand cmd = DataAccess.GetSqlStringCommand(sql);
| List<AutoBomLocationEntity> list = DataAccessExtensive.ExecuteListEntity<AutoBomLocationEntity>(this.DataAccess, cmd, SetEntity);
| return list;
| }
|
| /// <summary>
| /// 设置实体的各列
| /// <summary>
| private void SetEntity(AutoBomLocationEntity entity, IDataReader reader)
| {
| SetEntityUti(entity, "CN_S_STOCK_CODE", "CN_S_STOCK_CODE", reader);
| SetEntityUti(entity, "CN_S_LOCATION_CODE", "CN_S_LOCATION_CODE", reader);
| SetEntityUti(entity, "CN_N_MAX_STORE_NUM", "CN_N_MAX_STORE_NUM", reader);
| SetEntityUti(entity, "CN_C_IS_DO_PARTITION", "CN_C_IS_DO_PARTITION", reader);
| SetEntityUti(entity, "CN_S_NOTE", "CN_S_NOTE", reader);
| SetEntityUti(entity, "CN_C_IS_ENABLE", "CN_C_IS_ENABLE", reader);
| SetEntityUti(entity, "CN_S_ROADWAY", "CN_S_ROADWAY", reader);
| SetEntityUti(entity, "CN_S_ROW", "CN_S_ROW", reader);
| SetEntityUti(entity, "CN_S_COL", "CN_S_COL", reader);
| SetEntityUti(entity, "CN_S_FLOOR", "CN_S_FLOOR", reader);
| SetEntityUti(entity, "CN_S_TYPE", "CN_S_TYPE", reader);
| SetEntityUti(entity, "CN_N_AGV_LOCATION", "CN_N_AGV_LOCATION", reader);
| SetEntityUti(entity, "CN_S_CREATOR", "CN_S_CREATOR", reader);
| SetEntityUti(entity, "CN_S_CREATOR_BY", "CN_S_CREATOR_BY", reader);
| SetEntityUti(entity, "CN_T_CREATE", "CN_T_CREATE", reader);
| SetEntityUti(entity, "CN_S_MODIFY", "CN_S_MODIFY", reader);
| SetEntityUti(entity, "CN_S_MODIFY_BY", "CN_S_MODIFY_BY", reader);
| SetEntityUti(entity, "CN_T_MODIFY", "CN_T_MODIFY", reader);
| SetEntityUti(entity, "CN_S_POSITION", "CN_S_POSITION", reader);
| SetEntityUti(entity, "CN_GUID", "CN_GUID", reader);
| SetEntityUti(entity, "CN_S_STATUS", "CN_S_STATUS", reader);
| SetEntityUti(entity, "CN_S_LOCATION_STATE", "CN_S_LOCATION_STATE", reader);
| SetEntityUti(entity, "CN_S_LOCATION_NAME", "CN_S_LOCATION_NAME", reader);
| SetEntityUti(entity, "CN_S_AREA_CODE", "CN_S_AREA_CODE", reader);
| }
| #endregion
|
|
| /// <summary>
| /// 获得货位集合
| /// </summary>
| /// <param name="strWhere"></param>
| /// <param name="orderby"></param>
| /// <returns></returns>
| /// <history>[HanHe(XDL)] CREATED 2018/06/28</history>
| public List<AutoBomLocationEntity> GetLocationList(string strWhere, string OrderBy)
| {
| List<AutoBomLocationEntity> list = new List<AutoBomLocationEntity>();
| string strSql = @"SELECT CN_S_STOCK_CODE
| ,CN_S_LOCATION_CODE
| ,CN_N_MAX_STORE_NUM
| ,CN_C_IS_DO_PARTITION
| ,CN_S_NOTE
| ,CN_C_IS_ENABLE
| ,CN_S_ROADWAY
| ,CN_S_ROW
| ,CN_S_COL
| ,CN_S_FLOOR
| ,CN_S_TYPE
| ,CN_N_AGV_LOCATION
| ,CN_S_CREATOR
| ,CN_S_CREATOR_BY
| ,CN_T_CREATE
| ,CN_S_MODIFY
| ,CN_S_MODIFY_BY
| ,CN_T_MODIFY
| ,CN_S_POSITION
| ,CN_GUID
| ,CN_S_STATUS
| ,CN_S_AREA_CODE
| ,CN_N_SYNC
| ,CN_S_LOCATION_NAME
| ,CN_S_LOCATION_STATE FROM TN_AB_STOCK_LOCATION WHERE 1=1 ";
| if (!string.IsNullOrEmpty(strWhere))
| {
| strSql += " " + strWhere;
| }
| if (!string.IsNullOrEmpty(OrderBy))
| {
| strSql += " " + OrderBy;
| }
|
| try
| {
| DbCommand cmd = DataAccess.GetSqlStringCommand(strSql);
| list = DataAccessExtensive.ExecuteListEntity<AutoBomLocationEntity>(this.DataAccess, cmd, SetLocationEntity);
| return list;
| }
| catch (Exception ex)
| {
| return list;
| }
|
| }
| /// <summary>
| /// 设置实体的各列
| /// <summary>
| private void SetLocationEntity(AutoBomLocationEntity entity, IDataReader reader)
| {
| SetEntityUti(entity, "CN_S_STOCK_CODE", "CN_S_STOCK_CODE", reader);
| SetEntityUti(entity, "CN_S_LOCATION_CODE", "CN_S_LOCATION_CODE", reader);
| SetEntityUti(entity, "CN_N_MAX_STORE_NUM", "CN_N_MAX_STORE_NUM", reader);
| SetEntityUti(entity, "CN_C_IS_DO_PARTITION", "CN_C_IS_DO_PARTITION", reader);
| SetEntityUti(entity, "CN_S_NOTE", "CN_S_NOTE", reader);
| SetEntityUti(entity, "CN_C_IS_ENABLE", "CN_C_IS_ENABLE", reader);
| SetEntityUti(entity, "CN_S_ROADWAY", "CN_S_ROADWAY", reader);
| SetEntityUti(entity, "CN_S_ROW", "CN_S_ROW", reader);
| SetEntityUti(entity, "CN_S_COL", "CN_S_COL", reader);
| SetEntityUti(entity, "CN_S_FLOOR", "CN_S_FLOOR", reader);
| SetEntityUti(entity, "CN_S_TYPE", "CN_S_TYPE", reader);
| SetEntityUti(entity, "CN_N_AGV_LOCATION", "CN_N_AGV_LOCATION", reader);
| SetEntityUti(entity, "CN_S_CREATOR", "CN_S_CREATOR", reader);
| SetEntityUti(entity, "CN_S_CREATOR_BY", "CN_S_CREATOR_BY", reader);
| SetEntityUti(entity, "CN_T_CREATE", "CN_T_CREATE", reader);
| SetEntityUti(entity, "CN_S_MODIFY", "CN_S_MODIFY", reader);
| SetEntityUti(entity, "CN_S_MODIFY_BY", "CN_S_MODIFY_BY", reader);
| SetEntityUti(entity, "CN_T_MODIFY", "CN_T_MODIFY", reader);
| SetEntityUti(entity, "CN_S_POSITION", "CN_S_POSITION", reader);
| SetEntityUti(entity, "CN_GUID", "CN_GUID", reader);
| SetEntityUti(entity, "CN_S_STATUS", "CN_S_STATUS", reader);
| SetEntityUti(entity, "CN_S_LOCATION_STATE", "CN_S_LOCATION_STATE", reader);
| SetEntityUti(entity, "CN_S_LOCATION_NAME", "CN_S_LOCATION_NAME", reader);
| SetEntityUti(entity, "CN_S_AREA_CODE", "CN_S_AREA_CODE", reader);
| SetEntityUti(entity, "CN_N_SYNC", "CN_N_SYNC", reader);
| }
|
| /// <summary>
| /// 修改货位同步状态
| /// </summary>
| /// <param name="obj"></param>
| /// <returns></returns>
| /// <history>[HanHe(XDL)] CREATED 2018/06/28</history>
| public SqlExecuteResult UpdateLocationSync(string Where, string Set)
| {
| string sql = "UPDATE TN_AB_STOCK_LOCATION SET " + Set + " " + Where;
| DbCommand cmd = DataAccess.GetSqlStringCommand(sql);
| return ExecuteCommand(cmd, null);
| }
| }
| }
|
|