diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/census/vo/AreaAssetDeviceVo.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/census/vo/AreaAssetDeviceVo.java index 56ce3a8..fa6f71d 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/census/vo/AreaAssetDeviceVo.java +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/census/vo/AreaAssetDeviceVo.java @@ -16,11 +16,8 @@ public class AreaAssetDeviceVo { @ApiModelProperty(value = "机构Id") private Long deptId; - @ApiModelProperty(value = "设备名称") - private String deviceCode; - - @ApiModelProperty(value = "设备名称") - private String deviceName; + @ApiModelProperty(value = "机构名称") + private String deptName; @ApiModelProperty(value = "状态") private Integer status; diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpMonitorServiceImpl.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpMonitorServiceImpl.java index ba577d3..ccf9ee1 100644 --- a/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpMonitorServiceImpl.java +++ b/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpMonitorServiceImpl.java @@ -638,7 +638,7 @@ public class FdpMonitorServiceImpl extends BaseServiceImpl taskObjects = JsonFileUtil.readJsonFile(upload + "/HZ_ST_EX_OBJECT.json", TaskObjectSyncBO.class); List projectContents = JsonFileUtil.readJsonFile(upload + "/HZ_ST_EX_OBJECT_PROJECT_CONTENT.json", TaskObjectProjectContentBO.class); - // 内容图片 - this.batchCurrentImg(upload, eventRecords); - // 文件上传 this.batchUploadImg(upload, eventRecords); this.batchUploadImg(upload, eventAttachments); @@ -876,49 +873,6 @@ public class InspectOfflineServiceImpl implements IOfflineDataService { } /** - * 上传内容文件 - * - * @param sourceDir - * @param data - */ - private void batchCurrentImg(String sourceDir, List data) { - if (CollectionUtil.isEmpty(data)) { - return; - } - - data.forEach(bo -> { - if (CollectionUtil.isEmpty(bo.getCurrentValues())) { - return; - } - List urls = bo.getCurrentValues().stream().map(o -> { - if (StringUtils.isBlank(o) || !o.contains("file:")) { - return null; - } - /**wxq begin**/ - String fileName = o.substring(o.lastIndexOf("/") >= 0 ? o.lastIndexOf("/") + 1 : 0); - File file = new File(sourceDir + "/" + fileName); - if (!file.exists()) { - throw new RuntimeException("文件名称为:" + fileName + "不存在,上传失败!"); - } - R r = null; - try { - MultipartFile multipartFile = this.getMultipartFile(file); - r = ossClient.putFile(multipartFile); - if (!r.isSuccess()) { - throw new RuntimeException("上传文件["+fileName+"]失败,bladex-resource报错:" + r.toString()); - } - BladeFile bladeFile = r.getData(); - return bladeFile != null ? bladeFile.getLink() : null; - } catch (Exception ex) { - throw new RuntimeException("上传文件["+fileName+"]失败,bladex-resource报错:" + r.toString(), ex); - } - }).filter(StringUtils::isNotBlank).collect(Collectors.toList()); - bo.setCurrentValues(urls); - }); - - } - - /** * 上传文件 * * @param sourceDir @@ -955,7 +909,7 @@ public class InspectOfflineServiceImpl implements IOfflineDataService { } catch (Exception ex) { throw new RuntimeException("上传文件["+fileName+"]失败,bladex-resource报错:" + r.toString(), ex); } - }).filter(StringUtils::isNotBlank).collect(Collectors.toList()); + }).filter(o -> StringUtils.isNotBlank(o)).collect(Collectors.toList()); bo.setFiles(urls); }); diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/offline/sync/EventRecordSyncBO.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/offline/sync/EventRecordSyncBO.java index 1cc9c64..c90b919 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/offline/sync/EventRecordSyncBO.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/offline/sync/EventRecordSyncBO.java @@ -40,20 +40,4 @@ public class EventRecordSyncBO extends EventRecordEntity implements SyncBO { super.setFileUrl(urls.get(0)); } } - - @Override - public List getCurrentValues() { - return new ArrayList() {{ - if (StringUtil.isNotBlank(getCurrentValue())) { - add(getCurrentValue()); - } - }}; - } - - @Override - public void setCurrentValues(List urls) { - if (CollectionUtil.isNotEmpty(urls)) { - super.setCurrentValue(urls.get(0)); - } - } } diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/offline/sync/SyncBO.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/offline/sync/SyncBO.java index f03fd08..628053e 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/offline/sync/SyncBO.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/offline/sync/SyncBO.java @@ -13,15 +13,6 @@ public interface SyncBO { } default void setFiles(List urls) { - - } - - default List getCurrentValues() { - return null; - } - - default void setCurrentValues(List urls) { - } Object getPrimaryKey(); diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/impl/AreaDutyServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/impl/AreaDutyServiceImpl.java index 1a75a11..f67fa82 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/impl/AreaDutyServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/census/service/impl/AreaDutyServiceImpl.java @@ -151,13 +151,7 @@ public class AreaDutyServiceImpl implements AreaDutyService { AreaTimelyVo timely = new AreaTimelyVo(); timely.setEventId(early.getFaultId()); timely.setContent(early.getFinfo()); - timely.setDeptName("未知"); - if(!StringUtil.isEmpty(early.getStation())){ - List names = stations.stream().filter(o->o.getCode().equals(early.getStation())).map(StationEntity::getName).collect(Collectors.toList()); - if(CollectionUtil.isNotEmpty(names)){ - timely.setDeptName(names.get(0)); - } - } + timely.setDeptName(early.getStation()); timely.setTime(early.getCreateTime()); int sum = this.eventToHours(LocalDateTime.parse(early.getCreateTime(),DateUtil.DATETIME_FORMATTER)); timely.setSum(sum); @@ -307,12 +301,12 @@ public class AreaDutyServiceImpl implements AreaDutyService { asset.setDevices(entry.getValue().stream().map(value->{ AreaAssetDeviceVo item = new AreaAssetDeviceVo(); item.setDeptId(entry.getKey()); - item.setDeviceCode(value.getEmCode()); - item.setDeviceName(value.getName()); + item.setDeptName(asset.getDeptName()); // 状态 HydropowerUnitRealVo real = reals.stream().filter(o->o.getDeviceCode().equals(value.getEmCode())).min(Comparator.comparing(HydropowerUnitRealVo::getDeviceCode)).get(); - item.setStatus(2); - if(ObjectUtil.isNotEmpty(real) && Math.abs(real.getActivePower()) > 0){ + if(ObjectUtil.isEmpty(real)){ + item.setStatus(2); + }else if(Math.abs(real.getActivePower()) > 0){ item.setStatus(1); } return item;