From 0ee63a1947e4955a4f2ff1ea80ab1770848f6837 Mon Sep 17 00:00:00 2001 From: judy <278197488@qq.com> Date: Fri, 30 Aug 2024 10:53:46 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9B=98=E7=82=B9=E6=B5=8B=E8=AF=95=E4=BC=98?= =?UTF-8?q?=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/BusinStockInvQueryBo.java | 5 +++++ shkj-wms/src/main/java/com/shkj/wms/plc/PlcEventTask.java | 3 +++ .../src/main/java/com/shkj/wms/scheduled/ScheduledTasks.java | 2 +- shkj-wms/src/main/java/com/shkj/wms/utils/IntIdUtil.java | 4 ++-- .../src/main/java/com/shkj/wms/vo/StockLocationInvVo.java | 2 +- .../src/main/resources/mapper/wms/BusinStockInvMapper.xml | 4 ++-- 6 files changed, 14 insertions(+), 6 deletions(-) diff --git a/shkj-wms/src/main/java/com/shkj/wms/bo/BusinStockInvQueryBo.java b/shkj-wms/src/main/java/com/shkj/wms/bo/BusinStockInvQueryBo.java index 8905d6f..4e7ae8f 100644 --- a/shkj-wms/src/main/java/com/shkj/wms/bo/BusinStockInvQueryBo.java +++ b/shkj-wms/src/main/java/com/shkj/wms/bo/BusinStockInvQueryBo.java @@ -66,5 +66,10 @@ public class BusinStockInvQueryBo extends BaseEntity { */ private String invStatus; + /** + * 货位ID + */ + private Long locationId; + } 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 62dd79b..ed87fd6 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 @@ -523,6 +523,9 @@ public class PlcEventTask { Object temp = redisTemplate.opsForValue().get(RedisConstant.redisSTKWare + taskId); redisTaskId = ObjectUtils.isNotEmpty(temp) ? Long.valueOf(temp.toString()) : 0L; } + + log.info("堆垛机的数据:taskId="+taskId+" redisTaskId="+redisTaskId); + String tunnel = ""; //判断redis中是否已有此任务号,如果有则不再执行; if (taskId != 0 && !redisTaskId.equals(taskId) && readValue == 1) { 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 588c59a..c86a3b3 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 @@ -1722,7 +1722,7 @@ public class ScheduledTasks { plcToLayerMap.put("SHORT", baseLocation.getLayer()); allMap.put(plcToLayer, plcToLayerMap); Map plcMLMap = new HashMap<>(1); - plcMLMap.put("Short", 4); + plcMLMap.put("Short", 7); allMap.put(plcml, plcMLMap); PLCReadAndWrite plcReadAndWrite = new PLCReadAndWrite(); diff --git a/shkj-wms/src/main/java/com/shkj/wms/utils/IntIdUtil.java b/shkj-wms/src/main/java/com/shkj/wms/utils/IntIdUtil.java index 94398b2..3e7030e 100644 --- a/shkj-wms/src/main/java/com/shkj/wms/utils/IntIdUtil.java +++ b/shkj-wms/src/main/java/com/shkj/wms/utils/IntIdUtil.java @@ -26,7 +26,7 @@ public class IntIdUtil { if (seq > ROTATION) { seq = 0; } - String str = String.format("%1$01d", seq++); + String str = String.format("%1$02d", seq++); SpringUtils.getBean(RedisCache.class).setCacheObject("seq", seq); System.out.println("redis的值为"+seq); return str; @@ -38,7 +38,7 @@ public class IntIdUtil { // 因为int的最大数是2147483647 所以前2位=当前年-10 String yearStr = now.getYear() - 10 + ""; yearStr = yearStr.substring(2); - StringBuilder id = new StringBuilder(yearStr + String.format("%1$01d", now.getDayOfYear() )+ next()); + StringBuilder id = new StringBuilder(yearStr + String.format("%1$02d", now.getDayOfYear() )+ next()); return Long.parseLong(id.toString()); } diff --git a/shkj-wms/src/main/java/com/shkj/wms/vo/StockLocationInvVo.java b/shkj-wms/src/main/java/com/shkj/wms/vo/StockLocationInvVo.java index 41f4ef8..44b76e7 100644 --- a/shkj-wms/src/main/java/com/shkj/wms/vo/StockLocationInvVo.java +++ b/shkj-wms/src/main/java/com/shkj/wms/vo/StockLocationInvVo.java @@ -44,5 +44,5 @@ public class StockLocationInvVo implements Serializable { /** * 保险杠数量 */ - private String goodQty; + private Integer goodQty; } diff --git a/shkj-wms/src/main/resources/mapper/wms/BusinStockInvMapper.xml b/shkj-wms/src/main/resources/mapper/wms/BusinStockInvMapper.xml index d6bd887..84c51fa 100644 --- a/shkj-wms/src/main/resources/mapper/wms/BusinStockInvMapper.xml +++ b/shkj-wms/src/main/resources/mapper/wms/BusinStockInvMapper.xml @@ -39,7 +39,7 @@ - select loc.id as locationId, loc.location_code,goods.vehiche_model,goods.color,loc.location_status,count(stock.id) goodQty + select loc.id as locationId, loc.location_code,goods.vehiche_model,goods.color,loc.location_status, sum(case when stock.goods_no is null then 0 else 1 end ) as goodQty from base_location loc left join sys_stock_detail stock on loc.id =stock.location_id left join base_goods_data goods on stock.goods_no=goods.goods_no