Forráskód Böngészése

Merge branch 'master' of http://124.70.43.205:3000/xieshengjie/sis-background

chenminghua 1 éve
szülő
commit
55ed37adbb
42 módosított fájl, 34 hozzáadás és 2064 törlés
  1. 5 6
      power-fitting-JN/pom.xml
  2. 10 10
      power-fitting-JN/src/main/java/com.gyee.power.fitting/MapperGenerator.java
  3. 0 39
      power-fitting-JN/src/main/java/com.gyee.power.fitting/common/spring/InitialRunner.java
  4. 3 3
      power-fitting-JN/src/main/java/com.gyee.power.fitting/common/util/FileUtil.java
  5. 0 60
      power-fitting-JN/src/main/java/com.gyee.power.fitting/controller/agc/AgcDeviateController.java
  6. 0 18
      power-fitting-JN/src/main/java/com.gyee.power.fitting/controller/base/WindInfoController.java
  7. 0 33
      power-fitting-JN/src/main/java/com.gyee.power.fitting/controller/fj/FiveLossInfoController.java
  8. 0 164
      power-fitting-JN/src/main/java/com.gyee.power.fitting/controller/gf/PhotovoltaicController.java
  9. 0 12
      power-fitting-JN/src/main/java/com.gyee.power.fitting/mapper/AgcDeviateMapper.java
  10. 0 17
      power-fitting-JN/src/main/java/com.gyee.power.fitting/mapper/LineMapper.java
  11. 0 16
      power-fitting-JN/src/main/java/com.gyee.power.fitting/mapper/PhotovoltaiccapacityMapper.java
  12. 0 18
      power-fitting-JN/src/main/java/com.gyee.power.fitting/mapper/PhotovoltaicivMapper.java
  13. 0 16
      power-fitting-JN/src/main/java/com.gyee.power.fitting/mapper/PowerlossinfoMapper.java
  14. 0 16
      power-fitting-JN/src/main/java/com.gyee.power.fitting/mapper/ProjectMapper.java
  15. 0 92
      power-fitting-JN/src/main/java/com.gyee.power.fitting/model/AgcDeviateModel.java
  16. 0 60
      power-fitting-JN/src/main/java/com.gyee.power.fitting/model/Line.java
  17. 0 78
      power-fitting-JN/src/main/java/com.gyee.power.fitting/model/Photovoltaiccapacity.java
  18. 0 77
      power-fitting-JN/src/main/java/com.gyee.power.fitting/model/Photovoltaiciv.java
  19. 0 77
      power-fitting-JN/src/main/java/com.gyee.power.fitting/model/Powerlossinfo.java
  20. 0 76
      power-fitting-JN/src/main/java/com.gyee.power.fitting/model/Project.java
  21. 1 1
      power-fitting-JN/src/main/java/com.gyee.power.fitting/model/Windturbinetestingpointai2.java
  22. 1 31
      power-fitting-JN/src/main/java/com.gyee.power.fitting/model/custom/FjjxbVo.java
  23. 0 60
      power-fitting-JN/src/main/java/com.gyee.power.fitting/schedule/DeviateAnalysisTask.java
  24. 0 42
      power-fitting-JN/src/main/java/com.gyee.power.fitting/schedule/FiveLossScheduleTask.java
  25. 0 16
      power-fitting-JN/src/main/java/com.gyee.power.fitting/service/IPhotovoltaiccapacityService.java
  26. 0 16
      power-fitting-JN/src/main/java/com.gyee.power.fitting/service/IPhotovoltaicivService.java
  27. 0 22
      power-fitting-JN/src/main/java/com.gyee.power.fitting/service/LineService.java
  28. 0 33
      power-fitting-JN/src/main/java/com.gyee.power.fitting/service/PowerlossinfoService.java
  29. 0 22
      power-fitting-JN/src/main/java/com.gyee.power.fitting/service/ProjectService.java
  30. 0 252
      power-fitting-JN/src/main/java/com.gyee.power.fitting/service/custom/agc/AgcDeviateService.java
  31. 0 109
      power-fitting-JN/src/main/java/com.gyee.power.fitting/service/custom/agc/FileService.java
  32. 1 267
      power-fitting-JN/src/main/java/com.gyee.power.fitting/service/custom/fiveloss/FiveLossService.java
  33. 0 38
      power-fitting-JN/src/main/java/com.gyee.power.fitting/service/impl/LineServiceImpl.java
  34. 0 20
      power-fitting-JN/src/main/java/com.gyee.power.fitting/service/impl/PhotovoltaiccapacityServiceImpl.java
  35. 0 20
      power-fitting-JN/src/main/java/com.gyee.power.fitting/service/impl/PhotovoltaicivServiceImpl.java
  36. 0 99
      power-fitting-JN/src/main/java/com.gyee.power.fitting/service/impl/PowerlossinfoServiceImpl.java
  37. 0 2
      power-fitting-JN/src/main/java/com.gyee.power.fitting/service/impl/PowerwindinfoServiceImpl.java
  38. 0 38
      power-fitting-JN/src/main/java/com.gyee.power.fitting/service/impl/ProjectServiceImpl.java
  39. 13 13
      power-fitting-JN/src/main/resources/application.yaml
  40. 0 23
      power-fitting-JN/src/main/resources/mapper/LineMapper.xml
  41. 0 24
      power-fitting-JN/src/main/resources/mapper/PowerlossinfoMapper.xml
  42. 0 28
      power-fitting-JN/src/main/resources/mapper/ProjectMapper.xml

+ 5 - 6
power-fitting-JN/pom.xml

@@ -41,12 +41,11 @@
             <version>2.7.4</version>
         </dependency>
 
-
-        <!--        <dependency>-->
-        <!--            <groupId>com.oracle</groupId>-->
-        <!--            <artifactId>ojdbc6</artifactId>-->
-        <!--            <version>11.2.0.3</version>-->
-        <!--        </dependency>-->
+        <dependency>
+            <groupId>org.postgresql</groupId>
+            <artifactId>postgresql</artifactId>
+            <version>42.2.5</version>
+        </dependency>
 
         <!--oracle驱动-->
         <!-- https://mvnrepository.com/artifact/com.oracle.database.jdbc/ojdbc8 -->

+ 10 - 10
power-fitting-JN/src/main/java/com.gyee.power.fitting/MapperGenerator.java

