| | |
| | | import com.vincent.rsf.server.manager.enums.*; |
| | | import com.vincent.rsf.server.manager.entity.*; |
| | | import com.vincent.rsf.server.manager.service.*; |
| | | import com.vincent.rsf.server.manager.service.impl.LocItemWorkingServiceImpl; |
| | | import com.vincent.rsf.server.manager.service.impl.LocServiceImpl; |
| | | import com.vincent.rsf.server.manager.service.impl.WaveOrderRelaServiceImpl; |
| | | import com.vincent.rsf.server.system.constant.GlobalConfigCode; |
| | |
| | | private ReportMsgService reportMsgService; |
| | | @Autowired |
| | | private WaveOrderRelaService waveOrderRelaService; |
| | | @Autowired |
| | | private LocItemWorkingService locItemWorkingService; |
| | | |
| | | |
| | | /** |
| | | * @param |
| | |
| | | throw new CoolException("任务历史档保存失败!!"); |
| | | } |
| | | List<TaskItem> taskItems = taskItemService.list(new LambdaQueryWrapper<TaskItem>().eq(TaskItem::getTaskId, task.getId())); |
| | | //入库单据明细上报 |
| | | // if (order.getType().equals(OrderType.ORDER_OUT.type)) { |
| | | // try { |
| | | // //上报已完成订单至ERP、MES等三方系统 |
| | | // reportMsgService.reportOrders(order); |
| | | // order.setReportOnce(order.getReportOnce() + 1); |
| | | // if (!asnOrderService.updateById(order)) { |
| | | // log.error(order.getCode() + ",单据上传次数修改失败!!"); |
| | | // } |
| | | // } catch (Exception e) { |
| | | // log.error(e.getMessage()); |
| | | // } |
| | | // } |
| | | |
| | | if (task.getTaskType().equals(TaskType.TASK_TYPE_IN.type)) { |
| | | for (TaskItem taskItem : taskItems) { |
| | | if (Objects.isNull(taskItem.getOrderId())) { |
| | |
| | | /**入库单明细上报*/ |
| | | reportMsgService.reportOrderItem(wkOrderItem); |
| | | } |
| | | } else if (task.getTaskType() >= TaskType.TASK_TYPE_OUT.type && task.getTaskType() <= TaskType.TASK_TYPE_EMPITY_OUT.type) { |
| | | |
| | | } else if ((task.getTaskType() >= TaskType.TASK_TYPE_OUT.type && task.getTaskType() <= TaskType.TASK_TYPE_EMPITY_OUT.type) |
| | | || task.getTaskType().equals(TaskType.TASK_TYPE_PICK_IN.type)) { |
| | | /**判断单据是否完成**/ |
| | | Set<Long> longSet = taskItems.stream().map(TaskItem::getSourceId).collect(Collectors.toSet()); |
| | | List<WaveOrderRela> waveOrderRelas = waveOrderRelaService.list(new LambdaQueryWrapper<WaveOrderRela>() |
| | |
| | | //检查单据是否完成 |
| | | if (order.getAnfme().compareTo(order.getQty()) == 0) { |
| | | order.setExceStatus(AsnExceStatus.OUT_STOCK_STATUS_TASK_DONE.val); |
| | | // if (order.getType().equals(OrderType.ORDER_IN)) { |
| | | // order.setExceStatus(AsnExceStatus.ASN_EXCE_STATUS_TASK_DONE.val); |
| | | // } else { |
| | | // order.setExceStatus(AsnExceStatus.OUT_STOCK_STATUS_TASK_DONE.val); |
| | | // } |
| | | if (!asnOrderService.updateById(order)) { |
| | | throw new CoolException("出库单更新状态失败"); |
| | | } |
| | | } |
| | | }); |
| | | |
| | | //出库单上报RCS修改库位状态 |
| | | try { |
| | | reportStationStatus(task); |
| | |
| | | itemLogs.add(itemLog); |
| | | } |
| | | |
| | | locItemWorkingService.remove(new LambdaQueryWrapper<LocItemWorking>().eq(LocItemWorking::getTaskId, task.getId())); |
| | | |
| | | |
| | | if (!taskService.removeById(task.getId())) { |
| | | throw new CoolException("原始任务删除失败!!"); |
| | | } |
| | |
| | | throw new CoolException("原始任务明细删除失败!!"); |
| | | } |
| | | } |
| | | |
| | | |
| | | }); |
| | | } |
| | | |