| | |
| | | @Autowired |
| | | private WrkMastService wrkMastService; |
| | | @Autowired |
| | | private WrkMastLogService wrkMastLogService; |
| | | @Autowired |
| | | private WrkLastnoService wrkLastnoService; |
| | | @Autowired |
| | | private LocMastService locMastService; |
| | |
| | | return workNo; |
| | | } |
| | | |
| | | //检测工作号是否在指定类型工作范围内 |
| | | public synchronized boolean checkWorkNoContainMk(Integer workNo, Integer wrkMk) { |
| | | WrkLastno wrkLastno = wrkLastnoService.selectById(wrkMk); |
| | | if (Cools.isEmpty(wrkLastno)) { |
| | | throw new CoolException("数据异常,请联系管理员"); |
| | | } |
| | | |
| | | int sNo = wrkLastno.getSNo(); |
| | | int eNo = wrkLastno.getENo(); |
| | | if (workNo >= sNo && workNo <= eNo) { |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | public static String zerofill(String msg, Integer count) { |
| | | if (msg.length() == count) { |
| | | return msg; |
| | |
| | | wrkMast.setWrkSts(WrkStsType.COMPLETE_MOVE.sts); |
| | | } else if (wrkMast.getIoType() == WrkIoType.SHUTTLE_CHARGE.id) { |
| | | wrkMast.setWrkSts(WrkStsType.COMPLETE_CHARGE.sts); |
| | | } else if (wrkMast.getIoType() == WrkIoType.LOC_MOVE.id) { |
| | | wrkMast.setWrkSts(WrkStsType.COMPLETE_LOC_MOVE.sts); |
| | | } |
| | | |
| | | wrkMast.setModiTime(new Date()); |
| | |
| | | throw new CoolException("任务不存在"); |
| | | } |
| | | |
| | | wrkMastLogService.save(wrkNo); |
| | | wrkMastService.deleteById(wrkNo); |
| | | wrkMast.setMk("taskCancel"); |
| | | wrkMast.setModiTime(new Date()); |
| | | wrkMastService.updateById(wrkMast); |
| | | return true; |
| | | } |
| | | |
| | | //移库任务 |
| | | public boolean createLocMoveTask(CreateLocMoveTaskParam param) { |
| | | Date now = new Date(); |
| | | LocMast locMast = locMastService.queryByLoc(param.getSourceLocNo()); |
| | | if (null == locMast) { |
| | | LocMast sourceLocMast = locMastService.queryByLoc(param.getSourceLocNo()); |
| | | if (null == sourceLocMast) { |
| | | throw new CoolException("源库位不存在"); |
| | | } |
| | | |
| | | if (!locMast.getLocSts().equals("F")) { |
| | | if (!sourceLocMast.getLocSts().equals("F")) { |
| | | throw new CoolException("源库位不处于在库状态"); |
| | | } |
| | | |
| | | LocMast locMast = locMastService.queryByLoc(param.getLocNo()); |
| | | if (null == locMast) { |
| | | throw new CoolException("目标库位不存在"); |
| | | } |
| | | |
| | | if (!locMast.getLocSts().equals("O")) { |
| | | throw new CoolException("目标库位不处于空库状态"); |
| | | } |
| | | |
| | | // 获取工作号 |
| | |
| | | News.error("移库任务 --- 保存工作档失败!"); |
| | | throw new CoolException("保存工作档失败"); |
| | | } |
| | | |
| | | sourceLocMast.setLocSts("R"); |
| | | sourceLocMast.setModiTime(new Date()); |
| | | locMastService.updateById(sourceLocMast); |
| | | |
| | | locMast.setLocSts("S"); |
| | | locMast.setModiTime(new Date()); |
| | | locMastService.updateById(locMast); |
| | | |
| | | return true; |
| | | } |
| | |
| | | throw new CoolException("保存工作档失败"); |
| | | } |
| | | |
| | | locMast.setLocSts("S"); |
| | | locMast.setModiTime(new Date()); |
| | | locMastService.updateById(locMast); |
| | | |
| | | return true; |
| | | } |
| | | |
| | |
| | | throw new CoolException("保存工作档失败"); |
| | | } |
| | | |
| | | locMast.setLocSts("R"); |
| | | locMast.setModiTime(new Date()); |
| | | locMastService.updateById(locMast); |
| | | |
| | | return true; |
| | | } |
| | | |