Просмотр исходного кода

添加基础信息镜像文件读取

jyyw 1 год назад
Родитель
Сommit
d8aa9cfca4
46 измененных файлов с 1263 добавлено и 139 удалено
  1. 5 5
      ipfcst-spare2/pom.xml
  2. 26 0
      ipfcst-spare2/src/main/java/com/jiayue/ipfcst/spare2/Spare2Application.java
  3. 31 0
      ipfcst-spare2/src/main/java/com/jiayue/ipfcst/spare2/base4/BaseRepository.java
  4. 4 0
      ipfcst-spare2/src/main/java/com/jiayue/ipfcst/spare2/base4/BaseService.java
  5. 30 0
      ipfcst-spare2/src/main/java/com/jiayue/ipfcst/spare2/baseinfos/repository/AGC_AVCInfoRepository.java
  6. 30 0
      ipfcst-spare2/src/main/java/com/jiayue/ipfcst/spare2/baseinfos/repository/BoosterStationInfoRepository.java
  7. 45 0
      ipfcst-spare2/src/main/java/com/jiayue/ipfcst/spare2/baseinfos/repository/ElectricFieldRepository.java
  8. 30 0
      ipfcst-spare2/src/main/java/com/jiayue/ipfcst/spare2/baseinfos/repository/EquipmentAttributeRepository.java
  9. 30 0
      ipfcst-spare2/src/main/java/com/jiayue/ipfcst/spare2/baseinfos/repository/Gather104TcpTunnelInfoRepository.java
  10. 30 0
      ipfcst-spare2/src/main/java/com/jiayue/ipfcst/spare2/baseinfos/repository/InitJobClassRepository.java
  11. 30 0
      ipfcst-spare2/src/main/java/com/jiayue/ipfcst/spare2/baseinfos/repository/InverterInfoRepository.java
  12. 30 0
      ipfcst-spare2/src/main/java/com/jiayue/ipfcst/spare2/baseinfos/repository/ProtocolGatherDataPointRepository.java
  13. 30 0
      ipfcst-spare2/src/main/java/com/jiayue/ipfcst/spare2/baseinfos/repository/PvModuleModelRepository.java
  14. 31 0
      ipfcst-spare2/src/main/java/com/jiayue/ipfcst/spare2/baseinfos/repository/QuartzRepository.java
  15. 30 0
      ipfcst-spare2/src/main/java/com/jiayue/ipfcst/spare2/baseinfos/repository/SysParameterRepository.java
  16. 30 0
      ipfcst-spare2/src/main/java/com/jiayue/ipfcst/spare2/baseinfos/repository/UploadFileChannelRepository.java
  17. 30 0
      ipfcst-spare2/src/main/java/com/jiayue/ipfcst/spare2/baseinfos/repository/UploadFileCodeRepository.java
  18. 30 0
      ipfcst-spare2/src/main/java/com/jiayue/ipfcst/spare2/baseinfos/repository/UploadObjectRepository.java
  19. 30 0
      ipfcst-spare2/src/main/java/com/jiayue/ipfcst/spare2/baseinfos/repository/WeatherStationInfoRepository.java
  20. 30 0
      ipfcst-spare2/src/main/java/com/jiayue/ipfcst/spare2/baseinfos/repository/WindTowerInfoRepository.java
  21. 30 0
      ipfcst-spare2/src/main/java/com/jiayue/ipfcst/spare2/baseinfos/repository/WindTurbineInfoRepository.java
  22. 28 0
      ipfcst-spare2/src/main/java/com/jiayue/ipfcst/spare2/baseinfos/service/AGC_AVCInfoService.java
  23. 28 0
      ipfcst-spare2/src/main/java/com/jiayue/ipfcst/spare2/baseinfos/service/BoosterStationInfoService.java
  24. 32 0
      ipfcst-spare2/src/main/java/com/jiayue/ipfcst/spare2/baseinfos/service/ElectricFieldService.java
  25. 28 0
      ipfcst-spare2/src/main/java/com/jiayue/ipfcst/spare2/baseinfos/service/EquipmentAttributeService.java
  26. 28 0
      ipfcst-spare2/src/main/java/com/jiayue/ipfcst/spare2/baseinfos/service/Gather104TcpTunnelInfoService.java
  27. 27 0
      ipfcst-spare2/src/main/java/com/jiayue/ipfcst/spare2/baseinfos/service/InitJobClassService.java
  28. 28 0
      ipfcst-spare2/src/main/java/com/jiayue/ipfcst/spare2/baseinfos/service/InverterInfoService.java
  29. 28 0
      ipfcst-spare2/src/main/java/com/jiayue/ipfcst/spare2/baseinfos/service/ProtocolGatherDataPointService.java
  30. 28 0
      ipfcst-spare2/src/main/java/com/jiayue/ipfcst/spare2/baseinfos/service/PvModuleModelService.java
  31. 28 0
      ipfcst-spare2/src/main/java/com/jiayue/ipfcst/spare2/baseinfos/service/QuartzService.java
  32. 28 0
      ipfcst-spare2/src/main/java/com/jiayue/ipfcst/spare2/baseinfos/service/SysParameterService.java
  33. 28 0
      ipfcst-spare2/src/main/java/com/jiayue/ipfcst/spare2/baseinfos/service/UploadFileChannelService.java
  34. 28 0
      ipfcst-spare2/src/main/java/com/jiayue/ipfcst/spare2/baseinfos/service/UploadFileCodeService.java
  35. 28 0
      ipfcst-spare2/src/main/java/com/jiayue/ipfcst/spare2/baseinfos/service/UploadObiectService.java
  36. 28 0
      ipfcst-spare2/src/main/java/com/jiayue/ipfcst/spare2/baseinfos/service/WeatherStationInfoService.java
  37. 28 0
      ipfcst-spare2/src/main/java/com/jiayue/ipfcst/spare2/baseinfos/service/WindTowerInfoService.java
  38. 28 0
      ipfcst-spare2/src/main/java/com/jiayue/ipfcst/spare2/baseinfos/service/WindTurbineInfoService.java
  39. 5 0
      ipfcst-spare2/src/main/java/com/jiayue/ipfcst/spare2/constants/Constants.java
  40. 1 1
      ipfcst-spare2/src/main/java/com/jiayue/ipfcst/spare2/job/ConsoleCheckUpJob.java
  41. 13 133
      ipfcst-spare2/src/main/java/com/jiayue/ipfcst/spare2/util/FileUtil.java
  42. 7 0
      ipfcst-spare2/src/main/resources/application.yml
  43. 18 0
      ipfcst-spare2/src/main/resources/assembly_base.xml
  44. 38 0
      ipfcst-spare2/src/main/resources/ehcache-setting.xml
  45. 79 0
      ipfcst-spare2/src/main/resources/logback-spare2.xml
  46. 31 0
      ipfcst-spare2/src/main/resources/start-spare2.vm

+ 5 - 5
ipfcst-spare2/pom.xml

@@ -99,11 +99,11 @@
             <version>3.0.0</version>
         </dependency>
 
-        <dependency>
-            <groupId>com.jiayue.ipfcst</groupId>
-            <artifactId>ipfcst-common-security</artifactId>
-            <version>3.0.0</version>
-        </dependency>
+<!--        <dependency>-->
+<!--            <groupId>com.jiayue.ipfcst</groupId>-->
+<!--            <artifactId>ipfcst-common-security</artifactId>-->
+<!--            <version>3.0.0</version>-->
+<!--        </dependency>-->
 
         <dependency>
             <groupId>org.apache.commons</groupId>

+ 26 - 0
ipfcst-spare2/src/main/java/com/jiayue/ipfcst/spare2/Spare2Application.java

@@ -2,14 +2,19 @@ package com.jiayue.ipfcst.spare2;
 
 import io.netty.util.ResourceLeakDetector;
 import lombok.extern.slf4j.Slf4j;
