|
@@ -18,11 +18,12 @@ import java.util.List;
|
|
|
public class PointGenerateService {
|
|
|
|
|
|
|
|
|
+ @Resource
|
|
|
+ private ICompanysService companysService;//公司
|
|
|
+
|
|
|
@Autowired
|
|
|
private IRegionService regionService;//区域
|
|
|
|
|
|
- @Resource
|
|
|
- private ICompanysService companysService;//公司
|
|
|
|
|
|
@Resource
|
|
|
private IProjectService projectService;//期次
|
|
@@ -43,16 +44,11 @@ public class PointGenerateService {
|
|
|
private IWindturbinetestingpointnewService windturbinetestingpointnewService;
|
|
|
|
|
|
|
|
|
-
|
|
|
public int addGeneratePoint(String regioncompanyid, String id, String stationId, String projectId, String lineId, List<Standardpoint> pointList) {
|
|
|
|
|
|
|
|
|
-
|
|
|
int tag = 0;
|
|
|
//区域
|
|
|
-
|
|
|
-
|
|
|
- //ddd
|
|
|
List<Region> regionList = regionService.getReginBycode(regioncompanyid);
|
|
|
|
|
|
//判断公司是否为空
|
|
@@ -123,56 +119,56 @@ public class PointGenerateService {
|
|
|
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);
|
|
|
- for (Windturbine w : windturbineList) {
|
|
|
- for (Standardpoint p : pointList) {
|
|
|
-
|
|
|
- if ("1".equals(p.getType())) {
|
|
|
-
|
|
|
- Windpowerstationpointnew station = new Windpowerstationpointnew();
|
|
|
-
|
|
|
- station.setCode("");
|
|
|
- station.setName(w.getName()+p.getName());
|
|
|
- station.setModel("");
|
|
|
- station.setValueunit("");
|
|
|
- station.setEnglishname("");
|
|
|
- station.setTypeid("");
|
|
|
- station.setModelid(w.getModelid());
|
|
|
- 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);
|
|
|
-
|
|
|
- } else {
|
|
|
- Windturbinetestingpointnew testing = new Windturbinetestingpointnew();
|
|
|
+ List<Windpowerstationpointnew> stationList = new ArrayList<>();
|
|
|
+ List<Windturbinetestingpointnew> testingList = new ArrayList<>();
|
|
|
+
|
|
|
+ List<Windturbine> windturbineList = windturbineService.getWindturbineGyLine("", "", lineId);
|
|
|
+
|
|
|
+ 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);
|
|
|
+
|
|
|
+ } 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.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.setShortid("");
|
|
|
+// testing.setLongid("");
|
|
|
testing.setWindpowerstationid(w.getWindpowerstationid());
|
|
|
- testing.setRealtimeid("");
|
|
|
+// testing.setRealtimeid("");
|
|
|
testingList.add(testing);
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -204,7 +200,120 @@ public class PointGenerateService {
|
|
|
|
|
|
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
|
|
|
+
|
|
|
+ List<Windturbinetestingpointnew> testingList = czd(p, windpowerstationList);
|
|
|
+ for (Windturbinetestingpointnew i: testingList){
|
|
|
+ boolean b = windturbinetestingpointnewService.addOrUpdate(i);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
+ private List<Windpowerstationpointnew> fjd(Standardpoint p, List<Windpowerstation> windpowerstationList) {
|
|
|
+ List<Windpowerstationpointnew> stationList = new ArrayList<>();
|
|
|
+
|
|
|
+ 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);
|
|
|
+
|
|
|
+ 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);
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return stationList;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param p
|
|
|
+ * @param windpowerstationList
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ private List<Windturbinetestingpointnew> czd(Standardpoint p, List<Windpowerstation> windpowerstationList) {
|
|
|
+ Windturbinetestingpointnew testing = null;
|
|
|
+ List<Windturbinetestingpointnew> testingList = new ArrayList<>();
|
|
|
+ for (Windpowerstation staion : windpowerstationList) {
|
|
|
+
|
|
|
+ List<Windturbine> windturbineList = windturbineService.getWindturbineGyLine(staion.getId(), "", "");
|
|
|
+ for (Windturbine w : windturbineList) {
|
|
|
+ List<Windturbinetestingpointnew> list = windturbinetestingpointnewService.list(w.getId(), p.getUniformcode());
|
|
|
+ if (null != list && list.size() > 0) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ testing = new Windturbinetestingpointnew();
|
|
|
+ testing.setCode("fjjs".equals(p.getType()) ? "INITIAL" : "");
|
|
|
+ testing.setName(w.getName() + p.getName());
|
|
|
+ testing.setUniformcode(p.getUniformcode());
|
|
|
+ testing.setWindpowerstationid(w.getWindpowerstationid());
|
|
|
+ testingList.add(testing);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ return testingList;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
}
|