自动化立体仓库 - WMS系统
zhou zhou
22 小时以前 65b0504a31e97af4f80bd31eaf7b56eea7e80a38
src/main/java/com/zy/asrs/service/impl/TaskServiceImpl.java
@@ -34,6 +34,8 @@
    private TaskService taskService;
    @Autowired
    private TaskDetlLogService taskDetlLogService;
    @Autowired
    private BasStationService basStationService;
    @Override
    @Transactional(rollbackFor = Exception.class)
@@ -67,7 +69,7 @@
    @Override
    @Transactional
    public void pickWrkMast(String workNo, Long userId) {
        Task wrkMast = this.selectById(workNo);
        Task wrkMast = this.selectOne(new EntityWrapper<Task>().eq("wrk_no", workNo) );
        if (Cools.isEmpty(wrkMast)) {
            throw new CoolException(workNo + "工作档不存在");
        }
@@ -154,6 +156,18 @@
                locMast.setModiUser(userId);
                locCacheService.updateById(locMast);
            }
            BasStation station = basStationService.selectOne(new EntityWrapper<BasStation>().eq("dev_no", wrkMast.getSourceStaNo()));
            if (station.getLocSts().equals("R")) {
                station.setLocSts(wrkMast.getIoType().equals(1)?"F":"D");
                station.setModiTime(new Date());
                station.setModiUser(userId);
                if (!basStationService.updateById(station)) {
                    throw new CoolException("更新源站点状态失败");
                }
            } else {
                throw new CoolException("更新源站点状态失败,目标库位状态:" + station.getLocSts());
            }
            // 出库取消(修改源库位)
        } else if (wrkMast.getWrkSts() > 10 && wrkMast.getWrkSts() != 14) {
            locNo = wrkMast.getSourceLocNo();
@@ -176,6 +190,18 @@
                locMast.setModiUser(userId);
                locCacheService.updateById(locMast);
            }
            BasStation station = basStationService.selectOne(new EntityWrapper<BasStation>().eq("dev_no", wrkMast.getStaNo()));
            if (station.getLocSts().equals("S")) {
                station.setLocSts("O");
                station.setModiTime(new Date());
                station.setModiUser(userId);
                if (!basStationService.updateById(station)) {
                    throw new CoolException("更新源站点状态失败");
                }
            } else {
                throw new CoolException("更新源站点状态失败,目标库位状态:" + station.getLocSts());
            }
        } else {
            throw new CoolException("当前工作状态无法取消");
        }