opt:优化数字孪生大屏相关接口。

This commit is contained in:
2024-09-11 17:42:28 +08:00
parent 8a179fbf88
commit 38a3588e3b
6 changed files with 29 additions and 16 deletions

View File

@@ -7,7 +7,7 @@ spring:
db-type: com.alibaba.druid.pool.DruidDataSource db-type: com.alibaba.druid.pool.DruidDataSource
driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy 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: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} username: ${DB_USER:root}
# password: ${DB_PWD:Root.123456} # password: ${DB_PWD:Root.123456}
password: ${DB_PWD:123456} password: ${DB_PWD:123456}
@@ -72,8 +72,7 @@ spring:
redis: redis:
#数据库索引 #数据库索引
database: ${REDIS_DB:2} 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} port: ${REDIS_PORT:6379}
# password: ${REDIS_PWD:} # password: ${REDIS_PWD:}
@@ -172,7 +171,7 @@ sa-token:
# Redis数据库索引默认为0 # Redis数据库索引默认为0
database: 2 database: 2
# Redis服务器地址 # Redis服务器地址
host: 10.44.101.19 host: 127.0.0.1
# Redis服务器连接端口 # Redis服务器连接端口
port: 6379 port: 6379
# Redis服务器连接密码默认为空 # Redis服务器连接密码默认为空

View File

@@ -2,7 +2,7 @@ spring:
freemarker: freemarker:
check-template-location: false check-template-location: false
profiles: profiles:
active: prod active: dev
jackson: jackson:
time-zone: GMT+8 time-zone: GMT+8
data: data:
@@ -90,6 +90,6 @@ mybatis-plus:
id-type: INPUT id-type: INPUT
lucene: lucene:
index: index:
path: D:\lucene\index path: C:\lucene\index
tlog: tlog:
enable-invoke-time-print: true enable-invoke-time-print: true

View File

@@ -143,7 +143,7 @@ public class CockpitServiceImpl implements CockpitService {
item.put("region_name", "GHS"); item.put("region_name", "GHS");
item.put("total_qty", "0"); item.put("total_qty", "0");
item.put("date", today.minusDays(i).format(formatter)); 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) { public JSONObject equipmentInfo(String deviceCode) {
JSONObject res = new JSONObject(); JSONObject res = new JSONObject();
SchBasePoint point = pointService.getById(deviceCode); SchBasePoint point = pointService.getById(deviceCode);
if (point == null) {
throw new BadRequestException("该设备不存在");
}
List<SchBasePoint> points; List<SchBasePoint> points;
switch (point.getRegion_code()) { switch (point.getRegion_code()) {
case RegionCodeConstant.COATED_PLATE_LINE_AREA: case RegionCodeConstant.COATED_PLATE_LINE_AREA:
@@ -403,9 +406,11 @@ public class CockpitServiceImpl implements CockpitService {
res.put("device_code", deviceCode); res.put("device_code", deviceCode);
res.put("device_name", point.getPoint_name()); res.put("device_name", point.getPoint_name());
//当前物料 //当前物料
JSONObject getDeviceWorker=cockpitMapper.getDeviceWorker(deviceCode); JSONObject getDeviceWorker = cockpitMapper.getDeviceWorker(deviceCode);
String material=cockpitMapper.getMaterialName(getDeviceWorker.getString("material_id")); if (getDeviceWorker != null) {
String material = cockpitMapper.getMaterialName(getDeviceWorker.getString("material_id"));
res.put("material", material); res.put("material", material);
}
for (Object object : baoshijian) { for (Object object : baoshijian) {
JSONObject jsonObject = (JSONObject) object; JSONObject jsonObject = (JSONObject) object;
if (deviceCode.equals(jsonObject.getString("device_code"))) { if (deviceCode.equals(jsonObject.getString("device_code"))) {

View File

@@ -490,8 +490,17 @@ GROUP BY
<select id="faultAlarm" resultType="java.util.HashMap"> <select id="faultAlarm" resultType="java.util.HashMap">
SELECT SELECT
CASE
d.failure_info
WHEN '1024' THEN
'过载'
WHEN '1' THEN
'网络超时'
WHEN '512' THEN
'信号丢失'
ELSE ''
END AS fault_cause,
d.device_code AS device_name, d.device_code AS device_name,
d.failure_info AS fault_cause,
d.failure_time AS alarm_time d.failure_time AS alarm_time
FROM FROM
das_device_fault d das_device_fault d

View File

@@ -54,8 +54,8 @@ spring:
multi-statement-allow: true multi-statement-allow: true
redis: redis:
#数据库索引 #数据库索引
database: ${REDIS_DB:5} database: ${REDIS_DB:2}
host: ${REDIS_HOST:10.44.101.19} host: ${REDIS_HOST:127.0.0.1}
port: ${REDIS_PORT:6379} port: ${REDIS_PORT:6379}
password: ${REDIS_PWD:} password: ${REDIS_PWD:}
@@ -152,9 +152,9 @@ sa-token:
token-session-check-login: false token-session-check-login: false
alone-redis: alone-redis:
# Redis数据库索引默认为0 # Redis数据库索引默认为0
database: 5 database: 2
# Redis服务器地址 # Redis服务器地址
host: 10.44.101.19 host: 127.0.0.1
# Redis服务器连接端口 # Redis服务器连接端口
port: 6379 port: 6379
# Redis服务器连接密码默认为空 # Redis服务器连接密码默认为空

View File

@@ -112,6 +112,6 @@ mybatis-plus:
id-type: INPUT id-type: INPUT
lucene: lucene:
index: index:
path: D:\lucene\index path: C:\lucene\index
tlog: tlog:
enable-invoke-time-print: true enable-invoke-time-print: true