From 9af243246082c1d6324985252af7787b9b821b7d Mon Sep 17 00:00:00 2001 From: Comair <1464848666@qq.com> Date: Tue, 23 Jul 2024 21:06:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=A9=BA=E6=89=98=E5=8E=BB?= =?UTF-8?q?=E5=90=91=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/shkj/wms/plc/PlcEventTask.java | 10 +++++----- .../src/main/java/com/shkj/wms/plc/PlcInit.java | 2 +- .../com/shkj/wms/scheduled/ScheduledTasks.java | 15 +++++++++------ .../wms/service/impl/BaseLocationServiceImpl.java | 9 +++++++++ .../impl/IBusinEnptyContainerServiceImpl.java | 4 ++-- .../service/impl/PutInOutStorageServiceImpl.java | 5 +++-- .../main/java/com/shkj/wms/third/rcs/RCSUtil.java | 1 - .../resources/mapper/wms/BusinDataTaskMapper.xml | 2 +- 8 files changed, 30 insertions(+), 18 deletions(-) diff --git a/shkj-wms/src/main/java/com/shkj/wms/plc/PlcEventTask.java b/shkj-wms/src/main/java/com/shkj/wms/plc/PlcEventTask.java index af6cab9..38a3886 100644 --- a/shkj-wms/src/main/java/com/shkj/wms/plc/PlcEventTask.java +++ b/shkj-wms/src/main/java/com/shkj/wms/plc/PlcEventTask.java @@ -136,7 +136,7 @@ public class PlcEventTask { private ScheduledExecutorService executorService = Executors.newScheduledThreadPool(8); - // @Scheduled(fixedRate = 200) + @Scheduled(fixedRate = 200) public void init() { //查询需要连接的PLC,初始化连接对象 List plcList = iWcsPlcConnectService.selectWcsPlcConnectList(new WcsPlcConnect().setIsActive("1")); @@ -219,7 +219,7 @@ public class PlcEventTask { } } - // @Scheduled(fixedRate = 200) + @Scheduled(fixedRate = 200) public void init1() { //查询需要连接的PLC,初始化连接对象 List plcList = iWcsPlcConnectService.selectWcsPlcConnectList(new WcsPlcConnect().setIsActive("1")); @@ -237,7 +237,7 @@ public class PlcEventTask { } } - // @Scheduled(fixedRate = 200) + @Scheduled(fixedRate = 200) public void init2() { //查询需要连接的PLC,初始化连接对象 List plcList = iWcsPlcConnectService.selectWcsPlcConnectList(new WcsPlcConnect().setIsActive("1")); @@ -255,7 +255,7 @@ public class PlcEventTask { } } - // @Scheduled(fixedDelay = 6000) + @Scheduled(fixedDelay = 6000) public void writePlcheartbeat() { //根据连接的plcId获取属性 PlcOperate plcOperate = plcInit.getPlcOperate_41(); @@ -678,7 +678,7 @@ public class PlcEventTask { LocalTime end = LocalTime.now(); Duration between = Duration.between(start, end); long seconds = between.getSeconds() % 60; - log.info("执行plctask用时:" + seconds); + // log.info("执行plctask用时:" + seconds); } catch (Exception e) { e.printStackTrace(); diff --git a/shkj-wms/src/main/java/com/shkj/wms/plc/PlcInit.java b/shkj-wms/src/main/java/com/shkj/wms/plc/PlcInit.java index e3f80f5..4c94631 100644 --- a/shkj-wms/src/main/java/com/shkj/wms/plc/PlcInit.java +++ b/shkj-wms/src/main/java/com/shkj/wms/plc/PlcInit.java @@ -42,7 +42,7 @@ public class PlcInit { RedisTemplate redisTemplate; private ScheduledExecutorService executorService = Executors.newScheduledThreadPool(1); - // @PostConstruct + @PostConstruct public void init(){ log.info("初始化连接对象"); executorService.scheduleWithFixedDelay( 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 7a89bfd..c386bb2 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 @@ -179,9 +179,9 @@ public class ScheduledTasks { // @PostConstruct // @Scheduled(cron = "0/3 * * * * ? ") - // @Scheduled(fixedRate = 200) + @Scheduled(fixedRate = 200) public void task() { - log.info("开始获取需要执行的任务"); + // log.info("开始获取需要执行的任务"); //获取待下发任务数据 BusinTaskQueryBo taskQueryBo = new BusinTaskQueryBo(); List businDataTaskVos = new ArrayList<>(); @@ -234,7 +234,7 @@ public class ScheduledTasks { taskQueryBo.setTaskType("22"); List businDataTaskVo22 = iBusinDataTaskService.selectBusinDataTask1(taskQueryBo); businDataTaskVos.addAll(businDataTaskVo22); - + log.info("要执行的任务信息:"+JsonUtil.toJSONString(businDataTaskVos)); for (BusinDataTaskVo businDataTaskVo : businDataTaskVos) { doTask(businDataTaskVo); } @@ -387,7 +387,7 @@ public class ScheduledTasks { businDataTaskVo.setToLayer(locationVo.getLayer()); businDataTaskVo.setToRow(locationVo.getLocationRow()); businDataTaskVo.setTunnel(tunnel); - businDataTaskVo.setLocationId(locationVo.getId()); + businDataTaskVo.setLocationId(locationId); //获取货位对应的巷道及巷道对应的设备信息 pointQueryBo.setTunnel(tunnel); pointQueryBo.setDirection("0"); @@ -1895,7 +1895,7 @@ public class ScheduledTasks { /** * 空治具出库流程 */ - // @Scheduled(cron = "0/5 * * * * ? ") + @Scheduled(cron = "0/5 * * * * ? ") public void exeEmptyContainerFromWare() { if (ObjectUtils.isEmpty(redisTemplate.opsForValue().get(RedisConstant.out_empty_type))) { log.info("暂未设置空治具出库"); @@ -2071,6 +2071,8 @@ public class ScheduledTasks { } else if (businDataTaskVo.getWarehouseType().equals("2")) { randome = "P02"; } + + Long locationId =0L; if ("P01".equals(randome)) { //根据车型分配库位 先判断该任务是否已经分配了货位 Result locationVoResult = null; @@ -2093,7 +2095,7 @@ public class ScheduledTasks { redisTemplate.opsForValue().set("randome", "P02"); BaseLocationVo locationVo = locationVoResult.getData(); String tunnel = locationVo.getTunnel(); - Long locationId = locationVo.getId(); + locationId = locationVo.getId(); for (BusinDataTaskGoodsVo businDataTaskGoodsVo : businDataTaskGoodsVos) { businDataTaskGoodsVo.setLocationId(locationId); } @@ -2221,6 +2223,7 @@ public class ScheduledTasks { BusinDataTask businDataTask = new BusinDataTask(); businDataTask.setId(businDataTaskVo.getId()); businDataTask.setTaskStatus(TaskStatusEnum.wait_callback.getValue()); + businDataTask.setLocationId(locationId); iBusinDataTaskService.updateById(businDataTask); return; } 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 c1fc0f9..ca15f00 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 @@ -792,6 +792,7 @@ public class BaseLocationServiceImpl extends ServiceImpl assignEmptyLocationAll(AssingEmptyLocBo assingEmptyLocBo) { BaseLocationVo locationVo = null; //bo等于空时,是空治具分配货位,否则是保险杠分配货位 @@ -1000,6 +1001,14 @@ public class BaseLocationServiceImpl extends ServiceImpl locationList, String batch, String vehicheModel, List businDataTaskGoodsVos) { BaseLocationVo resultLocationVo = null; diff --git a/shkj-wms/src/main/java/com/shkj/wms/service/impl/IBusinEnptyContainerServiceImpl.java b/shkj-wms/src/main/java/com/shkj/wms/service/impl/IBusinEnptyContainerServiceImpl.java index 32b2680..7beb609 100644 --- a/shkj-wms/src/main/java/com/shkj/wms/service/impl/IBusinEnptyContainerServiceImpl.java +++ b/shkj-wms/src/main/java/com/shkj/wms/service/impl/IBusinEnptyContainerServiceImpl.java @@ -157,7 +157,7 @@ public class IBusinEnptyContainerServiceImpl extends ServiceImpl locationVoResult=iBaseLocationService.assignEmptyLocationAll(emptyLocBo); if (!Result.isOk(locationVoResult)){ @@ -175,7 +175,7 @@ public class IBusinEnptyContainerServiceImpl extends ServiceImpl basePointDeviceVos = baseLocationPlcMapper.selectBasePointByGroupno(pointQueryBo); if (basePointDeviceVos.size() > 0) { - basePointDeviceVo = basePointDeviceVos.get(0); + pointDeviceVo = basePointDeviceVos.get(0); } agvType= String.valueOf(RCSTaskTypeEnum.TO_B_AND_PUT.getValue()); diff --git a/shkj-wms/src/main/java/com/shkj/wms/service/impl/PutInOutStorageServiceImpl.java b/shkj-wms/src/main/java/com/shkj/wms/service/impl/PutInOutStorageServiceImpl.java index b1d04af..a54d97c 100644 --- a/shkj-wms/src/main/java/com/shkj/wms/service/impl/PutInOutStorageServiceImpl.java +++ b/shkj-wms/src/main/java/com/shkj/wms/service/impl/PutInOutStorageServiceImpl.java @@ -1053,6 +1053,7 @@ public class PutInOutStorageServiceImpl extends ServiceImpl 0 ? Result.ok():Result.err(); + // return businBillheadMapper.updateInfoBytaskCode(taskId) > 0 ? Result.ok():Result.err(); } @Override diff --git a/shkj-wms/src/main/java/com/shkj/wms/third/rcs/RCSUtil.java b/shkj-wms/src/main/java/com/shkj/wms/third/rcs/RCSUtil.java index 7dae3dd..2b972b4 100644 --- a/shkj-wms/src/main/java/com/shkj/wms/third/rcs/RCSUtil.java +++ b/shkj-wms/src/main/java/com/shkj/wms/third/rcs/RCSUtil.java @@ -339,7 +339,6 @@ public class RCSUtil { for (String point : points) { RcsIdList rcsIdList = new RcsIdList(); rcsIdList.setId(point); - log.error(point); idList.add(rcsIdList); } dto.setTargets(idList); diff --git a/shkj-wms/src/main/resources/mapper/wms/BusinDataTaskMapper.xml b/shkj-wms/src/main/resources/mapper/wms/BusinDataTaskMapper.xml index 8fdcade..383d215 100644 --- a/shkj-wms/src/main/resources/mapper/wms/BusinDataTaskMapper.xml +++ b/shkj-wms/src/main/resources/mapper/wms/BusinDataTaskMapper.xml @@ -249,7 +249,7 @@ - and DATE_FORMAT(task.create_time,'%Y-%m-%d')>=#{createTimeS} + and DATE_FORMAT(task.create_time,'%Y-%m-%d')>=#{createTimeS}