Browse Source

#离线巡检文件下载

zhongwei
yang_shj 2 years ago
parent
commit
6d09b67d6c
  1. 7
      hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/offline/OfflineConstant.java
  2. 2
      hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/EmInfoServiceImpl.java
  3. 10
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/offline/service/impl/InspectOfflineServiceImpl.java
  4. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/AbnormalAlarmServiceImpl.java
  5. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/OperFaultServiceImpl.java
  6. 2
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/DangerSourceServiceImpl.java

7
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<String> DANGER_TABKLE_NAMES = Arrays.asList("HZIMS_SAFE_DANGER_SOURCE");
List<String> DANGER_TABKLE_NAMES = Collections.singletonList("HZIMS_SAFE_DANGER_SOURCE");
// 设备表
List<String> EMINFO_TABKLE_NAMES = Arrays.asList("HZIMS_EM_INFO");
List<String> EMINFO_TABKLE_NAMES = Collections.singletonList("HZIMS_EM_INFO");
// 故障表
List<String> FAULT_TABKLE_NAMES = Arrays.asList("HZIMS_OPER_FAULT");
List<String> FAULT_TABKLE_NAMES = Collections.singletonList("HZIMS_OPER_FAULT");
}

2
hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/EmInfoServiceImpl.java

@ -400,7 +400,7 @@ public class EmInfoServiceImpl extends BaseServiceImpl<EmInfoMapper, EmInfoEntit
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<String, Object> result = jdbcTemplate.queryForMap(show_table_sql);
if (MapUtils.isEmpty(result)) {
return;

10
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<String,Object> 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<String, Object> 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<String> 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());
}

2
hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/AbnormalAlarmServiceImpl.java

@ -224,7 +224,7 @@ public class AbnormalAlarmServiceImpl extends BaseServiceImpl<AbnormalAlarmMappe
}
User admin = userClient.userByAccount("200000", "admin").getData();
message.setCreateDept(admin.getCreateDept());
message.setCreateUser(admin.getCreateUser());
message.setCreateUser(admin.getId());
result.getData().forEach(user->{
message.setPusher(String.valueOf(user.getId()));
message.setPusherName(user.getName());

2
hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/OperFaultServiceImpl.java

@ -108,7 +108,7 @@ public class OperFaultServiceImpl extends BaseServiceImpl<OperFaultMapper, OperF
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<String, Object> result = jdbcTemplate.queryForMap(show_table_sql);
if (MapUtils.isEmpty(result)) {
return;

2
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/DangerSourceServiceImpl.java

@ -292,7 +292,7 @@ public class DangerSourceServiceImpl extends BaseServiceImpl<DangerSourceMapper,
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<String, Object> result = jdbcTemplate.queryForMap(show_table_sql);
if (MapUtils.isEmpty(result)) {
return;

Loading…
Cancel
Save