Ver código fonte

Revert "西安信控计算服务"

This reverts commit c081f01f
shilin 2 anos atrás
pai
commit
c9bfe56aac
58 arquivos alterados com 0 adições e 7977 exclusões
  1. 0 19
      realtime/generationXa-service/src/main/java/com/gyee/generation/GenerationMain.java
  2. 0 68
      realtime/generationXa-service/src/main/java/com/gyee/generation/config/XxlJobConfig.java
  3. 0 20
      realtime/generationXa-service/src/main/java/com/gyee/generation/controller/WindpowerstationController.java
  4. 0 20
      realtime/generationXa-service/src/main/java/com/gyee/generation/controller/WindpowerstationpointnewController.java
  5. 0 20
      realtime/generationXa-service/src/main/java/com/gyee/generation/controller/WindpowerstationstandardpointController.java
  6. 0 20
      realtime/generationXa-service/src/main/java/com/gyee/generation/controller/WindturbinepowerController.java
  7. 0 20
      realtime/generationXa-service/src/main/java/com/gyee/generation/controller/WindturbinestandardpointController.java
  8. 0 20
      realtime/generationXa-service/src/main/java/com/gyee/generation/controller/WindturbinestatusdiController.java
  9. 0 20
      realtime/generationXa-service/src/main/java/com/gyee/generation/controller/WindturbinetestingpointnewController.java
  10. 0 184
      realtime/generationXa-service/src/main/java/com/gyee/generation/init/CacheContext.java
  11. 0 16
      realtime/generationXa-service/src/main/java/com/gyee/generation/mapper/auto/MeterpointMapper.java
  12. 0 16
      realtime/generationXa-service/src/main/java/com/gyee/generation/mapper/auto/MeterpointvalueMapper.java
  13. 0 16
      realtime/generationXa-service/src/main/java/com/gyee/generation/mapper/auto/ShutdowneventMapper.java
  14. 0 16
      realtime/generationXa-service/src/main/java/com/gyee/generation/mapper/auto/WindpowerstationstandardpointMapper.java
  15. 0 16
      realtime/generationXa-service/src/main/java/com/gyee/generation/mapper/auto/WindpowerstationtestingpointMapper.java
  16. 0 16
      realtime/generationXa-service/src/main/java/com/gyee/generation/mapper/auto/WindturbinepowerMapper.java
  17. 0 16
      realtime/generationXa-service/src/main/java/com/gyee/generation/mapper/auto/WindturbinestandardpointMapper.java
  18. 0 16
      realtime/generationXa-service/src/main/java/com/gyee/generation/mapper/auto/WindturbinestatusdiMapper.java
  19. 0 16
      realtime/generationXa-service/src/main/java/com/gyee/generation/mapper/auto/WindturbinetestingpointaiMapper.java
  20. 0 91
      realtime/generationXa-service/src/main/java/com/gyee/generation/model/auto/Meterpoint.java
  21. 0 74
      realtime/generationXa-service/src/main/java/com/gyee/generation/model/auto/Meterpointvalue.java
  22. 0 66
      realtime/generationXa-service/src/main/java/com/gyee/generation/model/auto/Shutdownevent.java
  23. 0 34
      realtime/generationXa-service/src/main/java/com/gyee/generation/model/auto/Windturbinepower.java
  24. 0 530
      realtime/generationXa-service/src/main/java/com/gyee/generation/service/AverageAndGeneratingService.java
  25. 0 1101
      realtime/generationXa-service/src/main/java/com/gyee/generation/service/FiveLossesService.java
  26. 0 690
      realtime/generationXa-service/src/main/java/com/gyee/generation/service/GenerationService.java
  27. 0 151
      realtime/generationXa-service/src/main/java/com/gyee/generation/service/RealtimeSpeedPowerService.java
  28. 0 82
      realtime/generationXa-service/src/main/java/com/gyee/generation/service/SafetyService.java
  29. 0 723
      realtime/generationXa-service/src/main/java/com/gyee/generation/service/StatusService.java
  30. 0 245
      realtime/generationXa-service/src/main/java/com/gyee/generation/service/TheorypowerService.java
  31. 0 16
      realtime/generationXa-service/src/main/java/com/gyee/generation/service/auto/IMeterpointService.java
  32. 0 16
      realtime/generationXa-service/src/main/java/com/gyee/generation/service/auto/IMeterpointvalueService.java
  33. 0 16
      realtime/generationXa-service/src/main/java/com/gyee/generation/service/auto/IShutdowneventService.java
  34. 0 16
      realtime/generationXa-service/src/main/java/com/gyee/generation/service/auto/IWindpowerstationstandardpointService.java
  35. 0 16
      realtime/generationXa-service/src/main/java/com/gyee/generation/service/auto/IWindpowerstationtestingpointService.java
  36. 0 16
      realtime/generationXa-service/src/main/java/com/gyee/generation/service/auto/IWindturbinepowerService.java
  37. 0 16
      realtime/generationXa-service/src/main/java/com/gyee/generation/service/auto/IWindturbinestandardpointService.java
  38. 0 16
      realtime/generationXa-service/src/main/java/com/gyee/generation/service/auto/IWindturbinestatusdiService.java
  39. 0 16
      realtime/generationXa-service/src/main/java/com/gyee/generation/service/auto/IWindturbinetestingpointaiService.java
  40. 0 20
      realtime/generationXa-service/src/main/java/com/gyee/generation/service/auto/impl/MeterpointServiceImpl.java
  41. 0 20
      realtime/generationXa-service/src/main/java/com/gyee/generation/service/auto/impl/MeterpointvalueServiceImpl.java
  42. 0 20
      realtime/generationXa-service/src/main/java/com/gyee/generation/service/auto/impl/ShutdowneventServiceImpl.java
  43. 0 20
      realtime/generationXa-service/src/main/java/com/gyee/generation/service/auto/impl/WindpowerstationstandardpointServiceImpl.java
  44. 0 20
      realtime/generationXa-service/src/main/java/com/gyee/generation/service/auto/impl/WindpowerstationtestingpointServiceImpl.java
  45. 0 20
      realtime/generationXa-service/src/main/java/com/gyee/generation/service/auto/impl/WindturbinepowerServiceImpl.java
  46. 0 20
      realtime/generationXa-service/src/main/java/com/gyee/generation/service/auto/impl/WindturbinestandardpointServiceImpl.java
  47. 0 20
      realtime/generationXa-service/src/main/java/com/gyee/generation/service/auto/impl/WindturbinestatusdiServiceImpl.java
  48. 0 20
      realtime/generationXa-service/src/main/java/com/gyee/generation/service/auto/impl/WindturbinetestingpointaiServiceImpl.java
  49. 0 202
      realtime/generationXa-service/src/main/java/com/gyee/generation/task/SaticScheduleTask.java
  50. 0 1316
      realtime/generationXa-service/src/main/java/com/gyee/generation/util/realtimesource/EdosUtil.java
  51. 0 1316
      realtime/generationXa-service/src/main/java/com/gyee/generation/util/realtimesource/EdosUtilTd.java
  52. 0 44
      realtime/generationXa-service/src/main/java/com/gyee/generation/util/redis/RedisAutoConfiguration.java
  53. 0 47
      realtime/generationXa-service/src/main/java/com/gyee/generation/util/redis/RedisConfig.java
  54. 0 51
      realtime/generationXa-service/src/main/java/com/gyee/generation/util/redis/RedisService.java
  55. 0 125
      realtime/generationXa-service/src/main/java/com/gyee/generation/util/redis/RedisServiceImpl.java
  56. 0 117
      realtime/generationXa-service/src/main/resources/application-xa.yml
  57. 0 4
      realtime/generationXa-service/src/main/resources/application.yml
  58. 0 89
      realtime/generationXa-service/src/test/java/com/gyee/generation/GenerationTest.java

+ 0 - 19
realtime/generationXa-service/src/main/java/com/gyee/generation/GenerationMain.java

@@ -1,19 +0,0 @@
-package com.gyee.generation;
-
-import org.mybatis.spring.annotation.MapperScan;
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-
-/**
- * @ClassName : GenerationMain
- * @Author : xieshengjie
- * @Date: 2022/2/28 14:55
- * @Description :
- */
-@SpringBootApplication
-@MapperScan("com.gyee.generation.mapper")
-public class GenerationMain {
-    public static void main(String[] args) {
-        SpringApplication.run(GenerationMain.class,args);
-    }
-}

+ 0 - 68
realtime/generationXa-service/src/main/java/com/gyee/generation/config/XxlJobConfig.java

@@ -1,68 +0,0 @@
-package com.gyee.generation.config;
-
-
-import com.xxl.job.core.executor.impl.XxlJobSpringExecutor;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.context.EnvironmentAware;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.PropertySource;
-import org.springframework.core.env.Environment;
-
-/**
- * xxl-job config
- *
- * @author xuxueli 2017-04-28
- */
-
-
-@Configuration
-@PropertySource("classpath:xxl-job-executor.properties")
-public class XxlJobConfig implements EnvironmentAware {
-    private Environment env;
-
-
-    @Override
-    public void setEnvironment(Environment environment) {
-        this.env=environment;
-    }
-
-    private Logger logger = LoggerFactory.getLogger(XxlJobConfig.class);
-
-
-
-    @Bean
-    public XxlJobSpringExecutor xxlJobExecutor() {
-    logger.info(">>>>>>>>>>> xxl-job config init.");
-    XxlJobSpringExecutor xxlJobSpringExecutor = new XxlJobSpringExecutor();
-    xxlJobSpringExecutor.setAdminAddresses(env.getProperty("xxl.job.admin.addresses"));
-    xxlJobSpringExecutor.setAppname(env.getProperty("xxl.job.executor.appname"));
-    xxlJobSpringExecutor.setAddress(env.getProperty("xxl.job.executor.address"));
-    xxlJobSpringExecutor.setIp(env.getProperty("xxl.job.executor.ip"));
-    xxlJobSpringExecutor.setPort(Integer.parseInt(env.getProperty("xxl.job.executor.port")));
-    xxlJobSpringExecutor.setAccessToken(env.getProperty("xxl.job.accessToken"));
-    xxlJobSpringExecutor.setLogPath(env.getProperty("xxl.job.executor.logpath"));
-    xxlJobSpringExecutor.setLogRetentionDays(Integer.parseInt(env.getProperty("xxl.job.executor.logretentiondays")));
-    return xxlJobSpringExecutor;
-    }
-
-    /**
-    * 针对多网卡、容器内部署等情况,可借助 "spring-cloud-commons" 提供的 "InetUtils" 组件灵活定制注册IP;
-    *
-    *      1、引入依赖:
-    *          <dependency>
-    *             <groupId>org.springframework.cloud</groupId>
-    *             <artifactId>spring-cloud-commons</artifactId>
-    *             <version>${version}</version>
-    *         </dependency>
-    *
-    *      2、配置文件,或者容器启动变量
-    *          spring.cloud.inetutils.preferred-networks: 'xxx.xxx.xxx.'
-    *
-    *      3、获取IP
-    *          String ip_ = inetUtils.findFirstNonLoopbackHostInfo().getIpAddress();
-    */
-
-
-}

+ 0 - 20
realtime/generationXa-service/src/main/java/com/gyee/generation/controller/WindpowerstationController.java

@@ -1,20 +0,0 @@
-package com.gyee.generation.controller;
-
-
-import org.springframework.web.bind.annotation.RequestMapping;
-
-import org.springframework.web.bind.annotation.RestController;
-
-/**
- * <p>
- *  前端控制器
- * </p>
- *
- * @author 谢生杰
- * @since 2022-02-28
- */
-@RestController
-@RequestMapping("//windpowerstation")
-public class WindpowerstationController {
-
-}

+ 0 - 20
realtime/generationXa-service/src/main/java/com/gyee/generation/controller/WindpowerstationpointnewController.java

@@ -1,20 +0,0 @@
-package com.gyee.generation.controller;
-
-
-import org.springframework.web.bind.annotation.RequestMapping;
-
-import org.springframework.web.bind.annotation.RestController;
-
-/**
- * <p>
- *  前端控制器
- * </p>
- *
- * @author 谢生杰
- * @since 2022-03-02
- */
-@RestController
-@RequestMapping("//windpowerstationpointnew")
-public class WindpowerstationpointnewController {
-
-}

+ 0 - 20
realtime/generationXa-service/src/main/java/com/gyee/generation/controller/WindpowerstationstandardpointController.java

@@ -1,20 +0,0 @@
-package com.gyee.generation.controller;
-
-
-import org.springframework.web.bind.annotation.RequestMapping;
-
-import org.springframework.web.bind.annotation.RestController;
-
-/**
- * <p>
- *  前端控制器
- * </p>
- *
- * @author 谢生杰
- * @since 2022-02-28
- */
-@RestController
-@RequestMapping("//windpowerstationstandardpoint")
-public class WindpowerstationstandardpointController {
-
-}

+ 0 - 20
realtime/generationXa-service/src/main/java/com/gyee/generation/controller/WindturbinepowerController.java

@@ -1,20 +0,0 @@
-package com.gyee.generation.controller;
-
-
-import org.springframework.web.bind.annotation.RequestMapping;
-
-import org.springframework.web.bind.annotation.RestController;
-
-/**
- * <p>
- *  前端控制器
- * </p>
- *
- * @author 谢生杰
- * @since 2022-04-26
- */
-@RestController
-@RequestMapping("//windturbinepower")
-public class WindturbinepowerController {
-
-}

+ 0 - 20
realtime/generationXa-service/src/main/java/com/gyee/generation/controller/WindturbinestandardpointController.java

@@ -1,20 +0,0 @@
-package com.gyee.generation.controller;
-
-
-import org.springframework.web.bind.annotation.RequestMapping;
-
-import org.springframework.web.bind.annotation.RestController;
-
-/**
- * <p>
- *  前端控制器
- * </p>
- *
- * @author 谢生杰
- * @since 2022-02-28
- */
-@RestController
-@RequestMapping("//windturbinestandardpoint")
-public class WindturbinestandardpointController {
-
-}

+ 0 - 20
realtime/generationXa-service/src/main/java/com/gyee/generation/controller/WindturbinestatusdiController.java

@@ -1,20 +0,0 @@
-package com.gyee.generation.controller;
-
-
-import org.springframework.web.bind.annotation.RequestMapping;
-
-import org.springframework.web.bind.annotation.RestController;
-
-/**
- * <p>
- *  前端控制器
- * </p>
- *
- * @author 谢生杰
- * @since 2022-03-28
- */
-@RestController
-@RequestMapping("//windturbinestatusdi")
-public class WindturbinestatusdiController {
-
-}

+ 0 - 20
realtime/generationXa-service/src/main/java/com/gyee/generation/controller/WindturbinetestingpointnewController.java

@@ -1,20 +0,0 @@
-package com.gyee.generation.controller;
-
-
-import org.springframework.web.bind.annotation.RequestMapping;
-
-import org.springframework.web.bind.annotation.RestController;
-
-/**
- * <p>
- *  前端控制器
- * </p>
- *
- * @author 谢生杰
- * @since 2022-03-02
- */
-@RestController
-@RequestMapping("//windturbinetestingpointnew")
-public class WindturbinetestingpointnewController {
-
-}

+ 0 - 184
realtime/generationXa-service/src/main/java/com/gyee/generation/init/CacheContext.java

@@ -1,184 +0,0 @@
-package com.gyee.generation.init;
-
-
-import com.alibaba.fastjson.JSONObject;
-import com.alibaba.fastjson.TypeReference;
-import com.gyee.common.model.StringUtils;
-import com.gyee.generation.model.auto.*;
-import com.gyee.generation.service.auto.*;
-import com.gyee.generation.util.redis.RedisService;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.boot.CommandLineRunner;
-import org.springframework.stereotype.Component;
-
-import javax.annotation.Resource;
-import java.util.*;
-import java.util.stream.Collectors;
-
-/**
- * @ClassName : CacheContext
- * @Author : xieshengjie
- * @Date: 2021/5/18 9:35
- * @Description : 缓存
- */
-@Component
-public class CacheContext implements CommandLineRunner {
-    Logger logger = LoggerFactory.getLogger(CacheContext.class);
-
-    @Resource
-    private IWindturbineService windturbineService;
-    @Resource
-    private ILineService lineService;
-    @Resource
-    private IProjectService projectService;
-    @Resource
-    private IWindpowerstationService windpowerstationService;
-    @Resource
-    private IMeterpointService meterpointService;
-    @Resource
-    private IEquipmentmodelService equipmentmodelService;
-    @Resource
-    private IWindturbinestatusdiService windturbinestatusdiService;
-    @Resource
-    private IWindturbinepowerService windturbinepowerService;
-    @Resource
-    private RedisService redisService;
-    @Value("${runWindpowerstation}")
-    private String runWindpowerstation;
-
-    public static List<Windturbine> wtls = new ArrayList<>();
-    public static List<Project> projects = new ArrayList<>();
-    public static List<Line>  lines = new ArrayList<>();
-    public static List<Windpowerstation>  wpls = new ArrayList<>();
-    public static List<Meterpoint>  meterpoints = new ArrayList<>();
-    public static Map<String,Meterpoint>  meterpointMap = new HashMap<>();
-    public static Map<String,List<Project>> wppromap = new HashMap<>();
-    public static Map<String,List<Line>> prolinemap = new HashMap<>();
-    public static Map<String,List<Windturbine>> linewtmap = new HashMap<>();
-    public static Map<String, Map<String, Windturbinetestingpointnew>> wtpAimap = new HashMap<>();// 风电机测点AI表
-    public static Map<String,Map<String, Windpowerstationpointnew>> linepointmap =new HashMap<>();
-    public static Map<String,Map<String, Windpowerstationpointnew>> propointmap =new HashMap<>();
-    public static Map<String,Map<String, Windpowerstationpointnew>> wppointmap =new HashMap<>();
-    public static Map<String,Project> proMap = new HashMap<>();
-    public static Map<String,List<Windturbinestatusdi>> statusMap = new HashMap<>();
-    public static Map<String,Map<Double,Double>> zbzglMap = new HashMap<>();
-    public static Map<String,Equipmentmodel> modelMap = new HashMap<>();
-    public static Map<String,Map<Double,Double>> zzsglMap = new HashMap<>();
-    public static Map<String,Double> modelpower = new HashMap<>();
-    @Override
-    public void run(String... args) throws Exception {
-        logger.info("缓存开始------------------------------------------------------------");
-        List<String> runWpids = Arrays.asList(runWindpowerstation.split(","));
-        logger.info(runWpids.get(0)+"------------------"+runWpids.size());
-
-        List<Equipmentmodel> equipmentmodels = equipmentmodelService.list();
-        equipmentmodels.stream().forEach(e->{
-            modelMap.put(e.getId(),e);
-        });
-
-        wtls = windturbineService.list().stream().filter(i->runWpids.contains(i.getWindpowerstationid())).collect(Collectors.toList());
-        logger.info(wtls.size()+"");
-        wtls.forEach(wt->{
-            Equipmentmodel equipmentmodel = modelMap.get(wt.getModelid());
-            modelpower.put(wt.getId(),equipmentmodel.getPowerproduction());
-
-            String wtString = redisService.get(wt.getId());
-            Map<String, Windturbinetestingpointnew> stringWindturbinetestingpointnewMap = JSONObject.parseObject(wtString, new TypeReference<Map<String, Windturbinetestingpointnew>>() {
-            });
-            wtpAimap.put(wt.getId(),stringWindturbinetestingpointnewMap);
-
-            if (linewtmap.containsKey(wt.getLineid())){
-                linewtmap.get(wt.getLineid()).add(wt);
-            }else {
-                List<Windturbine> lines = new ArrayList<>();
-                lines.add(wt);
-                linewtmap.put(wt.getLineid(),lines);
-            }
-        });
-
-        projects = projectService.list().stream().filter(i->runWpids.contains(i.getWindpowerstationid())).collect(Collectors.toList());
-        projects.stream().forEach(p->{
-            proMap.put(p.getId(),p);
-            if (wppromap.containsKey(p.getWindpowerstationid())){
-                wppromap.get(p.getWindpowerstationid()).add(p);
-            }else {
-                List<Project> prolist = new ArrayList<>();
-                prolist.add(p);
-                wppromap.put(p.getWindpowerstationid(),prolist);
-            }
-            String pjString = redisService.get(p.getId());
-            Map<String, Windpowerstationpointnew> stringWindpowerstationpointnewMap = JSONObject.parseObject(pjString, new TypeReference<Map<String, Windpowerstationpointnew>>() {
-            });
-            propointmap.put(p.getId(),stringWindpowerstationpointnewMap);
-
-        });
-
-        lines = lineService.list().stream().filter(i-> StringUtils.isNotNull(proMap.get(i.getProjectid())) && runWpids.contains(proMap.get(i.getProjectid()).getWindpowerstationid())).collect(Collectors.toList());
-        lines.stream().forEach(l->{
-            if (prolinemap.containsKey(l.getProjectid())){
-                prolinemap.get(l.getProjectid()).add(l);
-            }else {
-                List<Line> lineList = new ArrayList<>();
-                lineList.add(l);
-                prolinemap.put(l.getProjectid(),lineList);
-            }
-            String lnString = redisService.get(l.getId());
-            Map<String, Windpowerstationpointnew> stringWindpowerstationpointnewMap = JSONObject.parseObject(lnString, new TypeReference<Map<String, Windpowerstationpointnew>>() {
-            });
-            linepointmap.put(l.getId(),stringWindpowerstationpointnewMap);
-        });
-
-        wpls = windpowerstationService.list().stream().filter(i->runWpids.contains(i.getId())).collect(Collectors.toList());;
-        meterpoints = meterpointService.list().stream().filter(i->runWpids.contains(i.getWindpowerstationid())).collect(Collectors.toList());
-        meterpoints.stream().forEach(meterpoint -> {
-            meterpointMap.put(meterpoint.getId(),meterpoint);
-        });
-
-
-        wpls.stream().forEach(wp->{
-            String wpString = redisService.get(wp.getId());
-            Map<String, Windpowerstationpointnew> stringMapMap = JSONObject.parseObject(wpString, new TypeReference<Map<String, Windpowerstationpointnew>>() {
-            });
-            wppointmap.put(wp.getId(),stringMapMap);
-        });
-
-        String sszzt = redisService.get("SSZZT");
-         statusMap = JSONObject.parseObject(sszzt, new TypeReference<Map<String,List<Windturbinestatusdi>>>() {
-        });
-
-
-
-        String zbzgl = redisService.get("ZBZGL");
-        zbzglMap = JSONObject.parseObject(zbzgl, new TypeReference<Map<String,Map<Double,Double>>>() {
-        });
-
-        List<Windturbinepower> windturbinepowerList = windturbinepowerService.list().stream().filter(windturbinepower -> runWindpowerstation.contains(windturbinepower.getWindpowerstationid())).collect(Collectors.toList());
-        windturbinepowerList.stream().forEach(w -> {
-            if (zzsglMap.containsKey(w.getWindturbineid())){
-                zzsglMap.get(w.getWindturbineid()).put(w.getSpeed(),w.getTheorypower());
-            }else {
-                Map<Double,Double> tempMap = new HashMap<>();
-                tempMap.put(w.getSpeed(),w.getTheorypower());
-                zzsglMap.put(w.getWindturbineid(),tempMap);
-            }
-
-        });
-
-//        String wpString = redisService.get("PRODUCT-WP");
-//        wppointmap = JSONObject.parseObject(wpString, new TypeReference<Map<String, Map<String, Windpowerstationpointnew>>>() {
-//        });
-//        String pjString = redisService.get("PRODUCT-PJ");
-//        propointmap = JSONObject.parseObject(pjString, new TypeReference<Map<String, Map<String, Windpowerstationpointnew>>>() {
-//        });
-//        String lnString = redisService.get("PRODUCT-LN");
-//        linepointmap = JSONObject.parseObject(lnString, new TypeReference<Map<String, Map<String, Windpowerstationpointnew>>>() {
-//        });
-
-//        String wtString = redisService.get("PRODUCT-WT");
-//        wtpAimap = JSONObject.parseObject(wtString, new TypeReference<Map<String, Map<String, Windturbinetestingpointnew>>>() {
-//        });
-        logger.info("缓存结束------------------------------------------------------------");
-    }
-}

+ 0 - 16
realtime/generationXa-service/src/main/java/com/gyee/generation/mapper/auto/MeterpointMapper.java

@@ -1,16 +0,0 @@
-package com.gyee.generation.mapper.auto;
-
-import com.gyee.generation.model.auto.Meterpoint;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-
-/**
- * <p>
- *  Mapper 接口
- * </p>
- *
- * @author 谢生杰
- * @since 2022-02-28
- */
-public interface MeterpointMapper extends BaseMapper<Meterpoint> {
-
-}

+ 0 - 16
realtime/generationXa-service/src/main/java/com/gyee/generation/mapper/auto/MeterpointvalueMapper.java

@@ -1,16 +0,0 @@
-package com.gyee.generation.mapper.auto;
-
-import com.gyee.generation.model.auto.Meterpointvalue;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-
-/**
- * <p>
- *  Mapper 接口
- * </p>
- *
- * @author 谢生杰
- * @since 2022-03-21
- */
-public interface MeterpointvalueMapper extends BaseMapper<Meterpointvalue> {
-
-}

+ 0 - 16
realtime/generationXa-service/src/main/java/com/gyee/generation/mapper/auto/ShutdowneventMapper.java

@@ -1,16 +0,0 @@
-package com.gyee.generation.mapper.auto;
-
-import com.gyee.generation.model.auto.Shutdownevent;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-
-/**
- * <p>
- *  Mapper 接口
- * </p>
- *
- * @author 谢生杰
- * @since 2022-07-29
- */
-public interface ShutdowneventMapper extends BaseMapper<Shutdownevent> {
-
-}