+import net.sf.ehcache.CacheManager;
 import org.apache.velocity.app.Velocity;
 import org.apache.velocity.app.VelocityEngine;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.boot.builder.SpringApplicationBuilder;
+import org.springframework.cache.annotation.EnableCaching;
+import org.springframework.cache.ehcache.EhCacheCacheManager;
+import org.springframework.cache.ehcache.EhCacheManagerFactoryBean;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.core.env.Environment;
+import org.springframework.core.io.ClassPathResource;
 import org.springframework.scheduling.annotation.EnableScheduling;
 
 import java.util.Properties;
@@ -26,6 +31,7 @@ import java.util.TimeZone;
 @SpringBootApplication
 @Slf4j
 @EnableScheduling
+@EnableCaching
 public class Spare2Application {
 
     private final Environment environment;
@@ -43,6 +49,26 @@ public class Spare2Application {
     }
 
     /**
+     * ecache缓存对象获取
+     */
+    @Bean
+    public EhCacheCacheManager cacheManager(CacheManager cacheManagerFactory) {
+        EhCacheCacheManager ehCacheCacheManager = new EhCacheCacheManager();
+        ehCacheCacheManager.setCacheManager(cacheManagerFactory);
+        return ehCacheCacheManager;
+    }
+
+    /**
+     * ecache缓存配置加载
+     */
+    @Bean
+    public EhCacheManagerFactoryBean cacheManagerFactory() {
+        EhCacheManagerFactoryBean ehCacheManagerFactoryBean = new EhCacheManagerFactoryBean();
+        ehCacheManagerFactoryBean.setConfigLocation(new ClassPathResource("ehcache-setting.xml"));
+        return ehCacheManagerFactoryBean;
+    }
+
+    /**
      * 上报文件模板引擎
      *
      * @return 返回模板引擎

+ 31 - 0
ipfcst-spare2/src/main/java/com/jiayue/ipfcst/spare2/base4/BaseRepository.java

@@ -0,0 +1,31 @@
+package com.jiayue.ipfcst.spare2.base4;
+
+import com.jiayue.ipfcst.spare2.util.FileUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.cache.Cache;
+import org.springframework.cache.ehcache.EhCacheCacheManager;
+import org.springframework.stereotype.Repository;
+
+import java.io.Serializable;
+import java.util.List;
+
+@Repository
+public class BaseRepository implements Serializable {
+
+    @Autowired
+    public EhCacheCacheManager ehCacheCacheManager;
+
+    public <T> Exception newImageFileContentEmptyException(Class<T> t) {
+        return new Exception("基础信息:镜像文件" + t.getSimpleName() + "内容为空,无法启动程序");
+    }
+
+    public <T> List<T> readImageToList(Class<T> clazz) throws Exception {
+        List<T> list = (List<T>) FileUtil.readBaseInfoImage(clazz.getSimpleName());
+        if (null != list) {
+            throw newImageFileContentEmptyException(clazz);
+        }
+        Cache cache = ehCacheCacheManager.getCache(clazz.getSimpleName());
+        cache.put("list", list);
+        return list;
+    }
+}

+ 4 - 0
ipfcst-spare2/src/main/java/com/jiayue/ipfcst/spare2/base4/BaseService.java

@@ -0,0 +1,4 @@
+package com.jiayue.ipfcst.spare2.base4;
+
+public class BaseService {
+}

+ 30 - 0
ipfcst-spare2/src/main/java/com/jiayue/ipfcst/spare2/baseinfos/repository/AGC_AVCInfoRepository.java

@@ -0,0 +1,30 @@
+package com.jiayue.ipfcst.spare2.baseinfos.repository;
+
+import com.jiayue.ipfcst.common.data.entity.AGC_AVCInfo;
+import com.jiayue.ipfcst.spare2.base4.BaseRepository;
+import org.springframework.cache.annotation.CacheEvict;
+import org.springframework.cache.annotation.CachePut;
+import org.springframework.cache.annotation.Cacheable;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+@Repository
+public class AGC_AVCInfoRepository extends BaseRepository {
+
+    @Cacheable(cacheNames = "AGC_AVCInfo", key = "#agcAvcInfoList")
+    public AGC_AVCInfo findById() {
+        return null;
+    }
+
+    @Cacheable(cacheNames = "AGC_AVCInfo", key = "#agcAvcInfoList")
+    public List<AGC_AVCInfo> findAll() {
+        return null;
+    }
+
+    @CacheEvict(value = "AGC_AVCInfo", beforeInvocation = true)
+    @CachePut(cacheNames = "AGC_AVCInfo", key = "#agcAvcInfoList")
+    private List<AGC_AVCInfo> fresh() throws Exception {
+        return readImageToList(AGC_AVCInfo.class);
+    }
+}

+ 30 - 0
ipfcst-spare2/src/main/java/com/jiayue/ipfcst/spare2/baseinfos/repository/BoosterStationInfoRepository.java

@@ -0,0 +1,30 @@
+package com.jiayue.ipfcst.spare2.baseinfos.repository;
+
+import com.jiayue.ipfcst.common.data.entity.BoosterStationInfo;
+import com.jiayue.ipfcst.spare2.base4.BaseRepository;
+import org.springframework.cache.annotation.CacheEvict;
+import org.springframework.cache.annotation.CachePut;
+import org.springframework.cache.annotation.Cacheable;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+@Repository
+public class BoosterStationInfoRepository extends BaseRepository {
+
+    @Cacheable(cacheNames = "BoosterStationInfo", key = "#boosterStationInfoList")
+    public BoosterStationInfo findById() {
+        return null;
+    }
+
+    @Cacheable(cacheNames = "BoosterStationInfo", key = "#boosterStationInfoList")
+    public List<BoosterStationInfo> findAll() {
+        return null;
+    }
+
+    @CacheEvict(value = "BoosterStationInfo", beforeInvocation = true)
+    @CachePut(cacheNames = "BoosterStationInfo", key = "#boosterStationInfoList")
+    private List<BoosterStationInfo> fresh() throws Exception {
+        return readImageToList(BoosterStationInfo.class);
+    }
+}

+ 45 - 0
ipfcst-spare2/src/main/java/com/jiayue/ipfcst/spare2/baseinfos/repository/ElectricFieldRepository.java

@@ -0,0 +1,45 @@
+package com.jiayue.ipfcst.spare2.baseinfos.repository;
+
+import com.jiayue.ipfcst.common.data.entity.ElectricField;
+import com.jiayue.ipfcst.spare2.base4.BaseRepository;
+import org.springframework.cache.Cache;
+import org.springframework.cache.annotation.CacheEvict;
+import org.springframework.cache.annotation.CachePut;
+import org.springframework.cache.annotation.Cacheable;
+import org.springframework.stereotype.Repository;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Optional;
+
+@Repository
+public class ElectricFieldRepository extends BaseRepository {
+
+    @Cacheable(cacheNames = "ElectricField", key = "#electricFieldList")
+    public ElectricField findFirst() {
+        List<ElectricField> list = findAll();
+        Optional<ElectricField> optional = list.stream().findFirst();
+        return optional.orElse(null);
+    }
+
+    @Cacheable(cacheNames = "ElectricField", key = "#electricFieldList")
+    public ElectricField findByStationCode(String stationCode) {
+        List<ElectricField> list = findAll();
+        Optional<ElectricField> optional = list.stream().filter(t -> t.getStationCode().equals(stationCode)).findFirst();
+        return optional.orElse(null);
+    }
+
+    @Cacheable(cacheNames = "ElectricField", key = "#electricFieldList")
+    public List<ElectricField> findAll() {
+        List<ElectricField> result = new ArrayList<>();
+        Cache cache = ehCacheCacheManager.getCache("ElectricField");
+        result = (List<ElectricField>) cache.get("list");
+        return result;
+    }
+
+    @CacheEvict(value = "ElectricField", beforeInvocation = true)
+    @CachePut(cacheNames = "ElectricField", key = "#electricFieldList")
+    private List<ElectricField> fresh() throws Exception {
+        return readImageToList(ElectricField.class);
+    }
+}

+ 30 - 0
ipfcst-spare2/src/main/java/com/jiayue/ipfcst/spare2/baseinfos/repository/EquipmentAttributeRepository.java

@@ -0,0 +1,30 @@
+package com.jiayue.ipfcst.spare2.baseinfos.repository;
+
+import com.jiayue.ipfcst.common.data.entity.EquipmentAttribute;
+import com.jiayue.ipfcst.spare2.base4.BaseRepository;
+import org.springframework.cache.annotation.CacheEvict;
+import org.springframework.cache.annotation.CachePut;
+import org.springframework.cache.annotation.Cacheable;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+@Repository
+public class EquipmentAttributeRepository extends BaseRepository {
+
+    @Cacheable(cacheNames = "EquipmentAttribute", key = "#equipmentAttributeList")
+    public EquipmentAttribute findById() {
+        return null;
+    }
+
+    @Cacheable(cacheNames = "EquipmentAttribute", key = "#equipmentAttributeList")
+    public List<EquipmentAttribute> findAll() {
+        return null;
+    }
+
+    @CacheEvict(value = "EquipmentAttribute", beforeInvocation = true)
+    @CachePut(cacheNames = "EquipmentAttribute", key = "#equipmentAttributeList")
+    private List<EquipmentAttribute> fresh() throws Exception {
+        return readImageToList(EquipmentAttribute.class);
+    }
+}

+ 30 - 0
ipfcst-spare2/src/main/java/com/jiayue/ipfcst/spare2/baseinfos/repository/Gather104TcpTunnelInfoRepository.java

@@ -0,0 +1,30 @@
+package com.jiayue.ipfcst.spare2.baseinfos.repository;
+
+import com.jiayue.ipfcst.common.data.entity.gathertunnelinfo.Gather104TcpTunnelInfo;
+import com.jiayue.ipfcst.spare2.base4.BaseRepository;
+import org.springframework.cache.annotation.CacheEvict;
+import org.springframework.cache.annotation.CachePut;
+import org.springframework.cache.annotation.Cacheable;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+@Repository
+public class Gather104TcpTunnelInfoRepository extends BaseRepository {
+
+    @Cacheable(cacheNames = "Gather104TcpTunnelInfo", key = "#gather104TcpTunnelInfoList")
+    public Gather104TcpTunnelInfo findById() {
+        return null;
+    }
+
+    @Cacheable(cacheNames = "Gather104TcpTunnelInfo", key = "#gather104TcpTunnelInfoList")
+    public List<Gather104TcpTunnelInfo> findAll() {
+        return null;
+    }
+
+    @CacheEvict(value = "Gather104TcpTunnelInfo", beforeInvocation = true)
+    @CachePut(cacheNames = "Gather104TcpTunnelInfo", key = "#gather104TcpTunnelInfoList")
+    private List<Gather104TcpTunnelInfo> fresh() throws Exception {
+        return readImageToList(Gather104TcpTunnelInfo.class);
+    }
+}

+ 30 - 0
ipfcst-spare2/src/main/java/com/jiayue/ipfcst/spare2/baseinfos/repository/InitJobClassRepository.java

@@ -0,0 +1,30 @@
+package com.jiayue.ipfcst.spare2.baseinfos.repository;
+
+import com.jiayue.ipfcst.common.data.entity.InitJobClass;
+import com.jiayue.ipfcst.spare2.base4.BaseRepository;
+import org.springframework.cache.annotation.CacheEvict;
+import org.springframework.cache.annotation.CachePut;
+import org.springframework.cache.annotation.Cacheable;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+@Repository
+public class InitJobClassRepository extends BaseRepository {
+
+    @Cacheable(cacheNames = "InitJobClass", key = "#initJobClassList")
+    public InitJobClass findById() {
+        return null;
+    }
+
+    @Cacheable(cacheNames = "InitJobClass", key = "#initJobClassList")
+    public List<InitJobClass> findAll() {
+        return null;
+    }
+
+    @CacheEvict(value = "InitJobClass", beforeInvocation = true)
+    @CachePut(cacheNames = "InitJobClass", key = "#initJobClassList")
+    private List<InitJobClass> fresh() throws Exception {
+        return readImageToList(InitJobClass.class);
+    }
+}

+ 30 - 0
ipfcst-spare2/src/main/java/com/jiayue/ipfcst/spare2/baseinfos/repository/InverterInfoRepository.java

@@ -0,0 +1,30 @@
+package com.jiayue.ipfcst.spare2.baseinfos.repository;
+
+import com.jiayue.ipfcst.common.data.entity.InverterInfo;
+import com.jiayue.ipfcst.spare2.base4.BaseRepository;
+import org.springframework.cache.annotation.CacheEvict;
+import org.springframework.cache.annotation.CachePut;
+import org.springframework.cache.annotation.Cacheable;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+@Repository
+public class InverterInfoRepository extends BaseRepository {
+
+    @Cacheable(cacheNames = "InverterInfo", key = "#inverterInfoList")
+    public InverterInfo findById() {
+        return null;
+    }
+
+    @Cacheable(cacheNames = "InverterInfo", key = "#inverterInfoList")
+    public List<InverterInfo> findAll() {
+        return null;
+    }
+
+    @CacheEvict(value = "InverterInfo", beforeInvocation = true)
+    @CachePut(cacheNames = "InverterInfo", key = "#inverterInfoList")
+    private List<InverterInfo> fresh() throws Exception {
+        return readImageToList(InverterInfo.class);
+    }
+}

+ 30 - 0
ipfcst-spare2/src/main/java/com/jiayue/ipfcst/spare2/baseinfos/repository/ProtocolGatherDataPointRepository.java

@@ -0,0 +1,30 @@
+package com.jiayue.ipfcst.spare2.baseinfos.repository;
+
+import com.jiayue.ipfcst.common.data.entity.ProtocolGatherDataPoint;
+import com.jiayue.ipfcst.spare2.base4.BaseRepository;
+import org.springframework.cache.annotation.CacheEvict;
+import org.springframework.cache.annotation.CachePut;
+import org.springframework.cache.annotation.Cacheable;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+@Repository
+public class ProtocolGatherDataPointRepository extends BaseRepository {
+
+    @Cacheable(cacheNames = "ProtocolGatherDataPoint", key = "#protocolGatherDataPointList")
+    public ProtocolGatherDataPoint findById() {
+        return null;
+    }
+
+    @Cacheable(cacheNames = "ProtocolGatherDataPoint", key = "#protocolGatherDataPointList")
+    public List<ProtocolGatherDataPoint> findAll() {
+        return null;
+    }
+
+    @CacheEvict(value = "ProtocolGatherDataPoint", beforeInvocation = true)
+    @CachePut(cacheNames = "ProtocolGatherDataPoint", key = "#protocolGatherDataPointList")
+    private List<ProtocolGatherDataPoint> fresh() throws Exception {
+        return readImageToList(ProtocolGatherDataPoint.class);
+    }
+}

+ 30 - 0
ipfcst-spare2/src/main/java/com/jiayue/ipfcst/spare2/baseinfos/repository/PvModuleModelRepository.java

@@ -0,0 +1,30 @@
+package com.jiayue.ipfcst.spare2.baseinfos.repository;
+
+import com.jiayue.ipfcst.common.data.entity.PvModuleModel;
+import com.jiayue.ipfcst.spare2.base4.BaseRepository;
+import org.springframework.cache.annotation.CacheEvict;
+import org.springframework.cache.annotation.CachePut;
+import org.springframework.cache.annotation.Cacheable;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+@Repository
+public class PvModuleModelRepository extends BaseRepository {
+
+    @Cacheable(cacheNames = "PvModuleModel", key = "#pvModuleModelList")
+    public PvModuleModel findById() {
+        return null;
+    }
+
+    @Cacheable(cacheNames = "PvModuleModel", key = "#pvModuleModelList")
+    public List<PvModuleModel> findAll() {
+        return null;
+    }
+
+    @CacheEvict(value = "PvModuleModel", beforeInvocation = true)
+    @CachePut(cacheNames = "PvModuleModel", key = "#pvModuleModelList")
+    private List<PvModuleModel> fresh() throws Exception {
+        return readImageToList(PvModuleModel.class);
+    }
+}

+ 31 - 0
ipfcst-spare2/src/main/java/com/jiayue/ipfcst/spare2/baseinfos/repository/QuartzRepository.java

@@ -0,0 +1,31 @@
+package com.jiayue.ipfcst.spare2.baseinfos.repository;
+
+import com.jiayue.ipfcst.common.data.entity.ElectricField;
+import com.jiayue.ipfcst.common.data.entity.Quartz;
+import com.jiayue.ipfcst.spare2.base4.BaseRepository;
+import org.springframework.cache.annotation.CacheEvict;
+import org.springframework.cache.annotation.CachePut;
+import org.springframework.cache.annotation.Cacheable;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+@Repository
+public class QuartzRepository extends BaseRepository {
+
+    @Cacheable(cacheNames = "Quartz", key = "#quartzList")
+    public Quartz findById() {
+        return null;
+    }
+
+    @Cacheable(cacheNames = "Quartz", key = "#quartzList")
+    public List<Quartz> findAll() {
+        return null;
+    }
+
+    @CacheEvict(value = "ElectricField", beforeInvocation = true)
+    @CachePut(cacheNames = "ElectricField", key = "#electricFieldList")
+    private List<ElectricField> fresh() throws Exception {
+        return readImageToList(ElectricField.class);
+    }
+}

+ 30 - 0
ipfcst-spare2/src/main/java/com/jiayue/ipfcst/spare2/baseinfos/repository/SysParameterRepository.java

@@ -0,0 +1,30 @@
+package com.jiayue.ipfcst.spare2.baseinfos.repository;
+
+import com.jiayue.ipfcst.common.data.entity.SysParameter;
+import com.jiayue.ipfcst.spare2.base4.BaseRepository;
+import org.springframework.cache.annotation.CacheEvict;
+import org.springframework.cache.annotation.CachePut;
+import org.springframework.cache.annotation.Cacheable;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+@Repository
+public class SysParameterRepository extends BaseRepository {
+
+    @Cacheable(cacheNames = "SysParameter", key = "#sysParameterList")
+    public SysParameter findById() {
+        return null;
+    }
+
+    @Cacheable(cacheNames = "SysParameter", key = "#sysParameterList")
+    public List<SysParameter> findAll() {
+        return null;
+    }
+
+    @CacheEvict(value = "SysParameter", beforeInvocation = true)
+    @CachePut(cacheNames = "SysParameter", key = "#sysParameterList")
+    private List<SysParameter> fresh() throws Exception {
+        return readImageToList(SysParameter.class);
+    }
+}

+ 30 - 0
ipfcst-spare2/src/main/java/com/jiayue/ipfcst/spare2/baseinfos/repository/UploadFileChannelRepository.java

@@ -0,0 +1,30 @@
+package com.jiayue.ipfcst.spare2.baseinfos.repository;
+
+import com.jiayue.ipfcst.common.data.entity.UploadFileChannel;
+import com.jiayue.ipfcst.spare2.base4.BaseRepository;
+import org.springframework.cache.annotation.CacheEvict;
+import org.springframework.cache.annotation.CachePut;
+import org.springframework.cache.annotation.Cacheable;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+@Repository
+public class UploadFileChannelRepository extends BaseRepository {
+
+    @Cacheable(cacheNames = "UploadFileChannel", key = "#uploadFileChannelList")
+    public UploadFileChannel findById() {
+        return null;
+    }
+
+    @Cacheable(cacheNames = "UploadFileChannel", key = "#uploadFileChannelList")
+    public List<UploadFileChannel> findAll() {
+        return null;
+    }
+
+    @CacheEvict(value = "UploadFileChannel", beforeInvocation = true)
+    @CachePut(cacheNames = "UploadFileChannel", key = "#uploadFileChannelList")
+    private List<UploadFileChannel> fresh() throws Exception {
+        return readImageToList(UploadFileChannel.class);
+    }
+}

+ 30 - 0
ipfcst-spare2/src/main/java/com/jiayue/ipfcst/spare2/baseinfos/repository/UploadFileCodeRepository.java

@@ -0,0 +1,30 @@
+package com.jiayue.ipfcst.spare2.baseinfos.repository;
+
+import com.jiayue.ipfcst.common.data.entity.UploadFileCode;
+import com.jiayue.ipfcst.spare2.base4.BaseRepository;
+import org.springframework.cache.annotation.CacheEvict;
+import org.springframework.cache.annotation.CachePut;
+import org.springframework.cache.annotation.Cacheable;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+@Repository
+public class UploadFileCodeRepository extends BaseRepository {
+
+    @Cacheable(cacheNames = "UploadFileCode", key = "#uploadFileCodeList")
+    public UploadFileCode findById() {
+        return null;
+    }
+
+    @Cacheable(cacheNames = "UploadFileCode", key = "#uploadFileCodeList")
+    public List<UploadFileCode> findAll() {
+        return null;
+    }
+
+    @CacheEvict(value = "UploadFileCode", beforeInvocation = true)
+    @CachePut(cacheNames = "UploadFileCode", key = "#uploadFileCodeList")
+    private List<UploadFileCode> fresh() throws Exception {
+        return readImageToList(UploadFileCode.class);
+    }
+}

+ 30 - 0
ipfcst-spare2/src/main/java/com/jiayue/ipfcst/spare2/baseinfos/repository/UploadObjectRepository.java

@@ -0,0 +1,30 @@
+package com.jiayue.ipfcst.spare2.baseinfos.repository;
+
+import com.jiayue.ipfcst.common.data.entity.UploadObject;
+import com.jiayue.ipfcst.spare2.base4.BaseRepository;
+import org.springframework.cache.annotation.CacheEvict;
+import org.springframework.cache.annotation.CachePut;
+import org.springframework.cache.annotation.Cacheable;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+@Repository
+public class UploadObjectRepository extends BaseRepository {
+
+    @Cacheable(cacheNames = "UploadObject", key = "#uploadObjectList")
+    public UploadObject findById() {
+        return null;
+    }
+
+    @Cacheable(cacheNames = "UploadObject", key = "#uploadObjectList")
+    public List<UploadObject> findAll() {
+        return null;
+    }
+
+    @CacheEvict(value = "UploadObject", beforeInvocation = true)
+    @CachePut(cacheNames = "UploadObject", key = "#uploadObjectList")
+    private List<UploadObject> fresh() throws Exception {
+        return readImageToList(UploadObject.class);
+    }
+}

+ 30 - 0
ipfcst-spare2/src/main/java/com/jiayue/ipfcst/spare2/baseinfos/repository/WeatherStationInfoRepository.java

@@ -0,0 +1,30 @@
+package com.jiayue.ipfcst.spare2.baseinfos.repository;
+
+import com.jiayue.ipfcst.common.data.entity.WeatherStationInfo;
+import com.jiayue.ipfcst.spare2.base4.BaseRepository;
+import org.springframework.cache.annotation.CacheEvict;
+import org.springframework.cache.annotation.CachePut;
+import org.springframework.cache.annotation.Cacheable;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+@Repository
+public class WeatherStationInfoRepository extends BaseRepository {
+
+    @Cacheable(cacheNames = "WeatherStationInfo", key = "#weatherStationInfoList")
+    public WeatherStationInfo findById() {
+        return null;
+    }
+
+    @Cacheable(cacheNames = "WeatherStationInfo", key = "#weatherStationInfoList")
+    public List<WeatherStationInfo> findAll() {
+        return null;
+    }
+
+    @CacheEvict(value = "WeatherStationInfo", beforeInvocation = true)
+    @CachePut(cacheNames = "WeatherStationInfo", key = "#weatherStationInfoList")
+    private List<WeatherStationInfo> fresh() throws Exception {
+        return readImageToList(WeatherStationInfo.class);
+    }
+}

+ 30 - 0
ipfcst-spare2/src/main/java/com/jiayue/ipfcst/spare2/baseinfos/repository/WindTowerInfoRepository.java

@@ -0,0 +1,30 @@
+package com.jiayue.ipfcst.spare2.baseinfos.repository;
+
+import com.jiayue.ipfcst.common.data.entity.WindTowerInfo;
+import com.jiayue.ipfcst.spare2.base4.BaseRepository;
+import org.springframework.cache.annotation.CacheEvict;
+import org.springframework.cache.annotation.CachePut;
+import org.springframework.cache.annotation.Cacheable;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+@Repository
+public class WindTowerInfoRepository extends BaseRepository {
+
+    @Cacheable(cacheNames = "WindTowerInfo", key = "#windTowerInfoList")
+    public WindTowerInfo findById() {
+        return null;
+    }
+
+    @Cacheable(cacheNames = "WindTowerInfo", key = "#windTowerInfoList")
+    public List<WindTowerInfo> findAll() {
+        return null;
+    }
+
+    @CacheEvict(value = "WindTowerInfo", beforeInvocation = true)
+    @CachePut(cacheNames = "WindTowerInfo", key = "#windTowerInfoList")
+    private List<WindTowerInfo> fresh() throws Exception {
+        return readImageToList(WindTowerInfo.class);
+    }
+}

+ 30 - 0
ipfcst-spare2/src/main/java/com/jiayue/ipfcst/spare2/baseinfos/repository/WindTurbineInfoRepository.java

@@ -0,0 +1,30 @@
+package com.jiayue.ipfcst.spare2.baseinfos.repository;
+
+import com.jiayue.ipfcst.common.data.entity.WindTurbineInfo;
+import com.jiayue.ipfcst.spare2.base4.BaseRepository;
+import org.springframework.cache.annotation.CacheEvict;
+import org.springframework.cache.annotation.CachePut;
+import org.springframework.cache.annotation.Cacheable;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+@Repository
+public class WindTurbineInfoRepository extends BaseRepository {
+
+    @Cacheable(cacheNames = "WindTurbineInfo", key = "#windTurbineInfoList")
+    public WindTurbineInfo findById() {
+        return null;
+    }
+
+    @Cacheable(cacheNames = "WindTurbineInfo", key = "#windTurbineInfoList")
+    public List<WindTurbineInfo> findAll() {
+        return null;
+    }
+
+    @CacheEvict(value = "WindTurbineInfo", beforeInvocation = true)
+    @CachePut(cacheNames = "WindTurbineInfo", key = "#windTurbineInfoList")
+    private List<WindTurbineInfo> fresh() throws Exception {
+        return readImageToList(WindTurbineInfo.class);
+    }
+}

+ 28 - 0
ipfcst-spare2/src/main/java/com/jiayue/ipfcst/spare2/baseinfos/service/AGC_AVCInfoService.java

@@ -0,0 +1,28 @@
+package com.jiayue.ipfcst.spare2.baseinfos.service;
+
+import com.jiayue.ipfcst.common.data.entity.AGC_AVCInfo;
+import com.jiayue.ipfcst.spare2.base4.BaseService;
+import com.jiayue.ipfcst.spare2.baseinfos.repository.AGC_AVCInfoRepository;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+@Slf4j
+public class AGC_AVCInfoService extends BaseService {
+
+    @Autowired
+    AGC_AVCInfoRepository agcAvcInfoRepository;
+
+    public AGC_AVCInfo findById() {
+        return agcAvcInfoRepository.findById();
+    }
+
+    public List<AGC_AVCInfo> findAll() {
+        return agcAvcInfoRepository.findAll();
+    }
+
+
+}

+ 28 - 0
ipfcst-spare2/src/main/java/com/jiayue/ipfcst/spare2/baseinfos/service/BoosterStationInfoService.java

@@ -0,0 +1,28 @@
+package com.jiayue.ipfcst.spare2.baseinfos.service;
+
+import com.jiayue.ipfcst.common.data.entity.BoosterStationInfo;
+import com.jiayue.ipfcst.spare2.base4.BaseService;
+import com.jiayue.ipfcst.spare2.baseinfos.repository.BoosterStationInfoRepository;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+@Slf4j
+public class BoosterStationInfoService extends BaseService {
+
+    @Autowired
+    BoosterStationInfoRepository boosterStationInfoRepository;
+
+    public BoosterStationInfo findById() {
+        return boosterStationInfoRepository.findById();
+    }
+
+    public List<BoosterStationInfo> findAll() {
+        return boosterStationInfoRepository.findAll();
+    }
+
+
+}

+ 32 - 0
ipfcst-spare2/src/main/java/com/jiayue/ipfcst/spare2/baseinfos/service/ElectricFieldService.java

@@ -0,0 +1,32 @@
+package com.jiayue.ipfcst.spare2.baseinfos.service;
+
+import com.jiayue.ipfcst.common.data.entity.ElectricField;
+import com.jiayue.ipfcst.spare2.base4.BaseService;
+import com.jiayue.ipfcst.spare2.baseinfos.repository.ElectricFieldRepository;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+@Slf4j
+public class ElectricFieldService extends BaseService {
+
+    @Autowired
+    ElectricFieldRepository electricFieldRepository;
+
+    public ElectricField findFirst() {
+        return electricFieldRepository.findFirst();
+    }
+
+    public ElectricField findById(String stationCode) {
+        return electricFieldRepository.findByStationCode(stationCode);
+    }
+
+    public List<ElectricField> findAll() {
+        return electricFieldRepository.findAll();
+    }
+
+
+}

+ 28 - 0
ipfcst-spare2/src/main/java/com/jiayue/ipfcst/spare2/baseinfos/service/EquipmentAttributeService.java

@@ -0,0 +1,28 @@
+package com.jiayue.ipfcst.spare2.baseinfos.service;
+
+import com.jiayue.ipfcst.common.data.entity.EquipmentAttribute;
+import com.jiayue.ipfcst.spare2.base4.BaseService;
+import com.jiayue.ipfcst.spare2.baseinfos.repository.EquipmentAttributeRepository;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+@Slf4j
+public class EquipmentAttributeService extends BaseService {
+
+    @Autowired
+    EquipmentAttributeRepository EquipmentAttributeRepository;
+
+    public EquipmentAttribute findById() {
+        return EquipmentAttributeRepository.findById();
+    }
+
+    public List<EquipmentAttribute> findAll() {
+        return EquipmentAttributeRepository.findAll();
+    }
+
+
+}

+ 28 - 0
ipfcst-spare2/src/main/java/com/jiayue/ipfcst/spare2/baseinfos/service/Gather104TcpTunnelInfoService.java

@@ -0,0 +1,28 @@
+package com.jiayue.ipfcst.spare2.baseinfos.service;
+
+import com.jiayue.ipfcst.common.data.entity.gathertunnelinfo.Gather104TcpTunnelInfo;
+import com.jiayue.ipfcst.spare2.base4.BaseService;
+import com.jiayue.ipfcst.spare2.baseinfos.repository.Gather104TcpTunnelInfoRepository;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+@Slf4j
+public class Gather104TcpTunnelInfoService extends BaseService {
+
+    @Autowired
+    Gather104TcpTunnelInfoRepository gather104TcpTunnelInfoRepository;
+
+    public Gather104TcpTunnelInfo findById() {
+        return gather104TcpTunnelInfoRepository.findById();
+    }
+
+    public List<Gather104TcpTunnelInfo> findAll() {
+        return gather104TcpTunnelInfoRepository.findAll();
+    }
+
+
+}

+ 27 - 0
ipfcst-spare2/src/main/java/com/jiayue/ipfcst/spare2/baseinfos/service/InitJobClassService.java

@@ -0,0 +1,27 @@
+package com.jiayue.ipfcst.spare2.baseinfos.service;
+
+import com.jiayue.ipfcst.common.data.entity.InitJobClass;
+import com.jiayue.ipfcst.spare2.base4.BaseService;
+import com.jiayue.ipfcst.spare2.baseinfos.repository.InitJobClassRepository;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+@Slf4j
+public class InitJobClassService extends BaseService {
+
+    @Autowired
+    InitJobClassRepository initJobClassRepository;
+
+    public InitJobClass findById() {
+        return initJobClassRepository.findById();
+    }
+
+    public List<InitJobClass> findAll() {
+        return initJobClassRepository.findAll();
+    }
+
+}

+ 28 - 0
ipfcst-spare2/src/main/java/com/jiayue/ipfcst/spare2/baseinfos/service/InverterInfoService.java

@@ -0,0 +1,28 @@
+package com.jiayue.ipfcst.spare2.baseinfos.service;
+
+import com.jiayue.ipfcst.common.data.entity.InverterInfo;
+import com.jiayue.ipfcst.spare2.base4.BaseService;
+import com.jiayue.ipfcst.spare2.baseinfos.repository.InverterInfoRepository;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+@Slf4j
+public class InverterInfoService extends BaseService {
+
+    @Autowired
+    InverterInfoRepository inverterInfoRepository;
+
+    public InverterInfo findById() {
+        return inverterInfoRepository.findById();
+    }
+
+    public List<InverterInfo> findAll() {
+        return inverterInfoRepository.findAll();
+    }
+
+
+}

+ 28 - 0
ipfcst-spare2/src/main/java/com/jiayue/ipfcst/spare2/baseinfos/service/ProtocolGatherDataPointService.java

@@ -0,0 +1,28 @@
+package com.jiayue.ipfcst.spare2.baseinfos.service;
+
+import com.jiayue.ipfcst.common.data.entity.ProtocolGatherDataPoint;
+import com.jiayue.ipfcst.spare2.base4.BaseService;
+import com.jiayue.ipfcst.spare2.baseinfos.repository.ProtocolGatherDataPointRepository;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+@Slf4j
+public class ProtocolGatherDataPointService extends BaseService {
+
+    @Autowired
+    ProtocolGatherDataPointRepository protocolGatherDataPointRepository;
+
+    public ProtocolGatherDataPoint findById() {
+        return protocolGatherDataPointRepository.findById();
+    }
+
+    public List<ProtocolGatherDataPoint> findAll() {
+        return protocolGatherDataPointRepository.findAll();
+    }
+
+
+}

+ 28 - 0
ipfcst-spare2/src/main/java/com/jiayue/ipfcst/spare2/baseinfos/service/PvModuleModelService.java

@@ -0,0 +1,28 @@
+package com.jiayue.ipfcst.spare2.baseinfos.service;
+
+import com.jiayue.ipfcst.common.data.entity.PvModuleModel;
+import com.jiayue.ipfcst.spare2.base4.BaseService;
+import com.jiayue.ipfcst.spare2.baseinfos.repository.PvModuleModelRepository;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+@Slf4j
+public class PvModuleModelService extends BaseService {
+
+    @Autowired
+    PvModuleModelRepository pvModuleModelRepository;
+
+    public PvModuleModel findById() {
+        return pvModuleModelRepository.findById();
+    }
+
+    public List<PvModuleModel> findAll() {
+        return pvModuleModelRepository.findAll();
+    }
+
+
+}

+ 28 - 0
ipfcst-spare2/src/main/java/com/jiayue/ipfcst/spare2/baseinfos/service/QuartzService.java

@@ -0,0 +1,28 @@
+package com.jiayue.ipfcst.spare2.baseinfos.service;
+
+import com.jiayue.ipfcst.common.data.entity.Quartz;
+import com.jiayue.ipfcst.spare2.base4.BaseService;
+import com.jiayue.ipfcst.spare2.baseinfos.repository.QuartzRepository;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+@Slf4j
+public class QuartzService extends BaseService {
+
+    @Autowired
+    QuartzRepository quartzRepository;
+
+    public Quartz findById() {
+        return quartzRepository.findById();
+    }
+
+    public List<Quartz> findAll() {
+        return quartzRepository.findAll();
+    }
+
+
+}

+ 28 - 0
ipfcst-spare2/src/main/java/com/jiayue/ipfcst/spare2/baseinfos/service/SysParameterService.java

@@ -0,0 +1,28 @@
+package com.jiayue.ipfcst.spare2.baseinfos.service;
+
+import com.jiayue.ipfcst.common.data.entity.SysParameter;
+import com.jiayue.ipfcst.spare2.base4.BaseService;
+import com.jiayue.ipfcst.spare2.baseinfos.repository.SysParameterRepository;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+@Slf4j
+public class SysParameterService extends BaseService {
+
+    @Autowired
+    SysParameterRepository sysParameterRepository;
+
+    public SysParameter findById() {
+        return sysParameterRepository.findById();
+    }
+
+    public List<SysParameter> findAll() {
+        return sysParameterRepository.findAll();
+    }
+
+
+}

+ 28 - 0
ipfcst-spare2/src/main/java/com/jiayue/ipfcst/spare2/baseinfos/service/UploadFileChannelService.java

@@ -0,0 +1,28 @@
+package com.jiayue.ipfcst.spare2.baseinfos.service;
+
+import com.jiayue.ipfcst.common.data.entity.UploadFileChannel;
+import com.jiayue.ipfcst.spare2.base4.BaseService;
+import com.jiayue.ipfcst.spare2.baseinfos.repository.UploadFileChannelRepository;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+@Slf4j
+public class UploadFileChannelService extends BaseService {
+
+    @Autowired
+    UploadFileChannelRepository uploadFileChannelRepository;
+
+    public UploadFileChannel findById() {
+        return uploadFileChannelRepository.findById();
+    }
+
+    public List<UploadFileChannel> findAll() {
+        return uploadFileChannelRepository.findAll();
+    }
+
+
+}

+ 28 - 0
ipfcst-spare2/src/main/java/com/jiayue/ipfcst/spare2/baseinfos/service/UploadFileCodeService.java

@@ -0,0 +1,28 @@
+package com.jiayue.ipfcst.spare2.baseinfos.service;
+
+import com.jiayue.ipfcst.common.data.entity.UploadFileCode;
+import com.jiayue.ipfcst.spare2.base4.BaseService;
+import com.jiayue.ipfcst.spare2.baseinfos.repository.UploadFileCodeRepository;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+@Slf4j
+public class UploadFileCodeService extends BaseService {
+
+    @Autowired
+    UploadFileCodeRepository uploadFileCodeRepository;
+
+    public UploadFileCode findById() {
+        return uploadFileCodeRepository.findById();
+    }
+
+    public List<UploadFileCode> findAll() {
+        return uploadFileCodeRepository.findAll();
+    }
+
+
+}

+ 28 - 0
ipfcst-spare2/src/main/java/com/jiayue/ipfcst/spare2/baseinfos/service/UploadObiectService.java

@@ -0,0 +1,28 @@
+package com.jiayue.ipfcst.spare2.baseinfos.service;
+
+import com.jiayue.ipfcst.common.data.entity.UploadObject;
+import com.jiayue.ipfcst.spare2.base4.BaseService;
+import com.jiayue.ipfcst.spare2.baseinfos.repository.UploadObjectRepository;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+@Slf4j
+public class UploadObiectService extends BaseService {
+
+    @Autowired
+    UploadObjectRepository uploadObjectRepository;
+
+    public UploadObject findById() {
+        return uploadObjectRepository.findById();
+    }
+
+    public List<UploadObject> findAll() {
+        return uploadObjectRepository.findAll();
+    }
+
+
+}

+ 28 - 0
ipfcst-spare2/src/main/java/com/jiayue/ipfcst/spare2/baseinfos/service/WeatherStationInfoService.java

@@ -0,0 +1,28 @@
+package com.jiayue.ipfcst.spare2.baseinfos.service;
+
+import com.jiayue.ipfcst.common.data.entity.WeatherStationInfo;
+import com.jiayue.ipfcst.spare2.base4.BaseService;
+import com.jiayue.ipfcst.spare2.baseinfos.repository.WeatherStationInfoRepository;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+@Slf4j
+public class WeatherStationInfoService extends BaseService {
+
+    @Autowired
+    WeatherStationInfoRepository weatherStationInfoRepository;
+
+    public WeatherStationInfo findById() {
+        return weatherStationInfoRepository.findById();
+    }
+
+    public List<WeatherStationInfo> findAll() {
+        return weatherStationInfoRepository.findAll();
+    }
+
+
+}

+ 28 - 0
ipfcst-spare2/src/main/java/com/jiayue/ipfcst/spare2/baseinfos/service/WindTowerInfoService.java

@@ -0,0 +1,28 @@
+package com.jiayue.ipfcst.spare2.baseinfos.service;
+
+import com.jiayue.ipfcst.common.data.entity.WindTowerInfo;
+import com.jiayue.ipfcst.spare2.base4.BaseService;
+import com.jiayue.ipfcst.spare2.baseinfos.repository.WindTowerInfoRepository;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+@Slf4j
+public class WindTowerInfoService extends BaseService {
+
+    @Autowired
+    WindTowerInfoRepository windTowerInfoRepository;
+
+    public WindTowerInfo findById() {
+        return windTowerInfoRepository.findById();
+    }
+
+    public List<WindTowerInfo> findAll() {
+        return windTowerInfoRepository.findAll();
+    }
+
+
+}

+ 28 - 0
ipfcst-spare2/src/main/java/com/jiayue/ipfcst/spare2/baseinfos/service/WindTurbineInfoService.java

@@ -0,0 +1,28 @@
+package com.jiayue.ipfcst.spare2.baseinfos.service;
+
+import com.jiayue.ipfcst.common.data.entity.WindTurbineInfo;
+import com.jiayue.ipfcst.spare2.base4.BaseService;
+import com.jiayue.ipfcst.spare2.baseinfos.repository.WindTurbineInfoRepository;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+@Slf4j
+public class WindTurbineInfoService extends BaseService {
+
+    @Autowired
+    WindTurbineInfoRepository windTurbineInfoRepository;
+
+    public WindTurbineInfo findById() {
+        return windTurbineInfoRepository.findById();
+    }
+
+    public List<WindTurbineInfo> findAll() {
+        return windTurbineInfoRepository.findAll();
+    }
+
+
+}

+ 5 - 0
ipfcst-spare2/src/main/java/com/jiayue/ipfcst/spare2/constants/Constants.java

@@ -0,0 +1,5 @@
+package com.jiayue.ipfcst.spare2.constants;
+
+public class Constants {
+
+}

+ 1 - 1
ipfcst-spare2/src/main/java/com/jiayue/ipfcst/spare2/job/ConsoleCheckUpJob.java

@@ -35,7 +35,7 @@ public class ConsoleCheckUpJob {
             log.error("console程序进程未找到,将使用spare2生成文件");
             error = true;
         }
-        log.info("console程序进程查询结果:{}",CollectionUtil.join(processResult.output, " "));
+        log.info("console程序进程查询结果:{}", CollectionUtil.join(processResult.output, " "));
         //console进程存在,访问console健康接口,确认程序状态
         if (!error) {
             // 向console发送健康接口请求

+ 13 - 133
ipfcst-spare2/src/main/java/com/jiayue/ipfcst/spare2/util/FileUtil.java

@@ -1,14 +1,11 @@
 package com.jiayue.ipfcst.spare2.util;
 
+import com.jiayue.ipfcst.common.data.util.CommonDataUtil;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.io.FileUtils;
-import org.springframework.util.ResourceUtils;
 
 import java.io.File;
-import java.io.FileNotFoundException;
 import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.net.URLDecoder;
 import java.nio.file.Files;
 import java.nio.file.LinkOption;
 import java.nio.file.Path;
@@ -25,11 +22,19 @@ import java.util.Date;
  * @version 3.0
  */
 @Slf4j
-public class FileUtil {
+public class FileUtil extends CommonDataUtil {
 
-    public final static String FILEPATH = FileUtil.getFileUploadPath() + File.separator + "new";
-    public final static String BAKPATH = FileUtil.getFileUploadPath() + File.separator + "bak";
-    public final static String ERRPATH = FileUtil.getFileUploadPath() + File.separator + "err";
+    private static final String imageFileSuffix = "txt";
+
+    public static <T> String imageFileName(Class<T> clazz) {
+        String name = clazz.getSimpleName() + "." + imageFileSuffix;
+        String full = getImageFilePath() + File.separator + name;
+        File imageFile = new File(full);
+        if (!imageFile.exists()) {
+            log.error("ImageFile : {} dosen`t exist", name);
+        }
+        return name;
+    }
 
     /**
      * 移动本地文件
@@ -114,129 +119,4 @@ public class FileUtil {
         }
         return new Date().getTime();
     }
-
-    /**
-     * 获取项目根路径
-     *
-     * @return
-     */
-    public static String getResourceBasePath() {
-        // 获取跟目录
-        File path = null;
-        try {
-            path = new File(ResourceUtils.getURL("classpath:").getPath());
-
-        } catch (FileNotFoundException e) {
-            // nothing to do
-        }
-        if (path == null || !path.exists()) {
-            path = new File("");
-        }
-
-        String pathStr = path.getAbsolutePath();
-        try {
-            pathStr = URLDecoder.decode(pathStr, "UTF-8");
-        } catch (UnsupportedEncodingException e) {
-            e.printStackTrace();
-        }
-        // 如果是在eclipse中运行,则和target同级目录,如果是jar部署到服务器,则默认和jar包同级
-//    pathStr = pathStr.replace("\\target\\classes", "");
-
-        return pathStr;
-    }
-
-    /**
-     * 获取上报文件目录相对路径
-     *
-     * @return
-     */
-    public static String getFileUploadPath() {
-        return createUploadAllDir("uploadFile");
-    }
-
-    /**
-     * 获取下载文件目录相对路径
-     *
-     * @return
-     */
-    public static String getDownloadFilePath() {
-        return createUploadAllDir("downloadFile");
-    }
-
-
-    /**
-     * 获取日志目录相对路径
-     *
-     * @return
-     */
-    public static String getLogsPath() {
-        return createUploadAllDir("logs");
-    }
-
-    /**
-     * 获取系统脚本相对路径
-     *
-     * @return
-     */
-    public static String getBinPath() {
-        return createUploadAllDir("bin");
-    }
-
-    /**
-     * json数据存储相对路径
-     *
-     * @return
-     */
-    public static String getJsonPath() {
-        return createUploadAllDir("json");
-    }
-
-    /**
-     * 存储接入数据
-     *
-     * @return
-     */
-    public static String getDataPath() {
-        return createUploadAllDir("data");
-    }
-
-
-    private static String createUploadAllDir(String dir) {
-        String path = "";
-        if (System.getProperties().getProperty("file.separator").equals("\\")) {
-            path = new File(getResourceBasePath()).getParentFile().getParentFile().getParentFile().getAbsolutePath() + File.separator + dir;
-        } else {
-            path = "/home/syjy/ipfcstSingle/" + dir;
-        }
-        try {
-            path = URLDecoder.decode(path, "UTF-8");
-        } catch (UnsupportedEncodingException e) {
-            e.printStackTrace();
-        }
-        File file = new File(path);
-        if (!file.exists()) {
-            boolean b = file.mkdirs();
-            if (!b)
-                log.error("目录创建失败" + path);
-        }
-        return path;
-    }
-
-    /**
-     * 获取环境数导据出文件目录相对路径
-     *
-     * @return
-     */
-    public static String getEnvironmentalDataFile() {
-        return createUploadAllDir("environmentalDataFile");
-    }
-
-    /**
-     * 获取临时文件目录相对路径
-     *
-     * @return
-     */
-    public static String getTempFilePath() {
-        return createUploadAllDir("tempFile");
-    }
 }

+ 7 - 0
ipfcst-spare2/src/main/resources/application.yml

@@ -0,0 +1,7 @@
+server:
+  port: 9019
+spring:
+  main:
+    web-application-type: none
+logging:
+  config: classpath:logback-spare2.xml

+ 18 - 0
ipfcst-spare2/src/main/resources/assembly_base.xml

@@ -0,0 +1,18 @@
+<assembly>
+  <id>bin</id>
+  <formats>
+    <!-- zip,tar,tar.gz,tar.bz2,jar,dir,war -->
+    <format>zip</format>
+  </formats>
+  <includeBaseDirectory>false</includeBaseDirectory>
+  <fileSets>
+    <fileSet>
+      <directory>../syjy/ipfcstV3/produce/spare2/${project.version}</directory>
+      <includes>
+        <include>*.jar</include>
+        <include>application.yml</include>
+      </includes>
+      <outputDirectory>/</outputDirectory>
+    </fileSet>
+  </fileSets>
+</assembly>

+ 38 - 0
ipfcst-spare2/src/main/resources/ehcache-setting.xml

@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ehcache>
+    <!-- 指定一个文件目录,当EhCache把数据写到硬盘上时,将把数据写到这个文件目录下 -->
+    <diskStore path="java.io.tmpdir"/>
+
+    <!-- 设定缓存的默认数据过期策略 -->
+    <defaultCache
+            maxElementsInMemory="10000"
+            eternal="false"
+            overflowToDisk="true"
+            diskPersistent="false"
+            diskExpiryThreadIntervalSeconds="120"
+    />
+    <cache name="ipfcst"
+           maxElementsInMemory="10000"
+           eternal="false"
+           overflowToDisk="true"
+           diskPersistent="false"
+           diskExpiryThreadIntervalSeconds="120"
+    />
+    <cache name="searchablecache"
+           maxElementsOnDisk="200"
+           maxElementsInMemory="10000"
+           eternal="false"
+           timeToIdleSeconds="120"
+           timeToLiveSeconds="120">
+        <searchable/>
+
+    </cache>
+    <cache name="integration"
+           maxElementsInMemory="10000"
+           eternal="false"
+           overflowToDisk="true"
+           diskPersistent="false"
+           diskExpiryThreadIntervalSeconds="120"
+    />
+
+</ehcache>

+ 79 - 0
ipfcst-spare2/src/main/resources/logback-spare2.xml

@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<configuration scan="false" scanPeriod="60 seconds" debug="false"><!-- 这个是根配置文件,一定要有的
+                            scan:
+                                是当配置文件被修改后会被重新加载
+                            scanPeriod:
+                                设置监测配置文件是否有修改的时间间隔,如果没有给出时间单位,
+                                默认单位是毫秒。当scan为true时,此属性生效。默认的时间间隔为1分钟。
+                            debug:
+                                当此属性设置为true时,将打印出logback内部日志信息,实时查看logback运行状态。
+                                默认值为false。
+                             -->
+  <!-- 日志存放路径
+      下面的标签可以自己定义
+      name:相当于Map的key
+      value:就是map的value
+      ${catalina.base}是tomcat的当前路径
+      /logs:就是tomcat下的日志路径,
+      /ehrlog:如果没有目录会默认创建
+  -->
+  <property name="logbase" value="./logs/"/>
+  <!-- 时间戳:这个时间戳可以作为每日日志的名称 -->
+  <timestamp key="bySecond" datePattern="yyyy-MM-dd"/>
+  <!-- appender:
+      name相当于一个名称
+      class:确定要加载哪个类
+      encoder:一定要加 encoder ,
+      默认配置为PatternLayoutEncoder
+      patter:必填
+      ConsoleAppender:也明白是什么意思,就是输出在控制台上-->
+  <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+    <encoder>
+      <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
+      <charset>UTF-8</charset>
+    </encoder>
+  </appender>
+  <!-- 把日志存储
+      encoding:日志的编码
+      file:指定当前生成的日志文件名称
+      rollingPolicy:滚动策略
+      FileNamePattern:移动文件最后的名称,跟file标签结合使用,
+      比如file里面的内容是  1.txt
+      那么,FileNamePattern里面写的是2.txt,那么最后文件名就为2.txt
+      如果最后结尾是gz或者zip,那么,就会自动打成压缩包
+      -->
+  <appender name="logFile" class="ch.qos.logback.core.rolling.RollingFileAppender">
+    <!-- 编码 -->
+    <!--<Encoding>UTF-8</Encoding>-->
+    <!-- 按照时间来 -->
+    <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
+      <!--日志文件输出的文件名-->
+      <FileNamePattern>${logbase}/%d{yyyy-MM-dd}/ipfcst-spare2.%d{yyyy-MM-dd}.%i.log</FileNamePattern>
+      <!--日志文件保留天数-->
+      <MaxHistory>180</MaxHistory>
+      <maxFileSize>10MB</maxFileSize>
+      <totalSizeCap>1024MB</totalSizeCap>
+      <cleanHistoryOnStart>true</cleanHistoryOnStart>
+    </rollingPolicy>
+    <!-- 布局 -->
+    <encoder>
+      <!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符-->
+      <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
+      <charset>UTF-8</charset>
+    </encoder>
+    <append>false</append>
+  </appender>
+
+  <logger name="com.jiayue" level="info" additivity="true">
+    <appender-ref ref="logFile"/>
+  </logger>
+
+  <logger name="org" level="info" additivity="true">
+    <appender-ref ref="logFile"/>
+  </logger>
+
+  <root level="info">
+    <appender-ref ref="STDOUT"/>
+  </root>
+</configuration>

+ 31 - 0
ipfcst-spare2/src/main/resources/start-spare2.vm

@@ -0,0 +1,31 @@
+#!/bin/sh
+
+export basedir=/home/syjy/ipfcstV3
+export producedir=$basedir/produce
+
+export start_app_log=$basedir/logs/ipfcst_spare2.log
+
+export version="${version}"
+
+export app_path=$producedir/spare2/$version
+
+export JAVA_HOME=/home/syjy/ipfcstV3/jdk/jdk1.8.0_261
+export JRE_HOME=$JAVA_HOME/jre
+export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH
+export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH
+
+export LANG="zh_CN.UTF-8"
+export LC_ALL="zh_CN.UTF-8"
+
+#set($tempvar = '$!')
+
+cd $app_path
+echo "Starting spare2"
+if test -x $app_path/ipfcst-spare2.jar; then
+    nohup java -jar $app_path/ipfcst-spare2.jar >$start_app_log 2>&1 &
+    echo "spare2 started, PID is ${tempvar}" | sed -e "s/\b\(.\)/\u\1/g"
+else
+    echo "Couldn't find spare2 server($app_path/ipfcst-spare2.jar)"
+fi
+
+exit 0