| | |
| | | |
| | | @Autowired |
| | | private QlyInspectService qlyInspectService; |
| | | @Autowired |
| | | private AsnOrderItemService asnOrderItemService; |
| | | |
| | | /** |
| | |
| | | items.forEach(qlyIsptItem -> { |
| | | AsnOrderItem orderItem = asnOrderItemService.getById(qlyIsptItem.getAsnItemId()); |
| | | if (qlyIsptItem.getSafeQty().compareTo(orderItem.getAnfme()) >= 0.00) { |
| | | orderItem.setIsptResult() |
| | | orderItem.setIsptResult(QlyIsptResult.QLY_ISPT_RESULT_EXCELLENT.val) |
| | | .setIsptStatus(QlyIsptStatus.QLY_ISPT_STAS_DONE.val); |
| | | } else if (qlyIsptItem.getSafeQty().compareTo(0.00) > 0.00 && qlyIsptItem.getSafeQty().compareTo(orderItem.getAnfme()) < 0.00) { |
| | | orderItem.setIsptResult(QlyIsptResult.QLY_ISPT_RESULT_SECTION.val); |
| | | if (Double.compare(qlyIsptItem.getSafeQty() + qlyIsptItem.getDisQty(), orderItem.getAnfme()) >= 0.00 ) { |
| | | orderItem.setIsptStatus(QlyIsptStatus.QLY_ISPT_STAS_DONE.val); |
| | | } else { |
| | | orderItem.setIsptStatus(QlyIsptStatus.QLY_ISPT_STAS_ING.val); |
| | | } |
| | | } else { |
| | | orderItem.setIsptResult(QlyIsptResult.QLY_ISPT_RESULT_DEFECT.val) |
| | | .setIsptStatus(QlyIsptStatus.QLY_ISPT_STAS_DONE.val); |
| | | } |
| | | |
| | | if (!asnOrderItemService.updateById(orderItem)) { |
| | | throw new CoolException("收货单明细修改失败!!"); |
| | | } |
| | | }); |
| | | Double safeQty = items.stream().mapToDouble(QlyIsptItem::getSafeQty).sum(); |
| | | Double disQty = items.stream().mapToDouble(QlyIsptItem::getDisQty).sum(); |