+ 0 - 16
realtime/generationXa-service/src/main/java/com/gyee/generation/mapper/auto/WindpowerstationstandardpointMapper.java

@@ -1,16 +0,0 @@
-package com.gyee.generation.mapper.auto;
-
-import com.gyee.generation.model.auto.Windpowerstationstandardpoint;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-
-/**
- * <p>
- *  Mapper 接口
- * </p>
- *
- * @author 谢生杰
- * @since 2022-02-28
- */
-public interface WindpowerstationstandardpointMapper extends BaseMapper<Windpowerstationstandardpoint> {
-
-}

+ 0 - 16
realtime/generationXa-service/src/main/java/com/gyee/generation/mapper/auto/WindpowerstationtestingpointMapper.java

@@ -1,16 +0,0 @@
-package com.gyee.generation.mapper.auto;
-
-import com.gyee.generation.model.auto.Windpowerstationtestingpoint;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-
-/**
- * <p>
- *  Mapper 接口
- * </p>
- *
- * @author 谢生杰
- * @since 2022-02-28
- */
-public interface WindpowerstationtestingpointMapper extends BaseMapper<Windpowerstationtestingpoint> {
-
-}

+ 0 - 16
realtime/generationXa-service/src/main/java/com/gyee/generation/mapper/auto/WindturbinepowerMapper.java

@@ -1,16 +0,0 @@
-package com.gyee.generation.mapper.auto;
-
-import com.gyee.generation.model.auto.Windturbinepower;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-
-/**
- * <p>
- *  Mapper 接口
- * </p>
- *
- * @author 谢生杰
- * @since 2022-04-26
- */
-public interface WindturbinepowerMapper extends BaseMapper<Windturbinepower> {
-
-}

+ 0 - 16
realtime/generationXa-service/src/main/java/com/gyee/generation/mapper/auto/WindturbinestandardpointMapper.java

@@ -1,16 +0,0 @@
-package com.gyee.generation.mapper.auto;
-
-import com.gyee.generation.model.auto.Windturbinestandardpoint;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-
-/**
- * <p>
- *  Mapper 接口
- * </p>
- *
- * @author 谢生杰
- * @since 2022-02-28
- */
-public interface WindturbinestandardpointMapper extends BaseMapper<Windturbinestandardpoint> {
-
-}

+ 0 - 16
realtime/generationXa-service/src/main/java/com/gyee/generation/mapper/auto/WindturbinestatusdiMapper.java

@@ -1,16 +0,0 @@
-package com.gyee.generation.mapper.auto;
-
-import com.gyee.generation.model.auto.Windturbinestatusdi;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-
-/**
- * <p>
- *  Mapper 接口
- * </p>
- *
- * @author 谢生杰
- * @since 2022-03-28
- */
-public interface WindturbinestatusdiMapper extends BaseMapper<Windturbinestatusdi> {
-
-}

+ 0 - 16
realtime/generationXa-service/src/main/java/com/gyee/generation/mapper/auto/WindturbinetestingpointaiMapper.java

@@ -1,16 +0,0 @@
-package com.gyee.generation.mapper.auto;
-
-import com.gyee.generation.model.auto.Windturbinetestingpointai;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-
-/**
- * <p>
- *  Mapper 接口
- * </p>
- *
- * @author 谢生杰
- * @since 2022-02-28
- */
-public interface WindturbinetestingpointaiMapper extends BaseMapper<Windturbinetestingpointai> {
-
-}

+ 0 - 91
realtime/generationXa-service/src/main/java/com/gyee/generation/model/auto/Meterpoint.java

@@ -1,91 +0,0 @@
-package com.gyee.generation.model.auto;
-
-import com.baomidou.mybatisplus.annotation.TableField;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import com.baomidou.mybatisplus.extension.activerecord.Model;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-
-import java.util.Date;
-
-/**
- * <p>
- * 
- * </p>
- *
- * @author 谢生杰
- * @since 2022-02-28
- */
-@Data
-@EqualsAndHashCode(callSuper = true)
-@TableName("METERPOINT")
-public class Meterpoint extends Model {
-
-    private static final long serialVersionUID = 1L;
-
-    @TableId("ID")
-    private String id;
-
-    @TableField("CODE")
-    private String code;
-
-    @TableField("NAME")
-    private String name;
-
-    @TableField("DESCRIPTION")
-    private String description;
-
-    @TableField("WINDPOWERSTATIONID")
-    private String windpowerstationid;
-
-    @TableField("PROJECTID")
-    private String projectid;
-
-    @TableField("LINEID")
-    private String lineid;
-
-    @TableField("METERTYPE")
-    private String metertype;
-
-    @TableField("METERCODE")
-    private String metercode;
-
-    @TableField("METERSORT")
-    private String metersort;
-
-    @TableField("DISPLAYTYPE")
-    private String displaytype;
-
-    @TableField("UNIFORMCODE")
-    private String uniformcode;
-
-    @TableField("MAGNIFICATION")
-    private Double magnification;
-
-    @TableField("SHORTID")
-    private String shortid;
-
-    @TableField("LONGID")
-    private String longid;
-
-    @TableField("REALTIMEID")
-    private String realtimeid;
-
-    @TableField("INITIALVALUE")
-    private Double initialvalue;
-
-    @TableField("XS")
-    private Double xs;
-
-    @TableField("MAGNIFICATIONXS")
-    private Double magnificationxs;
-
-    @TableField("OTHERVALUE")
-    private Double othervalue;
-
-    @TableField("OTHERDATE")
-    private Date otherdate;
-
-
-}

+ 0 - 74
realtime/generationXa-service/src/main/java/com/gyee/generation/model/auto/Meterpointvalue.java

@@ -1,74 +0,0 @@
-package com.gyee.generation.model.auto;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableField;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import com.baomidou.mybatisplus.extension.activerecord.Model;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-
-import java.util.Date;
-
-/**
- * <p>
- * 
- * </p>
- *
- * @author 谢生杰
- * @since 2022-03-21
- */
-@Data
-@EqualsAndHashCode(callSuper = true)
-@TableName("METERPOINTVALUE")
-public class Meterpointvalue extends Model {
-
-    private static final long serialVersionUID = 1L;
-
-    @TableId(value = "ID",type = IdType.ASSIGN_ID)
-    private Long id;
-
-    @TableField("RECORDDATE")
-    private Date recorddate;
-
-    @TableField("METERID")
-    private String meterid;
-
-    @TableField("YEAR")
-    private Double year;
-
-    @TableField("MONTH")
-    private Double month;
-
-    @TableField("DAY")
-    private Double day;
-
-    @TableField("NOW")
-    private Double now;
-
-    @TableField("TOTALVALUE")
-    private Double totalvalue;
-
-    @TableField("YEARVALUE")
-    private Double yearvalue;
-
-    @TableField("MONTHVALUE")
-    private Double monthvalue;
-
-    @TableField("DAYVALUE")
-    private Double dayvalue;
-
-    @TableField("YEAR4")
-    private Double year4;
-
-    @TableField("MONTH4")
-    private Double month4;
-
-    @TableField("DAY4")
-    private Double day4;
-
-    @TableField("NOW4")
-    private Double now4;
-
-
-}

+ 0 - 66
realtime/generationXa-service/src/main/java/com/gyee/generation/model/auto/Shutdownevent.java

@@ -1,66 +0,0 @@
-package com.gyee.generation.model.auto;
-
-import java.util.Date;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.extension.activerecord.Model;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.Value;
-import org.springframework.data.annotation.Id;
-
-/**
- * <p>
- * 
- * </p>
- *
- * @author 谢生杰
- * @since 2022-07-29
- */
-@Data
-@EqualsAndHashCode(callSuper = true)
-public class Shutdownevent extends Model {
-
-    private static final long serialVersionUID = 1L;
-    @TableId(value = "id",type = IdType.INPUT)
-    private String id;
-
-    private String windpowerstationid;
-
-    private String windturbineid;
-
-    private Date stoptime;
-
-    private Date starttime;
-
-    private Double stophours;
-
-    private Double losspower;
-
-    private String stoptypeid;
-
-    private Integer ishandle;
-
-    private String warningid;
-
-    private String projectid;
-
-    private String handleway;
-
-    private String faultview;
-
-    private Integer statuscode;
-
-    private String mainid;
-
-    private String resetrate;
-
-    private String staterate;
-
-    private String failrate;
-
-    private Integer warningrecordsid;
-
-
-}

+ 0 - 34
realtime/generationXa-service/src/main/java/com/gyee/generation/model/auto/Windturbinepower.java

@@ -1,34 +0,0 @@
-package com.gyee.generation.model.auto;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.extension.activerecord.Model;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-
-/**
- * <p>
- * 
- * </p>
- *
- * @author 谢生杰
- * @since 2022-04-26
- */
-@Data
-@EqualsAndHashCode(callSuper = true)
-public class Windturbinepower extends Model {
-
-    private static final long serialVersionUID = 1L;
-    @TableId(value = "ID",type = IdType.INPUT)
-    private String id;
-
-    private String windturbineid;
-
-    private String windpowerstationid;
-
-    private Double speed;
-
-    private Double theorypower;
-
-
-}

+ 0 - 530
realtime/generationXa-service/src/main/java/com/gyee/generation/service/AverageAndGeneratingService.java

@@ -1,530 +0,0 @@
-package com.gyee.generation.service;
-
-import com.gyee.common.contant.Contant;
-import com.gyee.common.model.PointData;
-import com.gyee.common.util.DateUtils;
-import com.gyee.generation.init.CacheContext;
-import com.gyee.generation.model.auto.*;
-import com.gyee.generation.util.realtimesource.IEdosUtil;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.stereotype.Service;
-
-import javax.annotation.Resource;
-import java.util.*;
-
-/**
- * @ClassName : AverageAndGeneratingService
- * @Author : xieshengjie
- * @Date: 2022/3/22 10:42
- * @Description : 平均风速,平均功率,SCADA发电量
- */
-@Service
-public class AverageAndGeneratingService {
-
-    private Date samedayZero;
-    private Date monthFirstZero;
-    private Date yearFirstZero;
-    private Date currentDate;
-    private List<Windpowerstation> wpls;
-    private Map<String, List<Project>> wppromap;
-    private Map<String, List<Line>> prolinemap;
-    private Map<String, List<Windturbine>> linewtmap;
-    private Date tomorrow;
-    private List<Windturbine> wtls;
-    private Map<String, Map<String, Windpowerstationpointnew>> wppointmap;
-    private Map<String, Map<String, Windpowerstationpointnew>> linepointmap;
-    private Map<String, Map<String, Windpowerstationpointnew>> propointmap;
-    private Map<String, Map<String, Windturbinetestingpointnew>> wtpAimap;
-    @Resource
-    private IEdosUtil edosUtil;
-    @Value("${typeOfElectric.direct}")
-    private String direct;
-
-
-    private void init(){
-        samedayZero = DateUtils.getSamedayZero();
-        monthFirstZero = DateUtils.getMonthFirstZero();
-        yearFirstZero = DateUtils.getYearFirstZero();
-        currentDate = DateUtils.getCurrentDate();
-        wpls = CacheContext.wpls;
-        wtls = CacheContext.wtls;
-        wppromap = CacheContext.wppromap;
-        prolinemap = CacheContext.prolinemap;
-        wppointmap = CacheContext.wppointmap;
-        linepointmap = CacheContext.linepointmap;
-        propointmap = CacheContext.propointmap;
-        wtpAimap = CacheContext.wtpAimap;
-        linewtmap = CacheContext.linewtmap;
-        tomorrow = DateUtils.addDays(samedayZero,1);
-    }
-
-    /**
-     * 保存平均风速,平均功率,scada发电量实时计算点
-     * @throws Exception
-     */
-    public  void saveAvespeedAndAvepowerAndScada() throws Exception {
-        init();
-        List<PointData> resultList = new ArrayList<>();
-        String monthbenchPoints = Contant.monthbenchPoints;
-        wpls.stream().forEach(wp->{
-            List<Project> projects = wppromap.get(wp.getId());
-            Map<String, Windpowerstationpointnew> wppointnewmap = wppointmap.get(wp.getId());
-            Windpowerstationpointnew wppointnew = wppointnewmap.get(Contant.RPJFS);
-            Windpowerstationpointnew ywppointnew = wppointnewmap.get(Contant.YPJFS);
-            Windpowerstationpointnew nwppointnew = wppointnewmap.get(Contant.NPJFS);
-            Windpowerstationpointnew powerwppointnew = wppointnewmap.get(Contant.RPJGL);
-            Windpowerstationpointnew ypowerwppointnew = wppointnewmap.get(Contant.YPJGL);
-            Windpowerstationpointnew npowerwppointnew = wppointnewmap.get(Contant.NPJGL);
-            Windpowerstationpointnew fdlwppointnew = wppointnewmap.get(Contant.RFDL);
-            Windpowerstationpointnew yfdlwppointnew = wppointnewmap.get(Contant.YFDL);
-            Windpowerstationpointnew nfdlwppointnew = wppointnewmap.get(Contant.NFDL);
-            Windpowerstationpointnew fnlylwppointnew = wppointnewmap.get(Contant.FNLYL);
-            Windpowerstationpointnew jpeyhlwppointnew = wppointnewmap.get(Contant.JPEYHL);
-            Windpowerstationpointnew jpeyhtwppointnew = wppointnewmap.get(Contant.JPEYHT);
-            Windpowerstationpointnew jybmwppointnew = wppointnewmap.get(Contant.JYBM);
-            Windpowerstationpointnew jyswppointnew = wppointnewmap.get(Contant.JYS);
-
-            List<PointData> projectavespeedList = new ArrayList<>();
-            List<PointData> yprojectavespeedList = new ArrayList<>();
-            List<PointData> nprojectavespeedList = new ArrayList<>();
-            List<PointData> projectavepowerList = new ArrayList<>();
-            List<PointData> yprojectavepowerList = new ArrayList<>();
-            List<PointData> nprojectavepowerList = new ArrayList<>();
-            List<PointData> projectfdlList = new ArrayList<>();
-            List<PointData> projectyfdlList = new ArrayList<>();
-            List<PointData> projectnfdlList = new ArrayList<>();
-            projects.stream().forEach(project -> {
-                List<Line> lines = prolinemap.get(project.getId());
-                Map<String, Windpowerstationpointnew> projectpointnewmap = propointmap.get(project.getId());
-                Windpowerstationpointnew projectpointnew = projectpointnewmap.get(Contant.RPJFS);
-                Windpowerstationpointnew yprojectpointnew = projectpointnewmap.get(Contant.YPJFS);
-                Windpowerstationpointnew nprojectpointnew = projectpointnewmap.get(Contant.NPJFS);
-                Windpowerstationpointnew powerprojectpointnew = projectpointnewmap.get(Contant.RPJGL);
-                Windpowerstationpointnew ypowerprojectpointnew = projectpointnewmap.get(Contant.YPJGL);
-                Windpowerstationpointnew npowerprojectpointnew = projectpointnewmap.get(Contant.NPJGL);
-                Windpowerstationpointnew fdlprojectpointnew = projectpointnewmap.get(Contant.RFDL);
-                Windpowerstationpointnew yfdlprojectpointnew = projectpointnewmap.get(Contant.YFDL);
-                Windpowerstationpointnew nfdlprojectpointnew = projectpointnewmap.get(Contant.NFDL);
-                Windpowerstationpointnew fnlylprojectpointnew = projectpointnewmap.get(Contant.FNLYL);
-
-                Windpowerstationpointnew jpeyhlprojectpointnew = projectpointnewmap.get(Contant.JPEYHL);
-                Windpowerstationpointnew jpeyhtprojectpointnew = projectpointnewmap.get(Contant.JPEYHT);
-                Windpowerstationpointnew jybmprojectpointnew = projectpointnewmap.get(Contant.JYBM);
-                Windpowerstationpointnew jysprojectpointnew = projectpointnewmap.get(Contant.JYS);
-
-                List<PointData> lineavespeedList = new ArrayList<>();
-                List<PointData> ylineavespeedList = new ArrayList<>();
-                List<PointData> nlineavespeedList = new ArrayList<>();
-                List<PointData> lineavepowerList = new ArrayList<>();
-                List<PointData> ylineavepowerList = new ArrayList<>();
-                List<PointData> nlineavepowerList = new ArrayList<>();
-                List<PointData> linefdlList = new ArrayList<>();
-                List<PointData> ylinefdlList = new ArrayList<>();
-                List<PointData> nlinefdlList = new ArrayList<>();
-                lines.stream().forEach(line -> {
-                    List<Windturbine> windturbines = linewtmap.get(line.getId());
-                    Map<String, Windpowerstationpointnew> linepointnewmap = linepointmap.get(line.getId());
-                    Windpowerstationpointnew linepointnew = linepointnewmap.get(Contant.RPJFS);
-                    Windpowerstationpointnew ylinepointnew = linepointnewmap.get(Contant.YPJFS);
-                    Windpowerstationpointnew nlinepointnew = linepointnewmap.get(Contant.NPJFS);
-                    Windpowerstationpointnew linepowerpointnew = linepointnewmap.get(Contant.RPJGL);
-                    Windpowerstationpointnew ylinepowerpointnew = linepointnewmap.get(Contant.YPJGL);
-                    Windpowerstationpointnew nlinepowerpointnew = linepointnewmap.get(Contant.NPJGL);
-                    Windpowerstationpointnew linefdlpointnew = linepointnewmap.get(Contant.RFDL);
-                    Windpowerstationpointnew ylinefdlpointnew = linepointnewmap.get(Contant.YFDL);
-                    Windpowerstationpointnew nlinefdlpointnew = linepointnewmap.get(Contant.NFDL);
-                    Windpowerstationpointnew linefnlylpointnew = linepointnewmap.get(Contant.FNLYL);
-
-                    Windpowerstationpointnew jpeyhlpointnew = linepointnewmap.get(Contant.JPEYHL);
-                    Windpowerstationpointnew jpeyhtpointnew = linepointnewmap.get(Contant.JPEYHT);
-                    Windpowerstationpointnew jybmpointnew = linepointnewmap.get(Contant.JYBM);
-                    Windpowerstationpointnew jyspointnew = linepointnewmap.get(Contant.JYS);
-
-                    List<PointData> wtavespeedList = new ArrayList<>();
-                    List<PointData> ywtavespeedList = new ArrayList<>();
-                    List<PointData> nwtavespeedList = new ArrayList<>();
-                    List<PointData> wtavepowerList = new ArrayList<>();
-                    List<PointData> ywtavepowerList = new ArrayList<>();
-                    List<PointData> nwtavepowerList = new ArrayList<>();
-                    List<PointData> rfdlList = new ArrayList<>();
-                    List<PointData> yfdlList = new ArrayList<>();
-                    List<PointData> nfdlList = new ArrayList<>();
-
-                    windturbines.stream().forEach(wt->{
-                        Map<String, Windturbinetestingpointnew> windturbinetestingpointnewMap = wtpAimap.get(wt.getId());
-                        Windturbinetestingpointnew aveSpeedPoint = windturbinetestingpointnewMap.get(Contant.RPJFS);
-                        Windturbinetestingpointnew monthAveSpeedPoint = windturbinetestingpointnewMap.get(Contant.YPJFS);
-                        Windturbinetestingpointnew yearAveSpeedPoint = windturbinetestingpointnewMap.get(Contant.NPJFS);
-                        Windturbinetestingpointnew fjssfs = windturbinetestingpointnewMap.get(Contant.AI022);
-                        Windturbinetestingpointnew avePowerPoint = windturbinetestingpointnewMap.get(Contant.RPJGL);
-                        Windturbinetestingpointnew yavePowerPoint = windturbinetestingpointnewMap.get(Contant.YPJGL);
-                        Windturbinetestingpointnew navePowerPoint = windturbinetestingpointnewMap.get(Contant.NPJGL);
-                        Windturbinetestingpointnew fjssgl = windturbinetestingpointnewMap.get(Contant.AI130);
-                        Windturbinetestingpointnew ai064 = windturbinetestingpointnewMap.get(Contant.AI064);
-                        Windturbinetestingpointnew fjfdl = windturbinetestingpointnewMap.get(Contant.RFDL);
-                        Windturbinetestingpointnew fjyfdl = windturbinetestingpointnewMap.get(Contant.YFDL);
-                        Windturbinetestingpointnew fjnfdl = windturbinetestingpointnewMap.get(Contant.NFDL);
-                        Windturbinetestingpointnew ai138 = windturbinetestingpointnewMap.get(Contant.AI138);
-                        Windturbinetestingpointnew ai139 = windturbinetestingpointnewMap.get(Contant.AI139);
-                        try {
-                            //算发电量
-                            Double rfdl = 0.0;
-                            Double yfdl = 0.0;
-                            Double nfdl = 0.0;
-                            if (direct.contains(wt.getProjectid())){
-                                rfdl = edosUtil.getSectionData(ai064,tomorrow.getTime()).getPointValueInDouble();
-                                yfdl = edosUtil.getSectionData(ai138,tomorrow.getTime()).getPointValueInDouble();
-                                nfdl = edosUtil.getSectionData(ai139,tomorrow.getTime()).getPointValueInDouble();
-                            }else{
-                                Double currentValue = 0.0;
-                                Double samedayValue = 0.0;
-                                Double monthFirstValue = 0.0;
-                                Double yearFirstValue = 0.0;
-                                PointData realData = edosUtil.getSectionData(ai064,tomorrow.getTime());
-                                currentValue = realData.getPointValueInDouble();
-                                samedayValue = edosUtil.getSectionData(ai064,samedayZero.getTime()).getPointValueInDouble();
-                                monthFirstValue = edosUtil.getSectionData(ai064,monthFirstZero.getTime()).getPointValueInDouble();
-                                yearFirstValue = edosUtil.getSectionData(ai064,yearFirstZero.getTime()).getPointValueInDouble();
-
-                                rfdl = currentValue - samedayValue;
-                                yfdl = currentValue - monthFirstValue;
-                                nfdl = currentValue - yearFirstValue;
-                            }
-                            PointData fdlpointData = createPointData(fjfdl, rfdl);
-                            rfdlList.add(fdlpointData);
-
-                            PointData yfdlpointData = createPointData(fjyfdl, yfdl);
-
-                            yfdlList.add(yfdlpointData);
-
-                            PointData nfdlpointData = createPointData(fjnfdl, nfdl);
-                            yfdlList.add(nfdlpointData);
-                            //算平均风速
-                            List<PointData> ssfsList = edosUtil.getHistStat(fjssfs, samedayZero.getTime() / 1000, currentDate.getTime() / 1000, 1l, null, 2);
-                            Optional<PointData> ssfsFirst = ssfsList.stream().findFirst();
-                            if (ssfsFirst.isPresent()){
-                                PointData pointData = ssfsFirst.get();
-                                double inDouble = pointData.getPointValueInDouble();
-                                createWtPointData(aveSpeedPoint, pointData, inDouble);
-                                wtavespeedList.add(pointData);
-                            }
-                            //算月平均风速
-                            List<PointData> yssfsList = edosUtil.getHistStat(fjssfs, monthFirstZero.getTime() / 1000, currentDate.getTime() / 1000, 1l, null, 2);
-                            Optional<PointData> yssfsFirst = yssfsList.stream().findFirst();
-                            if (yssfsFirst.isPresent()){
-                                PointData pointData = yssfsFirst.get();
-                                double inDouble = pointData.getPointValueInDouble();
-                                createWtPointData(monthAveSpeedPoint, pointData, inDouble);
-                                ywtavespeedList.add(pointData);
-                            }
-                            //算年平均风速
-                            List<PointData> nssfsList = edosUtil.getHistStat(fjssfs, yearFirstZero.getTime() / 1000, currentDate.getTime() / 1000, 1l, null, 2);
-                            Optional<PointData> nssfsFirst = nssfsList.stream().findFirst();
-                            if (nssfsFirst.isPresent()){
-                                PointData pointData = nssfsFirst.get();
-                                double inDouble = pointData.getPointValueInDouble();
-                                createWtPointData(yearAveSpeedPoint, pointData, inDouble);
-                                nwtavespeedList.add(pointData);
-                            }
-                            //算平均功率
-                            List<PointData> ssglList = edosUtil.getHistStat(fjssgl, samedayZero.getTime() / 1000, currentDate.getTime() / 1000, 1l, null, 2);
-                            Optional<PointData> ssglFirst = ssglList.stream().findFirst();
-                            if (ssglFirst.isPresent()){
-                                PointData pointData = ssglFirst.get();
-                                double inDouble = pointData.getPointValueInDouble();
-                                createWtPointData(avePowerPoint, pointData, inDouble);
-                                wtavepowerList.add(pointData);
-                            }
-                            //算月平均功率
-                            List<PointData> yssglList = edosUtil.getHistStat(fjssgl, monthFirstZero.getTime() / 1000, currentDate.getTime() / 1000, 1l, null, 2);
-                            Optional<PointData> yssglFirst = yssglList.stream().findFirst();
-                            if (yssglFirst.isPresent()){
-                                PointData pointData = yssglFirst.get();
-                                double inDouble = pointData.getPointValueInDouble();
-                                createWtPointData(yavePowerPoint, pointData, inDouble);
-                                ywtavepowerList.add(pointData);
-                            }
-                            //算年平均功率
-                            List<PointData> nssglList = edosUtil.getHistStat(fjssgl, yearFirstZero.getTime() / 1000, currentDate.getTime() / 1000, 1l, null, 2);
-                            Optional<PointData> nssglFirst = nssglList.stream().findFirst();
-                            if (nssglFirst.isPresent()){
-                                PointData pointData = nssglFirst.get();
-                                double inDouble = pointData.getPointValueInDouble();
-                                createWtPointData(navePowerPoint, pointData, inDouble);
-                                nwtavepowerList.add(pointData);
-                            }
-
-                        } catch (Exception e) {
-                            e.printStackTrace();
-                        }
-                    });
-                    resultList.addAll(wtavespeedList);
-                    resultList.addAll(ywtavespeedList);
-                    resultList.addAll(nwtavespeedList);
-                    resultList.addAll(wtavepowerList);
-                    resultList.addAll(ywtavepowerList);
-                    resultList.addAll(nwtavepowerList);
-                    resultList.addAll(rfdlList);
-                    resultList.addAll(yfdlList);
-                    resultList.addAll(nfdlList);
-                    double linefdl = rfdlList.stream().mapToDouble(PointData::getPointValueInDouble).sum();
-                    double lineyfdl = yfdlList.stream().mapToDouble(PointData::getPointValueInDouble).sum();
-                    double linenfdl = nfdlList.stream().mapToDouble(PointData::getPointValueInDouble).sum();
-                    PointData fdlpoint = createWpPointData(linefdlpointnew, linefdl);
-                    PointData yfdlpoint = createWpPointData(ylinefdlpointnew, lineyfdl);
-                    PointData nfdlpoint = createWpPointData(nlinefdlpointnew, linenfdl);
-                    linefdlList.add(fdlpoint);
-                    ylinefdlList.add(yfdlpoint);
-                    nlinefdlList.add(nfdlpoint);
-
-                    //算节能减排
-                    double jpeyhl = lineyfdl * 0.0059;
-                    double jpeyht = lineyfdl * 0.8568;
-                    double jybm = lineyfdl * 0.37;
-                    double jys = lineyfdl * 3.05;
-                    PointData jpeyhlpoint = createWpPointData(jpeyhlpointnew, jpeyhl);
-                    PointData jpeyhtpoint = createWpPointData(jpeyhtpointnew, jpeyht);
-                    PointData jybmpoint = createWpPointData(jybmpointnew, jybm);
-                    PointData jyspoint = createWpPointData(jyspointnew, jys);
-                    resultList.add(jpeyhlpoint);
-                    resultList.add(jpeyhtpoint);
-                    resultList.add(jybmpoint);
-                    resultList.add(jyspoint);
-
-                    //算风能利用率
-                    List<String> pointList = new ArrayList<>();
-                    double ssdl = 0;
-                    Arrays.stream(monthbenchPoints.split(",")).forEach(code->{
-                        pointList.add(linepointnewmap.get(code).getCode());
-                    });
-                    try {
-                        List<PointData> ssdlList = edosUtil.getRealData(pointList);
-                        ssdl = ssdlList.stream().mapToDouble(PointData::getPointValueInDouble).sum();
-                    } catch (Exception e) {
-                        e.printStackTrace();
-                    }
-                    double fnlyl = (ssdl+lineyfdl)!=0?lineyfdl/(ssdl+lineyfdl):0;
-                    PointData fnlylpoint = createWpPointData(linefnlylpointnew, fnlyl);
-                    resultList.add(fnlylpoint);
-
-                    OptionalDouble average = wtavespeedList.stream().mapToDouble(PointData::getPointValueInDouble).average();
-                    if (average.isPresent()){
-                        double linespeed = average.getAsDouble();
-                        PointData pointData = createWpPointData(linepointnew, linespeed);
-                        lineavespeedList.add(pointData);
-                    }
-                    OptionalDouble yaverage = ywtavespeedList.stream().mapToDouble(PointData::getPointValueInDouble).average();
-                    if (yaverage.isPresent()){
-                        double linespeed = yaverage.getAsDouble();
-                        PointData pointData = createWpPointData(ylinepointnew, linespeed);
-                        ylineavespeedList.add(pointData);
-                    }
-                    OptionalDouble naverage = nwtavespeedList.stream().mapToDouble(PointData::getPointValueInDouble).average();
-                    if (naverage.isPresent()){
-                        double linespeed = naverage.getAsDouble();
-                        PointData pointData = createWpPointData(nlinepointnew, linespeed);
-                        nlineavespeedList.add(pointData);
-                    }
-                    Double poweraverage = wtavepowerList.stream().mapToDouble(PointData::getPointValueInDouble).sum();
-                    PointData powerpointData = createWpPointData(linepowerpointnew, poweraverage);
-                    lineavepowerList.add(powerpointData);
-
-                    Double ypoweraverage = ywtavepowerList.stream().mapToDouble(PointData::getPointValueInDouble).sum();
-                    PointData ypowerpointData = createWpPointData(ylinepowerpointnew, ypoweraverage);
-                    ylineavepowerList.add(ypowerpointData);
-
-                    Double npoweraverage = nwtavepowerList.stream().mapToDouble(PointData::getPointValueInDouble).sum();
-                    PointData npowerpointData = createWpPointData(nlinepowerpointnew, npoweraverage);
-                    nlineavepowerList.add(npowerpointData);
-                });
-                OptionalDouble average = lineavespeedList.stream().mapToDouble(PointData::getPointValueInDouble).average();
-                OptionalDouble yaverage = ylineavespeedList.stream().mapToDouble(PointData::getPointValueInDouble).average();
-                OptionalDouble naverage = nlineavespeedList.stream().mapToDouble(PointData::getPointValueInDouble).average();
-
-                Double prorfdl = linefdlList.stream().mapToDouble(PointData::getPointValueInDouble).sum();
-                Double proyfdl = ylinefdlList.stream().mapToDouble(PointData::getPointValueInDouble).sum();
-                Double pronfdl = nlinefdlList.stream().mapToDouble(PointData::getPointValueInDouble).sum();
-                resultList.addAll(lineavespeedList);
-                resultList.addAll(ylineavespeedList);
-                resultList.addAll(nlineavespeedList);
-                resultList.addAll(lineavepowerList);
-                resultList.addAll(ylineavepowerList);
-                resultList.addAll(nlineavepowerList);
-                resultList.addAll(linefdlList);
-                resultList.addAll(ylinefdlList);
-                resultList.addAll(nlinefdlList);
-
-                //算节能减排
-                double jpeyhl = proyfdl * 0.0059;
-                double jpeyht = proyfdl * 0.8568;
-                double jybm = proyfdl * 0.37;
-                double jys = proyfdl * 3.05;
-                PointData jpeyhlpoint = createWpPointData(jpeyhlprojectpointnew, jpeyhl);
-                PointData jpeyhtpoint = createWpPointData(jpeyhtprojectpointnew, jpeyht);
-                PointData jybmpoint = createWpPointData(jybmprojectpointnew, jybm);
-                PointData jyspoint = createWpPointData(jysprojectpointnew, jys);
-                resultList.add(jpeyhlpoint);
-                resultList.add(jpeyhtpoint);
-                resultList.add(jybmpoint);
-                resultList.add(jyspoint);
-
-                //算风能利用率
-                List<String> pointList = new ArrayList<>();
-                double ssdl = 0;
-                Arrays.stream(monthbenchPoints.split(",")).forEach(code->{
-                    pointList.add(projectpointnewmap.get(code).getCode());
-                });
-                try {
-                    List<PointData> ssdlList = edosUtil.getRealData(pointList);
-                    ssdl = ssdlList.stream().mapToDouble(PointData::getPointValueInDouble).sum();
-                } catch (Exception e) {
-                    e.printStackTrace();
-                }
-                double fnlyl = (ssdl+proyfdl)!=0?proyfdl/(ssdl+proyfdl):0;
-                PointData fnlylpoint = createWpPointData(fnlylprojectpointnew, fnlyl);
-                resultList.add(fnlylpoint);
-
-                PointData rfdlpointData = createWpPointData(fdlprojectpointnew, prorfdl);
-                PointData yfdlpointData = createWpPointData(yfdlprojectpointnew, proyfdl);
-                PointData nfdlpointData = createWpPointData(nfdlprojectpointnew, pronfdl);
-                projectfdlList.add(rfdlpointData);
-                projectyfdlList.add(yfdlpointData);
-                projectnfdlList.add(nfdlpointData);
-                if (average.isPresent()){
-                    double projectspeed = average.getAsDouble();
-                    PointData pointData = createWpPointData(projectpointnew, projectspeed);
-                    projectavespeedList.add(pointData);
-                }
-                if (yaverage.isPresent()){
-                    double projectspeed = yaverage.getAsDouble();
-                    PointData pointData = createWpPointData(yprojectpointnew, projectspeed);
-                    yprojectavespeedList.add(pointData);
-                }
-                if (naverage.isPresent()){
-                    double projectspeed = naverage.getAsDouble();
-                    PointData pointData = createWpPointData(nprojectpointnew, projectspeed);
-                    nprojectavespeedList.add(pointData);
-                }
-
-                Double poweraverage = lineavepowerList.stream().mapToDouble(PointData::getPointValueInDouble).sum();
-                Double ypoweraverage = ylineavepowerList.stream().mapToDouble(PointData::getPointValueInDouble).sum();
-                Double npoweraverage = nlineavepowerList.stream().mapToDouble(PointData::getPointValueInDouble).sum();
-                PointData powerpointData = createWpPointData(powerprojectpointnew, poweraverage);
-                projectavepowerList.add(powerpointData);
-                PointData ypowerpointData = createWpPointData(ypowerprojectpointnew, ypoweraverage);
-                yprojectavepowerList.add(ypowerpointData);
-                PointData npowerpointData = createWpPointData(npowerprojectpointnew, npoweraverage);
-                nprojectavepowerList.add(npowerpointData);
-            });
-
-            resultList.addAll(projectfdlList);
-            resultList.addAll(projectyfdlList);
-            resultList.addAll(projectnfdlList);
-            double fcrfdl = projectfdlList.stream().mapToDouble(PointData::getPointValueInDouble).sum();
-            PointData fdlpointData = createWpPointData(fdlwppointnew, fcrfdl);
-            resultList.add(fdlpointData);
-
-            double fcyfdl = projectyfdlList.stream().mapToDouble(PointData::getPointValueInDouble).sum();
-            PointData yfdlpointData = createWpPointData(yfdlwppointnew, fcyfdl);
-            resultList.add(yfdlpointData);
-
-            //算节能减排
-            double jpeyhl = fcyfdl * 0.0059;
-            double jpeyht = fcyfdl * 0.8568;
-            double jybm = fcyfdl * 0.37;
-            double jys = fcyfdl * 3.05;
-            PointData jpeyhlpoint = createWpPointData(jpeyhlwppointnew, jpeyhl);
-            PointData jpeyhtpoint = createWpPointData(jpeyhtwppointnew, jpeyht);
-            PointData jybmpoint = createWpPointData(jybmwppointnew, jybm);
-            PointData jyspoint = createWpPointData(jyswppointnew, jys);
-            resultList.add(jpeyhlpoint);
-            resultList.add(jpeyhtpoint);
-            resultList.add(jybmpoint);
-            resultList.add(jyspoint);
-            //算风能利用率
-            List<String> pointList = new ArrayList<>();
-            double ssdl = 0;
-            Arrays.stream(monthbenchPoints.split(",")).forEach(code->{
-                pointList.add(wppointnewmap.get(code).getCode());
-            });
-            try {
-                List<PointData> ssdlList = edosUtil.getRealData(pointList);
-                ssdl = ssdlList.stream().mapToDouble(PointData::getPointValueInDouble).sum();
-            } catch (Exception e) {
-                e.printStackTrace();
-            }
-            double fnlyl = (ssdl+fcyfdl)!=0?fcyfdl/(ssdl+fcyfdl):0;
-            PointData fnlylpoint = createWpPointData(fnlylwppointnew, fnlyl);
-            resultList.add(fnlylpoint);
-
-            double fcnfdl = projectnfdlList.stream().mapToDouble(PointData::getPointValueInDouble).sum();
-            PointData nfdlpointData = createWpPointData(nfdlwppointnew, fcnfdl);
-            resultList.add(nfdlpointData);
-
-            OptionalDouble average = projectavespeedList.stream().mapToDouble(PointData::getPointValueInDouble).average();
-            resultList.addAll(projectavespeedList);
-            if (average.isPresent()){
-                double wpspeed = average.getAsDouble();
-                PointData pointData = createWpPointData(wppointnew, wpspeed);
-                resultList.add(pointData);
-            }
-            OptionalDouble yaverage = yprojectavespeedList.stream().mapToDouble(PointData::getPointValueInDouble).average();
-            resultList.addAll(yprojectavespeedList);
-            if (yaverage.isPresent()){
-                double wpspeed = yaverage.getAsDouble();
-                PointData pointData = createWpPointData(ywppointnew, wpspeed);
-                resultList.add(pointData);
-            }
-            OptionalDouble naverage = nprojectavespeedList.stream().mapToDouble(PointData::getPointValueInDouble).average();
-            resultList.addAll(nprojectavespeedList);
-            if (naverage.isPresent()){
-                double wpspeed = naverage.getAsDouble();
-                PointData pointData = createWpPointData(nwppointnew, wpspeed);
-                resultList.add(pointData);
-            }
-            Double poweraverage = projectavepowerList.stream().mapToDouble(PointData::getPointValueInDouble).sum();
-            resultList.addAll(projectavepowerList);
-            PointData powerpointData = createWpPointData(powerwppointnew, poweraverage);
-            resultList.add(powerpointData);
-
-            Double ypoweraverage = yprojectavepowerList.stream().mapToDouble(PointData::getPointValueInDouble).sum();
-            resultList.addAll(yprojectavepowerList);
-            PointData ypowerpointData = createWpPointData(ypowerwppointnew, ypoweraverage);
-            resultList.add(ypowerpointData);
-
-            Double npoweraverage = nprojectavepowerList.stream().mapToDouble(PointData::getPointValueInDouble).sum();
-            resultList.addAll(nprojectavepowerList);
-            PointData npowerpointData = createWpPointData(npowerwppointnew, npoweraverage);
-            resultList.add(npowerpointData);
-        });
-        edosUtil.sendMultiPoint(resultList);
-    }
-
-    private PointData createPointData(Windturbinetestingpointnew fjfdl, Double rfdl) {
-        PointData pointData = new PointData();
-        pointData.setEdnaId(fjfdl.getCode());
-        pointData.setPointName(fjfdl.getName());
-        pointData.setPointTime(currentDate.getTime());
-        pointData.setPointValueInDouble(rfdl);
-        pointData.setPointValue(String.valueOf(rfdl));
-        return pointData;
-    }
-
-    private PointData createWpPointData(Windpowerstationpointnew linepointnew, double linespeed) {
-        PointData pointData = new PointData();
-        pointData.setEdnaId(linepointnew.getCode());
-        pointData.setPointTime(currentDate.getTime());
-        pointData.setPointName(linepointnew.getName());
-        pointData.setPointValue(String.valueOf(linespeed));
-        pointData.setPointValueInDouble(linespeed);
-        return pointData;
-    }
-
-    private void createWtPointData(Windturbinetestingpointnew aveSpeedPoint, PointData pointData, double inDouble) {
-        pointData.setEdnaId(aveSpeedPoint.getCode());
-        pointData.setPointName(aveSpeedPoint.getName());
-        pointData.setPointValueInDouble(inDouble);
-        pointData.setPointValue(String.valueOf(inDouble));
-        pointData.setPointTime(currentDate.getTime());
-    }
-}

