Browse Source

增加基础信息生成

xusl 1 year ago
parent
commit
0fad337555
20 changed files with 611 additions and 302 deletions
  1. 12 0
      ipfcst-console/src/main/java/com/jiayue/ipfcst/aop/BaseInfoImage.java
  2. 61 0
      ipfcst-console/src/main/java/com/jiayue/ipfcst/aop/BaseInfoImageAspect.java
  3. 29 0
      ipfcst-console/src/main/java/com/jiayue/ipfcst/config/ConsoleInit.java
  4. 4 0
      ipfcst-console/src/main/java/com/jiayue/ipfcst/console/controller/AGC_AVCInfoController.java
  5. 4 0
      ipfcst-console/src/main/java/com/jiayue/ipfcst/console/controller/BoosterStationInfoController.java
  6. 5 292
      ipfcst-console/src/main/java/com/jiayue/ipfcst/console/controller/ElectricFieldController.java
  7. 5 0
      ipfcst-console/src/main/java/com/jiayue/ipfcst/console/controller/InverterInfoController.java
  8. 4 0
      ipfcst-console/src/main/java/com/jiayue/ipfcst/console/controller/PvModuleModelController.java
  9. 4 0
      ipfcst-console/src/main/java/com/jiayue/ipfcst/console/controller/SubsidiaryEquipmentInfoController.java
  10. 5 1
      ipfcst-console/src/main/java/com/jiayue/ipfcst/console/controller/WeatherStationInfoController.java
  11. 10 3
      ipfcst-console/src/main/java/com/jiayue/ipfcst/console/controller/WindTowerInfoController.java
  12. 6 0
      ipfcst-console/src/main/java/com/jiayue/ipfcst/console/controller/WindTurbineInfoController.java
  13. 45 0
      ipfcst-console/src/main/java/com/jiayue/ipfcst/console/service/BaseInfoImageService.java
  14. 369 2
      ipfcst-console/src/main/java/com/jiayue/ipfcst/console/service/ElectricFieldService.java
  15. 4 0
      ipfcst-console/src/main/java/com/jiayue/ipfcst/fileupload/controller/UploadFileChannelController.java
  16. 4 0
      ipfcst-console/src/main/java/com/jiayue/ipfcst/fileupload/controller/UploadFileCodeController.java
  17. 4 0
      ipfcst-console/src/main/java/com/jiayue/ipfcst/fileupload/controller/UploadObjectController.java
  18. 3 0
      ipfcst-console/src/main/java/com/jiayue/ipfcst/fileupload/controller/UploadURLController.java
  19. 9 0
      ipfcst-console/src/main/java/com/jiayue/ipfcst/fileupload/util/FileUtil.java
  20. 24 4
      ipfcst-upload/src/test/java/org/example/AppTest.java

+ 12 - 0
ipfcst-console/src/main/java/com/jiayue/ipfcst/aop/BaseInfoImage.java

@@ -0,0 +1,12 @@
+package com.jiayue.ipfcst.aop;
+
+import java.lang.annotation.*;
+
+/**
+ * 基础信息镜像
+ */
+@Documented
+@Target(ElementType.METHOD)
+@Retention(RetentionPolicy.RUNTIME)
+public @interface BaseInfoImage {
+}

+ 61 - 0
ipfcst-console/src/main/java/com/jiayue/ipfcst/aop/BaseInfoImageAspect.java

@@ -0,0 +1,61 @@
+package com.jiayue.ipfcst.aop;
+
+import com.alibaba.fastjson.JSONObject;
+import com.jiayue.ipfcst.common.core.util.SpringContextHolder;
+import com.jiayue.ipfcst.common.data.constant.enums.ElectricFieldStatrsEnum;
+import com.jiayue.ipfcst.common.data.entity.ElectricField;
+import com.jiayue.ipfcst.console.service.BaseInfoImageService;
+import com.jiayue.ipfcst.console.service.ElectricFieldService;
+import com.jiayue.ipfcst.fileupload.util.FileUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.aspectj.lang.JoinPoint;
+import org.aspectj.lang.ProceedingJoinPoint;
+import org.aspectj.lang.annotation.AfterReturning;
+import org.aspectj.lang.annotation.Around;
+import org.aspectj.lang.annotation.Aspect;
+import org.aspectj.lang.annotation.Pointcut;
+import org.aspectj.lang.reflect.MethodSignature;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import org.springframework.web.context.request.RequestAttributes;
+import org.springframework.web.context.request.RequestContextHolder;
+import org.springframework.web.context.request.ServletRequestAttributes;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.File;
+import java.io.FileWriter;
+import java.lang.reflect.Method;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * service层aop,根据注解确定哪些方法需要执行某些操作
+ *
+ * @author xsl
+ * @version 3.3
+ */
+@Aspect
+@Component
+@Slf4j
+public class BaseInfoImageAspect {
+  @Autowired
+  BaseInfoImageService baseInfoImageService;
+
+    @Pointcut("@annotation(com.jiayue.ipfcst.aop.BaseInfoImage)")
+    public void aroundPoinCut() {
+    }
+
+    @AfterReturning(value = "aroundPoinCut()",returning = "methodResult")
+    public Object afterReturningPublish(JoinPoint joinPoint, Object methodResult) throws Throwable {
+        log.info("----------------------------------进入BaseInfoImage拦截器-----------------------------------------------");
+      String returnJson = JSONObject.toJSONString(methodResult);
+      Object[] args = joinPoint.getArgs();
+
+      try {
+          baseInfoImageService.generateBaseInfoImage();
+        } catch (Exception e) {
+            log.error("拦截器生成基础镜像信息异常", e);
+        }
+        return returnJson;
+    }
+}

+ 29 - 0
ipfcst-console/src/main/java/com/jiayue/ipfcst/config/ConsoleInit.java

@@ -0,0 +1,29 @@
+package com.jiayue.ipfcst.config;
+
+import com.jiayue.ipfcst.console.service.BaseInfoImageService;
+import lombok.SneakyThrows;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Bean;
+import org.springframework.stereotype.Component;
+
+
+/**
+ * console启动加载
+ *
+ * @author xsl
+ * @since 2024/03/25
+ */
+@Component
+public class ConsoleInit {
+  @Autowired
+  BaseInfoImageService baseInfoImageService;
+
+  /**
+   * 生成镜像信息文件
+   */
+  @Bean
+  @SneakyThrows
+  public void BaseInfoImage() {
+    baseInfoImageService.generateBaseInfoImage();
+  }
+}

+ 4 - 0
ipfcst-console/src/main/java/com/jiayue/ipfcst/console/controller/AGC_AVCInfoController.java

@@ -1,5 +1,6 @@
 package com.jiayue.ipfcst.console.controller;
 
+import com.jiayue.ipfcst.aop.BaseInfoImage;
 import com.jiayue.ipfcst.common.core.exception.BusinessException;
 import com.jiayue.ipfcst.common.core.web.vo.ResponseVO;
 import com.jiayue.ipfcst.common.data.entity.AGC_AVCInfo;
