| | |
| | | if (Cools.isEmpty(mat)) { |
| | | throw new CoolException(detlDto.getMatnr() + "商品档案不存在"); |
| | | } |
| | | |
| | | //最多可放数量 |
| | | Double singleMax = mat.getUpQty() * suplus; |
| | | if (singleMax.compareTo(detlDto.getAnfme()) < 0) { |
| | | throw new CoolException("单次最大组托上限为:" + singleMax); |
| | | throw new CoolException("物料:" + detlDto.getMatnr() + "单次组托上限为:" + mat.getUpQty() + ",当前总量超出托盘装载上限!!"); |
| | | } |
| | | BigDecimal decimal = new BigDecimal(detlDto.getAnfme() / mat.getUpQty()); |
| | | //当前物料需要占用料箱格数 |
| | | Integer curr = decimal.setScale(0, RoundingMode.CEILING).intValue(); |
| | | suplus = suplus - curr; |
| | | if (suplus == 0 || suplus < 0) { |
| | | if (suplus < 0) { |
| | | throw new CoolException("物料:" + detlDto.getMatnr() + ", 超出当前托盘装载上限!!"); |
| | | } |
| | | |