| | |
| | | @Override |
| | | @Transactional |
| | | public R pakoutOrderPause(OpenOrderPakoutPauseParam param) { |
| | | if (param == null || Cools.isEmpty(param.getOrderNo())) { |
| | | if (param == null || Cools.isEmpty(param.getOrderId())) { |
| | | throw new CoolException("orderNo is empty"); |
| | | } |
| | | Order order = orderService.selectByNo(param.getOrderNo()); |
| | | Order order = orderService.selectByNo(param.getOrderId()); |
| | | if (order == null) { |
| | | order = OrderInAndOutUtil.selectByNo(Boolean.FALSE, param.getOrderNo()); |
| | | order = OrderInAndOutUtil.selectByNo(Boolean.FALSE, param.getOrderId()); |
| | | } |
| | | if (order == null) { |
| | | throw new CoolException("order not found: " + param.getOrderNo()); |
| | | throw new CoolException("order not found: " + param.getOrderId()); |
| | | } |
| | | |
| | | List<WrkMast> activeTasks = findActiveOutboundTasks(param.getOrderNo()); |
| | | List<WrkMast> activeTasks = findActiveOutboundTasks(param.getOrderId()); |
| | | if (activeTasks.isEmpty()) { |
| | | return R.ok("no active out tasks"); |
| | | } |
| | |
| | | } |
| | | |
| | | Map<String, Object> result = new HashMap<>(); |
| | | result.put("orderNo", param.getOrderNo()); |
| | | result.put("orderNo", param.getOrderId()); |
| | | result.put("pausedCount", pausedCount); |
| | | result.put("wcsStopCount", issuedTasks.size()); |
| | | return R.ok("pause out success").add(result); |
| | |
| | | } |
| | | if (Objects.equals(param.getExecute(), 2)) { |
| | | OpenOrderPakoutPauseParam pauseParam = new OpenOrderPakoutPauseParam(); |
| | | pauseParam.setOrderNo(param.getOrderId()); |
| | | pauseParam.setReason("OPEN_API_PAUSE"); |
| | | // pauseParam.getOrderId(param.getOrderId()); |
| | | // pauseParam.setReason("OPEN_API_PAUSE"); |
| | | return pakoutOrderPause(pauseParam); |
| | | } |
| | | throw new CoolException("execute only supports 1 or 2"); |
| | |
| | | |
| | | private StopOutTaskParams buildStopOutTaskParams(OpenOrderPakoutPauseParam param, List<WrkMast> wrkMasts) { |
| | | StopOutTaskParams stopParams = new StopOutTaskParams(); |
| | | stopParams.setOrderNo(param.getOrderNo()); |
| | | stopParams.setOrderNo(param.getOrderId()); |
| | | stopParams.setReason(param.getReason()); |
| | | for (WrkMast wrkMast : wrkMasts) { |
| | | StopOutTaskParams.TaskItem item = new StopOutTaskParams.TaskItem(); |
| | |
| | | |
| | | if (param.getFull() == 1) { |
| | | //满托盘 |
| | | mat = matService.selectByMatnr(param.getMatnr()); |
| | | mat = matService.selectByMatnr("emptyPallet"); |
| | | } else if (param.getFull() == 0) { |
| | | //空托盘 |
| | | mat = matService.selectByMatnr("emptyPallet"); |
| | |
| | | |
| | | WaitPakin waitPakin = new WaitPakin(); |
| | | waitPakin.sync(mat); |
| | | // waitPakin.setMatnr(param.getMatnr()); |
| | | waitPakin.setBatch(String.valueOf(param.getBatchId())); |
| | | waitPakin.setZpallet(param.getPalletId()); // 托盘码 |
| | | |