| | |
| | | if (Objects.isNull(asrder) || Objects.isNull(asrder.getId())) { |
| | | throw new CoolException("参数不能为空!!"); |
| | | } |
| | | asrder.setExceStatus(Short.parseShort(AsnExceStatus.ASN_EXCE_STATUS_TASK_CLOSE.val)); |
| | | asrder.setExceStatus(AsnExceStatus.ASN_EXCE_STATUS_TASK_CLOSE.val); |
| | | |
| | | if (!this.updateById(asrder)) { |
| | | throw new CoolException("单据关闭失败!!"); |
| | |
| | | if (orderItems.isEmpty()) { |
| | | throw new CoolException("收货明细为空!!"); |
| | | } |
| | | if (Objects.isNull(asrder.getAnfme()) || asrder.getAnfme().compareTo(0.00) == 0) { |
| | | throw new CoolException("收货数量不能为零!!"); |
| | | } |
| | | // if (Objects.isNull(asrder.getAnfme()) || asrder.getAnfme().compareTo(0.00) == 0) { |
| | | // throw new CoolException("收货数量不能为零!!"); |
| | | // } |
| | | AsnOrder order = this.getById(asrder.getId()); |
| | | AsnOrderLog orderLog = new AsnOrderLog(); |
| | | order.setExceStatus(Short.parseShort(AsnExceStatus.ASN_EXCE_STATUS_TASK_DONE.val)); |
| | | order.setExceStatus(AsnExceStatus.ASN_EXCE_STATUS_TASK_DONE.val); |
| | | BeanUtils.copyProperties(order, orderLog); |
| | | orderLog.setId(null); |
| | | orderLog.setAsnId(order.getId()); |
| | |
| | | if (!this.saveOrUpdate(order)) { |
| | | throw new CoolException("状态修改失败!!"); |
| | | } |
| | | orderLog.setExceStatus(Short.parseShort(AsnExceStatus.ASN_EXCE_STATUS_TASK_CLOSE.val)); |
| | | orderLog.setExceStatus(AsnExceStatus.ASN_EXCE_STATUS_TASK_CLOSE.val); |
| | | if (!asnOrderLogService.save(orderLog)) { |
| | | throw new CoolException("主单历史档添加失败!!"); |
| | | } |
| | |
| | | AsnOrderItemLog itemLog = new AsnOrderItemLog(); |
| | | BeanUtils.copyProperties(item, itemLog); |
| | | itemLog.setAsnItemId(itemLog.getId()) |
| | | .setLogId(orderLog.getId()) |
| | | .setAsnId(item.getAsnId()); |
| | | logs.add(itemLog); |
| | | }); |