Diferenças do arquivo suprimidas por serem muito extensas
+ 0 - 1101
realtime/generationXa-service/src/main/java/com/gyee/generation/service/FiveLossesService.java


+ 0 - 690
realtime/generationXa-service/src/main/java/com/gyee/generation/service/GenerationService.java

@@ -1,690 +0,0 @@
-package com.gyee.generation.service;
-
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.gyee.common.contant.Contant;
-import com.gyee.common.model.PointData;
-import com.gyee.common.model.StringUtils;
-import com.gyee.common.util.DateUtils;
-import com.gyee.common.util.DoubleUtils;
-import com.gyee.generation.init.CacheContext;
-import com.gyee.generation.model.auto.*;
-import com.gyee.generation.service.auto.IMeterpointvalueService;
-import com.gyee.generation.util.realtimesource.IEdosUtil;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.springframework.stereotype.Service;
-
-import javax.annotation.Resource;
-import java.util.*;
-import java.util.concurrent.atomic.AtomicReference;
-
-/**
- * @ClassName : GenerationService
- * @Author : xieshengjie
- * @Date: 2022/2/28 15:23
- * @Description :
- */
-@Service
-public class GenerationService {
-
-   private Log log = LogFactory.getLog(GenerationService.class);
-    @Resource
-    private IEdosUtil edosUtil;
-    @Resource
-    private IMeterpointvalueService meterpointvalueService;
-
-
-    /**
-     * 保存电计量电量,场用电量,购网电量,上网电量
-     * @throws Exception
-     */
-    public void saveGenerationDatas() throws Exception {
-        List<PointData> resultList = new ArrayList<>();
-        List<PointData> fdlList = new ArrayList<>();
-        List<Windpowerstation> wpls = CacheContext.wpls;
-        List<Line> lines = CacheContext.lines;
-        Map<String, List<Project>> wppromap = CacheContext.wppromap;
-        Map<String, List<Line>> prolinemap = CacheContext.prolinemap;
-        List<Meterpoint> meterpoints = CacheContext.meterpoints;
-        Map<String, Map<String, Windpowerstationpointnew>> wppointmap = CacheContext.wppointmap;
-        Map<String, Map<String, Windpowerstationpointnew>> linepointmap = CacheContext.linepointmap;
-        Map<String, Map<String, Windpowerstationpointnew>> propointmap = CacheContext.propointmap;
-        Date samedayZero = DateUtils.getSamedayZero();
-        Date monthFirstZero = DateUtils.getMonthFirstZero();
-        Date yearFirstZero = DateUtils.getYearFirstZero();
-        Date currentDate = DateUtils.getCurrentDate();
-        Date tomorrow = DateUtils.addDays(samedayZero,1);
-
-        lines.stream().forEach(line->{
-            Map<String, Windpowerstationpointnew> linemap = linepointmap.get(line.getId());
-            //线路发电量
-            Optional<Meterpoint> fdlOptional = meterpoints.stream().filter(me -> me.getLineid().equals(line.getId()) &&  me.getUniformcode().equals("ZXYG") && me.getMetertype().equals("进线") && me.getMetersort().equals("主")).findFirst();
-            computeFdl(fdlList, tomorrow,samedayZero, monthFirstZero, yearFirstZero, currentDate, linemap, fdlOptional);
-        });
-        wpls.stream().forEach(wp->{
-            Map<String, Windpowerstationpointnew> wpmap = wppointmap.get(wp.getId());
-            AtomicReference<Double> fcrfdl = new AtomicReference<>((double) 0);
-            AtomicReference<Double> fcyfdl = new AtomicReference<>((double) 0);
-            AtomicReference<Double> fcnfdl = new AtomicReference<>((double) 0);
-            AtomicReference<Double> fcrswdl = new AtomicReference<>((double) 0);
-            AtomicReference<Double> fcyswdl = new AtomicReference<>((double) 0);
-            AtomicReference<Double> fcnswdl = new AtomicReference<>((double) 0);
-            AtomicReference<Double> fcrgwdl = new AtomicReference<>((double) 0);
-            AtomicReference<Double> fcygwdl = new AtomicReference<>((double) 0);
-            AtomicReference<Double> fcngwdl = new AtomicReference<>((double) 0);
-            AtomicReference<Double> fcrcydl = new AtomicReference<>((double) 0);
-            AtomicReference<Double> fcycydl = new AtomicReference<>((double) 0);
-            AtomicReference<Double> fcncydl = new AtomicReference<>((double) 0);
-            wppromap.get(wp.getId()).stream().forEach(project -> {
-                Map<String, Windpowerstationpointnew> projectmap = propointmap.get(project.getId());
-                AtomicReference<Double> qcrfdl = new AtomicReference<>(0.0);
-                AtomicReference<Double> qcyfdl = new AtomicReference<>(0.0);
-                AtomicReference<Double> qcnfdl = new AtomicReference<>(0.0);
-                AtomicReference<Double> qcrswdl = new AtomicReference<>(0.0);
-                AtomicReference<Double> qcyswdl = new AtomicReference<>(0.0);
-                AtomicReference<Double> qcnswdl = new AtomicReference<>(0.0);
-                AtomicReference<Double> qcrgwdl = new AtomicReference<>(0.0);
-                AtomicReference<Double> qcygwdl = new AtomicReference<>(0.0);
-                AtomicReference<Double> qcngwdl = new AtomicReference<>(0.0);
-                AtomicReference<Double> qcrcydl = new AtomicReference<>(0.0);
-                AtomicReference<Double> qcycydl = new AtomicReference<>(0.0);
-                AtomicReference<Double> qcncydl = new AtomicReference<>(0.0);
-                prolinemap.get(project.getId()).stream().forEach(line -> {
-                    Map<String, Windpowerstationpointnew> linemap = linepointmap.get(line.getId());
-                    //线路发电量
-                    Optional<Meterpoint> fdlOptional = meterpoints.stream().filter(me -> me.getLineid().equals(line.getId()) &&   me.getUniformcode().equals("ZXYG") && me.getMetertype().equals("进线") && me.getMetersort().equals("主")).findFirst();
-                    lineFdl(resultList,tomorrow, samedayZero, monthFirstZero, yearFirstZero, currentDate, qcrfdl, qcyfdl, qcnfdl, linemap, fdlOptional);
-                    log.info(line.getName()+"电计量电量计算完毕!");
-                    //线路上网电量
-                    Optional<Meterpoint> swdlOptional= null;
-                    Optional<Meterpoint> gwdlOptional=null;
-                    if (wp.getId().equals("GJY_FDC")){
-                        swdlOptional = meterpoints.stream().filter(me ->   me.getUniformcode().equals("ZXYG") && me.getMetertype().equals("主变高压侧") && me.getMetersort().equals("主") && me.getLineid().contains(line.getId())).findFirst();
-                        gwdlOptional = meterpoints.stream().filter(me ->  me.getUniformcode().equals("FXYG") && me.getMetertype().equals("主变高压侧") && me.getMetersort().equals("主") && me.getLineid().contains(line.getId())).findFirst();
-                    }else{
-                        swdlOptional = meterpoints.stream().filter(me ->   me.getUniformcode().equals("ZXYG") && me.getMetertype().equals("出线") && me.getMetersort().equals("主") && me.getLineid().contains(line.getId())).findFirst();
-                        gwdlOptional = meterpoints.stream().filter(me ->  me.getUniformcode().equals("FXYG") && me.getMetertype().equals("出线") && me.getMetersort().equals("主") && me.getLineid().contains(line.getId())).findFirst();
-                    }
-                     lineOrtherdl(fdlList,tomorrow,resultList, linepointmap, samedayZero, monthFirstZero, yearFirstZero, currentDate, qcrswdl, qcyswdl, qcnswdl, line, linemap, swdlOptional,Contant.SWDLB,Contant.SWDLY,Contant.SWDLN);
-                    log.info(line.getName()+"上网电量计算完毕!");
-                    //线路购网电量
-                    lineOrtherdl(fdlList,tomorrow,resultList, linepointmap, samedayZero, monthFirstZero, yearFirstZero, currentDate, qcrgwdl, qcygwdl, qcngwdl, line, linemap, gwdlOptional,Contant.GWGWB,Contant.GWGWY,Contant.GWGWN);
-                    log.info(line.getName()+"工网购网电量计算完毕!");
-                    //厂用电量
-                    Optional<Meterpoint> zybOptional = meterpoints.stream().filter(me->   me.getUniformcode().equals("ZXYG") && me.getMetertype().equals("站用变") && me.getMetersort().equals("主") && me.getLineid().contains(line.getId())).findFirst();
-                    lineOrtherdl(fdlList,tomorrow,resultList, linepointmap, samedayZero, monthFirstZero, yearFirstZero, currentDate, qcrcydl, qcycydl, qcncydl, line, linemap, zybOptional,Contant.CYDLB,Contant.CYDLY,Contant.CYDLN);
-                    log.info(line.getName()+"场用电量计算完毕!");
-                    //农网购网电量
-                    setZero(resultList,currentDate,linemap,Contant.NWGWB,Contant.NWGWY,Contant.NWGWN);
-                    log.info(line.getName()+"农网购网电量计算完毕!");
-
-                });
-                //期次发电量
-                projectFdl(resultList, currentDate, fcrfdl, fcyfdl, fcnfdl, projectmap, qcrfdl, qcyfdl, qcnfdl);
-                log.info(project.getName()+"发电量计算完毕!");
-                //期次上网电量
-                projectOrther(resultList, currentDate, fcrswdl, fcyswdl, fcnswdl, projectmap, qcrswdl, qcyswdl, qcnswdl,Contant.SWDLB,Contant.SWDLY,Contant.SWDLN);
-                log.info(project.getName()+"上网电量计算完毕!");
-                //期次购网电量
-                projectOrther(resultList, currentDate, fcrgwdl, fcygwdl, fcngwdl, projectmap, qcrgwdl, qcygwdl, qcngwdl,Contant.GWGWB,Contant.GWGWY,Contant.GWGWN);
-                log.info(project.getName()+"工网购网电量计算完毕!");
-                //期次厂用电量
-                projectOrther(resultList, currentDate, fcrcydl, fcycydl, fcncydl, projectmap, qcrcydl, qcycydl, qcncydl,Contant.CYDLB,Contant.CYDLY,Contant.CYDLN);
-                log.info(project.getName()+"场用电量计算完毕!");
-                //期次农网电量
-                setZero(resultList,currentDate,projectmap,Contant.NWGWB,Contant.NWGWY,Contant.NWGWN);
-                log.info(project.getName()+"农网电量计算完毕!");
-
-            });
-            //场站发电量
-            windpowerFdl(resultList, currentDate, wpmap, fcrfdl, fcyfdl, fcnfdl,Contant.RFDLB,Contant.YFDLB,Contant.NFDLB);
-            log.info(wp.getName()+"发电量计算完毕!");
-            //场站上网电量
-            windpowerFdl(resultList, currentDate, wpmap, fcrswdl, fcyswdl, fcnswdl,Contant.SWDLB,Contant.SWDLY,Contant.SWDLN);
-            log.info(wp.getName()+"上网电量计算完毕!");
-            //场站购网电量
-            windpowerFdl(resultList, currentDate, wpmap, fcrgwdl, fcygwdl, fcngwdl,Contant.GWGWB,Contant.GWGWY,Contant.GWGWN);
-            log.info(wp.getName()+"工网购网电量计算完毕!");
-            //场站场用电量
-            windpowerFdl(resultList, currentDate, wpmap, fcrcydl, fcycydl, fcncydl,Contant.CYDLB,Contant.CYDLY,Contant.CYDLN);
-            log.info(wp.getName()+"场用电量计算完毕!");
-            //场站农网电量
-            setZero(resultList,currentDate,wpmap,Contant.NWGWB,Contant.NWGWY,Contant.NWGWN);
-            log.info(wp.getName()+"农网购网电量计算完毕!");
-        });
-
-        edosUtil.sendMultiPoint(resultList);
-    }
-
-    /**
-     * 存储meterpointvalue表
-     * 实时+0点算前一天
-     */
-    public void saveMeterpointValueRealtime(String beginDate,String endDate){
-        List<Meterpoint> meterpoints = CacheContext.meterpoints;
-        List<String> days = DateUtils.getDays(beginDate, endDate);
-        days.stream().forEach(day->{
-            Date samedayZero = DateUtils.getSamedayZero(day);
-            Date monthFirstZero = DateUtils.getMonthFirstZero(day);
-            Date yearFirstZero = DateUtils.getYearFirstZero(day);
-            Date date = DateUtils.addDays(samedayZero, 1);
-            List<Meterpointvalue> resultList = new ArrayList<>();
-            QueryWrapper<Meterpointvalue> qw = new QueryWrapper();
-            qw.eq("recorddate",date);
-            meterpointvalueService.remove(qw);
-            meterpoints.stream().forEach(meterpoint -> {
-                String meterid = meterpoint.getId();
-                Double magnification = meterpoint.getMagnification();
-                Double xs = meterpoint.getXs();
-                Meterpointvalue meterpointvalue = new Meterpointvalue();
-
-                meterpointvalue.setRecorddate(date);
-                meterpointvalue.setMeterid(meterpoint.getId());
-                Double real = 0.0;
-                Double sameday = 0.0;
-                Double month = 0.0;
-                Double year = 0.0;
-                try {
-                    real = edosUtil.getSectionData(meterid,date.getTime()).getPointValueInDouble();
-                    sameday = edosUtil.getSectionData(meterid,samedayZero.getTime()).getPointValueInDouble();
-                    month = edosUtil.getSectionData(meterid,monthFirstZero.getTime()).getPointValueInDouble();
-                    year = edosUtil.getSectionData(meterid,yearFirstZero.getTime()).getPointValueInDouble();
-
-                } catch (Exception e) {
-                    e.printStackTrace();
-                }
-                meterpointvalue.setYear(DoubleUtils.keepPrecision(year/xs,2));
-                meterpointvalue.setYear4(DoubleUtils.keepPrecision(year/xs,4));
-                meterpointvalue.setMonth(DoubleUtils.keepPrecision(month/xs,2));
-                meterpointvalue.setMonth4(DoubleUtils.keepPrecision(month/xs,4));
-                meterpointvalue.setDay(DoubleUtils.keepPrecision(sameday/xs,2));
-                meterpointvalue.setDay4(DoubleUtils.keepPrecision(sameday/xs,4));
-                meterpointvalue.setNow(DoubleUtils.keepPrecision(real/xs,2));
-                meterpointvalue.setNow4(DoubleUtils.keepPrecision(real/xs,4));
-                Double yearvalue = (real/xs - year/xs) * magnification;
-                Double monthvalue = (real/xs - month/xs) * magnification;
-                Double dayvalue = (real/xs - sameday/xs) * magnification;
-                meterpointvalue.setYearvalue(yearvalue);
-                meterpointvalue.setMonthvalue(monthvalue);
-                meterpointvalue.setDayvalue(dayvalue);
-                resultList.add(meterpointvalue);
-            });
-            meterpointvalueService.saveBatch(resultList);
-        });
-
-
-
-    }
-
-    public void updateMeterpointValueHistory(String beginDate,String endDate){
-        List<Meterpointvalue> resultLsit = new ArrayList<>();
-        Map<String,Meterpoint> meterpointMap = CacheContext.meterpointMap;
-        List<String> days = DateUtils.getDays(beginDate, endDate);
-        days.stream().forEach(day->{
-            Date date = DateUtils.parseDate(beginDate);
-            Date date1 = DateUtils.addDays(date, 1);
-            Date date2= DateUtils.addDays(date1, 1);
-            QueryWrapper<Meterpointvalue> qw = new QueryWrapper<>();
-            qw.eq("recorddate",date1);
-            List<Meterpointvalue> meterpointvalues = meterpointvalueService.list(qw);
-
-            meterpointvalues.stream().forEach(meterpointvalue -> {
-                Meterpoint meterpoint = meterpointMap.get(meterpointvalue.getMeterid());
-                Double magnification = meterpoint.getMagnification();
-                Double xs = meterpoint.getXs();
-                Double real = 0.0;
-
-                try {
-                    real = edosUtil.getSectionData(meterpointvalue.getMeterid(),date1.getTime()).getPointValueInDouble();
-                } catch (Exception e) {
-                    e.printStackTrace();
-                }
-                Double yearvalue = (real/xs - meterpointvalue.getYear4()) * magnification;
-                Double monthvalue = (real/xs - meterpointvalue.getMonth4()) * magnification;
-                Double dayvalue = (real/xs - meterpointvalue.getDay4()) * magnification;
-                meterpointvalue.setNow(DoubleUtils.keepPrecision(real,2));
-                meterpointvalue.setNow4(DoubleUtils.keepPrecision(real,4));
-                meterpointvalue.setYearvalue(yearvalue);
-                meterpointvalue.setMonthvalue(monthvalue);
-                meterpointvalue.setDayvalue(dayvalue);
-                resultLsit.add(meterpointvalue);
-            });
-            meterpointvalueService.saveOrUpdateBatch(resultLsit);
-        });
-    }
-
-
-    private void setGsZero(List<PointData> resultList,Date currentDate,Map<String, Map<String, Windpowerstationpointnew>> linemap,String foreignkeyid,String rcode,String ycode,String ncode) {
-        //线路日发电量
-        PointData r = new PointData();
-        r.setPointTime(currentDate.getTime());
-        r.setPointValue("0");
-        r.setPointValueInDouble(0);
-        r.setEdnaId(linemap.get(foreignkeyid).get(rcode).getCode());
-        r.setPointName(linemap.get(foreignkeyid).get(rcode).getName());
-        resultList.add(r);
-        //线路月发电量
-        PointData y = new PointData();
-        y.setPointTime(currentDate.getTime());
-        y.setPointValue("0");
-        y.setPointValueInDouble(0);
-        y.setEdnaId(linemap.get(foreignkeyid).get(ycode).getCode());
-        y.setPointName(linemap.get(foreignkeyid).get(ycode).getName());
-        resultList.add(y);
-        //线路年发电量
-        PointData n = new PointData();
-        n.setPointTime(currentDate.getTime());
-        n.setPointValue("0");
-        n.setPointValueInDouble(0);
-        n.setEdnaId(linemap.get(foreignkeyid).get(ncode).getCode());
-        n.setPointName(linemap.get(foreignkeyid).get(ncode).getName());
-        resultList.add(n);
-    }
-    private void setZero(List<PointData> resultList,Date currentDate,Map<String, Windpowerstationpointnew> linemap,String rcode,String ycode,String ncode) {
-        //线路日发电量
-        PointData r = new PointData();
-        r.setPointTime(currentDate.getTime());
-        r.setPointValue("0");
-        r.setPointValueInDouble(0);
-        r.setEdnaId(linemap.get(rcode).getCode());
-        r.setPointName(linemap.get(rcode).getName());
-        resultList.add(r);
-        //线路月发电量
-        PointData y = new PointData();
-        y.setPointTime(currentDate.getTime());
-        y.setPointValue("0");
-        y.setPointValueInDouble(0);
-        y.setEdnaId(linemap.get(ycode).getCode());
-        y.setPointName(linemap.get(ycode).getName());
-        resultList.add(y);
-        //线路年发电量
-        PointData n = new PointData();
-        n.setPointTime(currentDate.getTime());
-        n.setPointValue("0");
-        n.setPointValueInDouble(0);
-        n.setEdnaId(linemap.get(ncode).getCode());
-        n.setPointName(linemap.get(ncode).getName());
-        resultList.add(n);
-    }
-
-    private Map<String,Double> getPercentage(List<PointData> fdlList,Meterpoint swdlMeterpoint,List<PointData> resultList,Map<String, Map<String, Windpowerstationpointnew>> linepointmap,Line line){
-
-        Map<String,Double> percentageMap = new HashMap<>();
-        String[] swdlLines = swdlMeterpoint.getLineid().split("\\|");
-        AtomicReference<Double> xldl = new AtomicReference<>((double) 0);
-        AtomicReference<Double> xlzdl = new AtomicReference<>((double) 0);
-        AtomicReference<Double> xlydl = new AtomicReference<>((double) 0);
-        AtomicReference<Double> xlzydl = new AtomicReference<>((double) 0);
-        AtomicReference<Double> xlndl = new AtomicReference<>((double) 0);
-        AtomicReference<Double> xlzndl = new AtomicReference<>((double) 0);
-        Arrays.stream(swdlLines).forEach(l->{
-            Optional<PointData> xldlfirst = fdlList.stream().filter(res -> res.getEdnaId().equals(linepointmap.get(l).get(Contant.RFDLB).getCode())).findFirst();
-            if (xldlfirst.isPresent()){
-                if (l.equals(line.getId())){
-                    xldl.set(xldlfirst.get().getPointValueInDouble());
-                    xlzdl.updateAndGet(v -> new Double((double) (v + xldlfirst.get().getPointValueInDouble())));
-                }else{
-                    xlzdl.updateAndGet(v -> new Double((double) (v + xldlfirst.get().getPointValueInDouble())));
-                }
-            }
-            Optional<PointData> xlydlfirst = fdlList.stream().filter(res -> res.getEdnaId().equals(linepointmap.get(l).get(Contant.YFDLB).getCode())).findFirst();
-            if (xlydlfirst.isPresent()){
-                if (l.equals(line.getId())){
-                    xlydl.set(xlydlfirst.get().getPointValueInDouble());
-                    xlzydl.updateAndGet(v -> new Double((double) (v + xlydlfirst.get().getPointValueInDouble())));
-                }else{
-                    xlzydl.updateAndGet(v -> new Double((double) (v + xlydlfirst.get().getPointValueInDouble())));
-                }
-            }
-            Optional<PointData> xlndlfirst = fdlList.stream().filter(res -> res.getEdnaId().equals(linepointmap.get(l).get(Contant.NFDLB).getCode())).findFirst();
-            if (xlndlfirst.isPresent()){
-                if (l.equals(line.getId())){
-                    xlndl.set(xlndlfirst.get().getPointValueInDouble());
-                    xlzndl.updateAndGet(v -> new Double((double) (v + xlndlfirst.get().getPointValueInDouble())));
-                }else{
-                    xlzndl.updateAndGet(v -> new Double((double) (v + xlndlfirst.get().getPointValueInDouble())));
-                }
-            }
-        });
-        //电量百分比
-        double percentage = xlzdl.get() != 0 ? xldl.get() / xlzdl.get() * 100 : 0;
-        percentageMap.put("percentage",percentage);
-        double ypercentage = xlzydl.get() != 0 ? xlydl.get() / xlzydl.get() * 100 : 0;
-        percentageMap.put("ypercentage",ypercentage);
-        double npercentage = xlzndl.get() != 0 ? xlndl.get() / xlzndl.get() * 100 : 0;
-        percentageMap.put("npercentage",npercentage);
-        return percentageMap;
-    }
-    private void lineOrtherdl(List<PointData> fdlList,Date tomorrow,List<PointData> resultList, Map<String, Map<String, Windpowerstationpointnew>> linepointmap, Date samedayZero, Date monthFirstZero, Date yearFirstZero, Date currentDate, AtomicReference<Double> qcrswdl, AtomicReference<Double> qcyswdl, AtomicReference<Double> qcnswdl, Line line, Map<String, Windpowerstationpointnew> linemap, Optional<Meterpoint> optionalMeterpoint,String rcode,String ycode,String ncode) {
-        if (optionalMeterpoint.isPresent()){
-            Meterpoint swdlMeterpoint = optionalMeterpoint.get();
-            //获取电量百分比,算其他电量
-            Map<String, Double> percentageMap = getPercentage(fdlList,swdlMeterpoint, resultList, linepointmap, line);
-
-            String pointid = swdlMeterpoint.getId();
-            Double real = 0.0;
-            Double sameday = 0.0;
-            Double month = 0.0;
-            Double year = 0.0;
-            try {
-                real = edosUtil.getSectionData(pointid,tomorrow.getTime()).getPointValueInDouble();
-                sameday = edosUtil.getSectionData(pointid,samedayZero.getTime()).getPointValueInDouble();
-                month = edosUtil.getSectionData(pointid,monthFirstZero.getTime()).getPointValueInDouble();
-                year = edosUtil.getSectionData(pointid,yearFirstZero.getTime()).getPointValueInDouble();
-
-                Double magnification = optionalMeterpoint.get().getMagnification();
-                Double xs = optionalMeterpoint.get().getXs();
-
-                double xlswdl = (real - sameday) * magnification / xs * percentageMap.get("percentage");
-                qcrswdl.updateAndGet(v -> new Double((double) (v + xlswdl)));
-                //线路上网电量
-                PointData r = new PointData();
-                r.setPointTime(currentDate.getTime());
-                r.setPointValue(String.valueOf(xlswdl));
-                r.setPointValueInDouble(xlswdl);
-                r.setEdnaId(linemap.get(rcode).getCode());
-                r.setPointName(linemap.get(rcode).getName());
-                resultList.add(r);
-                //线路月上网发电量
-                double xlyswdl = (real - month) * magnification / xs * percentageMap.get("ypercentage");
-                qcyswdl.updateAndGet(v -> new Double((double) (v + xlyswdl)));
-                PointData y = new PointData();
-                y.setPointTime(currentDate.getTime());
-                y.setPointValue(String.valueOf(xlyswdl));
-                y.setPointValueInDouble(xlyswdl);
-                y.setEdnaId(linemap.get(ycode).getCode());
-                y.setPointName(linemap.get(ycode).getName());
-                resultList.add(y);
-                //线路年上网发电量
-                double xlnswfdl = (real - year) * magnification / xs * percentageMap.get("npercentage");
-                qcnswdl.updateAndGet(v -> new Double((double) (v + xlnswfdl)));
-                PointData n = new PointData();
-                n.setPointTime(currentDate.getTime());
-                n.setPointValue(String.valueOf(xlnswfdl));
-                n.setPointValueInDouble(xlnswfdl);
-                n.setEdnaId(linemap.get(ncode).getCode());
-                n.setPointName(linemap.get(ncode).getName());
-                resultList.add(n);
-            } catch (Exception e) {
-                e.printStackTrace();
-            }
-        }
-    }
-    private void computeFdl(List<PointData> fdlList, Date tomorrow,Date samedayZero, Date monthFirstZero, Date yearFirstZero, Date currentDate, Map<String, Windpowerstationpointnew> linemap, Optional<Meterpoint> fdlOptional) {
-        if (fdlOptional.isPresent()){
-            String pointid = fdlOptional.get().getId();
-            Double real = 0.0;
-            Double sameday = 0.0;
-            Double month = 0.0;
-            Double year = 0.0;
-            try {
-                real = edosUtil.getSectionData(pointid,tomorrow.getTime()).getPointValueInDouble();
-                sameday = edosUtil.getSectionData(pointid,samedayZero.getTime()).getPointValueInDouble();
-                month = edosUtil.getSectionData(pointid,monthFirstZero.getTime()).getPointValueInDouble();
-                year = edosUtil.getSectionData(pointid,yearFirstZero.getTime()).getPointValueInDouble();
-
-                Double magnification = fdlOptional.get().getMagnification();
-                Double xs = fdlOptional.get().getXs();
-                double xlrfdl = (real - sameday) * magnification / xs;
-                //线路日发电量
-                PointData r = new PointData();
-                r.setPointTime(currentDate.getTime());
-                r.setPointValue(String.valueOf(xlrfdl));
-                r.setPointValueInDouble(xlrfdl);
-                r.setEdnaId(linemap.get(Contant.RFDLB).getCode());
-                r.setPointName(linemap.get(Contant.RFDLB).getName());
-                fdlList.add(r);
-                //线路月发电量
-                double xlyfdl = (real - month) * magnification / xs;
-                PointData y = new PointData();
-                y.setPointTime(currentDate.getTime());
-                y.setPointValue(String.valueOf(xlyfdl));
-                y.setPointValueInDouble(xlyfdl);
-                y.setEdnaId(linemap.get(Contant.YFDLB).getCode());
-                y.setPointName(linemap.get(Contant.YFDLB).getName());
-                fdlList.add(y);
-                //线路年发电量
-                double xlnfdl = (real - year) * magnification / xs;
-                PointData n = new PointData();
-                n.setPointTime(currentDate.getTime());
-                n.setPointValue(String.valueOf(xlnfdl));
-                n.setPointValueInDouble(xlnfdl);
-                n.setEdnaId(linemap.get(Contant.NFDLB).getCode());
-                n.setPointName(linemap.get(Contant.NFDLB).getName());
-                fdlList.add(n);
-            } catch (Exception e) {
-                e.printStackTrace();
-            }
-        }
-    }
-
-    private void lineFdl(List<PointData> resultList, Date tomorrow,Date samedayZero, Date monthFirstZero, Date yearFirstZero, Date currentDate, AtomicReference<Double> qcrfdl, AtomicReference<Double> qcyfdl, AtomicReference<Double> qcnfdl, Map<String, Windpowerstationpointnew> linemap, Optional<Meterpoint> optionalMeterpoint) {
-        if (optionalMeterpoint.isPresent()){
-            String pointid = optionalMeterpoint.get().getId();
-            Double real = 0.0;
-            Double sameday = 0.0;
-            Double month = 0.0;
-            Double year = 0.0;
-            try {
-                real = edosUtil.getSectionData(pointid,tomorrow.getTime()).getPointValueInDouble();
-                sameday = edosUtil.getSectionData(pointid,samedayZero.getTime()).getPointValueInDouble();
-                month = edosUtil.getSectionData(pointid,monthFirstZero.getTime()).getPointValueInDouble();
-                year = edosUtil.getSectionData(pointid,yearFirstZero.getTime()).getPointValueInDouble();
-
-                Double magnification = optionalMeterpoint.get().getMagnification();
-                Double xs = optionalMeterpoint.get().getXs();
-                double xlrfdl = (real - sameday) * magnification / xs;
-                qcrfdl.updateAndGet(v -> new Double((double) (v + xlrfdl)));
-                //线路日发电量
-                PointData r = new PointData();
-                r.setPointTime(currentDate.getTime());
-                r.setPointValue(String.valueOf(xlrfdl));
-                r.setPointValueInDouble(xlrfdl);
-                r.setEdnaId(linemap.get(Contant.RFDLB).getCode());
-                r.setPointName(linemap.get(Contant.RFDLB).getName());
-                resultList.add(r);
-                //线路月发电量
-                double xlyfdl = (real - month) * magnification / xs;
-                qcyfdl.updateAndGet(v -> new Double((double) (v + xlyfdl)));
-                PointData y = new PointData();
-                y.setPointTime(currentDate.getTime());
-                y.setPointValue(String.valueOf(xlyfdl));
-                y.setPointValueInDouble(xlyfdl);
-                y.setEdnaId(linemap.get(Contant.YFDLB).getCode());
-                y.setPointName(linemap.get(Contant.YFDLB).getName());
-                resultList.add(y);
-                //线路年发电量
-                double xlnfdl = (real - year) * magnification / xs;
-                qcnfdl.updateAndGet(v -> new Double((double) (v + xlnfdl)));
-                PointData n = new PointData();
-                n.setPointTime(currentDate.getTime());
-                n.setPointValue(String.valueOf(xlnfdl));
-                n.setPointValueInDouble(xlnfdl);
-                n.setEdnaId(linemap.get(Contant.NFDLB).getCode());
-                n.setPointName(linemap.get(Contant.NFDLB).getName());
-                resultList.add(n);
-            } catch (Exception e) {
-                e.printStackTrace();
-            }
-        }
-    }
-
-
-
-    private void windpowerFdl(List<PointData> resultList, Date currentDate, Map<String, Windpowerstationpointnew> wpmap, AtomicReference<Double> fcrswdl, AtomicReference<Double> fcyswdl, AtomicReference<Double> fcnswdl,String rcode,String ycode,String ncode) {
-        //风场日上网发电量
-        PointData r = new PointData();
-        r.setPointTime(currentDate.getTime());
-        r.setPointValue(String.valueOf(fcrswdl.get()));
-        r.setPointValueInDouble(fcrswdl.get());
-        r.setEdnaId(wpmap.get(rcode).getCode());
-        r.setPointName(wpmap.get(rcode).getName());
-        resultList.add(r);
-        //风场月上网发电量
-        PointData y = new PointData();
-        y.setPointTime(currentDate.getTime());
-        y.setPointValue(String.valueOf(fcyswdl.get()));
-        y.setPointValueInDouble(fcyswdl.get());
-        y.setEdnaId(wpmap.get(ycode).getCode());
-        y.setPointName(wpmap.get(ycode).getName());
-        resultList.add(y);
-        //风场年上网发电量
-        PointData n = new PointData();
-        n.setPointTime(currentDate.getTime());
-        n.setPointValue(String.valueOf(fcnswdl.get()));
-        n.setPointValueInDouble(fcnswdl.get());
-        n.setEdnaId(wpmap.get(ncode).getCode());
-        n.setPointName(wpmap.get(ncode).getName());
-        resultList.add(n);
-    }
-
-    private void qygsFdl(List<PointData> resultList, Map<String, Map<String, Windpowerstationpointnew>> wppointmap, Date currentDate, Double gsrfdl, Double gsyfdl, Double gsnfdl, AtomicReference<Double> fdrfdl, AtomicReference<Double> fdyfdl, AtomicReference<Double> fdnfdl, AtomicReference<Double> gfrfdl, AtomicReference<Double> gfyfdl, AtomicReference<Double> gfnfdl, String rcode, String ycode, String ncode) {
-        if (StringUtils.isNotEmpty(wppointmap.get("-1"))){
-            PointData fdr = new PointData();
-            fdr.setPointTime(currentDate.getTime());
-            fdr.setPointValue(String.valueOf(fdrfdl.get()));
-            fdr.setPointValueInDouble(fdrfdl.get());
-            fdr.setEdnaId(wppointmap.get("-1").get(rcode).getCode());
-            fdr.setPointName(wppointmap.get("-1").get(rcode).getName());
-            resultList.add(fdr);
-            //风电月发电量
-            PointData fdy = new PointData();
-            fdy.setPointTime(currentDate.getTime());
-            fdy.setPointValue(String.valueOf(fdyfdl.get()));
-            fdy.setPointValueInDouble(fdyfdl.get());
-            fdy.setEdnaId(wppointmap.get("-1").get(ycode).getCode());
-            fdy.setPointName(wppointmap.get("-1").get(ycode).getName());
-            resultList.add(fdy);
-            //风电年发电量
-            PointData fdn = new PointData();
-            fdn.setPointTime(currentDate.getTime());
-            fdn.setPointValue(String.valueOf(fdnfdl.get()));
-            fdn.setPointValueInDouble(fdnfdl.get());
-            fdn.setEdnaId(wppointmap.get("-1").get(ncode).getCode());
-            fdn.setPointName(wppointmap.get("-1").get(ncode).getName());
-            resultList.add(fdn);
-        }
-        if (StringUtils.isNotEmpty(wppointmap.get("-2"))){
-            //光伏日发电量
-            PointData gfr = new PointData();
-            gfr.setPointTime(currentDate.getTime());
-            gfr.setPointValue(String.valueOf(gfrfdl.get()));
-            gfr.setPointValueInDouble(gfrfdl.get());
-            gfr.setEdnaId(wppointmap.get("-2").get(rcode).getCode());
-            gfr.setPointName(wppointmap.get("-2").get(rcode).getName());
-            resultList.add(gfr);
-            //光伏月发电量
-            PointData gfy = new PointData();
-            gfy.setPointTime(currentDate.getTime());
-            gfy.setPointValue(String.valueOf(gfyfdl.get()));
-            gfy.setPointValueInDouble(gfyfdl.get());
-            gfy.setEdnaId(wppointmap.get("-2").get(ycode).getCode());
-            gfy.setPointName(wppointmap.get("-2").get(ycode).getName());
-            resultList.add(gfy);
-            //光伏年发电量
-            PointData gfn = new PointData();
-            gfn.setPointTime(currentDate.getTime());
-            gfn.setPointValue(String.valueOf(gfnfdl.get()));
-            gfn.setPointValueInDouble(gfnfdl.get());
-            gfn.setEdnaId(wppointmap.get("-2").get(ncode).getCode());
-            gfn.setPointName(wppointmap.get("-2").get(ncode).getName());
-            resultList.add(gfn);
-        }
-
-        //风场日发电量
-        gsrfdl = fdrfdl.get()+gfrfdl.get();
-        gsyfdl = fdyfdl.get()+gfyfdl.get();
-        gsnfdl = fdnfdl.get()+gfnfdl.get();
-        PointData r = new PointData();
-        r.setPointTime(currentDate.getTime());
-        r.setPointValue(String.valueOf(gsrfdl));
-        r.setPointValueInDouble(gsrfdl);
-        r.setEdnaId(wppointmap.get("0").get(rcode).getCode());
-        r.setPointName(wppointmap.get("0").get(rcode).getName());
-        resultList.add(r);
-        //风场月发电量
-        PointData y = new PointData();
-        y.setPointTime(currentDate.getTime());
-        y.setPointValue(String.valueOf(gsyfdl));
-        y.setPointValueInDouble(gsyfdl);
-        y.setEdnaId(wppointmap.get("0").get(ycode).getCode());
-        y.setPointName(wppointmap.get("0").get(ycode).getName());
-        resultList.add(y);
-        //风场年发电量
-        PointData n = new PointData();
-        n.setPointTime(currentDate.getTime());
-        n.setPointValue(String.valueOf(gsnfdl));
-        n.setPointValueInDouble(gsnfdl);
-        n.setEdnaId(wppointmap.get("0").get(ncode).getCode());
-        n.setPointName(wppointmap.get("0").get(ncode).getName());
-        resultList.add(n);
-    }
-
-
-
-
-    private void projectOrther(List<PointData> resultList, Date currentDate, AtomicReference<Double> fcrswdl, AtomicReference<Double> fcyswdl, AtomicReference<Double> fcnswdl, Map<String, Windpowerstationpointnew> projectmap, AtomicReference<Double> qcrswdl, AtomicReference<Double> qcyswdl, AtomicReference<Double> qcnswdl,String rcode,String ycode,String ncode) {
-        //-------------------------------------------期次上网电量
-        fcrswdl.updateAndGet(v -> new Double((double) (v + qcrswdl.get())));
-        //期次日上网发电量
-        PointData r = new PointData();
-        r.setPointTime(currentDate.getTime());
-        r.setPointValue(String.valueOf(qcrswdl.get()));
-        r.setPointValueInDouble(qcrswdl.get());
-        r.setEdnaId(projectmap.get(rcode).getCode());
-        r.setPointName(projectmap.get(rcode).getName());
-        resultList.add(r);
-        fcyswdl.updateAndGet(v -> new Double((double) (v + qcyswdl.get())));
-        //期次月上网发电量
-        PointData y = new PointData();
-        y.setPointTime(currentDate.getTime());
-        y.setPointValue(String.valueOf(qcyswdl.get()));
-        y.setPointValueInDouble(qcyswdl.get());
-        y.setEdnaId(projectmap.get(ycode).getCode());
-        y.setPointName(projectmap.get(ycode).getName());
-        resultList.add(y);
-        fcnswdl.updateAndGet(v -> new Double((double) (v + qcnswdl.get())));
-        //期次年上网发电量
-        PointData n = new PointData();
-        n.setPointTime(currentDate.getTime());
-        n.setPointValue(String.valueOf(qcnswdl.get()));
-        n.setPointValueInDouble(qcnswdl.get());
-        n.setEdnaId(projectmap.get(ncode).getCode());
-        n.setPointName(projectmap.get(ncode).getName());
-        resultList.add(n);
-    }
-
-    private void projectFdl(List<PointData> resultList, Date currentDate, AtomicReference<Double> fcrfdl, AtomicReference<Double> fcyfdl, AtomicReference<Double> fcnfdl, Map<String, Windpowerstationpointnew> projectmap, AtomicReference<Double> qcrfdl, AtomicReference<Double> qcyfdl, AtomicReference<Double> qcnfdl) {
-        //-------------------------------------------期次发电量
-        fcrfdl.updateAndGet(v -> new Double((double) (v + qcrfdl.get())));
-        //期次日发电量
-        PointData r = new PointData();
-        r.setPointTime(currentDate.getTime());
-        r.setPointValue(String.valueOf(qcrfdl.get()));
-        r.setPointValueInDouble(qcrfdl.get());
-        r.setEdnaId(projectmap.get(Contant.RFDLB).getCode());
-        r.setPointName(projectmap.get(Contant.RFDLB).getName());
-        resultList.add(r);
-        fcyfdl.updateAndGet(v -> new Double((double) (v + qcyfdl.get())));
-        //期次月发电量
-        PointData y = new PointData();
-        y.setPointTime(currentDate.getTime());
-        y.setPointValue(String.valueOf(qcyfdl.get()));
-        y.setPointValueInDouble(qcyfdl.get());
-        y.setEdnaId(projectmap.get(Contant.YFDLB).getCode());
-        y.setPointName(projectmap.get(Contant.YFDLB).getName());
-        resultList.add(y);
-        fcnfdl.updateAndGet(v -> new Double((double) (v + qcnfdl.get())));
-        //期次年发电量
-        PointData n = new PointData();
-        n.setPointTime(currentDate.getTime());
-        n.setPointValue(String.valueOf(qcnfdl.get()));
-        n.setPointValueInDouble(qcnfdl.get());
-        n.setEdnaId(projectmap.get(Contant.NFDLB).getCode());
-        n.setPointName(projectmap.get(Contant.NFDLB).getName());
-        resultList.add(n);
-    }
-
-
-
-}

