自动化立体仓库 - WMS系统
zyx
2024-02-05 19d222a720ba3d57964b2bee19d6e433851fb990
src/main/java/com/zy/common/web/WcsController.java
@@ -8,7 +8,6 @@
import com.zy.asrs.entity.*;
import com.zy.asrs.mapper.WrkMastMapper;
import com.zy.asrs.service.*;
import com.zy.asrs.utils.Utils;
import com.zy.common.CodeRes;
import com.zy.common.model.LocTypeDto;
import com.zy.common.model.StartupDto;
@@ -497,17 +496,23 @@
            }
        }
        //清空源库位数据
        LocMast locMast1 = locMastService.selectByLoc(wrkMast.getSourceLocNo());
        if (locMast1.getLocSts().equals("P")) {
            locMast1.setLocSts("O"); // 清空库位
            locMast1.setModiTime(new Date());
            if (!locMastService.updateById(locMast1)) {
                throw new CoolException("改变库位状态失败");
            }
        } else {
            throw new CoolException("源库位状态异常");
        //检查目标库位,库存明细是否添加成功
        List<LocDetl> checkLocDetls = locDetlService.selectByLocNo(dto.getLocNo());
        if (checkLocDetls.isEmpty()) {
            throw new CoolException("库存明细迁移失败");
        }
//        //清空源库位数据
        LocMast locMast1 = locMastService.selectByLoc(wrkMast.getSourceLocNo());
//        if (locMast1.getLocSts().equals("P")) {
//            locMast1.setLocSts("O"); // 清空库位
//            locMast1.setModiTime(new Date());
//            if (!locMastService.updateById(locMast1)) {
//                throw new CoolException("改变库位状态失败");
//            }
//        } else {
//            throw new CoolException("源库位状态异常");
//        }
        // 保存工作主档历史档
        if (!wrkMastLogService.save(wrkMast.getWrkNo())) {
@@ -577,20 +582,44 @@
        if(Cools.isEmpty(agvBasDevp) || !"O".equals(agvBasDevp.getLocSts())){
            throw new CoolException("当前站点不存在或者站点不为空");
        }
        if(Cools.isEmpty(agvWaitPakinService.selectByContainerCode(containerCode))){
            throw new CoolException("该料箱位组托");
        AgvWaitPakin agvWaitPakin = agvWaitPakinService.selectByContainerCode(containerCode);
        AgvWrkMast agvWrkMast = agvWrkMastService.selectOne(new EntityWrapper<AgvWrkMast>().eq("barcode", containerCode));
        //拣料、盘点完成任务
        if(!Cools.isEmpty(agvWrkMast) && (agvWrkMast.getIoType() == 103 || agvWrkMast.getIoType() == 107) && agvWrkMast.getWrkSts() == 205){
            //生成拣料、盘点再入库任务
            List<AgvWrkMast> agvWrkMastList = new ArrayList<>();
            agvWrkMast.setMk("Y");
            agvWrkMast.setLocNo(agvBasDevp.getDevNo());
            agvWrkMastList.add(agvWrkMast);
            agvWorkService.pickIn(agvWrkMastList);
            //绑定站点
            agvBasDevpService.updateLocStsAndBarcodeByDevNo(param.getDevNo(),"F",containerCode);
            return R.ok();
        }
        //去找agv工作档任务
        if(!Cools.isEmpty(agvWrkMastService.selectOne(new EntityWrapper<AgvWrkMast>().eq("barcode",containerCode)))){
            throw new CoolException("该料箱正在入库中");
        }
        //绑定站点
        agvBasDevpService.updateLocStsAndBarcodeByDevNo(param.getDevNo(),"F",containerCode);
        //入库任务
        if (!Cools.isEmpty(agvWaitPakinService.selectByContainerCode(containerCode))){
            //生成工作档
            List<AgvBasDevp> agvBasDevpList = agvBasDevpService.selectList(new EntityWrapper<AgvBasDevp>().eq("dev_no", param.getDevNo()));
            agvWorkService.createWaitPainWrkMastStart(agvBasDevpList, null, true);
        //生成工作档
        List<AgvBasDevp> agvBasDevpList = agvBasDevpService.selectList(new EntityWrapper<AgvBasDevp>().eq("dev_no", param.getDevNo()));
        agvWorkService.createWaitPainWrkMastStart(agvBasDevpList, null, true);
            //绑定站点
            agvBasDevpService.updateLocStsAndBarcodeByDevNo(param.getDevNo(),"F",containerCode);
            return R.ok();
        }
        return R.error("没有查询到该料箱信息");
    }
    /*
    显示AGV输送线拣料、盘点、入库信息
     */
    @PostMapping("/info")
    @ResponseBody
    public R showAgvBasDevInfo(@RequestBody ReplenishmentParam param){
        return R.ok();