自动化立体仓库 - WMS系统
zhou zhou
1 天以前 df325bcf7aabda3e879fbf86c85b3fd5047cffe0
src/main/java/com/zy/asrs/service/impl/TaskServiceImpl.java
@@ -14,6 +14,7 @@
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.concurrent.TimeUnit;
@@ -31,12 +32,13 @@
    private TaskDetlService taskDetlService;
    @Autowired
    private TaskService taskService;
    @Autowired
    private TaskDetlLogService taskDetlLogService;
    @Autowired
    private BasStationService basStationService;
    @Override
    @Transactional
    @Transactional(rollbackFor = Exception.class)
    public void completeWrkMast(String workNo, Long userId) {
        Task wrkMast = this.selectOne(new EntityWrapper<Task>().eq("wrk_no", workNo));
        if (Cools.isEmpty(wrkMast)) {
@@ -121,6 +123,10 @@
        }
    }
    @Override
    public List<Task> selectToBeCompleteData() {
        return this.baseMapper.selectToBeCompleteData();
    }
    @Override
@@ -150,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();
@@ -172,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("当前工作状态无法取消");
        }