| | |
| | | throw new CoolException("策略参数为空"); |
| | | } |
| | | if (Cools.isEmpty(param.getOrderId())) { |
| | | throw new CoolException("单据id为空"); |
| | | throw new CoolException("单据ID为空"); |
| | | } |
| | | WaveRule waveRule = waveRuleService.getOne(new LambdaQueryWrapper<WaveRule>().eq(WaveRule::getId, param.getWaveId())); |
| | | if (Cools.isEmpty(waveRule)) { |
| | |
| | | if (!Objects.isNull(loc)) { |
| | | List<LocItem> locItems = new ArrayList<>(); |
| | | LocItem locItem = locItemService.getById(param.getId()); |
| | | locItem.setOutQty(param.getOutQty()).setBatch(param.getBatch()); |
| | | |
| | | AsnOrderItem orderItem = outStockItemService.getOne(new LambdaQueryWrapper<AsnOrderItem>() |
| | | .eq(AsnOrderItem::getAsnId, outId) |
| | | .eq(StringUtils.isNotBlank(locItem.getBatch()), AsnOrderItem::getSplrBatch, locItem.getBatch()) |
| | | .eq(StringUtils.isNotBlank(locItem.getFieldsIndex()), AsnOrderItem::getFieldsIndex, locItem.getFieldsIndex()) |
| | | .eq(AsnOrderItem::getMatnrId, locItem.getMatnrId())); |
| | | |
| | | if (Objects.isNull(orderItem)) { |
| | | throw new CoolException("单据明细不存在!!"); |
| | | } |
| | | |
| | | locItem.setOutQty(param.getOutQty()) |
| | | .setBatch(param.getBatch()) |
| | | .setSourceId(outId) |
| | | .setSourceCode(orderItem.getAsnCode()) |
| | | .setSource(orderItem.getId()); |
| | | locItems.add(locItem); |
| | | |
| | | LocToTaskParams taskParams = new LocToTaskParams(); |
| | |
| | | throw new CoolException(e.getMessage()); |
| | | } |
| | | |
| | | AsnOrderItem orderItem = outStockItemService.getOne(new LambdaQueryWrapper<AsnOrderItem>() |
| | | .eq(AsnOrderItem::getAsnId, outId) |
| | | .eq(StringUtils.isNotBlank(locItem.getBatch()), AsnOrderItem::getSplrBatch, locItem.getBatch()) |
| | | .eq(StringUtils.isNotBlank(locItem.getFieldsIndex()), AsnOrderItem::getFieldsIndex, locItem.getFieldsIndex()) |
| | | .eq(AsnOrderItem::getMatnrId, locItem.getMatnrId())); |
| | | |
| | | if (Objects.isNull(orderItem)) { |
| | | throw new CoolException("单据明细不存在!!"); |
| | | } |
| | | |
| | | Double workQty = Math.round((orderItem.getWorkQty() + locItem.getOutQty()) * 10000) / 10000.0; |
| | | |
| | |
| | | } |
| | | Double workQty = Math.round((outOrder.getWorkQty() + sum) * 10000) / 10000.0; |
| | | |
| | | outOrder.setWorkQty(workQty).setExceStatus( AsnExceStatus.OUT_STOCK_STATUS_TASK_CREATE.val); |
| | | outOrder.setWorkQty(workQty).setExceStatus(AsnExceStatus.OUT_STOCK_STATUS_TASK_CREATE.val); |
| | | |
| | | if (!outStockService.updateById(outOrder)) { |
| | | throw new CoolException("出库单状态修改失败!!"); |
| | |
| | | |
| | | private List<OrderOutItemDto> getOutOrderList(Long orderId, WaveRule waveRule) { |
| | | List<AsnOrderItem> asnOrderItems = asnOrderItemService.list(new LambdaQueryWrapper<AsnOrderItem>() |
| | | .eq(AsnOrderItem::getAsnId, orderId) |
| | | ); |
| | | .eq(AsnOrderItem::getAsnId, orderId)); |
| | | List<OrderOutItemDto> list = new ArrayList<>(); |
| | | Set<ExistDto> existDtos = new HashSet<>(); |
| | | |