+ 0 - 151
realtime/generationXa-service/src/main/java/com/gyee/generation/service/RealtimeSpeedPowerService.java

@@ -1,151 +0,0 @@
-package com.gyee.generation.service;
-
-import com.gyee.common.contant.Contant;
-import com.gyee.common.model.PointData;
-import com.gyee.common.util.DateUtils;
-import com.gyee.generation.init.CacheContext;
-import com.gyee.generation.model.auto.*;
-import com.gyee.generation.util.realtimesource.IEdosUtil;
-import org.springframework.stereotype.Service;
-
-import javax.annotation.Resource;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.atomic.AtomicReference;
-
-/**
- * @ClassName : RealtimeSpeedPowerService
- * @Author : xieshengjie
- * @Date: 2022/4/24 8:49
- * @Description : 场站实时风速,实时功率
- */
-@Service
-public class RealtimeSpeedPowerService {
-    @Resource
-    private IEdosUtil edosUtil;
-    private List<Windpowerstation> wpls;
-    private Map<String, List<Project>> wppromap;
-    private Map<String, List<Line>> prolinemap;
-    private Map<String, List<Windturbine>> linewtmap;
-    private Date currentDate;
-    private Map<String, Map<String, Windpowerstationpointnew>> wppointmap;
-    private Map<String, Map<String, Windpowerstationpointnew>> linepointmap;
-    private Map<String, Map<String, Windpowerstationpointnew>> propointmap;
-    private Map<String, Map<String, Windturbinetestingpointnew>> wtpAimap;
-
-    private void init(){
-        wpls = CacheContext.wpls;
-        wppromap = CacheContext.wppromap;
-        prolinemap = CacheContext.prolinemap;
-        linewtmap = CacheContext.linewtmap;
-        wppointmap = CacheContext.wppointmap;
-        linepointmap = CacheContext.linepointmap;
-        propointmap = CacheContext.propointmap;
-        wtpAimap = CacheContext.wtpAimap;
-        currentDate = DateUtils.getCurrentDate();
-    }
-
-    /**
-     * 计算场站实时风速功率
-     */
-    public void calculateRealtimeSpeedPower() throws Exception {
-        init();
-        List<PointData> resultList = new ArrayList<>();
-
-        wpls.stream().forEach(wp->{
-            AtomicReference<Double> wpSpeed = new AtomicReference<>(0.0);
-            AtomicReference<Double> wpPower = new AtomicReference<>(0.0);
-            Map<String, Windpowerstationpointnew> wppointnewMap = wppointmap.get(wp.getId());
-            Windpowerstationpointnew wpspeedpointnew = wppointnewMap.get(Contant.SSFS);
-            Windpowerstationpointnew wppowerpointnew = wppointnewMap.get(Contant.SSZGL);
-            AtomicReference<Double> wpcount = new AtomicReference<>(0.0);
-            wppromap.get(wp.getId()).stream().forEach(project -> {
-                AtomicReference<Double> projectSpeed = new AtomicReference<>(0.0);
-                AtomicReference<Double> projectPower = new AtomicReference<>(0.0);
-                Map<String, Windpowerstationpointnew> propointnewMap = propointmap.get(project.getId());
-                Windpowerstationpointnew prospeedpointnew = propointnewMap.get(Contant.SSFS);
-                Windpowerstationpointnew propowerpointnew = propointnewMap.get(Contant.SSZGL);
-                AtomicReference<Double> procount = new AtomicReference<>(0.0);
-                prolinemap.get(project.getId()).stream().forEach(line->{
-                    AtomicReference<Double> lineSpeed = new AtomicReference<>(0.0);
-                    AtomicReference<Double> linePower = new AtomicReference<>(0.0);
-                    Map<String, Windpowerstationpointnew> linepointnewMap = linepointmap.get(line.getId());
-                    Windpowerstationpointnew linespeedpointnew = linepointnewMap.get(Contant.SSFS);
-                    Windpowerstationpointnew linepowerpointnew = linepointnewMap.get(Contant.SSZGL);
-                    AtomicReference<Double> count = new AtomicReference<>(0.0);
-                    linewtmap.get(line.getId()).stream().forEach(wt->{
-                        Map<String, Windturbinetestingpointnew> windturbinetestingpointnewMap = wtpAimap.get(wt.getId());
-                        Windturbinetestingpointnew speedpoint = windturbinetestingpointnewMap.get(Contant.AI022);
-                        Windturbinetestingpointnew powerpoint = windturbinetestingpointnewMap.get(Contant.AI130);
-                        Windturbinetestingpointnew ztpoint = windturbinetestingpointnewMap.get(Contant.ZTMX);
-                        Boolean isOffline = false;
-                        try {
-                            Double ztvalue  = edosUtil.getRealData(ztpoint).getPointValueInDouble();
-                            if (ztvalue == 12.0){
-                                isOffline = true;
-                            }
-                            if (! isOffline){
-                                count.getAndSet(count.get() + 1);
-                                procount.getAndSet(procount.get() + 1);
-                                wpcount.getAndSet(wpcount.get() + 1);
-                                Double wtspeed = 0.0;
-                                Double wtpower = 0.0;
-                                try {
-                                    wtspeed = edosUtil.getRealData(speedpoint).getPointValueInDouble();
-                                    Double finalWtspeed = wtspeed;
-                                    lineSpeed.updateAndGet(v -> new Double((double) (v + finalWtspeed)));
-                                    projectSpeed.updateAndGet(v -> new Double((double) (v + finalWtspeed)));
-                                    wpSpeed.updateAndGet(v -> new Double((double) (v + finalWtspeed)));
-
-                                    wtpower = edosUtil.getRealData(powerpoint).getPointValueInDouble();
-                                    Double finalWtpower = wtpower;
-                                    linePower.updateAndGet(v -> new Double((double) (v + finalWtpower)));
-                                    projectPower.updateAndGet(v -> new Double((double) (v + finalWtpower)));
-                                    wpPower.updateAndGet(v -> new Double((double) (v + finalWtpower)));
-                                } catch (Exception e) {
-                                    e.printStackTrace();
-                                }
-                            }
-                        } catch (Exception e) {
-                            e.printStackTrace();
-                        }
-
-                    });
-                    Double linespeedvalue = count.get()!=0 ? lineSpeed.get()/count.get() : 0.0;
-                    PointData linespeedPointData = createWpPointData(linespeedpointnew, linespeedvalue);
-                    PointData linepowerPointData = createWpPointData(linepowerpointnew, linePower.get());
-                    resultList.add(linespeedPointData);
-                    resultList.add(linepowerPointData);
-                });
-
-                Double projectspeedvalue = procount.get()!=0 ? projectSpeed.get()/procount.get() : 0.0;
-                PointData projectspeedPointData = createWpPointData(prospeedpointnew, projectspeedvalue);
-                PointData projectpowerPointData = createWpPointData(propowerpointnew, projectPower.get());
-                resultList.add(projectspeedPointData);
-                resultList.add(projectpowerPointData);
-            });
-
-            Double wpspeedvalue = wpcount.get()!=0 ? wpSpeed.get()/wpcount.get() : 0.0;
-            PointData wpspeedPointData = createWpPointData(wpspeedpointnew, wpspeedvalue);
-            PointData wppowerPointData = createWpPointData(wppowerpointnew, wpPower.get());
-            resultList.add(wpspeedPointData);
-            resultList.add(wppowerPointData);
-
-        });
-        edosUtil.sendMultiPoint(resultList);
-
-
-    }
-
-    private PointData createWpPointData(Windpowerstationpointnew linepointnew, double linespeed) {
-        PointData pointData = new PointData();
-        pointData.setEdnaId(linepointnew.getCode());
-        pointData.setPointTime(currentDate.getTime());
-        pointData.setPointName(linepointnew.getName());
-        pointData.setPointValue(String.valueOf(linespeed));
-        pointData.setPointValueInDouble(linespeed);
-        return pointData;
-    }
-}

