| | |
| | | import java.math.BigDecimal; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | import java.util.stream.Stream; |
| | | |
| | | import com.vincent.rsf.server.manager.enums.WaveRuleType; |
| | | |
| | |
| | | AsnOrder order = new AsnOrder(); |
| | | BeanUtils.copyProperties(delivery, order); |
| | | String ruleCode = SerialRuleUtils.generateRuleCode(SerialRuleCode.SYS_OUT_STOCK_CODE, order); |
| | | if (Objects.isNull(ruleCode) || StringUtils.isBlank(ruleCode)) { |
| | | if (StringUtils.isBlank(ruleCode)) { |
| | | throw new CoolException("编码规则错误:请检查 「SYS_OUT_STOCK_CODE」编码是否设置成功"); |
| | | } |
| | | order.setExceStatus(AsnExceStatus.OUT_STOCK_STATUS_TASK_INIT.val) |
| | |
| | | ); |
| | | locItemQueryWrapper.apply(applySql); |
| | | List<LocItem> locItems = locItemService.list(locItemQueryWrapper); |
| | | locItems.sort(Comparator |
| | | .comparing((LocItem item) -> !LocUtils.isShallowLoc(item.getLocCode())) |
| | | ); |
| | | locItems.sort(Comparator.comparing((LocItem item) -> !LocUtils.isShallowLoc(item.getLocCode()))); |
| | | List<LocItem> locsSet = locItems.stream().filter(locItem -> locItem.getAnfme().compareTo(asnOrderItem.getAnfme()) == 0.0).collect(Collectors.toList()); |
| | | if (!locsSet.isEmpty()) { |
| | | return locsSet; |
| | | } |
| | | return locItems; |
| | | } |
| | | |
| | |
| | | if (issued.doubleValue() <= 0) { |
| | | continue; |
| | | } |
| | | List<LocItem> locItems = null; |
| | | List<LocItem> locItems = new ArrayList<>(); |
| | | if (WaveRuleType.Efficiency_First.type.equals(waveRule.getType())) { |
| | | locItems = getEfficiencyFirstItemList(asnOrderItem); |
| | | } else if (WaveRuleType.First_In_First_Out.type.equals(waveRule.getType())) { |