From 38a3588e3b02d2874cc58c3c2be27a078e3c145d Mon Sep 17 00:00:00 2001 From: gongbaoxiong <751575283@qq.com> Date: Wed, 11 Sep 2024 17:42:28 +0800 Subject: [PATCH] =?UTF-8?q?opt:=E4=BC=98=E5=8C=96=E6=95=B0=E5=AD=97?= =?UTF-8?q?=E5=AD=AA=E7=94=9F=E5=A4=A7=E5=B1=8F=E7=9B=B8=E5=85=B3=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/config/application-prod.yml | 7 +++---- .../src/main/resources/config/application.yml | 4 ++-- .../cockpit/service/impl/CockpitServiceImpl.java | 13 +++++++++---- .../nl/wms/cockpit/service/mapper/CockpitMapper.xml | 11 ++++++++++- .../src/main/resources/config/application-prod.yml | 8 ++++---- .../src/main/resources/config/application.yml | 2 +- 6 files changed, 29 insertions(+), 16 deletions(-) diff --git a/acs/nladmin-system/nlsso-server/src/main/resources/config/application-prod.yml b/acs/nladmin-system/nlsso-server/src/main/resources/config/application-prod.yml index e247274..f094a0e 100644 --- a/acs/nladmin-system/nlsso-server/src/main/resources/config/application-prod.yml +++ b/acs/nladmin-system/nlsso-server/src/main/resources/config/application-prod.yml @@ -7,7 +7,7 @@ spring: db-type: com.alibaba.druid.pool.DruidDataSource driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy # url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.81.252}:${DB_PORT:3306}/${DB_NAME:stand_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true - url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true + url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3307}/${DB_NAME:acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true username: ${DB_USER:root} # password: ${DB_PWD:Root.123456} password: ${DB_PWD:123456} @@ -72,8 +72,7 @@ spring: redis: #数据库索引 database: ${REDIS_DB:2} - host: ${REDIS_HOST:10.44.101.19} - # host: ${REDIS_HOST:127.0.0.1} + host: ${REDIS_HOST:127.0.0.1} port: ${REDIS_PORT:6379} # password: ${REDIS_PWD:} @@ -172,7 +171,7 @@ sa-token: # Redis数据库索引(默认为0) database: 2 # Redis服务器地址 - host: 10.44.101.19 + host: 127.0.0.1 # Redis服务器连接端口 port: 6379 # Redis服务器连接密码(默认为空) diff --git a/acs/nladmin-system/nlsso-server/src/main/resources/config/application.yml b/acs/nladmin-system/nlsso-server/src/main/resources/config/application.yml index bc92901..0e52b7e 100644 --- a/acs/nladmin-system/nlsso-server/src/main/resources/config/application.yml +++ b/acs/nladmin-system/nlsso-server/src/main/resources/config/application.yml @@ -2,7 +2,7 @@ spring: freemarker: check-template-location: false profiles: - active: prod + active: dev jackson: time-zone: GMT+8 data: @@ -90,6 +90,6 @@ mybatis-plus: id-type: INPUT lucene: index: - path: D:\lucene\index + path: C:\lucene\index tlog: enable-invoke-time-print: true \ No newline at end of file diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/cockpit/service/impl/CockpitServiceImpl.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/cockpit/service/impl/CockpitServiceImpl.java index 332fdc6..45fd605 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/cockpit/service/impl/CockpitServiceImpl.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/cockpit/service/impl/CockpitServiceImpl.java @@ -143,7 +143,7 @@ public class CockpitServiceImpl implements CockpitService { item.put("region_name", "GHS"); item.put("total_qty", "0"); item.put("date", today.minusDays(i).format(formatter)); - tb_real_qty.add(item); + gh_real_qty.add(item); } } //设备运行状态 @@ -394,6 +394,9 @@ public class CockpitServiceImpl implements CockpitService { public JSONObject equipmentInfo(String deviceCode) { JSONObject res = new JSONObject(); SchBasePoint point = pointService.getById(deviceCode); + if (point == null) { + throw new BadRequestException("该设备不存在"); + } List points; switch (point.getRegion_code()) { case RegionCodeConstant.COATED_PLATE_LINE_AREA: @@ -403,9 +406,11 @@ public class CockpitServiceImpl implements CockpitService { res.put("device_code", deviceCode); res.put("device_name", point.getPoint_name()); //当前物料 - JSONObject getDeviceWorker=cockpitMapper.getDeviceWorker(deviceCode); - String material=cockpitMapper.getMaterialName(getDeviceWorker.getString("material_id")); - res.put("material", material); + JSONObject getDeviceWorker = cockpitMapper.getDeviceWorker(deviceCode); + if (getDeviceWorker != null) { + String material = cockpitMapper.getMaterialName(getDeviceWorker.getString("material_id")); + res.put("material", material); + } for (Object object : baoshijian) { JSONObject jsonObject = (JSONObject) object; if (deviceCode.equals(jsonObject.getString("device_code"))) { diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/cockpit/service/mapper/CockpitMapper.xml b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/cockpit/service/mapper/CockpitMapper.xml index 4f8aaa7..ec4c8d2 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/cockpit/service/mapper/CockpitMapper.xml +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/cockpit/service/mapper/CockpitMapper.xml @@ -490,8 +490,17 @@ GROUP BY