From 7c9e61bb2b4bf9df7daa57f39d94ab511660ecd2 Mon Sep 17 00:00:00 2001 From: Joshi <3040996759@qq.com> Date: Wed, 29 Apr 2026 09:06:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=BD=E6=B0=B4=E5=90=8E=E7=AB=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- industry-admin/src/main/resources/application.yml | 8 ++++---- .../service/impl/IndustryMaterialServiceImpl.java | 15 ++++++++++++++- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/industry-admin/src/main/resources/application.yml b/industry-admin/src/main/resources/application.yml index 645656b5..40adb33d 100644 --- a/industry-admin/src/main/resources/application.yml +++ b/industry-admin/src/main/resources/application.yml @@ -14,12 +14,12 @@ industry: captchaType: math # 0为粗轧,1为精轧 -mode: 1 +mode: 0 # 开发环境配置 server: # 服务器的HTTP端口,默认为8080 - port: 8082 + port: 8081 servlet: # 应用的访问路径 context-path: / @@ -73,7 +73,7 @@ spring: # 地址 host: localhost # 端口,默认为6379 - port: 6380 + port: 6379 # 数据库索引 database: 0 # 密码 @@ -143,7 +143,7 @@ xss: urlPatterns: /system/*,/monitor/*,/tool/* -ipAddress: 10.20.10.29 +ipAddress: 10.20.10.30 httpIp: http://10.20.10.158 diff --git a/industry-system/src/main/java/com/industry/work/service/impl/IndustryMaterialServiceImpl.java b/industry-system/src/main/java/com/industry/work/service/impl/IndustryMaterialServiceImpl.java index 1a6cc3c6..b9e8133a 100644 --- a/industry-system/src/main/java/com/industry/work/service/impl/IndustryMaterialServiceImpl.java +++ b/industry-system/src/main/java/com/industry/work/service/impl/IndustryMaterialServiceImpl.java @@ -810,6 +810,10 @@ public class IndustryMaterialServiceImpl implements IIndustryMaterialService { */ @Override public void getMaterialData() { + //打印leftId和rightId + System.out.println("监测到id-leftId或者rightId"); + System.out.println("leftId:" + redisCache.getCacheObject("leftId")); + System.out.println("rightId:" + redisCache.getCacheObject("rightId")); IndustryMaterial material = new IndustryMaterial(); material.setState(1L); if (!industryMaterialMapper.selectIndustryMaterialList2(material).isEmpty()) { @@ -844,8 +848,11 @@ public class IndustryMaterialServiceImpl implements IIndustryMaterialService { // 小于9则一直接受来料 String industryMaterialId = s7PLC.readString("DB4.30", 64); + System.out.println("industryMaterialId----------:" + industryMaterialId); industryMaterialId = industryMaterialId.replace("\u0000", ""); + System.out.println("industryMaterialId----------:" + industryMaterialId); + // 读取是否有此id String leftId = redisCache.getCacheObject("leftId"); // 不为空表示读到了 @@ -878,6 +885,10 @@ public class IndustryMaterialServiceImpl implements IIndustryMaterialService { String specification = s7PLC.readString("DB4.162", 128); specification = specification.replace("\u0000", ""); + System.out.println(" diameter:" + diameterLeft); + System.out.println(" width:" + widthLeft); + System.out.println(" technology:" + technology); + System.out.println(" specification:" + specification); industryMaterial.setDiameter(diameterLeft); industryMaterial.setTechnology(technology); @@ -902,12 +913,14 @@ public class IndustryMaterialServiceImpl implements IIndustryMaterialService { redisCache.setCacheObject("size", size); } - + System.out.println("sort:---" + sort); // 小于9则一直接受来料 if (sort < 9L) { // industryMaterialId = (String) PLCUtils.getPLCData(connector,ipAddress, 44, 30, "string", 64, 10,MbFlag); industryMaterialId = s7PLC.readString("DB44.30", 64); + System.out.println("industryMaterialId----------:" + industryMaterialId); industryMaterialId = industryMaterialId.replace("\u0000", ""); + System.out.println("industryMaterialId----------:" + industryMaterialId); // 读取是否有此id String rightId = (String) redisCache.getCacheObject("rightId"); // 不为空表示读到了