+ 0 - 82
realtime/generationXa-service/src/main/java/com/gyee/generation/service/SafetyService.java

@@ -1,82 +0,0 @@
-package com.gyee.generation.service;
-
-import com.gyee.common.contant.Contant;
-import com.gyee.common.model.PointData;
-import com.gyee.common.util.DateUtils;
-import com.gyee.generation.init.CacheContext;
-import com.gyee.generation.model.auto.Line;
-import com.gyee.generation.model.auto.Project;
-import com.gyee.generation.model.auto.Windpowerstation;
-import com.gyee.generation.model.auto.Windpowerstationpointnew;
-import com.gyee.generation.util.realtimesource.IEdosUtil;
-import org.springframework.stereotype.Service;
-
-import javax.annotation.Resource;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-
-/**
- * @ClassName : SafetyService
- * @Author : xieshengjie
- * @Date: 2022/5/30 15:10
- * @Description : 安全天数
- */
-@Service
-public class SafetyService {
-    @Resource
-    private IEdosUtil edosUtil;
-
-    private Date currentDate;
-
-    public void safetyReatimel() throws Exception {
-        List<PointData> resultList = new ArrayList<>();
-        List<Windpowerstation> wpls = CacheContext.wpls;
-        Map<String, Map<String, Windpowerstationpointnew>> wppointmap = CacheContext.wppointmap;
-        Map<String, Map<String, Windpowerstationpointnew>> propointmap = CacheContext.propointmap;
-        Map<String, List<Project>> wppromap = CacheContext.wppromap;
-        Map<String, Map<String, Windpowerstationpointnew>> linepointmap = CacheContext.linepointmap;
-        Map<String, List<Line>> prolinemap = CacheContext.prolinemap;
-        wpls.stream().forEach(wp->{
-            Windpowerstationpointnew windpowerstationpointnew = wppointmap.get(wp.getId()).get(Contant.AQTS);
-            double aqts = 0;
-            try {
-                double doublevalue = edosUtil.getRealData(windpowerstationpointnew).getPointValueInDouble();
-                aqts = doublevalue+1;
-            } catch (Exception e) {
-                e.printStackTrace();
-            }
-            PointData wpPointData = createWpPointData(windpowerstationpointnew, aqts);
-            resultList.add(wpPointData);
-            List<Project> projects = wppromap.get(wp.getId());
-            double finalAqts = aqts;
-            double finalAqts1 = aqts;
-            projects.stream().forEach(project -> {
-                Windpowerstationpointnew windpowerstationpointnew1 = propointmap.get(project.getId()).get(Contant.AQTS);
-                PointData proPointData = createWpPointData(windpowerstationpointnew1, finalAqts);
-                resultList.add(proPointData);
-                List<Line> lineList = prolinemap.get(project.getId());
-                lineList.stream().forEach(line -> {
-                    Windpowerstationpointnew windpowerstationpointnew2 = linepointmap.get(line.getId()).get(Contant.AQTS);
-                    PointData linePointData = createWpPointData(windpowerstationpointnew2, finalAqts1);
-                    resultList.add(linePointData);
-                });
-            });
-
-        });
-        edosUtil.sendMultiPoint(resultList);
-    }
-
-
-    private PointData createWpPointData(Windpowerstationpointnew linepointnew, double linespeed) {
-        currentDate = DateUtils.getSamedayZero();
-        PointData pointData = new PointData();
-        pointData.setEdnaId(linepointnew.getCode());
-        pointData.setPointTime(currentDate.getTime());
-        pointData.setPointName(linepointnew.getName());
-        pointData.setPointValue(String.valueOf(linespeed));
-        pointData.setPointValueInDouble(linespeed);
-        return pointData;
-    }
-}

+ 0 - 723
realtime/generationXa-service/src/main/java/com/gyee/generation/service/StatusService.java

