From 82f65b06c71e24c3ad66c1634c0e6d8c30052203 Mon Sep 17 00:00:00 2001 From: judy <278197488@qq.com> Date: Wed, 21 Aug 2024 09:49:07 +0800 Subject: [PATCH] =?UTF-8?q?=E5=87=BA=E5=BA=93=E6=97=B6=E9=AA=8C=E8=AF=81?= =?UTF-8?q?=E5=8F=8C=E6=B7=B1=E4=BD=8D=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shkj/wms/scheduled/ScheduledTasks.java | 20 ++++++++++ .../service/impl/BaseLocationServiceImpl.java | 37 +++++++++++++++++-- .../service/impl/BusinPickupServiceImpl.java | 11 ++++-- 3 files changed, 60 insertions(+), 8 deletions(-) diff --git a/shkj-wms/src/main/java/com/shkj/wms/scheduled/ScheduledTasks.java b/shkj-wms/src/main/java/com/shkj/wms/scheduled/ScheduledTasks.java index f08aef9..ec438fa 100644 --- a/shkj-wms/src/main/java/com/shkj/wms/scheduled/ScheduledTasks.java +++ b/shkj-wms/src/main/java/com/shkj/wms/scheduled/ScheduledTasks.java @@ -769,9 +769,27 @@ public class ScheduledTasks { .last("limit 1") ); if (businDataTaskIsnotDeep != null){ + //单深位有任务,优先下发单深位任务 log.info("查询到单深位的任务:"+taskVoid); businDataTask=businDataTaskIsnotDeep; location=one; + }else{ + //单深位无任务,再查询外面深位是否有库存,如果有,更新此任务的取货路径 + if ("1".equals(one.getLocationStatus()) || "2".equals(one.getLocationStatus())){ + //先把深位的货位状态改为有货或空托状态 + if(businDataTaskGoodsVos !=null && businDataTaskGoodsVos.size()>0){ + location.setLocationStatus("1"); + }else { + location.setLocationStatus("2"); + } + iBaseLocationService.updateById(location); + businDataTask.setFromColumn(one.getLocationColumn()); + businDataTask.setFromRow(one.getLocationRow()); + businDataTask.setFromLayer(one.getLayer()); + businDataTask.setLocationId(one.getId()); + + location=one; + } } } } @@ -787,6 +805,7 @@ public class ScheduledTasks { //给库存添加出货预占 iSysStockDetailService.updateBatchById(sysStockDetailList); + //给堆垛机下发任务 Result taskResult = outTask(businDataTask); if (taskResult.getCode() == HttpStatus.SUCCESS.getCode()) { @@ -825,6 +844,7 @@ public class ScheduledTasks { } businDataTask.setDistinction(businDataTaskVo.getDistinction()); iBusinDataTaskService.saveOrUpdate(businDataTask); + businDataTaskVo = BeanUtil.toBean(businDataTask, BusinDataTaskVo.class); } else { businDataTaskVo.setExceptionMsg("当前开放的货位已无当前库存"); diff --git a/shkj-wms/src/main/java/com/shkj/wms/service/impl/BaseLocationServiceImpl.java b/shkj-wms/src/main/java/com/shkj/wms/service/impl/BaseLocationServiceImpl.java index f3ea835..ef841ec 100644 --- a/shkj-wms/src/main/java/com/shkj/wms/service/impl/BaseLocationServiceImpl.java +++ b/shkj-wms/src/main/java/com/shkj/wms/service/impl/BaseLocationServiceImpl.java @@ -1442,11 +1442,39 @@ public class BaseLocationServiceImpl extends ServiceImpl locationVoResult; + AssingEmptyLocBo assingEmptyLocBo = null; + if (businDataTaskGoodsVos !=null && businDataTaskGoodsVos.size()>0){ + assingEmptyLocBo = new AssingEmptyLocBo(); + assingEmptyLocBo.setBusinDataTaskGoodsVos(businDataTaskGoodsVos); + assingEmptyLocBo.setBatch(DateUtils.getDate()); + assingEmptyLocBo.setGoodsNo(businDataTaskGoodsVos.get(0).getGoodsNo()); + assingEmptyLocBo.setVehicheModel(businDataTaskGoodsVos.get(0).getVehicheModel()); + assingEmptyLocBo.setTunnel(baseLocation.getTunnel()); + locationVoResult = this.assignEmptyLocationAll(assingEmptyLocBo, null); + }else { + locationVoResult = this.assignEmptyLocationAll(assingEmptyLocBo, tunnel); + } + if (Result.isOk(locationVoResult)){ + BaseLocationVo baseLocationVo = locationVoResult.getData(); + log.info("给堆垛机下发任务:" + businDataTask.getId() + " 原货位:" +baseLocation.getLocationCode()+" 新货位:"+baseLocationVo.getLocationCode()); + businDataTask.setToLayer(baseLocationVo.getLayer()); + businDataTask.setToColumn(baseLocationVo.getLocationColumn()); + businDataTask.setToRow(baseLocationVo.getLocationRow()); + businDataTask.setLocationId(baseLocationVo.getId()); + log.info("原货位已被占用,重新分配的货位:" + JsonUtil.toJSONString(baseLocationVo)); + iBusinDataTaskService.updateById(businDataTask); + } + return; + } + //如果是单深位,验证下双深位的是否有库存,如果有在判断车型颜色是否一致 if ("2".equals(locationRow) || "3".equals(locationRow) || "14".equals(locationRow)) { if (locationRow.equals("2")) { @@ -1500,7 +1528,8 @@ public class BaseLocationServiceImpl extends ServiceImpl 0) { @@ -1583,7 +1613,6 @@ public class BaseLocationServiceImpl extends ServiceImpl map : goods) { SysStockDetail sysStockDetail = new SysStockDetail(); -// sysStockDetail.setStorageId(storageCode); sysStockDetail.setContainerCode(DataTask.getContainerId()); sysStockDetail.setQty(BigDecimal.valueOf(goods.size())); sysStockDetail.setBatch(batch); @@ -420,8 +420,11 @@ public class BusinPickupServiceImpl extends ServiceImpl booleanResult = iBusinEnptyContainerService.emptyContainerFlowDir(point, bo.getContainerId(), agvno, null); + if (Result.isOk(booleanResult)){ + redisTemplate.opsForValue().set("xzz:"+DataTask.getId(),agvno,5, TimeUnit.MINUTES); + } + // 创建任务 //TODO 平库释放后直接去下挂逻辑,后续不需要可以删掉 // BusinDataTask task = new BusinDataTask(); @@ -750,7 +753,7 @@ public class BusinPickupServiceImpl extends ServiceImpl booleanResult = iBusinEnptyContainerService.emptyContainerFlowDir(point, businPickupAddBo.getContainerId(), agvno, null); if (Result.isOk(booleanResult)){ log.info("小组装放行完成:"+point+" AGV编号:"+agvno+" 任务号:"+businPickupAddBo.getTaskCode()); - redisTemplate.opsForValue().set("xzz:"+DataTask.getId(),agvno); + redisTemplate.opsForValue().set("xzz:"+DataTask.getId(),agvno,5,TimeUnit.MINUTES); DataTask.setTaskStatus("2"); businDataTaskService.updateById(DataTask);