hlf 2 роки тому
батько
коміт
d277411f9e
41 змінених файлів з 1034 додано та 27 видалено
  1. 3 1
      build.gradle.kts
  2. 57 0
      src/main/java/com/gyee/table/alarm/JpaElectricalTestingPointAIDao.java
  3. 52 0
      src/main/java/com/gyee/table/alarm/JpaElectricalTestingPointDIDao.java
  4. 16 0
      src/main/java/com/gyee/table/alarm/repository/ElectricalTestingPointAIRepository.java
  5. 12 0
      src/main/java/com/gyee/table/alarm/repository/ElectricalTestingPointDIRepository.java
  6. 10 10
      src/main/java/com/gyee/table/controller/EchartController.java
  7. 54 0
      src/main/java/com/gyee/table/controller/ElectricalTestingPointController.java
  8. 24 11
      src/main/java/com/gyee/table/controller/TableHeaderController.java
  9. 88 0
      src/main/java/com/gyee/table/controller/TerminalController.java
  10. 28 0
      src/main/java/com/gyee/table/entity/ElectricalTestingPointAI.java
  11. 65 0
      src/main/java/com/gyee/table/entity/ElectricalTestingPointAIEntity.java
  12. 28 0
      src/main/java/com/gyee/table/entity/ElectricalTestingPointDI.java
  13. 65 0
      src/main/java/com/gyee/table/entity/ElectricalTestingPointDIEntity.java
  14. 22 0
      src/main/java/com/gyee/table/entity/Line.java
  15. 28 0
      src/main/java/com/gyee/table/entity/Project.java
  16. 33 0
      src/main/java/com/gyee/table/entity/Windpowerstation.java
  17. 28 0
      src/main/java/com/gyee/table/entity/Windturbine.java
  18. 16 0
      src/main/java/com/gyee/table/mapper/LineMapper.java
  19. 16 0
      src/main/java/com/gyee/table/mapper/ProjectMapper.java
  20. 14 0
      src/main/java/com/gyee/table/mapper/WindpowerstationMapper.java
  21. 16 0
      src/main/java/com/gyee/table/mapper/WindturbineMapper.java
  22. 11 0
      src/main/java/com/gyee/table/service/ElectricalTestingPointAIDao.java
  23. 9 0
      src/main/java/com/gyee/table/service/ElectricalTestingPointDIDao.java
  24. 50 0
      src/main/java/com/gyee/table/service/ElectricalTestingPointService.java
  25. 16 0
      src/main/java/com/gyee/table/service/ILineService.java
  26. 16 0
      src/main/java/com/gyee/table/service/IProjectService.java
  27. 14 0
      src/main/java/com/gyee/table/service/IWindpowerstationService.java
  28. 16 0
      src/main/java/com/gyee/table/service/IWindturbineService.java
  29. 27 0
      src/main/java/com/gyee/table/service/impl/LineServiceImpl.java
  30. 27 0
      src/main/java/com/gyee/table/service/impl/ProjectServiceImpl.java
  31. 18 0
      src/main/java/com/gyee/table/service/impl/WindpowerstationServiceImpl.java
  32. 27 0
      src/main/java/com/gyee/table/service/impl/WindturbineServiceImpl.java
  33. 23 0
      src/main/java/com/gyee/table/utils/DataUtil.java
  34. 46 0
      src/main/java/com/gyee/table/utils/StringUtil.java
  35. 5 0
      src/main/java/com/gyee/table/utils/ToData.java
  36. 16 0
      src/main/java/com/gyee/table/vo/ElectricalDto.java
  37. 9 5
      src/main/resources/application.yml
  38. 8 0
      src/main/resources/mappers/LineMapper.xml
  39. 8 0
      src/main/resources/mappers/ProjectMapper.xml
  40. 5 0
      src/main/resources/mappers/WindpowerstationMapper.xml
  41. 8 0
      src/main/resources/mappers/WindturbineMapper.xml

+ 3 - 1
build.gradle.kts