@@ -1,723 +0,0 @@
-package com.gyee.generation.service;
-
-import com.gyee.common.contant.Contant;
-import com.gyee.common.model.PointData;
-import com.gyee.common.model.StringUtils;
-import com.gyee.common.util.DateUtils;
-import com.gyee.generation.init.CacheContext;
-import com.gyee.generation.model.auto.*;
-import com.gyee.generation.util.realtimesource.IEdosUtil;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.stereotype.Service;
-
-import javax.annotation.Resource;
-import java.util.*;
-import java.util.concurrent.atomic.AtomicInteger;
-import java.util.stream.Collectors;
-
-/**
- * @ClassName : StatusService
- * @Author : xieshengjie
- * @Date: 2022/3/28 14:22
- * @Description : 状态计算
- */
-@Service
-public class StatusService {
-
-    private Map<String, List<Windturbinestatusdi>> statusMap;
-    private List<Windturbine> wtls;
-    private List<Project> projects;
-    private Map<String, Map<String, Windturbinetestingpointnew>> wtpAimap;
-    private Map<String,Map<String, Windpowerstationpointnew>> linepointmap;
-    private Map<String,Map<String, Windpowerstationpointnew>> propointmap;
-    private Map<String,Map<String, Windpowerstationpointnew>> wppointmap;
-    private Date currentDate;
-    private List<Windpowerstation> wpls;
-    private List<Line> lines;
-    private Map<String, Equipmentmodel> modelMap;
-
-    public static Map<String,List<Project>> wppromap;
-    public static Map<String,List<Line>> prolinemap;
-    public static Map<String,List<Windturbine>> linewtmap;
-    @Resource
-    private IEdosUtil edosUtil;
-//    @Resource
-//    private IEdosUtil edosUtilTd;
-    @Value("${clauStatus.ai}")
-    private String clauStatusAi;
-    @Value("${clauStatus.di}")
-    private String clauStatusDi;
-    @Value("${second}")
-    private String second;
-    @Value("${AI134}")
-    private String AI134;
-    @Value("${AI178}")
-    private String AI178;
-
-
-    public void init(){
-        statusMap = CacheContext.statusMap;
-        wtls = CacheContext.wtls;
-        wpls = CacheContext.wpls;
-        lines = CacheContext.lines;
-        projects = CacheContext.projects;
-        wtpAimap = CacheContext.wtpAimap;
-        linepointmap = CacheContext.linepointmap;
-        propointmap = CacheContext.propointmap;
-        wppointmap = CacheContext.wppointmap;
-        currentDate = DateUtils.getCurrentDate();
-        modelMap = CacheContext.modelMap;
-        wppromap = CacheContext.wppromap;
-        prolinemap = CacheContext.prolinemap;
-        linewtmap = CacheContext.linewtmap;
-    }
-
-    /**
-     * 计算状态
-     * @throws Exception
-     */
-    public void calculateStatus() throws Exception {
-        init();
-        List<PointData> resultList = new ArrayList<>();
-        projects.stream().forEach(project->{
-            wtls.stream().filter(i->i.getProjectid().equals(project.getId())).forEach(wt->{
-                Map<String, Windturbinetestingpointnew> stringWindturbinetestingpointnewMap = wtpAimap.get(wt.getId());
-                Windturbinetestingpointnew ztmxPoint = stringWindturbinetestingpointnewMap.get(Contant.ZTMX);
-                Windturbinetestingpointnew fj5tPoint = stringWindturbinetestingpointnewMap.get(Contant.FJ5T);
-                Windturbinetestingpointnew ai130 = stringWindturbinetestingpointnewMap.get(Contant.AI130);
-                String[] interruption = Contant.INTERRUPTION.split(",");
-                List<String> interruptionList = new ArrayList<>();
-                Arrays.stream(interruption).forEach(i->{
-                    Windturbinetestingpointnew windturbinetestingpointnew = stringWindturbinetestingpointnewMap.get(i);
-                    if (!windturbinetestingpointnew.getCode().equals("INITIAL")){
-                        interruptionList.add(windturbinetestingpointnew.getCode());
-                    }
-                });
-                Double status = 1.0;
-                Double mxstatus = 2.0;
-                try {
-                    if (StringUtils.isEmpty(interruptionList)){
-                        mxstatus = 12.0;
-                        status = 3.0;
-                    }
-                    else {
-                        List<PointData> interruptionRealData = edosUtil.getRealData(interruptionList);
-                        List<PointData> collect = interruptionRealData.stream().filter(i -> (currentDate.getTime() - i.getPointTime()) / 1000 > Integer.parseInt(second)).collect(Collectors.toList());
-                        if (collect.size()!=interruptionRealData.size()){
-                            Double ztmx = edosUtil.getRealData(ztmxPoint).getPointValueInDouble();
-                            if (ztmx == 7 || ztmx == 9 || ztmx == 10 || ztmx == 11 || ztmx == 4 || ztmx == 5 ){     //手打状态
-                                mxstatus = ztmx;
-                            }
-                            if (clauStatusAi.contains(wt.getProjectid())){
-                                //多状态根据一个点来判断
-                                Optional<Windturbinestatusdi> first = statusMap.get(wt.getId()).stream().filter(w -> w.getUniformcode().equals(Contant.AI422)).findFirst();
-                                if (first.isPresent()){
-                                    Windturbinestatusdi windturbinestatusdi = first.get();
-                                    if (wt.getModelid().equals("EN141/2.65") || wt.getModelid().equals("EN141/3.2")){
-                                        //远景
-                                        int pointValueInDouble = (int) edosUtil.getRealData(windturbinestatusdi.getId()).getPointValueInDouble();
-                                        switch (pointValueInDouble){
-                                            case 1:
-                                            case 4:
-                                                mxstatus = 1.0;
-                                                break;
-                                            case 2:
-                                                mxstatus = 6.0;
-                                                break;
-                                            case 3:
-                                                mxstatus = 11.0;
-                                                break;
-                                            case 5:
-                                            case 6:
-                                                mxstatus = 2.0;
-                                                break;
-                                            case 7:
-                                                mxstatus = 4.0;
-                                                break;
-                                            case 8:
-                                                mxstatus = 12.0;
-                                                break;
-                                            case 9:
-                                                mxstatus = 0.0;
-                                                break;
-                                            case 10:
-                                                mxstatus = 10.0;
-                                                break;
-                                            case 11:
-                                            case 12:
-                                                mxstatus = 8.0;
-                                                break;
-                                        }
-                                    }else {
-                                        //联合动力
-                                        double pointValueInDouble = edosUtil.getRealData(windturbinestatusdi.getId()).getPointValueInDouble();
-                                        switch ((int) pointValueInDouble){
-                                            case 0:
-                                                mxstatus = 12.0;
-                                                break;
-                                            case 1:
-                                                mxstatus = 6.0;
-                                                break;
-                                            case 2:
-                                                mxstatus = 8.0;
-                                                break;
-                                            case 3:
-                                                mxstatus = 0.0;
-                                                break;
-                                            case 4:
-                                            case 5:
-                                                mxstatus = 2.0;
-                                                break;
-                                            case 6:
-                                                mxstatus = 1.0;
-                                                break;
-                                            default:
-                                                mxstatus = 2.0;
-                                        }
-                                    }
-                                }
-                            }
-                            if (clauStatusDi.contains(wt.getProjectid())){
-                                //每个状态一个状态点
-                                List<Windturbinestatusdi> windturbinestatusdis = statusMap.get(wt.getId()).stream().filter(w -> w.getUniformcode().equals(Contant.MX000) || w.getUniformcode().equals(Contant.MX002) || w.getUniformcode().equals(Contant.MX004) || w.getUniformcode().equals(Contant.MX006) || w.getUniformcode().equals(Contant.MX008)).collect(Collectors.toList());
-                                for(Windturbinestatusdi w : windturbinestatusdis){
-                                    PointData realData = edosUtil.getRealData(w.getId());
-                                    if (realData.getPointValueInDouble()==1){
-                                        mxstatus = Double.parseDouble(w.getTypeid());
-                                        break;
-                                    }
-                                }
-                            }
-                            if (mxstatus == 2){
-                                boolean isJcl = isJcl(wt, stringWindturbinetestingpointnewMap);
-                                double power = edosUtil.getRealData(ai130).getPointValueInDouble();
-                                if (power<=0){
-                                    mxstatus=0.0;
-                                }else if (isJcl){
-                                    mxstatus = 3.0;
-                                }
-                            }
-                        }else{
-                            //离线
-                            mxstatus = 12.0;
-                        }
-                        if (mxstatus == 0 || mxstatus == 1){
-                            status = 0.0;
-                        }else if(mxstatus == 2 || mxstatus == 3){
-                            status = 1.0;
-                        }else if(mxstatus == 4 || mxstatus == 5){
-                            status = 5.0;
-                        }else if(mxstatus == 6 || mxstatus == 7){
-                            status = 2.0;
-                        }else if(mxstatus == 8 || mxstatus == 9){
-                            status = 4.0;
-                        }else if(mxstatus == 10 || mxstatus == 11){
-                            status = 6.0;
-                        }else if(mxstatus == 12){
-                            status = 3.0;
-                        }
-                    }
-
-                    PointData ztmx = createPointData(ztmxPoint, mxstatus);
-                    PointData fj5t = createPointData(fj5tPoint, status);
-                    resultList.add(ztmx);
-                    resultList.add(fj5t);
-                } catch (Exception e) {
-                    e.printStackTrace();
-                }
-            });
-        });
-//        edosUtilTd.sendMultiPoint(resultList);
-        edosUtil.sendMultiPoint(resultList);
-    }
-
-    /**
-     * 计算状态台数
-     */
-    public void calculateStatusNumber() throws Exception {
-        init();
-        List<PointData> resultList = new ArrayList<>();
-        wpls.stream().forEach(wp->{
-            List<Project> projects = wppromap.get(wp.getId());
-            Map<String, Windpowerstationpointnew> wpmap = wppointmap.get(wp.getId());
-            AtomicInteger wpdjnum = new AtomicInteger();
-            AtomicInteger wptjnum = new AtomicInteger();
-            AtomicInteger wpfdnum = new AtomicInteger();
-            AtomicInteger wpfdjclnum = new AtomicInteger();
-            AtomicInteger wpxdjclnum = new AtomicInteger();
-            AtomicInteger wpxdtjnum = new AtomicInteger();
-            AtomicInteger wpgznum = new AtomicInteger();
-            AtomicInteger wpcngznum = new AtomicInteger();
-            AtomicInteger wpjxnum = new AtomicInteger();
-            AtomicInteger wpcnjxnum = new AtomicInteger();
-            AtomicInteger wpdwslnum = new AtomicInteger();
-            AtomicInteger wphjslnum = new AtomicInteger();
-            AtomicInteger wplxnum = new AtomicInteger();
-
-            //六种
-            AtomicInteger wpdjts = new AtomicInteger();
-            AtomicInteger wpgzts = new AtomicInteger();
-            AtomicInteger wptxzd = new AtomicInteger();
-            AtomicInteger wpwhtj = new AtomicInteger();
-            AtomicInteger wpxdts = new AtomicInteger();
-            AtomicInteger wpyxts = new AtomicInteger();
-            AtomicInteger wpslts = new AtomicInteger();
-            projects.stream().forEach(project->{
-                List<Line> lineList = prolinemap.get(project.getId());
-                Map<String, Windpowerstationpointnew> projectmap = propointmap.get(project.getId());
-                AtomicInteger prodjnum = new AtomicInteger();
-                AtomicInteger protjnum = new AtomicInteger();
-                AtomicInteger profdnum = new AtomicInteger();
-                AtomicInteger profdjclnum = new AtomicInteger();
-                AtomicInteger proxdjclnum = new AtomicInteger();
-                AtomicInteger proxdtjnum = new AtomicInteger();
-                AtomicInteger progznum = new AtomicInteger();
-                AtomicInteger procngznum = new AtomicInteger();
-                AtomicInteger projxnum = new AtomicInteger();
-                AtomicInteger procnjxnum = new AtomicInteger();
-                AtomicInteger prodwslnum = new AtomicInteger();
-                AtomicInteger prohjslnum = new AtomicInteger();
-                AtomicInteger prolxnum = new AtomicInteger();
-
-                //六种
-                AtomicInteger prodjts = new AtomicInteger();
-                AtomicInteger progzts = new AtomicInteger();
-                AtomicInteger protxzd = new AtomicInteger();
-                AtomicInteger prowhtj = new AtomicInteger();
-                AtomicInteger proxdts = new AtomicInteger();
-                AtomicInteger proyxts = new AtomicInteger();
-                AtomicInteger proslts = new AtomicInteger();
-
-                lineList.stream().forEach(line->{
-                    List<Windturbine> windturbines = linewtmap.get(line.getId());
-                    Map<String, Windpowerstationpointnew> linemap = linepointmap.get(line.getId());
-                    AtomicInteger djnum = new AtomicInteger();
-                    AtomicInteger tjnum = new AtomicInteger();
-                    AtomicInteger fdnum = new AtomicInteger();
-                    AtomicInteger fdjclnum = new AtomicInteger();
-                    AtomicInteger xdjclnum = new AtomicInteger();
-                    AtomicInteger xdtjnum = new AtomicInteger();
-                    AtomicInteger gznum = new AtomicInteger();
-                    AtomicInteger cngznum = new AtomicInteger();
-                    AtomicInteger jxnum = new AtomicInteger();
-                    AtomicInteger cnjxnum = new AtomicInteger();
-                    AtomicInteger dwslnum = new AtomicInteger();
-                    AtomicInteger hjslnum = new AtomicInteger();
-                    AtomicInteger lxnum = new AtomicInteger();
-                    //六种
-                    AtomicInteger djts = new AtomicInteger();
-                    AtomicInteger gzts = new AtomicInteger();
-                    AtomicInteger txzd = new AtomicInteger();
-                    AtomicInteger whtj = new AtomicInteger();
-                    AtomicInteger xdts = new AtomicInteger();
-                    AtomicInteger yxts = new AtomicInteger();
-                    AtomicInteger slts = new AtomicInteger();
-                    windturbines.stream().forEach(wt->{
-                        Windturbinetestingpointnew windturbinetestingpointnew = wtpAimap.get(wt.getId()).get(Contant.ZTMX);
-                        try {
-                            double valueInDouble = edosUtil.getRealData(windturbinetestingpointnew).getPointValueInDouble();
-                            switch ((int) valueInDouble){
-                                case 0:
-                                    djnum.getAndIncrement();
-                                    break;
-                                case 1:
-                                    tjnum.getAndIncrement();
-                                    break;
-                                case 2:
-                                    fdnum.getAndIncrement();
-                                    break;
-                                case 3:
-                                    fdjclnum.getAndIncrement();
-                                    break;
-                                case 4:
-                                    xdjclnum.getAndIncrement();
-                                    break;
-                                case 5:
-                                    xdtjnum.getAndIncrement();
-                                    break;
-                                case 6:
-                                    gznum.getAndIncrement();
-                                    break;
-                                case 7:
-                                    cngznum.getAndIncrement();
-                                    break;
-                                case 8:
-                                    jxnum.getAndIncrement();
-                                    break;
-                                case 9:
-                                    cnjxnum.getAndIncrement();
-                                    break;
-                                case 10:
-                                    dwslnum.getAndIncrement();
-                                    break;
-                                case 11:
-                                    hjslnum.getAndIncrement();
-                                    break;
-                                case 12:
-                                    lxnum.getAndIncrement();
-                                    break;
-                                default:
-                                    fdnum.getAndIncrement();
-                            }
-                        } catch (Exception e) {
-                            e.printStackTrace();
-                        }
-                    });
-                    //待机台数0
-                    Windpowerstationpointnew djnumPointNew = linemap.get(Contant.DJNUM);
-                    PointData djnumPoint = createWpPoint(djnum, djnumPointNew);
-                    prodjnum.addAndGet(djnum.intValue());
-                    resultList.add(djnumPoint);
-                    //停机台数1
-                    Windpowerstationpointnew tjnumPointNew = linemap.get(Contant.TJNUM);
-                    PointData tjnumPoint = createWpPoint(tjnum, tjnumPointNew);
-                    protjnum.addAndGet(tjnum.intValue());
-                    resultList.add(tjnumPoint);
-                    //待机台数6-0
-                    djts.addAndGet(djnum.intValue()+tjnum.intValue());
-                    Windpowerstationpointnew djtsPointNew = linemap.get(Contant.DJTS);
-                    PointData djtsPoint = createWpPoint(djts, djtsPointNew);
-                    resultList.add(djtsPoint);
-                    //运行台数2
-                    Windpowerstationpointnew fdnumPointNew = linemap.get(Contant.FDNUM);
-                    PointData fdnumPoint = createWpPoint(fdnum, fdnumPointNew);
-                    profdnum.addAndGet(fdnum.intValue());
-                    resultList.add(fdnumPoint);
-                    //降出力台数3
-                    Windpowerstationpointnew fdjclnumPointNew = linemap.get(Contant.FDJCLNUM);
-                    PointData fdjclnumPoint = createWpPoint(fdjclnum, fdjclnumPointNew);
-                    profdjclnum.addAndGet(fdjclnum.intValue());
-                    resultList.add(fdjclnumPoint);
-                    //运行台数6-1
-                    yxts.addAndGet(fdnum.intValue()+fdjclnum.intValue());
-                    Windpowerstationpointnew yxtsPointNew = linemap.get(Contant.YXTS);
-                    PointData yxtsPoint = createWpPoint(yxts, yxtsPointNew);
-                    resultList.add(yxtsPoint);
-
-                    //限电降出力台数4
-                    Windpowerstationpointnew xdjclnumPointNew = linemap.get(Contant.XDJCLNUM);
-                    PointData xdjclnumPoint = createWpPoint(xdjclnum, xdjclnumPointNew);
-                    proxdjclnum.addAndGet(xdjclnum.intValue());
-                    resultList.add(xdjclnumPoint);
-                    //限电停机台数5
-                    Windpowerstationpointnew xdtjnumPointNew = linemap.get(Contant.XDTJNUM);
-                    PointData xdtjnumPoint = createWpPoint(xdtjnum, xdtjnumPointNew);
-                    proxdtjnum.addAndGet(xdtjnum.intValue());
-                    resultList.add(xdtjnumPoint);
-                    //限电台数6-5
-                    xdts.addAndGet(xdjclnum.intValue()+xdtjnum.intValue());
-                    Windpowerstationpointnew xdtsPointNew = linemap.get(Contant.XDTS);
-                    PointData xdtsPoint = createWpPoint(xdts, xdtsPointNew);
-                    resultList.add(xdtsPoint);
-
-                    //故障台数6
-                    Windpowerstationpointnew gznumPointNew = linemap.get(Contant.GZNUM);
-                    PointData gznumPoint = createWpPoint(gznum, gznumPointNew);
-                    progznum.addAndGet(gznum.intValue());
-                    resultList.add(gznumPoint);
-                    //故障受累台数7
-                    Windpowerstationpointnew cngznumPointNew = linemap.get(Contant.CNGZNUM);
-                    PointData cngznumPoint = createWpPoint(cngznum, cngznumPointNew);
-                    procngznum.addAndGet(cngznum.intValue());
-                    resultList.add(cngznumPoint);
-
-
-                    //检修台数8
-                    Windpowerstationpointnew jxnumPointNew = linemap.get(Contant.JXNUM);
-                    PointData jxnumPoint = createWpPoint(jxnum, jxnumPointNew);
-                    projxnum.addAndGet(jxnum.intValue());
-                    resultList.add(jxnumPoint);
-                    //检修受累台数9
-                    Windpowerstationpointnew cnjxnumPointNew = linemap.get(Contant.CNJXNUM);
-                    PointData cnjxnumPoint = createWpPoint(cnjxnum, cnjxnumPointNew);
-                    procnjxnum.addAndGet(cnjxnum.intValue());
-                    resultList.add(cnjxnumPoint);
-
-                    //检修台数6-4
-                    whtj.addAndGet(jxnum.intValue()+cnjxnum.intValue());
-                    Windpowerstationpointnew whtjPointNew = linemap.get(Contant.WHTJ);
-                    PointData whtjPoint = createWpPoint(whtj, whtjPointNew);
-                    resultList.add(whtjPoint);
-                    //电网受累台数10
-                    Windpowerstationpointnew dwslnumPointNew = linemap.get(Contant.DWSLNUM);
-                    PointData dwslnumPoint = createWpPoint(dwslnum, dwslnumPointNew);
-                    prodwslnum.addAndGet(dwslnum.intValue());
-                    resultList.add(dwslnumPoint);
-                    //环境受累台数11
-                    Windpowerstationpointnew hjslnumPointNew = linemap.get(Contant.HJSLNUM);
-                    PointData hjslnumPoint = createWpPoint(hjslnum, hjslnumPointNew);
-                    prohjslnum.addAndGet(hjslnum.intValue());
-                    resultList.add(hjslnumPoint);
-
-                    //故障台数6-2
-                    gzts.addAndGet(gznum.intValue()+cngznum.intValue());
-                    Windpowerstationpointnew gztsPointNew = linemap.get(Contant.GZTJ);
-                    PointData gztjPoint = createWpPoint(gzts, gztsPointNew);
-                    resultList.add(gztjPoint);
-                    //受累台数6-6
-                    slts.addAndGet(dwslnum.intValue()+hjslnum.intValue());
-                    Windpowerstationpointnew sltsPointNew = linemap.get(Contant.SLTS);
-                    PointData sltjPoint = createWpPoint(slts, sltsPointNew);
-                    resultList.add(sltjPoint);
-
-                    //离线台数12
-                    Windpowerstationpointnew lxnumPointNew = linemap.get(Contant.LXNUM);
-                    Windpowerstationpointnew txzdPointNew = linemap.get(Contant.TXZD);
-                    PointData lxnumPoint = createWpPoint(lxnum, lxnumPointNew);
-                    PointData txzdPoint = createWpPoint(lxnum, txzdPointNew);
-                    prolxnum.addAndGet(lxnum.intValue());
-                    resultList.add(lxnumPoint);
-                    resultList.add(txzdPoint);
-                });
-                //待机台数0
-                Windpowerstationpointnew djnumPointNew = projectmap.get(Contant.DJNUM);
-                PointData djnumPoint = createWpPoint(prodjnum, djnumPointNew);
-                wpdjnum.addAndGet(prodjnum.intValue());
-                resultList.add(djnumPoint);
-                //停机台数1
-                Windpowerstationpointnew tjnumPointNew = projectmap.get(Contant.TJNUM);
-                PointData tjnumPoint = createWpPoint(protjnum, tjnumPointNew);
-                wptjnum.addAndGet(protjnum.intValue());
-                resultList.add(tjnumPoint);
-                //待机台数6-0
-                Windpowerstationpointnew djtsPointNew = projectmap.get(Contant.DJTS);
-                prodjts.addAndGet(prodjnum.intValue()+protjnum.intValue());
-                PointData djtsPoint = createWpPoint(prodjts, djtsPointNew);
-                resultList.add(djtsPoint);
-
-                //运行台数2
-                Windpowerstationpointnew fdnumPointNew = projectmap.get(Contant.FDNUM);
-                PointData fdnumPoint = createWpPoint(profdnum, fdnumPointNew);
-                wpfdnum.addAndGet(profdnum.intValue());
-                resultList.add(fdnumPoint);
-                //降出力台数3
-                Windpowerstationpointnew fdjclnumPointNew = projectmap.get(Contant.FDJCLNUM);
-                PointData fdjclnumPoint = createWpPoint(profdjclnum, fdjclnumPointNew);
-                wpfdjclnum.addAndGet(profdjclnum.intValue());
-                resultList.add(fdjclnumPoint);
-                //运行台数6-1
-                Windpowerstationpointnew yxtsPointNew = projectmap.get(Contant.YXTS);
-                proyxts.addAndGet(profdnum.intValue()+profdjclnum.intValue());
-                PointData yxtsPoint = createWpPoint(proyxts, yxtsPointNew);
-                resultList.add(yxtsPoint);
-
-                //限电降出力台数4
-                Windpowerstationpointnew xdjclnumPointNew = projectmap.get(Contant.XDJCLNUM);
-                PointData xdjclnumPoint = createWpPoint(proxdjclnum, xdjclnumPointNew);
-                wpxdjclnum.addAndGet(proxdjclnum.intValue());
-                resultList.add(xdjclnumPoint);
-                //限电停机台数5
-                Windpowerstationpointnew xdtjnumPointNew = projectmap.get(Contant.XDTJNUM);
-                PointData xdtjnumPoint = createWpPoint(proxdtjnum, xdtjnumPointNew);
-                wpxdtjnum.addAndGet(proxdtjnum.intValue());
-                resultList.add(xdtjnumPoint);
-                //限电台数6-5
-                Windpowerstationpointnew xdtsPointNew = projectmap.get(Contant.XDTS);
-                proxdts.addAndGet(proxdjclnum.intValue()+proxdtjnum.intValue());
-                PointData xdtsPoint = createWpPoint(proxdts, xdtsPointNew);
-                resultList.add(xdtsPoint);
-
-                //故障台数6
-                Windpowerstationpointnew gznumPointNew = projectmap.get(Contant.GZNUM);
-                PointData gznumPoint = createWpPoint(progznum, gznumPointNew);
-                wpgznum.addAndGet(progznum.intValue());
-                resultList.add(gznumPoint);
-                //故障受累台数7
-                Windpowerstationpointnew cngznumPointNew = projectmap.get(Contant.CNGZNUM);
-                PointData cngznumPoint = createWpPoint(procngznum, cngznumPointNew);
-                wpcngznum.addAndGet(procngznum.intValue());
-                resultList.add(cngznumPoint);
-
-
-                //检修台数8
-                Windpowerstationpointnew jxnumPointNew = projectmap.get(Contant.JXNUM);
-                PointData jxnumPoint = createWpPoint(projxnum, jxnumPointNew);
-                wpjxnum.addAndGet(projxnum.intValue());
-                resultList.add(jxnumPoint);
-                //检修受累台数9
-                Windpowerstationpointnew cnjxnumPointNew = projectmap.get(Contant.CNJXNUM);
-                PointData cnjxnumPoint = createWpPoint(procnjxnum, cnjxnumPointNew);
-                wpcnjxnum.addAndGet(procnjxnum.intValue());
-                resultList.add(cnjxnumPoint);
-
-                //检修台数6-4
-                Windpowerstationpointnew jxtsPointNew = projectmap.get(Contant.WHTJ);
-                prowhtj.addAndGet(projxnum.intValue()+procnjxnum.intValue());
-                PointData jxtsPoint = createWpPoint(prowhtj, jxtsPointNew);
-                resultList.add(jxtsPoint);
-                //电网受累台数10
-                Windpowerstationpointnew dwslnumPointNew = projectmap.get(Contant.DWSLNUM);
-                PointData dwslnumPoint = createWpPoint(prodwslnum, dwslnumPointNew);
-                wpdwslnum.addAndGet(prodwslnum.intValue());
-                resultList.add(dwslnumPoint);
-                //环境受累台数11
-                Windpowerstationpointnew hjslnumPointNew = projectmap.get(Contant.HJSLNUM);
-                PointData hjslnumPoint = createWpPoint(prohjslnum, hjslnumPointNew);
-                wphjslnum.addAndGet(prohjslnum.intValue());
-                resultList.add(hjslnumPoint);
-                //故障台数6-2
-                Windpowerstationpointnew gztsPointNew = projectmap.get(Contant.GZTJ);
-                progzts.addAndGet(progznum.intValue()+procngznum.intValue());
-                PointData gztsPoint = createWpPoint(progzts, gztsPointNew);
-                resultList.add(gztsPoint);
-                //受累台数6-6
-                Windpowerstationpointnew sltsPointNew = projectmap.get(Contant.SLTS);
-                proslts.addAndGet(prodwslnum.intValue()+prohjslnum.intValue());
-                PointData sltsPoint = createWpPoint(proslts, sltsPointNew);
-                resultList.add(sltsPoint);
-                //离线台数12
-                Windpowerstationpointnew lxnumPointNew = projectmap.get(Contant.LXNUM);
-                Windpowerstationpointnew txzdPointNew = projectmap.get(Contant.TXZD);
-                PointData lxnumPoint = createWpPoint(prolxnum, lxnumPointNew);
-                PointData txzdPoint = createWpPoint(prolxnum, txzdPointNew);
-                wplxnum.addAndGet(prolxnum.intValue());
-                resultList.add(lxnumPoint);
-                resultList.add(txzdPoint);
-            });
-            //待机台数0
-            Windpowerstationpointnew djnumPointNew = wpmap.get(Contant.DJNUM);
-            PointData djnumPoint = createWpPoint(wpdjnum, djnumPointNew);
-            resultList.add(djnumPoint);
-            //停机台数1
-            Windpowerstationpointnew tjnumPointNew = wpmap.get(Contant.TJNUM);
-            PointData tjnumPoint = createWpPoint(wptjnum, tjnumPointNew);
-            resultList.add(tjnumPoint);
-
-            //待机台数6-0
-            Windpowerstationpointnew djtsPointNew = wpmap.get(Contant.DJTS);
-            wpdjts.addAndGet(wpdjnum.intValue()+wptjnum.intValue());
-            PointData djtsPoint = createWpPoint(wpdjts, djtsPointNew);
-            resultList.add(djtsPoint);
-            //运行台数2
-            Windpowerstationpointnew fdnumPointNew = wpmap.get(Contant.FDNUM);
-            PointData fdnumPoint = createWpPoint(wpfdnum, fdnumPointNew);
-            resultList.add(fdnumPoint);
-            //降出力台数3
-            Windpowerstationpointnew fdjclnumPointNew = wpmap.get(Contant.FDJCLNUM);
-            PointData fdjclnumPoint = createWpPoint(wpfdjclnum, fdjclnumPointNew);
-            resultList.add(fdjclnumPoint);
-
-            //运行台数6-1
-            Windpowerstationpointnew yxtsPointNew = wpmap.get(Contant.YXTS);
-            wpyxts.addAndGet(wpfdnum.intValue()+wpfdjclnum.intValue());
-            PointData yxtsPoint = createWpPoint(wpyxts, yxtsPointNew);
-            resultList.add(yxtsPoint);
-            //限电降出力台数4
-            Windpowerstationpointnew xdjclnumPointNew = wpmap.get(Contant.XDJCLNUM);
-            PointData xdjclnumPoint = createWpPoint(wpxdjclnum, xdjclnumPointNew);
-            resultList.add(xdjclnumPoint);
-            //限电停机台数5
-            Windpowerstationpointnew xdtjnumPointNew = wpmap.get(Contant.XDTJNUM);
-            PointData xdtjnumPoint = createWpPoint(wpxdtjnum, xdtjnumPointNew);
-            resultList.add(xdtjnumPoint);
-
-            //限电台数6-5
-            Windpowerstationpointnew xdtsPointNew = wpmap.get(Contant.XDTS);
-            wpxdts.addAndGet(wpxdjclnum.intValue()+wpxdtjnum.intValue());
-            PointData xdtsPoint = createWpPoint(wpxdts, xdtsPointNew);
-            resultList.add(xdtsPoint);
-            //故障台数6
-            Windpowerstationpointnew gznumPointNew = wpmap.get(Contant.GZNUM);
-            PointData gznumPoint = createWpPoint(wpgznum, gznumPointNew);
-            resultList.add(gznumPoint);
-            //故障受累台数7
-            Windpowerstationpointnew cngznumPointNew = wpmap.get(Contant.CNGZNUM);
-            PointData cngznumPoint = createWpPoint(wpcngznum, cngznumPointNew);
-            resultList.add(cngznumPoint);
-
-
-            //检修台数8
-            Windpowerstationpointnew jxnumPointNew = wpmap.get(Contant.JXNUM);
-            PointData jxnumPoint = createWpPoint(wpjxnum, jxnumPointNew);
-            resultList.add(jxnumPoint);
-            //检修受累台数9
-            Windpowerstationpointnew cnjxnumPointNew = wpmap.get(Contant.CNJXNUM);
-            PointData cnjxnumPoint = createWpPoint(wpcnjxnum, cnjxnumPointNew);
-            resultList.add(cnjxnumPoint);
-            //检修台数6-4
-            Windpowerstationpointnew jxtsPointNew = wpmap.get(Contant.WHTJ);
-            wpwhtj.addAndGet(wpjxnum.intValue()+wpcnjxnum.intValue());
-            PointData jxtsPoint = createWpPoint(wpwhtj, jxtsPointNew);
-            resultList.add(jxtsPoint);
-            //电网受累台数10
-            Windpowerstationpointnew dwslnumPointNew = wpmap.get(Contant.DWSLNUM);
-            PointData dwslnumPoint = createWpPoint(wpdwslnum, dwslnumPointNew);
-            resultList.add(dwslnumPoint);
-            //环境受累台数11
-            Windpowerstationpointnew hjslnumPointNew = wpmap.get(Contant.HJSLNUM);
-            PointData hjslnumPoint = createWpPoint(wphjslnum, hjslnumPointNew);
-            resultList.add(hjslnumPoint);
-            //故障台数6-2
-            Windpowerstationpointnew gztsPointNew = wpmap.get(Contant.GZTJ);
-            wpgzts.addAndGet(wpgznum.intValue()+wpcngznum.intValue());
-            PointData gztsPoint = createWpPoint(wpgzts, gztsPointNew);
-            resultList.add(gztsPoint);
-            //受累台数6-6
-            Windpowerstationpointnew sltsPointNew = wpmap.get(Contant.SLTS);
-            wpslts.addAndGet(wpdwslnum.intValue()+wphjslnum.intValue());
-            PointData sltsPoint = createWpPoint(wpslts, sltsPointNew);
-            resultList.add(sltsPoint);
-            //离线台数12
-            Windpowerstationpointnew lxnumPointNew = wpmap.get(Contant.LXNUM);
-            Windpowerstationpointnew txzdPointNew = wpmap.get(Contant.TXZD);
-            PointData lxnumPoint = createWpPoint(wplxnum, lxnumPointNew);
-            PointData txzdPoint = createWpPoint(wplxnum, txzdPointNew);
-            resultList.add(lxnumPoint);
-            resultList.add(txzdPoint);
-        });
-        edosUtil.sendMultiPoint(resultList);
-    }
-
-    private PointData createWpPoint(AtomicInteger tjnum, Windpowerstationpointnew tjnumPoint) {
-        PointData pointData = new PointData();
-        pointData.setEdnaId(tjnumPoint.getCode());
-        pointData.setPointName(tjnumPoint.getName());
-        pointData.setPointTime(currentDate.getTime());
-        pointData.setPointValue(String.valueOf(tjnum.doubleValue()));
-        pointData.setPointValueInDouble(tjnum.doubleValue());
-        return pointData;
-    }
-
-    /**
-     * 判断是否降出力
-     * @param wt
-     * @param stringWindturbinetestingpointnewMap
-     * @return
-     * @throws Exception
-     */
-    private boolean isJcl(Windturbine wt, Map<String, Windturbinetestingpointnew> stringWindturbinetestingpointnewMap) throws Exception {
-        boolean isJcl = false;
-        Windturbinetestingpointnew ai134point = stringWindturbinetestingpointnewMap.get(Contant.AI134);
-        Windturbinetestingpointnew ai178point = stringWindturbinetestingpointnewMap.get(Contant.AI178);
-        Windturbinetestingpointnew ai443point = stringWindturbinetestingpointnewMap.get(Contant.AI443);
-        if (!ai134point.getCode().equals("INITIAL")){
-            Double realData = edosUtil.getRealData(ai134point).getPointValueInDouble();
-            if (realData<Double.parseDouble(AI134)){
-                isJcl = true;
-            }
-        }
-        if (!ai178point.getCode().equals("INITIAL")){
-            Double realData = edosUtil.getRealData(ai178point).getPointValueInDouble();
-            if (realData<Double.parseDouble(AI178)){
-                isJcl = true;
-            }
-        }
-        if (!ai443point.getCode().equals("INITIAL")){
-            Double realData = edosUtil.getRealData(ai443point).getPointValueInDouble();
-            if (realData<modelMap.get(wt.getModelid()).getPowerproduction()){
-                isJcl = true;
-            }
-        }
-        return isJcl;
-    }
-
-    private PointData createPointData(Windturbinetestingpointnew ztmxPoint, Double mxstatus) {
-        PointData pointData = new PointData();
-        pointData.setEdnaId(ztmxPoint.getCode());
-        pointData.setPointName(ztmxPoint.getName());
-        pointData.setPointTime(currentDate.getTime());
-        pointData.setPointValue(String.valueOf(mxstatus));
-        pointData.setPointValueInDouble(mxstatus);
-        return pointData;
-    }
-}

