From f7360a57e6888bbdc8ecd6e8f376916df4c2567b Mon Sep 17 00:00:00 2001 From: Comair <1464848666@qq.com> Date: Fri, 2 Aug 2024 09:18:36 +0800 Subject: [PATCH] =?UTF-8?q?=E7=8E=B0=E5=9C=BA=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/shkj/wms/bo/AssingEmptyLocBo.java | 1 + .../src/main/java/com/shkj/wms/plc/PlcEventTask.java | 9 +++++++-- .../main/java/com/shkj/wms/scheduled/ScheduledTasks.java | 8 +++++++- .../shkj/wms/service/impl/BaseLocationServiceImpl.java | 2 ++ .../wms/service/impl/PutInOutStorageServiceImpl.java | 5 +++-- 5 files changed, 20 insertions(+), 5 deletions(-) diff --git a/shkj-wms/src/main/java/com/shkj/wms/bo/AssingEmptyLocBo.java b/shkj-wms/src/main/java/com/shkj/wms/bo/AssingEmptyLocBo.java index b63e554..77f1a6c 100644 --- a/shkj-wms/src/main/java/com/shkj/wms/bo/AssingEmptyLocBo.java +++ b/shkj-wms/src/main/java/com/shkj/wms/bo/AssingEmptyLocBo.java @@ -23,6 +23,7 @@ public class AssingEmptyLocBo implements Serializable { private String vehicheModel; private String batch; + private String tunnel; private List businDataTaskGoodsVos; 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 bbf58dc..c99523b 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 @@ -34,6 +34,7 @@ import com.shkj.wms.service.IBaseGoodsDataService; import com.shkj.wms.service.IBusinDataTaskService; import com.shkj.wms.service.IPutInOutStorageService; import com.shkj.wms.utils.JsonUtil; +import io.lettuce.core.dynamic.domain.Timeout; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.ObjectUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -384,7 +385,11 @@ public class PlcEventTask { // containerCode=containerCode.substring(0,containerCode.length()-1); log.info("治具编号" + containerCode + "first:" + firstBarcode + "second:" + secondBarcode + "third:" + thirdBarcode); //连续读到相同治具编号时不生成新任务 - String redisContainerCode = redisTemplate.opsForValue().get("autoTask").toString(); + Object autoTask = redisTemplate.opsForValue().get("autoTask"); + String redisContainerCode=""; + if (autoTask != null){ + redisContainerCode = autoTask.toString(); + } if (redisContainerCode.equals(containerCode)) { return; } @@ -426,7 +431,7 @@ public class PlcEventTask { log.info("生成新任务:" + taskId + "治具编号:" + containerCode); scheduledTasks.inTask(taskId, one.getId()); if (ObjectUtils.isNotEmpty(taskId)) { - redisTemplate.opsForValue().set("autoTask", containerCode); + redisTemplate.opsForValue().set("autoTask", containerCode,5,TimeUnit.MINUTES); } } } 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 81056f8..3ea8193 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 @@ -1100,7 +1100,13 @@ public class ScheduledTasks { .eq(BaseLocation::getLocationColumn, locationColumn) .eq(BaseLocation::getLayer, layer)); if(one !=null){ - BusinDataTaskVo businDataTaskIsnotDeep = businDataTaskVos.stream().filter(item -> item.getLocationId().equals(one.getId())).findFirst().orElse(null); + // BusinDataTaskVo businDataTaskIsnotDeep = businDataTaskVos.stream().filter(item -> item.getLocationId().equals(one.getId())).findFirst().orElse(null); + BusinDataTask businDataTaskIsnotDeep = iBusinDataTaskService.getOne( + new LambdaQueryWrapper() + .eq(BusinDataTask::getLocationId, one.getId()) + .in(BusinDataTask::getTaskStatus, Arrays.asList("0", "-1")) + .last("limit 1") + ); if (businDataTaskIsnotDeep != null){ log.info("查询到单深位的任务:"+taskVoid); businDataTask=businDataTaskIsnotDeep; 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 8e6610a..8a9be5b 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 @@ -906,6 +906,7 @@ public class BaseLocationServiceImpl extends ServiceImpl baseLocationVos = this.baseMapper.queryBaseLocationListByGoods(bo); if (baseLocationVos.size() == 0) { @@ -1340,6 +1341,7 @@ public class BaseLocationServiceImpl extends ServiceImpl locationVoResult = this.assignEmptyLocationAll(assingEmptyLocBo); if (Result.isOk(locationVoResult)) { BaseLocationVo baseLocationVo = locationVoResult.getData(); 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 2d5b7ba..7f84751 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 @@ -451,8 +451,9 @@ public class PutInOutStorageServiceImpl extends ServiceImpl