|
@@ -3,7 +3,6 @@ package com.gyee.backconfig.service;
|
|
|
|
|
|
import com.gyee.backconfig.model.auto.*;
|
|
import com.gyee.backconfig.model.auto.*;
|
|
import com.gyee.backconfig.service.auto.*;
|
|
import com.gyee.backconfig.service.auto.*;
|
|
-import com.gyee.common.model.StringUtils;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
@@ -44,190 +43,33 @@ public class PointGenerateService {
|
|
private IWindturbinetestingpointnewService windturbinetestingpointnewService;
|
|
private IWindturbinetestingpointnewService windturbinetestingpointnewService;
|
|
|
|
|
|
|
|
|
|
- public int addGeneratePoint(String regioncompanyid, String id, String stationId, String projectId, String lineId, List<Standardpoint> pointList) {
|
|
|
|
|
|
|
|
|
|
+ public int addGeneratePoint(List<Standardpoint> pointList) {
|
|
|
|
|
|
- int tag = 0;
|
|
|
|
- //区域
|
|
|
|
- List<Region> regionList = regionService.getReginBycode(regioncompanyid);
|
|
|
|
-
|
|
|
|
- //判断公司是否为空
|
|
|
|
- if (null != id && id.length() > 0) {
|
|
|
|
- //不为空
|
|
|
|
- for (Region r : regionList) {
|
|
|
|
- List<Companys> companysList = companysService.getCompanysByidAndRid(r.getCompanyid());
|
|
|
|
-
|
|
|
|
- //判断是否有匹配的的公司
|
|
|
|
- if (null != companysList && companysList.size() > 0) {
|
|
|
|
- for (Companys c : companysList) {
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (StringUtils.isNotNull(regioncompanyid) && StringUtils.isNotNull(id)
|
|
|
|
- && StringUtils.isNotNull(stationId) && StringUtils.isNotNull(projectId) && StringUtils.isNotNull(lineId)) {
|
|
|
|
- tag = 1;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (StringUtils.isNotNull(regioncompanyid) && StringUtils.isNotNull(id)
|
|
|
|
- && StringUtils.isNotNull(stationId) && StringUtils.isNotNull(projectId)) {
|
|
|
|
- tag = 2;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (StringUtils.isNotNull(regioncompanyid) && StringUtils.isNotNull(id) && StringUtils.isNotNull(stationId)) {
|
|
|
|
- tag = 3;
|
|
|
|
- }
|
|
|
|
- if (StringUtils.isNotNull(regioncompanyid) && StringUtils.isNotNull(id)) {
|
|
|
|
- tag = 4;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (StringUtils.isNotNull(regioncompanyid)) {
|
|
|
|
- tag = 5;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- switch (tag) {
|
|
|
|
- case 1:
|
|
|
|
- addPoint(regioncompanyid, id, stationId, projectId, lineId, pointList);
|
|
|
|
- break;
|
|
|
|
- case 2:
|
|
|
|
- addPoint(regioncompanyid, id, stationId, projectId, pointList);
|
|
|
|
- break;
|
|
|
|
- case 3:
|
|
|
|
- addPoint(regioncompanyid, id, stationId, pointList);
|
|
|
|
- break;
|
|
|
|
- case 4:
|
|
|
|
- addPoint(regioncompanyid, id, pointList);
|
|
|
|
- break;
|
|
|
|
-
|
|
|
|
- case 5:
|
|
|
|
- addPoint(regioncompanyid, pointList);
|
|
|
|
- break;
|
|
|
|
- default:
|
|
|
|
- addPoint(pointList);
|
|
|
|
- break;
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- return 0;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- int addPoint(String regioncompanyid, String id, String stationId, String projectId, String lineId, List<Standardpoint> pointList) {
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- List<Windpowerstationpointnew> stationList = new ArrayList<>();
|
|
|
|
- List<Windturbinetestingpointnew> testingList = new ArrayList<>();
|
|
|
|
-
|
|
|
|
- List<Windturbine> windturbineList = windturbineService.getWindturbineGyLine("", "", lineId);
|
|
|
|
-
|
|
|
|
|
|
+ List<Companys> companysList = companysService.getCompanysByidAndRid("");
|
|
for (Standardpoint p : pointList) {
|
|
for (Standardpoint p : pointList) {
|
|
|
|
|
|
- if ("1".equals(p.getType())) {
|
|
|
|
-
|
|
|
|
- Windpowerstationpointnew station = new Windpowerstationpointnew();
|
|
|
|
-
|
|
|
|
- station.setCode("");
|
|
|
|
- station.setName(stationId + p.getName());
|
|
|
|
- station.setModel("");
|
|
|
|
- station.setValueunit("");
|
|
|
|
- station.setEnglishname("");
|
|
|
|
- station.setTypeid("");
|
|
|
|
- station.setModelid("");
|
|
|
|
- station.setMaxval(null);
|
|
|
|
- station.setMinval(null);
|
|
|
|
- station.setReasonablemaxval(null);
|
|
|
|
- station.setReasonableminval(null);
|
|
|
|
- station.setUniformcode(p.getUniformcode());
|
|
|
|
- station.setShortid("");
|
|
|
|
- station.setLongid("");
|
|
|
|
- station.setWindpowerstationid("");
|
|
|
|
- station.setRealtimeid("");
|
|
|
|
- stationList.add(station);
|
|
|
|
|
|
+ if ("czjs".equals(p.getType())) {
|
|
|
|
|
|
- } else {
|
|
|
|
- for (Windturbine w : windturbineList) {
|
|
|
|
-
|
|
|
|
- Windturbinetestingpointnew testing = new Windturbinetestingpointnew();
|
|
|
|
- testing.setCode("2".equals(p.getType()) ? "INITIAL" : "");
|
|
|
|
- testing.setName(w.getName() + p.getName());
|
|
|
|
-// testing.setModel("");
|
|
|
|
-// testing.setValueunit("");
|
|
|
|
-// testing.setEnglishname("");
|
|
|
|
-// testing.setTypeid("");
|
|
|
|
-// testing.setModelid("");
|
|
|
|
-// testing.setMaxval(null);
|
|
|
|
-// testing.setMinval(null);
|
|
|
|
-// testing.setReasonablemaxval(null);
|
|
|
|
-// testing.setReasonableminval(null);
|
|
|
|
- testing.setUniformcode(p.getUniformcode());
|
|
|
|
-// testing.setShortid("");
|
|
|
|
-// testing.setLongid("");
|
|
|
|
- testing.setWindpowerstationid(w.getWindpowerstationid());
|
|
|
|
-// testing.setRealtimeid("");
|
|
|
|
- testingList.add(testing);
|
|
|
|
|
|
+ List<Windpowerstationpointnew> staionList = fjd(p, companysList);
|
|
|
|
+ for (Windpowerstationpointnew i : staionList) {
|
|
|
|
+// boolean b = windpowerstationpointnewService.addOrUpdate(i);
|
|
}
|
|
}
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- return 0;
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- int addPoint(String regioncompanyid, String id, String stationId, String projectId, List<Standardpoint> uniformcodes) {
|
|
|
|
-
|
|
|
|
- return 0;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- int addPoint(String regioncompanyid, String id, String stationId, List<Standardpoint> uniformcodes) {
|
|
|
|
-
|
|
|
|
- return 0;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- int addPoint(String regioncompanyid, String id, List<Standardpoint> uniformcodes) {
|
|
|
|
-
|
|
|
|
- return 0;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- int addPoint(String regioncompanyid, List<Standardpoint> uniformcodes) {
|
|
|
|
-
|
|
|
|
- return 0;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- int addPoint(List<Standardpoint> uniformcodes) {
|
|
|
|
-
|
|
|
|
- List<Companys> companysList = companysService.getCompanysByidAndRid("");
|
|
|
|
- for (Companys c : companysList) {
|
|
|
|
- List<Region> regionList = regionService.getReginBycode(c.getCapacityunit());
|
|
|
|
- for (Region r : regionList) {
|
|
|
|
- List<Windpowerstation> windpowerstationList = windpowerstationService.getList(r.getCompanyid());
|
|
|
|
- for (Standardpoint p : uniformcodes) {
|
|
|
|
|
|
|
|
- if ("czjs".equals(p.getType())) {
|
|
|
|
-
|
|
|
|
- List<Windpowerstationpointnew> staionList= fjd(p, windpowerstationList);
|
|
|
|
- for (Windpowerstationpointnew i : staionList){
|
|
|
|
- boolean b = windpowerstationpointnewService.addOrUpdate(i);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- } else {
|
|
|
|
- //fjjs
|
|
|
|
- //fjjcd
|
|
|
|
|
|
+ } else {
|
|
|
|
+ //fjjs
|
|
|
|
+ //fjjcd
|
|
|
|
|
|
|
|
+ for (Companys c : companysList) {
|
|
|
|
+ List<Region> regionList = regionService.getReginBycode(c.getCapacityunit());
|
|
|
|
+ for (Region r : regionList) {
|
|
|
|
+ List<Windpowerstation> windpowerstationList = windpowerstationService.getList(r.getCompanyid());
|
|
List<Windturbinetestingpointnew> testingList = czd(p, windpowerstationList);
|
|
List<Windturbinetestingpointnew> testingList = czd(p, windpowerstationList);
|
|
- for (Windturbinetestingpointnew i: testingList){
|
|
|
|
- boolean b = windturbinetestingpointnewService.addOrUpdate(i);
|
|
|
|
|
|
+ for (Windturbinetestingpointnew i : testingList) {
|
|
|
|
+// boolean b = windturbinetestingpointnewService.addOrUpdate(i);
|
|
}
|
|
}
|
|
-
|
|
|
|
}
|
|
}
|
|
-
|
|
|
|
}
|
|
}
|
|
-
|
|
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
@@ -236,47 +78,55 @@ public class PointGenerateService {
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
- private List<Windpowerstationpointnew> fjd(Standardpoint p, List<Windpowerstation> windpowerstationList) {
|
|
|
|
|
|
+ private List<Windpowerstationpointnew> fjd(Standardpoint p, List<Companys> companysList) {
|
|
List<Windpowerstationpointnew> stationList = new ArrayList<>();
|
|
List<Windpowerstationpointnew> stationList = new ArrayList<>();
|
|
|
|
|
|
Windpowerstationpointnew stationpoint = null;
|
|
Windpowerstationpointnew stationpoint = null;
|
|
|
|
|
|
- for (Windpowerstation station : windpowerstationList) {
|
|
|
|
- List<Windpowerstationpointnew> list1 = windpowerstationpointnewService.getStationpointByUniformcode(station.getId(), p.getUniformcode());
|
|
|
|
- if (null != list1 && list1.size() > 0) {
|
|
|
|
- continue;
|
|
|
|
- }
|
|
|
|
- stationpoint = new Windpowerstationpointnew();
|
|
|
|
- stationpoint.setCode("");
|
|
|
|
- stationpoint.setName(station.getName() + p.getName());
|
|
|
|
- stationpoint.setUniformcode(p.getUniformcode());
|
|
|
|
- stationList.add(stationpoint);
|
|
|
|
-
|
|
|
|
- List<Project> projectList = projectService.getList(station.getId());
|
|
|
|
- for (Project project : projectList) {
|
|
|
|
- List<Windpowerstationpointnew> list2 = windpowerstationpointnewService.getStationpointByUniformcode(project.getId(), p.getUniformcode());
|
|
|
|
- if (null != list2 && list2.size() > 0) {
|
|
|
|
- continue;
|
|
|
|
- }
|
|
|
|
- stationpoint = new Windpowerstationpointnew();
|
|
|
|
- stationpoint.setCode("");
|
|
|
|
- stationpoint.setName(project.getName() + p.getName());
|
|
|
|
- stationpoint.setUniformcode(p.getUniformcode());
|
|
|
|
- stationList.add(stationpoint);
|
|
|
|
|
|
+ for (Companys c : companysList) {
|
|
|
|
+ List<Region> regionList = regionService.getReginBycode(c.getCapacityunit());
|
|
|
|
+ for (Region r : regionList) {
|
|
|
|
+ List<Windpowerstation> windpowerstationList = windpowerstationService.getList(r.getCompanyid());
|
|
|
|
|
|
- List<Line> lineList = lineService.getList(project.getId());
|
|
|
|
- for (Line l : lineList) {
|
|
|
|
|
|
|
|
- List<Windpowerstationpointnew> list3 = windpowerstationpointnewService.getStationpointByUniformcode(l.getId(), p.getUniformcode());
|
|
|
|
- if (null != list3 && list3.size() > 0) {
|
|
|
|
|
|
+ for (Windpowerstation station : windpowerstationList) {
|
|
|
|
+ List<Windpowerstationpointnew> list1 = windpowerstationpointnewService.getStationpointByUniformcode(station.getId(), p.getUniformcode());
|
|
|
|
+ if (null != list1 && list1.size() > 0) {
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
stationpoint = new Windpowerstationpointnew();
|
|
stationpoint = new Windpowerstationpointnew();
|
|
stationpoint.setCode("");
|
|
stationpoint.setCode("");
|
|
- stationpoint.setName(l.getName() + p.getName());
|
|
|
|
|
|
+ stationpoint.setName(station.getName() + p.getName());
|
|
stationpoint.setUniformcode(p.getUniformcode());
|
|
stationpoint.setUniformcode(p.getUniformcode());
|
|
stationList.add(stationpoint);
|
|
stationList.add(stationpoint);
|
|
|
|
|
|
|
|
+ List<Project> projectList = projectService.getList(station.getId());
|
|
|
|
+ for (Project project : projectList) {
|
|
|
|
+ List<Windpowerstationpointnew> list2 = windpowerstationpointnewService.getStationpointByUniformcode(project.getId(), p.getUniformcode());
|
|
|
|
+ if (null != list2 && list2.size() > 0) {
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ stationpoint = new Windpowerstationpointnew();
|
|
|
|
+ stationpoint.setCode("");
|
|
|
|
+ stationpoint.setName(project.getName() + p.getName());
|
|
|
|
+ stationpoint.setUniformcode(p.getUniformcode());
|
|
|
|
+ stationList.add(stationpoint);
|
|
|
|
+
|
|
|
|
+ List<Line> lineList = lineService.getList(project.getId());
|
|
|
|
+ for (Line l : lineList) {
|
|
|
|
+
|
|
|
|
+ List<Windpowerstationpointnew> list3 = windpowerstationpointnewService.getStationpointByUniformcode(l.getId(), p.getUniformcode());
|
|
|
|
+ if (null != list3 && list3.size() > 0) {
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ stationpoint = new Windpowerstationpointnew();
|
|
|
|
+ stationpoint.setCode("");
|
|
|
|
+ stationpoint.setName(l.getName() + p.getName());
|
|
|
|
+ stationpoint.setUniformcode(p.getUniformcode());
|
|
|
|
+ stationList.add(stationpoint);
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -303,13 +153,13 @@ public class PointGenerateService {
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
testing = new Windturbinetestingpointnew();
|
|
testing = new Windturbinetestingpointnew();
|
|
|
|
+
|
|
testing.setCode("fjjs".equals(p.getType()) ? "INITIAL" : "");
|
|
testing.setCode("fjjs".equals(p.getType()) ? "INITIAL" : "");
|
|
testing.setName(w.getName() + p.getName());
|
|
testing.setName(w.getName() + p.getName());
|
|
testing.setUniformcode(p.getUniformcode());
|
|
testing.setUniformcode(p.getUniformcode());
|
|
testing.setWindpowerstationid(w.getWindpowerstationid());
|
|
testing.setWindpowerstationid(w.getWindpowerstationid());
|
|
testingList.add(testing);
|
|
testingList.add(testing);
|
|
}
|
|
}
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
|
|
return testingList;
|
|
return testingList;
|