+ 0 - 245
realtime/generationXa-service/src/main/java/com/gyee/generation/service/TheorypowerService.java

@@ -1,245 +0,0 @@
-package com.gyee.generation.service;
-
-import com.alibaba.fastjson.JSONObject;
-import com.alibaba.fastjson.TypeReference;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.gyee.common.contant.Contant;
-import com.gyee.common.model.PointData;
-import com.gyee.common.model.algorithm.PointVo;
-import com.gyee.common.util.CommonUtils;
-import com.gyee.common.util.DateUtils;
-import com.gyee.common.util.DoubleUtils;
-import com.gyee.common.util.algorithm.LineBuild;
-import com.gyee.generation.init.CacheContext;
-import com.gyee.generation.model.auto.*;
-import com.gyee.generation.service.auto.IWindturbinepowerService;
-import com.gyee.generation.util.realtimesource.IEdosUtil;
-import com.gyee.generation.util.redis.RedisService;
-import org.springframework.stereotype.Service;
-
-import javax.annotation.Resource;
-import java.util.*;
-import java.util.concurrent.atomic.AtomicReference;
-import java.util.stream.Collectors;
-
-/**
- * @ClassName : TheorypowerService
- * @Author : xieshengjie
- * @Date: 2022/4/26 10:37
- * @Description : 理论功率,保证功率
- */
-@Service
-public class TheorypowerService {
-    @Resource
-    private IEdosUtil edosUtil;
-    @Resource
-    private RedisService redisService;
-    @Resource
-    private IWindturbinepowerService windturbinepowerService;
-    private List<Windpowerstation> wpls;
-    private Map<String, List<Project>> wppromap;
-    private Map<String, List<Line>> prolinemap;
-    private Map<String, List<Windturbine>> linewtmap;
-    private Date currentDate;
-    private Map<String, Map<String, Windpowerstationpointnew>> wppointmap;
-    private Map<String, Map<String, Windpowerstationpointnew>> linepointmap;
-    private Map<String, Map<String, Windpowerstationpointnew>> propointmap;
-    private Map<String, Map<String, Windturbinetestingpointnew>> wtpAimap;
-
-    private void init(){
-        wpls = CacheContext.wpls;
-        wppromap = CacheContext.wppromap;
-        prolinemap = CacheContext.prolinemap;
-        linewtmap = CacheContext.linewtmap;
-        wppointmap = CacheContext.wppointmap;
-        linepointmap = CacheContext.linepointmap;
-        propointmap = CacheContext.propointmap;
-        wtpAimap = CacheContext.wtpAimap;
-        currentDate = DateUtils.getCurrentDate();
-    }
-
-    /**
-     * 理论功率,保证功率
-     */
-    public void theropower() throws Exception {
-        init();
-        Map<String, Map<Double, Double>> zbzglMap = CacheContext.zbzglMap;
-        Map<String, Map<Double, Double>> zzsglMap = CacheContext.zzsglMap;
-        List<PointData> resultList = new ArrayList<>();
-        wpls.stream().forEach(wp->{
-            Map<String, Windpowerstationpointnew> wppointnewMap = wppointmap.get(wp.getId());
-            Windpowerstationpointnew wpbzglpoint = wppointnewMap.get(Contant.ZBZGL);
-            Windpowerstationpointnew wpzsglpoint = wppointnewMap.get(Contant.ZZSGL);
-            AtomicReference<Double> wpbzgl = new AtomicReference<>(0.0);
-            AtomicReference<Double> wpzsgl = new AtomicReference<>(0.0);
-            wppromap.get(wp.getId()).stream().forEach(project -> {
-                Map<String, Windpowerstationpointnew> projectpointnewMap = propointmap.get(project.getId());
-                Windpowerstationpointnew projectbzglpoint = projectpointnewMap.get(Contant.ZBZGL);
-                Windpowerstationpointnew projectzsglpoint = projectpointnewMap.get(Contant.ZZSGL);
-                AtomicReference<Double> projectbzgl = new AtomicReference<>(0.0);
-                AtomicReference<Double> projectzsgl = new AtomicReference<>(0.0);
-                prolinemap.get(project.getId()).stream().forEach(line -> {
-                    AtomicReference<Double> linebzgl = new AtomicReference<>(0.0);
-                    AtomicReference<Double> linezsgl = new AtomicReference<>(0.0);
-                    Map<String, Windpowerstationpointnew> linepointnewMap = linepointmap.get(line.getId());
-                    Windpowerstationpointnew linebzglpoint = linepointnewMap.get(Contant.ZBZGL);
-                    Windpowerstationpointnew linezsglpoint = linepointnewMap.get(Contant.ZZSGL);
-                    linewtmap.get(line.getId()).stream().forEach(wt->{
-                        String zzsglString = redisService.get("ZZSGL");
-                        Map<String,Map<Double, Double>> zszglMap = JSONObject.parseObject(zzsglString, new TypeReference<Map<String,Map<Double,Double>>>() {
-                        });
-                        Map<Double, Double> zsglMap = zszglMap.get(wt.getId());
-                        Map<String, Windturbinetestingpointnew> windturbinetestingpointnewMap = wtpAimap.get(wt.getId());
-                        Windturbinetestingpointnew speedPointnew = windturbinetestingpointnewMap.get(Contant.AI022);
-                        Windturbinetestingpointnew ztmxPointnew = windturbinetestingpointnewMap.get(Contant.FJ5T);
-                        Windturbinetestingpointnew wtzsgl = windturbinetestingpointnewMap.get(Contant.ZSGL);
-                        Windturbinetestingpointnew wtbzgl = windturbinetestingpointnewMap.get(Contant.BZGL);
-                        Double zzsgl = 0.0;
-                        Double zbzgl = 0.0;
-                        try {
-                            Double wtztmx = DoubleUtils.keepPrecision(edosUtil.getRealData(ztmxPointnew).getPointValueInDouble(),2);
-                            Double wtspeed = DoubleUtils.keepPrecision(edosUtil.getRealData(speedPointnew).getPointValueInDouble(),2);
-                            if (wtztmx==2 || wtztmx==4 || wtztmx==0 || wtztmx==3){
-                                zbzgl = 0.0;
-                                zzsgl = 0.0;
-                            }else {
-                                if (zbzglMap.containsKey(wt.getModelid())){
-                                    Map<Double, Double> doubleDoubleMap = zbzglMap.get(wt.getModelid());
-                                    if(doubleDoubleMap.containsKey(wtspeed)){
-                                        zbzgl = doubleDoubleMap.get(wtspeed);
-                                    }
-                                }
-                                if (zsglMap.containsKey(wtspeed)){
-                                    zzsgl = zsglMap.get(wtspeed);
-                                }
-                            }
-                        } catch (Exception e) {
-                            e.printStackTrace();
-                        }
-                        Double finalZbzgl = zbzgl;
-                        linebzgl.updateAndGet(v -> v + finalZbzgl);
-                        Double finalZzsgl = zzsgl;
-                        linezsgl.updateAndGet(v -> v + finalZzsgl);
-                        PointData wtbzglpoint = createPointData(wtbzgl, zbzgl);
-                        resultList.add(wtbzglpoint);
-                        PointData wtzsglpoint = createPointData(wtzsgl, zzsgl);
-                        resultList.add(wtzsglpoint);
-                    });
-                    PointData linebzglpointdata = createWpPointData(linebzglpoint, linebzgl.get());
-                    resultList.add(linebzglpointdata);
-                    PointData linezsglpointdata = createWpPointData(linezsglpoint, linezsgl.get());
-                    resultList.add(linezsglpointdata);
-                    Double finallineZbzgl = linebzgl.get();
-                    projectbzgl.updateAndGet(v -> v + finallineZbzgl);
-                    Double finallineZzsgl = linezsgl.get();
-                    projectzsgl.updateAndGet(v -> v + finallineZzsgl);
-                });
-                PointData projectbzglpointdata = createWpPointData(projectbzglpoint, projectbzgl.get());
-                resultList.add(projectbzglpointdata);
-                PointData projectzsglpointdata = createWpPointData(projectzsglpoint, projectzsgl.get());
-                resultList.add(projectzsglpointdata);
-                Double finalprojectZbzgl = projectbzgl.get();
-                wpbzgl.updateAndGet(v -> v + finalprojectZbzgl);
-                Double finalprojectZzsgl = projectzsgl.get();
-                wpzsgl.updateAndGet(v -> v + finalprojectZzsgl);
-            });
-            PointData wpbzglpointdata = createWpPointData(wpbzglpoint, wpbzgl.get());
-            resultList.add(wpbzglpointdata);
-            PointData wpzsglpointdata = createWpPointData(wpzsglpoint, wpzsgl.get());
-            resultList.add(wpzsglpointdata);
-        });
-        edosUtil.sendMultiPoint(resultList);
-    }
-
-
-    /**
-     * 拟合功率曲线,存储到redis
-     */
-    public void fittingPower(){
-        init();
-        List<Windturbinepower> resultList = new ArrayList<>();
-        List<Windturbine> wtls = CacheContext.wtls;
-        Date date = new Date();
-        Calendar cal = Calendar.getInstance();
-        cal.setTime(date);
-        cal.add(Calendar.MONTH, -1);
-        Date begin = cal.getTime();
-
-        wtls.stream().forEach(wt->{
-            QueryWrapper<Windturbinepower> deleteqw = new QueryWrapper<>();
-            deleteqw.eq("windturbineid",wt.getId());
-            windturbinepowerService.remove(deleteqw);
-
-            Map<String, Windturbinetestingpointnew> windturbinetestingpointnewMap = wtpAimap.get(wt.getId());
-            Windturbinetestingpointnew speedPoint = windturbinetestingpointnewMap.get(Contant.AI022);
-            Windturbinetestingpointnew powerPoint = windturbinetestingpointnewMap.get(Contant.AI130);
-            Windturbinetestingpointnew fjztPoint = windturbinetestingpointnewMap.get(Contant.FJ5T);
-            List<PointVo> pointVoList = new ArrayList<>();
-            List<PointVo> tempList = new ArrayList<>();
-            try {
-                List<PointData> speedpoints =  edosUtil.getHistoryDatasSnap(speedPoint, begin.getTime()/1000 , date.getTime()/1000 , null, 3600l);
-                List<PointData> powerpoints = edosUtil.getHistoryDatasSnap(powerPoint, begin.getTime()/1000 , date.getTime()/1000 , null, 3600l);
-                List<PointData> fjztpoints = edosUtil.getHistoryDatasSnap(fjztPoint, begin.getTime()/1000 , date.getTime()/1000 , null, 3600l);
-                for (int x = 0;x<speedpoints.size();x++){
-                    if (fjztpoints.get(x).getPointValueInDouble()==1){
-                        PointVo vo = new PointVo();
-                        vo.setX(speedpoints.get(x).getPointValueInDouble());
-                        vo.setY(powerpoints.get(x).getPointValueInDouble());
-                        tempList.add(vo);
-                    }
-                }
-                List<PointVo> collect = tempList.stream().filter(i -> i.getY() >= 0 && i.getY() <= (CacheContext.modelpower.get(wt.getId())*1.5) && i.getX()>=0 && i.getX()<=25).collect(Collectors.toList());
-                Collections.sort(collect, Comparator.comparing(PointVo::getY));
-                double[] speeds = collect.stream().map(i -> i.getX()).mapToDouble(Double::doubleValue).toArray();
-                double[] powers = collect.stream().map(i -> i.getY()).mapToDouble(Double::doubleValue).toArray();
-                pointVoList = LineBuild.buildLine(speeds, powers, speeds.length, 20, 0.01);
-            } catch (Exception e) {
-                e.printStackTrace();
-            }
-            pointVoList.stream().forEach(pointVo -> {
-                Windturbinepower windturbinepower = new Windturbinepower();
-                windturbinepower.setId(CommonUtils.getUUID());
-                windturbinepower.setWindturbineid(wt.getId());
-                windturbinepower.setWindpowerstationid(wt.getWindpowerstationid());
-                windturbinepower.setSpeed(pointVo.getX());
-                windturbinepower.setTheorypower(pointVo.getY());
-                resultList.add(windturbinepower);
-            });
-        });
-        windturbinepowerService.saveBatch(resultList);
-        Map<String,Map<Double,Double>> zzsglMap = new HashMap<>();
-        wtls.stream().forEach(wt->{
-            List<Windturbinepower> windturbinepowers = resultList.stream().filter(p -> p.getWindturbineid().equals(wt.getId())).collect(Collectors.toList());
-            Map<Double,Double> doubleMap = new HashMap<>();
-            windturbinepowers.stream().forEach(w->{
-                doubleMap.put(w.getSpeed(),w.getTheorypower());
-            });
-            zzsglMap.put(wt.getId(),doubleMap);
-        });
-        redisService.set("ZZSGL", JSONObject.toJSONString(zzsglMap));
-
-    }
-
-
-
-
-    private PointData createPointData(Windturbinetestingpointnew fjfdl, Double rfdl) {
-        PointData pointData = new PointData();
-        pointData.setEdnaId(fjfdl.getCode());
-        pointData.setPointName(fjfdl.getName());
-        pointData.setPointTime(currentDate.getTime());
-        pointData.setPointValueInDouble(rfdl);
-        pointData.setPointValue(String.valueOf(rfdl));
-        return pointData;
-    }
-
-    private PointData createWpPointData(Windpowerstationpointnew linepointnew, double linespeed) {
-        PointData pointData = new PointData();
-        pointData.setEdnaId(linepointnew.getCode());
-        pointData.setPointTime(currentDate.getTime());
-        pointData.setPointName(linepointnew.getName());
-        pointData.setPointValue(String.valueOf(linespeed));
-        pointData.setPointValueInDouble(linespeed);
-        return pointData;
-    }
-}

+ 0 - 16
realtime/generationXa-service/src/main/java/com/gyee/generation/service/auto/IMeterpointService.java

@@ -1,16 +0,0 @@
-package com.gyee.generation.service.auto;
-
-import com.gyee.generation.model.auto.Meterpoint;
-import com.baomidou.mybatisplus.extension.service.IService;
-
-/**
- * <p>
- *  服务类
- * </p>
- *
- * @author 谢生杰
- * @since 2022-02-28
- */
-public interface IMeterpointService extends IService<Meterpoint> {
-
-}

+ 0 - 16
realtime/generationXa-service/src/main/java/com/gyee/generation/service/auto/IMeterpointvalueService.java

@@ -1,16 +0,0 @@
-package com.gyee.generation.service.auto;
-
-import com.gyee.generation.model.auto.Meterpointvalue;
-import com.baomidou.mybatisplus.extension.service.IService;
-
-/**
- * <p>
- *  服务类
- * </p>
- *
- * @author 谢生杰
- * @since 2022-03-21
- */
-public interface IMeterpointvalueService extends IService<Meterpointvalue> {
-
-}

+ 0 - 16
realtime/generationXa-service/src/main/java/com/gyee/generation/service/auto/IShutdowneventService.java

@@ -1,16 +0,0 @@
-package com.gyee.generation.service.auto;
-
-import com.gyee.generation.model.auto.Shutdownevent;
-import com.baomidou.mybatisplus.extension.service.IService;
-
-/**
- * <p>
- *  服务类
- * </p>
- *
- * @author 谢生杰
- * @since 2022-07-29
- */
-public interface IShutdowneventService extends IService<Shutdownevent> {
-
-}

+ 0 - 16
realtime/generationXa-service/src/main/java/com/gyee/generation/service/auto/IWindpowerstationstandardpointService.java

@@ -1,16 +0,0 @@
-package com.gyee.generation.service.auto;
-
-import com.gyee.generation.model.auto.Windpowerstationstandardpoint;
-import com.baomidou.mybatisplus.extension.service.IService;
-
-/**
- * <p>
- *  服务类
- * </p>
- *
- * @author 谢生杰
- * @since 2022-02-28
- */
-public interface IWindpowerstationstandardpointService extends IService<Windpowerstationstandardpoint> {
-
-}

+ 0 - 16
realtime/generationXa-service/src/main/java/com/gyee/generation/service/auto/IWindpowerstationtestingpointService.java

@@ -1,16 +0,0 @@
-package com.gyee.generation.service.auto;
-
-import com.gyee.generation.model.auto.Windpowerstationtestingpoint;
-import com.baomidou.mybatisplus.extension.service.IService;
-
-/**
- * <p>
- *  服务类
- * </p>
- *
- * @author 谢生杰
- * @since 2022-02-28
- */
-public interface IWindpowerstationtestingpointService extends IService<Windpowerstationtestingpoint> {
-
-}

+ 0 - 16
realtime/generationXa-service/src/main/java/com/gyee/generation/service/auto/IWindturbinepowerService.java

@@ -1,16 +0,0 @@
-package com.gyee.generation.service.auto;
-
-import com.gyee.generation.model.auto.Windturbinepower;
-import com.baomidou.mybatisplus.extension.service.IService;
-
-/**
- * <p>
- *  服务类
- * </p>
- *
- * @author 谢生杰
- * @since 2022-04-26
- */
-public interface IWindturbinepowerService extends IService<Windturbinepower> {
-
-}

+ 0 - 16
realtime/generationXa-service/src/main/java/com/gyee/generation/service/auto/IWindturbinestandardpointService.java

@@ -1,16 +0,0 @@
-package com.gyee.generation.service.auto;
-
-import com.gyee.generation.model.auto.Windturbinestandardpoint;
-import com.baomidou.mybatisplus.extension.service.IService;
-
-/**
- * <p>
- *  服务类
- * </p>
- *
- * @author 谢生杰
- * @since 2022-02-28
- */
-public interface IWindturbinestandardpointService extends IService<Windturbinestandardpoint> {
-
-}

+ 0 - 16
realtime/generationXa-service/src/main/java/com/gyee/generation/service/auto/IWindturbinestatusdiService.java

@@ -1,16 +0,0 @@
-package com.gyee.generation.service.auto;
-
-import com.gyee.generation.model.auto.Windturbinestatusdi;
-import com.baomidou.mybatisplus.extension.service.IService;
-
-/**
- * <p>
- *  服务类
- * </p>
- *
- * @author 谢生杰
- * @since 2022-03-28
- */
-public interface IWindturbinestatusdiService extends IService<Windturbinestatusdi> {
-
-}

+ 0 - 16
realtime/generationXa-service/src/main/java/com/gyee/generation/service/auto/IWindturbinetestingpointaiService.java

@@ -1,16 +0,0 @@
-package com.gyee.generation.service.auto;
-
-import com.gyee.generation.model.auto.Windturbinetestingpointai;
-import com.baomidou.mybatisplus.extension.service.IService;
-
-/**
- * <p>
- *  服务类
- * </p>
- *
- * @author 谢生杰
- * @since 2022-02-28
- */
-public interface IWindturbinetestingpointaiService extends IService<Windturbinetestingpointai> {
-
-}

+ 0 - 20
realtime/generationXa-service/src/main/java/com/gyee/generation/service/auto/impl/MeterpointServiceImpl.java

@@ -1,20 +0,0 @@
-package com.gyee.generation.service.auto.impl;
-
-import com.gyee.generation.model.auto.Meterpoint;
-import com.gyee.generation.mapper.auto.MeterpointMapper;
-import com.gyee.generation.service.auto.IMeterpointService;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import org.springframework.stereotype.Service;
-
-/**
- * <p>
- *  服务实现类
- * </p>
- *
- * @author 谢生杰
- * @since 2022-02-28
- */
-@Service
-public class MeterpointServiceImpl extends ServiceImpl<MeterpointMapper, Meterpoint> implements IMeterpointService {
-
-}

+ 0 - 20
realtime/generationXa-service/src/main/java/com/gyee/generation/service/auto/impl/MeterpointvalueServiceImpl.java

@@ -1,20 +0,0 @@
-package com.gyee.generation.service.auto.impl;
-
-import com.gyee.generation.model.auto.Meterpointvalue;
-import com.gyee.generation.mapper.auto.MeterpointvalueMapper;
-import com.gyee.generation.service.auto.IMeterpointvalueService;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import org.springframework.stereotype.Service;
-
-/**
- * <p>
- *  服务实现类
- * </p>
- *
- * @author 谢生杰
- * @since 2022-03-21
- */
-@Service
-public class MeterpointvalueServiceImpl extends ServiceImpl<MeterpointvalueMapper, Meterpointvalue> implements IMeterpointvalueService {
-
-}

+ 0 - 20
realtime/generationXa-service/src/main/java/com/gyee/generation/service/auto/impl/ShutdowneventServiceImpl.java

@@ -1,20 +0,0 @@
-package com.gyee.generation.service.auto.impl;
-
-import com.gyee.generation.model.auto.Shutdownevent;
-import com.gyee.generation.mapper.auto.ShutdowneventMapper;
-import com.gyee.generation.service.auto.IShutdowneventService;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import org.springframework.stereotype.Service;
-
-/**
- * <p>
- *  服务实现类
- * </p>
- *
- * @author 谢生杰
- * @since 2022-07-29
- */
-@Service
-public class ShutdowneventServiceImpl extends ServiceImpl<ShutdowneventMapper, Shutdownevent> implements IShutdowneventService {
-
-}

+ 0 - 20
realtime/generationXa-service/src/main/java/com/gyee/generation/service/auto/impl/WindpowerstationstandardpointServiceImpl.java

@@ -1,20 +0,0 @@
-package com.gyee.generation.service.auto.impl;
-
-import com.gyee.generation.model.auto.Windpowerstationstandardpoint;
-import com.gyee.generation.mapper.auto.WindpowerstationstandardpointMapper;
-import com.gyee.generation.service.auto.IWindpowerstationstandardpointService;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import org.springframework.stereotype.Service;
-
-/**
- * <p>
- *  服务实现类
- * </p>
- *
- * @author 谢生杰
- * @since 2022-02-28
- */
-@Service
-public class WindpowerstationstandardpointServiceImpl extends ServiceImpl<WindpowerstationstandardpointMapper, Windpowerstationstandardpoint> implements IWindpowerstationstandardpointService {
-
-}

+ 0 - 20
realtime/generationXa-service/src/main/java/com/gyee/generation/service/auto/impl/WindpowerstationtestingpointServiceImpl.java

@@ -1,20 +0,0 @@
-package com.gyee.generation.service.auto.impl;
-
-import com.gyee.generation.model.auto.Windpowerstationtestingpoint;
-import com.gyee.generation.mapper.auto.WindpowerstationtestingpointMapper;
-import com.gyee.generation.service.auto.IWindpowerstationtestingpointService;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import org.springframework.stereotype.Service;
-
-/**
- * <p>
- *  服务实现类
- * </p>
- *
- * @author 谢生杰
- * @since 2022-02-28
- */
-@Service
-public class WindpowerstationtestingpointServiceImpl extends ServiceImpl<WindpowerstationtestingpointMapper, Windpowerstationtestingpoint> implements IWindpowerstationtestingpointService {
-
-}

+ 0 - 20
realtime/generationXa-service/src/main/java/com/gyee/generation/service/auto/impl/WindturbinepowerServiceImpl.java

@@ -1,20 +0,0 @@
-package com.gyee.generation.service.auto.impl;
-
-import com.gyee.generation.model.auto.Windturbinepower;
-import com.gyee.generation.mapper.auto.WindturbinepowerMapper;
-import com.gyee.generation.service.auto.IWindturbinepowerService;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import org.springframework.stereotype.Service;
-
-/**
- * <p>
- *  服务实现类
- * </p>
- *
- * @author 谢生杰
- * @since 2022-04-26
- */
-@Service
-public class WindturbinepowerServiceImpl extends ServiceImpl<WindturbinepowerMapper, Windturbinepower> implements IWindturbinepowerService {
-
-}

