| | |
| | | |
| | | public void updateLocStsByLocNo(String locNo, String locSts, String barcode,Short containerType); |
| | | |
| | | public void updateLocStsByLocNo(String locNo, String locSts, String barcode,Short containerType,String locType,Short locType3); |
| | | public List<String> queryGroupEmptyStock(int floor); |
| | | |
| | | List<AgvLocMast> selectLocByLevAndFloor(int lev, int floor); |
| | |
| | | agvLocMast.setLocType2(containerType); |
| | | this.updateById(agvLocMast); |
| | | } |
| | | public void updateLocStsByLocNo(String locNo, String locSts, String barcode,Short containerType,String locType,Short locType3) { |
| | | AgvLocMast agvLocMast = this.selectById(locNo); |
| | | agvLocMast.setLocSts(locSts); |
| | | agvLocMast.setBarcode(barcode); |
| | | agvLocMast.setLocType2(containerType); |
| | | agvLocMast.setLocType(locType); |
| | | agvLocMast.setLocType3(locType3); |
| | | this.updateById(agvLocMast); |
| | | } |
| | | |
| | | public List<String> queryGroupEmptyStock(int floor) { |
| | | return this.baseMapper.queryGroupEmptyStock(floor); |
| | |
| | | //修改出库站点状态 |
| | | agvBasDevpService.updateLocStsAndBarcodeByDevNo(wrkMast.getLocNo(),"F",wrkMast.getBarcode(),wrkMast.getWhsType().shortValue()); |
| | | } |
| | | if(wrkMast.getIoType() == 1 || wrkMast.getIoType() == 53 ){ |
| | | //修改出库站点状态 |
| | | agvBasDevpService.updateLocStsAndBarcodeByDevNo(wrkMast.getSourceLocNo(),"O","",wrkMast.getWhsType().shortValue()); |
| | | } |
| | | //出库任务 110.空板出库 |
| | | if(wrkMast.getIoType() == 110){ |
| | | agvBasDevpService.updateLocStsAndBarcodeByDevNo(wrkMast.getLocNo(),"F",wrkMast.getBarcode(),wrkMast.getWhsType().shortValue()); |
| | |
| | | agvWrkMast.setWrkNo(-agvWrkMast.getWrkNo()); |
| | | } |
| | | agvTaskCreateParam.setTaskCode(agvWrkMast.getWrkNo().toString()); |
| | | agvTaskCreateParam.setTaskTyp("F01"); |
| | | if (agvWrkMast.getIoType() == 108 || agvWrkMast.getIoType() == 109) { |
| | | agvTaskCreateParam.setTaskTyp("F06"); |
| | | } else { |
| | | agvTaskCreateParam.setTaskTyp("F01"); |
| | | } |
| | | |
| | | agvTaskCreateParam.setPositionCodePath(agvTaskParamList); |
| | | |
| | | } |
| | |
| | | /* |
| | | 定时处理AGV工作档中工作状态为205.工作完成 且 (1.入库 || 53,拣料入库 || 57.盘点入库 || 10.空板入库 || 11.库格移载)的数据 |
| | | */ |
| | | @Scheduled(cron = "0/1 * * * * ? ") |
| | | @Scheduled(cron = "0/3 * * * * ? ") |
| | | public void excutePutwayWrk(){ |
| | | List<AgvWrkMast> agvWrkMastList = agvWrkMastService.selectList(new EntityWrapper<AgvWrkMast>() |
| | | .eq("wrk_sts", 205) |
| | |
| | | /* |
| | | 定时处理AGV工作档中工作状态为206.出库完成 且 (101.出库 || 110.空板出库) |
| | | */ |
| | | @Scheduled(cron = "0/1 * * * * ? ") |
| | | @Scheduled(cron = "0/3 * * * * ? ") |
| | | public void excuteCarryWrk(){ |
| | | List<AgvWrkMast> agvWrkMastList = agvWrkMastService.selectList(new EntityWrapper<AgvWrkMast>() |
| | | .eq("wrk_sts", 206) |
| | |
| | | /* |
| | | 定时处理AGV工作档中工作状态为206.出库完成 且 (101.出库 || 110.空板出库) |
| | | */ |
| | | @Scheduled(cron = "0/1 * * * * ? ") |
| | | @Scheduled(cron = "0/3 * * * * ? ") |
| | | public void excuteCarryWrk2(){ |
| | | List<AgvWrkMast> agvWrkMastList = agvWrkMastService.selectList(new EntityWrapper<AgvWrkMast>() |
| | | .eq("wrk_sts", 208) |
| | |
| | | putaway:上架 |
| | | 定时处理AGV工作档中工作状态为201.生成入库任务ID 且(出库类型为 53.拣料再入库 || 1.入库 || 10.空板入库栽 || 57.盘点再入库)的数据 |
| | | */ |
| | | @Scheduled(cron = "0/2 * * * * ? ") |
| | | @Scheduled(cron = "0/3 * * * * ? ") |
| | | public void startPutwayWrk(){ |
| | | List<AgvWrkMast> agvWrkMastList = agvWrkMastService.selectPage(new Page<>(1, 50) |
| | | ,new EntityWrapper<AgvWrkMast>() |
| | |
| | | .andNew().eq("io_type", 53) |
| | | .or().eq("io_type", 1) |
| | | .or().eq("io_type", 10) |
| | | .or().eq("io_type", 57)).getRecords(); |
| | | .or().eq("io_type", 57) |
| | | .or().eq("io_type", 108)).getRecords(); |
| | | |
| | | if(!Cools.isEmpty(agvWrkMastList)){ |
| | | agvWrkMastList.forEach(agvWrkMast -> { |
| | |
| | | carry:搬运,统指出库、移库、点到点搬运等 |
| | | 定时处理AGV工作档中工作状态为21.生成出库任务 且(出库类型为 101.出库 || 103.拣料出库 || 11.库格移栽 || 110.空板出库 || 107.盘点出库)的数据 |
| | | */ |
| | | @Scheduled(cron = "0/10 * * * * ? ") |
| | | @Scheduled(cron = "0/3 * * * * ? ") |
| | | public void startCarryWrk(){ |
| | | List<AgvWrkMast> agvWrkMastList = agvWrkMastService.selectPage(new Page<>(1, 50) |
| | | ,new EntityWrapper<AgvWrkMast>() |
| | |
| | | /* |
| | | 自动生成空板出库任务 |
| | | */ |
| | | @Scheduled(cron = "0/10 * * * * ? ") |
| | | @Scheduled(cron = "0/3 * * * * ? ") |
| | | public void autoEmptyOut(){ |
| | | boolean packageEmptyAutoOUt = Cools.eq("Y",Parameter.get().getPackageEmptyAutoOUt()); |
| | | boolean mateEmptyAutoOut = Cools.eq("Y",Parameter.get().getMateEmptyAutoOut()); |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | @Scheduled(cron = "0/2 * * * * ? ") |
| | | private void autoEmptyBack(){ |
| | | // 查询 不为1楼的空货架 |
| | | List<AgvLocMast> agvLocMasts = agvLocMastService.selectList( |
| | | new EntityWrapper<AgvLocMast>() |
| | | .ne("floor", 3) |
| | | .eq("loc_sts","D") |
| | | .eq("loc_type1",3)); |
| | | if (agvLocMasts.isEmpty()) { |
| | | return; |
| | | } |
| | | for (AgvLocMast agvLocMast : agvLocMasts) { |
| | | ReturnT<String> returnT = autoMoveHandler.start(agvLocMast); |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | //更新库存明细 |
| | | agvLocDetlService.updateStock(agvWrkMast.getSourceLocNo(),agvWrkMast.getLocNo()); |
| | | //修改源库位状态为O |
| | | agvLocMastService.updateLocStsByLocNo(agvWrkMast.getSourceLocNo(),"O","",null); |
| | | |
| | | agvLocMastService.updateLocStsByLocNo(agvWrkMast.getSourceLocNo(),"O","",agvWrkMast.getWhsType().shortValue(),"",(short)0); |
| | | } |
| | | |
| | | if(agvWrkMast.getIoType() == 109){ |
| | | //修改源库位状态为O |
| | | agvLocMastService.updateLocStsByLocNo(agvWrkMast.getSourceLocNo(),"O","",agvWrkMast.getWhsType().shortValue(),"",(short)0); |
| | | } |
| | | |
| | | |
| | | //删除AGV工作档 |
| | | agvWrkMastService.deleteById(wrkNo); |
| | | //删除AGV工作明细档 |
| | |
| | | locMast.setLocSts(locSts); |
| | | agvLocMastService.updateById(locMast); |
| | | } |
| | | |
| | | public ReturnT<String> autoEmptyBack(AgvLocMast agvLocMast) { |
| | | Date now = new Date(); |
| | | //查询工作档 |
| | | AgvWrkMast agvWrkMast = agvWrkMastService.selectByContainerCode(agvLocMast.getBarcode()); |
| | | if(!Cools.isEmpty(agvWrkMast)){ |
| | | throw new CoolException("当前"+agvLocMast.getBarcode()+"货架码已在工作档中"); |
| | | } |
| | | //检索库位,选择合适的库位 |
| | | AgvLocMast LocMast = agvCommonService.getLocNo(3,agvLocMast.getLocType3()); |
| | | //生成工作档 |
| | | AgvWrkMast mast = new AgvWrkMast(); |
| | | //工作状态 |
| | | mast.setWrkSts(201L); |
| | | //入出库类型 |
| | | mast.setIoType(109); |
| | | mast.setIoTime(now); |
| | | //优先级 |
| | | mast.setIoPri(300.0); |
| | | //源站点 |
| | | mast.setSourceLocNo(agvLocMast.getLocNo()); |
| | | //目标站点 |
| | | mast.setLocNo(LocMast.getLocNo()); |
| | | //容器编码 |
| | | mast.setBarcode(agvLocMast.getBarcode()); |
| | | //容器类型 |
| | | mast.setWhsType(30); |
| | | |
| | | mast.setAppeUser(9527L); |
| | | mast.setAppeTime(now); |
| | | mast.setModiUser(9527L); |
| | | mast.setModiTime(now); |
| | | if (!agvWrkMastService.insertByIncrease(mast)) { |
| | | throw new CoolException("保存工作档失败"); |
| | | } |
| | | return SUCCESS; |
| | | } |
| | | } |