| | |
| | | if (!taskService.updateById(task)) { |
| | | throw new CoolException("任务状态修改失败!!"); |
| | | } |
| | | } else if (task.getIoType().equals(110)) { |
| | | Date now = new Date(); |
| | | LocCache locMast = locCacheService |
| | | .selectOne(new EntityWrapper<LocCache>().eq("loc_no", task.getSourceLocNo())); |
| | | if (Objects.isNull(locMast)) { |
| | | throw new RuntimeException("数据错误:库位信息不能为空!!"); |
| | | } |
| | | // 修改源库位状态 R ===>> O |
| | | if (locMast.getLocSts().equals(LocStsType.LOC_STS_TYPE_R.type)) { |
| | | locMast.setLocSts(LocStsType.LOC_STS_TYPE_O.type); |
| | | locMast.setBarcode(""); |
| | | locMast.setModiTime(now); |
| | | locMast.setIoTime(now); |
| | | if (!locCacheService.updateById(locMast)) { |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | return FAIL.setMsg("全板出库 ===>> 修改源库位状态失败; [workNo=" + task.getWrkNo() + "],[locNo=" |
| | | + task.getSourceLocNo() + "]"); |
| | | } |
| | | } else { |
| | | throw new CoolException("当前库位状态" + locMast.getLocSts() + ", 无法执行出库操作!!"); |
| | | } |
| | | |
| | | BasStation devNo = basStationService |
| | | .selectOne(new EntityWrapper<BasStation>().eq("dev_no", task.getStaNo())); |
| | | if (Objects.isNull(devNo)) { |
| | | throw new CoolException("站点:" + task.getSourceStaNo() + ", 不存在!!"); |
| | | } |
| | | devNo.setLocSts(LocStsType.LOC_STS_TYPE_D.type); |
| | | devNo.setModiTime(new Date()); |
| | | if (!basStationService.updateById(devNo)) { |
| | | throw new CoolException("站点信息修改失败!!"); |
| | | } |
| | | task.setWrkSts(15L); |
| | | if (!taskService.updateById(task)) { |
| | | throw new CoolException("任务状态修改失败!!"); |
| | | } |
| | | } else { |
| | | |
| | | } |