Commit cc9dad801d54ffd8efebc4aa0359b99915747fe6
Merge branch 'develop' of http://172.16.29.40:8010/wms/wms4 into develop
* 'develop' of http://172.16.29.40:8010/wms/wms4: 入库增加序列号 增加出库预配盘
Showing
18 changed files
with
290 additions
and
77 deletions
ant-design-vue-jeecg/src/views/system/inventory/InventoryDetailList.vue
... | ... | @@ -216,11 +216,11 @@ export default { |
216 | 216 | align: 'center', |
217 | 217 | dataIndex: 'batch' |
218 | 218 | }, |
219 | - // { | |
220 | - // title: '序列号', | |
221 | - // align: "center", | |
222 | - // dataIndex: 'sn' | |
223 | - // }, | |
219 | + { | |
220 | + title: '序列号', | |
221 | + align: "center", | |
222 | + dataIndex: 'sn' | |
223 | + }, | |
224 | 224 | { |
225 | 225 | title: '入库日期', |
226 | 226 | align: 'center', |
... | ... |
ant-design-vue-jeecg/src/views/system/inventory/SimpleInventoryDetailList.vue
... | ... | @@ -350,11 +350,11 @@ export default { |
350 | 350 | align: 'center', |
351 | 351 | dataIndex: 'batch' |
352 | 352 | }, |
353 | - // { | |
354 | - // title:'序列号', | |
355 | - // align:"center", | |
356 | - // dataIndex: 'sn' | |
357 | - // }, | |
353 | + { | |
354 | + title:'序列号', | |
355 | + align:"center", | |
356 | + dataIndex: 'sn' | |
357 | + }, | |
358 | 358 | { |
359 | 359 | title: '入库日期', |
360 | 360 | align: 'center', |
... | ... |
ant-design-vue-jeecg/src/views/system/receipt/ReceiptContainerDetailList.vue
ant-design-vue-jeecg/src/views/system/shipment/ShipmentContainerDetailList.vue
ant-design-vue-jeecg/src/views/system/task/TaskDetailList.vue
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/mes/entity/MaterialInfo.java
... | ... | @@ -28,6 +28,11 @@ public class MaterialInfo implements Comparable<MaterialInfo> { |
28 | 28 | */ |
29 | 29 | @ApiModelProperty(value = "顺序") |
30 | 30 | private int sequence; |
31 | + /** | |
32 | + * 序列号 | |
33 | + */ | |
34 | + @ApiModelProperty(value = "序列号") | |
35 | + private String sn; | |
31 | 36 | |
32 | 37 | @Override |
33 | 38 | public int compareTo(@NotNull MaterialInfo o) { |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/mes/servuce/impl/MesServiceImpl.java
... | ... | @@ -112,30 +112,28 @@ public class MesServiceImpl implements IMesService { |
112 | 112 | if (receiptDetailList == null || receiptDetailList.size() == 0) { |
113 | 113 | return Result.error("MES下发入库信息,没有找到匹配的入库单详情, 上游单号:" + referCode); |
114 | 114 | } |
115 | - for (ReceiptDetail receiptDetail : receiptDetailList) { | |
116 | - String materialCode = receiptDetail.getMaterialCode(); | |
117 | - BigDecimal taskQty = BigDecimal.ZERO; | |
118 | - boolean hav = false; | |
119 | - for (MaterialInfo materialInfo : materialInfoList) { | |
115 | + | |
116 | + for (MaterialInfo materialInfo : materialInfoList) { | |
117 | + for (ReceiptDetail receiptDetail : receiptDetailList) { | |
118 | + String materialCode = receiptDetail.getMaterialCode(); | |
119 | + BigDecimal taskQty = BigDecimal.ZERO; | |
120 | 120 | if (materialInfo.getMaterialCode().equals(materialCode)) { |
121 | - hav = true; | |
122 | 121 | taskQty = materialInfo.getQty(); |
123 | - break; | |
122 | + String sn = materialInfo.getSn(); | |
123 | + Receive receive = new Receive(); | |
124 | + receive.setId(receiptDetail.getId()); | |
125 | + receive.setContainerCode(containerCode); | |
126 | + receive.setMaterialCode(materialCode); | |
127 | + receive.setMaterialName(receiptDetail.getMaterialName()); | |
128 | + receive.setMaterialSpec(receiptDetail.getMaterialSpec()); | |
129 | + receive.setMaterialUnit(receiptDetail.getMaterialUnit()); | |
130 | + receive.setInventoryStatus(receiptDetail.getInventoryStatus()); | |
131 | + receive.setQty(receiptDetail.getQty()); | |
132 | + receive.setSn(sn); | |
133 | + receive.setTaskQty(taskQty); | |
134 | + receiveList.add(receive); | |
124 | 135 | } |
125 | 136 | } |
126 | - if (hav) { | |
127 | - Receive receive = new Receive(); | |
128 | - receive.setId(receiptDetail.getId()); | |
129 | - receive.setContainerCode(containerCode); | |
130 | - receive.setMaterialCode(materialCode); | |
131 | - receive.setMaterialName(receiptDetail.getMaterialName()); | |
132 | - receive.setMaterialSpec(receiptDetail.getMaterialSpec()); | |
133 | - receive.setMaterialUnit(receiptDetail.getMaterialUnit()); | |
134 | - receive.setInventoryStatus(receiptDetail.getInventoryStatus()); | |
135 | - receive.setQty(receiptDetail.getQty()); | |
136 | - receive.setTaskQty(taskQty); | |
137 | - receiveList.add(receive); | |
138 | - } | |
139 | 137 | } |
140 | 138 | Result result = receiveService.receiving(receiveList, warehouseCode); |
141 | 139 | if (!result.isSuccess()) { |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/tv/TvController.java
1 | 1 | package org.jeecg.modules.wms.api.tv; |
2 | 2 | |
3 | -import cn.hutool.core.collection.CollUtil; | |
4 | -import cn.hutool.core.collection.CollectionUtil; | |
5 | -import cn.hutool.core.date.DateUtil; | |
6 | -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |
7 | -import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; | |
8 | -import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |
9 | -import io.swagger.annotations.Api; | |
10 | -import io.swagger.annotations.ApiOperation; | |
11 | -import lombok.extern.slf4j.Slf4j; | |
3 | +import java.math.BigDecimal; | |
4 | +import java.util.*; | |
5 | +import java.util.stream.Collectors; | |
6 | + | |
7 | +import javax.annotation.Resource; | |
8 | +import javax.servlet.http.HttpServletResponse; | |
9 | + | |
12 | 10 | import org.jeecg.common.api.vo.Result; |
13 | 11 | import org.jeecg.modules.wms.api.mobile.entity.TvTaskVo; |
14 | 12 | import org.jeecg.modules.wms.config.location.entity.Location; |
... | ... | @@ -18,27 +16,29 @@ import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryDetail; |
18 | 16 | import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryDetailService; |
19 | 17 | import org.jeecg.modules.wms.inventory.inventoryTransaction.entity.InventoryTransaction; |
20 | 18 | import org.jeecg.modules.wms.inventory.inventoryTransaction.service.IInventoryTransactionService; |
19 | +import org.jeecg.modules.wms.shipment.shipmentContainerAdvice.entity.ShipmentContainerAdvice; | |
20 | +import org.jeecg.modules.wms.shipment.shipmentContainerAdvice.service.IShipmentContainerAdviceService; | |
21 | 21 | import org.jeecg.modules.wms.shipment.shipmentHeader.entity.ShipmentDetail; |
22 | 22 | import org.jeecg.modules.wms.shipment.shipmentHeader.service.IShipmentDetailService; |
23 | 23 | import org.jeecg.modules.wms.task.taskHeader.entity.TaskDetail; |
24 | 24 | import org.jeecg.modules.wms.task.taskHeader.entity.TaskHeader; |
25 | -import org.jeecg.modules.wms.task.taskHeader.service.ITaskDetailService; | |
26 | -import org.jeecg.modules.wms.task.taskHeader.service.ITaskHeaderService; | |
27 | 25 | import org.jeecg.modules.wms.task.taskHeader.service.impl.TaskDetailServiceImpl; |
28 | 26 | import org.jeecg.modules.wms.task.taskHeader.service.impl.TaskHeaderServiceImpl; |
29 | 27 | import org.jeecg.utils.StringUtils; |
30 | 28 | import org.jeecg.utils.constant.QuantityConstant; |
31 | -import org.jeecg.utils.support.PassApiAuthentication; | |
32 | 29 | import org.springframework.beans.factory.annotation.Value; |
33 | 30 | import org.springframework.web.bind.annotation.GetMapping; |
34 | 31 | import org.springframework.web.bind.annotation.RequestMapping; |
35 | 32 | import org.springframework.web.bind.annotation.RestController; |
36 | 33 | |
37 | -import javax.annotation.Resource; | |
38 | -import javax.servlet.http.HttpServletResponse; | |
39 | -import java.math.BigDecimal; | |
40 | -import java.util.*; | |
41 | -import java.util.stream.Collectors; | |
34 | +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |
35 | +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; | |
36 | +import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |
37 | + | |
38 | +import cn.hutool.core.collection.CollUtil; | |
39 | +import cn.hutool.core.date.DateUtil; | |
40 | +import io.swagger.annotations.Api; | |
41 | +import lombok.extern.slf4j.Slf4j; | |
42 | 42 | |
43 | 43 | /** |
44 | 44 | */ |
... | ... | @@ -71,9 +71,11 @@ public class TvController { |
71 | 71 | |
72 | 72 | @Resource |
73 | 73 | private IInventoryDetailService inventoryDetailService; |
74 | + @Resource | |
75 | + private IShipmentContainerAdviceService shipmentContainerAdviceService; | |
74 | 76 | |
75 | 77 | @GetMapping("taskOfStation") |
76 | - public Result<List<TvTaskVo>> importExcel(String code, HttpServletResponse response) { | |
78 | + public Result<List<TvTaskVo>> taskOfStation(String code, HttpServletResponse response) { | |
77 | 79 | |
78 | 80 | addResponseHeader(response, QuantityConstant.TV_VERSION); |
79 | 81 | List<String> stationList = new ArrayList<>(); |
... | ... | @@ -103,8 +105,7 @@ public class TvController { |
103 | 105 | statusMap.put("100", "任务完成"); |
104 | 106 | |
105 | 107 | LambdaQueryWrapper<TaskHeader> hQuery = Wrappers.lambdaQuery(); |
106 | - hQuery.eq(TaskHeader::getStatus, QuantityConstant.TASK_STATUS_ARRIVED_STATION) | |
107 | - .in(stationList.size() > 0, TaskHeader::getToPortCode, stationList); | |
108 | + hQuery.eq(TaskHeader::getStatus, QuantityConstant.TASK_STATUS_ARRIVED_STATION).in(stationList.size() > 0, TaskHeader::getToPortCode, stationList); | |
108 | 109 | List<TaskHeader> headers = taskHeaderService.list(hQuery); |
109 | 110 | |
110 | 111 | List<TvTaskVo> list = new ArrayList<>(); |
... | ... | @@ -128,12 +129,12 @@ public class TvController { |
128 | 129 | * @param response |
129 | 130 | * @param key |
130 | 131 | */ |
131 | - private void addResponseHeader(HttpServletResponse response, String key){ | |
132 | + private void addResponseHeader(HttpServletResponse response, String key) { | |
132 | 133 | try { |
133 | 134 | String version = parameterConfigurationService.getValueByCode(key); |
134 | 135 | response.setHeader(key, version); |
135 | - response.setHeader("Access-Control-Expose-Headers",key); | |
136 | - }catch (Exception e){ | |
136 | + response.setHeader("Access-Control-Expose-Headers", key); | |
137 | + } catch (Exception e) { | |
137 | 138 | log.error("查找电视版本参数错误", e); |
138 | 139 | } |
139 | 140 | } |
... | ... | @@ -287,13 +288,13 @@ public class TvController { |
287 | 288 | long sumNum = sumLocationList.size(); |
288 | 289 | long haveContainerNum = sumLocationList.stream().filter(l -> StringUtils.isNotEmpty(l.getContainerCode())).count(); |
289 | 290 | long unHaveContainerNum = sumNum - haveContainerNum; |
290 | - //巷道 | |
291 | + // 巷道 | |
291 | 292 | resultMap.put("roadWay", roadWay + "号巷道"); |
292 | - //库位总数 | |
293 | + // 库位总数 | |
293 | 294 | resultMap.put("sumNum", String.valueOf(sumNum)); |
294 | - //有托盘库位 | |
295 | + // 有托盘库位 | |
295 | 296 | resultMap.put("haveContainerNum", String.valueOf(haveContainerNum)); |
296 | - //空闲库位 | |
297 | + // 空闲库位 | |
297 | 298 | resultMap.put("unHaveContainerNum", String.valueOf(unHaveContainerNum)); |
298 | 299 | float usagerate = (Math.round(haveContainerNum / (float)sumNum * 100)) / 100f; |
299 | 300 | resultMap.put("usagerate", (int)(usagerate * 100) + "%"); |
... | ... | @@ -355,4 +356,53 @@ public class TvController { |
355 | 356 | return Result.OK(result); |
356 | 357 | } |
357 | 358 | |
359 | + @GetMapping("getAdviceByTv") | |
360 | + public Result getAdviceByTv(String code, HttpServletResponse response) { | |
361 | + | |
362 | + addResponseHeader(response, QuantityConstant.TV_VERSION); | |
363 | + List<String> stationList = new ArrayList<>(); | |
364 | + if (StringUtils.isNotEmpty(code)) { | |
365 | + stationList = Arrays.asList(code.split(",")); | |
366 | + } | |
367 | + | |
368 | + HashMap<String, String> typeMap = new HashMap<>(); | |
369 | + typeMap.put("100", "整盘入库"); | |
370 | + typeMap.put("200", "补充入库"); | |
371 | + typeMap.put("300", "整盘出库"); | |
372 | + typeMap.put("400", "分拣出库"); | |
373 | + typeMap.put("500", "空容器入库"); | |
374 | + typeMap.put("600", "空容器出库"); | |
375 | + typeMap.put("700", "盘点"); | |
376 | + typeMap.put("800", "移库"); | |
377 | + typeMap.put("900", "出库查看"); | |
378 | + typeMap.put("1000", "换站"); | |
379 | + typeMap.put("1100", "空托盘组入库"); | |
380 | + typeMap.put("1200", "空托盘组出库"); | |
381 | + typeMap.put("1300", "空托盘组换站"); | |
382 | + | |
383 | + HashMap<String, String> statusMap = new HashMap<>(); | |
384 | + statusMap.put("1", "生成任务"); | |
385 | + statusMap.put("10", "下发任务"); | |
386 | + statusMap.put("50", "到达拣选台"); | |
387 | + statusMap.put("100", "任务完成"); | |
388 | + | |
389 | + LambdaQueryWrapper<TaskHeader> hQuery = Wrappers.lambdaQuery(); | |
390 | + hQuery.eq(TaskHeader::getStatus, QuantityConstant.TASK_STATUS_ARRIVED_STATION).in(stationList.size() > 0, TaskHeader::getToPortCode, stationList); | |
391 | + List<TaskHeader> taskHeaderList = taskHeaderService.list(hQuery); | |
392 | + | |
393 | + List<ShipmentContainerAdvice> shipmentContainerAdviceList = new ArrayList<>(); | |
394 | + for (TaskHeader taskHeader : taskHeaderList) { | |
395 | + if (taskHeader.getTaskType() == QuantityConstant.TASK_TYPE_SORTINGSHIPMENT) { | |
396 | + int shipmentContainerHeaderId = taskHeader.getShipmentContainerHeaderId(); | |
397 | + List<ShipmentContainerAdvice> shipmentContainerAdviceList1 = | |
398 | + shipmentContainerAdviceService.getShipmentContainerAdviceListByShipmentContainerId(shipmentContainerHeaderId); | |
399 | + if (CollectionUtils.isNotEmpty(shipmentContainerAdviceList1)) { | |
400 | + shipmentContainerAdviceList.addAll(shipmentContainerAdviceList1); | |
401 | + } | |
402 | + } | |
403 | + } | |
404 | + | |
405 | + return Result.OK(shipmentContainerAdviceList); | |
406 | + } | |
407 | + | |
358 | 408 | } |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/service/WcsServiceImpl.java
... | ... | @@ -280,9 +280,7 @@ public class WcsServiceImpl implements WcsService { |
280 | 280 | } |
281 | 281 | } |
282 | 282 | if (taskType == QuantityConstant.TASK_TYPE_WHOLERECEIPT) { |
283 | - if (!lockStationService.unlockStation(taskHeader.getToPortCode(), warehouseCode)) { | |
284 | - throw new JeecgBootException("分配库位,解锁站台失败:" + taskHeader.getToPortCode()); | |
285 | - } | |
283 | + lockStationService.unlockStation(taskHeader.getToPortCode(), warehouseCode); | |
286 | 284 | } |
287 | 285 | taskHeader = new TaskHeader(); |
288 | 286 | taskHeader.setId(Integer.parseInt(taskNo)); |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/receipt/receiptContainerHeader/service/impl/ReceiptContainerHeaderServiceImpl.java
... | ... | @@ -224,6 +224,7 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl<ReceiptContai |
224 | 224 | taskDetail.setBatch(receiptContainerDetail.getBatch()); |
225 | 225 | taskDetail.setLot(receiptContainerDetail.getLot()); |
226 | 226 | taskDetail.setProject(receiptContainerDetail.getProject()); |
227 | + taskDetail.setSn(receiptContainerDetail.getSn()); | |
227 | 228 | taskDetail.setReceiveTime(receiptContainerDetail.getReceiveTime()); |
228 | 229 | taskDetailList.add(taskDetail); |
229 | 230 | ReceiptDetail receiptDetail = receiptDetailService.getById(receiptContainerDetail.getReceiptDetailId()); |
... | ... | @@ -260,7 +261,7 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl<ReceiptContai |
260 | 261 | throw new JeecgBootException("创建入库任务, 更新入库单明细失败"); |
261 | 262 | } |
262 | 263 | } |
263 | - String value = parameterConfigurationService.getValueByCode(QuantityConstant.START_LOCKING_STATION,zoneCode); | |
264 | + String value = parameterConfigurationService.getValueByCode(QuantityConstant.START_LOCKING_STATION, zoneCode); | |
264 | 265 | if (StringUtils.isNotEmpty(value)) { |
265 | 266 | int lockStation = Integer.parseInt(value); |
266 | 267 | if (lockStation == QuantityConstant.START_LOCK_STATION) { |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentCombination/service/impl/ShipmentCombinationServiceImpl.java
... | ... | @@ -1202,6 +1202,7 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi |
1202 | 1202 | if (shipmentContainerHeader == null) { |
1203 | 1203 | return Result.error("生成出库任务时, 出库组盘头" + "未找到,操作中止"); |
1204 | 1204 | } |
1205 | + shipmentContainerHeader = shipmentContainerHeaderService.getById(shipmentContainerHeader.getId()); | |
1205 | 1206 | if (shipmentContainerHeader.getStatus() >= QuantityConstant.SHIPMENT_CONTAINER_TASK) { |
1206 | 1207 | return Result.error("生成出库任务时, 出库组盘头" + shipmentContainerHeader.getId() + "已经生成任务,请不要重复生成,操作中止"); |
1207 | 1208 | } |
... | ... | @@ -1245,10 +1246,6 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi |
1245 | 1246 | } |
1246 | 1247 | int taskType = QuantityConstant.TASK_TYPE_SORTINGSHIPMENT; |
1247 | 1248 | String zoneCode = location.getZoneCode(); |
1248 | -// if (taskType == QuantityConstant.TASK_TYPE_SORTINGSHIPMENT) { | |
1249 | -// shipmentContainerHeader.setToLocationCode(fromLocationCode); | |
1250 | -// } | |
1251 | - shipmentContainerHeader.setTaskType(taskType); | |
1252 | 1249 | TaskHeader taskHeader = new TaskHeader(); |
1253 | 1250 | taskHeader.setPreTaskNo(preTaskNo); |
1254 | 1251 | taskHeader.setTaskType(taskType); |
... | ... | @@ -1267,8 +1264,11 @@ public class ShipmentCombinationServiceImpl implements IShipmentCombinationServi |
1267 | 1264 | if (!success) { |
1268 | 1265 | throw new JeecgBootException("生成出库任务时, 创建任务失败"); |
1269 | 1266 | } |
1270 | - shipmentContainerHeader.setStatus(QuantityConstant.SHIPMENT_CONTAINER_TASK); | |
1271 | - success = shipmentContainerHeaderService.updateById(shipmentContainerHeader); | |
1267 | + ShipmentContainerHeader shipmentContainerHeader1 = new ShipmentContainerHeader(); | |
1268 | + shipmentContainerHeader1.setId(shipmentContainerHeader.getId()); | |
1269 | + shipmentContainerHeader1.setTaskType(taskType); | |
1270 | + shipmentContainerHeader1.setStatus(QuantityConstant.SHIPMENT_CONTAINER_TASK); | |
1271 | + success = shipmentContainerHeaderService.updateById(shipmentContainerHeader1); | |
1272 | 1272 | if (!success) { |
1273 | 1273 | throw new JeecgBootException("生成出库任务时, 更新出库组盘头失败"); |
1274 | 1274 | } |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentContainerAdvice/service/IShipmentContainerAdviceService.java
... | ... | @@ -3,6 +3,7 @@ package org.jeecg.modules.wms.shipment.shipmentContainerAdvice.service; |
3 | 3 | import java.math.BigDecimal; |
4 | 4 | import java.util.List; |
5 | 5 | |
6 | +import org.jeecg.common.api.vo.Result; | |
6 | 7 | import org.jeecg.modules.wms.shipment.shipmentContainerAdvice.entity.ShipmentContainerAdvice; |
7 | 8 | |
8 | 9 | import com.baomidou.mybatisplus.extension.service.IService; |
... | ... | @@ -17,5 +18,15 @@ public interface IShipmentContainerAdviceService extends IService<ShipmentContai |
17 | 18 | |
18 | 19 | boolean updateQtyById(BigDecimal qty, int id); |
19 | 20 | |
21 | + boolean updateStatusById(int status, int id); | |
22 | + | |
23 | + /** | |
24 | + * 取消配盘 | |
25 | + * @return | |
26 | + */ | |
27 | + Result cancelCombine(Integer id); | |
28 | + | |
20 | 29 | List<ShipmentContainerAdvice> getShipmentContainerAdviceListByShipmentCode(String shipmentCode, String warehouseCode); |
30 | + | |
31 | + List<ShipmentContainerAdvice> getShipmentContainerAdviceListByShipmentContainerId(int shipmentContainerId); | |
21 | 32 | } |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentContainerAdvice/service/impl/ShipmentContainerAdviceServiceImpl.java
... | ... | @@ -3,35 +3,136 @@ package org.jeecg.modules.wms.shipment.shipmentContainerAdvice.service.impl; |
3 | 3 | import java.math.BigDecimal; |
4 | 4 | import java.util.List; |
5 | 5 | |
6 | +import javax.annotation.Resource; | |
7 | + | |
8 | +import org.jeecg.common.api.vo.Result; | |
9 | +import org.jeecg.common.exception.JeecgBootException; | |
10 | +import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryDetail; | |
11 | +import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryDetailService; | |
6 | 12 | import org.jeecg.modules.wms.shipment.shipmentContainerAdvice.entity.ShipmentContainerAdvice; |
7 | 13 | import org.jeecg.modules.wms.shipment.shipmentContainerAdvice.mapper.ShipmentContainerAdviceMapper; |
8 | 14 | import org.jeecg.modules.wms.shipment.shipmentContainerAdvice.service.IShipmentContainerAdviceService; |
15 | +import org.jeecg.modules.wms.shipment.shipmentContainerHeader.entity.ShipmentContainerHeader; | |
16 | +import org.jeecg.modules.wms.shipment.shipmentContainerHeader.service.IShipmentContainerDetailService; | |
17 | +import org.jeecg.modules.wms.shipment.shipmentContainerHeader.service.IShipmentContainerHeaderService; | |
18 | +import org.jeecg.modules.wms.shipment.shipmentHeader.entity.ShipmentDetail; | |
19 | +import org.jeecg.modules.wms.shipment.shipmentHeader.service.IShipmentDetailService; | |
20 | +import org.jeecg.modules.wms.shipment.shipmentHeader.service.IShipmentHeaderService; | |
21 | +import org.jeecg.utils.constant.QuantityConstant; | |
9 | 22 | import org.springframework.stereotype.Service; |
23 | +import org.springframework.transaction.annotation.Transactional; | |
10 | 24 | |
25 | +import com.alibaba.fastjson.JSON; | |
11 | 26 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
12 | 27 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
13 | 28 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
14 | 29 | |
30 | +import cn.monitor4all.logRecord.context.LogRecordContext; | |
31 | +import lombok.extern.slf4j.Slf4j; | |
32 | + | |
15 | 33 | /** |
16 | 34 | * @Description: 出库预配盘 |
17 | 35 | * @Author: jeecg-boot |
18 | 36 | * @Date: 2023-11-16 |
19 | 37 | * @Version: V1.0 |
20 | 38 | */ |
39 | +@Slf4j | |
21 | 40 | @Service |
22 | 41 | public class ShipmentContainerAdviceServiceImpl extends ServiceImpl<ShipmentContainerAdviceMapper, ShipmentContainerAdvice> |
23 | 42 | implements IShipmentContainerAdviceService { |
24 | 43 | |
44 | + @Resource | |
45 | + private IShipmentContainerHeaderService shipmentContainerHeaderService; | |
46 | + @Resource | |
47 | + private IShipmentContainerDetailService shipmentContainerDetailService; | |
48 | + @Resource | |
49 | + private IShipmentDetailService shipmentDetailService; | |
50 | + @Resource | |
51 | + private IShipmentHeaderService shipmentHeaderService; | |
52 | + @Resource | |
53 | + private IInventoryDetailService inventoryDetailService; | |
54 | + @Resource | |
55 | + private IShipmentContainerAdviceService shipmentContainerAdviceService; | |
56 | + | |
25 | 57 | @Override |
26 | 58 | public boolean updateQtyById(BigDecimal qty, int id) { |
27 | - return false; | |
59 | + ShipmentContainerAdvice shipmentContainerAdvice = new ShipmentContainerAdvice(); | |
60 | + shipmentContainerAdvice.setQty(qty); | |
61 | + shipmentContainerAdvice.setId(id); | |
62 | + boolean success = updateById(shipmentContainerAdvice); | |
63 | + return success; | |
64 | + } | |
65 | + | |
66 | + @Override | |
67 | + public boolean updateStatusById(int status, int id) { | |
68 | + ShipmentContainerAdvice shipmentContainerAdvice = new ShipmentContainerAdvice(); | |
69 | + shipmentContainerAdvice.setStatus(status); | |
70 | + shipmentContainerAdvice.setId(id); | |
71 | + boolean success = updateById(shipmentContainerAdvice); | |
72 | + return success; | |
73 | + } | |
74 | + | |
75 | + @Override | |
76 | + @Transactional(rollbackFor = JeecgBootException.class) | |
77 | + public Result cancelCombine(Integer id) { | |
78 | + log.info("开始取消预配盘,id:" + id); | |
79 | + ShipmentContainerHeader shipmentContainerHeader = shipmentContainerHeaderService.getById(id); | |
80 | + if (shipmentContainerHeader == null) { | |
81 | + return Result.error("取消出库预配盘失败, 没有找到出库组盘头ID:" + id); | |
82 | + } | |
83 | + int status = shipmentContainerHeader.getStatus(); | |
84 | + if (status >= QuantityConstant.SHIPMENT_CONTAINER_TASK) { | |
85 | + return Result.error("取消出库预配盘失败,出库配盘状态是生成出库任务"); | |
86 | + } | |
87 | + List<ShipmentContainerAdvice> shipmentContainerAdviceList = shipmentContainerAdviceService.getShipmentContainerAdviceListByShipmentContainerId(id); | |
88 | + for (ShipmentContainerAdvice shipmentContainerAdvice : shipmentContainerAdviceList) { | |
89 | + ShipmentDetail shipmentDetail = shipmentDetailService.getById(shipmentContainerAdvice.getShipmentDetailId()); | |
90 | + if (shipmentDetail == null) { | |
91 | + throw new JeecgBootException("取消出库预配盘失败, 没有找到出库单,出库详情ID:" + shipmentContainerAdvice.getShipmentDetailId()); | |
92 | + } | |
93 | + shipmentDetail.setStatus(QuantityConstant.SHIPMENT_HEADER_BUILD); | |
94 | + BigDecimal taskQty = shipmentDetail.getTaskQty().subtract(shipmentContainerAdvice.getQty()); | |
95 | + shipmentDetail.setTaskQty(taskQty); | |
96 | + if (!shipmentDetailService.updateTaskQtyAndStatusById(taskQty, QuantityConstant.SHIPMENT_HEADER_BUILD, shipmentDetail.getId())) { | |
97 | + throw new JeecgBootException("取消出库预配盘失败, 更新出库明细失败,出库详情ID:" + shipmentContainerAdvice.getShipmentDetailId()); | |
98 | + } | |
99 | + if (!shipmentContainerAdviceService.removeById(shipmentContainerAdvice.getId())) { | |
100 | + throw new JeecgBootException("取消出库预配盘失败, 删除出库组盘明细表失败,配盘详情ID:" + shipmentContainerAdvice.getId()); | |
101 | + } | |
102 | + if (!shipmentHeaderService.updateShipmentHeaderStatus(shipmentDetail.getShipmentId())) { | |
103 | + throw new JeecgBootException("取消出库预配盘失败, 更新出库单头失败,出库单ID:" + shipmentDetail.getShipmentId()); | |
104 | + } | |
105 | + InventoryDetail inventoryDetail = inventoryDetailService.getById(shipmentContainerAdvice.getInventoryDetailId()); | |
106 | + if (inventoryDetail == null) { | |
107 | + throw new JeecgBootException("取消出库预配盘失败, 没有找到库存详情失败,库存详情ID:" + shipmentContainerAdvice.getInventoryDetailId()); | |
108 | + } | |
109 | + BigDecimal inventoryDetailTaskQty = inventoryDetail.getTaskQty().subtract(shipmentContainerAdvice.getQty()); | |
110 | + if (!inventoryDetailService.updateTaskQtyById(inventoryDetailTaskQty, shipmentContainerAdvice.getInventoryDetailId())) { | |
111 | + throw new JeecgBootException("取消出库预配盘失败, 解锁库存详情失败,库存详情ID:" + inventoryDetail.getId()); | |
112 | + } | |
113 | + } | |
114 | + if (!shipmentContainerHeaderService.removeById(id)) { | |
115 | + throw new JeecgBootException("取消出库预配盘失败, 删除出库组盘头表失败,配盘ID:" + id); | |
116 | + } | |
117 | + LogRecordContext.putVariable("extraJsonString", JSON.toJSONString(shipmentContainerAdviceList)); | |
118 | + log.info("完成取消预配盘,id:" + id); | |
119 | + return Result.ok("取消预配盘成功"); | |
28 | 120 | } |
29 | 121 | |
30 | 122 | @Override |
31 | 123 | public List<ShipmentContainerAdvice> getShipmentContainerAdviceListByShipmentCode(String shipmentCode, String warehouseCode) { |
32 | 124 | LambdaQueryWrapper<ShipmentContainerAdvice> shipmentContainerAdviceLambdaQueryWrapper = Wrappers.lambdaQuery(); |
33 | - shipmentContainerAdviceLambdaQueryWrapper.eq(ShipmentContainerAdvice::getShipmentCode, shipmentCode).eq(ShipmentContainerAdvice::getWarehouseCode, | |
34 | - warehouseCode); | |
125 | + shipmentContainerAdviceLambdaQueryWrapper.eq(ShipmentContainerAdvice::getShipmentCode, shipmentCode) | |
126 | + .eq(ShipmentContainerAdvice::getWarehouseCode, warehouseCode).lt(ShipmentContainerAdvice::getStatus, QuantityConstant.SHIPMENT_CONTAINER_FINISHED); | |
127 | + List<ShipmentContainerAdvice> shipmentContainerAdviceList = list(shipmentContainerAdviceLambdaQueryWrapper); | |
128 | + return shipmentContainerAdviceList; | |
129 | + } | |
130 | + | |
131 | + @Override | |
132 | + public List<ShipmentContainerAdvice> getShipmentContainerAdviceListByShipmentContainerId(int shipmentContainerId) { | |
133 | + LambdaQueryWrapper<ShipmentContainerAdvice> shipmentContainerAdviceLambdaQueryWrapper = Wrappers.lambdaQuery(); | |
134 | + shipmentContainerAdviceLambdaQueryWrapper.eq(ShipmentContainerAdvice::getShipmentContainerId, shipmentContainerId).lt(ShipmentContainerAdvice::getStatus, | |
135 | + QuantityConstant.SHIPMENT_CONTAINER_FINISHED); | |
35 | 136 | List<ShipmentContainerAdvice> shipmentContainerAdviceList = list(shipmentContainerAdviceLambdaQueryWrapper); |
36 | 137 | return shipmentContainerAdviceList; |
37 | 138 | } |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentContainerHeader/entity/ShipmentContainerHeader.java
... | ... | @@ -77,6 +77,9 @@ public class ShipmentContainerHeader implements Serializable { |
77 | 77 | @Excel(name = "目标出入口", width = 15) |
78 | 78 | @ApiModelProperty(value = "目标出入口") |
79 | 79 | private String toPort; |
80 | + /** 是否预配盘 */ | |
81 | + @ApiModelProperty(value = "是否预配盘") | |
82 | + private Integer advice; | |
80 | 83 | /** 备用字段1 */ |
81 | 84 | @Excel(name = "备用字段1", width = 15) |
82 | 85 | @ApiModelProperty(value = "备用字段1") |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentContainerHeader/service/impl/ShipmentContainerHeaderServiceImpl.java
... | ... | @@ -15,6 +15,7 @@ import org.jeecg.modules.wms.config.parameterConfiguration.service.IParameterCon |
15 | 15 | import org.jeecg.modules.wms.framework.service.IHuahengMultiHandlerService; |
16 | 16 | import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryDetail; |
17 | 17 | import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryDetailService; |
18 | +import org.jeecg.modules.wms.shipment.shipmentContainerAdvice.service.IShipmentContainerAdviceService; | |
18 | 19 | import org.jeecg.modules.wms.shipment.shipmentContainerHeader.entity.ShipmentContainerDetail; |
19 | 20 | import org.jeecg.modules.wms.shipment.shipmentContainerHeader.entity.ShipmentContainerHeader; |
20 | 21 | import org.jeecg.modules.wms.shipment.shipmentContainerHeader.mapper.ShipmentContainerDetailMapper; |
... | ... | @@ -69,6 +70,8 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentCont |
69 | 70 | private IHuahengMultiHandlerService huahengMultiHandlerService; |
70 | 71 | @Resource |
71 | 72 | private IParameterConfigurationService parameterConfigurationService; |
73 | + @Resource | |
74 | + private IShipmentContainerAdviceService shipmentContainerAdviceService; | |
72 | 75 | |
73 | 76 | @Override |
74 | 77 | @Transactional |
... | ... | @@ -165,9 +168,8 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentCont |
165 | 168 | shipmentContainerHeader.setStatus(QuantityConstant.SHIPMENT_CONTAINER_BUILD); |
166 | 169 | boolean success = this.updateStatusById(QuantityConstant.SHIPMENT_CONTAINER_BUILD, shipmentContainerHeader.getId()); |
167 | 170 | if (!success) { |
168 | - throw new JeecgBootException("取消入库任务时, 更新入库组盘头失败"); | |
171 | + throw new JeecgBootException("取消出库任务时, 更新出库组盘头失败"); | |
169 | 172 | } |
170 | - | |
171 | 173 | List<ShipmentContainerDetail> shipmentContainerDetailList = |
172 | 174 | shipmentContainerDetailService.getShipmentContainerDetailListByHeaderId(shipmentContainerHeader.getId()); |
173 | 175 | List<ShipmentDetail> shipmentDetailList = new ArrayList<>(); |
... | ... | @@ -202,9 +204,17 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentCont |
202 | 204 | } |
203 | 205 | int cancelTaskRule = Integer.parseInt(value); |
204 | 206 | if (cancelTaskRule == QuantityConstant.RULE_TASK_CANCEL_CONTAINER) { |
205 | - Result result = shipmentContainerHeaderService.cancelCombine(shipmentContainerHeader.getId()); | |
206 | - if (!result.isSuccess()) { | |
207 | - throw new JeecgBootException("取消出库任务时, 取消配盘失败"); | |
207 | + int shipmentContainerAdvice = shipmentContainerHeader.getAdvice(); | |
208 | + if (shipmentContainerAdvice == QuantityConstant.STATUS_CLOSE) { | |
209 | + Result result = shipmentContainerHeaderService.cancelCombine(shipmentContainerHeader.getId()); | |
210 | + if (!result.isSuccess()) { | |
211 | + throw new JeecgBootException("取消出库任务时, 取消配盘失败"); | |
212 | + } | |
213 | + } else { | |
214 | + Result result = shipmentContainerAdviceService.cancelCombine(shipmentContainerHeader.getId()); | |
215 | + if (!result.isSuccess()) { | |
216 | + throw new JeecgBootException("取消出库任务时, 取消配盘失败"); | |
217 | + } | |
208 | 218 | } |
209 | 219 | } |
210 | 220 | log.info("完成取消出库任务,任务id" + taskHeader.getId()); |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/shipment/shipmentHeader/service/impl/ShipmentHeaderServiceImpl.java
... | ... | @@ -515,8 +515,11 @@ public class ShipmentHeaderServiceImpl extends ServiceImpl<ShipmentHeaderMapper, |
515 | 515 | throw new JeecgBootException("自动预配盘出库, 没有合适的出库口"); |
516 | 516 | } |
517 | 517 | Port port = portList.get(0); |
518 | - shipmentContainerHeader.setToPort(port.getCode()); | |
519 | - boolean success = shipmentContainerHeaderService.updateById(shipmentContainerHeader); | |
518 | + ShipmentContainerHeader shipmentContainerHeader1 = new ShipmentContainerHeader(); | |
519 | + shipmentContainerHeader1.setId(shipmentContainerHeader.getId()); | |
520 | + shipmentContainerHeader1.setToPort(port.getCode()); | |
521 | + shipmentContainerHeader1.setAdvice(QuantityConstant.STATUS_OPEN); | |
522 | + boolean success = shipmentContainerHeaderService.updateById(shipmentContainerHeader1); | |
520 | 523 | if (!success) { |
521 | 524 | throw new JeecgBootException("自动预配盘出库, 更新出库组盘头失败"); |
522 | 525 | } |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/impl/TaskHeaderServiceImpl.java
... | ... | @@ -45,6 +45,8 @@ import org.jeecg.modules.wms.receipt.receiving.domain.Receive; |
45 | 45 | import org.jeecg.modules.wms.receipt.receiving.service.IReceiveService; |
46 | 46 | import org.jeecg.modules.wms.shipment.shipmentCombination.entity.CombinationModel; |
47 | 47 | import org.jeecg.modules.wms.shipment.shipmentCombination.service.IShipmentCombinationService; |
48 | +import org.jeecg.modules.wms.shipment.shipmentContainerAdvice.entity.ShipmentContainerAdvice; | |
49 | +import org.jeecg.modules.wms.shipment.shipmentContainerAdvice.service.IShipmentContainerAdviceService; | |
48 | 50 | import org.jeecg.modules.wms.shipment.shipmentContainerHeader.entity.ShipmentContainerDetail; |
49 | 51 | import org.jeecg.modules.wms.shipment.shipmentContainerHeader.entity.ShipmentContainerHeader; |
50 | 52 | import org.jeecg.modules.wms.shipment.shipmentContainerHeader.service.IShipmentContainerDetailService; |
... | ... | @@ -157,6 +159,8 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
157 | 159 | private ILockStationService lockStationService; |
158 | 160 | @Resource |
159 | 161 | private IQualityDetailService qualityDetailService; |
162 | + @Resource | |
163 | + private IShipmentContainerAdviceService shipmentContainerAdviceService; | |
160 | 164 | |
161 | 165 | @Override |
162 | 166 | @Transactional |
... | ... | @@ -1273,6 +1277,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1273 | 1277 | inventoryDetail.setBatch(taskDetail.getBatch()); |
1274 | 1278 | inventoryDetail.setLot(taskDetail.getLot()); |
1275 | 1279 | inventoryDetail.setProject(taskDetail.getProject()); |
1280 | + inventoryDetail.setSn(taskDetail.getSn()); | |
1276 | 1281 | inventoryDetail.setReceiveTime(taskDetail.getReceiveTime()); |
1277 | 1282 | inventoryDetail.setReceiptDate(new Date()); |
1278 | 1283 | inventoryDetailList.add(inventoryDetail); |
... | ... | @@ -1296,6 +1301,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1296 | 1301 | inventoryTransaction.setBatch(taskDetail.getBatch()); |
1297 | 1302 | inventoryTransaction.setLot(taskDetail.getLot()); |
1298 | 1303 | inventoryTransaction.setProject(taskDetail.getProject()); |
1304 | + inventoryTransaction.setSn(taskDetail.getSn()); | |
1299 | 1305 | inventoryTransaction.setInventoryStatus(taskDetail.getInventoryStatus()); |
1300 | 1306 | inventoryTransaction.setQty(receiptQty); |
1301 | 1307 | inventoryTransaction.setReceiptQty(receiptQty); |
... | ... | @@ -1397,6 +1403,13 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1397 | 1403 | if (!success) { |
1398 | 1404 | throw new JeecgBootException("完成出库任务,更新出库组盘头失败"); |
1399 | 1405 | } |
1406 | + List<ShipmentContainerAdvice> shipmentContainerAdviceList = | |
1407 | + shipmentContainerAdviceService.getShipmentContainerAdviceListByShipmentContainerId(shipmentContainerHeader.getId()); | |
1408 | + for (ShipmentContainerAdvice shipmentContainerAdvice : shipmentContainerAdviceList) { | |
1409 | + if (!shipmentContainerAdviceService.updateStatusById(QuantityConstant.SHIPMENT_CONTAINER_FINISHED, shipmentContainerAdvice.getId())) { | |
1410 | + throw new JeecgBootException("完成出库任务,更新出库预配盘失败"); | |
1411 | + } | |
1412 | + } | |
1400 | 1413 | } |
1401 | 1414 | Result result = taskHeaderService.completeTaskUnLockContainerAndLocation(taskHeader.getContainerFillStatus(), taskType, containerCode, |
1402 | 1415 | fromLocationCode, toLocationCode, warehouseCode); |
... | ... | @@ -1641,6 +1654,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
1641 | 1654 | InventoryDetail inventoryDetail2 = inventoryDetailList.get(j); |
1642 | 1655 | if (inventoryDetail1.getMaterialCode().equals(inventoryDetail2.getMaterialCode()) && inventoryDetail1.getBatch().equals(inventoryDetail2.getBatch()) |
1643 | 1656 | && inventoryDetail1.getLot().equals(inventoryDetail2.getLot()) && inventoryDetail1.getProject().equals(inventoryDetail2.getProject()) |
1657 | + && inventoryDetail1.getSn().equals(inventoryDetail2.getSn()) | |
1644 | 1658 | && inventoryDetail1.getInventoryStatus().equals(inventoryDetail2.getInventoryStatus())) { |
1645 | 1659 | // 属性一样的库存,相加合并。 |
1646 | 1660 | BigDecimal totalQty = inventoryDetail1.getQty().add(inventoryDetail2.getQty()); |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/utils/constant/QuantityConstant.java
... | ... | @@ -531,6 +531,10 @@ public class QuantityConstant { |
531 | 531 | public static final String TV_VERSION = "Tv-Ver"; |
532 | 532 | public static final String RULE_SHIPMENT_ZONE = "shipmentZoneRule"; |
533 | 533 | public static final String SHIPMENT_WHOLE_TASK_CLEAR_INVENTORY = "shipmentWholeTaskClearInventory"; |
534 | + public static final String RULE_SHIPMENT_CONTAINER_ADVICE = "shipmentContainerAdvice"; | |
535 | + | |
536 | + public static final int STATUS_CLOSE = 0; | |
537 | + public static final int STATUS_OPEN = 1; | |
534 | 538 | |
535 | 539 | public static final int DOUBLE_FORK = 1; |
536 | 540 | public static final int SINGLE_FORK = 0; |
... | ... |