| | |
| | | String response; |
| | | R r = R.ok(); |
| | | WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("wrk_no", params.getTaskNo())); |
| | | if (!Objects.isNull(wrkMast) && "out".equalsIgnoreCase(params.getType()) && "Y".equalsIgnoreCase(wrkMast.getPauseMk())) { |
| | | return R.error("task paused"); |
| | | if (!Objects.isNull(wrkMast) && "out".equalsIgnoreCase(params.getType())) { |
| | | if ("Y".equalsIgnoreCase(wrkMast.getPauseMk())) { |
| | | return R.error("task paused"); |
| | | } |
| | | if (requiresOutboundErpConfirm(wrkMast) && !"Y".equalsIgnoreCase(wrkMast.getPdcType())) { |
| | | return R.error("task not confirmed by erp"); |
| | | } |
| | | } |
| | | try { |
| | | log.info("下发搬运任务给wcs="+JSON.toJSONString(params)); |
| | |
| | | } else if (params.getMsgType().equals("task_cancel")) { |
| | | if (mast.getIoType() != null && mast.getIoType() > 100 && mast.getWrkSts() < 14) { |
| | | mast.setPauseMk("Y"); |
| | | mast.setUpdMk("WCS_CANCELLED"); |
| | | mast.setManuType("WCS_CANCELLED"); |
| | | // mast.setUpdMk("WCS_CANCELLED"); |
| | | // mast.setManuType("WCS_CANCELLED"); |
| | | mast.setModiTime(new Date()); |
| | | if (!wrkMastService.updateById(mast)) { |
| | | throw new CoolException("task cancel update fail"); |
| | |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | private boolean requiresOutboundErpConfirm(WrkMast wrkMast) { |
| | | Integer ioType = wrkMast == null ? null : wrkMast.getIoType(); |
| | | return ioType != null && (ioType == 101 || ioType == 103 || ioType == 104 || ioType == 107 || ioType == 110); |
| | | } |
| | | @Override |
| | | public R pauseOutTasks(StopOutTaskParams params) { |
| | | if (params == null || params.getTasks() == null || params.getTasks().isEmpty()) { |