|
@@ -1,16 +1,14 @@
|
|
|
package com.gyee.backconfig.service;
|
|
|
|
|
|
|
|
|
-import com.gyee.backconfig.model.auto.Companys;
|
|
|
-import com.gyee.backconfig.model.auto.Region;
|
|
|
-import com.gyee.backconfig.model.auto.Standardpoint;
|
|
|
-import com.gyee.backconfig.model.auto.Windturbine;
|
|
|
+import com.gyee.backconfig.model.auto.*;
|
|
|
import com.gyee.backconfig.service.auto.*;
|
|
|
import com.gyee.common.model.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
@@ -39,6 +37,13 @@ public class PointGenerateService {
|
|
|
private IWindturbineService windturbineService;//风机
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private IWindpowerstationpointnewService windpowerstationpointnewService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IWindturbinetestingpointnewService windturbinetestingpointnewService;
|
|
|
+
|
|
|
+
|
|
|
public int addGeneratePoint(String regionCode, String companysId, String stationId, String projectId, String lineId, List<Standardpoint> pointList) {
|
|
|
|
|
|
|
|
@@ -114,12 +119,60 @@ public class PointGenerateService {
|
|
|
int addPoint(String regionCode, String companysId, String stationId, String projectId, String lineId, List<Standardpoint> pointList) {
|
|
|
|
|
|
|
|
|
- List<Windturbine> windturbineList = windturbineService.getWindturbineGyLine(lineId);
|
|
|
- for (Standardpoint point : 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();
|
|
|
+
|
|
|
+ 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);
|
|
|
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
-
|
|
|
return 0;
|
|
|
|
|
|
}
|