@@ -37,6 +38,7 @@ public class AGC_AVCInfoController {
   * 保存
   * */
   @PostMapping
+  @BaseInfoImage
   public ResponseVO save(@RequestBody AGC_AVCInfo agc_avcInfo){
     agcAvcInfoService.save(agc_avcInfo);
     return ResponseVO.success(1);
@@ -46,6 +48,7 @@ public class AGC_AVCInfoController {
   * 更新
   * */
   @PutMapping
+  @BaseInfoImage
   public ResponseVO update(@RequestBody AGC_AVCInfo agc_avcInfo){
     agcAvcInfoService.save(agc_avcInfo);
     return ResponseVO.success(1);
@@ -55,6 +58,7 @@ public class AGC_AVCInfoController {
   * 删除
   * */
   @DeleteMapping("/{id}")
+  @BaseInfoImage
   public ResponseVO delete(@PathVariable String id) throws BusinessException {
     agcAvcInfoService.delete(Integer.parseInt(id));
     return ResponseVO.success(1);

+ 4 - 0
ipfcst-console/src/main/java/com/jiayue/ipfcst/console/controller/BoosterStationInfoController.java

@@ -1,5 +1,6 @@
 package com.jiayue.ipfcst.console.controller;
 
+import com.jiayue.ipfcst.aop.BaseInfoImage;
 import com.jiayue.ipfcst.common.core.exception.BusinessException;
 import com.jiayue.ipfcst.common.core.web.vo.ResponseVO;
 import com.jiayue.ipfcst.common.data.entity.BoosterStationInfo;
@@ -37,6 +38,7 @@ public class BoosterStationInfoController {
   * 保存
   * */
   @PostMapping
+  @BaseInfoImage
   public ResponseVO save(@RequestBody BoosterStationInfo boosterStationInfo){
     boosterStationInfoService.save(boosterStationInfo);
     return ResponseVO.success(1);
@@ -46,6 +48,7 @@ public class BoosterStationInfoController {
   * 更新
   * */
   @PutMapping
+  @BaseInfoImage
   public ResponseVO update(@RequestBody BoosterStationInfo boosterStationInfo){
     boosterStationInfoService.save(boosterStationInfo);
     return ResponseVO.success(1);
@@ -55,6 +58,7 @@ public class BoosterStationInfoController {
   * 删除
   * */
   @DeleteMapping("/{id}")
+  @BaseInfoImage
   public ResponseVO delete(@PathVariable String id) throws BusinessException {
     boosterStationInfoService.delete(Integer.parseInt(id));
     return ResponseVO.success(1);

+ 5 - 292
ipfcst-console/src/main/java/com/jiayue/ipfcst/console/controller/ElectricFieldController.java

@@ -1,6 +1,7 @@
 package com.jiayue.ipfcst.console.controller;
 
 import cn.hutool.core.date.DateUtil;
+import com.jiayue.ipfcst.aop.BaseInfoImage;
 import com.jiayue.ipfcst.aop.SaveValidate;
 import com.jiayue.ipfcst.common.core.util.JsonBeanUtil;
 import com.jiayue.ipfcst.common.core.web.vo.ResponseVO;
@@ -121,6 +122,7 @@ public class ElectricFieldController {
      */
     @PostMapping(value = "/")
     @SaveValidate
+    @BaseInfoImage
     public ResponseVO saveElectricField(@RequestBody ElectricField electricField) {
         try {
             electricFieldService.update(electricField);
@@ -142,6 +144,7 @@ public class ElectricFieldController {
      */
     @PutMapping(value = "/")
     @SaveValidate
+    @BaseInfoImage
     public ResponseVO updateElectricField(@RequestBody ElectricField electricField) {
         try {
             this.electricFieldService.update(electricField);
@@ -348,299 +351,9 @@ public class ElectricFieldController {
    * @param electricField
    * @return
    */
-    @SneakyThrows
+  @SneakyThrows
   private List<String> queryAllParamsFromDb(ElectricField electricField) {
-      String header = electricField.getStationCode();
-      List<String> valList = new ArrayList<>();
-    //场站信息
-      List<ElectricField> electricFields = new ArrayList<>();
-    electricFields.add(electricField);
-      String val = "ElectricField:::" + JsonBeanUtil.beanToJson(electricFields);
-    valList.add(val);
-
-    //光伏组件信息
-    List<PvModuleModel> pvModuleModelList = pvModuleModelService.getAll();
-    if (null != pvModuleModelList && pvModuleModelList.size() > 0) {
-      for (PvModuleModel bean : pvModuleModelList) {
-        bean.setStationCode(header);
-      }
-      val = "PvModuleModel:::" + JsonBeanUtil.beanToJson(pvModuleModelList);
-      valList.add(val);
-    }
-    //检修计划
-    List<OverhaulPlan> overhaulPlanList = overHaulPlanService.getAll();
-    if (null != overhaulPlanList && overhaulPlanList.size() > 0) {
-      for (OverhaulPlan bean : overhaulPlanList) {
-        bean.setStationCode(header);
-      }
-      val = "OverhaulPlan:::" + JsonBeanUtil.beanToJson(overhaulPlanList);
-      valList.add(val);
-    }
-    //逆变器信息
-    List<InverterInfo> inverterInfoList = inverterInfoService.getAll();
-    if (null != inverterInfoList && inverterInfoList.size() > 0) {
-      for (InverterInfo bean : inverterInfoList) {
-        bean.setStationCode(header);
-      }
-      val = "InverterInfo:::" + JsonBeanUtil.beanToJson(inverterInfoList);
-      valList.add(val);
-    }
-    //气象站数据
-    List<WeatherStationInfo> weatherStationInfoList = weatherStationInfoService.getAll();
-    if (null != weatherStationInfoList && weatherStationInfoList.size() > 0) {
-      for (WeatherStationInfo bean : weatherStationInfoList) {
-        bean.setStationCode(header);
-      }
-      val = "WeatherStationInfo:::" + JsonBeanUtil.beanToJson(weatherStationInfoList);
-      valList.add(val);
-    }
-    //测风塔
-    List<WindTowerInfo> windTowerInfoList = windTowerInfoService.getAll();
-    if (null != windTowerInfoList && windTowerInfoList.size() > 0) {
-      for (WindTowerInfo bean : windTowerInfoList) {
-        bean.setStationCode(header);
-      }
-      val = "WindTowerInfo:::" + JsonBeanUtil.beanToJson(windTowerInfoList);
-      valList.add(val);
-    }
-    //风机
-    List<WindTurbineInfo> windTurbineInfoList = windTurbineInfoService.getAll();
-    if (null != windTurbineInfoList && windTurbineInfoList.size() > 0) {
-      for (WindTurbineInfo bean : windTurbineInfoList) {
-        bean.setStationCode(header);
-      }
-      val = "WindTurbineInfo:::" + JsonBeanUtil.beanToJson(windTurbineInfoList);
-      valList.add(val);
-    }
-    //初始化定时任务
-    List<InitJobClass> initJobClassList = initJobClassService.findAll();
-    if (null != initJobClassList && initJobClassList.size() > 0) {
-      for (InitJobClass bean : initJobClassList) {
-        bean.setStationCode(header);
-      }
-      val = "InitJobClass:::" + JsonBeanUtil.beanToJson(initJobClassList);
-      valList.add(val);
-    }
-    //定时任务
-    List<Quartz> quartzList = quartzService.getAll();
-    if (null != quartzList && quartzList.size() > 0) {
-      for (Quartz bean : quartzList) {
-        bean.setStationCode(header);
-      }
-      val = "Quartz:::" + JsonBeanUtil.beanToJson(quartzList);
-      valList.add(val);
-    }
-    //系统参数
-    List<SysParameter> sysParameterList = sysParameterService.getAll();
-    if (null != sysParameterList && sysParameterList.size() > 0) {
-      for (SysParameter bean : sysParameterList) {
-        bean.setStationCode(header);
-      }
-      val = "SysParameter:::" + JsonBeanUtil.beanToJson(sysParameterList);
-      valList.add(val);
-    }
-
-    //文件上报部分
-    List<UploadObject> uploadObjectList = uploadObjectService.get();
-    if (null != uploadObjectList && uploadObjectList.size() > 0) {
-      for (UploadObject bean : uploadObjectList) {
-        bean.setStationCode(header);
-      }
-      val = "UploadObject:::" + JsonBeanUtil.beanToJson(uploadObjectList);
-      valList.add(val);
-    }
-
-    //上报通道
-    List<UploadFileChannel> uploadFileChannels = uploadFileChannelService.get();
-    if (null != uploadFileChannels && uploadFileChannels.size() > 0) {
-      for (UploadFileChannel bean : uploadFileChannels) {
-        bean.setStationCode(header);
-      }
-      val = "UploadFileChannel:::" + JsonBeanUtil.beanToJson(uploadFileChannels);
-      valList.add(val);
-    }
-    //上报文件编码
-    List<UploadFileCode> uploadFileCodes = uploadFileCodeService.get();
-    if (null != uploadFileCodes && uploadFileCodes.size() > 0) {
-      for (UploadFileCode bean : uploadFileCodes) {
-        bean.setStationCode(header);
-      }
-      val = "UploadFileCode:::" + JsonBeanUtil.beanToJson(uploadFileCodes);
-      valList.add(val);
-    }
-    //上报文件路径
-    List<UploadURL> uploadURLS = uploadURLService.findAll();
-    if (null != uploadURLS && uploadURLS.size() > 0) {
-      for (UploadURL bean : uploadURLS) {
-        bean.setStationCode(header);
-      }
-      val = "UploadURL:::" + JsonBeanUtil.beanToJson(uploadURLS);
-      valList.add(val);
-    }
-
-    //数据接入部分
-    List<EquipmentAttribute> equipmentAttributes = equipmentAttributeService.getAll();
-    if (null != equipmentAttributes && equipmentAttributes.size() > 0) {
-      for (EquipmentAttribute bean : equipmentAttributes) {
-        bean.setStationCode(header);
-      }
-      val = "EquipmentAttribute:::" + JsonBeanUtil.beanToJson(equipmentAttributes);
-      valList.add(val);
-    }
-
-    //文件解析通道信息
-    List<FileParseTunnelInfo> fileParseTunnelInfos = tunnelInfoService.getAllFileParseTunnel();
-    if (null != fileParseTunnelInfos && fileParseTunnelInfos.size() > 0) {
-      for (FileParseTunnelInfo bean : fileParseTunnelInfos) {
-        bean.setStationCode(header);
-      }
-      val = "FileParseTunnelInfo:::" + JsonBeanUtil.beanToJson(fileParseTunnelInfos);
-      valList.add(val);
-    }
-
-    //104tcp 接入通道
-    List<Gather104TcpTunnelInfo> gather104TcpTunnelInfos = tunnelInfoService.getAllGather104TcpTunnel();
-    if (null != gather104TcpTunnelInfos && gather104TcpTunnelInfos.size() > 0) {
-      for (Gather104TcpTunnelInfo bean : gather104TcpTunnelInfos) {
-        bean.setStationCode(header);
-      }
-      val = "Gather104TcpTunnelInfo:::" + JsonBeanUtil.beanToJson(gather104TcpTunnelInfos);
-      valList.add(val);
-    }
-
-    //cdtRtu接入通道
-    List<GatherCdtRtuTunnelInfo> gatherCdtRtuTunnelInfos = tunnelInfoService.getAllGatherCdtRtuTunnel();
-    if (null != gatherCdtRtuTunnelInfos && gatherCdtRtuTunnelInfos.size() > 0) {
-      for (GatherCdtRtuTunnelInfo bean : gatherCdtRtuTunnelInfos) {
-        bean.setStationCode(header);
-      }
-      val = "GatherCdtRtuTunnelInfo:::" + JsonBeanUtil.beanToJson(gatherCdtRtuTunnelInfos);
-      valList.add(val);
-    }
-    //modbusRtu接入通道
-    List<GatherModbusRtuTunnelInfo> gatherModbusRtuTunnelInfos =
-      tunnelInfoService.getAllGatherModbusRtuTunnel();
-    if (null != gatherModbusRtuTunnelInfos && gatherModbusRtuTunnelInfos.size() > 0) {
-      for (GatherModbusRtuTunnelInfo bean : gatherModbusRtuTunnelInfos) {
-        bean.setStationCode(header);
-      }
-      val = "GatherModbusRtuTunnelInfo:::" + JsonBeanUtil.beanToJson(gatherModbusRtuTunnelInfos);
-      valList.add(val);
-    }
-
-    //modbusTcp接入通道
-    List<GatherModbusTcpTunnelInfo> gatherModbusTcpTunnelInfos =
-      tunnelInfoService.getAllGatherModbusTcpTunnel();
-    if (null != gatherModbusTcpTunnelInfos && gatherModbusTcpTunnelInfos.size() > 0) {
-      for (GatherModbusTcpTunnelInfo bean : gatherModbusTcpTunnelInfos) {
-        bean.setStationCode(header);
-      }
-      val = "GatherModbusTcpTunnelInfo:::" + JsonBeanUtil.beanToJson(gatherModbusTcpTunnelInfos);
-      valList.add(val);
-    }
-
-    //ModbusRtuWithTcp 接入通道
-    List<GatherModbusRtuWithTcpServerTunnelInfo> gatherModbusRtuWithTcpServerTunnelInfos =
-      tunnelInfoService.getAllGatherModbusRtuWithTcpServerTunnel();
-    if (null != gatherModbusRtuWithTcpServerTunnelInfos && gatherModbusRtuWithTcpServerTunnelInfos.size() > 0) {
-      for (GatherModbusRtuWithTcpServerTunnelInfo bean : gatherModbusRtuWithTcpServerTunnelInfos) {
-        bean.setStationCode(header);
-      }
-      val = "GatherModbusRtuWithTcpServerTunnelInfo:::" + JsonBeanUtil.beanToJson(gatherModbusRtuWithTcpServerTunnelInfos);
-      valList.add(val);
-    }
-
-    //104tcp转发通道
-    List<Sender104TcpTunnelInfo> sender104TcpTunnelInfos = tunnelInfoService.getAllSender104TcpTunnel();
-    if (null != sender104TcpTunnelInfos && sender104TcpTunnelInfos.size() > 0) {
-      for (Sender104TcpTunnelInfo bean : sender104TcpTunnelInfos) {
-        bean.setStationCode(header);
-      }
-      val = "Sender104TcpTunnelInfo:::" + JsonBeanUtil.beanToJson(sender104TcpTunnelInfos);
-      valList.add(val);
-    }
-
-    //CdtRtu转发通道
-    List<SenderCdtRtuTunnelInfo> senderCdtRtuTunnelInfos = tunnelInfoService.getAllSenderCdtRtuTunnel();
-    if (null != senderCdtRtuTunnelInfos && senderCdtRtuTunnelInfos.size() > 0) {
-      for (SenderCdtRtuTunnelInfo bean : senderCdtRtuTunnelInfos) {
-        bean.setStationCode(header);
-      }
-      val = "SenderCdtRtuTunnelInfo:::" + JsonBeanUtil.beanToJson(senderCdtRtuTunnelInfos);
-      valList.add(val);
-    }
-    //ModbusRtu 转发通道
-    List<SenderModbusRtuTunnelInfo> senderModbusRtuTunnelInfos =
-      tunnelInfoService.getAllSenderModbusRtuTunnel();
-    if (null != senderModbusRtuTunnelInfos && senderModbusRtuTunnelInfos.size() > 0) {
-      for (SenderModbusRtuTunnelInfo bean : senderModbusRtuTunnelInfos) {
-        bean.setStationCode(header);
-      }
-      val = "SenderModbusRtuTunnelInfo:::" + JsonBeanUtil.beanToJson(senderModbusRtuTunnelInfos);
-      valList.add(val);
-    }
-    //ModbusTcp 转发通道
-    List<SenderModbusTcpTunnelInfo> senderModbusTcpTunnelInfos =
-      tunnelInfoService.getAllSenderModbusTcpTunnel();
-    if (null != senderModbusTcpTunnelInfos && senderModbusTcpTunnelInfos.size() > 0) {
-      for (SenderModbusTcpTunnelInfo bean : senderModbusTcpTunnelInfos) {
-        bean.setStationCode(header);
-      }
-      val = "SenderModbusTcpTunnelInfo:::" + JsonBeanUtil.beanToJson(senderModbusTcpTunnelInfos);
-      valList.add(val);
-    }
-
-    //转发点表
-    List<ProtocolSenderDataPoint> protocolSenderDataPoints = protocolSenderDataPointService.getAll();
-    if (null != protocolSenderDataPoints && protocolSenderDataPoints.size() > 0) {
-      for (ProtocolSenderDataPoint bean : protocolSenderDataPoints) {
-        bean.setStationCode(header);
-      }
-      val = "ProtocolSenderDataPoint:::" + JsonBeanUtil.beanToJson(protocolSenderDataPoints);
-      valList.add(val);
-    }
-    //接入点表
-    List<ProtocolGatherDataPoint> protocolGatherDataPoints = protocolGatherDataPointService.getAll();
-    if (null != protocolGatherDataPoints && protocolGatherDataPoints.size() > 0) {
-      for (ProtocolGatherDataPoint bean : protocolGatherDataPoints) {
-        bean.setStationCode(header);
-      }
-      val = "ProtocolGatherDataPoint:::" + JsonBeanUtil.beanToJson(protocolGatherDataPoints);
-      valList.add(val);
-    }
-
-    // -------------------------20220615 新增agc/avc 升压站 南方电网设备-----------------------------------
-      //gac/avc
-      List<AGC_AVCInfo> agcAvcInfoList = agcAvcInfoService.getAll();
-      if (null != agcAvcInfoList && agcAvcInfoList.size() > 0) {
-        for (AGC_AVCInfo bean : agcAvcInfoList) {
-          bean.setStationCode(header);
-        }
-        val = "AgcAvcInfo:::" + JsonBeanUtil.beanToJson(agcAvcInfoList);
-        valList.add(val);
-      }
-
-      //升压站
-      List<BoosterStationInfo> boosterStationInfoList = boosterStationInfoService.getAll();
-      if (null != boosterStationInfoList && boosterStationInfoList.size() > 0) {
-        for (BoosterStationInfo bean : boosterStationInfoList) {
-          bean.setStationCode(header);
-        }
-        val = "BoosterStationInfo:::" + JsonBeanUtil.beanToJson(boosterStationInfoList);
-        valList.add(val);
-      }
-
-      //南方电网设备
-      List<SubsidiaryEquipmentInfo> subsidiaryEquipmentInfoList = subsidiaryEquipmentInfoService.getAll();
-      if (null != subsidiaryEquipmentInfoList && subsidiaryEquipmentInfoList.size() > 0) {
-        for (SubsidiaryEquipmentInfo bean : subsidiaryEquipmentInfoList) {
-          bean.setStationCode(header);
-        }
-        val = "SubsidiaryEquipmentInfo:::" + JsonBeanUtil.beanToJson(subsidiaryEquipmentInfoList);
-        valList.add(val);
-      }
-
-    return valList;
+    return electricFieldService.queryAllParamsFromDb(electricField);
   }
 
 

+ 5 - 0
ipfcst-console/src/main/java/com/jiayue/ipfcst/console/controller/InverterInfoController.java

@@ -1,5 +1,6 @@
 package com.jiayue.ipfcst.console.controller;
 
+import com.jiayue.ipfcst.aop.BaseInfoImage;
 import com.jiayue.ipfcst.aop.SaveValidate;
 import com.jiayue.ipfcst.common.core.web.vo.ResponseVO;
 import com.jiayue.ipfcst.common.data.constant.enums.EquipmentTypeEnum;
@@ -63,6 +64,7 @@ public class InverterInfoController {
      */
     @SaveValidate
     @PostMapping(value = "inverterInfo/")
+    @BaseInfoImage
     public ResponseVO saveInverter(@RequestBody InverterInfo inverterInfo) {
         try {
             inverterInfoService.save(inverterInfo);
@@ -83,6 +85,7 @@ public class InverterInfoController {
      */
     @SaveValidate
     @PostMapping(value = "inverterInfo/saveAll/{startValue}/{endValue}")
+    @BaseInfoImage
     public ResponseVO allSaveInverter(@RequestBody InverterInfo inverterInfo,@PathVariable("startValue") Integer startValue,@PathVariable("endValue") Integer endValue) {
         try {
           inverterInfoService.addALL(inverterInfo,startValue,endValue);
@@ -103,6 +106,7 @@ public class InverterInfoController {
      */
     @SaveValidate
     @PutMapping(value = "inverterInfo/")
+    @BaseInfoImage
     public ResponseVO updateInverter(@RequestBody InverterInfo inverterInfo) {
         try {
             inverterInfoService.save(inverterInfo);
@@ -124,6 +128,7 @@ public class InverterInfoController {
      */
     @SaveValidate
     @DeleteMapping(value = "inverterInfo/{ids}")
+    @BaseInfoImage
     public ResponseVO deleteInverter(@PathVariable("ids") String ids) {
         try {
             inverterInfoService.delete(ids);

+ 4 - 0
ipfcst-console/src/main/java/com/jiayue/ipfcst/console/controller/PvModuleModelController.java

@@ -1,5 +1,6 @@
 package com.jiayue.ipfcst.console.controller;
 
+import com.jiayue.ipfcst.aop.BaseInfoImage;
 import com.jiayue.ipfcst.aop.SaveValidate;
 import com.jiayue.ipfcst.common.core.web.vo.ResponseVO;
 import com.jiayue.ipfcst.common.data.constant.enums.PvRotationModeEnum;
@@ -85,6 +86,7 @@ public class PvModuleModelController {
      */
     @SaveValidate
     @PostMapping(value = "pvModuleModel/")
+    @BaseInfoImage
     public ResponseVO savePvModuleModel(@RequestBody PvModuleModel pvModuleModel) {
         try {
             pvModuleModelService.save(pvModuleModel);
@@ -105,6 +107,7 @@ public class PvModuleModelController {
      */
     @SaveValidate
     @PutMapping(value = "pvModuleModel/")
+    @BaseInfoImage
     public ResponseVO updatePvModuleModel(@RequestBody PvModuleModel pvModuleModel) {
         try {
             pvModuleModelService.save(pvModuleModel);
@@ -125,6 +128,7 @@ public class PvModuleModelController {
      */
     @SaveValidate
     @DeleteMapping(value="pvModuleModel/{ids}")
+    @BaseInfoImage
     public ResponseVO deletePvModuleModel(@PathVariable("ids")String ids){
         try{
             pvModuleModelService.delete(ids);

+ 4 - 0
ipfcst-console/src/main/java/com/jiayue/ipfcst/console/controller/SubsidiaryEquipmentInfoController.java

@@ -1,5 +1,6 @@
 package com.jiayue.ipfcst.console.controller;
 
+import com.jiayue.ipfcst.aop.BaseInfoImage;
 import com.jiayue.ipfcst.common.core.exception.BusinessException;
 import com.jiayue.ipfcst.common.core.web.vo.ResponseVO;
 import com.jiayue.ipfcst.common.data.entity.SubsidiaryEquipmentInfo;
@@ -38,6 +39,7 @@ public class SubsidiaryEquipmentInfoController {
   * 保存
   * */
   @PostMapping
+  @BaseInfoImage
   public ResponseVO save(@RequestBody SubsidiaryEquipmentInfo subsidiaryEquipmentInfo){
     subsidiaryEquipmentInfoService.save(subsidiaryEquipmentInfo);
     return ResponseVO.success(1);
@@ -47,6 +49,7 @@ public class SubsidiaryEquipmentInfoController {
   * 更新
   * */
   @PutMapping
+  @BaseInfoImage
   public ResponseVO update(@RequestBody SubsidiaryEquipmentInfo subsidiaryEquipmentInfo){
     subsidiaryEquipmentInfoService.save(subsidiaryEquipmentInfo);
     return ResponseVO.success(1);
@@ -56,6 +59,7 @@ public class SubsidiaryEquipmentInfoController {
   * 删除
   * */
   @DeleteMapping("/{id}")
+  @BaseInfoImage
   public ResponseVO delete(@PathVariable String id) throws BusinessException {
     subsidiaryEquipmentInfoService.delete(Integer.parseInt(id));
     return ResponseVO.success(1);

+ 5 - 1
ipfcst-console/src/main/java/com/jiayue/ipfcst/console/controller/WeatherStationInfoController.java

@@ -1,5 +1,6 @@
 package com.jiayue.ipfcst.console.controller;
 
+import com.jiayue.ipfcst.aop.BaseInfoImage;
 import com.jiayue.ipfcst.aop.SaveValidate;
 import com.jiayue.ipfcst.common.core.web.vo.ResponseVO;
 import com.jiayue.ipfcst.common.data.constant.enums.EquipmentTypeEnum;
@@ -41,6 +42,7 @@ public class WeatherStationInfoController {
     @SneakyThrows
     @SaveValidate
     @PostMapping()
+    @BaseInfoImage
     public ResponseVO add(@RequestBody WeatherStationInfo weatherStationInfo) {
       try {
         this.weatherStationInfoService.add(weatherStationInfo);
@@ -62,6 +64,7 @@ public class WeatherStationInfoController {
     @SneakyThrows
     @SaveValidate
     @PutMapping()
+    @BaseInfoImage
     public ResponseVO update(@RequestBody WeatherStationInfo weatherStationInfo) {
       try {
         this.weatherStationInfoService.update(weatherStationInfo);
@@ -95,12 +98,13 @@ public class WeatherStationInfoController {
     /**
      * 删除环境监测仪
      *
-     * @param weatherStationInfo 参数
+     * @param id 参数
      * @return 执行结果
      */
     @SneakyThrows
     @SaveValidate
     @DeleteMapping("/{id}")
+    @BaseInfoImage
     public ResponseVO delete(@PathVariable Integer id) {
       try {
         this.weatherStationInfoService.delete(id);

+ 10 - 3
ipfcst-console/src/main/java/com/jiayue/ipfcst/console/controller/WindTowerInfoController.java

@@ -1,5 +1,6 @@
 package com.jiayue.ipfcst.console.controller;
 
+import com.jiayue.ipfcst.aop.BaseInfoImage;
 import com.jiayue.ipfcst.aop.SaveValidate;
 import com.jiayue.ipfcst.common.core.web.vo.ResponseVO;
 import com.jiayue.ipfcst.common.data.constant.enums.EquipmentTypeEnum;
@@ -38,7 +39,9 @@ import java.util.List;
      */
     @SneakyThrows
     @SaveValidate
-    @PostMapping() public ResponseVO add(@RequestBody WindTowerInfo windTowerInfo) {
+    @PostMapping()
+    @BaseInfoImage
+    public ResponseVO add(@RequestBody WindTowerInfo windTowerInfo) {
         try {
             this.windTowerInfoService.add(windTowerInfo);
             return ResponseVO.success(1);
@@ -57,7 +60,9 @@ import java.util.List;
      */
     @SneakyThrows
     @SaveValidate
-    @PutMapping() public ResponseVO update(@RequestBody WindTowerInfo windTowerInfo) {
+    @PutMapping()
+    @BaseInfoImage
+    public ResponseVO update(@RequestBody WindTowerInfo windTowerInfo) {
         this.windTowerInfoService.update(windTowerInfo);
         return ResponseVO.success(1);
     }
@@ -70,7 +75,9 @@ import java.util.List;
      */
     @SneakyThrows
     @SaveValidate
-    @DeleteMapping("/{id}") public ResponseVO delete(@PathVariable Integer id) {
+    @DeleteMapping("/{id}")
+    @BaseInfoImage
+    public ResponseVO delete(@PathVariable Integer id) {
         this.windTowerInfoService.delete(id);
         return ResponseVO.success(1);
     }

+ 6 - 0
ipfcst-console/src/main/java/com/jiayue/ipfcst/console/controller/WindTurbineInfoController.java

@@ -1,5 +1,6 @@
 package com.jiayue.ipfcst.console.controller;
 
+import com.jiayue.ipfcst.aop.BaseInfoImage;
 import com.jiayue.ipfcst.aop.SaveValidate;
 import com.jiayue.ipfcst.common.core.web.vo.RequestVO;
 import com.jiayue.ipfcst.common.core.web.vo.ResponseVO;
@@ -43,6 +44,7 @@ public class WindTurbineInfoController {
     @SneakyThrows
     @SaveValidate
     @PostMapping()
+    @BaseInfoImage
     public ResponseVO add(@RequestBody WindTurbineInfo windTurbineInfo) {
         this.windTurbineInfoService.add(windTurbineInfo);
         return ResponseVO.success(1);
@@ -57,6 +59,7 @@ public class WindTurbineInfoController {
     @SneakyThrows
     @SaveValidate
     @PutMapping()
+    @BaseInfoImage
     public ResponseVO update(@RequestBody WindTurbineInfo windTurbineInfo) {
         this.windTurbineInfoService.update(windTurbineInfo);
         return ResponseVO.success(1);
@@ -84,6 +87,7 @@ public class WindTurbineInfoController {
     @SneakyThrows
     @SaveValidate
     @DeleteMapping("/{id}")
+    @BaseInfoImage
     public ResponseVO delete(@PathVariable Integer id) {
         this.windTurbineInfoService.delete(id);
         return ResponseVO.success(1);
@@ -126,6 +130,7 @@ public class WindTurbineInfoController {
    */
   @SaveValidate
   @PostMapping(value = "/saveAll/{startValue}/{endValue}")
+  @BaseInfoImage
   public ResponseVO allSaveWindTurbineInfo(@RequestBody WindTurbineInfo windTurbineInfo, @PathVariable("startValue") Integer startValue, @PathVariable("endValue") Integer endValue) {
     try {
       windTurbineInfoService.addALL(windTurbineInfo,startValue,endValue);
@@ -145,6 +150,7 @@ public class WindTurbineInfoController {
    */
   @SaveValidate
   @DeleteMapping(value = "/deleteIds/{ids}")
+  @BaseInfoImage
   public ResponseVO deleteWindTurbineInfo(@PathVariable("ids") String ids) {
     try {
       windTurbineInfoService.delete(ids);

+ 45 - 0
ipfcst-console/src/main/java/com/jiayue/ipfcst/console/service/BaseInfoImageService.java

@@ -0,0 +1,45 @@
+package com.jiayue.ipfcst.console.service;
+
+import com.jiayue.ipfcst.common.data.entity.ElectricField;
+import com.jiayue.ipfcst.fileupload.util.FileUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.util.List;
+
+/**
+ * 生成镜像文件服务类
+ *
+ * @author xsl
+ * @since 2024/03/25
+ */
+@Service
+public class BaseInfoImageService {
+  @Autowired
+  ElectricFieldService electricFieldService;
+  public void generateBaseInfoImage() throws Exception{
+    ElectricField electricField = electricFieldService.get();
+    List<String> list = electricFieldService.queryAllParamsFromDb(electricField);
+    String destFileDir = FileUtil.getImageFilePath();
+    File destDir = new File(destFileDir);
+    if (!destDir.exists()) {// 如果目录不存在则创建uploadFileEndTime目录
+      boolean b = destDir.mkdirs();
+      if (!b) {
+        throw new RuntimeException(destFileDir + " 目录创建失败");
+      }
+    }
+
+    // 先删除本地镜像文件
+    File BaseInfoImageFile = new File(destFileDir+File.separator + "BaseInfoImage.txt");
+    BaseInfoImageFile.delete();
+    // 生成新的镜像文件
+    try(FileWriter writer = new FileWriter(BaseInfoImageFile)){
+      // 增加文件
+      for (String str:list){
+        writer.write(str);
+      }
+    }
+  }
+}

+ 369 - 2
ipfcst-console/src/main/java/com/jiayue/ipfcst/console/service/ElectricFieldService.java

@@ -1,11 +1,24 @@
 package com.jiayue.ipfcst.console.service;
 
 import com.jiayue.ipfcst.common.core.exception.BusinessException;
+import com.jiayue.ipfcst.common.core.util.JsonBeanUtil;
 import com.jiayue.ipfcst.common.data.constant.enums.ElectricFieldStatrsEnum;
-import com.jiayue.ipfcst.common.data.entity.ElectricField;
-import com.jiayue.ipfcst.common.data.entity.UploadFileChannel;
+import com.jiayue.ipfcst.common.data.entity.*;
+import com.jiayue.ipfcst.common.data.entity.gathertunnelinfo.*;
+import com.jiayue.ipfcst.common.data.entity.sendertunnelinfo.Sender104TcpTunnelInfo;
+import com.jiayue.ipfcst.common.data.entity.sendertunnelinfo.SenderCdtRtuTunnelInfo;
+import com.jiayue.ipfcst.common.data.entity.sendertunnelinfo.SenderModbusRtuTunnelInfo;
+import com.jiayue.ipfcst.common.data.entity.sendertunnelinfo.SenderModbusTcpTunnelInfo;
 import com.jiayue.ipfcst.common.data.repository.ElectricFieldRepository;
 import com.jiayue.ipfcst.common.data.service.BaseService;
+import com.jiayue.ipfcst.dataexchange.service.EquipmentAttributeService;
+import com.jiayue.ipfcst.dataexchange.service.ProtocolGatherDataPointService;
+import com.jiayue.ipfcst.dataexchange.service.ProtocolSenderDataPointService;
+import com.jiayue.ipfcst.dataexchange.service.TunnelInfoService;
+import com.jiayue.ipfcst.fileupload.service.UploadFileChannelService;
+import com.jiayue.ipfcst.fileupload.service.UploadFileCodeService;
+import com.jiayue.ipfcst.fileupload.service.UploadObjectService;
+import com.jiayue.ipfcst.fileupload.service.UploadURLService;
 import lombok.extern.slf4j.Slf4j;
 import net.sf.ehcache.Cache;
 import net.sf.ehcache.Element;
@@ -38,6 +51,66 @@ public class ElectricFieldService extends BaseService {
   @Autowired
   EhCacheCacheManager ehCacheCacheManager;
 
+  @Autowired
+  PvModuleModelService pvModuleModelService;
+
+  @Autowired
+  InverterInfoService inverterInfoService;
+
+  @Autowired
+  WeatherStationInfoService weatherStationInfoService;
+
+  @Autowired
+  WindTowerInfoService windTowerInfoService;
+
+  @Autowired
+  WindTurbineInfoService windTurbineInfoService;
+
+  @Autowired
+  AGC_AVCInfoService agcAvcInfoService;
+
+  @Autowired
+  BoosterStationInfoService boosterStationInfoService;
+
+  @Autowired
+  SubsidiaryEquipmentInfoService subsidiaryEquipmentInfoService;
+
+  @Autowired
+  UploadObjectService uploadObjectService;
+
+  @Autowired
+  UploadURLService uploadURLService;
+
+  @Autowired
+  UploadFileChannelService uploadFileChannelService;
+
+  @Autowired
+  UploadFileCodeService uploadFileCodeService;
+
+  @Autowired
+  OverHaulPlanService overHaulPlanService;
+
+  @Autowired
+  QuartzService quartzService;
+
+  @Autowired
+  InitJobClassService initJobClassService;
+
+  @Autowired
+  SysParameterService sysParameterService;
+
+  @Autowired
+  TunnelInfoService tunnelInfoService;
+
+  @Autowired
+  EquipmentAttributeService equipmentAttributeService;
+
+  @Autowired
+  ProtocolSenderDataPointService protocolSenderDataPointService;
+
+  @Autowired
+  ProtocolGatherDataPointService protocolGatherDataPointService;
+
   private final ElectricFieldRepository electricFieldRepository;
 
   @Autowired
@@ -129,4 +202,298 @@ public class ElectricFieldService extends BaseService {
     }
     return electricField;
   }
+
+  public List<String> queryAllParamsFromDb(ElectricField electricField) throws Exception{
+    String header = electricField.getStationCode();
+    List<String> valList = new ArrayList<>();
+    //场站信息
+    List<ElectricField> electricFields = new ArrayList<>();
+    electricFields.add(electricField);
+    String val = "ElectricField:::" + JsonBeanUtil.beanToJson(electricFields);
+    valList.add(val);
+
+    //光伏组件信息
+    List<PvModuleModel> pvModuleModelList = pvModuleModelService.getAll();
+    if (null != pvModuleModelList && pvModuleModelList.size() > 0) {
+      for (PvModuleModel bean : pvModuleModelList) {
+        bean.setStationCode(header);
+      }
+      val = "PvModuleModel:::" + JsonBeanUtil.beanToJson(pvModuleModelList);
+      valList.add(val);
+    }
+    //检修计划
+    List<OverhaulPlan> overhaulPlanList = overHaulPlanService.getAll();
+    if (null != overhaulPlanList && overhaulPlanList.size() > 0) {
+      for (OverhaulPlan bean : overhaulPlanList) {
+        bean.setStationCode(header);
+      }
+      val = "OverhaulPlan:::" + JsonBeanUtil.beanToJson(overhaulPlanList);
+      valList.add(val);
+    }
+    //逆变器信息
+    List<InverterInfo> inverterInfoList = inverterInfoService.getAll();
+    if (null != inverterInfoList && inverterInfoList.size() > 0) {
+      for (InverterInfo bean : inverterInfoList) {
+        bean.setStationCode(header);
+      }
+      val = "InverterInfo:::" + JsonBeanUtil.beanToJson(inverterInfoList);
+      valList.add(val);
+    }
+    //气象站数据
+    List<WeatherStationInfo> weatherStationInfoList = weatherStationInfoService.getAll();
+    if (null != weatherStationInfoList && weatherStationInfoList.size() > 0) {
+      for (WeatherStationInfo bean : weatherStationInfoList) {
+        bean.setStationCode(header);
+      }
+      val = "WeatherStationInfo:::" + JsonBeanUtil.beanToJson(weatherStationInfoList);
+      valList.add(val);
+    }
+    //测风塔
+    List<WindTowerInfo> windTowerInfoList = windTowerInfoService.getAll();
+    if (null != windTowerInfoList && windTowerInfoList.size() > 0) {
+      for (WindTowerInfo bean : windTowerInfoList) {
+        bean.setStationCode(header);
+      }
+      val = "WindTowerInfo:::" + JsonBeanUtil.beanToJson(windTowerInfoList);
+      valList.add(val);
+    }
+    //风机
+    List<WindTurbineInfo> windTurbineInfoList = windTurbineInfoService.getAll();
+    if (null != windTurbineInfoList && windTurbineInfoList.size() > 0) {
+      for (WindTurbineInfo bean : windTurbineInfoList) {
+        bean.setStationCode(header);
+      }
+      val = "WindTurbineInfo:::" + JsonBeanUtil.beanToJson(windTurbineInfoList);
+      valList.add(val);
+    }
+    //初始化定时任务
+    List<InitJobClass> initJobClassList = initJobClassService.findAll();
+    if (null != initJobClassList && initJobClassList.size() > 0) {
+      for (InitJobClass bean : initJobClassList) {
+        bean.setStationCode(header);
+      }
+      val = "InitJobClass:::" + JsonBeanUtil.beanToJson(initJobClassList);
+      valList.add(val);
+    }
+    //定时任务
+    List<Quartz> quartzList = quartzService.getAll();
+    if (null != quartzList && quartzList.size() > 0) {
+      for (Quartz bean : quartzList) {
+        bean.setStationCode(header);
+      }
+      val = "Quartz:::" + JsonBeanUtil.beanToJson(quartzList);
+      valList.add(val);
+    }
+    //系统参数
+    List<SysParameter> sysParameterList = sysParameterService.getAll();
+    if (null != sysParameterList && sysParameterList.size() > 0) {
+      for (SysParameter bean : sysParameterList) {
+        bean.setStationCode(header);
+      }
+      val = "SysParameter:::" + JsonBeanUtil.beanToJson(sysParameterList);
+      valList.add(val);
+    }
+
+    //文件上报部分
+    List<UploadObject> uploadObjectList = uploadObjectService.get();
+    if (null != uploadObjectList && uploadObjectList.size() > 0) {
+      for (UploadObject bean : uploadObjectList) {
+        bean.setStationCode(header);
+      }
+      val = "UploadObject:::" + JsonBeanUtil.beanToJson(uploadObjectList);
+      valList.add(val);
+    }
+
+    //上报通道
+    List<UploadFileChannel> uploadFileChannels = uploadFileChannelService.get();
+    if (null != uploadFileChannels && uploadFileChannels.size() > 0) {
+      for (UploadFileChannel bean : uploadFileChannels) {
+        bean.setStationCode(header);
+      }
+      val = "UploadFileChannel:::" + JsonBeanUtil.beanToJson(uploadFileChannels);
+      valList.add(val);
+    }
+    //上报文件编码
+    List<UploadFileCode> uploadFileCodes = uploadFileCodeService.get();
+    if (null != uploadFileCodes && uploadFileCodes.size() > 0) {
+      for (UploadFileCode bean : uploadFileCodes) {
+        bean.setStationCode(header);
+      }
+      val = "UploadFileCode:::" + JsonBeanUtil.beanToJson(uploadFileCodes);
+      valList.add(val);
+    }
+    //上报文件路径
+    List<UploadURL> uploadURLS = uploadURLService.findAll();
+    if (null != uploadURLS && uploadURLS.size() > 0) {
+      for (UploadURL bean : uploadURLS) {
+        bean.setStationCode(header);
+      }
+      val = "UploadURL:::" + JsonBeanUtil.beanToJson(uploadURLS);
+      valList.add(val);
+    }
+
+    //数据接入部分
+    List<EquipmentAttribute> equipmentAttributes = equipmentAttributeService.getAll();
+    if (null != equipmentAttributes && equipmentAttributes.size() > 0) {
+      for (EquipmentAttribute bean : equipmentAttributes) {
+        bean.setStationCode(header);
+      }
+      val = "EquipmentAttribute:::" + JsonBeanUtil.beanToJson(equipmentAttributes);
+      valList.add(val);
+    }
+
+    //文件解析通道信息
+    List<FileParseTunnelInfo> fileParseTunnelInfos = tunnelInfoService.getAllFileParseTunnel();
+    if (null != fileParseTunnelInfos && fileParseTunnelInfos.size() > 0) {
+      for (FileParseTunnelInfo bean : fileParseTunnelInfos) {
+        bean.setStationCode(header);
+      }
+      val = "FileParseTunnelInfo:::" + JsonBeanUtil.beanToJson(fileParseTunnelInfos);
+      valList.add(val);
+    }
+
+    //104tcp 接入通道
+    List<Gather104TcpTunnelInfo> gather104TcpTunnelInfos = tunnelInfoService.getAllGather104TcpTunnel();
+    if (null != gather104TcpTunnelInfos && gather104TcpTunnelInfos.size() > 0) {
+      for (Gather104TcpTunnelInfo bean : gather104TcpTunnelInfos) {
+        bean.setStationCode(header);
+      }
+      val = "Gather104TcpTunnelInfo:::" + JsonBeanUtil.beanToJson(gather104TcpTunnelInfos);
+      valList.add(val);
+    }
+
+    //cdtRtu接入通道
+    List<GatherCdtRtuTunnelInfo> gatherCdtRtuTunnelInfos = tunnelInfoService.getAllGatherCdtRtuTunnel();
+    if (null != gatherCdtRtuTunnelInfos && gatherCdtRtuTunnelInfos.size() > 0) {
+      for (GatherCdtRtuTunnelInfo bean : gatherCdtRtuTunnelInfos) {
+        bean.setStationCode(header);
+      }
+      val = "GatherCdtRtuTunnelInfo:::" + JsonBeanUtil.beanToJson(gatherCdtRtuTunnelInfos);
+      valList.add(val);
+    }
+    //modbusRtu接入通道
+    List<GatherModbusRtuTunnelInfo> gatherModbusRtuTunnelInfos =
+      tunnelInfoService.getAllGatherModbusRtuTunnel();
+    if (null != gatherModbusRtuTunnelInfos && gatherModbusRtuTunnelInfos.size() > 0) {
+      for (GatherModbusRtuTunnelInfo bean : gatherModbusRtuTunnelInfos) {
+        bean.setStationCode(header);
+      }
+      val = "GatherModbusRtuTunnelInfo:::" + JsonBeanUtil.beanToJson(gatherModbusRtuTunnelInfos);
+      valList.add(val);
+    }
+
+    //modbusTcp接入通道
+    List<GatherModbusTcpTunnelInfo> gatherModbusTcpTunnelInfos =
+      tunnelInfoService.getAllGatherModbusTcpTunnel();
+    if (null != gatherModbusTcpTunnelInfos && gatherModbusTcpTunnelInfos.size() > 0) {
+      for (GatherModbusTcpTunnelInfo bean : gatherModbusTcpTunnelInfos) {
+        bean.setStationCode(header);
+      }
+      val = "GatherModbusTcpTunnelInfo:::" + JsonBeanUtil.beanToJson(gatherModbusTcpTunnelInfos);
+      valList.add(val);
+    }
+
+    //ModbusRtuWithTcp 接入通道
+    List<GatherModbusRtuWithTcpServerTunnelInfo> gatherModbusRtuWithTcpServerTunnelInfos =
+      tunnelInfoService.getAllGatherModbusRtuWithTcpServerTunnel();
+    if (null != gatherModbusRtuWithTcpServerTunnelInfos && gatherModbusRtuWithTcpServerTunnelInfos.size() > 0) {
+      for (GatherModbusRtuWithTcpServerTunnelInfo bean : gatherModbusRtuWithTcpServerTunnelInfos) {
+        bean.setStationCode(header);
+      }
+      val = "GatherModbusRtuWithTcpServerTunnelInfo:::" + JsonBeanUtil.beanToJson(gatherModbusRtuWithTcpServerTunnelInfos);
+      valList.add(val);
+    }
+
+    //104tcp转发通道
+    List<Sender104TcpTunnelInfo> sender104TcpTunnelInfos = tunnelInfoService.getAllSender104TcpTunnel();
+    if (null != sender104TcpTunnelInfos && sender104TcpTunnelInfos.size() > 0) {
+      for (Sender104TcpTunnelInfo bean : sender104TcpTunnelInfos) {
+        bean.setStationCode(header);
+      }
+      val = "Sender104TcpTunnelInfo:::" + JsonBeanUtil.beanToJson(sender104TcpTunnelInfos);
+      valList.add(val);
+    }
+
+    //CdtRtu转发通道
+    List<SenderCdtRtuTunnelInfo> senderCdtRtuTunnelInfos = tunnelInfoService.getAllSenderCdtRtuTunnel();
+    if (null != senderCdtRtuTunnelInfos && senderCdtRtuTunnelInfos.size() > 0) {
+      for (SenderCdtRtuTunnelInfo bean : senderCdtRtuTunnelInfos) {
+        bean.setStationCode(header);
+      }
+      val = "SenderCdtRtuTunnelInfo:::" + JsonBeanUtil.beanToJson(senderCdtRtuTunnelInfos);
+      valList.add(val);
+    }
+    //ModbusRtu 转发通道
+    List<SenderModbusRtuTunnelInfo> senderModbusRtuTunnelInfos =
+      tunnelInfoService.getAllSenderModbusRtuTunnel();
+    if (null != senderModbusRtuTunnelInfos && senderModbusRtuTunnelInfos.size() > 0) {
+      for (SenderModbusRtuTunnelInfo bean : senderModbusRtuTunnelInfos) {
+        bean.setStationCode(header);
+      }
+      val = "SenderModbusRtuTunnelInfo:::" + JsonBeanUtil.beanToJson(senderModbusRtuTunnelInfos);
+      valList.add(val);
+    }
+    //ModbusTcp 转发通道
+    List<SenderModbusTcpTunnelInfo> senderModbusTcpTunnelInfos =
+      tunnelInfoService.getAllSenderModbusTcpTunnel();
+    if (null != senderModbusTcpTunnelInfos && senderModbusTcpTunnelInfos.size() > 0) {
+      for (SenderModbusTcpTunnelInfo bean : senderModbusTcpTunnelInfos) {
+        bean.setStationCode(header);
+      }
+      val = "SenderModbusTcpTunnelInfo:::" + JsonBeanUtil.beanToJson(senderModbusTcpTunnelInfos);
+      valList.add(val);
+    }
+
+    //转发点表
+    List<ProtocolSenderDataPoint> protocolSenderDataPoints = protocolSenderDataPointService.getAll();
+    if (null != protocolSenderDataPoints && protocolSenderDataPoints.size() > 0) {
+      for (ProtocolSenderDataPoint bean : protocolSenderDataPoints) {
+        bean.setStationCode(header);
+      }
+      val = "ProtocolSenderDataPoint:::" + JsonBeanUtil.beanToJson(protocolSenderDataPoints);
+      valList.add(val);
+    }
+    //接入点表
+    List<ProtocolGatherDataPoint> protocolGatherDataPoints = protocolGatherDataPointService.getAll();
+    if (null != protocolGatherDataPoints && protocolGatherDataPoints.size() > 0) {
+      for (ProtocolGatherDataPoint bean : protocolGatherDataPoints) {
+        bean.setStationCode(header);
+      }
+      val = "ProtocolGatherDataPoint:::" + JsonBeanUtil.beanToJson(protocolGatherDataPoints);
+      valList.add(val);
+    }
+
+    // -------------------------20220615 新增agc/avc 升压站 南方电网设备-----------------------------------
+    //gac/avc
+    List<AGC_AVCInfo> agcAvcInfoList = agcAvcInfoService.getAll();
+    if (null != agcAvcInfoList && agcAvcInfoList.size() > 0) {
+      for (AGC_AVCInfo bean : agcAvcInfoList) {
+        bean.setStationCode(header);
+      }
+      val = "AgcAvcInfo:::" + JsonBeanUtil.beanToJson(agcAvcInfoList);
+      valList.add(val);
+    }
+
+    //升压站
+    List<BoosterStationInfo> boosterStationInfoList = boosterStationInfoService.getAll();
+    if (null != boosterStationInfoList && boosterStationInfoList.size() > 0) {
+      for (BoosterStationInfo bean : boosterStationInfoList) {
+        bean.setStationCode(header);
+      }
+      val = "BoosterStationInfo:::" + JsonBeanUtil.beanToJson(boosterStationInfoList);
+      valList.add(val);
+    }
+
+    //南方电网设备
+    List<SubsidiaryEquipmentInfo> subsidiaryEquipmentInfoList = subsidiaryEquipmentInfoService.getAll();
+    if (null != subsidiaryEquipmentInfoList && subsidiaryEquipmentInfoList.size() > 0) {
+      for (SubsidiaryEquipmentInfo bean : subsidiaryEquipmentInfoList) {
+        bean.setStationCode(header);
+      }
+      val = "SubsidiaryEquipmentInfo:::" + JsonBeanUtil.beanToJson(subsidiaryEquipmentInfoList);
+      valList.add(val);
+    }
+
+    return valList;
+  }
 }

+ 4 - 0
ipfcst-console/src/main/java/com/jiayue/ipfcst/fileupload/controller/UploadFileChannelController.java

@@ -1,5 +1,6 @@
 package com.jiayue.ipfcst.fileupload.controller;
 
+import com.jiayue.ipfcst.aop.BaseInfoImage;
 import com.jiayue.ipfcst.aop.SaveValidate;
 import com.jiayue.ipfcst.common.core.web.vo.ResponseVO;
 import com.jiayue.ipfcst.common.data.constant.enums.*;
@@ -47,6 +48,7 @@ public class UploadFileChannelController {
   @SneakyThrows
   @PostMapping
   @SaveValidate
+  @BaseInfoImage
   public ResponseVO add(@RequestBody UploadFileChannel uploadFileChannel) {
     UploadFileChannel save = uploadFileChannelService.save(uploadFileChannel);
     return ResponseVO.success(save);
@@ -62,6 +64,7 @@ public class UploadFileChannelController {
   @PutMapping
   @SaveValidate
   @Transactional
+  @BaseInfoImage
   public ResponseVO update(@RequestBody UploadFileChannel uploadFileChannel) {
 
     uploadFileChannelService.save(uploadFileChannel);
@@ -84,6 +87,7 @@ public class UploadFileChannelController {
   @SneakyThrows
   @DeleteMapping("/{id}")
   @SaveValidate
+  @BaseInfoImage
   public ResponseVO delete(@PathVariable Integer id) {
     UploadFileChannel uploadFileChannel = uploadFileChannelService.getById(id);
     uploadFileChannelService.delete(uploadFileChannel);

+ 4 - 0
ipfcst-console/src/main/java/com/jiayue/ipfcst/fileupload/controller/UploadFileCodeController.java

@@ -1,5 +1,6 @@
 package com.jiayue.ipfcst.fileupload.controller;
 
+import com.jiayue.ipfcst.aop.BaseInfoImage;
 import com.jiayue.ipfcst.aop.SaveValidate;
 import com.jiayue.ipfcst.common.core.web.vo.ResponseVO;
 import com.jiayue.ipfcst.common.data.entity.UploadFileCode;
@@ -39,6 +40,7 @@ public class UploadFileCodeController {
    */
   @PostMapping
   @SaveValidate
+  @BaseInfoImage
   public ResponseVO update(@RequestBody UploadFileCode uploadFileCode){
     return ResponseVO.success(uploadFileCodeService.save(uploadFileCode));
   }
@@ -51,6 +53,7 @@ public class UploadFileCodeController {
    */
   @PutMapping
   @SaveValidate
+  @BaseInfoImage
   public ResponseVO add(@RequestBody UploadFileCode uploadFileCode){
     return ResponseVO.success(uploadFileCodeService.save(uploadFileCode));
   }
@@ -63,6 +66,7 @@ public class UploadFileCodeController {
    */
   @DeleteMapping("/{id}")
   @SaveValidate
+  @BaseInfoImage
   public ResponseVO delete(@PathVariable Integer id){
     UploadFileCode uploadFileCode = new UploadFileCode();
     uploadFileCode.setId(id);

+ 4 - 0
ipfcst-console/src/main/java/com/jiayue/ipfcst/fileupload/controller/UploadObjectController.java

@@ -1,5 +1,6 @@
 package com.jiayue.ipfcst.fileupload.controller;
 
+import com.jiayue.ipfcst.aop.BaseInfoImage;
 import com.jiayue.ipfcst.aop.SaveValidate;
 import com.jiayue.ipfcst.common.core.exception.BusinessException;
 import com.jiayue.ipfcst.common.core.web.vo.ResponseVO;
@@ -51,6 +52,7 @@ public class UploadObjectController {
    */
   @PostMapping
   @SaveValidate
+  @BaseInfoImage
   public ResponseVO add(@RequestBody UploadObject uploadObject) {
     try {
       uploadObjectService.save(uploadObject);
@@ -69,6 +71,7 @@ public class UploadObjectController {
    */
   @PutMapping
   @SaveValidate
+  @BaseInfoImage
   public ResponseVO update(@RequestBody UploadObject uploadObject) {
     try {
       uploadObjectService.save(uploadObject);
@@ -88,6 +91,7 @@ public class UploadObjectController {
    */
   @DeleteMapping("/{id}")
   @SaveValidate
+  @BaseInfoImage
   public ResponseVO delete(@PathVariable Integer id) {
     try {
       uploadFileChannelService.deleteByObjId(id);

+ 3 - 0
ipfcst-console/src/main/java/com/jiayue/ipfcst/fileupload/controller/UploadURLController.java

@@ -1,5 +1,6 @@
 package com.jiayue.ipfcst.fileupload.controller;
 
+import com.jiayue.ipfcst.aop.BaseInfoImage;
 import com.jiayue.ipfcst.common.core.web.vo.ResponseVO;
 import com.jiayue.ipfcst.common.data.entity.UploadURL;
 import com.jiayue.ipfcst.fileupload.service.UploadURLService;
@@ -24,6 +25,7 @@ public class UploadURLController {
 
   @PostMapping("/uploadURL")
   @Transactional
+  @BaseInfoImage
   public ResponseVO save(@RequestBody UploadURL uploadURL){
 
     uploadURLService.save(uploadURL);
@@ -33,6 +35,7 @@ public class UploadURLController {
 
   @DeleteMapping("/uploadURL/{id}")
   @Transactional
+  @BaseInfoImage
   public ResponseVO delete(@PathVariable Integer id){
 
     uploadURLService.deleteByChannelId(id);

+ 9 - 0
ipfcst-console/src/main/java/com/jiayue/ipfcst/fileupload/util/FileUtil.java

@@ -262,6 +262,15 @@ public class FileUtil {
   }
 
   /**
+   * 镜像文件相对路径
+   *
+   * @return
+   */
+  public static String getImageFilePath() {
+    return createUploadAllDir("imageFile");
+  }
+
+  /**
    * 获取临时文件目录相对路径
    *
    * @return

+ 24 - 4
ipfcst-upload/src/test/java/org/example/AppTest.java

@@ -4,10 +4,15 @@ import junit.framework.Test;
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
 
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+
 /**
  * Unit test for simple App.
  */
-public class AppTest 
+public class AppTest
     extends TestCase
 {
     /**
@@ -31,8 +36,23 @@ public class AppTest
     /**
      * Rigourous Test :-)
      */
-    public void testApp()
-    {
-        assertTrue( true );
+    public void testApp() throws Exception{
+        File file1 = new File("d:\\test\\file1.txt");
+        file1.delete();
+//        while (true) {
+//            // 读取文件
+////            FileReader file = new FileReader("d:\\test\\test.txt"); // 创建文件对象
+////            if (file.exists()){
+//                try (BufferedReader reader = new BufferedReader(new FileReader("d:\\test\\test.txt"))) {
+//                    String line;
+//                    while ((line = reader.readLine()) != null) {
+//                        System.out.println(line);
+//                    }
+//                } catch (IOException e) {
+//                    e.printStackTrace();
+//                }
+//                System.out.println("===================读取完成===================");
+////            }
+//        }
     }
 }