Commit ce2e9b8945c9ca4156b2493771630cbc820f24ce

Authored by 易文鹏
1 parent 24a6dfae

一条单据明细可能有多条组盘多条任务,只有组盘明细全部执行完成后,才能改单据明细状态为拣货完成

src/main/java/com/huaheng/pc/monitor/job/task/RyTask.java
... ... @@ -166,6 +166,7 @@ public class RyTask extends BaseController {
166 166 runningTaskMap.put(taskKey, true);
167 167 //出库回传
168 168 List<ShipmentHeader> shipmentHeaderList = shipmentHeaderService.list(new LambdaQueryWrapper<ShipmentHeader>()
  169 + .eq(ShipmentHeader::getFirstStatus, QuantityConstant.SHIPMENT_HEADER_COMPLETED)
169 170 .eq(ShipmentHeader::getLastStatus, QuantityConstant.SHIPMENT_HEADER_COMPLETED));
170 171 for (ShipmentHeader shipmentHeader : shipmentHeaderList) {
171 172 //299:其他出库
... ...
src/main/java/com/huaheng/pc/task/taskHeader/service/ShipmentTaskService.java
... ... @@ -67,6 +67,9 @@ public class ShipmentTaskService {
67 67 private InventoryDetailService inventoryDetailService;
68 68 @Resource
69 69 private TaskHeaderService taskHeaderService;
  70 +
  71 + @Resource
  72 + private ShipmentContainerHeaderService shipmentContainerHeaderService;
70 73 @Resource
71 74 private TaskDetailService taskDetailService;
72 75 @Resource
... ... @@ -403,10 +406,23 @@ public class ShipmentTaskService {
403 406 HashSet<Integer> ids = new HashSet<>();
404 407 for (TaskDetail taskDetail : taskDetailList) {
405 408 ShipmentDetail shipmentDetail = shipmentDetailService.getById(taskDetail.getBillDetailId());
406   -
407 409 if (StringUtils.isNotNull(shipmentDetail)) {
408 410 if (shipmentDetail.getQty().compareTo(shipmentDetail.getTaskQty()) == 0) {
409   - shipmentDetail.setStatus(QuantityConstant.SHIPMENT_HEADER_COMPLETED);
  411 +
  412 + //一条单据明细可能有多条组盘多条任务
  413 + List<ShipmentContainerDetail> list = shipmentContainerDetailService.list(new LambdaQueryWrapper<ShipmentContainerDetail>().eq(ShipmentContainerDetail::getShipmentDetailId, shipmentDetail.getId()));
  414 + boolean flag = true;
  415 + for (ShipmentContainerDetail shipmentContainerDetail : list) {
  416 + if (shipmentContainerDetail.getStatus() != 20) {
  417 + flag = false;
  418 + break;
  419 + }
  420 + }
  421 + if (flag) {
  422 + shipmentDetail.setStatus(QuantityConstant.SHIPMENT_HEADER_COMPLETED);
  423 + } else {
  424 + shipmentDetail.setStatus(QuantityConstant.SHIPMENT_HEADER_GROUPDISK);
  425 + }
410 426 shipmentDetailService.updateById(shipmentDetail);
411 427 }
412 428 ids.add(shipmentDetail.getShipmentId());
... ...