@@ -27,27 +27,27 @@ public class MapperGenerator {
     //作者
     private static String authorName = "chenmh";
     //要生成的表名
-    private static String[] tables = {"POWERWINDINFO"};
+    private static String[] tables = {"windpowerstation", "windturbine", "windturbinetestingpointai"};
     //table前缀
     private static String prefix = "";
 
     //数据库类型
-    private static DbType dbType = DbType.ORACLE;
+    private static DbType dbType = DbType.POSTGRE_SQL;
     //数据库配置四要素
 //    private static String driverName = "com.mysql.cj.jdbc.Driver";
 //    private static String url = "jdbc:mysql://localhost:3306/gyee_sample_kudu?useUnicode=true&useSSL=false&characterEncoding=utf8&serverTimezone=UTC";
 //    private static String username = "root";
 //    private static String password = "";
 
-//    private static String driverName = "org.sqlite.JDBC";
-//    private static String url = "jdbc:sqlite::resource:DataMiningTools.db";
-//    private static String username = null;
-//    private static String password = null;
+    private static String driverName = "org.postgresql.Driver";
+    private static String url = "jdbc:postgresql://10.81.3.151:5432/wisdom";
+    private static String username = "gdprod";
+    private static String password = "gd123";
 
-    private static String driverName = "oracle.jdbc.driver.OracleDriver";
-    private static String url = "jdbc:oracle:thin:@192.168.1.105:1521:gdnxfd";
-    private static String username = "nxfdprod";
-    private static String password = "gdnxfd123";
+//    private static String driverName = "oracle.jdbc.driver.OracleDriver";
+//    private static String url = "jdbc:oracle:thin:@192.168.1.105:1521:gdnxfd";
+//    private static String username = "nxfdprod";
+//    private static String password = "gdnxfd123";
 
 
     public static void main(String[] args) {

+ 0 - 39
power-fitting-JN/src/main/java/com.gyee.power.fitting/common/spring/InitialRunner.java

@@ -39,10 +39,6 @@ public class InitialRunner implements CommandLineRunner {
     @Resource
     private ModelpowerdetailsService modelpowerdetailsService;
     @Resource
-    private ProjectService projectService;
-    @Resource
-    private LineService lineService;
-    @Resource
     private PowermodelService powermodelService;
 
 
@@ -88,19 +84,9 @@ public class InitialRunner implements CommandLineRunner {
      */
     public static Map<String, List<Windturbinetestingpointai2>> zglMap = new HashMap<>();
     /**
-     * 期次
-     **/
-    public static List<Project> projectList = new ArrayList<>();
-    /**
-     * 线路
-     **/
-    public static List<Line> lineList = new ArrayList<>();
-    public static Map<String, Project> projectMap = new HashMap<>();
-    /**
      * 所有设备型号
      **/
     public static List<Equipmentmodel> equipmentList = new ArrayList<>();
-    public static Map<String, Line> lineMap = new HashMap<>();
 
     /**
      * key: NG01_01
@@ -123,10 +109,6 @@ public class InitialRunner implements CommandLineRunner {
         cacheStation();
         cachePoints();
         cacheEquipment();
-        cacheProject();
-        cacheLine();
-        cachePhotovoltaicInfo();
-
         // 耗时缓存
         new Thread(){
             @Override
@@ -140,15 +122,6 @@ public class InitialRunner implements CommandLineRunner {
         System.out.println(">>>>>>>>>>>>>>>数据缓存完成<<<<<<<<<<<<<<");
     }
 
-    private void cachePhotovoltaicInfo() {
-        List<Windpowerstationtestingpoint2> zfsPoints = windpowerstationtestingpoint2Service.getPoints("GDC", "SSFS");
-        List<Windpowerstationtestingpoint2> zjwdPoints = windpowerstationtestingpoint2Service.getPoints("GDC", "FCCFTWD");
-        zfsMap = zfsPoints.stream().collect(Collectors.toMap(Windpowerstationtestingpoint2::getWindpowerstationid, Function.identity()));
-        zjwdMap = zjwdPoints.stream().collect(Collectors.toMap(Windpowerstationtestingpoint2::getWindpowerstationid, Function.identity()));
-        List<Windturbinetestingpointai2> zglPoints = pointService.getPoints("GDC", null, "AI130");
-        zglMap = zglPoints.stream().collect(Collectors.groupingBy(Windturbinetestingpointai2::getWindpowerstationid));
-    }
-
     /**
      * 缓存场站、风机数据
      * 数据新增或删除后需要更新,故每次清空
@@ -204,18 +177,6 @@ public class InitialRunner implements CommandLineRunner {
         log.info("保证功率数据缓存完成");
     }
 
-    private void cacheProject(){
-        projectList.addAll(projectService.selectList());
-        projectList.forEach(f -> projectMap.put(f.getId(), f));
-        log.info("期次数据缓存完成");
-    }
-
-    private void cacheLine(){
-        lineList.addAll(lineService.selectList());
-        lineList.forEach(f -> lineMap.put(f.getId(), f));
-        log.info("线路数据缓存完成");
-    }
-
     /**
      * 自算理论功率
      */

+ 3 - 3
power-fitting-JN/src/main/java/com.gyee.power.fitting/common/util/FileUtil.java

@@ -26,9 +26,9 @@ public class FileUtil {
         try {
             File file = new File(fileName);
             if (!file.exists()) {
-                fileName = fileName.substring(0, fileName.lastIndexOf("\\"));
-                File file1 = new File(fileName);
-                file1.mkdirs();
+//                fileName = fileName.substring(0, fileName.lastIndexOf("\\"));
+//                File file1 = new File(fileName);
+//                file1.mkdirs();
                 file.createNewFile();
             }
 

+ 0 - 60
power-fitting-JN/src/main/java/com.gyee.power.fitting/controller/agc/AgcDeviateController.java

@@ -1,60 +0,0 @@
-package com.gyee.power.fitting.controller.agc;
-
-import com.gyee.power.fitting.common.config.GyeeConfig;
-import com.gyee.power.fitting.model.agc.AgcDeviateTag;
-import com.gyee.power.fitting.service.custom.agc.AgcDeviateService;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
-
-import javax.annotation.Resource;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
-
-/**
- * 获取各个场站AGC偏差分析数据
- */
-@RestController
-@RequestMapping("/agc")
-public class AgcDeviateController {
-    @Resource
-    private AgcDeviateService agcDeviateService;
-    @Resource
-    private GyeeConfig gyeeConfig;
-
-    /**
-     * 获取偏差信息
-     *
-     * @param startTs  开始时间
-     * @param endTs    结束时间
-     * @param id       场站id
-     * @param interval 时间间隔
-     * @return
-     */
-    @GetMapping("/deviate")
-    public Map<String, AgcDeviateTag> getData(@RequestParam(value = "startTs") long startTs,
-                                              @RequestParam(value = "endTs") long endTs,
-                                              @RequestParam(value = "id") String id,
-                                              @RequestParam(value = "interval", defaultValue = "60", required = false) int interval) {
-        List<AgcDeviateTag> ls = new ArrayList<>();
-        if (gyeeConfig.isOffLine()) {
-            ls = agcDeviateService.getAgcDeviateTagsOffline(id, startTs, endTs, interval);
-        } else {
-            ls = agcDeviateService.getAgcDeviateTags(id, startTs, endTs, interval);
-        }
-        return ls.stream().collect(Collectors.toMap(AgcDeviateTag::getName, f -> f));
-    }
-
-    /**
-     * 获取配置
-     *
-     * @return
-     */
-    @GetMapping("/config")
-    public Object getAgcConifg() {
-        return agcDeviateService.getConfig();
-    }
-}

+ 0 - 18
power-fitting-JN/src/main/java/com.gyee.power.fitting/controller/base/WindInfoController.java

@@ -4,8 +4,6 @@ import com.alibaba.fastjson.JSONObject;
 import com.gyee.power.fitting.common.result.JsonResult;
 import com.gyee.power.fitting.common.result.ResultCode;
 import com.gyee.power.fitting.common.spring.InitialRunner;
-import com.gyee.power.fitting.model.Line;
-import com.gyee.power.fitting.model.Project;
 import com.gyee.power.fitting.model.Windpowerstation;
 import com.gyee.power.fitting.model.Windturbine;
 import org.springframework.web.bind.annotation.CrossOrigin;
@@ -50,21 +48,5 @@ public class WindInfoController {
         return JsonResult.successData(ResultCode.SUCCESS, list);
     }
 
-    @GetMapping("project")
-    public JSONObject getProject(String stationId) {
-        List<Project> list = InitialRunner.projectList.stream().filter(f -> f.getWindpowerstationid().equals(stationId)).collect(Collectors.toList());
-        return JsonResult.successData(ResultCode.SUCCESS, list);
-    }
 
-    @GetMapping("line")
-    public JSONObject getLine(String projectId) {
-        List<Line> list = new ArrayList<>();
-        String[] projects = projectId.split(",");
-        Map<String, List<Line>> map = InitialRunner.lineList.stream().collect(Collectors.groupingBy(Line::getProjectid));
-        for (String project : projects){
-            if (map.get(project).size() > 0)
-                list.addAll(map.get(project));
-        }
-        return JsonResult.successData(ResultCode.SUCCESS, list);
-    }
 }

+ 0 - 33
power-fitting-JN/src/main/java/com.gyee.power.fitting/controller/fj/FiveLossInfoController.java

@@ -33,37 +33,4 @@ public class FiveLossInfoController {
 
         return JsonResult.error(ResultCode.ERROR_MODEL);
     }
-
-
-    /**
-     * 五损数据查询
-     * @param station
-     * @param project
-     * @param line
-     * @param st
-     * @param et
-     * @param type  1:场站  2:期次  3:线路
-     * @return
-     */
-    @GetMapping("index")
-    public JSONObject fiveLoss(String station, String project, String line, String st, String et, String type){
-        Date begin = DateUtil.parseStrtoDate(st, DateUtil.DATE_PATTERN);
-        Date end = DateUtil.parseStrtoDate(et, DateUtil.DATE_PATTERN);
-        List<String> projects = StringUtils.isEmpty(project) ? Collections.emptyList() : Arrays.asList(project.split(","));
-        List<String> lines = StringUtils.isEmpty(line) ? Collections.emptyList() : Arrays.asList(line.split(","));
-
-        Map<String, Object> map = fiveLossService.fiveLoss(station, projects, lines, begin, end, type);
-        return JsonResult.successData(ResultCode.SUCCESS, map);
-    }
-
-
-    /**
-     * 五损数据计算
-     * @return
-     */
-    @GetMapping("cal")
-    public JSONObject fiveCal(){
-        fiveLossService.fiveLossCal();
-        return JsonResult.success(ResultCode.SUCCESS);
-    }
 }

+ 0 - 164
power-fitting-JN/src/main/java/com.gyee.power.fitting/controller/gf/PhotovoltaicController.java

@@ -1,164 +0,0 @@
-package com.gyee.power.fitting.controller.gf;
-
-import com.alibaba.fastjson.JSONObject;
-import com.gyee.power.fitting.common.result.JsonResult;
-import com.gyee.power.fitting.common.result.ResultCode;
-import com.gyee.power.fitting.model.anno.AnnotationTool;
-import com.gyee.power.fitting.model.anno.FixedVo;
-import com.gyee.power.fitting.model.custom.FjjxbVo;
-import com.gyee.power.fitting.model.custom.PhotovoltaicInfo;
-import com.gyee.power.fitting.model.custom.TableTitle;
-import com.gyee.power.fitting.service.impl.IvPvCurveFittingService;
-import org.springframework.web.bind.annotation.*;
-
-import javax.annotation.Resource;
-import javax.servlet.http.HttpServletResponse;
-import java.util.*;
-import java.util.stream.Collectors;
-
-@RestController("/photovol")
-public class PhotovoltaicController {
-
-    @Resource
-    private IvPvCurveFittingService curveFittingService;
-
-    @GetMapping("/filelist")
-    private JSONObject getFileList(@RequestParam("station") String station,
-                                   @RequestParam("inverters") List<String> inverters,
-                                   @RequestParam("startdate") long startdate,
-                                   @RequestParam("enddate") long enddate) {
-        List<String> fileList = curveFittingService.getFileList(station, inverters, startdate, enddate, false);
-        if (fileList == null) {
-            try {
-                curveFittingService.getDatas2File(station, startdate, enddate);
-                curveFittingService.standardPointCalculate2();
-            } catch (Exception e) {
-                return JsonResult.error(ResultCode.ERROR_FILE_NO);
-            }
-
-            fileList = curveFittingService.getFileList(station, inverters, startdate, enddate, true);
-        }
-        //Map<String, Object> table = curveFittingService.getTable(fileList.get(0));
-        //table.put("filelist", fileList);
-
-        List<Object> fileLists = curveFittingService.str2FileList(fileList);
-        return JsonResult.successData(ResultCode.SUCCESS, fileLists);
-    }
-
-    @GetMapping("/allfilelist")
-    private JSONObject getFileList() {
-        List<String> fileList = curveFittingService.getAllFileList();
-        List<Object> objects = curveFittingService.str2FileList(fileList);
-        return JsonResult.successData(ResultCode.SUCCESS, objects);
-    }
-
-    /**
-     * 单文件表格显示
-     *
-     * @param filename
-     * @return
-     */
-    @GetMapping("/datas")
-    private JSONObject getDatas(@RequestParam("filename") String filename) {
-        Map<String, Object> table = curveFittingService.getTable(filename);
-        return JsonResult.successData(ResultCode.SUCCESS, table);
-    }
-
-    //功率-时间曲线,根据条件,暂时不用
-    @GetMapping("/analysis/powertime")
-    private JSONObject powerTimeAnalysis(@RequestParam("station") String station,
-                                         @RequestParam("inverters") List<String> inverters,
-                                         @RequestParam("startdate") long startdate,
-                                         @RequestParam("enddate") long enddate) {
-        List<String> fileList = curveFittingService.getFileList(station, inverters, startdate, enddate, true);
-        Map<String, List<PhotovoltaicInfo>> infos = curveFittingService.calculatAnalysis(fileList);
-
-        List<FixedVo> fixedVos = AnnotationTool.getFixedVoList(PhotovoltaicInfo.class);
-        String[] ss = {"station", "datetime", "T", "S", "actualP"};
-        List<String> strings = Arrays.asList(ss);
-        List<TableTitle> collect = fixedVos.stream().map(d -> new TableTitle(d.getName(), d.getDes())).collect(Collectors.toList());
-        collect = collect.stream().filter(c -> strings.contains(c.getKey())).collect(Collectors.toList());
-        TableTitle title = new TableTitle();
-        title.setKey("ideaP");
-        title.setDes("理论功率");
-        collect.add(title);
-
-        Map<String, Object> table = new HashMap<>();
-        table.put("title", collect);
-        table.put("data", infos);
-        return JsonResult.successData(ResultCode.SUCCESS, table);
-    }
-
-    //功率-时间曲线,根据文件
-    @GetMapping("/analysis/powertimefile")
-    private JSONObject powerTimeFile(@RequestParam("filelist") List<String> fileList) {
-        Map<String, List<PhotovoltaicInfo>> infos = curveFittingService.calculatAnalysis(fileList);
-
-        List<TableTitle> collect = curveFittingService.getTheoryTitel();
-
-        Map<String, Object> table = new HashMap<>();
-        table.put("title", collect);
-        table.put("data", infos);
-        return JsonResult.successData(ResultCode.SUCCESS, table);
-    }
-
-    @GetMapping("/test")
-    private void test() {
-        curveFittingService.standardPointCalculate2();
-    }
-
-    @GetMapping("/gfjxb")
-    public JSONObject gfjxb(@RequestParam("startdate") long startdate,
-                            @RequestParam("enddate") long enddate) {
-        List<FjjxbVo> voList = curveFittingService.getPhotovoltaicPerformanceList(startdate, enddate);
-        return JsonResult.successData(ResultCode.SUCCESS, voList);
-    }
-
-    //功率-光照-温度曲线
-    @PostMapping("/analysis/powerbeam")
-    private JSONObject powerBeamTemperature(@RequestBody JSONObject filename) {
-        List<String> strings = jsonObj2List(filename);
-        if (strings.size() > 450) return JsonResult.error(ResultCode.PARAM_NOT_VALID);
-        List<PhotovoltaicInfo> infos = curveFittingService.calculatFitting(strings);
-        List<double[]> b = curveFittingService.oneFileFitting(infos);
-        infos = infos.stream().filter(i -> i.getS() > 1).sorted(Comparator.comparing(PhotovoltaicInfo::getS)).collect(Collectors.toList());
-
-        List<double[]> a = new ArrayList<>();
-        for (PhotovoltaicInfo pi : infos) {
-
-            double[] scatter = new double[3];
-
-            scatter[0] = pi.getS();
-            scatter[1] = pi.getActualP();
-            scatter[2] = pi.getT();
-
-            a.add(scatter);
-        }
-
-        HashMap<String, Object> map = new HashMap<>();
-        map.put("scatter", a);
-        map.put("curve", b);
-
-        return JsonResult.successData(ResultCode.SUCCESS, map);
-    }
-
-    //文件删除
-    @DeleteMapping("/delete/files")
-    private JSONObject deleteFiles(@RequestBody JSONObject filename) {
-        List<String> strings = jsonObj2List(filename);
-        int i = curveFittingService.deleteFiles(strings);
-        return JsonResult.successData(ResultCode.SUCCESS, "共删除" + i + "个文件,删除失败" + (strings.size() - i) + "个!");
-    }
-
-    private List<String> jsonObj2List(JSONObject filename) {
-        String fn = filename.getString("filename");
-        String[] split = fn.split(",");
-        return Arrays.asList(split);
-    }
-
-    @GetMapping("/export/files")
-    private void exportFiles(HttpServletResponse response, @RequestParam("filename") String filename) {
-        String[] split = filename.split(",");
-        curveFittingService.downFiles(Arrays.asList(split), response);
-    }
-}

+ 0 - 12
power-fitting-JN/src/main/java/com.gyee.power.fitting/mapper/AgcDeviateMapper.java

@@ -1,12 +0,0 @@
-package com.gyee.power.fitting.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.gyee.power.fitting.model.AgcDeviateModel;
-import org.apache.ibatis.annotations.Mapper;
-
-
-
-@Mapper
-public interface AgcDeviateMapper extends BaseMapper<AgcDeviateModel> {
-
-}

+ 0 - 17
power-fitting-JN/src/main/java/com.gyee.power.fitting/mapper/LineMapper.java

@@ -1,17 +0,0 @@
-package com.gyee.power.fitting.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.gyee.power.fitting.model.Line;
-
-
-/**
- * <p>
- *  Mapper 接口
- * </p>
- *
- * @author chenmh
- * @since 2023-02-03
- */
-public interface LineMapper extends BaseMapper<Line> {
-
-}

+ 0 - 16
power-fitting-JN/src/main/java/com.gyee.power.fitting/mapper/PhotovoltaiccapacityMapper.java

@@ -1,16 +0,0 @@
-package com.gyee.power.fitting.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.gyee.power.fitting.model.Photovoltaiccapacity;
-
-/**
- * <p>
- *  Mapper 接口
- * </p>
- *
- * @author gfhd
- * @since 2022-12-13
- */
-public interface PhotovoltaiccapacityMapper extends BaseMapper<Photovoltaiccapacity> {
-
-}

+ 0 - 18
power-fitting-JN/src/main/java/com.gyee.power.fitting/mapper/PhotovoltaicivMapper.java

@@ -1,18 +0,0 @@
-package com.gyee.power.fitting.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.gyee.power.fitting.model.Photovoltaiciv;
-import org.apache.ibatis.annotations.Mapper;
-
-/**
- * <p>
- *  Mapper 接口
- * </p>
- *
- * @author gfhd
- * @since 2022-12-13
- */
-@Mapper
-public interface PhotovoltaicivMapper extends BaseMapper<Photovoltaiciv> {
-
-}

+ 0 - 16
power-fitting-JN/src/main/java/com.gyee.power.fitting/mapper/PowerlossinfoMapper.java

@@ -1,16 +0,0 @@
-package com.gyee.power.fitting.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.gyee.power.fitting.model.Powerlossinfo;
-
-/**
- * <p>
- *  Mapper 接口
- * </p>
- *
- * @author chenmh
- * @since 2023-02-03
- */
-public interface PowerlossinfoMapper extends BaseMapper<Powerlossinfo> {
-
-}

+ 0 - 16
power-fitting-JN/src/main/java/com.gyee.power.fitting/mapper/ProjectMapper.java

@@ -1,16 +0,0 @@
-package com.gyee.power.fitting.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.gyee.power.fitting.model.Project;
-
-/**
- * <p>
- *  Mapper 接口
- * </p>
- *
- * @author chenmh
- * @since 2023-02-03
- */
-public interface ProjectMapper extends BaseMapper<Project> {
-
-}

+ 0 - 92
power-fitting-JN/src/main/java/com.gyee.power.fitting/model/AgcDeviateModel.java

@@ -1,92 +0,0 @@
-package com.gyee.power.fitting.model;
-
-import com.baomidou.mybatisplus.annotation.TableName;
-import com.baomidou.mybatisplus.extension.activerecord.Model;
-
-import javax.persistence.Column;
-import javax.persistence.Id;
-
-@TableName("controlsettings")
-public class AgcDeviateModel extends Model<AgcDeviateModel> {
-    /**
-     * 唯一ID
-     */
-    @Id
-    @Column(name = "ID")
-    private String id;
-    /**
-     * key
-     */
-    @Column(name = "KEY")
-    private String key;
-    /**
-     * 时间戳
-     */
-    @Column(name = "TIMESTAMP")
-    private Long timestamp;
-    /**
-     * 说明,描述
-     */
-    @Column(name = "DESCRIPTION")
-    private String description;
-    /**
-     * 值
-     */
-    @Column(name = "VALUE")
-    private String value;
-
-    /**
-     * 是否是备份
-     */
-    @Column(name = "BACKUP")
-    private boolean backup;
-
-    public String getId() {
-        return id;
-    }
-
-    public void setId(String id) {
-        this.id = id;
-    }
-
-    public String getKey() {
-        return key;
-    }
-
-    public void setKey(String key) {
-        this.key = key;
-    }
-
-    public Long getTimestamp() {
-        return timestamp;
-    }
-
-    public void setTimestamp(Long timestamp) {
-        this.timestamp = timestamp;
-    }
-
-    public String getDescription() {
-        return description;
-    }
-
-    public void setDescription(String description) {
-        this.description = description;
-    }
-
-    public String getValue() {
-        return value;
-    }
-
-    public void setValue(String value) {
-        this.value = value;
-    }
-
-    public boolean getBackup() {
-        return backup;
-    }
-
-    public void setBackup(boolean backup) {
-        this.backup = backup;
-    }
-
-}

+ 0 - 60
power-fitting-JN/src/main/java/com.gyee.power.fitting/model/Line.java

@@ -1,60 +0,0 @@
-package com.gyee.power.fitting.model;
-
-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.io.Serializable;
-
-/**
- * <p>
- * 
- * </p>
- *
- * @author chenmh
- * @since 2023-02-03
- */
-@Data
-@EqualsAndHashCode(callSuper = false)
-@TableName("LINE")
-public class Line extends Model<Line> {
-
-    private static final long serialVersionUID=1L;
-
-    @TableId("ID")
-    private String id;
-
-    @TableField("CODE")
-    private String code;
-
-    @TableField("NAME")
-    private String name;
-
-    @TableField("ANAME")
-    private String aname;
-
-    @TableField("PROJECTID")
-    private String projectid;
-
-    @TableField("ORDERNUM")
-    private String ordernum;
-
-    @TableField("CAPACITY")
-    private String capacity;
-
-    @TableField("CAPACITYUNIT")
-    private String capacityunit;
-
-    @TableField("QUANTITY")
-    private String quantity;
-
-
-    @Override
-    protected Serializable pkVal() {
-        return this.id;
-    }
-
-}

+ 0 - 78
power-fitting-JN/src/main/java/com.gyee.power.fitting/model/Photovoltaiccapacity.java

@@ -1,78 +0,0 @@
-package com.gyee.power.fitting.model;
-
-import java.io.Serializable;
-import java.math.BigDecimal;
-
-/**
- * <p>
- * 
- * </p>
- *
- * @author gfhd
- * @since 2022-12-13
- */
-public class Photovoltaiccapacity implements Serializable {
-
-    private static final long serialVersionUID = 1L;
-
-    private String id;
-
-    private Short branchesnum;
-
-    private Integer platesnum;
-
-    private BigDecimal ratedcapacity;
-
-    private String stationid;
-
-    public String getId() {
-        return id;
-    }
-
-    public void setId(String id) {
-        this.id = id;
-    }
-
-    public Short getBranchesnum() {
-        return branchesnum;
-    }
-
-    public void setBranchesnum(Short branchesnum) {
-        this.branchesnum = branchesnum;
-    }
-
-    public Integer getPlatesnum() {
-        return platesnum;
-    }
-
-    public void setPlatesnum(Integer platesnum) {
-        this.platesnum = platesnum;
-    }
-
-    public BigDecimal getRatedcapacity() {
-        return ratedcapacity;
-    }
-
-    public void setRatedcapacity(BigDecimal ratedcapacity) {
-        this.ratedcapacity = ratedcapacity;
-    }
-
-    public String getStationid() {
-        return stationid;
-    }
-
-    public void setStationid(String stationid) {
-        this.stationid = stationid;
-    }
-
-    @Override
-    public String toString() {
-        return "Photovoltaiccapacity{" +
-            "id = " + id +
-            ", branchesnum = " + branchesnum +
-            ", platesnum = " + platesnum +
-            ", ratedcapacity = " + ratedcapacity +
-            ", stationid = " + stationid +
-        "}";
-    }
-}

+ 0 - 77
power-fitting-JN/src/main/java/com.gyee.power.fitting/model/Photovoltaiciv.java

@@ -1,77 +0,0 @@
-package com.gyee.power.fitting.model;
-
-import java.io.Serializable;
-
-/**
- * <p>
- * 
- * </p>
- *
- * @author gfhd
- * @since 2022-12-13
- */
-public class Photovoltaiciv implements Serializable {
-
-    private static final long serialVersionUID = 1L;
-
-    private String id;
-
-    private String windturbineid;
-
-    private Short branchnum;
-
-    private String electric;
-
-    private String description;
-
-    public String getId() {
-        return id;
-    }
-
-    public void setId(String id) {
-        this.id = id;
-    }
-
-    public String getWindturbineid() {
-        return windturbineid;
-    }
-
-    public void setWindturbineid(String windturbineid) {
-        this.windturbineid = windturbineid;
-    }
-
-    public Short getBranchnum() {
-        return branchnum;
-    }
-
-    public void setBranchnum(Short branchnum) {
-        this.branchnum = branchnum;
-    }
-
-    public String getElectric() {
-        return electric;
-    }
-
-    public void setElectric(String electric) {
-        this.electric = electric;
-    }
-
-    public String getDescription() {
-        return description;
-    }
-
-    public void setDescription(String description) {
-        this.description = description;
-    }
-
-    @Override
-    public String toString() {
-        return "Photovoltaiciv{" +
-            "id = " + id +
-            ", windturbineid = " + windturbineid +
-            ", branchnum = " + branchnum +
-            ", electric = " + electric +
-            ", description = " + description +
-        "}";
-    }
-}

+ 0 - 77
power-fitting-JN/src/main/java/com.gyee.power.fitting/model/Powerlossinfo.java

@@ -1,77 +0,0 @@
-package com.gyee.power.fitting.model;
-
-import com.baomidou.mybatisplus.annotation.TableField;
-import com.baomidou.mybatisplus.annotation.TableName;
-import com.baomidou.mybatisplus.extension.activerecord.Model;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import java.io.Serializable;
-import java.util.Date;
-
-/**
- * <p>
- * 
- * </p>
- *
- * @author chenmh
- * @since 2023-02-03
- */
-@Data
-@EqualsAndHashCode(callSuper = false)
-@TableName("POWERLOSSINFO")
-public class Powerlossinfo extends Model<Powerlossinfo> {
-
-    private static final long serialVersionUID=1L;
-
-    @TableField("ID")
-    private String id;
-
-    @TableField("WINDTURBINEID")
-    private String windturbineid;
-
-    @TableField("PROJECTID")
-    private String projectid;
-
-    @TableField("LINEID")
-    private String lineid;
-
-    @TableField("STATIONID")
-    private String stationid;
-
-    @TableField("RECORDDATE")
-    private Date recorddate;
-
-    @TableField("GENECAPACITY")
-    private double genecapacity;
-
-    @TableField("THEROGENECAPACITY")
-    private double therogenecapacity;
-
-    @TableField("SPEED")
-    private double speed;
-
-    @TableField("DAYSLSSDL")
-    private double dayslssdl;
-
-    @TableField("DAYJHJXSSDL")
-    private double dayjhjxssdl;
-
-    @TableField("DAYFJHJXSSDL")
-    private double dayfjhjxssdl;
-
-    @TableField("DAYXDSSDL")
-    private double dayxdssdl;
-
-    @TableField("DAYXNSSDL")
-    private double dayxnssdl;
-
-    @TableField("DAYGZSSDL")
-    private double daygzssdl;
-
-
-    @Override
-    protected Serializable pkVal() {
-        return null;
-    }
-
-}

+ 0 - 76
power-fitting-JN/src/main/java/com.gyee.power.fitting/model/Project.java

@@ -1,76 +0,0 @@
-package com.gyee.power.fitting.model;
-
-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.io.Serializable;
-import java.time.LocalDate;
-
-/**
- * <p>
- * 
- * </p>
- *
- * @author chenmh
- * @since 2023-02-03
- */
-@Data
-@EqualsAndHashCode(callSuper = false)
-@TableName("PROJECT")
-public class Project extends Model<Project> {
-
-    private static final long serialVersionUID=1L;
-
-    @TableId("ID")
-    private String id;
-
-    @TableField("CODE")
-    private String code;
-
-    @TableField("NAME")
-    private String name;
-
-    @TableField("ANAME")
-    private String aname;
-
-    @TableField("WINDPOWERSTATIONID")
-    private String windpowerstationid;
-
-    @TableField("CAPACITY")
-    private String capacity;
-
-    @TableField("CAPACITYUNIT")
-    private String capacityunit;
-
-    @TableField("QUANTITY")
-    private String quantity;
-
-    @TableField("MODEL")
-    private String model;
-
-    @TableField("COMMISSIONDATE")
-    private LocalDate commissiondate;
-
-    @TableField("MASTERPHONE")
-    private String masterphone;
-
-    @TableField("SHIFTFOREMAN")
-    private String shiftforeman;
-
-    @TableField("SHIFTFOREMANPHONE")
-    private String shiftforemanphone;
-
-    @TableField("ORDERNUM")
-    private String ordernum;
-
-
-    @Override
-    protected Serializable pkVal() {
-        return this.id;
-    }
-
-}

+ 1 - 1
power-fitting-JN/src/main/java/com.gyee.power.fitting/model/Windturbinetestingpointai2.java

@@ -18,7 +18,7 @@ import lombok.EqualsAndHashCode;
  */
 @Data
 @EqualsAndHashCode(callSuper = false)
-@TableName("WINDTURBINETESTINGPOINTAI2")
+@TableName("WINDTURBINETESTINGPOINTAI")
 public class Windturbinetestingpointai2 extends Model<Windturbinetestingpointai2> {
 
     private static final long serialVersionUID=1L;

+ 1 - 31
power-fitting-JN/src/main/java/com.gyee.power.fitting/model/custom/FjjxbVo.java

@@ -1,6 +1,5 @@
 package com.gyee.power.fitting.model.custom;
 
-import com.gyee.power.fitting.model.Powerlossinfo;
 import com.gyee.power.fitting.model.anno.Desc;
 import lombok.Data;
 
@@ -9,7 +8,7 @@ import java.math.RoundingMode;
 import java.util.List;
 
 @Data
-public class FjjxbVo implements ToData<List<Powerlossinfo>> {
+public class FjjxbVo {
 
     private String id;
     @Desc(des = "名称")
@@ -32,33 +31,4 @@ public class FjjxbVo implements ToData<List<Powerlossinfo>> {
     private double xn;
     @Desc(des = "风能利用率(%)")
     private double fnlly;
-
-
-    @Override
-    public FjjxbVo toData(List<Powerlossinfo> ls) {
-        FjjxbVo vo = new FjjxbVo();
-
-        double fdl = ls.stream().mapToDouble(Powerlossinfo::getGenecapacity).sum();
-        double llfdl = ls.stream().mapToDouble(Powerlossinfo::getTherogenecapacity).sum();
-        double speed = ls.stream().mapToDouble(Powerlossinfo::getSpeed).average().getAsDouble();
-        double fjh = ls.stream().mapToDouble(Powerlossinfo::getDayfjhjxssdl).sum();
-        double jh = ls.stream().mapToDouble(Powerlossinfo::getDayjhjxssdl).sum();
-        double sl = ls.stream().mapToDouble(Powerlossinfo::getDayslssdl).sum();
-        double xd = ls.stream().mapToDouble(Powerlossinfo::getDayxdssdl).sum();
-        double xn = ls.stream().mapToDouble(Powerlossinfo::getDayxnssdl).sum();
-        vo.setLlfdl(new BigDecimal(llfdl / 10000).setScale(2, RoundingMode.CEILING).doubleValue());
-        vo.setSjfdl(new BigDecimal(fdl / 10000).setScale(2, RoundingMode.CEILING).doubleValue());
-        vo.setSpeed(new BigDecimal(speed).setScale(2, RoundingMode.CEILING).doubleValue());
-        vo.setFjhjx(new BigDecimal(fjh / 10000).setScale(2, RoundingMode.CEILING).doubleValue());
-        vo.setJhjx(new BigDecimal(jh / 10000).setScale(2, RoundingMode.CEILING).doubleValue());
-        vo.setSl(new BigDecimal(sl / 10000).setScale(2, RoundingMode.CEILING).doubleValue());
-        vo.setXd(new BigDecimal(xd / 10000).setScale(2, RoundingMode.CEILING).doubleValue());
-        vo.setXn(new BigDecimal(xn / 10000).setScale(2, RoundingMode.CEILING).doubleValue());
-        if (llfdl > 0)
-            vo.setFnlly(new BigDecimal((fdl / llfdl) * 100).setScale(2, RoundingMode.CEILING).doubleValue());
-        else
-            vo.setFnlly(82.35);
-
-        return vo;
-    }
 }

+ 0 - 60
power-fitting-JN/src/main/java/com.gyee.power.fitting/schedule/DeviateAnalysisTask.java

@@ -1,60 +0,0 @@
-package com.gyee.power.fitting.schedule;
-
-import com.gyee.power.fitting.common.constants.Constants;
-import com.gyee.power.fitting.common.spring.InitialRunner;
-import com.gyee.power.fitting.common.util.DateUtil;
-import com.gyee.power.fitting.model.Powerfittinganalysis;
-import com.gyee.power.fitting.model.Windturbine;
-import com.gyee.power.fitting.service.PowerfittinganalysisService;
-import com.gyee.power.fitting.service.custom.curve.DataPrepareService;
-import com.gyee.power.fitting.service.custom.curve.DataProcessService;
-import org.springframework.scheduling.annotation.Scheduled;
-import org.springframework.stereotype.Component;
-
-import javax.annotation.Resource;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
-
-@Component
-public class DeviateAnalysisTask {
-
-    @Resource
-    private DataPrepareService prepareService;
-    @Resource
-    private DataProcessService processService;
-    @Resource
-    private PowerfittinganalysisService powerService;
-
-
-    /**
-     * 元数据缓存
-     */
-    @Scheduled(cron = "0 0 1 1 * ?")  //每月1号凌晨1点执行
-    public void dataPrepare(){
-        Date month = DateUtil.addMonths(new Date(), -1);
-        Date st = DateUtil.dateZeroFormat(month);  //上月1号0点值
-        Date et = DateUtil.dateZeroFormat(new Date());  //当月1号0点值
-        Map<String, List<Windturbine>> wpMap = InitialRunner.wpMap;
-        wpMap.forEach((k, v) -> {
-            List<String> wtIds = v.stream().map(m -> m.getId()).collect(Collectors.toList());
-            prepareService.dataPrepare(k, wtIds, st.getTime(), et.getTime(), 10 * 60);
-        });
-    }
-
-
-    /**
-     * 根据缓存的文件进行数据预处理
-     */
-    @Scheduled(cron = "0 0 22 1 * ?")  //每月1号22点执行
-    public void dataProcess(){
-        List<Powerfittinganalysis> list = powerService.selectListByIsCal(Constants.DATA_PROCESS, 0);
-        if (list == null || list.size() == 0)
-            return;
-
-        List<String> ids = list.stream().map(m -> m.getId()).collect(Collectors.toList());
-        processService.dataProcess(ids, 25.0, 0.0, 2500.0, 0.0, true, true, true, true, true, true, 3);
-    }
-
-}

+ 0 - 42
power-fitting-JN/src/main/java/com.gyee.power.fitting/schedule/FiveLossScheduleTask.java

@@ -1,42 +0,0 @@
-package com.gyee.power.fitting.schedule;
-
-
-import com.gyee.power.fitting.common.config.GyeeConfig;
-import com.gyee.power.fitting.common.util.DateUtil;
-import com.gyee.power.fitting.service.custom.fiveloss.FiveLossService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.scheduling.annotation.Scheduled;
-import org.springframework.stereotype.Component;
-
-import java.util.Date;
-
-@Component
-public class FiveLossScheduleTask {
-
-    @Autowired
-    private GyeeConfig gyeeConfig;
-    @Autowired
-    private FiveLossService fiveLossService;
-
-    /**
-     * 五损数据离线计算,使用已经缓存的文件
-     */
-    @Scheduled(cron = "0 0 23 1 * ?")  //每月1号23点执行
-    public void fiveLossCal(){
-        fiveLossService.fiveLossCal();
-    }
-
-    /**
-     * 每月2号凌晨三点执行
-     */
-    @Scheduled(cron = "0 0 3 * * ?")  //每天凌晨三点执行
-    public void fiveLossLineCal(){
-        // 是否实时计算五损数据
-        if (gyeeConfig.isRealTimeCal()){
-            Date date = DateUtil.addDays(new Date(), -1);
-            Date st = DateUtil.dateZeroFormat(date);
-            Date et = DateUtil.dateZeroFormat(new Date());
-            fiveLossService.fiveLossCalByLine(st.getTime(), et.getTime(), 60);
-        }
-    }
-}

+ 0 - 16
power-fitting-JN/src/main/java/com.gyee.power.fitting/service/IPhotovoltaiccapacityService.java

@@ -1,16 +0,0 @@
-package com.gyee.power.fitting.service;
-
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.gyee.power.fitting.model.Photovoltaiccapacity;
-
-/**
- * <p>
- *  服务类
- * </p>
- *
- * @author gfhd
- * @since 2022-12-13
- */
-public interface IPhotovoltaiccapacityService extends IService<Photovoltaiccapacity> {
-
-}

+ 0 - 16
power-fitting-JN/src/main/java/com.gyee.power.fitting/service/IPhotovoltaicivService.java

@@ -1,16 +0,0 @@
-package com.gyee.power.fitting.service;
-
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.gyee.power.fitting.model.Photovoltaiciv;
-
-/**
- * <p>
- *  服务类
- * </p>
- *
- * @author gfhd
- * @since 2022-12-13
- */
-public interface IPhotovoltaicivService extends IService<Photovoltaiciv> {
-
-}

+ 0 - 22
power-fitting-JN/src/main/java/com.gyee.power.fitting/service/LineService.java

@@ -1,22 +0,0 @@
-package com.gyee.power.fitting.service;
-
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.gyee.power.fitting.model.Line;
-
-import java.util.List;
-
-
-/**
- * <p>
- *  服务类
- * </p>
- *
- * @author chenmh
- * @since 2023-02-03
- */
-public interface LineService extends IService<Line> {
-
-
-    List<Line> selectList();
-
-}

+ 0 - 33
power-fitting-JN/src/main/java/com.gyee.power.fitting/service/PowerlossinfoService.java

@@ -1,33 +0,0 @@
-package com.gyee.power.fitting.service;
-
-import com.baomidou.mybatisplus.core.conditions.Wrapper;
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.gyee.power.fitting.model.Powerlossinfo;
-
-import java.util.Date;
-import java.util.List;
-
-
-/**
- * <p>
- *  服务类
- * </p>
- *
- * @author chenmh
- * @since 2023-02-03
- */
-public interface PowerlossinfoService extends IService<Powerlossinfo> {
-
-
-    void insertItem(Powerlossinfo obj);
-
-
-    void insertBatch(List<Powerlossinfo> list);
-
-
-    void deleteBatch(String wtId, List<Date> dates);
-
-    void deleteByWtIdAndDate(String wtId, Date date);
-
-    List<Powerlossinfo> selectList(String station, List<String> project, List<String> line, Date st, Date et);
-}

+ 0 - 22
power-fitting-JN/src/main/java/com.gyee.power.fitting/service/ProjectService.java

@@ -1,22 +0,0 @@
-package com.gyee.power.fitting.service;
-
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.gyee.power.fitting.model.Project;
-
-import java.util.List;
-
-
-/**
- * <p>
- *  服务类
- * </p>
- *
- * @author chenmh
- * @since 2023-02-03
- */
-public interface ProjectService extends IService<Project> {
-
-
-    List<Project> selectList();
-
-}

+ 0 - 252
power-fitting-JN/src/main/java/com.gyee.power.fitting/service/custom/agc/AgcDeviateService.java

@@ -1,252 +0,0 @@
-package com.gyee.power.fitting.service.custom.agc;
-
-import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.TypeReference;
-import com.gyee.power.fitting.common.config.GyeeConfig;
-import com.gyee.power.fitting.common.feign.IDataAdapter;
-import com.gyee.power.fitting.model.agc.AgcDeviateConfig;
-import com.gyee.power.fitting.model.agc.AgcDeviateTag;
-import com.gyee.power.fitting.model.agc.AiPoints;
-import com.gyee.power.fitting.mapper.AgcDeviateMapper;
-import com.gyee.power.fitting.model.AgcDeviateModel;
-import com.gyee.power.fitting.model.agc.PointData;
-import org.springframework.core.annotation.Order;
-import org.springframework.core.env.Environment;
-import org.springframework.stereotype.Component;
-
-import javax.annotation.Resource;
-import java.io.File;
-import java.util.*;
-import java.util.stream.Collectors;
-
-/**
- * 读取数据库配置文件
- */
-@Order(0)
-@Component
-public class AgcDeviateService {
-
-    /**
-     * 是否是离线版本
-     */
-    private boolean isOffline;
-
-    /**
-     * 离线数据保存路径
-     */
-    private String filePathPower = "data\\power\\";
-    /**
-     * 文件读写
-     */
-    private FileService fileService;
-
-    private Map<String, List<String>> files;
-
-
-
-    private final AgcDeviateMapper agcDeviateMapper;
-    /**
-     * AGC信息缓存
-     */
-    private Map<String, AgcDeviateConfig> agcDeviateConfigMap;
-
-    @Resource
-    private IDataAdapter iDataAdapter;
-    @Resource
-    private GyeeConfig gyeeConfig;
-
-
-    public AgcDeviateService(AgcDeviateMapper agcDeviateMapper, FileService fs, Environment env) {
-        this.agcDeviateMapper = agcDeviateMapper;
-        fileService = fs;
-        agcDeviateConfigMap = new HashMap<>();
-
-        isOffline = Boolean.TRUE.equals(env.getProperty("gyee.offline", boolean.class));
-        filePathPower = env.getProperty("gyee.file-path-power");
-
-        AgcDeviateConfig[] adcs = null;
-        if (isOffline) {
-            adcs = fileService.getFromFile(filePathPower + "agc_info_net.json", AgcDeviateConfig[].class);
-            initFiles();
-        } else {
-            AgcDeviateModel adm = agcDeviateMapper.selectById("agc_info_net");
-            adcs = JSON.parseObject(adm.getValue(), AgcDeviateConfig[].class);
-        }
-        for (AgcDeviateConfig adc : adcs) {
-            agcDeviateConfigMap.put(adc.getId(), adc);
-        }
-    }
-
-    private void initFiles() {
-        files = new HashMap<>();
-        File f = new File(filePathPower);
-        File[] fs = f.listFiles();
-        for (File v : fs) {
-            if (v.isDirectory()) {
-                continue;
-            }
-            String[] nm = v.getName().split(",");
-            if (nm.length < 1) {
-                continue;
-            }
-            String name = nm[0];
-            if (!files.containsKey(name)) {
-                files.put(name, new ArrayList<>());
-            }
-            files.get(name).add(v.getPath());
-        }
-    }
-
-    /**
-     * 获取agc曲线偏差分析需要的数据
-     *
-     * @param id       场站ID
-     * @param startTs  开始时间戳
-     * @param endTs    结束时间戳
-     * @param interval 数据时间间隔
-     * @return 分析数据
-     */
-    public List<AgcDeviateTag> getAgcDeviateTags(String id, long startTs, long endTs, int interval) {
-        List<AgcDeviateTag> ladt = new ArrayList<>();
-        List<AiPoints> laps = getAiPoints(id);
-        if (laps == null) {
-            return ladt;
-        }
-        for (AiPoints ap : laps) {
-            AgcDeviateTag adt = new AgcDeviateTag();
-            adt.setName(ap.getName());
-            List<PointData> lpd = getPointData(ap, startTs, endTs, interval);
-            adt.setValues(lpd);
-            ladt.add(adt);
-        }
-        // 上限下限
-        List<AgcDeviateTag> upperLowerLimits = getUpperLowerLimits(ladt, id);
-        ladt.addAll(upperLowerLimits);
-        return ladt;
-    }
-
-    private List<PointData> getPointData(AiPoints ap, long startTs, long endTs, int interval) {
-        List<PointData> lpds = null;
-        if (ap.getTag().contains(",")) {
-            lpds = getMultiple(ap, startTs, endTs, interval);
-        } else {
-            lpds = iDataAdapter.getSnapValuesByKey(ap.getTag(), startTs, endTs, interval);
-        }
-        if (ap.getMultiplier() != 1) {
-            for (PointData pd : lpds) {
-                pd.setDoubleValue(pd.getDoubleValue() * ap.getMultiplier());
-            }
-        }
-        return lpds;
-    }
-
-    /**
-     * 获取多个标签点数值
-     */
-    private List<PointData> getMultiple(AiPoints ap, long startTs, long endTs, int interval) {
-        String[] tags = ap.getTag().split(",");
-        boolean isFirst = true;
-        List<PointData> lpd = new ArrayList<>();
-        for (String tag : tags) {
-            if (tag.equals("")) {
-                continue;
-            }
-            List<PointData> vals = iDataAdapter.getSnapValuesByKey(tag, startTs, endTs, interval);
-            for (int i = 0; i < vals.size(); ++i) {
-                if (isFirst) {
-                    lpd.addAll(vals);
-                    isFirst = false;
-                    break;
-                } else {
-                    PointData pd = lpd.get(i);
-                    pd.setDoubleValue(vals.get(i).getDoubleValue() + pd.getDoubleValue());
-                }
-            }
-        }
-        return lpd;
-    }
-
-    /**
-     * 获取上限下限
-     */
-    private List<AgcDeviateTag> getUpperLowerLimits(List<AgcDeviateTag> ladt, String id) {
-        // 装机容量
-        double capacity = getCapacity(id);
-        // 偏差
-        double deviation = capacity * 0.03;
-        // 有功设定
-        Optional<AgcDeviateTag> agcLimit = ladt.stream().filter(ad -> ad.getName().equals("有功设定限值")).findFirst();
-
-        List<AgcDeviateTag> la = new ArrayList<>();
-        if (!agcLimit.isPresent()) {
-            return la;
-        }
-        AgcDeviateTag adtUper = new AgcDeviateTag();
-        adtUper.setName("偏差上限");
-        adtUper.setValues(new ArrayList<>());
-        AgcDeviateTag adtLimt = new AgcDeviateTag();
-        adtLimt.setName("偏差下限");
-        adtLimt.setValues(new ArrayList<>());
-
-        for (PointData pd : agcLimit.get().getValues()) {
-            long ts = pd.getTs();
-            PointData pdUper = new PointData();
-            pdUper.setTs(ts);
-            pdUper.setDoubleValue(pd.getDoubleValue() + deviation);
-            PointData pdLimt = new PointData();
-            pdLimt.setTs(ts);
-            pdLimt.setDoubleValue(pd.getDoubleValue() - deviation);
-            adtUper.getValues().add(pdUper);
-            adtLimt.getValues().add(pdLimt);
-        }
-        la.add(adtUper);
-        la.add(adtLimt);
-        return la;
-    }
-
-
-    /**
-     * 根据ID获取agc配置信息
-     *
-     * @param id 场站ID
-     * @return 配置信息
-     */
-    private List<AiPoints> getAiPoints(String id) {
-        if (!agcDeviateConfigMap.containsKey(id)) {
-            return null;
-        }
-        AiPoints[] aiPoints = agcDeviateConfigMap.get(id).getAiPoints();
-        return Arrays.stream(aiPoints).filter(ap -> ap.getName().contains("功") && !ap.getName().contains("预测")).collect(Collectors.toList());
-    }
-
-    private double getCapacity(String id) {
-        if (!agcDeviateConfigMap.containsKey(id)) {
-            return 0;
-        }
-        return agcDeviateConfigMap.get(id).getInstalledCapacity();
-    }
-
-    /**
-     * 获取配置
-     *
-     * @return
-     */
-    public Object getConfig() {
-        return agcDeviateConfigMap;
-    }
-
-    public List<AgcDeviateTag> getAgcDeviateTagsOffline(String id, long startTs, long endTs, int interval) {
-        if (!files.containsKey(id)) {
-            return new ArrayList<>();
-        }
-        List<String> ls = files.get(id);
-
-        if (ls == null) {
-            return new ArrayList<>();
-        }
-
-        int ran = (int) (Math.random() * ls.size());
-        return fileService.getFromFile(ls.get(ran), new TypeReference<List<AgcDeviateTag>>() {
-        });
-    }
-}

+ 0 - 109
power-fitting-JN/src/main/java/com.gyee.power.fitting/service/custom/agc/FileService.java

@@ -1,109 +0,0 @@
-package com.gyee.power.fitting.service.custom.agc;
-
-import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.TypeReference;
-import org.springframework.stereotype.Component;
-
-import java.io.*;
-import java.lang.reflect.Type;
-
-/**
- * 配置文件读取
- *
- * @author xysn
- */
-@Component
-public class FileService {
-    /**
-     * 从json格式文件中获取对象
-     *
-     * @param path 文件路径
-     * @param type 对象类型
-     * @param <T>  泛型
-     * @return 返回对象
-     */
-    public <T> T getFromFile(String path, Type type) {
-        String str = getStringFormFile(path);
-        return JSON.parseObject(str, type);
-    }
-
-    /**
-     * 从json格式文件中获取对象
-     *
-     * @param path 文件路径
-     * @param type 对象类型
-     * @param <T>  泛型
-     * @return 返回对象
-     */
-    public <T> T getFromFile(String path, TypeReference<T> type) {
-        String str = getStringFormFile(path);
-        return JSON.parseObject(str, type);
-    }
-
-    /**
-     * 从文件中获取字符串
-     *
-     * @param path 路径
-     * @return 字符串
-     */
-    public String getStringFormFile(String path) {
-        BufferedReader bufferedReader = null;
-        File file = new File(path);
-        if (!file.exists()) {
-            return "";
-        }
-        try {
-            bufferedReader = new BufferedReader(new FileReader(file));
-            StringBuilder sb = new StringBuilder();
-            String s = null;
-            while ((s = bufferedReader.readLine()) != null) {
-                sb.append(s);
-            }
-            return sb.toString();
-        } catch (IOException e) {
-            e.printStackTrace();
-        } finally {
-            try {
-                assert bufferedReader != null;
-                bufferedReader.close();
-            } catch (IOException e) {
-                e.printStackTrace();
-            }
-        }
-        return "";
-    }
-
-    /**
-     * 保存对象到文件中
-     *
-     * @param path 文件路径
-     * @param obj  要保存的对象
-     * @return 是否保存成功
-     */
-    public boolean saveObjectToFile(String path, Object obj) {
-        BufferedWriter bufferedWriter = null;
-        try {
-            File file = new File(path);
-            bufferedWriter = new BufferedWriter(new FileWriter(file));
-            String str = "";
-            if (obj instanceof String) {
-                str = obj.toString();
-            } else {
-                str = JSON.toJSONString(obj);
-            }
-            bufferedWriter.write(str);
-            bufferedWriter.flush();
-            return true;
-        } catch (Exception e) {
-            e.printStackTrace();
-        } finally {
-            try {
-                assert bufferedWriter != null;
-                bufferedWriter.close();
-            } catch (IOException e) {
-                e.printStackTrace();
-            }
-        }
-        return false;
-    }
-}

+ 1 - 267
power-fitting-JN/src/main/java/com.gyee.power.fitting/service/custom/fiveloss/FiveLossService.java

@@ -17,7 +17,6 @@ import com.gyee.power.fitting.model.custom.PowerPointData;
 import com.gyee.power.fitting.model.custom.TableTitle;
 import com.gyee.power.fitting.model.custom.TsDoubleData;
 import com.gyee.power.fitting.service.PowerfittinganalysisService;
-import com.gyee.power.fitting.service.PowerlossinfoService;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.scheduling.annotation.Async;
 import org.springframework.stereotype.Service;
@@ -36,165 +35,10 @@ public class FiveLossService {
 
     @Resource
     private PowerfittinganalysisService analysisService;
-    @Resource
-    private PowerlossinfoService lossInfoService;
+
     @Resource
     private RemoteServiceBuilder remoteService;
 
-    /**
-     * 五项损失查询
-     *
-     * @param station 场站
-     * @param project 期次
-     * @param line    线路
-     * @param type    1:场站  2:期次  3:线路
-     * @return
-     */
-    public Map<String, Object> fiveLoss(String station, List<String> project, List<String> line, Date st, Date et, String type) {
-        Map<String, Object> promise = new HashMap<>();
-        Map<String, String> stationMap = InitialRunner.stationMap;
-        Map<String, Windturbine> wtMap = InitialRunner.wtMap;
-        Map<String, Project> pMap = InitialRunner.projectMap;
-        Map<String, Line> lMap = InitialRunner.lineMap;
-
-        List<Powerlossinfo> list = lossInfoService.selectList(station, project, line, st, et);
-        if (list == null || list.size() == 0)
-            return promise;
-
-        Map<String, List<Powerlossinfo>> collect = null;
-        if (type.equals("1"))
-            collect = list.stream().collect(Collectors.groupingBy(Powerlossinfo::getStationid));
-        else if (type.equals("2"))
-            collect = list.stream().collect(Collectors.groupingBy(Powerlossinfo::getProjectid));
-        else if (type.equals("3"))
-            collect = list.stream().collect(Collectors.groupingBy(Powerlossinfo::getLineid));
-        else if (line.size() > 0)
-            collect = list.stream().collect(Collectors.groupingBy(Powerlossinfo::getLineid));
-        else if (project.size() > 0)
-            collect = list.stream().collect(Collectors.groupingBy(Powerlossinfo::getProjectid));
-        else
-            collect = list.stream().collect(Collectors.groupingBy(Powerlossinfo::getWindturbineid));
-
-        List<FjjxbVo> result = collect.entrySet()
-                .stream()
-                .map(entry -> {
-                    String key = entry.getKey();
-                    List<Powerlossinfo> value = entry.getValue();
-                    FjjxbVo vo = new FjjxbVo().toData(value);
-                    vo.setId(key);
-                    if (type.equals("1"))
-                        vo.setName(stationMap.get(key));
-                    else if (type.equals("2"))
-                        vo.setName(pMap.get(key).getName());
-                    else if (type.equals("3"))
-                        vo.setName(lMap.get(key).getName());
-                    else if (line.size() > 0)
-                        vo.setName(lMap.get(key).getName());
-                    else if (project.size() > 0)
-                        vo.setName(pMap.get(key).getName());
-                    else
-                        vo.setName(wtMap.get(key).getName());
-                    return vo;
-                }).sorted(Comparator.comparing(FjjxbVo::getId)).collect(Collectors.toList());
-
-        /** 添加标题 **/
-        List<FixedVo> fxList = AnnotationTool.getFixedVoList(FjjxbVo.class);
-        List<TableTitle> lt = fxList.stream().map(d -> new TableTitle(d.getName(), d.getDes())).collect(Collectors.toList());
-
-        promise.put("title", lt);
-        promise.put("data", result);
-
-        return promise;
-    }
-
-
-    /** 根据已缓存的文件计算损失电量
-     * 明细状态
-     * 0-待机  1-手动停机  2-正常发电  3-缺陷降出力  4-限电降出力  5-限电停机  6-故障停机
-     * 7-场内受累停机  8-检修停机  9-场内受累检修  10-电网受累  11-环境受累  12-风机离线
-     */
-    @Async
-    @Transactional
-    public void fiveLossCal() {
-        log.info("======风机绩效榜计算开始.............");
-        Map<String, Windturbine> wtmap = InitialRunner.wtMap;
-        Map<String, Map<Double, Double>> zsglmap = InitialRunner.zsllglMap;
-
-        List<Powerfittinganalysis> analyses = analysisService.selectListByIsCal(Constants.DATA_PREPARE, 0);
-        if (analyses.size() == 0){
-            log.info("======风机榜效帮计算结束,Powerfittinganalysis数据为空.............");
-            return;
-        }
-
-        for (Powerfittinganalysis p : analyses) {
-            List<Powerlossinfo> result = new ArrayList<>();
-            Windturbine wt = wtmap.get(p.getWindturbine());
-            List<String> content = FileUtil.readFile(p.getPath(), true);
-            if (content.size() == 0){
-                log.info("======风机榜效帮计算结束,文件内容为空.............");
-                continue;
-            }
-
-            log.info("======风机绩效榜计算:" + p.getWindturbine());
-            content.remove(0); //去掉标题栏
-            int count = 86400 / p.getInterp(); //一天86400s  一天的条数
-            List<List<String>> coll = CollectUtil.groupListByQty(content, count);
-            coll.forEach(ls -> {
-                double rfdl = 0; //日发电量
-                double gzssdl = 0;//故障损失电量
-                double jhjxssdl = 0;//计划检修损失电量
-                double fjhjxssdl = 0;//非计划检修电量
-                double xdssdl = 0;//限电损失电量
-                double slssdl = 0;//受累损失电量
-                double xnssdl = 0;//性能损失电量
-
-                List<PowerPointData> pdl = ls.stream().map(mp -> new PowerPointData(mp.split(","), false)).collect(Collectors.toList());
-                double zcfd = generalLoss(pdl, zsglmap.get(p.getWindturbine()), p.getInterp(), 2); //正常发电
-                xdssdl = generalLoss(pdl, zsglmap.get(p.getWindturbine()), p.getInterp(), 5);  //限电损失电量
-                double qxjcl = generalLoss(pdl, zsglmap.get(p.getWindturbine()), p.getInterp(), 3); //缺陷降出力损失电量
-                double xdjcl = generalLoss(pdl, zsglmap.get(p.getWindturbine()), p.getInterp(), 4); //限电降出力损失电量
-                double cnsltj = generalLoss(pdl, zsglmap.get(p.getWindturbine()), p.getInterp(), 7); //场内受累停机损失电量
-                double cnsljx = generalLoss(pdl, zsglmap.get(p.getWindturbine()), p.getInterp(), 9); //场内受累检修损失电量
-                double dwsl = generalLoss(pdl, zsglmap.get(p.getWindturbine()), p.getInterp(), 10); //电网受累损失电量
-                double hjsl = generalLoss(pdl, zsglmap.get(p.getWindturbine()), p.getInterp(), 11); //环境受累损失电量
-
-                gzssdl = generalLoss(pdl, zsglmap.get(p.getWindturbine()), p.getInterp(), 6);
-                jhjxssdl = generalLoss(pdl, zsglmap.get(p.getWindturbine()), p.getInterp(), 8);
-                fjhjxssdl = gzssdl;
-                xdssdl = xdssdl + xdjcl;
-                slssdl = cnsltj + dwsl + hjsl + cnsljx + cnsljx;
-                xnssdl = qxjcl + zcfd;
-                rfdl = pdl.get(pdl.size() - 1).getDl();
-                double llgdl = rfdl + gzssdl + jhjxssdl + fjhjxssdl + xdssdl + slssdl + xnssdl;
-
-                Powerlossinfo loss = new Powerlossinfo();
-                loss.setLineid(wt.getLineid());
-                loss.setProjectid(wt.getProjectid());
-                loss.setRecorddate(DateUtil.parseStrtoDate(pdl.get(0).getTime(), DateUtil.DATE_PATTERN));
-                loss.setStationid(wt.getWindpowerstationid());
-                loss.setWindturbineid(wt.getId());
-                loss.setGenecapacity(rfdl);
-                loss.setTherogenecapacity(llgdl);
-                loss.setDayjhjxssdl(jhjxssdl);
-                loss.setDayfjhjxssdl(fjhjxssdl);
-                loss.setDaygzssdl(gzssdl);
-                loss.setDayxdssdl(xdssdl);
-                loss.setDayxnssdl(xnssdl);
-                loss.setDayslssdl(slssdl);
-                loss.setSpeed(pdl.stream().mapToDouble(PowerPointData::getSpeed).average().getAsDouble());
-                result.add(loss);
-            });
-
-            //保存之前删除已有的五损数据
-            lossInfoService.deleteBatch(wt.getId(), result.stream().map(m -> m.getRecorddate()).collect(Collectors.toList()));
-            lossInfoService.insertBatch(result);
-        }
-        //更新已经计算过的文件数据
-        analyses.forEach((entity) -> entity.setIscal(1));
-        analysisService.updateBatchById(analyses);
-        log.info("======风机榜效帮计算结束.............");
-    }
-
 
     /**
      * 损失电量计算  eg: 1.5MW   一小时发电:1500kWh    一分钟发电:1500/60 == 25kW
@@ -239,116 +83,6 @@ public class FiveLossService {
 
 
     /**
-     * 通过线上实时计算五损数据
-     * @param st   开始时间
-     * @param et   结束时间
-     * @param interval  等间隔时间
-     */
-    @Async
-    @Transactional
-    public void fiveLossCalByLine(long st, long et, int interval){
-        List<Windpowerstation> wpList = InitialRunner.wpList;
-        Map<String, Windturbine> wtmap = InitialRunner.wtMap;
-        Map<String, List<Windturbinetestingpointai2>> pointMap = InitialRunner.pointMap;
-        Map<String, List<Modelpowerdetails>> modelmap = InitialRunner.modelPowerDetailMap;
-
-        List<Powerlossinfo> result = new ArrayList<>();
-        pointMap.forEach((k, v) -> {
-            Windturbine wt = wtmap.get(k);
-            String speed = v.stream().filter(f -> f.getUniformcode().equals(Constants.CODE_POINT_SPEED)).findFirst().get().getId();
-            String power = v.stream().filter(f -> f.getUniformcode().equals(Constants.CODE_POINT_POWER)).findFirst().get().getId();
-            String fdl = v.stream().filter(f -> f.getUniformcode().equals(Constants.CODE_POINT_RFDL)).findFirst().get().getId();
-            String status = v.stream().filter(f -> f.getUniformcode().equals(Constants.CODE_POINT_MXZT)).findFirst().get().getId();
-
-            List<TsDoubleData> speedLS = remoteService.adapter().getHistorySnap(speed, st, et, interval);
-            List<TsDoubleData> powerLS = remoteService.adapter().getHistorySnap(power, st, et, interval);
-            JSONObject rfdlObj = remoteService.adapter().getHistorySection(fdl, et);
-            List<TsDoubleData> statusLS = remoteService.adapter().getHistorySnap(status, st, et, interval);
-
-            double rfdl = 0; //日发电量
-            double gzssdl = 0;//故障损失电量
-            double jhjxssdl = 0;//计划检修损失电量
-            double fjhjxssdl = 0;//非计划检修电量
-            double xdssdl = 0;//限电损失电量
-            double slssdl = 0;//受累损失电量
-            double xnssdl = 0;//性能损失电量
-
-            double zcfd = generalLossLine(statusLS, speedLS, powerLS, modelmap.get(wt.getModelid()), interval, 2); //正常发电
-            xdssdl = generalLossLine(statusLS, speedLS, powerLS, modelmap.get(wt.getModelid()), interval, 5);  //限电损失电量
-            double qxjcl = generalLossLine(statusLS, speedLS, powerLS, modelmap.get(wt.getModelid()),interval, 3); //缺陷降出力损失电量
-            double xdjcl = generalLossLine(statusLS, speedLS, powerLS, modelmap.get(wt.getModelid()), interval, 4); //限电降出力损失电量
-            double cnsltj = generalLossLine(statusLS, speedLS, powerLS,  modelmap.get(wt.getModelid()), interval, 7); //场内受累停机损失电量
-            double cnsljx = generalLossLine(statusLS, speedLS, powerLS,  modelmap.get(wt.getModelid()), interval, 9); //场内受累检修损失电量
-            double dwsl = generalLossLine(statusLS, speedLS, powerLS, modelmap.get(wt.getModelid()), interval, 10); //电网受累损失电量
-            double hjsl = generalLossLine(statusLS, speedLS, powerLS, modelmap.get(wt.getModelid()), interval, 11); //环境受累损失电量
-
-            gzssdl = generalLossLine(statusLS, speedLS, powerLS, modelmap.get(wt.getModelid()), interval, 6);
-            jhjxssdl = generalLossLine(statusLS, speedLS, powerLS, modelmap.get(wt.getModelid()), interval, 8);
-            fjhjxssdl = gzssdl;
-            xdssdl = xdssdl + xdjcl;
-            slssdl = cnsltj + dwsl + hjsl + cnsljx + cnsljx;
-            xnssdl = qxjcl + zcfd;
-            rfdl = rfdlObj.getJSONObject(fdl).getDoubleValue("doubleValue");
-
-            double llgdl = rfdl + gzssdl + jhjxssdl + fjhjxssdl + xdssdl + slssdl + xnssdl;
-
-            Powerlossinfo loss = new Powerlossinfo();
-            loss.setLineid(wt.getLineid());
-            loss.setProjectid(wt.getProjectid());
-            loss.setRecorddate(DateUtil.parseStrtoDate(DateUtil.format(st, DateUtil.DATE_PATTERN), DateUtil.DATE_PATTERN));
-            loss.setStationid(wt.getWindpowerstationid());
-            loss.setWindturbineid(wt.getId());
-            loss.setGenecapacity(rfdl);
-            loss.setTherogenecapacity(llgdl);
-            loss.setDayjhjxssdl(jhjxssdl);
-            loss.setDayfjhjxssdl(fjhjxssdl);
-            loss.setDaygzssdl(gzssdl);
-            loss.setDayxdssdl(xdssdl);
-            loss.setDayxnssdl(xnssdl);
-            loss.setDayslssdl(slssdl);
-            loss.setSpeed(speedLS.stream().mapToDouble(TsDoubleData::getDoubleValue).average().getAsDouble());
-            result.add(loss);
-
-            //保存之前删除已有的五损数据
-            lossInfoService.deleteByWtIdAndDate(wt.getId(), loss.getRecorddate());
-        });
-
-        lossInfoService.insertBatch(result);
-    }
-
-    private double generalLossLine(List<TsDoubleData> ztmxData, List<TsDoubleData> speedData, List<TsDoubleData> powerData, List<Modelpowerdetails> zsglData, int interval, double status) {
-        double ssdl = 0.0;
-        List<Modelpowerdetails> theoryData = zsglData.stream().filter(f -> f.getTheorypower() > 0).collect(Collectors.toList());
-        if (ztmxData.size() == powerData.size()){
-            if (status == 2.0 || status == 3.0 || status == 4.0 || status == 9.0 || status == 10.0 || status == 11.0) {
-                for (int i = 0; i < ztmxData.size(); i++) {
-                    for (int j = 0; j < theoryData.size(); j++) {
-                        if (String.format("%.2f", speedData.get(i).getDoubleValue()).equals(String.format("%.2f", theoryData.get(j).getSpeed()))) {
-                            double zsgl = theoryData.get(j).getTheorypower();
-                            double power = powerData.get(i).getDoubleValue();
-                            double temp = (zsgl - power) > 0 ? zsgl - power : 0;
-                            ssdl = ssdl + (temp / 60) * (interval / 60);
-                            break;
-                        }
-                    }
-                }
-            } else {
-                for (int i = 0; i < ztmxData.size(); i++) {
-                    for (int j = 0; j < theoryData.size(); j++) {
-                        if (String.format("%.2f", speedData.get(i).getDoubleValue()).equals(String.format("%.2f", theoryData.get(j).getSpeed()))) {
-                            double zsgl = theoryData.get(j).getTheorypower();
-                            ssdl = ssdl + (zsgl / 60) * (interval / 60);
-                            break;
-                        }
-                    }
-                }
-            }
-        }
-
-        return ssdl > 0 ? ssdl : 0;
-    }
-
-    /**
      * 使用文件,通过自诉案功率计算五损数据
      * @param ids  准备的数据ID
      */

+ 0 - 38
power-fitting-JN/src/main/java/com.gyee.power.fitting/service/impl/LineServiceImpl.java

@@ -1,38 +0,0 @@
-package com.gyee.power.fitting.service.impl;
-
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.gyee.power.fitting.common.base.ExcludeQueryWrapper;
-import com.gyee.power.fitting.mapper.LineMapper;
-import com.gyee.power.fitting.model.Line;
-import com.gyee.power.fitting.service.LineService;
-import org.springframework.stereotype.Service;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * <p>
- *  服务实现类
- * </p>
- *
- * @author chenmh
- * @since 2023-02-03
- */
-@Service
-public class LineServiceImpl extends ServiceImpl<LineMapper, Line> implements LineService {
-
-    @Override
-    public List<Line> selectList() {
-        List<Line> list = new ArrayList();
-
-        ExcludeQueryWrapper wrapper = new ExcludeQueryWrapper();
-
-        try{
-            list = baseMapper.selectList(wrapper);
-        }catch (Exception e){
-            log.error("LineServiceImpl--selectList", e);
-        }
-
-        return list;
-    }
-}

+ 0 - 20
power-fitting-JN/src/main/java/com.gyee.power.fitting/service/impl/PhotovoltaiccapacityServiceImpl.java

@@ -1,20 +0,0 @@
-package com.gyee.power.fitting.service.impl;
-
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.gyee.power.fitting.mapper.PhotovoltaiccapacityMapper;
-import com.gyee.power.fitting.model.Photovoltaiccapacity;
-import com.gyee.power.fitting.service.IPhotovoltaiccapacityService;
-import org.springframework.stereotype.Service;
-
-/**
- * <p>
- *  服务实现类
- * </p>
- *
- * @author gfhd
- * @since 2022-12-13
- */
-@Service
-public class PhotovoltaiccapacityServiceImpl extends ServiceImpl<PhotovoltaiccapacityMapper, Photovoltaiccapacity> implements IPhotovoltaiccapacityService {
-
-}

+ 0 - 20
power-fitting-JN/src/main/java/com.gyee.power.fitting/service/impl/PhotovoltaicivServiceImpl.java

@@ -1,20 +0,0 @@
-package com.gyee.power.fitting.service.impl;
-
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.gyee.power.fitting.mapper.PhotovoltaicivMapper;
-import com.gyee.power.fitting.model.Photovoltaiciv;
-import com.gyee.power.fitting.service.IPhotovoltaicivService;
-import org.springframework.stereotype.Service;
-
-/**
- * <p>
- *  服务实现类
- * </p>
- *
- * @author gfhd
- * @since 2022-12-13
- */
-@Service
-public class PhotovoltaicivServiceImpl extends ServiceImpl<PhotovoltaicivMapper, Photovoltaiciv> implements IPhotovoltaicivService {
-
-}

+ 0 - 99
power-fitting-JN/src/main/java/com.gyee.power.fitting/service/impl/PowerlossinfoServiceImpl.java

@@ -1,99 +0,0 @@
-package com.gyee.power.fitting.service.impl;
-
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.gyee.power.fitting.common.base.ExcludeQueryWrapper;
-import com.gyee.power.fitting.common.util.CollectUtil;
-import com.gyee.power.fitting.common.util.SnowFlakeUtil;
-import com.gyee.power.fitting.mapper.PowerlossinfoMapper;
-import com.gyee.power.fitting.model.Powerlossinfo;
-import com.gyee.power.fitting.service.PowerlossinfoService;
-import org.springframework.stereotype.Service;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Date;
-import java.util.List;
-
-/**
- * <p>
- *  服务实现类
- * </p>
- *
- * @author chenmh
- * @since 2023-02-03
- */
-@Service
-public class PowerlossinfoServiceImpl extends ServiceImpl<PowerlossinfoMapper, Powerlossinfo> implements PowerlossinfoService {
-
-    @Override
-    public void insertItem(Powerlossinfo obj) {
-        if (obj == null)
-            return;
-
-        obj.setId(SnowFlakeUtil.generateId());
-        try{
-            baseMapper.insert(obj);
-        }catch (Exception e){
-            log.error("PowerlossinfoServiceImpl--insertItem", e);
-        }
-    }
-
-    /**
-     * 超过1000条分批保存
-     * @param list
-     */
-    @Override
-    public void insertBatch(List<Powerlossinfo> list) {
-        list.forEach(item -> item.setId(SnowFlakeUtil.generateId()));
-        try{
-            if (list.size() > 1000){
-                List<List<Powerlossinfo>> coll = CollectUtil.groupListByQty(list, 1000);
-                coll.forEach(ls -> saveBatch(ls));
-            } else {
-                saveBatch(list);
-            }
-        }catch (Exception e){
-            log.error("PowerlossinfoServiceImpl--insertBatch", e);
-        }
-    }
-
-    @Override
-    public void deleteBatch(String wtId, List<Date> dates) {
-        QueryWrapper<Powerlossinfo> wrapper = new QueryWrapper<>();
-        wrapper.eq("windturbineid", wtId);
-        wrapper.in("recorddate", dates);
-        try{
-            baseMapper.delete(wrapper);
-        }catch (Exception e){
-            log.error("PowerlossinfoServiceImpl--deleteBatch", e);
-        }
-    }
-
-    @Override
-    public void deleteByWtIdAndDate(String wtId, Date date) {
-        QueryWrapper<Powerlossinfo> wrapper = new QueryWrapper<>();
-        wrapper.eq("windturbineid", wtId);
-        wrapper.eq("recorddate", date);
-        try{
-            baseMapper.delete(wrapper);
-        }catch (Exception e){
-            log.error("PowerlossinfoServiceImpl--deleteByWtIdAndDate", e);
-        }
-    }
-
-    @Override
-    public List<Powerlossinfo> selectList(String station, List<String> project, List<String> line, Date st, Date et) {
-        ExcludeQueryWrapper<Powerlossinfo> wrapper = new ExcludeQueryWrapper<>();
-        wrapper.eq("stationid", station)
-                .in("projectid", project)
-                .in("lineid", line)
-                .ge("recorddate", st)
-                .le("recorddate", et);
-        try{
-            return baseMapper.selectList(wrapper);
-        }catch (Exception e){
-            log.error("FiveLossService--fiveLoss", e);
-        }
-        return Collections.EMPTY_LIST;
-    }
-}

+ 0 - 2
power-fitting-JN/src/main/java/com.gyee.power.fitting/service/impl/PowerwindinfoServiceImpl.java

@@ -6,13 +6,11 @@ import com.gyee.power.fitting.common.base.ExcludeQueryWrapper;
 import com.gyee.power.fitting.common.util.CollectUtil;
 import com.gyee.power.fitting.common.util.SnowFlakeUtil;
 import com.gyee.power.fitting.mapper.PowerwindinfoMapper;
-import com.gyee.power.fitting.model.Powerlossinfo;
 import com.gyee.power.fitting.model.Powerwindinfo;
 import com.gyee.power.fitting.service.PowerwindinfoService;
 import org.springframework.stereotype.Service;
 
 import java.util.Collections;
-import java.util.Date;
 import java.util.List;
 
 /**

+ 0 - 38
power-fitting-JN/src/main/java/com.gyee.power.fitting/service/impl/ProjectServiceImpl.java

@@ -1,38 +0,0 @@
-package com.gyee.power.fitting.service.impl;
-
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.gyee.power.fitting.common.base.ExcludeQueryWrapper;
-import com.gyee.power.fitting.mapper.ProjectMapper;
-import com.gyee.power.fitting.model.Project;
-import com.gyee.power.fitting.service.ProjectService;
-import org.springframework.stereotype.Service;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * <p>
- *  服务实现类
- * </p>
- *
- * @author chenmh
- * @since 2023-02-03
- */
-@Service
-public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> implements ProjectService {
-
-    @Override
-    public List<Project> selectList() {
-        List<Project> list = new ArrayList();
-
-        ExcludeQueryWrapper wrapper = new ExcludeQueryWrapper();
-
-        try{
-            list = baseMapper.selectList(wrapper);
-        }catch (Exception e){
-            log.error("ProjectServiceImpl--selectList", e);
-        }
-
-        return list;
-    }
-}

+ 13 - 13
power-fitting-JN/src/main/resources/application.yaml

@@ -2,15 +2,15 @@ gyee:
   # 实时适配器的url
   adapter-url: http://10.155.32.4:8011
   # 数据准备保存路径(原始数据)
-  file-path-prepare: data\prepare\
+  file-path-prepare: data/prepare/
   # 数据处理保存路径(处理后的数据)
-  file-path-process: data\precess\
+  file-path-process: data/precess/
   # 数据拟合保存路径(拟合后的数据)
-  file-path-fitting: data\fitting\
+  file-path-fitting: data/fitting/
   # 数据压缩下载
-  file-path-download: data\zip\
+  file-path-download: data/zip/
   # 功率曲线离线数据保存路径
-  file-path-power: data\power\
+  file-path-power: data/power/
   # 数据准备时由于数据量太大,初始一个默认间隔,用于适配器取数
   interval: 20
   # 当前是否是离线环境
@@ -38,16 +38,16 @@ spring:
   datasource:
     type: com.alibaba.druid.pool.DruidDataSource
     # 宁夏三区oracle
-#    driver-class-name: oracle.jdbc.OracleDriver
-#    url: jdbc:oracle:thin:@192.168.1.105:1521:gdnxfd
-#    username: nxfdprod
-#    password: gdnxfd123
+    url: jdbc:postgresql://10.81.3.151:5432/wisdom
+    username: gdprod
+    password: gd123
+    driver-class-name: org.postgresql.Driver
 
     # 华为云oracle(功率预测的环境)
-    driver-class-name: oracle.jdbc.OracleDriver
-    url: jdbc:oracle:thin:@120.46.129.85:1521:ORCL
-    username: gyee
-    password: FRWIND
+#    driver-class-name: oracle.jdbc.OracleDriver
+#    url: jdbc:oracle:thin:@120.46.129.85:1521:ORCL
+#    username: gyee
+#    password: FRWIND
 
     druid:
       # 初始化大小,最小,最大

+ 0 - 23
power-fitting-JN/src/main/resources/mapper/LineMapper.xml

@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.gyee.power.fitting.mapper.LineMapper">
-
-    <!-- 通用查询映射结果 -->
-    <resultMap id="BaseResultMap" type="com.gyee.power.fitting.model.Line">
-        <id column="ID" property="id" />
-        <result column="CODE" property="code" />
-        <result column="NAME" property="name" />
-        <result column="ANAME" property="aname" />
-        <result column="PROJECTID" property="projectid" />
-        <result column="ORDERNUM" property="ordernum" />
-        <result column="CAPACITY" property="capacity" />
-        <result column="CAPACITYUNIT" property="capacityunit" />
-        <result column="QUANTITY" property="quantity" />
-    </resultMap>
-
-    <!-- 通用查询结果列 -->
-    <sql id="Base_Column_List">
-        ID, CODE, NAME, ANAME, PROJECTID, ORDERNUM, CAPACITY, CAPACITYUNIT, QUANTITY
-    </sql>
-
-</mapper>

+ 0 - 24
power-fitting-JN/src/main/resources/mapper/PowerlossinfoMapper.xml

@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.gyee.power.fitting.mapper.PowerlossinfoMapper">
-
-    <!-- 通用查询映射结果 -->
-    <resultMap id="BaseResultMap" type="com.gyee.power.fitting.model.Powerlossinfo">
-        <result column="ID" property="id" />
-        <result column="WINDTURBINEID" property="windturbineid" />
-        <result column="PROJECTID" property="projectid" />
-        <result column="LINEID" property="lineid" />
-        <result column="STATIONID" property="stationid" />
-        <result column="RECORDDATE" property="recorddate" />
-        <result column="GENECAPACITY" property="genecapacity" />
-        <result column="THEROGENECAPACITY" property="therogenecapacity" />
-        <result column="SPEED" property="speed" />
-        <result column="DAYSLSSDL" property="dayslssdl" />
-        <result column="DAYJHJXSSDL" property="dayjhjxssdl" />
-        <result column="DAYFJHJXSSDL" property="dayfjhjxssdl" />
-        <result column="DAYXDSSDL" property="dayxdssdl" />
-        <result column="DAYXNSSDL" property="dayxnssdl" />
-        <result column="DAYGZSSDL" property="daygzssdl" />
-    </resultMap>
-
-</mapper>

+ 0 - 28
power-fitting-JN/src/main/resources/mapper/ProjectMapper.xml

@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.gyee.power.fitting.mapper.ProjectMapper">
-
-    <!-- 通用查询映射结果 -->
-    <resultMap id="BaseResultMap" type="com.gyee.power.fitting.model.Project">
-        <id column="ID" property="id" />
-        <result column="CODE" property="code" />
-        <result column="NAME" property="name" />
-        <result column="ANAME" property="aname" />
-        <result column="WINDPOWERSTATIONID" property="windpowerstationid" />
-        <result column="CAPACITY" property="capacity" />
-        <result column="CAPACITYUNIT" property="capacityunit" />
-        <result column="QUANTITY" property="quantity" />
-        <result column="MODEL" property="model" />
-        <result column="COMMISSIONDATE" property="commissiondate" />
-        <result column="MASTERPHONE" property="masterphone" />
-        <result column="SHIFTFOREMAN" property="shiftforeman" />
-        <result column="SHIFTFOREMANPHONE" property="shiftforemanphone" />
-        <result column="ORDERNUM" property="ordernum" />
-    </resultMap>
-
-    <!-- 通用查询结果列 -->
-    <sql id="Base_Column_List">
-        ID, CODE, NAME, ANAME, WINDPOWERSTATIONID, CAPACITY, CAPACITYUNIT, QUANTITY, MODEL, COMMISSIONDATE, MASTERPHONE, SHIFTFOREMAN, SHIFTFOREMANPHONE, ORDERNUM
-    </sql>
-
-</mapper>