+ 0 - 20
realtime/generationXa-service/src/main/java/com/gyee/generation/service/auto/impl/WindturbinestandardpointServiceImpl.java

@@ -1,20 +0,0 @@
-package com.gyee.generation.service.auto.impl;
-
-import com.gyee.generation.model.auto.Windturbinestandardpoint;
-import com.gyee.generation.mapper.auto.WindturbinestandardpointMapper;
-import com.gyee.generation.service.auto.IWindturbinestandardpointService;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import org.springframework.stereotype.Service;
-
-/**
- * <p>
- *  服务实现类
- * </p>
- *
- * @author 谢生杰
- * @since 2022-02-28
- */
-@Service
-public class WindturbinestandardpointServiceImpl extends ServiceImpl<WindturbinestandardpointMapper, Windturbinestandardpoint> implements IWindturbinestandardpointService {
-
-}

+ 0 - 20
realtime/generationXa-service/src/main/java/com/gyee/generation/service/auto/impl/WindturbinestatusdiServiceImpl.java

@@ -1,20 +0,0 @@
-package com.gyee.generation.service.auto.impl;
-
-import com.gyee.generation.model.auto.Windturbinestatusdi;
-import com.gyee.generation.mapper.auto.WindturbinestatusdiMapper;
-import com.gyee.generation.service.auto.IWindturbinestatusdiService;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import org.springframework.stereotype.Service;
-
-/**
- * <p>
- *  服务实现类
- * </p>
- *
- * @author 谢生杰
- * @since 2022-03-28
- */
-@Service
-public class WindturbinestatusdiServiceImpl extends ServiceImpl<WindturbinestatusdiMapper, Windturbinestatusdi> implements IWindturbinestatusdiService {
-
-}

+ 0 - 20
realtime/generationXa-service/src/main/java/com/gyee/generation/service/auto/impl/WindturbinetestingpointaiServiceImpl.java

@@ -1,20 +0,0 @@
-package com.gyee.generation.service.auto.impl;
-
-import com.gyee.generation.model.auto.Windturbinetestingpointai;
-import com.gyee.generation.mapper.auto.WindturbinetestingpointaiMapper;
-import com.gyee.generation.service.auto.IWindturbinetestingpointaiService;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import org.springframework.stereotype.Service;
-
-/**
- * <p>
- *  服务实现类
- * </p>
- *
- * @author 谢生杰
- * @since 2022-02-28
- */
-@Service
-public class WindturbinetestingpointaiServiceImpl extends ServiceImpl<WindturbinetestingpointaiMapper, Windturbinetestingpointai> implements IWindturbinetestingpointaiService {
-
-}

+ 0 - 202
realtime/generationXa-service/src/main/java/com/gyee/generation/task/SaticScheduleTask.java

@@ -1,202 +0,0 @@
-package com.gyee.generation.task;
-
-
-import com.gyee.common.util.DateUtils;
-import com.gyee.generation.service.*;
-import com.xxl.job.core.context.XxlJobHelper;
-import com.xxl.job.core.handler.annotation.XxlJob;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.stereotype.Component;
-
-import javax.annotation.Resource;
-
-/**
- * @ClassName : SaticScheduleTask
- * @Description : 调度
- */
-
-
-@Component
-public class SaticScheduleTask {
-
-    private static Logger logger = LoggerFactory.getLogger(SaticScheduleTask.class);
-
-    @Resource
-    private GenerationService generationService;
-    @Resource
-    private StatusService statusService;
-    @Resource
-    private AverageAndGeneratingService averageAndGeneratingService;
-    @Resource
-    private RealtimeSpeedPowerService realtimeSpeedPowerService;
-    @Resource
-    private TheorypowerService theorypowerService;
-    @Resource
-    private FiveLossesService fiveLossesService;
-    @Resource
-    private SafetyService safetyService;
-    //3.添加定时任务
-    /**
-     * 电计量实时计算计算(电量,上网,购网,场用)
-     * 每15分钟执行一次
-     */
-
-    @XxlJob("electricityMetering-realtime")
-    public void electricityMetering()  {
-
-
-        XxlJobHelper.log("电计量实时调度程序执行开始!........");
-        try {
-            generationService.saveGenerationDatas();
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-        XxlJobHelper.log("电计量实时调度任务处理完成!........");
-    }
-
-    /**
-     * 存储meterpointvalue
-     * 每10分钟执行一次
-     */
-    @XxlJob("electricityMetering-history1")
-    public void history1()  {
-
-        XxlJobHelper.log("电计量历史1调度程序执行开始!........");
-        String date = DateUtils.toDate1(DateUtils.getCurrentDate());
-        try {
-            generationService.saveMeterpointValueRealtime(date,date);
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-        XxlJobHelper.log("电计量历史1调度任务处理完成!........");
-    }
-
-    /**
-     * 存储meterpointvalue(处理每天最后一个值,保证是第二天0点值)
-     * 每天0:30执行
-     */
-    @XxlJob("electricityMetering-history2")
-    public void history2()  {
-
-        XxlJobHelper.log("电计量历史2调度程序执行开始!........");
-        String yesterdayStr = DateUtils.getYesterdayStr("yyyy-MM-dd");
-        try {
-            generationService.saveMeterpointValueRealtime(yesterdayStr,yesterdayStr);
-
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-
-        XxlJobHelper.log("电计量历史2调度任务处理完成!........");
-    }
-
-    /**
-     * 实时状态计算
-     * 只执行一次(死循环)
-     * 2s
-     */
-    @XxlJob("status-realtime")
-    public void status() throws Exception {
-//        while(true){
-            XxlJobHelper.log("实时状态调度程序执行开始!........");
-            statusService.calculateStatus();
-            statusService.calculateStatusNumber();
-            XxlJobHelper.log("实时状态调度程序执行完成!........");
-//        }
-
-    }
-
-    /**
-     * 平均风速,平均功率,scada发电量计算
-     * 每10分钟一次
-     */
-    @XxlJob("averageandGenerating-realtime")
-    public void averageandGenerating() throws Exception {
-            XxlJobHelper.log("平均风速,功率,scada发电量调度程序执行开始!........");
-            averageAndGeneratingService.saveAvespeedAndAvepowerAndScada();
-            XxlJobHelper.log("平均风速,功率,scada发电量调度程序执行完成!........");
-    }
-
-    /**
-     * 实时风速功率
-     * 只执行一次(死循环)
-     * 2s
-     */
-    @XxlJob("speedAndPower-realtime")
-    public void speedAndPower() throws Exception {
-//        while (true){
-            XxlJobHelper.log("实时风速,实时功率调度程序执行开始!........");
-            realtimeSpeedPowerService.calculateRealtimeSpeedPower();
-            XxlJobHelper.log("实时风速,实时功率调度程序执行完成!........");
-//        }
-    }
-
-    /**
-     * 拟合功率曲线,存储到数据库中
-     * 一个月执行一次
-     * @throws Exception
-     */
-    @XxlJob("fittingpower-realtime")
-    public void fittingpower() throws Exception {
-        XxlJobHelper.log("拟合功率曲线调度程序执行开始!........");
-        theorypowerService.fittingPower();
-        XxlJobHelper.log("拟合功率曲线调度程序执行完成!........");
-    }
-
-
-    /**
-     * 计算理论功率,保证功率
-     * 死循环
-     * 10min
-     * @throws Exception
-     */
-    @XxlJob("theropower-realtime")
-    public void theropower() throws Exception {
-//        while (true){
-            XxlJobHelper.log("理论保证功率调度程序执行开始!........");
-            theorypowerService.theropower();
-            XxlJobHelper.log("理论保证功率调度程序执行完成!........");
-//        }
-
-    }
-
-    /**
-     * 计算损失电量
-     * 1小时一次(*:20)
-     * 30min
-     * @throws Exception
-     */
-    @XxlJob("losses-realtime")
-    public void losses() throws Exception {
-            XxlJobHelper.log("损失电量调度程序执行开始!........");
-            fiveLossesService.lossesReal();
-            XxlJobHelper.log("损失电量调度程序执行完成!........");
-    }
-
-    /**
-     * 安全天数
-     * 每日0点
-     * @throws Exception
-     */
-    @XxlJob("safe-realtime")
-    public void safety() throws Exception {
-        XxlJobHelper.log("安全天数调度程序执行开始!........");
-        safetyService.safetyReatimel();
-        XxlJobHelper.log("安全天数调度程序执行完成!........");
-    }
-
-    /**
-     * 保存shutdownevent
-     * 2分钟执行一次
-     */
-    @XxlJob("shutdownevent-realtime")
-    public void shutdownevent(){
-        XxlJobHelper.log("故障事件调度程序执行开始!........");
-        fiveLossesService.saveShutdownevent();
-        XxlJobHelper.log("故障事件调度程序执行完成!........");
-    }
-
-
-
-}

Diferenças do arquivo suprimidas por serem muito extensas
+ 0 - 1316
realtime/generationXa-service/src/main/java/com/gyee/generation/util/realtimesource/EdosUtil.java


Diferenças do arquivo suprimidas por serem muito extensas
+ 0 - 1316
realtime/generationXa-service/src/main/java/com/gyee/generation/util/realtimesource/EdosUtilTd.java


+ 0 - 44
realtime/generationXa-service/src/main/java/com/gyee/generation/util/redis/RedisAutoConfiguration.java

@@ -1,44 +0,0 @@
-package com.gyee.generation.util.redis;
-
-import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
-import org.springframework.boot.autoconfigure.data.redis.RedisProperties;
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.data.redis.connection.RedisConnectionFactory;
-import org.springframework.data.redis.core.RedisOperations;
-import org.springframework.data.redis.core.RedisTemplate;
-import org.springframework.data.redis.core.StringRedisTemplate;
-
-import java.net.UnknownHostException;
-
-@Configuration
-@ConditionalOnClass(RedisOperations.class)
-@EnableConfigurationProperties(RedisProperties.class)
-public class RedisAutoConfiguration {
-
-
-    @Bean
-    @ConditionalOnMissingBean(name = "redisTemplate")
-    public RedisTemplate<Object, Object> redisTemplate(
-            RedisConnectionFactory redisConnectionFactory) throws UnknownHostException {
-        RedisTemplate<Object, Object> template = new RedisTemplate<>();
-        template.setConnectionFactory(redisConnectionFactory);
-        return template;
-
-    }
-
-
-    @Bean
-    @ConditionalOnMissingBean
-    public StringRedisTemplate stringRedisTemplate(
-            RedisConnectionFactory redisConnectionFactory) throws UnknownHostException {
-        StringRedisTemplate template = new StringRedisTemplate();
-        template.setConnectionFactory(redisConnectionFactory);
-        return template;
-
-    }
-
-
-}

+ 0 - 47
realtime/generationXa-service/src/main/java/com/gyee/generation/util/redis/RedisConfig.java

@@ -1,47 +0,0 @@
-package com.gyee.generation.util.redis;
-
-import com.fasterxml.jackson.annotation.JsonAutoDetect;
-import com.fasterxml.jackson.annotation.PropertyAccessor;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.data.redis.connection.RedisConnectionFactory;
-import org.springframework.data.redis.core.RedisTemplate;
-import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
-import org.springframework.data.redis.serializer.StringRedisSerializer;
-
-
-/**
-
-/**
- *@ClassName RedisConfig
- *@Description TODO
- *@Author 谢生杰
- *@Date 2020/9/14 10:42
- *@Version 1.0
- **/
-@Configuration
-public class RedisConfig {
-    @Bean
-    @SuppressWarnings("all")
-    public RedisTemplate<String, Object> redisTemplate(RedisConnectionFactory factory) {
-        RedisTemplate<String, Object> template = new RedisTemplate<String, Object>();
-        template.setConnectionFactory(factory);
-        Jackson2JsonRedisSerializer jackson2JsonRedisSerializer = new Jackson2JsonRedisSerializer(Object.class);
-        ObjectMapper om = new ObjectMapper();
-        om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY);
-        om.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL);
-        jackson2JsonRedisSerializer.setObjectMapper(om);
-        StringRedisSerializer stringRedisSerializer = new StringRedisSerializer();
-        // key采用String的序列化方式
-        template.setKeySerializer(stringRedisSerializer);
-        // hash的key也采用String的序列化方式
-        template.setHashKeySerializer(stringRedisSerializer);
-        // value序列化方式采用jackson
-        template.setValueSerializer(jackson2JsonRedisSerializer);
-        // hash的value序列化方式采用jackson
-        template.setHashValueSerializer(jackson2JsonRedisSerializer);
-        template.afterPropertiesSet();
-        return template;
-    }
-}

+ 0 - 51
realtime/generationXa-service/src/main/java/com/gyee/generation/util/redis/RedisService.java

@@ -1,51 +0,0 @@
-package com.gyee.generation.util.redis;
-
-public interface RedisService {
-
-    /**
-     * set存数据
-     * @param key
-     * @param value
-     * @return
-     */
-    boolean set(String key, String value);
-
-
-
-    /**
-     * get获取数据
-     * @param key
-     * @return
-     */
-    String get(String key);
-
-//    void getList(String key,int start,int end);
-
-    /**
-     * 设置有效天数
-     * @param key
-     * @param expire
-     * @return
-     */
-    boolean expire(String key, long expire);
-
-    /**
-     * 移除数据
-     * @param key
-     * @return
-     */
-    boolean remove(String key);
-
-
-    /**
-     * 插入对象
-     */
-    void setObject(Object o);
-
-
-    boolean hasKey(String key);
-
-
-    void select(Integer dbIndex);
-
-}

+ 0 - 125
realtime/generationXa-service/src/main/java/com/gyee/generation/util/redis/RedisServiceImpl.java

@@ -1,125 +0,0 @@
-package com.gyee.generation.util.redis;
-
-import org.springframework.dao.DataAccessException;
-import org.springframework.data.redis.connection.RedisConnection;
-import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory;
-import org.springframework.data.redis.core.RedisCallback;
-import org.springframework.data.redis.core.RedisTemplate;
-import org.springframework.data.redis.serializer.RedisSerializer;
-import org.springframework.stereotype.Service;
-
-import javax.annotation.Resource;
-import java.lang.reflect.Field;
-import java.util.concurrent.TimeUnit;
-
-@Service("redisService")
-public class RedisServiceImpl implements RedisService {
-
-    @Resource
-    private RedisTemplate<String, ?> redisTemplate;
-
-    @Override
-    public boolean set(final String key, final String value) {;
-        boolean result = redisTemplate.execute(new RedisCallback<Boolean>() {
-            @Override
-            public Boolean doInRedis(RedisConnection connection) throws DataAccessException {
-                RedisSerializer<String> serializer = redisTemplate.getStringSerializer();
-                connection.set(serializer.serialize(key), serializer.serialize(value));
-                return true;
-            }
-        });
-        return result;
-    }
-
-
-    @Override
-    public String get(final String key) {
-        String result = redisTemplate.execute(new RedisCallback<String>() {
-            @Override
-            public String doInRedis(RedisConnection connection) throws DataAccessException {
-                RedisSerializer<String> serializer = redisTemplate.getStringSerializer();
-                byte[] value = connection.get(serializer.serialize(key));
-                return serializer.deserialize(value);
-            }
-        });
-        return result;
-    }
-
-
-
-    @Override
-    public boolean expire(final String key, long expire) {
-        return redisTemplate.expire(key, expire, TimeUnit.SECONDS);
-    }
-
-    @Override
-    public boolean remove(final String key) {
-        boolean result = redisTemplate.execute(new RedisCallback<Boolean>() {
-            @Override
-            public Boolean doInRedis(RedisConnection connection) throws DataAccessException {
-                RedisSerializer<String> serializer = redisTemplate.getStringSerializer();
-                connection.del(key.getBytes());
-                return true;
-            }
-        });
-        return result;
-    }
-
-    @Override
-    public boolean hasKey(final String key) {
-        try {
-            return redisTemplate.hasKey(key);
-        } catch (Exception e) {
-            e.printStackTrace();
-            return false;
-        }
-    }
-
-    @Override
-    public void setObject(Object obj) {
-        Field[] fields = obj.getClass().getDeclaredFields();
-        for(int i = 0 , len = fields.length; i < len; i++) {
-            // 对于每个属性,获取属性名
-            String varName = fields[i].getName();
-            try {
-                // 获取原来的访问控制权限
-                boolean accessFlag = fields[i].isAccessible();
-                // 修改访问控制权限
-                fields[i].setAccessible(true);
-                // 获取在对象f中属性fields[i]对应的对象中的变量
-                Object o;
-                try {
-                    o = fields[i].get(obj);
-                    if (o!=null){
-                        set(varName, String.valueOf(o));
-                    }else {
-                        set(varName,"");
-                    }
-
-                    //System.err.println("传入的对象中包含一个如下的变量:" + varName + " = " + o);
-                } catch (IllegalAccessException e) {
-                    // TODO Auto-generated catch block
-                    e.printStackTrace();
-                }
-                // 恢复访问控制权限
-                fields[i].setAccessible(accessFlag);
-            } catch (IllegalArgumentException ex) {
-                ex.printStackTrace();
-            }
-        }
-
-    }
-
-    public void select(Integer dbIndex) {
-        if (dbIndex == null || dbIndex > 15 || dbIndex < 0) {
-            dbIndex = 0;
-        }
-        LettuceConnectionFactory jedisConnectionFactory = (LettuceConnectionFactory) redisTemplate
-                .getConnectionFactory();
-        jedisConnectionFactory.setDatabase(dbIndex);
-        redisTemplate.setConnectionFactory(jedisConnectionFactory);
-        jedisConnectionFactory.afterPropertiesSet();
-//        jedisConnectionFactory.resetConnection();
-
-    }
-}

+ 0 - 117
realtime/generationXa-service/src/main/resources/application-xa.yml

@@ -1,117 +0,0 @@
-server:
-  port: 7012
-  servlet:
-    context-path: /
-
-
-spring:
-  main:
-    allow-bean-definition-overriding: true #当遇到同样名字的时候,是否允许覆盖注册
-  #redis集群
-  redis:
-    host: 10.81.3.155
-    port: 6379
-    timeout: 100000
-    #    集群环境打开下面注释,单机不需要打开
-#    cluster:
-#      #集群信息
-#      nodes: 10.83.68.151:6379,10.83.68.152:6379,10.83.68.153:6379,10.83.68.154:6379,10.83.68.155:6379,10.83.68.156:6379,10.83.68.157:6379,10.83.68.158:6379,10.83.68.159:6379
-#      #默认值是5 一般当此值设置过大时,容易报:Too many Cluster redirections
-#      maxRedirects: 3
-    password:
-    application:
-      name: test
-    jedis:
-      pool:
-        max-active: 8
-        min-idle: 0
-        max-idle: 8
-        max-wait: -1
-    database: 0
-  autoconfigure:
-    exclude: org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration,org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration
-  datasource:
-    type: com.alibaba.druid.pool.DruidDataSource
-    driver-class-name: org.postgresql.Driver
-    url: jdbc:postgresql://10.81.3.151:5432/wisdom
-    username: gdprod
-    password: gd123
-    oracle-schema=:
-    #    type: com.alibaba.druid.pool.DruidDataSource
-    #    url: jdbc:mysql://127.0.0.1:3306/test?characterEncoding=utf8&serverTimezone=UTC
-    #    username: root
-    #    password: root
-    #    driver-class-name: com.mysql.jdbc.Driver
-    druid:
-      max-active: 20
-      initial-size: 1
-      min-idle: 3
-      max-wait: 60000
-      time-between-eviction-runs-millis: 60000
-      min-evictable-idle-time-millis: 300000
-      test-while-idle: true
-      test-on-borrow: false
-      test-on-return: false
-  servlet:
-    multipart:
-      # 开启 multipart 上传功能
-      enabled: true
-      # 文件写入磁盘的阈值
-      file-size-threshold: 2KB
-      # 最大文件大小
-      max-file-size: 200MB
-      # 最大请求大小
-      max-request-size: 215MB
-
-mybatis-plus:
-  configuration:
-    map-underscore-to-camel-case: true
-    auto-mapping-behavior: full
-    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
-  mapper-locations: classpath*:mapper/**/*Mapper.xml
-  global-config:
-    # 逻辑删除配置
-    db-config:
-      id-type: auto
-      # 删除前
-      logic-not-delete-value: 1
-      # 删除后
-      logic-delete-value: 0
-logging:
-  level:
-    root: info
-    com.example: debug
-#db url
-db:
-  url: http://10.81.3.152:8011/ts
-#参与计算的场站
-runWindpowerstation: GJY_FDC,DJY_FDC,YF_FDC,HSM_FDC,PTZ_FDC,YLZ_FDC,ZK_FDC,NJL_FDC,YTY_FDC,PDL_FDC
-#计算状态用ai或者di
-clauStatus:
-  ai: GJY03_GC,YLZ01_GC,PTZ02_GC   #配置期次
-  di: GJY01_GC,GJY02_GC,DJY01_GC,DJY02_GC,YF01_GC,YF02_GC,HSM01_GC,PTZ01_GC,ZK01_GC,NJL01_GC,YTY01_GC,PDL01_GC
-#判断数据终端
-second: 1800
-#判断降出力
-AI134: 17.4    #叶轮转速给定
-AI178: 17.4    #转矩给定
-#AI443:容量
-
-#计算电量直接取,如果不是1就是相减算
-typeOfElectric:
-  #直接取
-  direct: GJY02_GC,YF01_GC,YF02_GC,HSM01_GC,PTZ01_GC,ZK01_GC
-
-
-
-
-
-
-
-
-
-
-
-
-
-

+ 0 - 4
realtime/generationXa-service/src/main/resources/application.yml

@@ -1,4 +0,0 @@
-spring:
-  profiles:
-    active: jn
-#    active: td

+ 0 - 89
realtime/generationXa-service/src/test/java/com/gyee/generation/GenerationTest.java

@@ -1,89 +0,0 @@
-package com.gyee.generation;
-
-import com.gyee.common.model.PointData;
-import com.gyee.common.model.algorithm.PointVo;
-import com.gyee.common.util.algorithm.LineBuild;
-import com.gyee.generation.init.CacheContext;
-import com.gyee.generation.model.auto.Windturbinetestingpointnew;
-import com.gyee.generation.service.*;
-import com.gyee.generation.util.realtimesource.EdosUtil;
-import com.gyee.generation.util.redis.RedisService;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
-import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.test.context.junit4.SpringRunner;
-
-import javax.annotation.Resource;
-import java.util.*;
-
-/**
- * @ClassName : GenerationTest
- * @Author : xieshengjie
- * @Date: 2022/3/8 9:17
- * @Description :
- */
-@SpringBootTest
-@RunWith(SpringRunner.class)
-@EnableAutoConfiguration(exclude={DataSourceAutoConfiguration.class})
-public class GenerationTest {
-    @Resource
-    private GenerationService generationService;
-    @Resource
-    private StatusService statusService;
-    @Resource
-    private AverageAndGeneratingService averageAndGeneratingService;
-    @Resource
-    private RealtimeSpeedPowerService realtimeSpeedPowerService;
-    @Resource
-    private TheorypowerService theorypowerService;
-    @Resource
-    private EdosUtil edosUtil;
-    @Resource
-    private RedisService redisService;
-    @Resource
-    private FiveLossesService fiveLossesService;
-    @Resource
-    private SafetyService safetyService;
-    @Test
-    public void test1() throws Exception {
-//        averageAndGeneratingService.saveAvespeedAndAvepowerAndScada();
-        statusService.calculateStatus();
-//        realtimeSpeedPowerService.calculateRealtimeSpeedPower();
-//        generationService.saveMeterpointValueRealtime();
-//        theorypowerService.fittingPower();
-//        theorypowerService.theropower();
-//        averageAndGeneratingService.saveAvespeedAndAvepowerAndScada();
-//        fiveLossesService.lossesReal();
-//        fiveLossesService.saveShutdownevent();
-//        safetyService.safetyReatimel();
-//        fiveLossesService.lossesReal();
-    }
-
-
-    @Test
-    public void test2() throws Exception {
-        Windturbinetestingpointnew windturbinetestingpointnew = CacheContext.wtpAimap.get("GJY01_027").get("AI022");
-        Windturbinetestingpointnew windturbinetestingpointnew1 = CacheContext.wtpAimap.get("GJY01_027").get("AI130");
-        Date date = new Date();
-
-        Calendar cal = Calendar.getInstance();
-        cal.setTime(date);
-        cal.add(Calendar.MONTH, -1);
-        Date begin = cal.getTime();
-
-        List<PointData> speedpoints = edosUtil.getHistoryDatasSnap(windturbinetestingpointnew, begin.getTime()/1000 , date.getTime()/1000 , null, 3600l);
-        List<PointData> powerpoints = edosUtil.getHistoryDatasSnap(windturbinetestingpointnew1, begin.getTime()/1000 , date.getTime()/1000 , null, 3600l);
-        Collections.sort(speedpoints, Comparator.comparing(PointData::getPointValueInDouble));
-        Collections.sort(powerpoints, Comparator.comparing(PointData::getPointValueInDouble));
-        double[] speeds = speedpoints.stream().map(i -> i.getPointValueInDouble()).mapToDouble(Double::doubleValue).toArray();
-        double[] powers = powerpoints.stream().map(i -> i.getPointValueInDouble()).mapToDouble(Double::doubleValue).toArray();
-
-        List<PointVo> pointVoList = LineBuild.buildLine(speeds, powers, speeds.length, 20, 0.01);
-    }
-
-    @Test
-    public void test3() throws Exception {
-    }
-}