@@ -28,9 +28,11 @@ dependencies {
 
     implementation("com.baomidou:mybatis-plus-boot-starter:3.5.3.1")
     implementation("com.alibaba:druid-spring-boot-starter:1.2.15")
-    implementation("mysql:mysql-connector-java:8.0.31")
+    //implementation("mysql:mysql-connector-java:8.0.31")
     implementation("com.alibaba:fastjson:2.0.23")
     implementation("org.apache.commons:commons-lang3:3.12.0")
+    implementation("org.postgresql:postgresql:42.4.0")
+    implementation("org.springframework.boot:spring-boot-starter-data-jpa")
 }
 
 tasks.withType<Test> {

+ 57 - 0
src/main/java/com/gyee/table/alarm/JpaElectricalTestingPointAIDao.java

@@ -0,0 +1,57 @@
+package com.gyee.table.alarm;
+
+import com.gyee.table.entity.ElectricalTestingPointAI;
+import com.gyee.table.entity.ElectricalTestingPointAIEntity;
+import com.gyee.table.alarm.repository.ElectricalTestingPointAIRepository;
+import com.gyee.table.service.ElectricalTestingPointAIDao;
+import com.gyee.table.utils.DataUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.jpa.domain.Specification;
+import org.springframework.stereotype.Component;
+
+import javax.persistence.criteria.CriteriaBuilder;
+import javax.persistence.criteria.CriteriaQuery;
+import javax.persistence.criteria.Predicate;
+import javax.persistence.criteria.Root;
+import java.util.ArrayList;
+import java.util.List;
+
+
+@Component
+public class JpaElectricalTestingPointAIDao implements ElectricalTestingPointAIDao {
+
+    @Autowired
+    private ElectricalTestingPointAIRepository ElectricalTestingPointAIRepository;
+
+    @Override
+    public List<ElectricalTestingPointAI> findByUniformcodeNameWindpowerstationid(String uniformcode, String name, String windpowerstationid) {
+
+        return findTest(uniformcode,name,windpowerstationid);
+    }
+
+    public List<ElectricalTestingPointAI> findTest(String uniformcode, String name, String windpowerstationid) {
+        Specification querySpecifi = new Specification<ElectricalTestingPointAIEntity>() {
+            @Override
+            public Predicate toPredicate(Root<ElectricalTestingPointAIEntity> root, CriteriaQuery<?> criteriaQuery, CriteriaBuilder criteriaBuilder) {
+
+                List<Predicate> predicates = new ArrayList<>();
+                if (uniformcode != null && !uniformcode.trim().equals("")) {
+                    predicates.add(criteriaBuilder.like(root.get("uniformCode"), "%" + uniformcode + "%" ));
+                }
+                if (name != null && !name.trim().equals("")) {
+                    predicates.add(criteriaBuilder.like(root.get("name"),"%" + name + "%" ));
+                }
+                if (windpowerstationid != null && !windpowerstationid.trim().equals("")) {
+                    predicates.add(criteriaBuilder.equal(root.get("windPowerStationId"), windpowerstationid));
+                }
+                return criteriaBuilder.and(predicates.toArray(new Predicate[predicates.size()]));
+            }
+        };
+
+        List<ElectricalTestingPointAIEntity> all = ElectricalTestingPointAIRepository.findAll(querySpecifi);
+        return DataUtil.convertDataList(all);
+    }
+
+
+
+}

+ 52 - 0
src/main/java/com/gyee/table/alarm/JpaElectricalTestingPointDIDao.java

@@ -0,0 +1,52 @@
+package com.gyee.table.alarm;
+
+import com.gyee.table.entity.ElectricalTestingPointDI;
+import com.gyee.table.entity.ElectricalTestingPointDIEntity;
+import com.gyee.table.service.ElectricalTestingPointDIDao;
+import com.gyee.table.utils.DataUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.jpa.domain.Specification;
+import org.springframework.stereotype.Component;
+
+import javax.persistence.criteria.CriteriaBuilder;
+import javax.persistence.criteria.CriteriaQuery;
+import javax.persistence.criteria.Predicate;
+import javax.persistence.criteria.Root;
+import java.util.ArrayList;
+import java.util.List;
+
+@Component
+public class JpaElectricalTestingPointDIDao implements ElectricalTestingPointDIDao {
+    @Autowired
+    private com.gyee.table.alarm.repository.ElectricalTestingPointDIRepository ElectricalTestingPointDIRepository;
+
+
+    @Override
+    public List<ElectricalTestingPointDI> findByUniformcodeNameWindpowerstationid(String uniformcode, String name, String windpowerstationid) {
+
+        return findTest(uniformcode,name,windpowerstationid);
+    }
+
+    public List<ElectricalTestingPointDI> findTest(String uniformcode, String name, String windpowerstationid) {
+        Specification querySpecifi = new Specification<ElectricalTestingPointDIEntity>() {
+            @Override
+            public Predicate toPredicate(Root<ElectricalTestingPointDIEntity> root, CriteriaQuery<?> criteriaQuery, CriteriaBuilder criteriaBuilder) {
+
+                List<Predicate> predicates = new ArrayList<>();
+                if (uniformcode != null && !uniformcode.trim().equals("")) {
+                    predicates.add(criteriaBuilder.like(root.get("uniformCode"), "%" + uniformcode + "%" ));
+                }
+                if (name != null && !name.trim().equals("")) {
+                    predicates.add(criteriaBuilder.like(root.get("name"),"%" + name + "%" ));
+                }
+                if (windpowerstationid != null && !windpowerstationid.trim().equals("")) {
+                    predicates.add(criteriaBuilder.equal(root.get("windPowerStationId"), windpowerstationid));
+                }
+                return criteriaBuilder.and(predicates.toArray(new Predicate[predicates.size()]));
+            }
+        };
+
+        List<ElectricalTestingPointDIEntity> all = ElectricalTestingPointDIRepository.findAll(querySpecifi);
+        return DataUtil.convertDataList(all);
+    }
+}

+ 16 - 0
src/main/java/com/gyee/table/alarm/repository/ElectricalTestingPointAIRepository.java

@@ -0,0 +1,16 @@
+package com.gyee.table.alarm.repository;
+
+import com.gyee.table.entity.ElectricalTestingPointAIEntity;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+
+@Repository
+public interface ElectricalTestingPointAIRepository extends JpaRepository<ElectricalTestingPointAIEntity, String>, JpaSpecificationExecutor {
+    List<ElectricalTestingPointAIEntity> findByUniformCodeAndNameAndWindPowerStationId(String uniformcode, String name, String windpowerstationid);
+
+}
+

+ 12 - 0
src/main/java/com/gyee/table/alarm/repository/ElectricalTestingPointDIRepository.java

@@ -0,0 +1,12 @@
+package com.gyee.table.alarm.repository;
+
+
+import com.gyee.table.entity.ElectricalTestingPointDIEntity;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+import org.springframework.stereotype.Repository;
+
+@Repository
+public interface ElectricalTestingPointDIRepository extends JpaRepository<ElectricalTestingPointDIEntity, String>, JpaSpecificationExecutor {
+    ElectricalTestingPointDIEntity findAllById(String id);
+}

+ 10 - 10
src/main/java/com/gyee/table/controller/EchartController.java

@@ -1,20 +1,14 @@
 package com.gyee.table.controller;
 
-import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson2.JSONObject;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.gyee.table.mapper.ObjectAllMapper;
 import com.gyee.table.service.IObjectService;
-import com.gyee.table.utils.ResponseWrapper;
-import com.gyee.table.vo.LineData;
-import com.gyee.table.vo.Point;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
 
-import java.util.ArrayList;
-import java.util.LinkedHashMap;
-import java.util.List;
 import java.util.Map;
 
 /**
@@ -30,6 +24,12 @@ public class EchartController {
     @Autowired
     private IObjectService objectService;
 
+    /**
+     * 根据 SQL 获取 ECHARTS 数据接口
+     *
+     * @param map
+     * @return
+     */
     @PostMapping("/line")
     public JSONObject getLineData(@RequestBody Map map) {
         String sql = (String) map.get("sql");

+ 54 - 0
src/main/java/com/gyee/table/controller/ElectricalTestingPointController.java

@@ -0,0 +1,54 @@
+package com.gyee.table.controller;
+
+
+import com.gyee.table.service.ElectricalTestingPointService;
+import com.gyee.table.utils.StringUtil;
+import com.gyee.table.vo.ElectricalDto;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.ArrayList;
+import java.util.List;
+
+@RestController
+@RequestMapping("/electrical")
+@CrossOrigin
+public class ElectricalTestingPointController {
+    @Autowired
+    protected ElectricalTestingPointService electricalTestingPointService;
+
+    /**
+     * 根据场站ID获取所有测点
+     *
+     * @param windpowerstationid
+     * @param name
+     * @param uniformcode
+     * @param type
+     * @return
+     */
+    @GetMapping("/electricaltestingpoint")
+    public List<ElectricalDto> getElectricalTestingPoint(
+//            @RequestParam(value = "pagenum",required = true) Integer pageNum,
+//            @RequestParam(value = "pagesize",required = true) Integer pageSize,
+            @RequestParam(value = "windpowerstationid", required = true) String windpowerstationid,
+            @RequestParam(value = "name", required = false) String name,
+            @RequestParam(value = "uniformcode", required = false) String uniformcode,
+            @RequestParam(value = "type", required = false) String type
+    ) {
+        List<ElectricalDto> list = new ArrayList<>();
+        if (StringUtil.isBlank(type)) {
+            list = electricalTestingPointService.getElectricalDtoAI(uniformcode, name, windpowerstationid);
+            List<ElectricalDto> list2 = electricalTestingPointService.getElectricalDtoDI(uniformcode, name, windpowerstationid);
+            list.addAll(list2);
+        } else if (type.equals("AI")) {
+            list = electricalTestingPointService.getElectricalDtoAI(uniformcode, name, windpowerstationid);
+        } else if (type.equals("DI")) {
+            list = electricalTestingPointService.getElectricalDtoDI(uniformcode, name, windpowerstationid);
+
+        } else {
+
+        }
+        return list;
+    }
+
+}

+ 24 - 11
src/main/java/com/gyee/table/controller/TableHeaderController.java

@@ -14,13 +14,12 @@ import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
 import javax.script.ScriptException;
-import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
 /**
  * <p>
- *  前端控制器
+ * 前端控制器
  * </p>
  *
  * @author gfhd
@@ -43,35 +42,49 @@ public class TableHeaderController {
     private final static String regex = "#|/\\*|\\*/|--|\\buse\\b|\\binsert\\b|\\bdelete\\b|\\bupdate\\b|\\bcreate\\b|\\bdrop\\b|\\btruncate\\b|\\balter\\b|\\bgrant\\b|\\bexecute\\b|\\bexec\\b|\\bxp_cmdshell\\b|\\bcall\\b|\\bdeclare\\b|\\bsource\\b|\\bsql\\b|\\bchr\\b|\\bmid\\b|\\bmaster\\b|\\bchar\\b|\\bsitename\\b|\\bnet user\\b|;|-|\\+|,|\\btable\\b|\\bgroup_concat\\b|\\bcolumn_name\\b|\\binformation_schema.columns\\b|\\btable_schema\\b|//|/";
 
     @GetMapping("/header/{headername}")
-    private JSONObject header(@PathVariable String headername){
-        if(StringUtils.isBlank(headername)) return Result.error(ResultCode.PARAM_IS_BLANK);
+    private JSONObject header(@PathVariable String headername) {
+        if (StringUtils.isBlank(headername)) return Result.error(ResultCode.PARAM_IS_BLANK);
         //List<TableHeaderColumn> header = tableHeaderService.getHeader(headername);
         List<TableColumnHeader> header = tableColumnHeaderService.getHeader(headername);
         /*Map<String, Object> map = new HashMap<>();
         map.put("name", headername);
         List<TableColumnHeader> header = tableColumnHeaderService.listByMap(map);*/
-        tableColumnHeaderService.saveBatch(header);
+        //tableColumnHeaderService.saveBatch(header);
         //tableHeaderColumnService.saveBatch(header);
-        return Result.successData(ResultCode.SUCCESS,header);
+        return Result.successData(ResultCode.SUCCESS, header);
     }
+
+    /**
+     * 根据 SQL 获取表格内容
+     *
+     * @param map
+     * @return
+     * @throws ScriptException
+     */
     @PostMapping("/data")
     private JSONObject getData(@RequestBody Map map) throws ScriptException {
         return objectService.selectBySql(map);
     }
 
+    /**
+     * 组态表格工具获取表头
+     *
+     * @param tableHeader
+     * @return
+     */
     @PutMapping("/header/update")
-    private JSONObject updateTable(@RequestBody List<TableColumnHeader> tableHeader){
+    private JSONObject updateTable(@RequestBody List<TableColumnHeader> tableHeader) {
         boolean b = tableColumnHeaderService.updateBatchById(tableHeader);
-        if(b){
+        if (b) {
             return Result.success();
-        }else {
+        } else {
             return Result.error();
         }
     }
 
     @GetMapping("/test")
-    private JSONObject test(){
+    private JSONObject test() {
         //List<TableHeaderColumn> list = tableHeaderColumnService.list();
-        return Result.successData(ResultCode.SUCCESS,null);
+        return Result.successData(ResultCode.SUCCESS, null);
     }
 }

+ 88 - 0
src/main/java/com/gyee/table/controller/TerminalController.java

@@ -0,0 +1,88 @@
+package com.gyee.table.controller;
+
+import com.alibaba.fastjson2.JSONObject;
+import com.gyee.table.entity.Line;
+import com.gyee.table.entity.Project;
+import com.gyee.table.entity.Windpowerstation;
+import com.gyee.table.entity.Windturbine;
+import com.gyee.table.result.Result;
+import com.gyee.table.result.ResultCode;
+import com.gyee.table.service.ILineService;
+import com.gyee.table.service.IProjectService;
+import com.gyee.table.service.IWindpowerstationService;
+import com.gyee.table.service.IWindturbineService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+/**
+ * @author hlf
+ * @date 2023/3/16 16:59
+ * 文件说明:
+ */
+@Slf4j
+@RestController
+@RequestMapping("/terminal")
+public class TerminalController {
+
+    @Resource
+    private IWindpowerstationService windpowerstationService;
+
+    @Resource
+    private IProjectService projectService;
+
+    @Resource
+    private ILineService lineService;
+
+    @Resource
+    private IWindturbineService windturbineService;
+
+    /**
+     * 获取所有场站
+     *
+     * @return
+     */
+    @GetMapping("/getYardStationData")
+    public JSONObject getYardStationData() {
+        List<Windpowerstation> list = windpowerstationService.list();
+        return Result.successData(ResultCode.SUCCESS, list);
+    }
+
+    /**
+     * 根据场站ID获取期次
+     *
+     * @return
+     */
+    @GetMapping("/getPeriodBySnData/{windpowerstationid}")
+    public JSONObject getPeriodBySnData(@PathVariable String windpowerstationid) {
+        List<Project> list = projectService.getWindpowerstationid(windpowerstationid);
+        return Result.successData(ResultCode.SUCCESS, list);
+    }
+
+    /**
+     * 根据期次ID获取集电线路
+     *
+     * @return
+     */
+    @GetMapping("/getCollectorWireByPidData/{projectid}")
+    public JSONObject getCollectorWireByPidData(@PathVariable String projectid) {
+        List<Line> list = lineService.getProjectid(projectid);
+        return Result.successData(ResultCode.SUCCESS, list);
+    }
+
+    /**
+     * 根据场站ID获取所有测点
+     *
+     * @return
+     */
+    @GetMapping("/getMeasuringPointBySnData/{windpowerstationid}")
+    public JSONObject getMeasuringPointBySnData(@PathVariable String windpowerstationid) {
+        List<Windturbine> list = windturbineService.getWindpowerstationid(windpowerstationid);
+        return Result.successData(ResultCode.SUCCESS, list);
+    }
+}

+ 28 - 0
src/main/java/com/gyee/table/entity/ElectricalTestingPointAI.java

@@ -0,0 +1,28 @@
+package com.gyee.table.entity;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+@Data
+public class ElectricalTestingPointAI implements Serializable {
+    private static final long serialVersionUID = -7009408032434108640L;
+    private String id;
+    private String code;
+    private String name;
+    private String model;
+    private String valueUnit;
+    private String englishName;
+    private String typeId;
+    private String modelId;
+    private String maxVal;
+    private String minVal;
+    private String reasonablemaxval;
+    private String reasonableminval;
+    private String electricalId;
+    private String uniformCode;
+    private String shortId;
+    private String longId;
+    private String windPowerStationId;
+    private String realtimeId;
+}

+ 65 - 0
src/main/java/com/gyee/table/entity/ElectricalTestingPointAIEntity.java

@@ -0,0 +1,65 @@
+package com.gyee.table.entity;
+
+import com.gyee.table.utils.ToData;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import org.springframework.beans.BeanUtils;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Table;
+import java.io.Serializable;
+
+
+@Data
+@Entity
+@NoArgsConstructor
+@Table(name="electricaltestingpointai")
+public class ElectricalTestingPointAIEntity implements ToData<ElectricalTestingPointAI>, Serializable {
+    @Id
+    @Column(name = "id")
+    private String id;
+    @Column(name = "code")
+    private String code;
+    @Column(name = "name")
+    private String name;
+    @Column(name = "model")
+    private String model;
+    @Column(name = "valueunit")
+    private String valueUnit;
+    @Column(name = "englishname")
+    private String englishName;
+    @Column(name = "typeid")
+    private String typeId;
+    @Column(name = "modelid")
+    private String modelId;
+    @Column(name = "maxval")
+    private String maxVal;
+    @Column(name = "minval")
+    private String minVal;
+    @Column(name = "reasonablemaxval")
+    private String reasonablemaxval;
+    @Column(name = "reasonableminval")
+    private String reasonableminval;
+    @Column(name = "electricalid")
+    private String electricalId;
+    @Column(name = "uniformcode")
+    private String uniformCode;
+    @Column(name = "shortid")
+    private String shortId;
+    @Column(name = "longid")
+    private String longId;
+    @Column(name = "windpowerstationid")
+    private String windPowerStationId;
+    @Column(name = "realtimeid")
+    private String realtimeId;
+
+    @Override
+    public ElectricalTestingPointAI toData() {
+        ElectricalTestingPointAI electricalTestingPointAI = new ElectricalTestingPointAI();
+        BeanUtils.copyProperties(this,electricalTestingPointAI);
+        return electricalTestingPointAI;
+    }
+
+}

+ 28 - 0
src/main/java/com/gyee/table/entity/ElectricalTestingPointDI.java

@@ -0,0 +1,28 @@
+package com.gyee.table.entity;
+
+import lombok.Data;
+
+import java.io.Serializable;
+@Data
+public class ElectricalTestingPointDI implements Serializable {
+    private static final long serialVersionUID = -7009408032434108640L;
+
+    private String id;
+    private String code;
+    private String name;
+    private String model;
+    private String valueUnit;
+    private String englishName;
+    private String typeId;
+    private String modelId;
+    private String maxVal;
+    private String minVal;
+    private String reasonablemaxval;
+    private String reasonableminval;
+    private String electricalId;
+    private String uniformCode;
+    private String shortId;
+    private String longId;
+    private String windPowerStationId;
+    private String realtimeId;
+}

+ 65 - 0
src/main/java/com/gyee/table/entity/ElectricalTestingPointDIEntity.java

@@ -0,0 +1,65 @@
+package com.gyee.table.entity;
+
+import com.gyee.table.utils.ToData;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import org.springframework.beans.BeanUtils;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Table;
+import java.io.Serializable;
+
+
+@Data
+@Entity
+@NoArgsConstructor
+@Table(name = "electricaltestingpointdi")
+public class ElectricalTestingPointDIEntity implements ToData<ElectricalTestingPointDI>, Serializable {
+    @Id
+    @Column(name = "id")
+    private String id;
+    @Column(name = "code")
+    private String code;
+    @Column(name = "name")
+    private String name;
+    @Column(name = "model")
+    private String model;
+    @Column(name = "valueunit")
+    private String valueUnit;
+    @Column(name = "englishname")
+    private String englishName;
+    @Column(name = "typeid")
+    private String typeId;
+    @Column(name = "modelid")
+    private String modelId;
+    @Column(name = "maxval")
+    private String maxVal;
+    @Column(name = "minval")
+    private String minVal;
+    @Column(name = "reasonablemaxval")
+    private String reasonablemaxval;
+    @Column(name = "reasonableminval")
+    private String reasonableminval;
+    @Column(name = "electricalid")
+    private String electricalId;
+    @Column(name = "uniformcode")
+    private String uniformCode;
+    @Column(name = "shortid")
+    private String shortId;
+    @Column(name = "longid")
+    private String longId;
+    @Column(name = "windpowerstationid")
+    private String windPowerStationId;
+    @Column(name = "realtimeid")
+    private String realtimeId;
+
+    @Override
+    public ElectricalTestingPointDI toData() {
+        ElectricalTestingPointDI electricalTestingPointDI = new ElectricalTestingPointDI();
+        BeanUtils.copyProperties(this, electricalTestingPointDI);
+        return electricalTestingPointDI;
+    }
+
+}

+ 22 - 0
src/main/java/com/gyee/table/entity/Line.java

@@ -0,0 +1,22 @@
+package com.gyee.table.entity;
+
+import lombok.Data;
+
+/**
+ * @author hlf
+ * @date 2023/3/16 17:01
+ * 文件说明:
+ */
+@Data
+public class Line {
+
+    private String id;
+    private String code;
+    private String name;
+    private String aname;
+    private String projectid;
+    private Integer ordernum;
+    private Double capacity;
+    private String capacityunit;
+    private Integer quantity;
+}

+ 28 - 0
src/main/java/com/gyee/table/entity/Project.java

@@ -0,0 +1,28 @@
+package com.gyee.table.entity;
+
+import lombok.Data;
+
+/**
+ * @author hlf
+ * @date 2023/3/16 17:03
+ * 文件说明:
+ */
+@Data
+public class Project {
+
+    private String id;
+    private String code;
+    private String name;
+    private String aname;
+    private String windpowerstationid;
+    private Double capacity;
+    private String capacityunit;
+    private Integer quantity;
+    private String model;
+    private String commissiondate;
+    private String masterphone;
+    private String shiftforeman;
+    private String shiftforemanphone;
+    private Integer ordernum;
+
+}

+ 33 - 0
src/main/java/com/gyee/table/entity/Windpowerstation.java

@@ -0,0 +1,33 @@
+package com.gyee.table.entity;
+
+import lombok.Data;
+
+/**
+ * @author hlf
+ * @date 2023/3/16 17:05
+ * 文件说明:
+ */
+@Data
+public class Windpowerstation {
+
+    private String id;
+    private String code;
+    private String name;
+    private String address;
+    private String telephone;
+    private Double capacity;
+    private String capacityunit;
+    private Integer quantity;
+    private String aname;
+    private Double longitude;
+    private Double latitude;
+    private String photo;
+    private String companyid;
+    private String systemmanufact;
+    private String headfarm;
+    private String headfarmphone;
+    private String model;
+    private Integer ordernum;
+    private Double altitude;
+
+}

+ 28 - 0
src/main/java/com/gyee/table/entity/Windturbine.java

@@ -0,0 +1,28 @@
+package com.gyee.table.entity;
+
+import lombok.Data;
+
+/**
+ * @author hlf
+ * @date 2023/3/16 17:07
+ * 文件说明:
+ */
+@Data
+public class Windturbine {
+
+    private String id;
+    private String code;
+    private String windpowerstationid;
+    private Double longitude;
+    private Double latitude;
+    private String modelid;
+    private String status;
+    private String projectid;
+    private String lineid;
+    private String firstintegratedtime;
+    private String photo;
+    private String name;
+    private String standardid;
+    private Integer gycp_id;
+
+}

+ 16 - 0
src/main/java/com/gyee/table/mapper/LineMapper.java

@@ -0,0 +1,16 @@
+package com.gyee.table.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.gyee.table.entity.Line;
+
+import java.util.List;
+
+/**
+ * @author hlf
+ * @date 2023/3/17 9:26
+ * 文件说明:
+ */
+public interface LineMapper extends BaseMapper<Line> {
+
+    List<Line> getProjectid(String projectid);
+}

+ 16 - 0
src/main/java/com/gyee/table/mapper/ProjectMapper.java

@@ -0,0 +1,16 @@
+package com.gyee.table.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.gyee.table.entity.Project;
+
+import java.util.List;
+
+/**
+ * @author hlf
+ * @date 2023/3/17 9:24
+ * 文件说明:
+ */
+public interface ProjectMapper extends BaseMapper<Project> {
+
+    List<Project> getWindpowerstationid(String windpowerstationid);
+}

+ 14 - 0
src/main/java/com/gyee/table/mapper/WindpowerstationMapper.java

@@ -0,0 +1,14 @@
+package com.gyee.table.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.gyee.table.entity.Windpowerstation;
+
+/**
+ * @author hlf
+ * @date 2023/3/17 9:21
+ * 文件说明:
+ */
+public interface WindpowerstationMapper extends BaseMapper<Windpowerstation> {
+
+
+}

+ 16 - 0
src/main/java/com/gyee/table/mapper/WindturbineMapper.java

@@ -0,0 +1,16 @@
+package com.gyee.table.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.gyee.table.entity.Windturbine;
+
+import java.util.List;
+
+/**
+ * @author hlf
+ * @date 2023/3/17 9:13
+ * 文件说明:
+ */
+public interface WindturbineMapper extends BaseMapper<Windturbine> {
+
+    List<Windturbine> getWindpowerstationid(String windpowerstationid);
+}

+ 11 - 0
src/main/java/com/gyee/table/service/ElectricalTestingPointAIDao.java

@@ -0,0 +1,11 @@
+package com.gyee.table.service;
+
+import com.gyee.table.entity.ElectricalTestingPointAI;
+
+import java.util.List;
+
+    public interface ElectricalTestingPointAIDao {
+        List<ElectricalTestingPointAI> findByUniformcodeNameWindpowerstationid(String  uniformcode, String  name, String windpowerstationid);
+
+
+    }

+ 9 - 0
src/main/java/com/gyee/table/service/ElectricalTestingPointDIDao.java

@@ -0,0 +1,9 @@
+package com.gyee.table.service;
+
+import com.gyee.table.entity.ElectricalTestingPointDI;
+
+import java.util.List;
+
+public interface ElectricalTestingPointDIDao {
+    List<ElectricalTestingPointDI> findByUniformcodeNameWindpowerstationid(String  uniformcode, String  name, String windpowerstationid);
+}

+ 50 - 0
src/main/java/com/gyee/table/service/ElectricalTestingPointService.java

@@ -0,0 +1,50 @@
+package com.gyee.table.service;
+
+import com.gyee.table.entity.ElectricalTestingPointAI;
+import com.gyee.table.entity.ElectricalTestingPointDI;
+import com.gyee.table.vo.ElectricalDto;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.List;
+
+@Service
+public class ElectricalTestingPointService {
+
+    @Autowired
+    protected ElectricalTestingPointAIDao electricalTestingPointAIDao;
+
+    @Autowired
+    protected ElectricalTestingPointDIDao electricalTestingPointDIDao;
+
+
+    //uniformcode,name,windpowerstationid
+    public List<ElectricalDto>  getElectricalDtoAI(String uniformcode, String name, String windpowerstationid){
+        List<ElectricalDto> list = new ArrayList<>();
+        List<ElectricalTestingPointAI> electricalTestingPointAIS = electricalTestingPointAIDao.findByUniformcodeNameWindpowerstationid(uniformcode,name,windpowerstationid);
+        for (ElectricalTestingPointAI ElectricalTestingPointAI : electricalTestingPointAIS){
+            ElectricalDto data = new ElectricalDto();
+            data.setId(ElectricalTestingPointAI.getId());
+            data.setName(ElectricalTestingPointAI.getName());
+            data.setUniformcode(ElectricalTestingPointAI.getUniformCode());
+            data.setWindpowerstationid(ElectricalTestingPointAI.getWindPowerStationId());
+            list.add(data);
+        }
+        return list;
+    }
+
+    public List<ElectricalDto> getElectricalDtoDI(String uniformcode,String name,String windpowerstationid) {
+        List<ElectricalDto> list = new ArrayList<>();
+        List<ElectricalTestingPointDI> electricalTestingPointDIS = electricalTestingPointDIDao.findByUniformcodeNameWindpowerstationid(uniformcode, name, windpowerstationid);
+        for (ElectricalTestingPointDI electricalTestingPointDI : electricalTestingPointDIS) {
+            ElectricalDto data = new ElectricalDto();
+            data.setId(electricalTestingPointDI.getId());
+            data.setName(electricalTestingPointDI.getName());
+            data.setUniformcode(electricalTestingPointDI.getUniformCode());
+            data.setWindpowerstationid(electricalTestingPointDI.getWindPowerStationId());
+            list.add(data);
+        }
+        return list;
+    }
+}

+ 16 - 0
src/main/java/com/gyee/table/service/ILineService.java

@@ -0,0 +1,16 @@
+package com.gyee.table.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.gyee.table.entity.Line;
+
+import java.util.List;
+
+/**
+ * @author hlf
+ * @date 2023/3/17 9:25
+ * 文件说明:
+ */
+public interface ILineService extends IService<Line> {
+
+    List<Line> getProjectid(String projectid);
+}

+ 16 - 0
src/main/java/com/gyee/table/service/IProjectService.java

@@ -0,0 +1,16 @@
+package com.gyee.table.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.gyee.table.entity.Project;
+
+import java.util.List;
+
+/**
+ * @author hlf
+ * @date 2023/3/17 9:22
+ * 文件说明:
+ */
+public interface IProjectService extends IService<Project> {
+
+    List<Project> getWindpowerstationid(String windpowerstationid);
+}

+ 14 - 0
src/main/java/com/gyee/table/service/IWindpowerstationService.java

@@ -0,0 +1,14 @@
+package com.gyee.table.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.gyee.table.entity.Windpowerstation;
+
+/**
+ * @author hlf
+ * @date 2023/3/17 9:19
+ * 文件说明:
+ */
+public interface IWindpowerstationService extends IService<Windpowerstation> {
+
+
+}

+ 16 - 0
src/main/java/com/gyee/table/service/IWindturbineService.java

@@ -0,0 +1,16 @@
+package com.gyee.table.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.gyee.table.entity.Windturbine;
+
+import java.util.List;
+
+/**
+ * @author hlf
+ * @date 2023/3/17 9:10
+ * 文件说明:
+ */
+public interface IWindturbineService extends IService<Windturbine> {
+
+    List<Windturbine> getWindpowerstationid(String windpowerstationid);
+}

+ 27 - 0
src/main/java/com/gyee/table/service/impl/LineServiceImpl.java

@@ -0,0 +1,27 @@
+package com.gyee.table.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.gyee.table.entity.Line;
+import com.gyee.table.mapper.LineMapper;
+import com.gyee.table.service.ILineService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * @author hlf
+ * @date 2023/3/17 9:26
+ * 文件说明:
+ */
+@Service
+public class LineServiceImpl extends ServiceImpl<LineMapper, Line> implements ILineService {
+
+    @Autowired(required = false)
+    private LineMapper lineMapper;
+
+    @Override
+    public List<Line> getProjectid(String projectid) {
+        return lineMapper.getProjectid(projectid);
+    }
+}

+ 27 - 0
src/main/java/com/gyee/table/service/impl/ProjectServiceImpl.java

@@ -0,0 +1,27 @@
+package com.gyee.table.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.gyee.table.entity.Project;
+import com.gyee.table.mapper.ProjectMapper;
+import com.gyee.table.service.IProjectService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * @author hlf
+ * @date 2023/3/17 9:23
+ * 文件说明:
+ */
+@Service
+public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> implements IProjectService {
+
+    @Autowired(required = false)
+    private ProjectMapper projectMapper;
+
+    @Override
+    public List<Project> getWindpowerstationid(String windpowerstationid) {
+        return projectMapper.getWindpowerstationid(windpowerstationid);
+    }
+}

+ 18 - 0
src/main/java/com/gyee/table/service/impl/WindpowerstationServiceImpl.java

@@ -0,0 +1,18 @@
+package com.gyee.table.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.gyee.table.entity.Windpowerstation;
+import com.gyee.table.mapper.WindpowerstationMapper;
+import com.gyee.table.service.IWindpowerstationService;
+import org.springframework.stereotype.Service;
+
+/**
+ * @author hlf
+ * @date 2023/3/17 9:20
+ * 文件说明:
+ */
+@Service
+public class WindpowerstationServiceImpl extends ServiceImpl<WindpowerstationMapper, Windpowerstation> implements IWindpowerstationService {
+
+
+}

+ 27 - 0
src/main/java/com/gyee/table/service/impl/WindturbineServiceImpl.java

@@ -0,0 +1,27 @@
+package com.gyee.table.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.gyee.table.entity.Windturbine;
+import com.gyee.table.mapper.WindturbineMapper;
+import com.gyee.table.service.IWindturbineService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * @author hlf
+ * @date 2023/3/17 9:11
+ * 文件说明:
+ */
+@Service
+public class WindturbineServiceImpl extends ServiceImpl<WindturbineMapper, Windturbine> implements IWindturbineService {
+
+    @Autowired(required = false)
+    private WindturbineMapper windturbineMapper;
+
+    @Override
+    public List<Windturbine> getWindpowerstationid(String windpowerstationid) {
+        return windturbineMapper.getWindpowerstationid(windpowerstationid);
+    }
+}

+ 23 - 0
src/main/java/com/gyee/table/utils/DataUtil.java

@@ -0,0 +1,23 @@
+package com.gyee.table.utils;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Optional;
+import java.util.stream.Collectors;
+
+/**
+ * @author songwb<songwb@aliyun.com>
+ */
+public abstract class DataUtil {
+
+    private DataUtil() {
+    }
+
+    public static <T> List<T> convertDataList(Collection<? extends ToData<T>> toDataList) {
+        return toDataList.stream().map(ToData::toData).collect(Collectors.toList());
+    }
+
+    public static <T> T getData(ToData<T> data) {
+        return Optional.ofNullable(data).isPresent() ? data.toData() : null;
+    }
+}

+ 46 - 0
src/main/java/com/gyee/table/utils/StringUtil.java

@@ -0,0 +1,46 @@
+package com.gyee.table.utils;
+
+import org.apache.commons.lang3.StringUtils;
+
+import java.util.UUID;
+
+/**
+ * String辅助类
+ * 
+ */
+public class StringUtil extends StringUtils {
+	
+	/**
+	 * 非空判断
+	 * 
+	 * @param obj
+	 * @return
+	 */
+	public static boolean isNotBlank(Object obj) {
+		return !isBlank(obj);
+	}
+
+	/**
+	 * 为空判断
+	 * 
+	 * @param obj
+	 * @return
+	 */
+	public static boolean isBlank(Object obj) {
+		if (obj == null || StringUtils.isBlank(obj.toString())) {
+			return true;
+		}
+		return false;
+	}
+
+	/**
+	 * 获得一个UUID
+	 * @return String UUID
+	 */
+	public static String getUUID(){
+		String uuid = UUID.randomUUID().toString();
+		//去掉“-”符号
+		return uuid.replaceAll("-", "");
+	}
+
+}

+ 5 - 0
src/main/java/com/gyee/table/utils/ToData.java

@@ -0,0 +1,5 @@
+package com.gyee.table.utils;
+
+public interface ToData<T> {
+    T toData();
+}

+ 16 - 0
src/main/java/com/gyee/table/vo/ElectricalDto.java

@@ -0,0 +1,16 @@
+package com.gyee.table.vo;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+@Data
+public class ElectricalDto implements Serializable {
+
+    //返回值类型(标签点名、场站ID、中文描述、统一编码)
+    private String id;
+    private String name;
+    private String uniformcode;
+    private String windpowerstationid;
+
+}

+ 9 - 5
src/main/resources/application.yml

@@ -10,11 +10,15 @@ spring:
         charset: UTF-8
         enabled: true
   datasource:
-    driver-class-name: com.mysql.cj.jdbc.Driver
-    #url: jdbc:mysql://49.234.50.218:3306/list
-    url: jdbc:mysql://123.60.219.66:3306/configuration_software?default-character-set=utf8
-    #url: jdbc:mysql://192.168.1.69/wisdom_cs?useUnicode=true&characterEncoding=UTF-8
-    username: root
+#    driver-class-name: com.mysql.cj.jdbc.Driver
+#    url: jdbc:mysql://49.234.50.218:3306/list
+#    url: jdbc:mysql://123.60.219.66:3306/configuration_software?default-character-set=utf8
+#    url: jdbc:mysql://192.168.1.69/wisdom_cs?useUnicode=true&characterEncoding=UTF-8
+#    username: root
+#    password: gyeepd@123
+    driver-class-name: org.postgresql.Driver
+    url: jdbc:postgresql://123.60.219.66:5432/configuration_software
+    username: postgres
     password: gyeepd@123
     type: com.alibaba.druid.pool.DruidDataSource
 

+ 8 - 0
src/main/resources/mappers/LineMapper.xml

@@ -0,0 +1,8 @@
+<?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.table.mapper.LineMapper">
+
+    <select id="getProjectid" resultType="com.gyee.table.entity.Line">
+        select * from line where projectid = #{projectid}
+    </select>
+</mapper>

+ 8 - 0
src/main/resources/mappers/ProjectMapper.xml

@@ -0,0 +1,8 @@
+<?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.table.mapper.ProjectMapper">
+
+    <select id="getWindpowerstationid" resultType="com.gyee.table.entity.Project">
+        select * from project where windpowerstationid = #{windpowerstationid}
+    </select>
+</mapper>

+ 5 - 0
src/main/resources/mappers/WindpowerstationMapper.xml

@@ -0,0 +1,5 @@
+<?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.table.mapper.WindpowerstationMapper">
+
+</mapper>

+ 8 - 0
src/main/resources/mappers/WindturbineMapper.xml

@@ -0,0 +1,8 @@
+<?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.table.mapper.WindturbineMapper">
+
+    <select id="getWindpowerstationid" resultType="com.gyee.table.entity.Windturbine">
+        select * from windturbine where windpowerstationid = #{windpowerstationid}
+    </select>
+</mapper>