From 6d09b67d6c4f1b2f1439e75df9857d04b5f91b51 Mon Sep 17 00:00:00 2001 From: yang_shj <1069818635@QQ.com> Date: Mon, 22 May 2023 11:51:53 +0800 Subject: [PATCH] =?UTF-8?q?#=E7=A6=BB=E7=BA=BF=E5=B7=A1=E6=A3=80=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E4=B8=8B=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/hnac/hzinfo/inspect/offline/OfflineConstant.java | 7 ++++--- .../hnac/hzims/equipment/service/impl/EmInfoServiceImpl.java | 2 +- .../offline/service/impl/InspectOfflineServiceImpl.java | 10 +++------- .../alert/service/impl/AbnormalAlarmServiceImpl.java | 2 +- .../operational/defect/service/impl/OperFaultServiceImpl.java | 2 +- .../safeproduct/service/impl/DangerSourceServiceImpl.java | 2 +- 6 files changed, 11 insertions(+), 14 deletions(-) diff --git a/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/offline/OfflineConstant.java b/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/offline/OfflineConstant.java index 0c4ef5d..aefd1a4 100644 --- a/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/offline/OfflineConstant.java +++ b/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/offline/OfflineConstant.java @@ -1,6 +1,7 @@ package com.hnac.hzinfo.inspect.offline; import java.util.Arrays; +import java.util.Collections; import java.util.List; /** @@ -37,11 +38,11 @@ public interface OfflineConstant { "HZ_OFFLINE_TASK"); // 危险源表 - List DANGER_TABKLE_NAMES = Arrays.asList("HZIMS_SAFE_DANGER_SOURCE"); + List DANGER_TABKLE_NAMES = Collections.singletonList("HZIMS_SAFE_DANGER_SOURCE"); // 设备表 - List EMINFO_TABKLE_NAMES = Arrays.asList("HZIMS_EM_INFO"); + List EMINFO_TABKLE_NAMES = Collections.singletonList("HZIMS_EM_INFO"); // 故障表 - List FAULT_TABKLE_NAMES = Arrays.asList("HZIMS_OPER_FAULT"); + List FAULT_TABKLE_NAMES = Collections.singletonList("HZIMS_OPER_FAULT"); } diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/EmInfoServiceImpl.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/EmInfoServiceImpl.java index db5f8c8..e267ba3 100644 --- a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/EmInfoServiceImpl.java +++ b/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/EmInfoServiceImpl.java @@ -400,7 +400,7 @@ public class EmInfoServiceImpl extends BaseServiceImpl { CreateTableVO item = new CreateTableVO(); // 获取表结构sql语句 - String show_table_sql = "show create table " + databaseName + "." + table; + String show_table_sql = "show create table `" + databaseName + "`." + table; Map result = jdbcTemplate.queryForMap(show_table_sql); if (MapUtils.isEmpty(result)) { return; diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/offline/service/impl/InspectOfflineServiceImpl.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/offline/service/impl/InspectOfflineServiceImpl.java index f9ccdc9..b90016b 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/offline/service/impl/InspectOfflineServiceImpl.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/offline/service/impl/InspectOfflineServiceImpl.java @@ -32,6 +32,7 @@ import com.hnac.hzinfo.inspect.task.vo.TaskObjectProjectOfflineVO; import com.hnac.hzinfo.inspect.task.vo.TaskOfflineVO; import com.hnac.hzinfo.inspect.utils.JsonFileUtil; import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.MapUtils; import org.apache.commons.fileupload.FileItem; import org.apache.commons.fileupload.FileItemFactory; @@ -82,10 +83,9 @@ import java.util.stream.Collectors; @Service @Primary @RequiredArgsConstructor +@Slf4j public class InspectOfflineServiceImpl implements IOfflineDataService { - private static Logger logger = LoggerFactory.getLogger(InspectOfflineServiceImpl.class); - private final ITaskUserService taskUserService; private final ITaskService taskService; @@ -166,7 +166,6 @@ public class InspectOfflineServiceImpl implements IOfflineDataService { */ @Override public void syncOfflineDataToOnline(Map paramMap) { - logger.error("sync_offline_data_to_online : 进入离线结束方法"); String fileUrl = (String) paramMap.get("fileUrl"); if(StringUtil.isBlank(fileUrl)){ return; @@ -284,7 +283,7 @@ public class InspectOfflineServiceImpl implements IOfflineDataService { tableNames.forEach(table -> { CreateTableVO item = new CreateTableVO(); // 获取表结构sql语句 - String show_table_sql = "show create table " + databaseName + "." + table; + String show_table_sql = "show create table `" + databaseName + "`." + table; Map result = jdbcTemplate.queryForMap(show_table_sql); if (MapUtils.isEmpty(result)) { return; @@ -413,7 +412,6 @@ public class InspectOfflineServiceImpl implements IOfflineDataService { for (int i=0; i < fileJson.size();i++){ TableJsonUtils.createJsonFile(fileJson.get(i), download, tableNames.get(i)); } - logger.error("file_list: {}",fileList); // 视频、图片下载 if(CollectionUtil.isEmpty(fileList)){ return; @@ -894,7 +892,6 @@ public class InspectOfflineServiceImpl implements IOfflineDataService { if (CollectionUtil.isEmpty(bo.getFiles())) { return; } - logger.info(">>>>>>>>>>>>>>files: " + JSONObject.toJSONString(bo.getFiles())); List urls = bo.getFiles().stream().map(o -> { if (StringUtils.isBlank(o) || o.contains("http")) { return null; @@ -909,7 +906,6 @@ public class InspectOfflineServiceImpl implements IOfflineDataService { try { MultipartFile multipartFile = this.getMultipartFile(file); r = ossClient.putFile(multipartFile); - logger.info(">>>>>>>>>>>>>>上传文件返回结果:" + r.toString()); if (!r.isSuccess()) { throw new RuntimeException("上传文件["+fileName+"]失败,bladex-resource报错:" + r.toString()); } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/AbnormalAlarmServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/AbnormalAlarmServiceImpl.java index f8d4c68..a5a3966 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/AbnormalAlarmServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/AbnormalAlarmServiceImpl.java @@ -224,7 +224,7 @@ public class AbnormalAlarmServiceImpl extends BaseServiceImpl{ message.setPusher(String.valueOf(user.getId())); message.setPusherName(user.getName()); diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/OperFaultServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/OperFaultServiceImpl.java index 6e32dd8..cfb29dc 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/OperFaultServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/OperFaultServiceImpl.java @@ -108,7 +108,7 @@ public class OperFaultServiceImpl extends BaseServiceImpl { CreateTableVO item = new CreateTableVO(); // 获取表结构sql语句 - String show_table_sql = "show create table " + databaseName + "." + table; + String show_table_sql = "show create table `" + databaseName + "`." + table; Map result = jdbcTemplate.queryForMap(show_table_sql); if (MapUtils.isEmpty(result)) { return; diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/DangerSourceServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/DangerSourceServiceImpl.java index 833a356..d0df057 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/DangerSourceServiceImpl.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/DangerSourceServiceImpl.java @@ -292,7 +292,7 @@ public class DangerSourceServiceImpl extends BaseServiceImpl { CreateTableVO item = new CreateTableVO(); // 获取表结构sql语句 - String show_table_sql = "show create table " + databaseName + "." + table; + String show_table_sql = "show create table `" + databaseName + "`." + table; Map result = jdbcTemplate.queryForMap(show_table_sql); if (MapUtils.isEmpty(result)) { return;