| | |
| | | if (!waveService.save(wave)) { |
| | | throw new CoolException("波次保存失败!!"); |
| | | } |
| | | |
| | | List<Long> list = orders.stream().map(AsnOrder::getId).collect(Collectors.toList()); |
| | | List<AsnOrderItem> orderItems = asnOrderItemService |
| | | .list(new LambdaQueryWrapper<AsnOrderItem>() |
| | | .in(AsnOrderItem::getAsnId, list)); |
| | | .in(AsnOrderItem::getAsnId, list).apply("anfme > work_qty")); |
| | | if (orderItems.isEmpty()) { |
| | | throw new CoolException("单据不存在!!"); |
| | | } |
| | |
| | | .set(AsnOrder::getWaveId, wave.getId()) |
| | | .set(AsnOrder::getWorkQty, wkQty) |
| | | .set(AsnOrder::getExceStatus, AsnExceStatus.OUT_STOCK_STATUS_TASK_WAVE.val) |
| | | .in(AsnOrder::getId, params.getIds()))) { |
| | | .eq(AsnOrder::getId, order.getId()))) { |
| | | throw new CoolException("执行状态修改修改失败!!"); |
| | | } |
| | | } |
| | |
| | | throw new CoolException("主单信息不能为空"); |
| | | } |
| | | AsnOrder orders = params.getOrders(); |
| | | if (Objects.isNull(orders)) { |
| | | throw new CoolException("单据不能为空!!"); |
| | | } |
| | | if (StringUtils.isBlank(orders.getWkType())) { |
| | | throw new CoolException("业务类型不能为空!!"); |
| | | } |
| | | |
| | | String ruleCode = SerialRuleUtils.generateRuleCode(SerialRuleCode.SYS_OUT_STOCK_CODE, orders); |
| | | if (Objects.isNull(ruleCode) || StringUtils.isBlank(ruleCode)) { |
| | | if (StringUtils.isBlank(ruleCode)) { |
| | | throw new CoolException("编码规则错误:请检查「SYS_OUT_STOCK_CODE」是否设置正确!!"); |
| | | } |
| | | orders.setCode(ruleCode) |
| | |
| | | p1.getUpdateBy(), |
| | | p1.getMemo() |
| | | ), |
| | | WaveItem::getSplrBatch, WaveItem::getMatnrId, WaveItem::getFieldsIndex |
| | | WaveItem::getSplrBatch, WaveItem::getMatnrCode, WaveItem::getFieldsIndex |
| | | ); |
| | | |
| | | return waveItems; |