Commit 6b8998e324108260c2bebc90dc29f5f7abf92702
Merge remote-tracking branch 'origin/develop' into develop
# Conflicts: # src/main/java/com/huaheng/pc/receipt/receiptContainerHeader/service/ReceiptContainerHeaderServiceImpl.java # src/main/java/com/huaheng/pc/receipt/receiving/service/ReceivingService.java
Showing
24 changed files
with
631 additions
and
264 deletions
src/main/java/com/huaheng/common/constant/QuantityConstant.java
0 → 100644
1 | +package com.huaheng.common.constant; | |
2 | + | |
3 | +/** | |
4 | + * 数字自定义常量 | |
5 | + * | |
6 | + * @author ricard | |
7 | + */ | |
8 | +public class QuantityConstant { | |
9 | + /** | |
10 | + * 1、入库单状态 | |
11 | + * 2、出库单状态 | |
12 | + * 3、单据上传状态 | |
13 | + * 4、入库组盘状态 | |
14 | + * 5、出库组盘状态 | |
15 | + * 6、任务类型 | |
16 | + * 7、任务状态 | |
17 | + * 8、波次状态 | |
18 | + * 9、质检状态 | |
19 | + * 10、盘点状态 | |
20 | + * 11、库存交易类型 | |
21 | + * 12、调整单状态 | |
22 | + * 13、任务内部类型 | |
23 | + * 14、质检单类型 | |
24 | + */ | |
25 | + | |
26 | + //1、入库单状态 | |
27 | + | |
28 | + //新建 | |
29 | + public static final Integer RECEIPT_HEADER_BUILD = 0; | |
30 | + | |
31 | + //等待审核 | |
32 | + public static final Integer RECEIPT_HEADER_MODERATED = 5; | |
33 | + | |
34 | + //驳回 | |
35 | + public static final Integer RECEIPT_HEADER_TURNDOWN = 10; | |
36 | + | |
37 | + //作废 | |
38 | + public static final Integer RECEIPT_HEADER_OBSOLETE = 20; | |
39 | + | |
40 | + //订单池 | |
41 | + public static final Integer RECEIPT_HEADER_POOL = 100; | |
42 | + | |
43 | + //入库预约 | |
44 | + public static final Integer RECEIPT_HEADER_RESERVATION = 120; | |
45 | + | |
46 | + //入库到货 | |
47 | + public static final Integer RECEIPT_HEADER_ARRIVAL = 150; | |
48 | + | |
49 | + //入库质检 | |
50 | + public static final Integer RECEIPT_HEADER_CHECK = 180; | |
51 | + | |
52 | + //收货 | |
53 | + public static final Integer RECEIPT_HEADER_RECEIVING = 200; | |
54 | + | |
55 | + //定位 | |
56 | + public static final Integer RECEIPT_HEADER_POSITION = 240; | |
57 | + | |
58 | + //等待上架 | |
59 | + public static final Integer RECEIPT_HEADER_WAIT = 280; | |
60 | + | |
61 | + //上架 | |
62 | + public static final Integer RECEIPT_HEADER_SHELF = 300; | |
63 | + | |
64 | + //过账 | |
65 | + public static final Integer RECEIPT_HEADER_POSTING = 800; | |
66 | + | |
67 | + //回传 | |
68 | + public static final Integer RECEIPT_HEADER_RETURN = 900; | |
69 | + | |
70 | + | |
71 | + | |
72 | + | |
73 | + | |
74 | + //2、出库单状态 | |
75 | + | |
76 | + //新建 | |
77 | + public static final Integer SHIPMENT_HEADER_BUILD = 0; | |
78 | + | |
79 | + //订单池 | |
80 | + public static final Integer SHIPMENT_HEADER_POOL = 100; | |
81 | + | |
82 | + //出库预约 | |
83 | + public static final Integer SHIPMENT_HEADER_RESERVATION = 120; | |
84 | + | |
85 | + //订单分析 | |
86 | + public static final Integer SHIPMENT_HEADER_ANALYSIS = 150; | |
87 | + | |
88 | + //波次 | |
89 | + public static final Integer SHIPMENT_HEADER_WAVE = 200; | |
90 | + | |
91 | + //出库组盘 | |
92 | + public static final Integer SHIPMENT_HEADER_GROUPDISK = 300; | |
93 | + | |
94 | + //拣货完成 | |
95 | + public static final Integer SHIPMENT_HEADER_COMPLETED = 500; | |
96 | + | |
97 | + //发运 | |
98 | + public static final Integer SHIPMENT_HEADER_SHIPPING = 800; | |
99 | + | |
100 | + //回传 | |
101 | + public static final Integer SHIPMENT_HEADER_RETURN = 900; | |
102 | + | |
103 | + | |
104 | + | |
105 | + | |
106 | + //3、单据上传状态 | |
107 | + | |
108 | + //未上传 | |
109 | + public static final Integer UPLOAD_NOT = 0; | |
110 | + | |
111 | + //上传失败 | |
112 | + public static final Integer UPLOAD_FAILED = 10; | |
113 | + | |
114 | + //上架完成 | |
115 | + public static final Integer UPLOAD_SUCCESS = 20; | |
116 | + | |
117 | + | |
118 | + | |
119 | + | |
120 | + //4、入库组盘状态 | |
121 | + | |
122 | + //新建 | |
123 | + public static final Integer RECEIPT_CONTAINER_BUILD = 0; | |
124 | + | |
125 | + //生成任务 | |
126 | + public static final Integer RECEIPT_CONTAINER_TASK= 10; | |
127 | + | |
128 | + //上架完成 | |
129 | + public static final Integer RECEIPT_CONTAINER_FINISHED = 20; | |
130 | + | |
131 | + //复核完成 | |
132 | + public static final Integer RECEIPT_CONTAINER_REVIEWSUCCESS = 30; | |
133 | + | |
134 | + | |
135 | + | |
136 | + //5、出库组盘状态 | |
137 | + | |
138 | + //新建 | |
139 | + public static final Integer SHIPMENT_CONTAINER_BUILD = 0; | |
140 | + | |
141 | + //生成任务 | |
142 | + public static final Integer SHIPMENT_CONTAINER_TASK= 10; | |
143 | + | |
144 | + //拣货完成 | |
145 | + public static final Integer SHIPMENT_CONTAINER_FINISHED = 20; | |
146 | + | |
147 | + //复核完成 | |
148 | + public static final Integer SHIPMENT_CONTAINER_REVIEWSUCCESS = 30; | |
149 | + | |
150 | + | |
151 | + | |
152 | + //6、任务类型 | |
153 | + | |
154 | + //整盘入库 | |
155 | + public static final Integer TASK_TYPE_WHOLERECEIPT = 100; | |
156 | + | |
157 | + //补充入库 | |
158 | + public static final Integer TASK_TYPE_SUPPLEMENTRECEIPT = 200; | |
159 | + | |
160 | + //整盘出库 | |
161 | + public static final Integer TASK_TYPE_WHOLESHIPMENT = 300; | |
162 | + | |
163 | + //分拣出库 | |
164 | + public static final Integer TASK_TYPE_SORTINGSHIPMENT = 400; | |
165 | + | |
166 | + //空容器入库 | |
167 | + public static final Integer TASK_TYPE_EMPTYRECEIPT = 500; | |
168 | + | |
169 | + //空容器出库 | |
170 | + public static final Integer TASK_TYPE_EMPTYSHIPMENT = 600; | |
171 | + | |
172 | + //盘点 | |
173 | + public static final Integer TASK_TYPE_CYCLECOUNT = 700; | |
174 | + | |
175 | + //移库 | |
176 | + public static final Integer TASK_TYPE_TRANSFER = 800; | |
177 | + | |
178 | + //出库查看 | |
179 | + public static final Integer TASK_TYPE_VIEW = 900; | |
180 | + | |
181 | + | |
182 | + | |
183 | + //7、任务状态 | |
184 | + | |
185 | + //生成任务 | |
186 | + public static final Integer TASK_STATUS_BUILD = 1; | |
187 | + | |
188 | + //下达任务 | |
189 | + public static final Integer TASK_STATUS_RELEASE = 10; | |
190 | + | |
191 | + //开始执行 | |
192 | + public static final Integer TASK_STATUS_RUNNING = 20; | |
193 | + | |
194 | + //任务完成 | |
195 | + public static final Integer TASK_STATUS_COMPLETED = 100; | |
196 | + | |
197 | + | |
198 | + //8、波次状态 | |
199 | + | |
200 | + //新建波次 | |
201 | + public static final Integer WAVE_STATUS_BUILD = 0; | |
202 | + | |
203 | + //开始波次 | |
204 | + public static final Integer WAVE_STATUS_START = 100; | |
205 | + | |
206 | + //剔除不符合条件订单 | |
207 | + public static final Integer WAVE_STATUS_EXCLUDE = 150; | |
208 | + | |
209 | + //指定分配规则 | |
210 | + public static final Integer WAVE_STATUS_ASSIGN = 200; | |
211 | + | |
212 | + //分配库存 | |
213 | + public static final Integer WAVE_STATUS_ALLOCATION = 300; | |
214 | + | |
215 | + //订单分组 | |
216 | + public static final Integer WAVE_STATUS_GROUPING = 400; | |
217 | + | |
218 | + //创建货箱 | |
219 | + public static final Integer WAVE_STATUS_CREATECONTAINER = 500; | |
220 | + | |
221 | + //生成任务 | |
222 | + public static final Integer WAVE_STATUS_BUILDTASK = 600; | |
223 | + | |
224 | + //结束波次 | |
225 | + public static final Integer WAVE_STATUS_END = 900; | |
226 | + | |
227 | + //失败 | |
228 | + public static final Integer WAVE_STATUS_FAILED = 999; | |
229 | + | |
230 | + | |
231 | + | |
232 | + //9、质检状态 | |
233 | + | |
234 | + //新建 | |
235 | + public static final Integer CHECK_STATUS_BUILD = 0; | |
236 | + | |
237 | + //质检中 | |
238 | + public static final Integer CHECK_STATUS_IN = 10; | |
239 | + | |
240 | + //质检完成 | |
241 | + public static final Integer CHECK_STATUS_COMPLETED = 20; | |
242 | + | |
243 | + | |
244 | + | |
245 | + //10、盘点状态 | |
246 | + | |
247 | + //新建 | |
248 | + public static final Integer CYCLECOUNT_STATUS_BUILD = 1; | |
249 | + | |
250 | + //盘点任务生成 | |
251 | + public static final Integer CYCLECOUNT_STATUS_BUILDTASK = 5; | |
252 | + | |
253 | + //执行中 | |
254 | + public static final Integer CYCLECOUNT_STATUS_EXECUTING = 10; | |
255 | + | |
256 | + //已登记 | |
257 | + public static final Integer CYCLECOUNT_STATUS_REGISTERED= 15; | |
258 | + | |
259 | + //审核 | |
260 | + public static final Integer CYCLECOUNT_STATUS_REVIEW = 30; | |
261 | + | |
262 | + //关闭 | |
263 | + public static final Integer CYCLECOUNT_STATUS_CLOSE = 99; | |
264 | + | |
265 | + //盘点完成 | |
266 | + public static final Integer CYCLECOUNT_STATUS_COMPLETED = 100; | |
267 | + | |
268 | + //已生成调整单 | |
269 | + public static final Integer CYCLECOUNT_STATUS_GENERATEADJUST = 101; | |
270 | + | |
271 | + | |
272 | + | |
273 | + //11、库存交易类型 | |
274 | + | |
275 | + //入库 | |
276 | + public static final Integer INVENTORY_TRANSACTION_RECEIPT = 10; | |
277 | + | |
278 | + //出库 | |
279 | + public static final Integer INVENTORY_TRANSACTION_SHIPMENT = 20; | |
280 | + | |
281 | + //调整入 | |
282 | + public static final Integer INVENTORY_TRANSACTION_ADJUSTINTO = 30; | |
283 | + | |
284 | + //调整出 | |
285 | + public static final Integer INVENTORY_TRANSACTION_ADJUSTOUT = 40; | |
286 | + | |
287 | + //调整属性 | |
288 | + public static final Integer INVENTORY_TRANSACTION_ADJUSTPROPERTIES = 50; | |
289 | + | |
290 | + //盘点 | |
291 | + public static final Integer INVENTORY_TRANSACTION_CYCLECOUNT = 60; | |
292 | + | |
293 | + //移库入 | |
294 | + public static final Integer INVENTORY_TRANSACTION_TRANSFERINTO = 70; | |
295 | + | |
296 | + //移库出 | |
297 | + public static final Integer INVENTORY_TRANSACTION_TRANSFEROUT = 80; | |
298 | + | |
299 | + | |
300 | + //12、调整单状态 | |
301 | + | |
302 | + //未批准 | |
303 | + public static final Integer ADJUST_STATUS_NOAPPROVED = 0; | |
304 | + | |
305 | + //已批准 | |
306 | + public static final Integer ADJUST_STATUS_APPROVED = 1; | |
307 | + | |
308 | + //待调整 | |
309 | + public static final Integer ADJUST_STATUS_WAIT = 2; | |
310 | + | |
311 | + //已调整 | |
312 | + public static final Integer ADJUST_STATUS_STOP = 3; | |
313 | + | |
314 | + | |
315 | + //13、任务内部类型 | |
316 | + | |
317 | + //上架任务 | |
318 | + public static final Integer TASK_INTENERTYPE_SHELF = 100; | |
319 | + | |
320 | + //拣货任务 | |
321 | + public static final Integer TASK_INTENERTYPE_PICKING = 200; | |
322 | + | |
323 | + //补货任务 | |
324 | + public static final Integer TASK_INTENERTYPE_SUPPLEMENT = 300; | |
325 | + | |
326 | + //工作任务 | |
327 | + public static final Integer TASK_INTENERTYPE_WORK = 400; | |
328 | + | |
329 | + //质检任务 | |
330 | + public static final Integer TASK_INTENERTYPE_CHECK = 500; | |
331 | + | |
332 | + //移库任务 | |
333 | + public static final Integer TASK_INTENERTYPE_TRANSFER = 600; | |
334 | + | |
335 | + //盘点任务 | |
336 | + public static final Integer TASK_INTENERTYPE_CYCLECOUNT = 700; | |
337 | + | |
338 | + | |
339 | + | |
340 | + //13、质检单类型 | |
341 | + | |
342 | + //入库质检 | |
343 | + public static final Integer CHECK_TYPE_RECEIPT = 100; | |
344 | + | |
345 | + //在库全检 | |
346 | + public static final Integer CHECK_TYPE_FULL = 200; | |
347 | + | |
348 | + //在库抽检 | |
349 | + public static final Integer CHECK_TYPE_SELECT = 300; | |
350 | + | |
351 | + | |
352 | +} | |
... | ... |
src/main/java/com/huaheng/pc/check/checkDetail/service/CheckDetailService.java
... | ... | @@ -2,6 +2,7 @@ package com.huaheng.pc.check.checkDetail.service; |
2 | 2 | |
3 | 3 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
4 | 4 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
5 | +import com.huaheng.common.constant.QuantityConstant; | |
5 | 6 | import com.huaheng.common.exception.service.ServiceException; |
6 | 7 | import com.huaheng.common.support.Convert; |
7 | 8 | import com.huaheng.common.utils.security.ShiroUtils; |
... | ... | @@ -58,7 +59,7 @@ public class CheckDetailService extends ServiceImpl<CheckDetailMapper, CheckDeta |
58 | 59 | checkDetail.setCheckBy(ShiroUtils.getLoginName()); |
59 | 60 | checkDetail.setCheckAt(new Date()); |
60 | 61 | |
61 | - checkDetail.setStatus("20"); | |
62 | + checkDetail.setStatus((QuantityConstant.CHECK_STATUS_COMPLETED).toString()); | |
62 | 63 | checkDetail.setLastUpdated(new Date()); |
63 | 64 | checkDetail.setLastUpdatedBy(ShiroUtils.getLoginName()); |
64 | 65 | if (!this.updateById(checkDetail)){ |
... | ... | @@ -71,7 +72,7 @@ public class CheckDetailService extends ServiceImpl<CheckDetailMapper, CheckDeta |
71 | 72 | //判断头表下所有明细是否全部完成 |
72 | 73 | boolean result = false; |
73 | 74 | for (CheckDetail checkDetail1 : checkDetails){ |
74 | - if ("20".equals(checkDetail1.getStatus())){ | |
75 | + if ((QuantityConstant.CHECK_STATUS_COMPLETED).toString().equals(checkDetail1.getStatus())){ | |
75 | 76 | result = true; |
76 | 77 | } else { |
77 | 78 | result = false; |
... | ... | @@ -80,7 +81,7 @@ public class CheckDetailService extends ServiceImpl<CheckDetailMapper, CheckDeta |
80 | 81 | if (result){ |
81 | 82 | CheckHeader checkHeader = new CheckHeader(); |
82 | 83 | checkHeader.setId(checkDetail.getCheckHeaderId()); |
83 | - checkHeader.setStatus("30"); | |
84 | + checkHeader.setStatus((QuantityConstant.CHECK_STATUS_COMPLETED).toString()); | |
84 | 85 | if ( !checkHeaderService.updateById(checkHeader)){ |
85 | 86 | throw new ServiceException("质检头表更新失败"); |
86 | 87 | } |
... | ... |
src/main/java/com/huaheng/pc/check/checkingRegister/controller/CheckingRegisterController.java
... | ... | @@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; |
5 | 5 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
6 | 6 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
7 | 7 | import com.fasterxml.jackson.databind.ser.Serializers; |
8 | +import com.huaheng.common.constant.QuantityConstant; | |
8 | 9 | import com.huaheng.common.support.Convert; |
9 | 10 | import com.huaheng.common.utils.StringUtils; |
10 | 11 | import com.huaheng.common.utils.security.ShiroUtils; |
... | ... | @@ -134,7 +135,7 @@ public class CheckingRegisterController extends BaseController { |
134 | 135 | List emptyList = checkingRegisterService.emptyList(checkingRegister.getCheckDetailId()); |
135 | 136 | return getMpDataTable(emptyList, Long.valueOf(emptyList.size())); |
136 | 137 | } |
137 | - if (!"20".equals(checkDetail.getStatus())){ | |
138 | + if (!(QuantityConstant.CHECK_STATUS_COMPLETED).toString().equals(checkDetail.getStatus())){ | |
138 | 139 | //未完成质检list |
139 | 140 | List notCompleteList = checkingRegisterService.notCompleteList(checkingRegister.getCheckDetailId()); |
140 | 141 | return getMpDataTable(notCompleteList, Long.valueOf(notCompleteList.size())); |
... | ... | @@ -149,7 +150,7 @@ public class CheckingRegisterController extends BaseController { |
149 | 150 | List emptyList = checkingRegisterService.emptyList(checkingRegister.getCheckDetailId()); |
150 | 151 | return getMpDataTable(emptyList, Long.valueOf(emptyList.size())); |
151 | 152 | } |
152 | - if (!"20".equals(checkDetail.getStatus())){ | |
153 | + if (!(QuantityConstant.CHECK_STATUS_COMPLETED).toString().equals(checkDetail.getStatus())){ | |
153 | 154 | //未完成质检list |
154 | 155 | List notCompleteList = checkingRegisterService.notCompleteList(checkingRegister.getCheckDetailId()); |
155 | 156 | return getMpDataTable(notCompleteList, Long.valueOf(notCompleteList.size())); |
... | ... |
src/main/java/com/huaheng/pc/config/cycleCountPreference/controller/cycleCountPreferenceController.java
... | ... | @@ -44,6 +44,8 @@ public class cycleCountPreferenceController extends BaseController { |
44 | 44 | |
45 | 45 | private String prefix = "config/cycleCountPreference"; |
46 | 46 | |
47 | + | |
48 | + @RequiresPermissions("config:cycleCountPreference:view") | |
47 | 49 | @GetMapping() |
48 | 50 | public String cyclecountHeader() |
49 | 51 | { |
... | ... | @@ -53,7 +55,7 @@ public class cycleCountPreferenceController extends BaseController { |
53 | 55 | /** |
54 | 56 | * 查询盘点单主列表 |
55 | 57 | */ |
56 | - //@RequiresPermissions("inventory:cycleCount:list") | |
58 | + @RequiresPermissions("config:cycleCountPreference:list") | |
57 | 59 | @PostMapping("/list") |
58 | 60 | @Log(title = "配置-库存配置",operating = "盘点首选项", action = BusinessType.GRANT) |
59 | 61 | @ResponseBody |
... | ... | @@ -102,7 +104,7 @@ public class cycleCountPreferenceController extends BaseController { |
102 | 104 | /** |
103 | 105 | * 新增保存盘点首选项 |
104 | 106 | */ |
105 | - //@RequiresPermissions("config:receiptPreference:add") | |
107 | + @RequiresPermissions("config:cycleCountPreference:add") | |
106 | 108 | @Log(title = "配置-盘点首选项", operating = "新增盘点首选项", action = BusinessType.INSERT) |
107 | 109 | @PostMapping("/addSave") |
108 | 110 | @ResponseBody |
... | ... | @@ -125,7 +127,7 @@ public class cycleCountPreferenceController extends BaseController { |
125 | 127 | /** |
126 | 128 | * 修改保存盘点首选项 |
127 | 129 | */ |
128 | - //@RequiresPermissions("config:receiptPreference:edit") | |
130 | + @RequiresPermissions("config:cycleCountPreference:edit") | |
129 | 131 | @Log(title = "通用-盘点首选项", operating = "修改盘点首选项", action = BusinessType.UPDATE) |
130 | 132 | @PostMapping("/edit") |
131 | 133 | @ResponseBody |
... | ... | @@ -151,7 +153,7 @@ public class cycleCountPreferenceController extends BaseController { |
151 | 153 | /** |
152 | 154 | * 删除盘点首选项 |
153 | 155 | */ |
154 | - //@RequiresPermissions("config:receiptPreference:remove") | |
156 | + @RequiresPermissions("config:cycleCountPreference:remove") | |
155 | 157 | @Log(title = "通用-盘点首选项", operating = "删除盘点首选项", action = BusinessType.DELETE) |
156 | 158 | @PostMapping( "/remove") |
157 | 159 | @ResponseBody |
... | ... |
src/main/java/com/huaheng/pc/inventory/adjustDetail/service/AdjustDetailServiceImpl.java
... | ... | @@ -2,6 +2,7 @@ package com.huaheng.pc.inventory.adjustDetail.service; |
2 | 2 | |
3 | 3 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
4 | 4 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
5 | +import com.huaheng.common.constant.QuantityConstant; | |
5 | 6 | import com.huaheng.common.utils.StringUtils; |
6 | 7 | import com.huaheng.common.utils.security.ShiroUtils; |
7 | 8 | import com.huaheng.framework.web.domain.AjaxResult; |
... | ... | @@ -89,6 +90,11 @@ public class AdjustDetailServiceImpl extends ServiceImpl<AdjustDetailMapper, Adj |
89 | 90 | return AjaxResult.error("没有该条库存明细"); |
90 | 91 | } |
91 | 92 | } |
93 | + //明细单据的上层单编码需要和主单一直,主单空值则不判断 | |
94 | + if(StringUtils.isNotEmpty(adjustHeader.getCycleCountCode()) || StringUtils.isNotEmpty(adjustHeader.getCheckCode())){ | |
95 | + adjustDetail.setCycleCountCode(adjustHeader.getCycleCountCode()); | |
96 | + adjustDetail.setCheckCode(adjustHeader.getCheckCode()); | |
97 | + } | |
92 | 98 | //检查盘点单 |
93 | 99 | if(StringUtils.isNotEmpty(adjustDetail.getCycleCountCode())){ |
94 | 100 | CycleCountDetail cycleCountDetail = cycleCountDetailService.getById(adjustDetail.getCheckDetailId()); |
... | ... | @@ -248,7 +254,7 @@ public class AdjustDetailServiceImpl extends ServiceImpl<AdjustDetailMapper, Adj |
248 | 254 | inventoryTransaction.setCompanyCode(inventoryDetail.getCompanyCode()); |
249 | 255 | inventoryTransaction.setLocationCode(inventoryDetail.getLocationCode()); |
250 | 256 | inventoryTransaction.setContainerCode(inventoryDetail.getContainerCode()); |
251 | - inventoryTransaction.setTransactionType(40); | |
257 | + inventoryTransaction.setTransactionType(QuantityConstant.INVENTORY_TRANSACTION_ADJUSTOUT ); | |
252 | 258 | inventoryTransaction.setMaterialCode(inventoryDetail.getMaterialCode()); |
253 | 259 | inventoryTransaction.setMaterialName(inventoryDetail.getMaterialName()); |
254 | 260 | inventoryTransaction.setMaterialSpec(inventoryDetail.getMaterialSpec()); |
... | ... | @@ -308,7 +314,7 @@ public class AdjustDetailServiceImpl extends ServiceImpl<AdjustDetailMapper, Adj |
308 | 314 | inventoryTransaction.setCompanyCode(inventoryDetail.getCompanyCode()); |
309 | 315 | inventoryTransaction.setLocationCode(inventoryDetail.getLocationCode()); |
310 | 316 | inventoryTransaction.setContainerCode(inventoryDetail.getContainerCode()); |
311 | - inventoryTransaction.setTransactionType(40); | |
317 | + inventoryTransaction.setTransactionType(QuantityConstant.INVENTORY_TRANSACTION_ADJUSTOUT ); | |
312 | 318 | inventoryTransaction.setMaterialCode(inventoryDetail.getMaterialCode()); |
313 | 319 | inventoryTransaction.setMaterialName(inventoryDetail.getMaterialName()); |
314 | 320 | inventoryTransaction.setMaterialSpec(inventoryDetail.getMaterialSpec()); |
... | ... | @@ -341,7 +347,7 @@ public class AdjustDetailServiceImpl extends ServiceImpl<AdjustDetailMapper, Adj |
341 | 347 | inventoryTransaction2.setCompanyCode(inventoryDetail.getCompanyCode()); |
342 | 348 | inventoryTransaction2.setLocationCode(inventoryDetail.getLocationCode()); |
343 | 349 | inventoryTransaction2.setContainerCode(inventoryDetail.getContainerCode()); |
344 | - inventoryTransaction2.setTransactionType(30); | |
350 | + inventoryTransaction2.setTransactionType(QuantityConstant.INVENTORY_TRANSACTION_ADJUSTINTO); | |
345 | 351 | inventoryTransaction2.setMaterialCode(inventoryDetail.getMaterialCode()); |
346 | 352 | inventoryTransaction2.setMaterialName(inventoryDetail.getMaterialName()); |
347 | 353 | inventoryTransaction2.setMaterialSpec(inventoryDetail.getMaterialSpec()); |
... | ... | @@ -450,7 +456,7 @@ public class AdjustDetailServiceImpl extends ServiceImpl<AdjustDetailMapper, Adj |
450 | 456 | inventoryTransaction.setCompanyCode(inventoryDetail.getCompanyCode()); |
451 | 457 | inventoryTransaction.setLocationCode(inventoryDetail.getLocationCode()); |
452 | 458 | inventoryTransaction.setContainerCode(inventoryDetail.getContainerCode()); |
453 | - inventoryTransaction.setTransactionType(30); | |
459 | + inventoryTransaction.setTransactionType(QuantityConstant.INVENTORY_TRANSACTION_ADJUSTINTO); | |
454 | 460 | inventoryTransaction.setMaterialCode(inventoryDetail.getMaterialCode()); |
455 | 461 | inventoryTransaction.setMaterialName(inventoryDetail.getMaterialName()); |
456 | 462 | inventoryTransaction.setMaterialSpec(inventoryDetail.getMaterialSpec()); |
... | ... |
src/main/java/com/huaheng/pc/inventory/cycleCountDetail/service/CycleCountDetailServiceImpl.java
... | ... | @@ -3,6 +3,7 @@ package com.huaheng.pc.inventory.cycleCountDetail.service; |
3 | 3 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
4 | 4 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
5 | 5 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
6 | +import com.huaheng.common.constant.QuantityConstant; | |
6 | 7 | import com.huaheng.common.exception.service.ServiceException; |
7 | 8 | import com.huaheng.common.utils.StringUtils; |
8 | 9 | import com.huaheng.common.utils.security.ShiroUtils; |
... | ... | @@ -75,7 +76,7 @@ public class CycleCountDetailServiceImpl extends ServiceImpl<CycleCountDetailMap |
75 | 76 | cycleCountHeader.setCompanyCode(cycleCountDetail.getCompanyCode()); |
76 | 77 | LambdaQueryWrapper<CycleCountHeader> lambdaQueryWrapper = Wrappers.lambdaQuery(cycleCountHeader); |
77 | 78 | cycleCountHeader = cycleCountHeaderService.getOne(lambdaQueryWrapper); |
78 | - if(cycleCountHeader.getStatusCyc() < 10 ){ | |
79 | + if(cycleCountHeader.getStatusCyc() < QuantityConstant.CYCLECOUNT_STATUS_EXECUTING){ | |
79 | 80 | //主单状态小于10则修改 |
80 | 81 | cycleCountHeader.setStatusCyc(status); //主单状态 |
81 | 82 | cycleCountHeaderService.saveOrUpdate(cycleCountHeader); |
... | ... | @@ -103,7 +104,7 @@ public class CycleCountDetailServiceImpl extends ServiceImpl<CycleCountDetailMap |
103 | 104 | if(cyclecountHeader==null){ |
104 | 105 | return AjaxResult.error("盘点主单据不存在"); |
105 | 106 | } |
106 | - if(cyclecountHeader.getStatusCyc() > 1){ | |
107 | + if(cyclecountHeader.getStatusCyc() > QuantityConstant.CYCLECOUNT_STATUS_BUILD){ | |
107 | 108 | return AjaxResult.error("盘点单非新建状态,无法再添加明细"); |
108 | 109 | } |
109 | 110 | //默认盘点配置,首选项 |
... | ... | @@ -195,7 +196,7 @@ public class CycleCountDetailServiceImpl extends ServiceImpl<CycleCountDetailMap |
195 | 196 | int count = 0; |
196 | 197 | int countErr = 0; |
197 | 198 | for(CycleCountDetail item:list){ |
198 | - if(item.getEnableStatus() < 5 && item.getTaskHeaderId() == null){ | |
199 | + if(item.getEnableStatus() < QuantityConstant.CYCLECOUNT_STATUS_BUILDTASK && item.getTaskHeaderId() == null){ | |
199 | 200 | AjaxResult result = this.createCycleCoutTaskByDetailId(item.getId()); |
200 | 201 | if(result.getCode()==200){ |
201 | 202 | count++; |
... | ... | @@ -246,11 +247,11 @@ public class CycleCountDetailServiceImpl extends ServiceImpl<CycleCountDetailMap |
246 | 247 | //查询任务头和明细有相同容器,没有就新增任务头和明细 |
247 | 248 | LambdaQueryWrapper<TaskHeader> taskHeaderLambdaQueryWrapper = Wrappers.lambdaQuery(); |
248 | 249 | taskHeaderLambdaQueryWrapper |
249 | - .lt(TaskHeader::getStatus,100) | |
250 | + .lt(TaskHeader::getStatus,QuantityConstant.TASK_STATUS_COMPLETED) | |
250 | 251 | .eq(TaskHeader::getWarehouseCode,ShiroUtils.getWarehouseCode()) |
251 | 252 | .eq(TaskHeader::getCompanyCode,cycleCountDetail.getCompanyCode()) |
252 | - .eq(TaskHeader::getInternalTaskType,700) | |
253 | - .eq(TaskHeader::getTaskType,700) | |
253 | + .eq(TaskHeader::getInternalTaskType,QuantityConstant.TASK_INTENERTYPE_CYCLECOUNT) | |
254 | + .eq(TaskHeader::getTaskType,QuantityConstant.TASK_TYPE_CYCLECOUNT) | |
254 | 255 | .eq(TaskHeader::getContainerCode,cycleCountDetail.getContainerCode());//容器 |
255 | 256 | List<TaskHeader> taskHeaderList = taskHeaderService.list(taskHeaderLambdaQueryWrapper); |
256 | 257 | |
... | ... | @@ -260,10 +261,10 @@ public class CycleCountDetailServiceImpl extends ServiceImpl<CycleCountDetailMap |
260 | 261 | //存在相同容器的主任务直接加入该条主任务的明细 |
261 | 262 | task.setWarehouseCode(ShiroUtils.getWarehouseCode()); |
262 | 263 | task.setCompanyCode(cycleCountDetail.getCompanyCode()); |
263 | - task.setInternalTaskType(700); | |
264 | - task.setTaskType(700); | |
264 | + task.setInternalTaskType(QuantityConstant.TASK_INTENERTYPE_CYCLECOUNT); | |
265 | + task.setTaskType(QuantityConstant.TASK_TYPE_CYCLECOUNT); | |
265 | 266 | task.setContainerCode(cycleCountDetail.getContainerCode()); |
266 | - task.setStatus(0); | |
267 | + task.setStatus(QuantityConstant.TASK_STATUS_BUILD); | |
267 | 268 | task.setFromLocation(cycleCountDetail.getLocationCode()); |
268 | 269 | task.setToLocation(cycleCountDetail.getLocationCode()); |
269 | 270 | task.setCreated(new Date()); |
... | ... | @@ -320,7 +321,7 @@ public class CycleCountDetailServiceImpl extends ServiceImpl<CycleCountDetailMap |
320 | 321 | //cycleCountDetail.setTaskHeaderId(task.getId()); |
321 | 322 | cycleCountDetail.setLastUpdated(new Date()); |
322 | 323 | cycleCountDetail.setLastUpdatedBy(ShiroUtils.getLoginName()); |
323 | - cycleCountDetail.setEnableStatus(5); | |
324 | + cycleCountDetail.setEnableStatus(QuantityConstant.CYCLECOUNT_STATUS_BUILDTASK); | |
324 | 325 | cycleCountDetail.setTaskHeaderId(task.getId()); |
325 | 326 | cycleCountDetail.setTaskDetailId(taskDetail.getId()); |
326 | 327 | this.saveOrUpdate(cycleCountDetail); |
... | ... | @@ -331,7 +332,7 @@ public class CycleCountDetailServiceImpl extends ServiceImpl<CycleCountDetailMap |
331 | 332 | cycleCountHeader.setCompanyCode(cycleCountDetail.getCompanyCode()); |
332 | 333 | LambdaQueryWrapper<CycleCountHeader> lamb = Wrappers.lambdaQuery(cycleCountHeader); |
333 | 334 | cycleCountHeader = cycleCountHeaderService.getOne(lamb); |
334 | - cycleCountHeader.setStatusCyc(5); | |
335 | + cycleCountHeader.setStatusCyc(QuantityConstant.CYCLECOUNT_STATUS_BUILDTASK); | |
335 | 336 | cycleCountHeaderService.saveOrUpdate(cycleCountHeader); |
336 | 337 | return AjaxResult.success("盘点任务生成成功"); |
337 | 338 | } |
... | ... | @@ -354,10 +355,10 @@ public class CycleCountDetailServiceImpl extends ServiceImpl<CycleCountDetailMap |
354 | 355 | LambdaQueryWrapper<CycleCountHeader> cycleCountHeaderLambdaQueryWrapper = Wrappers.lambdaQuery(cycleCountHeader); |
355 | 356 | cycleCountHeader = cycleCountHeaderService.getOne(cycleCountHeaderLambdaQueryWrapper); //主单 |
356 | 357 | //任务执行后再实盘登记 |
357 | - if(cyclecountDetail.getEnableStatus() < 10){ | |
358 | + if(cyclecountDetail.getEnableStatus() < QuantityConstant.CYCLECOUNT_STATUS_EXECUTING){ | |
358 | 359 | return AjaxResult.error("盘点任务未执行不能登记数量!"); |
359 | 360 | } |
360 | - if(cyclecountDetail.getEnableStatus() == 100){ | |
361 | + if(cyclecountDetail.getEnableStatus() == QuantityConstant.CYCLECOUNT_STATUS_COMPLETED){ | |
361 | 362 | return AjaxResult.error("盘点任务完成后不能再登记数量!"); |
362 | 363 | } |
363 | 364 | if(cycleCountHeader == null){ |
... | ... | @@ -380,7 +381,7 @@ public class CycleCountDetailServiceImpl extends ServiceImpl<CycleCountDetailMap |
380 | 381 | } |
381 | 382 | cyclecountDetail.setCountedQty(qty); |
382 | 383 | cyclecountDetail.setGapQty(qty.subtract(cyclecountDetail.getSystemQty())); |
383 | - cyclecountDetail.setEnableStatus(15); | |
384 | + cyclecountDetail.setEnableStatus(QuantityConstant.CYCLECOUNT_STATUS_REGISTERED); | |
384 | 385 | cyclecountDetail.setLastUpdatedBy(ShiroUtils.getLoginName()); |
385 | 386 | cyclecountDetail.setLastUpdated(new Date()); |
386 | 387 | this.saveOrUpdate(cyclecountDetail); |
... | ... | @@ -454,7 +455,7 @@ public class CycleCountDetailServiceImpl extends ServiceImpl<CycleCountDetailMap |
454 | 455 | item.setCycleCountHeadCode(cycleCountHeaderCode1); |
455 | 456 | item.setCountedQty(null); |
456 | 457 | item.setGapQty(BigDecimal.ZERO); |
457 | - item.setEnableStatus(1); | |
458 | + item.setEnableStatus(QuantityConstant.CYCLECOUNT_STATUS_BUILD); | |
458 | 459 | item.setCreatedBy(ShiroUtils.getLoginName()); |
459 | 460 | item.setCreated(new Date()); |
460 | 461 | cycleCountDetailList.add(item); |
... | ... |
src/main/java/com/huaheng/pc/inventory/cycleCountHeader/service/CycleCountHeaderServiceImpl.java
... | ... | @@ -2,6 +2,7 @@ package com.huaheng.pc.inventory.cycleCountHeader.service; |
2 | 2 | |
3 | 3 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
4 | 4 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
5 | +import com.huaheng.common.constant.QuantityConstant; | |
5 | 6 | import com.huaheng.common.exception.service.ServiceException; |
6 | 7 | import com.huaheng.common.utils.security.ShiroUtils; |
7 | 8 | import com.huaheng.framework.web.domain.AjaxResult; |
... | ... | @@ -66,9 +67,9 @@ public class CycleCountHeaderServiceImpl extends ServiceImpl<CycleCountHeaderMap |
66 | 67 | List<CycleCountDetail> list = cycleCountDetailService.list(lam); |
67 | 68 | //当有子单的状态为100时触发主单的完成状态 |
68 | 69 | //100状态只有全部完成才写入主单 |
69 | - long count100 = list.stream().filter(t->t.getEnableStatus() == 100).count(); //明细已完成的条数 | |
70 | + long count100 = list.stream().filter(t->t.getEnableStatus() == QuantityConstant.CYCLECOUNT_STATUS_COMPLETED).count(); //明细已完成的条数 | |
70 | 71 | if(count100 == list.size() ){ |
71 | - cyclecountHeader.setStatusCyc(100); | |
72 | + cyclecountHeader.setStatusCyc(QuantityConstant.CYCLECOUNT_STATUS_COMPLETED); | |
72 | 73 | this.saveOrUpdate(cyclecountHeader); |
73 | 74 | } |
74 | 75 | //有任何子单没有完成则主单不修改为100 |
... | ... | @@ -149,7 +150,7 @@ public class CycleCountHeaderServiceImpl extends ServiceImpl<CycleCountHeaderMap |
149 | 150 | |
150 | 151 | //查询该条盘点单头 id |
151 | 152 | CycleCountHeader cyclecountHeader = cycleCountHeaderMapper.selectById(id); |
152 | - if(cyclecountHeader.getStatusCyc() < 100){ | |
153 | + if(cyclecountHeader.getStatusCyc() < QuantityConstant.CYCLECOUNT_STATUS_COMPLETED){ | |
153 | 154 | //查询是否已生成差异单 |
154 | 155 | throw new ServiceException("该条盘点单无法生成调整单,必须为盘点任务完成,请检查状态!"); |
155 | 156 | } |
... | ... | @@ -212,7 +213,7 @@ public class CycleCountHeaderServiceImpl extends ServiceImpl<CycleCountHeaderMap |
212 | 213 | } |
213 | 214 | adjustDetailService.saveBatch(adjustDetails); |
214 | 215 | //修改盘点主单状态为已生成差异单 |
215 | - cyclecountHeader.setStatusCyc(101); | |
216 | + cyclecountHeader.setStatusCyc(QuantityConstant.CYCLECOUNT_STATUS_GENERATEADJUST); | |
216 | 217 | this.saveOrUpdate(cyclecountHeader); |
217 | 218 | |
218 | 219 | return AjaxResult.success("差异调整及明细单生成完毕!"); |
... | ... |
src/main/java/com/huaheng/pc/inventory/inventoryDetail/service/InventoryDetailServiceImpl.java
... | ... | @@ -2,6 +2,7 @@ package com.huaheng.pc.inventory.inventoryDetail.service; |
2 | 2 | |
3 | 3 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
4 | 4 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
5 | +import com.huaheng.common.constant.QuantityConstant; | |
5 | 6 | import com.huaheng.common.exception.service.ServiceException; |
6 | 7 | import com.huaheng.common.utils.StringUtils; |
7 | 8 | import com.huaheng.common.utils.security.ShiroUtils; |
... | ... | @@ -92,10 +93,10 @@ public class InventoryDetailServiceImpl extends ServiceImpl<InventoryDetailMappe |
92 | 93 | TaskHeader taskHeader = new TaskHeader(); |
93 | 94 | taskHeader.setWarehouseCode(inventoryDetail.getWarehouseCode()); |
94 | 95 | taskHeader.setCompanyCode(inventoryDetail.getCompanyCode()); |
95 | - taskHeader.setInternalTaskType(200); | |
96 | - taskHeader.setTaskType(900); | |
96 | + taskHeader.setInternalTaskType(QuantityConstant.TASK_INTENERTYPE_PICKING); | |
97 | + taskHeader.setTaskType(QuantityConstant.TASK_TYPE_VIEW); | |
97 | 98 | taskHeader.setContainerCode(inventoryDetail.getContainerCode()); |
98 | - taskHeader.setStatus(0); | |
99 | + taskHeader.setStatus(QuantityConstant.TASK_STATUS_BUILD); | |
99 | 100 | taskHeader.setFromLocation(inventoryDetail.getLocationCode()); |
100 | 101 | taskHeader.setToLocation(inventoryDetail.getLocationCode()); |
101 | 102 | taskHeader.setCreated(new Date()); |
... | ... | @@ -178,9 +179,9 @@ public class InventoryDetailServiceImpl extends ServiceImpl<InventoryDetailMappe |
178 | 179 | CheckHeader checkHeader = new CheckHeader(); |
179 | 180 | //判断入库单明细与该单已选中质检的库存明细比较,得出质检单的类型 |
180 | 181 | if(inventoryDetailList.size()>inventoryDetails.size()){ |
181 | - checkHeader.setType("300"); | |
182 | + checkHeader.setType(QuantityConstant.CHECK_TYPE_SELECT.toString()); | |
182 | 183 | }else { |
183 | - checkHeader.setType("200"); | |
184 | + checkHeader.setType(QuantityConstant.CHECK_TYPE_FULL.toString()); | |
184 | 185 | } |
185 | 186 | |
186 | 187 | //生成质检单号code |
... | ... | @@ -196,7 +197,7 @@ public class InventoryDetailServiceImpl extends ServiceImpl<InventoryDetailMappe |
196 | 197 | checkHeader.setWarehouseCode(ShiroUtils.getWarehouseCode()); |
197 | 198 | checkHeader.setReferCode(code); |
198 | 199 | checkHeader.setEnable(1); |
199 | - checkHeader.setStatus("0"); | |
200 | + checkHeader.setStatus(QuantityConstant.CHECK_STATUS_BUILD.toString()); | |
200 | 201 | checkHeader.setCreatedBy(ShiroUtils.getLoginName()); |
201 | 202 | Boolean flag=checkHeaderService.save(checkHeader); |
202 | 203 | if(flag == false){ |
... | ... | @@ -211,7 +212,7 @@ public class InventoryDetailServiceImpl extends ServiceImpl<InventoryDetailMappe |
211 | 212 | checkDetail.setCheckHeaderId(checkHeader.getId()); |
212 | 213 | checkDetail.setCheckCode(checkCode); |
213 | 214 | checkDetail.setInventoryDetailId(item.getId()); |
214 | - checkDetail.setStatus("0"); | |
215 | + checkDetail.setStatus(QuantityConstant.CHECK_STATUS_BUILD.toString()); | |
215 | 216 | checkDetail.setCreatedBy(ShiroUtils.getLoginName()); |
216 | 217 | checkDetail.setCreated(new Date()); |
217 | 218 | checkDetail.setLastUpdatedBy(null); |
... | ... |
src/main/java/com/huaheng/pc/inventory/inventoryHeader/service/InventoryHeaderServiceImpl.java
... | ... | @@ -2,6 +2,7 @@ package com.huaheng.pc.inventory.inventoryHeader.service; |
2 | 2 | |
3 | 3 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
4 | 4 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
5 | +import com.huaheng.common.constant.QuantityConstant; | |
5 | 6 | import com.huaheng.common.exception.service.ServiceException; |
6 | 7 | import com.huaheng.common.utils.StringUtils; |
7 | 8 | import com.huaheng.common.utils.security.ShiroUtils; |
... | ... | @@ -120,10 +121,10 @@ public class InventoryHeaderServiceImpl extends ServiceImpl<InventoryHeaderMappe |
120 | 121 | TaskHeader taskHeader = new TaskHeader(); |
121 | 122 | taskHeader.setWarehouseCode(loc.getWarehouseCode()); |
122 | 123 | taskHeader.setCompanyCode("空容器");//货主 |
123 | - taskHeader.setInternalTaskType(100); //入库内部类型都给100 | |
124 | - taskHeader.setTaskType(500); | |
124 | + taskHeader.setInternalTaskType(QuantityConstant.TASK_INTENERTYPE_SHELF); //入库内部类型都给100 | |
125 | + taskHeader.setTaskType(QuantityConstant.TASK_TYPE_EMPTYRECEIPT); | |
125 | 126 | taskHeader.setContainerCode(container.getCode()); |
126 | - taskHeader.setStatus(1); | |
127 | + taskHeader.setStatus(QuantityConstant.TASK_STATUS_BUILD); | |
127 | 128 | taskHeader.setFromLocation(""); |
128 | 129 | taskHeader.setToLocation(loc.getCode()); |
129 | 130 | taskHeader.setCreated(new Date()); |
... | ... | @@ -199,10 +200,10 @@ public class InventoryHeaderServiceImpl extends ServiceImpl<InventoryHeaderMappe |
199 | 200 | TaskHeader taskHeader = new TaskHeader(); |
200 | 201 | taskHeader.setWarehouseCode(loc.getWarehouseCode()); |
201 | 202 | taskHeader.setCompanyCode("空容器");//货主 |
202 | - taskHeader.setInternalTaskType(200); //出库内部类型都给200 | |
203 | - taskHeader.setTaskType(600); | |
203 | + taskHeader.setInternalTaskType(QuantityConstant.TASK_INTENERTYPE_PICKING); //出库内部类型都给200 | |
204 | + taskHeader.setTaskType(QuantityConstant.TASK_TYPE_EMPTYSHIPMENT); | |
204 | 205 | taskHeader.setContainerCode(container.getCode()); |
205 | - taskHeader.setStatus(1); | |
206 | + taskHeader.setStatus(QuantityConstant.TASK_STATUS_BUILD); | |
206 | 207 | taskHeader.setFromLocation(sourceLocation); |
207 | 208 | taskHeader.setToLocation(""); |
208 | 209 | taskHeader.setCreated(new Date()); |
... | ... | @@ -272,10 +273,10 @@ public class InventoryHeaderServiceImpl extends ServiceImpl<InventoryHeaderMappe |
272 | 273 | TaskHeader taskHeader = new TaskHeader(); |
273 | 274 | taskHeader.setWarehouseCode(loc.getWarehouseCode()); |
274 | 275 | taskHeader.setCompanyCode("空容器");//货主 |
275 | - taskHeader.setInternalTaskType(200); //出库内部类型都给200 | |
276 | - taskHeader.setTaskType(900); | |
276 | + taskHeader.setInternalTaskType(QuantityConstant.TASK_INTENERTYPE_PICKING); //出库内部类型都给200 | |
277 | + taskHeader.setTaskType(QuantityConstant.TASK_TYPE_VIEW); | |
277 | 278 | taskHeader.setContainerCode(container.getCode()); |
278 | - taskHeader.setStatus(1); | |
279 | + taskHeader.setStatus(QuantityConstant.TASK_STATUS_BUILD); | |
279 | 280 | taskHeader.setFromLocation(location); |
280 | 281 | taskHeader.setToLocation(location); |
281 | 282 | taskHeader.setCreated(new Date()); |
... | ... |
src/main/java/com/huaheng/pc/receipt/receiptContainerDetail/service/ReceiptContainerDetailServiceImpl.java
... | ... | @@ -3,6 +3,7 @@ package com.huaheng.pc.receipt.receiptContainerDetail.service; |
3 | 3 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
4 | 4 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
5 | 5 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
6 | +import com.huaheng.common.constant.QuantityConstant; | |
6 | 7 | import com.huaheng.common.exception.service.ServiceException; |
7 | 8 | import com.huaheng.common.utils.security.ShiroUtils; |
8 | 9 | import com.huaheng.framework.web.domain.AjaxResult; |
... | ... | @@ -54,7 +55,7 @@ public class ReceiptContainerDetailServiceImpl extends ServiceImpl<ReceiptContai |
54 | 55 | for (Integer id : idList){ |
55 | 56 | ReceiptContainerDetail receiptContainerDetail = this.getById(id); |
56 | 57 | //如果已生成任务不允许撤销 |
57 | - if (receiptContainerDetail.getStatus() < 10){ | |
58 | + if (receiptContainerDetail.getStatus() < QuantityConstant.RECEIPT_CONTAINER_TASK){ | |
58 | 59 | //回滚入库单明细收货数量 |
59 | 60 | ReceiptDetail receiptDetail = receiptDetailService.getById(receiptContainerDetail.getReceiptDetailId()); |
60 | 61 | receiptDetail.setOpenQty(receiptDetail.getOpenQty().subtract(receiptContainerDetail.getQty())); |
... | ... | @@ -84,8 +85,8 @@ public class ReceiptContainerDetailServiceImpl extends ServiceImpl<ReceiptContai |
84 | 85 | if (containerDetailList.size() == 0){ |
85 | 86 | ReceiptHeader receiptHeader = new ReceiptHeader(); |
86 | 87 | receiptHeader.setId(receiptContainerDetail.getReceiptId()); |
87 | - receiptHeader.setFirstStatus(200); | |
88 | - receiptHeader.setLastStatus(200); | |
88 | + receiptHeader.setFirstStatus(QuantityConstant.RECEIPT_HEADER_RECEIVING); | |
89 | + receiptHeader.setLastStatus(QuantityConstant.RECEIPT_HEADER_RECEIVING); | |
89 | 90 | receiptHeader.setLastUpdatedBy(ShiroUtils.getLoginName()); |
90 | 91 | |
91 | 92 | if (!receiptHeaderService.updateById(receiptHeader)){ throw new ServiceException("回滚头表状态失败"); } |
... | ... |
src/main/java/com/huaheng/pc/receipt/receiptContainerHeader/service/ReceiptContainerHeaderServiceImpl.java
... | ... | @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
4 | 4 | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
5 | 5 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
6 | 6 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
7 | +import com.huaheng.common.constant.QuantityConstant; | |
7 | 8 | import com.huaheng.common.exception.service.ServiceException; |
8 | 9 | import com.huaheng.common.utils.security.ShiroUtils; |
9 | 10 | import com.huaheng.framework.web.domain.AjaxResult; |
... | ... | @@ -74,7 +75,7 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl<ReceiptContai |
74 | 75 | if (taskType == 1){ |
75 | 76 | //创建临时容器 |
76 | 77 | containerCode = createContainer(); |
77 | - taskType = 100; | |
78 | + taskType = QuantityConstant.TASK_TYPE_WHOLERECEIPT; | |
78 | 79 | }else { |
79 | 80 | if (taskType == 0){ throw new ServiceException("容器状态未知"); } |
80 | 81 | } |
... | ... | @@ -87,7 +88,7 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl<ReceiptContai |
87 | 88 | //根据容器编码查询组盘表头记录 |
88 | 89 | LambdaQueryWrapper<ReceiptContainerHeader> lambda = Wrappers.lambdaQuery(); |
89 | 90 | lambda.eq(ReceiptContainerHeader::getContainerCode, containerCode) |
90 | - .eq(ReceiptContainerHeader::getStatus, 0); | |
91 | + .eq(ReceiptContainerHeader::getStatus, QuantityConstant.RECEIPT_CONTAINER_BUILD); | |
91 | 92 | List<ReceiptContainerHeader> list = this.list(lambda); |
92 | 93 | |
93 | 94 | ReceiptContainerHeader receiptContainerHeader = new ReceiptContainerHeader(); |
... | ... | @@ -111,7 +112,7 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl<ReceiptContai |
111 | 112 | } |
112 | 113 | } else { |
113 | 114 | receiptContainerHeader = list.get(0); |
114 | - if (receiptContainerHeader.getStatus() > 9 && receiptContainerHeader.getStatus() < 20){ | |
115 | + if (receiptContainerHeader.getStatus() >= QuantityConstant.RECEIPT_CONTAINER_TASK && receiptContainerHeader.getStatus() < QuantityConstant.RECEIPT_CONTAINER_FINISHED){ | |
115 | 116 | throw new ServiceException("容器已经生成任务,不能放物料了!"); |
116 | 117 | } |
117 | 118 | } |
... | ... | @@ -130,8 +131,8 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl<ReceiptContai |
130 | 131 | |
131 | 132 | receiptContainerDetailAdd(receiptContainerHeaders.get(0).getId(), receiptDetail, qty, containerCode, locationCode); |
132 | 133 | //如果单据数量等于已收数量,更新入库详情状态和入库单状态 |
133 | - if (receiptDetail.getTotalQty().equals(receiptDetail.getOpenQty())){ | |
134 | - receiptDetail.setProcessStamp("200"); | |
134 | + if (receiptDetail.getTotalQty() == receiptDetail.getOpenQty()){ | |
135 | + receiptDetail.setProcessStamp(QuantityConstant.RECEIPT_HEADER_RECEIVING.toString()); | |
135 | 136 | if (!receiptDetailService.updateById(receiptDetail)){ |
136 | 137 | throw new ServiceException("更新入库详情处理标记失败"); |
137 | 138 | } |
... | ... | @@ -155,7 +156,7 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl<ReceiptContai |
155 | 156 | public Boolean cancelByIds(List<Integer> ids) { |
156 | 157 | for (Integer id : ids) { |
157 | 158 | //如果已生成任务则不允许取消组盘 |
158 | - if (this.getById(id).getStatus() < 10){ | |
159 | + if (this.getById(id).getStatus() < QuantityConstant.RECEIPT_CONTAINER_TASK){ | |
159 | 160 | //根据组盘头表id查询组盘明细表 |
160 | 161 | LambdaQueryWrapper<ReceiptContainerDetail> containerDetailLambda = Wrappers.lambdaQuery(); |
161 | 162 | containerDetailLambda.eq(ReceiptContainerDetail::getReceiptContainerId, id); |
... | ... | @@ -178,8 +179,8 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl<ReceiptContai |
178 | 179 | if (containerDetailList == null){ |
179 | 180 | ReceiptHeader receiptHeader = new ReceiptHeader(); |
180 | 181 | receiptHeader.setId(receiptContainerDetail.getReceiptId()); |
181 | - receiptHeader.setFirstStatus(200); | |
182 | - receiptHeader.setLastStatus(200); | |
182 | + receiptHeader.setFirstStatus(QuantityConstant.RECEIPT_HEADER_RECEIVING); | |
183 | + receiptHeader.setLastStatus(QuantityConstant.RECEIPT_HEADER_RECEIVING); | |
183 | 184 | receiptHeader.setLastUpdatedBy(ShiroUtils.getLoginName()); |
184 | 185 | |
185 | 186 | if (!receiptHeaderService.updateById(receiptHeader)){ throw new ServiceException("回滚头表状态失败"); } |
... | ... | @@ -232,15 +233,15 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl<ReceiptContai |
232 | 233 | //检查该容器编码是否已存任务 |
233 | 234 | LambdaQueryWrapper<TaskHeader> lambdaQueryWrapper = Wrappers.lambdaQuery(); |
234 | 235 | lambdaQueryWrapper.eq(TaskHeader::getContainerCode, containerCode) |
235 | - .lt(TaskHeader::getStatus, 100) | |
236 | + .lt(TaskHeader::getStatus, QuantityConstant.TASK_STATUS_COMPLETED) | |
236 | 237 | .eq(TaskHeader::getWarehouseCode, ShiroUtils.getWarehouseCode()); |
237 | 238 | if (taskHeaderService.count(lambdaQueryWrapper) > 0){ |
238 | 239 | throw new ServiceException("容器已经存在任务,请更换容器"); |
239 | 240 | } |
240 | 241 | if ("empty".equals(container.getStatus())){ |
241 | - return 100; | |
242 | + return QuantityConstant.TASK_TYPE_WHOLERECEIPT; | |
242 | 243 | }else if ("some".equals(container.getStatus())) { |
243 | - return 200; | |
244 | + return QuantityConstant.TASK_TYPE_SUPPLEMENTRECEIPT; | |
244 | 245 | } else if ("full".equals(container.getStatus())) { |
245 | 246 | throw new ServiceException("该容器已满,请更换容器"); |
246 | 247 | } |
... | ... | @@ -258,7 +259,7 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl<ReceiptContai |
258 | 259 | Boolean checkLocationCode(String locationCode, String containerCode, Integer taskType) { |
259 | 260 | //如果选了库位,就要校验库位和已经组盘的库位是否一致,避免重入库 |
260 | 261 | if (StringUtils.isEmpty(locationCode)) { |
261 | - if ("200".equals(locationCode)) { | |
262 | + if (QuantityConstant.TASK_TYPE_SUPPLEMENTRECEIPT.equals(locationCode)) { | |
262 | 263 | throw new ServiceException("补充入库,必须填写库位"); |
263 | 264 | } else { |
264 | 265 | return true; |
... | ... | @@ -291,14 +292,12 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl<ReceiptContai |
291 | 292 | } |
292 | 293 | if (!"empty".equals(location.getStatus()) ) { |
293 | 294 | throw new ServiceException("库位不是空闲状态!"); |
294 | - } | |
295 | - if ("100".equals(taskType)) { | |
296 | - if (StringUtils.isNotEmpty(location.getContainerCode())){ | |
295 | + if (QuantityConstant.TASK_TYPE_WHOLERECEIPT.equals(taskType)) { | |
296 | + if (com.huaheng.common.utils.StringUtils.isNotEmpty(location.getContainerCode())) | |
297 | 297 | throw new ServiceException("库位(" + containerCode + ")有容器(" + location.getContainerCode() + "),不能整盘入库!"); |
298 | - } | |
299 | 298 | } |
300 | - if("200".equals(taskType)) { | |
301 | - if (com.huaheng.common.utils.StringUtils.isEmpty(location.getContainerCode())) { | |
299 | + if(QuantityConstant.TASK_TYPE_SUPPLEMENTRECEIPT.equals(taskType)) { | |
300 | + if (com.huaheng.common.utils.StringUtils.isEmpty(location.getContainerCode())) | |
302 | 301 | throw new ServiceException("库位(" + locationCode + ")没有容器,不能补充入库!"); |
303 | 302 | } else if (!location.getContainerCode().equals(containerCode)) { |
304 | 303 | throw new ServiceException("库位(" + containerCode + ")对应的容器是:" + location.getContainerCode()+ ",请重选库位!"); |
... | ... |
src/main/java/com/huaheng/pc/receipt/receiptDetail/service/ReceiptDetailServiceImpl.java
... | ... | @@ -2,6 +2,7 @@ package com.huaheng.pc.receipt.receiptDetail.service; |
2 | 2 | |
3 | 3 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
4 | 4 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
5 | +import com.huaheng.common.constant.QuantityConstant; | |
5 | 6 | import com.huaheng.common.exception.service.ServiceException; |
6 | 7 | import com.huaheng.common.support.Convert; |
7 | 8 | import com.huaheng.common.utils.StringUtils; |
... | ... | @@ -74,7 +75,7 @@ public class ReceiptDetailServiceImpl extends ServiceImpl<ReceiptDetailMapper, R |
74 | 75 | //判断入库头表状态 |
75 | 76 | if (receiptHeader == null ){ |
76 | 77 | throw new ServiceException("找不到主单据"); |
77 | - } else if (receiptHeader.getFirstStatus() > 100){ | |
78 | + } else if (receiptHeader.getFirstStatus() > QuantityConstant.RECEIPT_HEADER_POOL){ | |
78 | 79 | throw new ServiceException("单据进入订单池后,不允许新增明细"); |
79 | 80 | } else if (receiptHeader.getFirstStatus() == 20) { |
80 | 81 | throw new ServiceException("单据已作废"); |
... | ... | @@ -178,8 +179,8 @@ public class ReceiptDetailServiceImpl extends ServiceImpl<ReceiptDetailMapper, R |
178 | 179 | List<StatusFlowDetail> statusFlowDetails = statusFlowDetailService.queryStatusFlowDetail(receiptDetail.getStatusFlowCode()); |
179 | 180 | String status = nextStatusFlow(statusFlowDetails, receiptDetail.getProcessStamp()); |
180 | 181 | //在状态到达时候是判断是否要质检 |
181 | - if ("200".equals(status) && inspection(receiptDetail)){ | |
182 | - receiptDetail.setProcessStamp("180"); | |
182 | + if (QuantityConstant.RECEIPT_HEADER_RECEIVING.toString().equals(status) && inspection(receiptDetail)){ | |
183 | + receiptDetail.setProcessStamp(QuantityConstant.RECEIPT_HEADER_CHECK.toString()); | |
183 | 184 | } else { |
184 | 185 | receiptDetail.setProcessStamp(status); |
185 | 186 | } |
... | ... | @@ -206,8 +207,8 @@ public class ReceiptDetailServiceImpl extends ServiceImpl<ReceiptDetailMapper, R |
206 | 207 | List<StatusFlowDetail> statusFlowDetails = statusFlowDetailService.queryStatusFlowDetail(receiptType.getReceiptFlow()); |
207 | 208 | String status = nextStatusFlow(statusFlowDetails, receiptDetail.getProcessStamp()); |
208 | 209 | //在状态到达时候是判断是否要质检 |
209 | - if ("200".equals(status) && inspection(receiptDetail)){ | |
210 | - receiptDetail.setProcessStamp("180"); | |
210 | + if (QuantityConstant.RECEIPT_HEADER_RECEIVING.toString().equals(status) && inspection(receiptDetail)){ | |
211 | + receiptDetail.setProcessStamp(QuantityConstant.RECEIPT_HEADER_CHECK.toString()); | |
211 | 212 | } else { |
212 | 213 | receiptDetail.setProcessStamp(status); |
213 | 214 | } |
... | ... | @@ -217,8 +218,8 @@ public class ReceiptDetailServiceImpl extends ServiceImpl<ReceiptDetailMapper, R |
217 | 218 | List<StatusFlowDetail> statusFlowDetails = statusFlowDetailService.queryStatusFlowDetail(material.getReceivingFlow()); |
218 | 219 | String status = nextStatusFlow(statusFlowDetails, receiptDetail.getProcessStamp()); |
219 | 220 | //在状态到达时候是判断是否要质检 |
220 | - if ("200".equals(status) && inspection(receiptDetail)){ | |
221 | - receiptDetail.setProcessStamp("180"); | |
221 | + if (QuantityConstant.RECEIPT_HEADER_RECEIVING.toString().equals(status) && inspection(receiptDetail)){ | |
222 | + receiptDetail.setProcessStamp(QuantityConstant.RECEIPT_HEADER_CHECK.toString()); | |
222 | 223 | } else { |
223 | 224 | receiptDetail.setProcessStamp(status); |
224 | 225 | } |
... | ... | @@ -232,8 +233,8 @@ public class ReceiptDetailServiceImpl extends ServiceImpl<ReceiptDetailMapper, R |
232 | 233 | List<StatusFlowDetail> statusFlowDetails = statusFlowDetailService.queryStatusFlowDetail(materialType.getReceivingFlow()); |
233 | 234 | String status = nextStatusFlow(statusFlowDetails, receiptDetail.getProcessStamp()); |
234 | 235 | //在状态到达时候是判断是否要质检 |
235 | - if ("200".equals(status) && inspection(receiptDetail)){ | |
236 | - receiptDetail.setProcessStamp("180"); | |
236 | + if (QuantityConstant.RECEIPT_HEADER_RECEIVING.toString().equals(status) && inspection(receiptDetail)){ | |
237 | + receiptDetail.setProcessStamp(QuantityConstant.RECEIPT_HEADER_CHECK.toString()); | |
237 | 238 | } else { |
238 | 239 | receiptDetail.setProcessStamp(status); |
239 | 240 | } |
... | ... | @@ -251,8 +252,8 @@ public class ReceiptDetailServiceImpl extends ServiceImpl<ReceiptDetailMapper, R |
251 | 252 | List<StatusFlowDetail> statusFlowDetails = statusFlowDetailService.queryStatusFlowDetail(receiptPreference.getReceivingFlow()); |
252 | 253 | String status = nextStatusFlow(statusFlowDetails, receiptDetail.getProcessStamp()); |
253 | 254 | //在状态到达时候是判断是否要质检 |
254 | - if ("200".equals(status) && inspection(receiptDetail)){ | |
255 | - receiptDetail.setProcessStamp("180"); | |
255 | + if (QuantityConstant.RECEIPT_HEADER_RECEIVING.toString().equals(status) && inspection(receiptDetail)){ | |
256 | + receiptDetail.setProcessStamp(QuantityConstant.RECEIPT_HEADER_CHECK.toString()); | |
256 | 257 | } else { |
257 | 258 | receiptDetail.setProcessStamp(status); |
258 | 259 | } |
... | ... | @@ -353,7 +354,7 @@ public class ReceiptDetailServiceImpl extends ServiceImpl<ReceiptDetailMapper, R |
353 | 354 | lambda.eq(ReceiptDetail::getReceiptId, id); |
354 | 355 | List<ReceiptDetail> receiptDetails = this.list(lambda); |
355 | 356 | for (ReceiptDetail receiptDetail : receiptDetails){ |
356 | - receiptDetail.setProcessStamp("100"); | |
357 | + receiptDetail.setProcessStamp(QuantityConstant.RECEIPT_HEADER_POOL.toString()); | |
357 | 358 | receiptDetail = this.queryflow(receiptDetail); |
358 | 359 | if (!this.updateById(receiptDetail)){ |
359 | 360 | throw new ServiceException("更新入库明细表失败"); |
... | ... |
src/main/java/com/huaheng/pc/receipt/receiptHeader/service/ReceiptHeaderService.java
... | ... | @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
4 | 4 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
5 | 5 | import com.baomidou.mybatisplus.extension.api.R; |
6 | 6 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
7 | +import com.huaheng.common.constant.QuantityConstant; | |
7 | 8 | import com.huaheng.common.exception.service.ServiceException; |
8 | 9 | import com.huaheng.common.support.Convert; |
9 | 10 | import com.huaheng.common.utils.StringUtils; |
... | ... | @@ -67,8 +68,8 @@ public class ReceiptHeaderService extends ServiceImpl<ReceiptHeaderMapper, Recei |
67 | 68 | |
68 | 69 | String code = createCode(receiptHeader.getReceiptType()); |
69 | 70 | receiptHeader.setCode(code); |
70 | - receiptHeader.setFirstStatus(0); | |
71 | - receiptHeader.setLastStatus(0); | |
71 | + receiptHeader.setFirstStatus(QuantityConstant.RECEIPT_HEADER_BUILD); | |
72 | + receiptHeader.setLastStatus(QuantityConstant.RECEIPT_HEADER_BUILD); | |
72 | 73 | receiptHeader.setWarehouseCode(ShiroUtils.getWarehouseCode()); |
73 | 74 | receiptHeader.setCreatedBy(ShiroUtils.getLoginName()); |
74 | 75 | receiptHeader.setLastUpdatedBy(ShiroUtils.getLoginName()); |
... | ... | @@ -113,7 +114,7 @@ public class ReceiptHeaderService extends ServiceImpl<ReceiptHeaderMapper, Recei |
113 | 114 | List<ReceiptDetail> receiptDetails = receiptDetailService.list(receiptDetailLambda); |
114 | 115 | //更新入库明细流程 |
115 | 116 | for (ReceiptDetail receiptDetail : receiptDetails) { |
116 | - receiptDetail.setProcessStamp("120"); | |
117 | + receiptDetail.setProcessStamp(QuantityConstant.RECEIPT_HEADER_RESERVATION.toString()); | |
117 | 118 | if (!receiptDetailService.updateById(receiptDetail)){ |
118 | 119 | throw new ServiceException("更新入库明细处理标记失败"); |
119 | 120 | } |
... | ... | @@ -139,7 +140,7 @@ public class ReceiptHeaderService extends ServiceImpl<ReceiptHeaderMapper, Recei |
139 | 140 | public AjaxResult arrival(Integer id) { |
140 | 141 | LambdaQueryWrapper<ReceiptDetail> receiptDetailLambda = Wrappers.lambdaQuery(); |
141 | 142 | receiptDetailLambda.eq(ReceiptDetail::getReceiptId, id) |
142 | - .eq(ReceiptDetail::getProcessStamp, "150"); | |
143 | + .eq(ReceiptDetail::getProcessStamp, QuantityConstant.RECEIPT_HEADER_ARRIVAL.toString()); | |
143 | 144 | List<ReceiptDetail> receiptDetails = receiptDetailService.list(receiptDetailLambda); |
144 | 145 | //更新入库明细流程 |
145 | 146 | for (ReceiptDetail receiptDetail : receiptDetails) { |
... | ... | @@ -170,11 +171,11 @@ public class ReceiptHeaderService extends ServiceImpl<ReceiptHeaderMapper, Recei |
170 | 171 | //创建质检头表 |
171 | 172 | CheckHeader checkHeader = new CheckHeader(); |
172 | 173 | checkHeader.setCode(receiptHeader.getCode()); |
173 | - checkHeader.setType("100"); | |
174 | + checkHeader.setType(QuantityConstant.CHECK_TYPE_RECEIPT.toString()); | |
174 | 175 | checkHeader.setWarehouseCode(ShiroUtils.getWarehouseCode()); |
175 | 176 | checkHeader.setReferCode(receiptHeader.getReferCode()); |
176 | 177 | checkHeader.setEnable(1); |
177 | - checkHeader.setStatus("0"); | |
178 | + checkHeader.setStatus(QuantityConstant.CHECK_STATUS_BUILD.toString()); | |
178 | 179 | checkHeader.setCreatedBy(ShiroUtils.getLoginName()); |
179 | 180 | checkHeader.setLastUpdatedBy(ShiroUtils.getLoginName()); |
180 | 181 | |
... | ... | @@ -200,7 +201,7 @@ public class ReceiptHeaderService extends ServiceImpl<ReceiptHeaderMapper, Recei |
200 | 201 | checkDetail.setMaterialUnit(receiptDetail.getMaterialUnit()); |
201 | 202 | checkDetail.setCompanyCode(receiptDetail.getCompanyCode()); |
202 | 203 | checkDetail.setInventorySts(receiptDetail.getInventorySts()); |
203 | - checkDetail.setStatus("0"); | |
204 | + checkDetail.setStatus(QuantityConstant.CHECK_STATUS_BUILD.toString()); | |
204 | 205 | checkDetail.setQty(receiptDetail.getTotalQty()); |
205 | 206 | checkDetail.setCheckBy(ShiroUtils.getLoginName()); |
206 | 207 | checkDetail.setCreatedBy(ShiroUtils.getLoginName()); |
... | ... | @@ -222,11 +223,11 @@ public class ReceiptHeaderService extends ServiceImpl<ReceiptHeaderMapper, Recei |
222 | 223 | Integer[] idArray = Convert.toIntArray(ids); |
223 | 224 | for (int i = 0; i<idArray.length; i++){ |
224 | 225 | ReceiptHeader receiptHeader = this.getById(idArray[i]); |
225 | - if (receiptHeader.getFirstStatus()>5||receiptHeader.getLastStatus()>5){ | |
226 | + if (receiptHeader.getFirstStatus()>QuantityConstant.RECEIPT_HEADER_MODERATED ||receiptHeader.getLastStatus()>QuantityConstant.RECEIPT_HEADER_MODERATED){ | |
226 | 227 | return AjaxResult.error("单据号为"+receiptHeader.getCode()+"入库单不需要审核"); |
227 | 228 | } |
228 | - receiptHeader.setFirstStatus(5); | |
229 | - receiptHeader.setLastStatus(5); | |
229 | + receiptHeader.setFirstStatus(QuantityConstant.RECEIPT_HEADER_MODERATED); | |
230 | + receiptHeader.setLastStatus(QuantityConstant.RECEIPT_HEADER_MODERATED); | |
230 | 231 | if (!this.updateById(receiptHeader)){ |
231 | 232 | throw new ServiceException("更新入库头表失败"); |
232 | 233 | } else { |
... | ... | @@ -246,7 +247,7 @@ public class ReceiptHeaderService extends ServiceImpl<ReceiptHeaderMapper, Recei |
246 | 247 | lambda.eq(ReceiptDetail::getReceiptId, id); |
247 | 248 | List<ReceiptDetail> receiptDetails = receiptDetailService.list(lambda); |
248 | 249 | for (ReceiptDetail receiptDetail : receiptDetails) { |
249 | - receiptDetail.setProcessStamp(String.valueOf(150)); | |
250 | + receiptDetail.setProcessStamp(QuantityConstant.RECEIPT_HEADER_ARRIVAL.toString()); | |
250 | 251 | receiptDetailService.updateById(receiptDetail); |
251 | 252 | if (!receiptDetailService.updateById(receiptDetailService.queryflow(receiptDetail))){ |
252 | 253 | throw new ServiceException("更新入库明细处理标记出错"); |
... | ... | @@ -270,14 +271,14 @@ public class ReceiptHeaderService extends ServiceImpl<ReceiptHeaderMapper, Recei |
270 | 271 | List<ReceiptDetail> list = receiptDetailService.list(lambdaQueryWrapper); |
271 | 272 | if (list.size() != 0){ |
272 | 273 | for (ReceiptDetail receiptDetail : list){ |
273 | - if (Integer.parseInt(receiptDetail.getProcessStamp()) < 100){ | |
274 | + if (Integer.parseInt(receiptDetail.getProcessStamp()) < QuantityConstant.RECEIPT_HEADER_POOL){ | |
274 | 275 | //判断入库明细是否需要审核 |
275 | 276 | ReceiptDetail beforeReceiptDetail = receiptDetailService.queryflow(receiptDetail); |
276 | 277 | if (Integer.parseInt(beforeReceiptDetail.getProcessStamp()) == 5 || Integer.parseInt(beforeReceiptDetail.getProcessStamp()) == 100){ |
277 | 278 | throw new ServiceException("请先提交审核"); |
278 | 279 | } |
279 | 280 | //加入订单池 |
280 | - receiptDetail.setProcessStamp("100"); | |
281 | + receiptDetail.setProcessStamp(QuantityConstant.RECEIPT_HEADER_POOL.toString()); | |
281 | 282 | ReceiptDetail receiptDetail1 = receiptDetailService.queryflow(receiptDetail); |
282 | 283 | if (!receiptDetailService.updateById(receiptDetail1)){ |
283 | 284 | throw new ServiceException("更新入库明细状态失败"); |
... | ... |
src/main/java/com/huaheng/pc/receipt/receiptHeaderHistory/service/ReceiptHeaderHistoryService.java
... | ... | @@ -2,6 +2,7 @@ package com.huaheng.pc.receipt.receiptHeaderHistory.service; |
2 | 2 | |
3 | 3 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
4 | 4 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
5 | +import com.huaheng.common.constant.QuantityConstant; | |
5 | 6 | import com.huaheng.common.exception.service.ServiceException; |
6 | 7 | import com.huaheng.common.utils.security.ShiroUtils; |
7 | 8 | import com.huaheng.framework.web.domain.AjaxResult; |
... | ... | @@ -37,8 +38,8 @@ public class ReceiptHeaderHistoryService extends ServiceImpl<ReceiptHeaderHistor |
37 | 38 | public AjaxResult add(Integer id){ |
38 | 39 | ReceiptHeader receiptHeader = receiptHeaderService.getById(id); |
39 | 40 | if (receiptHeader == null) return AjaxResult.success(""); |
40 | - if((receiptHeader.getFirstStatus()>=800 && receiptHeader.getLastStatus()>=800)|| | |
41 | - (receiptHeader.getFirstStatus()<100 &receiptHeader.getLastStatus()<100)){ | |
41 | + if((receiptHeader.getFirstStatus()>= QuantityConstant.RECEIPT_HEADER_POSTING && receiptHeader.getLastStatus()>=QuantityConstant.RECEIPT_HEADER_POSTING)|| | |
42 | + (receiptHeader.getFirstStatus()<QuantityConstant.RECEIPT_HEADER_POOL &receiptHeader.getLastStatus()<QuantityConstant.RECEIPT_HEADER_POOL)){ | |
42 | 43 | ReceiptHeaderHistory receiptHeaderHistory = new ReceiptHeaderHistory(); |
43 | 44 | List<ReceiptDetailHistory> receiptDetailHistoryList = new ArrayList<>(); |
44 | 45 | //查询入库单明细 |
... | ... |
src/main/java/com/huaheng/pc/receipt/receiving/service/ReceivingService.java
... | ... | @@ -2,6 +2,7 @@ package com.huaheng.pc.receipt.receiving.service; |
2 | 2 | |
3 | 3 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
4 | 4 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
5 | +import com.huaheng.common.constant.QuantityConstant; | |
5 | 6 | import com.huaheng.common.exception.service.ServiceException; |
6 | 7 | import com.huaheng.common.utils.StringUtils; |
7 | 8 | import com.huaheng.common.utils.security.ShiroUtils; |
... | ... | @@ -84,13 +85,12 @@ public class ReceivingService { |
84 | 85 | @Transactional |
85 | 86 | public Boolean position(ReceiptContainerDetail receiptContainerDetail){ |
86 | 87 | ReceiptContainerHeader receiptContainerHeader = receiptContainerHeaderService.getById(receiptContainerDetail.getReceiptContainerId()); |
87 | - if (0 !=receiptContainerHeader.getStatus()){ | |
88 | + if (!(0 ==receiptContainerHeader.getStatus())){ | |
88 | 89 | throw new ServiceException("该入库组盘已生成任务不能重新定位"); |
89 | 90 | } |
90 | 91 | //如果入库组盘表中有目标库位说明已经指定 |
91 | 92 | if (StringUtils.isNotEmpty(receiptContainerHeader.getToLocation())){return true;} |
92 | - /*定位规则*/ | |
93 | - String locatingRule = receiptContainerHeader.getLocatingRule(); | |
93 | + String locatingRule = receiptContainerHeader.getLocatingRule(); //定位规则 | |
94 | 94 | if (StringUtils.isEmpty(locatingRule)){ |
95 | 95 | locatingRule = receiptDetailService.getById(receiptContainerDetail.getReceiptDetailId()).getLocatingRule(); |
96 | 96 | //入库单明细定位规则不为空时执行 |
... | ... | @@ -178,7 +178,7 @@ public class ReceivingService { |
178 | 178 | public AjaxResult cancelPosition(ReceiptContainerDetail receiptContainerDetail){ |
179 | 179 | //查询入库组盘头 |
180 | 180 | ReceiptContainerHeader receiptContainerHeader = receiptContainerHeaderService.getById(receiptContainerDetail.getReceiptContainerId()); |
181 | - if (receiptContainerHeader.getStatus() != 0){ | |
181 | + if (!(receiptContainerHeader.getStatus().shortValue() == QuantityConstant.RECEIPT_CONTAINER_BUILD)){ | |
182 | 182 | throw new ServiceException("组盘已生成任务不能取消定位"); |
183 | 183 | } |
184 | 184 | //将入库组盘头表中的而库位编码赋值null |
... | ... | @@ -200,7 +200,7 @@ public class ReceivingService { |
200 | 200 | |
201 | 201 | //回滚入库明细状态 |
202 | 202 | ReceiptDetail receiptDetail = receiptDetailService.getById(receiptContainerDetail.getReceiptDetailId()); |
203 | - receiptDetail.setProcessStamp("240"); | |
203 | + receiptDetail.setProcessStamp(QuantityConstant.RECEIPT_HEADER_POSITION.toString()); | |
204 | 204 | if ( !receiptDetailService.updateById(receiptDetail)){ |
205 | 205 | throw new ServiceException("回滚入库明细状态失败"); |
206 | 206 | } |
... | ... |
src/main/java/com/huaheng/pc/shipment/shipmentContainerHeader/service/ShipmentContainerHeaderServiceImpl.java
... | ... | @@ -2,6 +2,7 @@ package com.huaheng.pc.shipment.shipmentContainerHeader.service; |
2 | 2 | |
3 | 3 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
4 | 4 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
5 | +import com.huaheng.common.constant.QuantityConstant; | |
5 | 6 | import com.huaheng.common.exception.service.ServiceException; |
6 | 7 | import com.huaheng.common.utils.security.ShiroUtils; |
7 | 8 | import com.huaheng.framework.web.domain.AjaxResult; |
... | ... | @@ -131,17 +132,6 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentCont |
131 | 132 | if (location == null) { |
132 | 133 | throw new ServiceException("库位 " + inventoryDetail.getLocationCode() + " 不存在"); |
133 | 134 | } |
134 | -// if (location.getStatus().equals("lock")) { | |
135 | -// //如果库位状态是锁定的话,就查找出库组盘表,如果存在未下发 | |
136 | -// LambdaQueryWrapper<ShipmentContainerHeader> lam=Wrappers.lambdaQuery(); | |
137 | -// lam.eq(ShipmentContainerHeader::getWarehouseCode,ShiroUtils.getWarehouseCode()) | |
138 | -// .eq(ShipmentContainerHeader::getContainerCode,location.getContainerCode()) | |
139 | -// .eq(ShipmentContainerHeader::getTaskCreated,0); | |
140 | -// ShipmentContainerHeader shipmentContainerHeader = this.getOne(lam); | |
141 | -// if (shipmentContainerHeader == null) { | |
142 | -// throw new ServiceException("库位已经锁定不能使用"); | |
143 | -// } | |
144 | -// } | |
145 | 135 | |
146 | 136 | //2.更新库存分配数 |
147 | 137 | inventoryDetail.setTaskQty(inventoryDetail.getTaskQty().add(shipmentCombinationModel.getShipQty())); |
... | ... | @@ -155,9 +145,9 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentCont |
155 | 145 | shipmentDetail.setRequestQty(shipmentDetail.getRequestQty().add(shipmentCombinationModel.getShipQty())); |
156 | 146 | int i = shipmentDetail.getShipQty().compareTo(shipmentDetail.getRequestQty()); |
157 | 147 | if(i > 0){ |
158 | - shipmentDetail.setStatus(200); | |
148 | + shipmentDetail.setStatus(QuantityConstant.SHIPMENT_HEADER_WAVE); | |
159 | 149 | }else if(i == 0){ |
160 | - shipmentDetail.setStatus(300); | |
150 | + shipmentDetail.setStatus(QuantityConstant.SHIPMENT_HEADER_GROUPDISK); | |
161 | 151 | }else if(i < 0){ |
162 | 152 | throw new ServiceException("出库数量不能大于单据数量!"); |
163 | 153 | } |
... | ... | @@ -166,9 +156,9 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentCont |
166 | 156 | //自动判定出库任务状态,根据库存数量减去预定库存相等就是整盘出--预计任务状态 |
167 | 157 | BigDecimal inventoryQty = inventoryDetail.getQty().subtract(inventoryDetail.getTaskQty()); |
168 | 158 | if(inventoryQty.compareTo(new BigDecimal(0)) <= 0) { |
169 | - shipmentCombinationModel.setTaskType(300); | |
159 | + shipmentCombinationModel.setTaskType(QuantityConstant.TASK_TYPE_WHOLESHIPMENT); | |
170 | 160 | } else { |
171 | - shipmentCombinationModel.setTaskType(400); | |
161 | + shipmentCombinationModel.setTaskType(QuantityConstant.TASK_TYPE_SORTINGSHIPMENT); | |
172 | 162 | } |
173 | 163 | |
174 | 164 | //5.增加出库组盘头 |
... | ... | @@ -198,7 +188,7 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentCont |
198 | 188 | lambdaQueryWrapper.eq(ShipmentContainerHeader::getLocationCode,location.getCode()) |
199 | 189 | .eq(ShipmentContainerHeader::getContainerCode,location.getContainerCode()) |
200 | 190 | .eq(ShipmentContainerHeader::getWarehouseCode,ShiroUtils.getWarehouseCode()) |
201 | - .le(ShipmentContainerHeader::getStatus,20); | |
191 | + .le(ShipmentContainerHeader::getStatus,QuantityConstant.SHIPMENT_CONTAINER_FINISHED); | |
202 | 192 | ShipmentContainerHeader shipmentContainerHeader = this.getOne(lambdaQueryWrapper); |
203 | 193 | if(shipmentContainerHeader != null) { |
204 | 194 | return shipmentContainerHeader; |
... | ... | @@ -219,7 +209,7 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentCont |
219 | 209 | shipmentContainerHeader.setWarehouseCode(ShiroUtils.getWarehouseCode()); |
220 | 210 | shipmentContainerHeader.setCompanyCode(shipmentDetail.getCompanyCode()); |
221 | 211 | shipmentContainerHeader.setContainerType(container.getContainerType()); |
222 | - shipmentContainerHeader.setStatus(0); | |
212 | + shipmentContainerHeader.setStatus(QuantityConstant.SHIPMENT_CONTAINER_BUILD); | |
223 | 213 | shipmentContainerHeader.setTaskCreated(0); |
224 | 214 | shipmentContainerHeader.setCreatedBy(ShiroUtils.getLoginName()); |
225 | 215 | Boolean flag = this.save(shipmentContainerHeader); |
... | ... | @@ -292,7 +282,7 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentCont |
292 | 282 | shipmentContainerDetaill.setQty(shipmentCombinationModel.getShipQty()); |
293 | 283 | shipmentContainerDetaill.setWaveId(shipmentDetail.getWaveId()); |
294 | 284 | shipmentContainerDetaill.setTaskCreated(0); |
295 | - shipmentContainerDetaill.setStatus(0); | |
285 | + shipmentContainerDetaill.setStatus(QuantityConstant.SHIPMENT_CONTAINER_BUILD); | |
296 | 286 | shipmentContainerDetaill.setBatch(shipmentDetail.getBatch()); |
297 | 287 | shipmentContainerDetaill.setLot(shipmentDetail.getLot()); |
298 | 288 | shipmentContainerDetaill.setProjectNo(shipmentDetail.getProjectNo()); |
... | ... | @@ -305,10 +295,10 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentCont |
305 | 295 | |
306 | 296 | //4.查看组盘头状态,如果状态在10到20,则生成任务明细或修改任务明细的数量 |
307 | 297 | //查看任务头 |
308 | - if(shipmentContainerHeader.getStatus()>=10 && shipmentContainerHeader.getStatus()<30){ | |
298 | + if(shipmentContainerHeader.getStatus()>=QuantityConstant.SHIPMENT_CONTAINER_TASK && shipmentContainerHeader.getStatus()<QuantityConstant.SHIPMENT_CONTAINER_REVIEWSUCCESS){ | |
309 | 299 | LambdaQueryWrapper<TaskHeader> taskHeaderLambdaQueryWrapper=Wrappers.lambdaQuery(); |
310 | 300 | taskHeaderLambdaQueryWrapper.eq(TaskHeader::getWarehouseCode,shipmentContainerHeader.getWarehouseCode()) |
311 | - .eq(TaskHeader::getInternalTaskType,200) | |
301 | + .eq(TaskHeader::getInternalTaskType,QuantityConstant.TASK_INTENERTYPE_PICKING) | |
312 | 302 | .eq(TaskHeader::getAllocationHeadId,shipmentContainerHeader.getId()); |
313 | 303 | TaskHeader taskHeader=taskHeaderService.getOne(taskHeaderLambdaQueryWrapper); |
314 | 304 | if(taskHeader==null){ |
... | ... | @@ -322,7 +312,7 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentCont |
322 | 312 | taskDetailLam.eq(TaskDetail::getWarehouseCode,shipmentContainerDetail.getWarehouseCode()) |
323 | 313 | .eq(TaskDetail::getAllocationId,shipmentContainerDetail.getId()) |
324 | 314 | .eq(TaskDetail::getTaskId,taskHeader.getId()) |
325 | - .eq(TaskDetail::getInternalTaskType,200); | |
315 | + .eq(TaskDetail::getInternalTaskType,QuantityConstant.TASK_INTENERTYPE_PICKING); | |
326 | 316 | TaskDetail taskDetail = taskDetailService.getOne(taskDetailLam); |
327 | 317 | if(taskDetail == null){ |
328 | 318 | throw new ServiceException("找不到对应的任务明细"); |
... | ... | @@ -356,10 +346,10 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentCont |
356 | 346 | taskDetail.setWaveId(shipmentContainerDetaill.getWaveId()); |
357 | 347 | taskDetail.setBatch(shipmentContainerDetaill.getBatch()); |
358 | 348 | taskDetail.setProjectNo(shipmentContainerDetail.getProjectNo()); |
359 | - if (shipmentContainerHeader.getStatus() == 10) { | |
360 | - taskDetail.setStatus(0); | |
349 | + if (shipmentContainerHeader.getStatus() == QuantityConstant.SHIPMENT_CONTAINER_TASK) { | |
350 | + taskDetail.setStatus(QuantityConstant.TASK_STATUS_BUILD); | |
361 | 351 | } else { |
362 | - taskDetail.setStatus(10); | |
352 | + taskDetail.setStatus(QuantityConstant.TASK_STATUS_RELEASE); | |
363 | 353 | } |
364 | 354 | taskDetail.setCreatedBy(ShiroUtils.getLoginName()); |
365 | 355 | taskDetail.setLastUpdatedBy(ShiroUtils.getLoginName()); |
... | ... | @@ -399,7 +389,7 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentCont |
399 | 389 | for(ShipmentContainerDetail shipmentContainerDetail:shipmentContainerDetails){ |
400 | 390 | //获取头 |
401 | 391 | ShipmentContainerHeader shipmentContainerHeader = this.getById(shipmentContainerDetail.getShippingContainerId()); |
402 | - if(shipmentContainerHeader.getStatus()>9){ | |
392 | + if(shipmentContainerHeader.getStatus()>= QuantityConstant.SHIPMENT_CONTAINER_TASK){ | |
403 | 393 | return AjaxResult.error("容器"+shipmentContainerHeader.getContainerCode()+"非新建状态,不允许取消明细"); |
404 | 394 | } |
405 | 395 | //恢复占用库存 |
... | ... | @@ -410,9 +400,9 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentCont |
410 | 400 | ShipmentDetail shipmentDetail = shipmentDetailService.getById(shipmentContainerDetail.getShipmentDetailId()); |
411 | 401 | shipmentDetail.setRequestQty(shipmentDetail.getRequestQty().subtract(shipmentContainerDetail.getQty())); |
412 | 402 | if(shipmentDetail.getRequestQty().compareTo(BigDecimal.ZERO) != 0 ){ |
413 | - shipmentDetail.setStatus(200);//明细状态恢复,如果删除后还有以出数量就是波次 | |
403 | + shipmentDetail.setStatus(QuantityConstant.SHIPMENT_HEADER_WAVE);//明细状态恢复,如果删除后还有以出数量就是波次 | |
414 | 404 | }else{ |
415 | - shipmentDetail.setStatus(100 );//明细状态 | |
405 | + shipmentDetail.setStatus(QuantityConstant.SHIPMENT_HEADER_POOL );//明细状态 | |
416 | 406 | } |
417 | 407 | shipmentDetailService.saveOrUpdate(shipmentDetail); |
418 | 408 | //删除这个配盘明细 |
... | ... | @@ -511,7 +501,7 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentCont |
511 | 501 | List<InventoryDetail> inventoryList = shippingCombinationService.getInventorys(item); |
512 | 502 | if(inventoryList.size() < 1 && item.getWaveId() != 0){ |
513 | 503 | Wave wave = waveService.getById(item.getWaveId()); |
514 | - wave.setStatus(999); | |
504 | + wave.setStatus(QuantityConstant.WAVE_STATUS_FAILED); | |
515 | 505 | waveService.updateById(wave); |
516 | 506 | throw new ServiceException("主单为"+item.getShipmentCode()+"子单id为"+item.getId() + "的单据没有库存,波次失败"); |
517 | 507 | } |
... | ... | @@ -528,7 +518,7 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentCont |
528 | 518 | ShipmentCombinationModel shipmentCombination = new ShipmentCombinationModel(); |
529 | 519 | shipmentCombination.setInventoryDetailId(inventory.getId()); |
530 | 520 | shipmentCombination.setShipmentDetailId(item.getId()); |
531 | - shipmentCombination.setType((short) 300); | |
521 | + shipmentCombination.setType((short) QuantityConstant.TASK_TYPE_WHOLESHIPMENT.intValue()); | |
532 | 522 | |
533 | 523 | //如果库存数 >= 待出库数,组盘数就是待出库数并且结束组盘,否则组盘数就是库存数 |
534 | 524 | if (inventoryQty.compareTo(shipmentQty) > -1) { |
... | ... | @@ -559,7 +549,7 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentCont |
559 | 549 | public AjaxResult checkForCancelCombination(List<Integer> shipmentContainerIds) { |
560 | 550 | for(int id : shipmentContainerIds){ |
561 | 551 | ShipmentContainerHeader shipmentContainerHeader = this.getById(id); |
562 | - if(shipmentContainerHeader.getStatus()>9){ | |
552 | + if(shipmentContainerHeader.getStatus()>=QuantityConstant.SHIPMENT_CONTAINER_TASK){ | |
563 | 553 | return AjaxResult.error("存在已生成任务的记录,请先取消任务再取消组盘"); |
564 | 554 | } |
565 | 555 | } |
... | ... |
src/main/java/com/huaheng/pc/shipment/shipmentDetail/service/ShipmentDetailServiceImpl.java
... | ... | @@ -2,6 +2,7 @@ package com.huaheng.pc.shipment.shipmentDetail.service; |
2 | 2 | |
3 | 3 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
4 | 4 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
5 | +import com.huaheng.common.constant.QuantityConstant; | |
5 | 6 | import com.huaheng.common.exception.service.ServiceException; |
6 | 7 | import com.huaheng.common.support.Convert; |
7 | 8 | import com.huaheng.common.utils.DataUtils; |
... | ... | @@ -72,7 +73,7 @@ public class ShipmentDetailServiceImpl extends ServiceImpl<ShipmentDetailMapper, |
72 | 73 | if (shipmentHeader == null) { |
73 | 74 | return AjaxResult.error("找不到主单据"); |
74 | 75 | } |
75 | - if (shipmentHeader.getFirstStatus() > 100) { | |
76 | + if (shipmentHeader.getFirstStatus() > QuantityConstant.SHIPMENT_HEADER_POOL) { | |
76 | 77 | //表示已经加入了波次 |
77 | 78 | return AjaxResult.error("主单据状态不允许新增明细"); |
78 | 79 | } |
... | ... | @@ -133,7 +134,7 @@ public class ShipmentDetailServiceImpl extends ServiceImpl<ShipmentDetailMapper, |
133 | 134 | if (list.size() > 1) { |
134 | 135 | return AjaxResult.error("有多个主单据,不能一起删除!"); |
135 | 136 | } |
136 | - if (list.get(0).get("status") > 100) { | |
137 | + if (list.get(0).get("status") > QuantityConstant.SHIPMENT_HEADER_POOL) { | |
137 | 138 | return AjaxResult.error("单据状进入订单池,不允许删除明细"); |
138 | 139 | } |
139 | 140 | Integer result = shipmentDetailMapper.batchDelete(ids); |
... | ... | @@ -173,7 +174,7 @@ public class ShipmentDetailServiceImpl extends ServiceImpl<ShipmentDetailMapper, |
173 | 174 | @Override |
174 | 175 | @Transactional |
175 | 176 | public void saveWave(String ids, String code) { |
176 | - Integer status = 100; | |
177 | + Integer status = QuantityConstant.SHIPMENT_HEADER_POOL; | |
177 | 178 | List<ShipmentHeader> shipmentHeaderList =shipmentPreferenceService.checkShipmentProcess(ids,status,code); |
178 | 179 | |
179 | 180 | //找到波次主表,看系统是否有此波次 |
... | ... | @@ -222,7 +223,7 @@ public class ShipmentDetailServiceImpl extends ServiceImpl<ShipmentDetailMapper, |
222 | 223 | |
223 | 224 | //查看波次是否建成未执行 |
224 | 225 | LambdaQueryWrapper<Wave> waveLam = Wrappers.lambdaQuery(); |
225 | - waveLam.eq(Wave::getStatus,0) | |
226 | + waveLam.eq(Wave::getStatus,QuantityConstant.WAVE_STATUS_BUILD) | |
226 | 227 | .eq(Wave::getWaveMode,code) |
227 | 228 | .eq(Wave::getWarehouseCode,ShiroUtils.getWarehouseCode()); |
228 | 229 | Wave wave = waveService.getOne(waveLam); |
... | ... | @@ -240,8 +241,8 @@ public class ShipmentDetailServiceImpl extends ServiceImpl<ShipmentDetailMapper, |
240 | 241 | wave.setWarehouseCode(ShiroUtils.getWarehouseCode()); |
241 | 242 | wave.setMasterCode(code); |
242 | 243 | wave.setWaveName(waveMaster.getName()); |
243 | - wave.setStatus(0); | |
244 | - wave.setCurrentWaveStep("0"); | |
244 | + wave.setStatus(QuantityConstant.WAVE_STATUS_BUILD); | |
245 | + wave.setCurrentWaveStep(QuantityConstant.WAVE_STATUS_BUILD.toString()); | |
245 | 246 | wave.setTotalShipments(Convert.toIntArray(ids).length); |
246 | 247 | wave.setTotalLines(shipmentDetailList.size()); |
247 | 248 | wave.setTotalQty(qty); |
... | ... | @@ -255,8 +256,8 @@ public class ShipmentDetailServiceImpl extends ServiceImpl<ShipmentDetailMapper, |
255 | 256 | //修改出库子单,加入波次ID,并修改状态为波次 |
256 | 257 | for(ShipmentDetail shipmentDetail :shipmentDetailList){ |
257 | 258 | shipmentDetail.setWaveId(wave.getId()); |
258 | - if(shipmentDetail.getStatus()<200) { | |
259 | - shipmentDetail.setStatus(200); | |
259 | + if(shipmentDetail.getStatus()<QuantityConstant.SHIPMENT_HEADER_WAVE) { | |
260 | + shipmentDetail.setStatus(QuantityConstant.SHIPMENT_HEADER_WAVE); | |
260 | 261 | } |
261 | 262 | } |
262 | 263 | |
... | ... | @@ -266,7 +267,7 @@ public class ShipmentDetailServiceImpl extends ServiceImpl<ShipmentDetailMapper, |
266 | 267 | } |
267 | 268 | |
268 | 269 | for(ShipmentHeader shipmentHeader :shipmentHeaderList){ |
269 | - shipmentHeader.setLastStatus(200); | |
270 | + shipmentHeader.setLastStatus(QuantityConstant.SHIPMENT_HEADER_WAVE); | |
270 | 271 | } |
271 | 272 | flag = shipmentHeaderService.updateBatchById(shipmentHeaderList); |
272 | 273 | if(flag == false){ |
... | ... |
src/main/java/com/huaheng/pc/shipment/shipmentDetailHistory/service/ShipmentDetailHistoryServiceImpl.java
... | ... | @@ -2,6 +2,7 @@ package com.huaheng.pc.shipment.shipmentDetailHistory.service; |
2 | 2 | |
3 | 3 | |
4 | 4 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
5 | +import com.huaheng.common.constant.QuantityConstant; | |
5 | 6 | import com.huaheng.common.utils.DataUtils; |
6 | 7 | import com.huaheng.common.utils.StringUtils; |
7 | 8 | import com.huaheng.framework.web.domain.AjaxResult; |
... | ... | @@ -46,7 +47,7 @@ public class ShipmentDetailHistoryServiceImpl extends ServiceImpl<ShipmentDetail |
46 | 47 | if (list.size() > 1) { |
47 | 48 | return AjaxResult.error("有多个主单据,不能一起删除!"); |
48 | 49 | } |
49 | - if (list.get(0).get("firstStatus") > 100) { | |
50 | + if (list.get(0).get("firstStatus") > QuantityConstant.SHIPMENT_HEADER_POOL) { | |
50 | 51 | return AjaxResult.error("单据状进入订单池,不允许删除明细"); |
51 | 52 | } |
52 | 53 | Integer result = shipmentDetailHistoryMapper.batchDelete(ids); |
... | ... |
src/main/java/com/huaheng/pc/shipment/shipmentHeader/service/ShipmentHeaderServiceImpl.java
... | ... | @@ -2,6 +2,7 @@ package com.huaheng.pc.shipment.shipmentHeader.service; |
2 | 2 | |
3 | 3 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
4 | 4 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
5 | +import com.huaheng.common.constant.QuantityConstant; | |
5 | 6 | import com.huaheng.common.exception.service.ServiceException; |
6 | 7 | import com.huaheng.common.support.Convert; |
7 | 8 | import com.huaheng.common.utils.security.ShiroUtils; |
... | ... | @@ -15,9 +16,11 @@ import com.huaheng.pc.shipment.shipmentHeaderHistory.domain.ShipmentHeaderHistor |
15 | 16 | import com.huaheng.pc.shipment.shipmentHeaderHistory.service.ShipmentHeaderHistoryService; |
16 | 17 | import com.huaheng.pc.system.dict.service.IDictDataService; |
17 | 18 | import org.apache.commons.beanutils.BeanUtils; |
19 | +import org.apache.commons.collections4.QueueUtils; | |
18 | 20 | import org.springframework.beans.factory.annotation.Autowired; |
19 | 21 | import org.springframework.stereotype.Service; |
20 | 22 | import javax.annotation.Resource; |
23 | +import javax.xml.namespace.QName; | |
21 | 24 | import java.lang.reflect.InvocationTargetException; |
22 | 25 | import java.text.SimpleDateFormat; |
23 | 26 | import java.util.ArrayList; |
... | ... | @@ -58,8 +61,8 @@ public class ShipmentHeaderServiceImpl extends ServiceImpl<ShipmentHeaderMapper, |
58 | 61 | } |
59 | 62 | String code = createCode(shipmentHeader.getShipmentType()); |
60 | 63 | shipmentHeader.setId(null); |
61 | - shipmentHeader.setFirstStatus(0); | |
62 | - shipmentHeader.setLastStatus(0); | |
64 | + shipmentHeader.setFirstStatus(QuantityConstant.RECEIPT_HEADER_BUILD); | |
65 | + shipmentHeader.setLastStatus(QuantityConstant.RECEIPT_HEADER_BUILD); | |
63 | 66 | shipmentHeader.setLastUpdated(null); |
64 | 67 | shipmentHeader.setLastUpdatedBy(ShiroUtils.getLoginName()); |
65 | 68 | shipmentHeader.setCreated(null); |
... | ... | @@ -106,29 +109,29 @@ public class ShipmentHeaderServiceImpl extends ServiceImpl<ShipmentHeaderMapper, |
106 | 109 | Map<String,Integer> map = shipmentContainerHeaderService.getShipmentContainerMaxAndMinStatusByShipmentID(shipmentId); |
107 | 110 | if(map==null){ |
108 | 111 | //说明没有货箱,则直接首位均为新建 |
109 | - shipmentHeader.setFirstStatus(100); | |
110 | - shipmentHeader.setLastStatus(100); | |
112 | + shipmentHeader.setFirstStatus(QuantityConstant.RECEIPT_HEADER_POOL); | |
113 | + shipmentHeader.setLastStatus(QuantityConstant.RECEIPT_HEADER_POOL); | |
111 | 114 | |
112 | 115 | this.saveOrUpdate(shipmentHeader); |
113 | 116 | }else { |
114 | 117 | int firstStatus = map.get("maxStatus"); |
115 | 118 | int lastStatus = map.get("minStatus"); |
116 | - if(firstStatus<=20){ | |
117 | - shipmentHeader.setFirstStatus(300); | |
119 | + if(firstStatus<=QuantityConstant.SHIPMENT_CONTAINER_FINISHED){ | |
120 | + shipmentHeader.setFirstStatus(QuantityConstant.SHIPMENT_HEADER_GROUPDISK); | |
118 | 121 | } |
119 | - if(firstStatus==30){ | |
120 | - shipmentHeader.setFirstStatus(500); | |
122 | + if(firstStatus==QuantityConstant.SHIPMENT_CONTAINER_REVIEWSUCCESS){ | |
123 | + shipmentHeader.setFirstStatus(QuantityConstant.SHIPMENT_HEADER_COMPLETED); | |
121 | 124 | } |
122 | - if(lastStatus <=20){ | |
123 | - shipmentHeader.setLastStatus(300); | |
125 | + if(lastStatus <=QuantityConstant.SHIPMENT_CONTAINER_FINISHED){ | |
126 | + shipmentHeader.setLastStatus(QuantityConstant.SHIPMENT_HEADER_GROUPDISK); | |
124 | 127 | } |
125 | - if(lastStatus==30){ | |
126 | - shipmentHeader.setLastStatus(500); | |
128 | + if(lastStatus==QuantityConstant.SHIPMENT_CONTAINER_REVIEWSUCCESS){ | |
129 | + shipmentHeader.setLastStatus(QuantityConstant.SHIPMENT_HEADER_COMPLETED); | |
127 | 130 | } |
128 | 131 | //是否存在未配盘的数量,如果是,则尾状态为新建 |
129 | 132 | Integer UnCompleted = shipmentDetailService.countUnCompleted(shipmentId); |
130 | 133 | if(UnCompleted != null && UnCompleted.intValue() > 0){ |
131 | - shipmentHeader.setLastStatus(100); | |
134 | + shipmentHeader.setLastStatus(QuantityConstant.SHIPMENT_HEADER_POOL); | |
132 | 135 | } |
133 | 136 | this.saveOrUpdate(shipmentHeader); |
134 | 137 | } |
... | ... | @@ -189,9 +192,9 @@ public class ShipmentHeaderServiceImpl extends ServiceImpl<ShipmentHeaderMapper, |
189 | 192 | } |
190 | 193 | |
191 | 194 | //2.小于100时,把主单和相应的子单加入到list中,大于等于100时,直接跳过 |
192 | - if(shipmentHeader.getFirstStatus() < 100 && shipmentHeader.getLastStatus() <100){ | |
193 | - shipmentHeader.setFirstStatus(100); | |
194 | - shipmentHeader.setLastStatus(100); | |
195 | + if(shipmentHeader.getFirstStatus() < QuantityConstant.SHIPMENT_HEADER_POOL && shipmentHeader.getLastStatus() <QuantityConstant.SHIPMENT_HEADER_POOL){ | |
196 | + shipmentHeader.setFirstStatus(QuantityConstant.SHIPMENT_HEADER_POOL); | |
197 | + shipmentHeader.setLastStatus(QuantityConstant.SHIPMENT_HEADER_POOL); | |
195 | 198 | shipmentHeaders.add(shipmentHeader); |
196 | 199 | |
197 | 200 | LambdaQueryWrapper<ShipmentDetail> lam = Wrappers.lambdaQuery(); |
... | ... | @@ -200,7 +203,7 @@ public class ShipmentHeaderServiceImpl extends ServiceImpl<ShipmentHeaderMapper, |
200 | 203 | List<ShipmentDetail> shipmentDetailList = shipmentDetailService.list(lam); |
201 | 204 | if(shipmentDetailList != null){ |
202 | 205 | for(ShipmentDetail shipmentDetail : shipmentDetailList){ |
203 | - shipmentDetail.setStatus(100); | |
206 | + shipmentDetail.setStatus(QuantityConstant.SHIPMENT_HEADER_POOL); | |
204 | 207 | } |
205 | 208 | shipmentDetails.addAll(shipmentDetailList); |
206 | 209 | }else { |
... | ... |
src/main/java/com/huaheng/pc/shipment/wave/service/WaveService.java
... | ... | @@ -3,6 +3,7 @@ package com.huaheng.pc.shipment.wave.service; |
3 | 3 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
4 | 4 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
5 | 5 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
6 | +import com.huaheng.common.constant.QuantityConstant; | |
6 | 7 | import com.huaheng.common.exception.service.ServiceException; |
7 | 8 | import com.huaheng.common.support.Convert; |
8 | 9 | import com.huaheng.common.utils.security.ShiroUtils; |
... | ... | @@ -58,7 +59,7 @@ public class WaveService extends ServiceImpl<WaveMapper, Wave> { |
58 | 59 | |
59 | 60 | //1、查看此波次的状态,状态不为o时,无法开始波次 |
60 | 61 | Wave wave = this.getById(id); |
61 | - if(wave == null || wave.getStatus() != 0){ | |
62 | + if(wave == null || wave.getStatus() != QuantityConstant.WAVE_STATUS_BUILD){ | |
62 | 63 | return AjaxResult.error("id为"+id+"的波次找不到,或者状态不能做开始操作"); |
63 | 64 | } |
64 | 65 | waves.add(wave); |
... | ... | @@ -84,7 +85,7 @@ public class WaveService extends ServiceImpl<WaveMapper, Wave> { |
84 | 85 | |
85 | 86 | //5、修改波次的状态 |
86 | 87 | for(Wave wave : waves){ |
87 | - wave.setStatus(300); | |
88 | + wave.setStatus(QuantityConstant.WAVE_STATUS_END); | |
88 | 89 | wave.setCurrentWaveStep("生成任务"); |
89 | 90 | } |
90 | 91 | Boolean flag = this.updateBatchById(waves); |
... | ... | @@ -116,16 +117,16 @@ public class WaveService extends ServiceImpl<WaveMapper, Wave> { |
116 | 117 | |
117 | 118 | //1、查看此波次是否可以释放 |
118 | 119 | Wave wave = this.getById(id); |
119 | - if(wave == null || (wave.getStatus()!=300 && wave.getStatus()!=999)){ | |
120 | + if(wave == null || (wave.getStatus()!=QuantityConstant.WAVE_STATUS_END && wave.getStatus()!=QuantityConstant.WAVE_STATUS_FAILED)){ | |
120 | 121 | return AjaxResult.error(id+"波次不可释放"); |
121 | 122 | } |
122 | 123 | |
123 | 124 | //2、查看此波次的状态,看是成功释放还是失败释放 |
124 | - if(wave.getStatus() == 300) { | |
125 | + if(wave.getStatus() == QuantityConstant.WAVE_STATUS_END) { | |
125 | 126 | //成功释放——找到此波次的未执行的子任务列表 |
126 | 127 | LambdaQueryWrapper<TaskDetail> lam = Wrappers.lambdaQuery(); |
127 | 128 | lam.eq(TaskDetail::getWarehouseCode, ShiroUtils.getWarehouseCode()) |
128 | - .eq(TaskDetail::getStatus, 0) | |
129 | + .eq(TaskDetail::getStatus, QuantityConstant.TASK_STATUS_BUILD) | |
129 | 130 | .eq(TaskDetail::getWaveId, id); |
130 | 131 | List<TaskDetail> taskDetails = taskDetailService.list(lam); |
131 | 132 | if (taskDetails != null) { |
... | ... | @@ -143,7 +144,7 @@ public class WaveService extends ServiceImpl<WaveMapper, Wave> { |
143 | 144 | HashSet<Integer> set = new HashSet<>(); |
144 | 145 | for(ShipmentDetail item : shipmentDetails){ |
145 | 146 | if(item.getShipQty().compareTo(item.getRequestQty())!=0) { |
146 | - item.setStatus(0); | |
147 | + item.setStatus(QuantityConstant.SHIPMENT_HEADER_POOL); | |
147 | 148 | } |
148 | 149 | item.setWaveId(0); |
149 | 150 | set.add(item.getShipmentId()); |
... | ... | @@ -157,8 +158,8 @@ public class WaveService extends ServiceImpl<WaveMapper, Wave> { |
157 | 158 | if(shipmentHeader == null){ |
158 | 159 | throw new ServiceException("没有对应的出库主单"); |
159 | 160 | } |
160 | - if(shipmentHeader.getFirstStatus()<= 200) { | |
161 | - shipmentHeader.setFirstStatus(0); | |
161 | + if(shipmentHeader.getFirstStatus()<= QuantityConstant.SHIPMENT_HEADER_WAVE) { | |
162 | + shipmentHeader.setFirstStatus(QuantityConstant.SHIPMENT_HEADER_POOL); | |
162 | 163 | flag = shipmentHeaderService.updateById(shipmentHeader); |
163 | 164 | if (flag == false) { |
164 | 165 | throw new ServiceException("修改出库主单失败"); |
... | ... |
src/main/java/com/huaheng/pc/task/taskHeader/service/TaskHeaderServiceImpl.java
... | ... | @@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
5 | 5 | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
6 | 6 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
7 | 7 | import com.huaheng.api.wcs.service.taskAssignService.TaskAssignService; |
8 | +import com.huaheng.common.constant.QuantityConstant; | |
8 | 9 | import com.huaheng.common.exception.service.ServiceException; |
9 | 10 | import com.huaheng.common.utils.DataUtils; |
10 | 11 | import com.huaheng.common.utils.StringUtils; |
... | ... | @@ -147,7 +148,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
147 | 148 | if(taskHeader==null){ |
148 | 149 | return AjaxResult.error("任务"+taskId+"未找到,操作中止"); |
149 | 150 | } |
150 | - if(taskHeader.getStatus() > 9){ | |
151 | + if(taskHeader.getStatus() >= QuantityConstant.TASK_STATUS_RELEASE){ | |
151 | 152 | return AjaxResult.error("存在任务"+taskHeader.getId()+"已下发或执行,操作中止"); |
152 | 153 | } |
153 | 154 | //查出任务明细 |
... | ... | @@ -168,23 +169,23 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
168 | 169 | //删除主任务 |
169 | 170 | taskHeaderService.removeById(taskHeader.getId()); |
170 | 171 | // 更改库位状态(整盘入库任务除外) |
171 | - if(taskHeader.getInternalTaskType() == 100 ) | |
172 | + if(taskHeader.getInternalTaskType() == QuantityConstant.TASK_INTENERTYPE_SHELF ) | |
172 | 173 | { |
173 | 174 | ReceiptContainerHeader record =new ReceiptContainerHeader(); |
174 | - record.setStatus((short)0); | |
175 | + record.setStatus((short)QuantityConstant.RECEIPT_CONTAINER_BUILD.intValue()); | |
175 | 176 | record.setId(taskHeader.getAllocationHeadId()); |
176 | 177 | if (!receiptContainerHeaderService.updateById(record)){throw new ServiceException("回滚组盘明细失败");} |
177 | 178 | } |
178 | 179 | //根据任务类型来更新货箱状态 |
179 | 180 | //修改关联的货箱状态 |
180 | - if(taskHeader.getInternalTaskType() == 200) { | |
181 | + if(taskHeader.getInternalTaskType() == QuantityConstant.TASK_INTENERTYPE_PICKING) { | |
181 | 182 | ShipmentContainerHeader shipmentContainerHeader = new ShipmentContainerHeader(); |
182 | 183 | shipmentContainerHeader.setId(taskHeader.getAllocationHeadId()); |
183 | - shipmentContainerHeader.setStatus(0); | |
184 | + shipmentContainerHeader.setStatus(QuantityConstant.SHIPMENT_CONTAINER_BUILD); | |
184 | 185 | shipmentContainerHeaderService.updateById(shipmentContainerHeader); |
185 | 186 | } |
186 | 187 | //盘点取消任务,恢复明细状态为1 |
187 | - if(taskHeader.getInternalTaskType() == 700) { | |
188 | + if(taskHeader.getInternalTaskType() == QuantityConstant.TASK_INTENERTYPE_CYCLECOUNT) { | |
188 | 189 | |
189 | 190 | CycleCountDetail cycleCountDetail = new CycleCountDetail(); |
190 | 191 | cycleCountDetail.setCompanyCode(taskDetail.getCompanyCode()); |
... | ... | @@ -205,7 +206,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
205 | 206 | } |
206 | 207 | |
207 | 208 | } |
208 | - if(taskHeader.getInternalTaskType()==100||taskHeader.getInternalTaskType()==200){ | |
209 | + if(taskHeader.getInternalTaskType()==QuantityConstant.TASK_INTENERTYPE_SHELF ||taskHeader.getInternalTaskType()==QuantityConstant.TASK_INTENERTYPE_PICKING){ | |
209 | 210 | if(taskHeader.getToLocation()!=null){ |
210 | 211 | //更新托盘、库位状态 |
211 | 212 | locationService.updateStatus(taskHeader.getToLocation(), "empty"); |
... | ... | @@ -235,7 +236,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
235 | 236 | if (shipmentContainerHeader == null) { |
236 | 237 | return AjaxResult.error("出库货箱" + shipmentContainerHeaderId + "未找到,操作中止"); |
237 | 238 | } |
238 | - if (shipmentContainerHeader.getStatus() > 9) { | |
239 | + if (shipmentContainerHeader.getStatus() >= QuantityConstant.SHIPMENT_CONTAINER_TASK) { | |
239 | 240 | return AjaxResult.error("出库货箱" + shipmentContainerHeader.getContainerCode() + "已经生成任务,请不要重复生成,操作中止"); |
240 | 241 | } |
241 | 242 | //获取所有子货箱 |
... | ... | @@ -257,7 +258,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
257 | 258 | //创建任务头 |
258 | 259 | TaskHeader task = new TaskHeader(); |
259 | 260 | //分拣出库 |
260 | - task.setTaskType(400); | |
261 | + task.setTaskType(QuantityConstant.TASK_TYPE_SORTINGSHIPMENT); | |
261 | 262 | task.setFromLocation(shipmentContainerHeader.getLocationCode()); |
262 | 263 | task.setToLocation(shipmentContainerHeader.getLocationCode()); |
263 | 264 | //判断是否整出任务,钱柜和AGV不能整出 |
... | ... | @@ -280,17 +281,17 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
280 | 281 | containerTotal = containerTotal.add(item.getQty()); |
281 | 282 | } |
282 | 283 | if (inventoryTotal.compareTo(containerTotal) == 0) { |
283 | - task.setTaskType(300);//整盘出库 | |
284 | + task.setTaskType(QuantityConstant.TASK_TYPE_WHOLESHIPMENT);//整盘出库 | |
284 | 285 | task.setToLocation(""); |
285 | 286 | } |
286 | 287 | |
287 | - task.setInternalTaskType(200); | |
288 | + task.setInternalTaskType(QuantityConstant.TASK_INTENERTYPE_PICKING); | |
288 | 289 | task.setAllocationHeadId(shipmentContainerHeader.getId()); |
289 | 290 | task.setWarehouseCode(shipmentContainerHeader.getWarehouseCode()); |
290 | 291 | task.setCompanyCode(shipmentContainerHeader.getCompanyCode()); |
291 | 292 | task.setAssignedUser(ShiroUtils.getLoginName()); |
292 | 293 | task.setConfirmedBy(ShiroUtils.getLoginName()); |
293 | - task.setStatus(0); | |
294 | + task.setStatus(QuantityConstant.TASK_STATUS_BUILD); | |
294 | 295 | task.setContainerCode(shipmentContainerHeader.getContainerCode()); |
295 | 296 | task.setCreatedBy(ShiroUtils.getLoginName()); |
296 | 297 | task.setCreated(new Date()); |
... | ... | @@ -321,7 +322,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
321 | 322 | taskDetail.setLot(shipmentContainerDetail.getLot()); |
322 | 323 | taskDetail.setBatch(shipmentContainerDetail.getBatch()); |
323 | 324 | taskDetail.setProjectNo(shipmentContainerDetail.getProjectNo()); |
324 | - taskDetail.setStatus(0); | |
325 | + taskDetail.setStatus(QuantityConstant.TASK_STATUS_BUILD); | |
325 | 326 | taskDetail.setWaveId(shipmentContainerDetail.getWaveId()); |
326 | 327 | taskDetail.setInventorySts(shipmentContainerDetail.getInventorySts()); |
327 | 328 | taskDetail.setCreatedBy(ShiroUtils.getLoginName()); |
... | ... | @@ -331,10 +332,10 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
331 | 332 | throw new ServiceException("新建任务明细失败,sql报错"); |
332 | 333 | } |
333 | 334 | |
334 | - shipmentContainerDetail.setStatus(10); | |
335 | + shipmentContainerDetail.setStatus(QuantityConstant.SHIPMENT_CONTAINER_TASK); | |
335 | 336 | } |
336 | 337 | //更新货位状态 |
337 | - shipmentContainerHeader.setStatus(10); | |
338 | + shipmentContainerHeader.setStatus(QuantityConstant.SHIPMENT_CONTAINER_TASK); | |
338 | 339 | flag = shipmentContainerHeaderService.updateById(shipmentContainerHeader); |
339 | 340 | if(flag == false){ |
340 | 341 | throw new ServiceException("修改组盘头状态失败,sql报错"); |
... | ... | @@ -359,12 +360,12 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
359 | 360 | for (Integer taskId : taskIds) { |
360 | 361 | task = taskHeaderService.getById(taskId); |
361 | 362 | |
362 | - if (task.getStatus() > 9) { | |
363 | + if (task.getStatus() >= QuantityConstant.TASK_STATUS_RELEASE) { | |
363 | 364 | return AjaxResult.error("任务" + taskId + "已经下发,请不要重复下发,操作中止"); |
364 | 365 | } |
365 | 366 | //修改任务头表 |
366 | 367 | task.setId(taskId); |
367 | - task.setStatus(10); | |
368 | + task.setStatus(QuantityConstant.TASK_STATUS_RELEASE); | |
368 | 369 | task.setStartPickDateTime(new Date()); //生成时间 |
369 | 370 | task.setLastUpdated(new Date()); |
370 | 371 | task.setLastUpdatedBy(ShiroUtils.getLoginName()); |
... | ... | @@ -375,14 +376,14 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
375 | 376 | List<TaskDetail> taskDetailList = taskDetailService.list(lambdaWrapper); |
376 | 377 | List<TaskDetail> taskDetails = new ArrayList<>(); |
377 | 378 | for (TaskDetail item:taskDetailList){ |
378 | - item.setStatus(10); | |
379 | + item.setStatus(QuantityConstant.TASK_STATUS_RELEASE); | |
379 | 380 | item.setLastUpdated(new Date()); |
380 | 381 | item.setLastUpdatedBy(ShiroUtils.getLoginName()); |
381 | 382 | item.setProcessStamp("100"); |
382 | 383 | taskDetails.add(item); |
383 | 384 | //盘点执行修改盘点单据状态为10 |
384 | - if(task.getTaskType() == 700){ | |
385 | - cycleCountDetailService.updataDetailStatus(item.getBillDetailId(),10); | |
385 | + if(task.getTaskType() == QuantityConstant.TASK_TYPE_CYCLECOUNT){ | |
386 | + cycleCountDetailService.updataDetailStatus(item.getBillDetailId(),QuantityConstant.CYCLECOUNT_STATUS_EXECUTING); | |
386 | 387 | } |
387 | 388 | } |
388 | 389 | if (!taskDetailService.saveOrUpdateBatch(taskDetails)){ |
... | ... | @@ -443,7 +444,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
443 | 444 | throw new ServiceException("任务" + taskId + "未找到,执行中止"); |
444 | 445 | } |
445 | 446 | //如果已完成则不管 |
446 | - if (task.getStatus() == 100) { | |
447 | + if (task.getStatus() == QuantityConstant.TASK_STATUS_COMPLETED) { | |
447 | 448 | throw new ServiceException("任务(" + taskId + ")任务已经是完成的!"); |
448 | 449 | } |
449 | 450 | //如果没有库位不能完成 |
... | ... | @@ -464,31 +465,31 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
464 | 465 | @Transactional |
465 | 466 | public void completeTask(TaskHeader task) { |
466 | 467 | //区分任务类型 |
467 | - if (task.getInternalTaskType() == 100) { | |
468 | + if (task.getInternalTaskType() == QuantityConstant.TASK_INTENERTYPE_SHELF) { | |
468 | 469 | //入库任务 |
469 | 470 | completeReceiptTask(task); |
470 | 471 | } |
471 | - if (task.getInternalTaskType() == 200) { | |
472 | + if (task.getInternalTaskType() == QuantityConstant.TASK_INTENERTYPE_PICKING) { | |
472 | 473 | // 出库任务 |
473 | 474 | completeShipmentTask(task); |
474 | 475 | } |
475 | 476 | // 900 出库查看,空托出库查看 |
476 | - if ( task.getTaskType() == 900) { | |
477 | + if ( task.getTaskType() == QuantityConstant.TASK_TYPE_VIEW) { | |
477 | 478 | completeSeeOutTask(task); |
478 | 479 | } |
479 | 480 | // 700 盘点 |
480 | - if ( task.getTaskType() == 700) { | |
481 | + if ( task.getTaskType() == QuantityConstant.TASK_TYPE_CYCLECOUNT) { | |
481 | 482 | completeCycleCountTask(task); |
482 | 483 | } |
483 | - if (task.getTaskType() == 800) { | |
484 | + if (task.getTaskType() == QuantityConstant.TASK_TYPE_TRANSFER) { | |
484 | 485 | // //移库 |
485 | 486 | completeTransferTask(task); |
486 | 487 | } |
487 | - if (task.getTaskType() == 500) { | |
488 | + if (task.getTaskType() == QuantityConstant.TASK_TYPE_EMPTYRECEIPT) { | |
488 | 489 | //空托盘入库 |
489 | 490 | completeEmptyIn(task); |
490 | 491 | } |
491 | - if (task.getTaskType() == 600) { | |
492 | + if (task.getTaskType() == QuantityConstant.TASK_TYPE_EMPTYSHIPMENT) { | |
492 | 493 | //空托盘出库 |
493 | 494 | completeEmptyOut(task); |
494 | 495 | } |
... | ... | @@ -507,7 +508,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
507 | 508 | } |
508 | 509 | for (Map<String, Object> map : taskReceiptContainerDetail) { |
509 | 510 | //将未完成的任务数量更新到库存表 |
510 | - if (DataUtils.getInteger(map.get("status")) < 100) { | |
511 | + if (DataUtils.getInteger(map.get("status")) < QuantityConstant.TASK_STATUS_COMPLETED) { | |
511 | 512 | LambdaQueryWrapper<InventoryDetail> inventory = Wrappers.lambdaQuery(); |
512 | 513 | inventory.eq(InventoryDetail::getWarehouseCode, ShiroUtils.getWarehouseCode()) |
513 | 514 | .eq(InventoryDetail::getLocationCode, task.getFromLocation()) |
... | ... | @@ -566,7 +567,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
566 | 567 | } |
567 | 568 | //记录库存交易记录 |
568 | 569 | InventoryTransaction inventoryTransaction = new InventoryTransaction(); |
569 | - inventoryTransaction.setTransactionType(10); | |
570 | + inventoryTransaction.setTransactionType(QuantityConstant.INVENTORY_TRANSACTION_RECEIPT); | |
570 | 571 | inventoryTransaction.setWarehouseCode(DataUtils.getString(map.get("warehouseCode"))); |
571 | 572 | inventoryTransaction.setCompanyCode(task.getCompanyCode()); |
572 | 573 | inventoryTransaction.setLocationCode(task.getToLocation()); |
... | ... | @@ -589,7 +590,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
589 | 590 | throw new ServiceException("新增库存记录失败"); |
590 | 591 | //修改任务明细的状态为完成 |
591 | 592 | TaskDetail taskDetail = new TaskDetail(); |
592 | - taskDetail.setStatus(100); | |
593 | + taskDetail.setStatus(QuantityConstant.TASK_STATUS_COMPLETED); | |
593 | 594 | taskDetail.setLastUpdatedBy(ShiroUtils.getLoginName()); |
594 | 595 | taskDetail.setAgingDate(new Date()); //入库时间 |
595 | 596 | LambdaUpdateWrapper<TaskDetail> lambdaUpdateWrapper = Wrappers.lambdaUpdate(); |
... | ... | @@ -600,7 +601,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
600 | 601 | } |
601 | 602 | |
602 | 603 | //修改任务主表状态,因为立库任务表单头只对应一个货箱,表单详情的任务会同时完成 |
603 | - task.setStatus(100); | |
604 | + task.setStatus(QuantityConstant.TASK_STATUS_COMPLETED); | |
604 | 605 | task.setLastUpdatedBy(ShiroUtils.getLoginName()); |
605 | 606 | task.setLastUpdated(new Date()); |
606 | 607 | LambdaUpdateWrapper<TaskHeader> taskHeaderLambdaUpdateWrapper = Wrappers.lambdaUpdate(); |
... | ... | @@ -628,7 +629,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
628 | 629 | } |
629 | 630 | //修改组盘表状态为20 |
630 | 631 | ReceiptContainerDetail receiptContainerDetail = new ReceiptContainerDetail(); |
631 | - receiptContainerDetail.setStatus(30); | |
632 | + receiptContainerDetail.setStatus(QuantityConstant.RECEIPT_CONTAINER_REVIEWSUCCESS); | |
632 | 633 | receiptContainerDetail.setProcessStamp("0"); |
633 | 634 | receiptContainerDetail.setLastUpdated(new Date()); |
634 | 635 | receiptContainerDetail.setLastUpdatedBy(ShiroUtils.getLoginName()); |
... | ... | @@ -644,15 +645,15 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
644 | 645 | receiptContainerHeader.setId(task.getAllocationHeadId()); |
645 | 646 | receiptContainerHeader.setLastUpdated(new Date()); |
646 | 647 | receiptContainerHeader.setLastUpdatedBy(ShiroUtils.getLoginName()); |
647 | - receiptContainerHeader.setStatus((short) 20); | |
648 | + receiptContainerHeader.setStatus((short) QuantityConstant.RECEIPT_CONTAINER_FINISHED.intValue()); | |
648 | 649 | if (!receiptContainerHeaderService.updateById(receiptContainerHeader)){ |
649 | 650 | throw new ServiceException("更新入库组盘头表状态失败"); |
650 | 651 | } |
651 | 652 | |
652 | 653 | //修改入库单状态 |
653 | 654 | ReceiptHeader receiptHeader = new ReceiptHeader(); |
654 | - receiptHeader.setFirstStatus(800); | |
655 | - receiptHeader.setLastStatus(800); | |
655 | + receiptHeader.setFirstStatus(QuantityConstant.RECEIPT_HEADER_POSTING); | |
656 | + receiptHeader.setLastStatus(QuantityConstant.RECEIPT_HEADER_POSTING); | |
656 | 657 | receiptHeader.setLastUpdatedBy(ShiroUtils.getLoginName()); |
657 | 658 | receiptHeader.setLastUpdated(new Date()); |
658 | 659 | LambdaUpdateWrapper<ReceiptHeader> receiptHeaderLambdaUpdateWrapper = Wrappers.lambdaUpdate(); |
... | ... | @@ -726,10 +727,10 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
726 | 727 | TaskHeader taskHeader = new TaskHeader(); |
727 | 728 | taskHeader.setWarehouseCode(ShiroUtils.getWarehouseCode()); |
728 | 729 | taskHeader.setCompanyCode(ShiroUtils.getCompanyCodeList().get(0));//获取第一个货主 |
729 | - taskHeader.setInternalTaskType(500); | |
730 | - taskHeader.setTaskType(800); | |
730 | + taskHeader.setInternalTaskType(QuantityConstant.TASK_INTENERTYPE_CHECK); | |
731 | + taskHeader.setTaskType(QuantityConstant.TASK_TYPE_TRANSFER); | |
731 | 732 | taskHeader.setContainerCode(loc1.getContainerCode()); |
732 | - taskHeader.setStatus(1); | |
733 | + taskHeader.setStatus(QuantityConstant.TASK_STATUS_BUILD); | |
733 | 734 | taskHeader.setFromLocation(sourceLocation); |
734 | 735 | taskHeader.setToLocation(destinationLocation); |
735 | 736 | taskHeader.setCreated(new Date()); |
... | ... | @@ -812,7 +813,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
812 | 813 | inventoryTransaction.setWarehouseCode(task.getWarehouseCode()); |
813 | 814 | inventoryTransaction.setLocationCode(taskDetail.getToLocation()); |
814 | 815 | inventoryTransaction.setContainerCode(taskDetail.getContainerCode()); |
815 | - inventoryTransaction.setTransactionType(50); | |
816 | + inventoryTransaction.setTransactionType(QuantityConstant.INVENTORY_TRANSACTION_ADJUSTPROPERTIES); | |
816 | 817 | inventoryTransaction.setMaterialCode(item.getMaterialCode()); |
817 | 818 | inventoryTransaction.setManufactureDate(item.getManufactureDate()); |
818 | 819 | inventoryTransaction.setMaterialName(item.getMaterialName()); |
... | ... | @@ -868,12 +869,12 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
868 | 869 | locationService.saveOrUpdate(loc1); |
869 | 870 | locationService.saveOrUpdate(loc2); |
870 | 871 | //更新taskHeader状态 |
871 | - task.setStatus(100); | |
872 | + task.setStatus(QuantityConstant.TASK_STATUS_COMPLETED); | |
872 | 873 | task.setLastUpdatedBy(ShiroUtils.getLoginName()); |
873 | 874 | task.setLastUpdated(new Date()); |
874 | 875 | taskHeaderService.saveOrUpdate(task); |
875 | 876 | //更新taskDetail状态 |
876 | - taskDetail.setStatus(100); | |
877 | + taskDetail.setStatus(QuantityConstant.TASK_STATUS_COMPLETED); | |
877 | 878 | taskDetail.setLastUpdatedBy(ShiroUtils.getLoginName()); |
878 | 879 | taskDetail.setLastUpdated(new Date()); |
879 | 880 | taskDetailService.saveOrUpdate(taskDetail); |
... | ... | @@ -919,10 +920,10 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
919 | 920 | TaskHeader taskHeader = new TaskHeader(); |
920 | 921 | taskHeader.setWarehouseCode(inventoryHeader.getWarehouseCode()); |
921 | 922 | taskHeader.setCompanyCode(inventoryHeader.getCompanyCode());//货主 |
922 | - taskHeader.setInternalTaskType(400); | |
923 | - taskHeader.setTaskType(900); | |
923 | + taskHeader.setInternalTaskType(QuantityConstant.TASK_INTENERTYPE_WORK); | |
924 | + taskHeader.setTaskType(QuantityConstant.TASK_TYPE_VIEW); | |
924 | 925 | taskHeader.setContainerCode(inventoryHeader.getContainerCode()); |
925 | - taskHeader.setStatus(1); | |
926 | + taskHeader.setStatus(QuantityConstant.TASK_STATUS_BUILD); | |
926 | 927 | taskHeader.setFromLocation(inventoryHeader.getLocationCode()); |
927 | 928 | taskHeader.setToLocation(inventoryHeader.getLocationCode()); |
928 | 929 | taskHeader.setCreated(new Date()); |
... | ... | @@ -968,7 +969,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
968 | 969 | @Transactional |
969 | 970 | @Override |
970 | 971 | public AjaxResult completeSeeOutTask(TaskHeader taskHeader) { |
971 | - taskHeader.setStatus(100); | |
972 | + taskHeader.setStatus(QuantityConstant.TASK_STATUS_COMPLETED); | |
972 | 973 | taskHeader.setLastUpdatedBy(ShiroUtils.getLoginName()); //更新用户 |
973 | 974 | taskHeader.setLastUpdated(new Date()); //更新时间 |
974 | 975 | //task更新明细单总的状态 |
... | ... | @@ -980,7 +981,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
980 | 981 | List<TaskDetail> taskDetailList = taskDetailService.list(lambdaQueryWrapper);//查询子单 |
981 | 982 | List<TaskDetail> list = new CopyOnWriteArrayList<>(); |
982 | 983 | for(TaskDetail item:taskDetailList){ |
983 | - item.setStatus(100); | |
984 | + item.setStatus(QuantityConstant.TASK_STATUS_COMPLETED); | |
984 | 985 | item.setLastUpdatedBy(ShiroUtils.getLoginName()); //更新用户 |
985 | 986 | item.setLastUpdated(new Date()); //更新时间 |
986 | 987 | list.add(item); |
... | ... | @@ -1005,7 +1006,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1005 | 1006 | /*盘点完成,传入任务主单,查出任务明细,通过任务明细查找盘点的明细单, |
1006 | 1007 | 完成任务同时,修改盘点细单和主单的状态,完成后库存锁复位*/ |
1007 | 1008 | //修改任务主单状态 |
1008 | - taskHeader.setStatus(100); | |
1009 | + taskHeader.setStatus(QuantityConstant.TASK_STATUS_COMPLETED); | |
1009 | 1010 | taskHeader.setLastUpdatedBy(ShiroUtils.getLoginName()); //更新用户 |
1010 | 1011 | taskHeader.setLastUpdated(new Date()); //更新时间 |
1011 | 1012 | //task更新明细单状态 |
... | ... | @@ -1019,13 +1020,13 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1019 | 1020 | //修改任务明细状态的同时查找到盘点明细的条目并修改状态,最后修改主单状态 |
1020 | 1021 | List<CycleCountDetail> cycleCountDetailList = new CopyOnWriteArrayList<>(); |
1021 | 1022 | for(TaskDetail item:taskDetailList){ |
1022 | - item.setStatus(100); | |
1023 | + item.setStatus(QuantityConstant.TASK_STATUS_COMPLETED); | |
1023 | 1024 | item.setLastUpdatedBy(ShiroUtils.getLoginName()); //更新用户 |
1024 | 1025 | item.setLastUpdated(new Date()); //更新时间 |
1025 | 1026 | list.add(item); |
1026 | 1027 | |
1027 | 1028 | CycleCountDetail cycleCountDetail = cycleCountDetailService.getById(item.getBillDetailId());//盘点明细 |
1028 | - cycleCountDetail.setEnableStatus(100); | |
1029 | + cycleCountDetail.setEnableStatus(QuantityConstant.CYCLECOUNT_STATUS_COMPLETED); | |
1029 | 1030 | cycleCountDetail.setCompletedBy(ShiroUtils.getLoginName()); |
1030 | 1031 | cycleCountDetail.setCompletedAt(new Date()); |
1031 | 1032 | cycleCountDetailList.add(cycleCountDetail); |
... | ... | @@ -1055,7 +1056,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1055 | 1056 | public void completeEmptyIn(TaskHeader taskHeader) { |
1056 | 1057 | |
1057 | 1058 | //完成任务,修改主单和明细状态 |
1058 | - taskHeader.setStatus(100); | |
1059 | + taskHeader.setStatus(QuantityConstant.TASK_STATUS_COMPLETED); | |
1059 | 1060 | taskHeader.setLastUpdatedBy(ShiroUtils.getLoginName()); |
1060 | 1061 | taskHeader.setLastUpdated(new Date()); |
1061 | 1062 | //taskHeaderService.saveOrUpdate(taskHeader); |
... | ... | @@ -1067,7 +1068,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1067 | 1068 | LambdaQueryWrapper lambdaQueryWrapper = Wrappers.lambdaQuery(taskDetail); |
1068 | 1069 | List<TaskDetail> taskDetailList = taskDetailService.list(lambdaQueryWrapper);//查询子单 |
1069 | 1070 | for (TaskDetail item : taskDetailList) { |
1070 | - item.setStatus(100); | |
1071 | + item.setStatus(QuantityConstant.TASK_STATUS_COMPLETED); | |
1071 | 1072 | item.setLastUpdatedBy(ShiroUtils.getLoginName()); //更新用户 |
1072 | 1073 | item.setLastUpdated(new Date()); //更新时间 |
1073 | 1074 | taskDetailList.add(item); |
... | ... | @@ -1090,7 +1091,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1090 | 1091 | @Transactional |
1091 | 1092 | public void completeEmptyOut(TaskHeader taskHeader) { |
1092 | 1093 | |
1093 | - taskHeader.setStatus(100); | |
1094 | + taskHeader.setStatus(QuantityConstant.TASK_STATUS_COMPLETED); | |
1094 | 1095 | taskHeader.setLastUpdatedBy(ShiroUtils.getLoginName()); |
1095 | 1096 | taskHeader.setLastUpdated(new Date()); |
1096 | 1097 | //taskHeaderService.saveOrUpdate(taskHeader); |
... | ... | @@ -1102,7 +1103,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1102 | 1103 | LambdaQueryWrapper lambdaQueryWrapper = Wrappers.lambdaQuery(taskDetail); |
1103 | 1104 | List<TaskDetail> taskDetailList = taskDetailService.list(lambdaQueryWrapper);//查询子单 |
1104 | 1105 | for (TaskDetail item : taskDetailList) { |
1105 | - item.setStatus(100); | |
1106 | + item.setStatus(QuantityConstant.TASK_STATUS_COMPLETED); | |
1106 | 1107 | item.setLastUpdatedBy(ShiroUtils.getLoginName()); //更新用户 |
1107 | 1108 | item.setLastUpdated(new Date()); //更新时间 |
1108 | 1109 | taskDetailList.add(item); |
... | ... | @@ -1146,15 +1147,15 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1146 | 1147 | |
1147 | 1148 | if (list.size() < 1) |
1148 | 1149 | throw new ServiceException("没有组盘明细,请先组盘!"); |
1149 | - if (receiptContainerHeader.getStatus() == 0) { | |
1150 | - if (receiptContainerHeader.getStatus().intValue() < 10) { | |
1151 | - receiptContainerHeader.setStatus((short) 10); | |
1150 | + if (receiptContainerHeader.getStatus() == QuantityConstant.RECEIPT_CONTAINER_BUILD.intValue()) { | |
1151 | + if (receiptContainerHeader.getStatus().intValue() < QuantityConstant.RECEIPT_CONTAINER_TASK) { | |
1152 | + receiptContainerHeader.setStatus((short) QuantityConstant.RECEIPT_CONTAINER_TASK.intValue()); | |
1152 | 1153 | receiptContainerHeaderService.updateById(receiptContainerHeader); |
1153 | 1154 | } |
1154 | 1155 | //添加任务主表 |
1155 | 1156 | TaskHeader task = new TaskHeader(); |
1156 | 1157 | task.setAllocationHeadId(receiptContainerHeader.getId()); |
1157 | - task.setInternalTaskType(100); | |
1158 | + task.setInternalTaskType(QuantityConstant.TASK_INTENERTYPE_SHELF); | |
1158 | 1159 | task.setWarehouseCode(receiptContainerHeader.getWarehouseCode()); |
1159 | 1160 | task.setCompanyCode(receiptContainerHeader.getCompanyCode()); |
1160 | 1161 | task.setFromLocation(receiptContainerHeader.getFromLocation()); |
... | ... | @@ -1171,7 +1172,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1171 | 1172 | TaskDetail taskDetail = new TaskDetail(); |
1172 | 1173 | taskDetail.setTaskId(task.getId()); |
1173 | 1174 | taskDetail.setTaskType(Integer.valueOf(receiptContainerHeaderService.getById(item.getReceiptContainerId()).getTaskType())); |
1174 | - taskDetail.setInternalTaskType(100); | |
1175 | + taskDetail.setInternalTaskType(QuantityConstant.TASK_INTENERTYPE_SHELF); | |
1175 | 1176 | taskDetail.setWarehouseCode(task.getWarehouseCode()); |
1176 | 1177 | taskDetail.setAllocationId(item.getReceiptId()); |
1177 | 1178 | taskDetail.setCompanyCode(task.getCompanyCode()); |
... | ... | @@ -1193,7 +1194,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1193 | 1194 | } |
1194 | 1195 | |
1195 | 1196 | //更新入库组盘明细状态 |
1196 | - item.setStatus(10); | |
1197 | + item.setStatus(QuantityConstant.RECEIPT_CONTAINER_TASK); | |
1197 | 1198 | if (!receiptContainerDetailService.updateById(item)){ |
1198 | 1199 | throw new ServiceException("更新入库组盘明细状态出错"); |
1199 | 1200 | } |
... | ... | @@ -1230,7 +1231,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1230 | 1231 | List<TaskDetail> taskDetails = taskDetailService.list(lambdaQueryWrapper); |
1231 | 1232 | List<Integer> shipmentHeadIds = new ArrayList<>(); |
1232 | 1233 | for(TaskDetail taskDetail : taskDetails){ |
1233 | - if(taskDetail.getStatus()<20){ | |
1234 | + if(taskDetail.getStatus()<QuantityConstant.TASK_STATUS_RUNNING){ | |
1234 | 1235 | //获取出库子货箱 |
1235 | 1236 | ShipmentContainerDetail shipmentContainerDetail = shipmentContainerDetailService.getById(taskDetail.getAllocationId()); |
1236 | 1237 | //取出子单据 |
... | ... | @@ -1259,7 +1260,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1259 | 1260 | inventoryHeaderService.updateById(inventoryHeader); |
1260 | 1261 | } |
1261 | 1262 | //设置子任务状态为已执行 |
1262 | - taskDetail.setStatus(100); | |
1263 | + taskDetail.setStatus(QuantityConstant.TASK_STATUS_COMPLETED); | |
1263 | 1264 | taskDetail.setLastUpdatedBy(ShiroUtils.getLoginName()); |
1264 | 1265 | taskDetail.setLastUpdated(new Date());//完成时间 |
1265 | 1266 | taskDetailService.updateById(taskDetail); |
... | ... | @@ -1269,7 +1270,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1269 | 1270 | inventoryTransaction.setCompanyCode(shipmentDetail.getCompanyCode()); |
1270 | 1271 | inventoryTransaction.setLocationCode(inventoryDetail.getLocationCode()); |
1271 | 1272 | inventoryTransaction.setContainerCode(inventoryDetail.getContainerCode()); |
1272 | - inventoryTransaction.setTransactionType(20); | |
1273 | + inventoryTransaction.setTransactionType(QuantityConstant.INVENTORY_TRANSACTION_SHIPMENT); | |
1273 | 1274 | inventoryTransaction.setMaterialCode(shipmentDetail.getMaterialCode()); |
1274 | 1275 | inventoryTransaction.setMaterialName(shipmentDetail.getMaterialName()); |
1275 | 1276 | inventoryTransaction.setMaterialSpec(shipmentDetail.getMaterialSpec()); |
... | ... | @@ -1295,7 +1296,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1295 | 1296 | } |
1296 | 1297 | } |
1297 | 1298 | //设置主任务为已执行 |
1298 | - task.setStatus(100); | |
1299 | + task.setStatus(QuantityConstant.TASK_STATUS_COMPLETED); | |
1299 | 1300 | task.setLastUpdatedBy(ShiroUtils.getLoginName()); |
1300 | 1301 | task.setLastUpdated(new Date()); |
1301 | 1302 | taskHeaderService.updateById(task); |
... | ... | @@ -1310,7 +1311,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1310 | 1311 | throw new ServiceException("系统没有"+task.getToLocation()+"库位"); |
1311 | 1312 | } |
1312 | 1313 | locationRecord.setStatus("empty"); |
1313 | - if(task.getTaskType()==300) { | |
1314 | + if(task.getTaskType()==QuantityConstant.TASK_TYPE_WHOLESHIPMENT) { | |
1314 | 1315 | locationRecord.setContainerCode(""); |
1315 | 1316 | } |
1316 | 1317 | locationService.updateById(locationRecord); |
... | ... | @@ -1321,7 +1322,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1321 | 1322 | if(ctn == null){ |
1322 | 1323 | throw new ServiceException("系统无此容器"); |
1323 | 1324 | } |
1324 | - if(task.getTaskType()==300) { | |
1325 | + if(task.getTaskType()==QuantityConstant.TASK_TYPE_WHOLESHIPMENT) { | |
1325 | 1326 | if(ctn.getContainerType().equals("LS")){ |
1326 | 1327 | Boolean flag = containerService.removeById(ctn.getId()); |
1327 | 1328 | if(flag == false){ |
... | ... | @@ -1351,7 +1352,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1351 | 1352 | //设置出库货箱状态为拣货任务完成 |
1352 | 1353 | for(TaskDetail taskDetail : taskDetails) { |
1353 | 1354 | ShipmentContainerDetail shipmentContainerDetail = new ShipmentContainerDetail(); |
1354 | - shipmentContainerDetail.setStatus(30); | |
1355 | + shipmentContainerDetail.setStatus(QuantityConstant.SHIPMENT_CONTAINER_REVIEWSUCCESS); | |
1355 | 1356 | shipmentContainerDetail.setLastUpdated(new Date()); |
1356 | 1357 | shipmentContainerDetail.setLastUpdatedBy(ShiroUtils.getLoginName()); |
1357 | 1358 | LambdaUpdateWrapper<ShipmentContainerDetail> shipmentContainerDetailLambdaUpdateWrapper = Wrappers.lambdaUpdate(); |
... | ... | @@ -1362,7 +1363,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1362 | 1363 | } |
1363 | 1364 | //设置出库货箱表头状态为拣货任务完成 |
1364 | 1365 | ShipmentContainerHeader shipmentContainerHeader = new ShipmentContainerHeader(); |
1365 | - shipmentContainerHeader.setStatus(30); | |
1366 | + shipmentContainerHeader.setStatus(QuantityConstant.SHIPMENT_CONTAINER_REVIEWSUCCESS); | |
1366 | 1367 | shipmentContainerHeader.setLastUpdated(new Date()); |
1367 | 1368 | shipmentContainerHeader.setLastUpdatedBy(ShiroUtils.getLoginName()); |
1368 | 1369 | LambdaUpdateWrapper<ShipmentContainerHeader> shipmentContainerHeaderLambdaUpdateWrapper = Wrappers.lambdaUpdate(); |
... | ... | @@ -1384,7 +1385,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1384 | 1385 | throw new ServiceException("查找出库单明细失败"); |
1385 | 1386 | } |
1386 | 1387 | if (shipmentDetail.getShipQty().compareTo(shipmentDetail.getRequestQty()) == 0) { |
1387 | - shipmentDetail.setStatus(500); | |
1388 | + shipmentDetail.setStatus(QuantityConstant.SHIPMENT_HEADER_COMPLETED); | |
1388 | 1389 | shipmentDetailService.updateById(shipmentDetail); |
1389 | 1390 | } |
1390 | 1391 | ids.add(shipmentDetail.getShipmentId()); |
... | ... | @@ -1396,11 +1397,11 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1396 | 1397 | Map<String,Integer> status = shipmentDetailService.selectStatus(shipmentHeader.getId()); |
1397 | 1398 | Integer maxStatus = status.get("maxStatus"); |
1398 | 1399 | Integer minStatus = status.get("minStatus"); |
1399 | - if(maxStatus == 500){ | |
1400 | - shipmentHeader.setFirstStatus(500); | |
1400 | + if(maxStatus == QuantityConstant.SHIPMENT_HEADER_COMPLETED){ | |
1401 | + shipmentHeader.setFirstStatus(QuantityConstant.SHIPMENT_HEADER_COMPLETED); | |
1401 | 1402 | } |
1402 | - if(minStatus == 500) { | |
1403 | - shipmentHeader.setLastStatus(500); | |
1403 | + if(minStatus == QuantityConstant.SHIPMENT_HEADER_COMPLETED) { | |
1404 | + shipmentHeader.setLastStatus(QuantityConstant.SHIPMENT_HEADER_COMPLETED); | |
1404 | 1405 | } |
1405 | 1406 | shipmentHeader.setLastUpdatedBy(ShiroUtils.getLoginName()); |
1406 | 1407 | shipmentHeader.setLastUpdated(new Date()); |
... | ... |
src/main/resources/application-dev.yml
1 | -# \u6570\u636E\u6E90\u914D\u7F6E | |
1 | +# 数据源配置 | |
2 | 2 | spring: |
3 | 3 | datasource: |
4 | 4 | type: com.alibaba.druid.pool.DruidDataSource |
5 | 5 | driverClassName: com.mysql.cj.jdbc.Driver |
6 | 6 | druid: |
7 | - # \u4E3B\u5E93\u6570\u636E\u6E90 | |
7 | + # 主库 | |
8 | 8 | master: |
9 | - url: jdbc:mysql://172.16.29.45:3306/wms_v2?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false | |
9 | + url: jdbc:mysql://172.16.29.45:3306/wms_v2?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2b8 | |
10 | 10 | username: softhuaheng |
11 | 11 | password: HHrobot123. |
12 | - # \u4ECE\u5E93\u6570\u636E\u6E90 | |
12 | + # 从库 | |
13 | 13 | slave: |
14 | - # \u4ECE\u6570\u636E\u6E90\u5F00\u5173/\u9ED8\u8BA4\u5173\u95ED | |
14 | + # 从库不启用 | |
15 | 15 | enabled: false |
16 | 16 | url: |
17 | 17 | username: |
18 | 18 | password: |
19 | - # \u521D\u59CB\u8FDE\u63A5\u6570 | |
19 | + # 初始连接数 | |
20 | 20 | initialSize: 5 |
21 | - # \u6700\u5C0F\u8FDE\u63A5\u6C60\u6570\u91CF | |
21 | + # 最小连接池数量 | |
22 | 22 | minIdle: 10 |
23 | - # \u6700\u5927\u8FDE\u63A5\u6C60\u6570\u91CF | |
23 | + # 最大连接池数量 | |
24 | 24 | maxActive: 20 |
25 | - # \u914D\u7F6E\u83B7\u53D6\u8FDE\u63A5\u7B49\u5F85\u8D85\u65F6\u7684\u65F6\u95F4 | |
26 | - maxWait: 60000 | |
27 | - # \u914D\u7F6E\u95F4\u9694\u591A\u4E45\u624D\u8FDB\u884C\u4E00\u6B21\u68C0\u6D4B\uFF0C\u68C0\u6D4B\u9700\u8981\u5173\u95ED\u7684\u7A7A\u95F2\u8FDE\u63A5\uFF0C\u5355\u4F4D\u662F\u6BEB\u79D2 | |
25 | + # 配置获取连接等待超时的时间 | |
26 | + maxWait: 5000 | |
27 | + # \配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 | |
28 | 28 | timeBetweenEvictionRunsMillis: 60000 |
29 | - # \u914D\u7F6E\u4E00\u4E2A\u8FDE\u63A5\u5728\u6C60\u4E2D\u6700\u5C0F\u751F\u5B58\u7684\u65F6\u95F4\uFF0C\u5355\u4F4D\u662F\u6BEB\u79D2 | |
30 | - minEvictableIdleTimeMillis: 300000 | |
31 | - # \u914D\u7F6E\u4E00\u4E2A\u8FDE\u63A5\u5728\u6C60\u4E2D\u6700\u5927\u751F\u5B58\u7684\u65F6\u95F4\uFF0C\u5355\u4F4D\u662F\u6BEB\u79D2 | |
32 | - maxEvictableIdleTimeMillis: 900000 | |
33 | - # \u914D\u7F6E\u68C0\u6D4B\u8FDE\u63A5\u662F\u5426\u6709\u6548 | |
29 | + # 配置一个连接在池中最小生存的时间,单位是毫秒 | |
30 | + minEvictableIdleTimeMillis: 30000 | |
31 | + #配置一个连接在池中最大生存的时间,单位是毫秒 | |
32 | + maxEvictableIdleTimeMillis: 300000 | |
33 | + # 配置检测连接是否有效 | |
34 | 34 | validationQuery: SELECT 1 FROM DUAL |
35 | 35 | testWhileIdle: true |
36 | 36 | testOnBorrow: false |
... | ... | @@ -39,16 +39,16 @@ spring: |
39 | 39 | enabled: true |
40 | 40 | statViewServlet: |
41 | 41 | enabled: true |
42 | - # \u8BBE\u7F6E\u767D\u540D\u5355\uFF0C\u4E0D\u586B\u5219\u5141\u8BB8\u6240\u6709\u8BBF\u95EE | |
42 | + # 设置白名单,不填则允许所有访问 | |
43 | 43 | allow: |
44 | 44 | url-pattern: /druid/* |
45 | - # \u63A7\u5236\u53F0\u7BA1\u7406\u7528\u6237\u540D\u548C\u5BC6\u7801 | |
45 | + # 控制台管理用户名和密码 | |
46 | 46 | login-username: |
47 | 47 | login-password: |
48 | 48 | filter: |
49 | 49 | stat: |
50 | 50 | enabled: true |
51 | - # \u6162SQL\u8BB0\u5F55 | |
51 | + # 慢SQL记录 | |
52 | 52 | log-slow-sql: true |
53 | 53 | slow-sql-millis: 1000 |
54 | 54 | merge-sql: true |
... | ... | @@ -56,7 +56,7 @@ spring: |
56 | 56 | config: |
57 | 57 | multi-statement-allow: true |
58 | 58 | |
59 | -#\u65E5\u5FD7\u914D\u7F6E | |
59 | +#日志配置 | |
60 | 60 | logging: |
61 | 61 | level: |
62 | 62 | com.huaheng: debug |
... | ... |
src/main/resources/application-druid.properties
... | ... | @@ -2,7 +2,7 @@ |
2 | 2 | spring.datasource.type=com.alibaba.druid.pool.DruidDataSource |
3 | 3 | spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver |
4 | 4 | # \u4E3B\u5E93 |
5 | -spring.datasource.druid.master.url=jdbc:mysql://172.16.29.45:3306/wms_v2?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false | |
5 | +spring.datasource.druid.master.url=jdbc:mysql://172.16.29.45:3306/wms_v2?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2b8 | |
6 | 6 | #spring.datasource.druid.master.url=jdbc:mysql://172.16.29.45:3306/huahengExample?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false |
7 | 7 | #spring.datasource.druid.master.url=jdbc:mysql://localhost:3306/wms2.0?characterEncoding=utf8&serverTimezone=GMT%2b8 |
8 | 8 | |
... | ... |
src/main/resources/templates/config/cycleCountPreference/cycleCountPreference.html
1 | 1 | <!DOCTYPE HTML> |
2 | -<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.w3.org/1999/xhtml"> | |
2 | +<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"> | |
3 | 3 | <meta charset="utf-8"> |
4 | 4 | <head th:include="include :: header"></head> |
5 | 5 | <body class="gray-bg"> |
... | ... | @@ -43,7 +43,8 @@ |
43 | 43 | </form> |
44 | 44 | </div> |
45 | 45 | <div class="btn-group hidden-xs" id="toolbar" role="group"> |
46 | - <a class="btn btn-outline btn-success btn-rounded" onclick="$.operate.add()" > | |
46 | + <a class="btn btn-outline btn-success btn-rounded" onclick="$.operate.add()" | |
47 | + shiro:hasPermission="config:cycleCountPreference:add"> | |
47 | 48 | <i class="fa fa-plus"></i> 新增 |
48 | 49 | </a> |
49 | 50 | </div> |
... | ... | @@ -224,8 +225,8 @@ |
224 | 225 | align: 'center', |
225 | 226 | formatter: function(value, row, index) { |
226 | 227 | var actions = []; |
227 | - actions.push('<a class="btn btn-success btn-xs " href="#" onclick="$.operate.edit(\'' + row.id + '\')" ><i class="fa fa-edit"></i>修改</a> '); | |
228 | - actions.push('<a class="btn btn-danger btn-xs " href="#" onclick="$.operate.remove(\'' + row.id + '\')" ><i class="fa fa-trash-o"></i>删除</a>'); | |
228 | + actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.id + '\')" ><i class="fa fa-edit"></i>修改</a> '); | |
229 | + actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.id + '\')" ><i class="fa fa-trash-o"></i>删除</a>'); | |
229 | 230 | return actions.join(''); |
230 | 231 | } |
231 | 232 | }] |
... | ... |