|
@@ -13,19 +13,15 @@ import com.gyee.common.vo.monitor.MatrixLineVo;
|
|
|
import com.gyee.common.vo.monitor.MatrixPowerVo;
|
|
|
import com.gyee.common.vo.monitor.MatrixProVo;
|
|
|
import com.gyee.common.vo.monitor.MatrixVo;
|
|
|
-import com.gyee.runeconomy.controller.agc.AgcDeviateTag;
|
|
|
import com.gyee.runeconomy.controller.agc.AiPoints;
|
|
|
-import com.gyee.runeconomy.dto.PowercurveVo;
|
|
|
import com.gyee.runeconomy.init.CacheContext;
|
|
|
import com.gyee.runeconomy.model.auto.*;
|
|
|
import com.gyee.runeconomy.service.TokenService;
|
|
|
-import com.gyee.runeconomy.service.agc.AgcDeviateService;
|
|
|
import com.gyee.runeconomy.service.auto.IProBasicPowerPointService;
|
|
|
import com.gyee.runeconomy.service.auto.IProBasicPowerstationPointService;
|
|
|
import com.gyee.runeconomy.service.auto.impl.ProEconManufacturerServiceImpl;
|
|
|
import com.gyee.runeconomy.util.StringUtils;
|
|
|
import com.gyee.runeconomy.util.realtimesource.IEdosUtil;
|
|
|
-import com.gyee.runeconomy.util.realtimesource.feign.RemoteServiceBuilder;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.web.context.request.RequestContextHolder;
|
|
|
import org.springframework.web.context.request.ServletRequestAttributes;
|
|
@@ -51,18 +47,10 @@ public class MatrixService {
|
|
|
private IProBasicPowerstationPointService proBasicPowerstationPointService;
|
|
|
|
|
|
@Resource
|
|
|
- private IProBasicPowerstationPointService pointService;
|
|
|
-
|
|
|
- @Resource
|
|
|
private ProEconManufacturerServiceImpl proEconManufacturerService;
|
|
|
|
|
|
- @Resource
|
|
|
- private RemoteServiceBuilder remoteService;
|
|
|
-
|
|
|
public Map<String, Object> matrixMX(String company, String type) throws Exception {
|
|
|
|
|
|
-
|
|
|
-
|
|
|
List<ProBasicPowerstation> wpls = CacheContext.wpls;
|
|
|
|
|
|
Map<String, Double> modelpower = CacheContext.modelpower;
|
|
@@ -81,8 +69,6 @@ public class MatrixService {
|
|
|
Map<String, List<ProBasicEquipment>> wpwtmap = CacheContext.wpwtmap;
|
|
|
Map<String, Map<String, ProBasicPowerstationPoint>> subwppointmap = CacheContext.subwppointmap;
|
|
|
|
|
|
-
|
|
|
-
|
|
|
List<ProBasicSubStation> subwpls = CacheContext.subwpls;
|
|
|
|
|
|
List<MatrixPowerVo> powerVos = new ArrayList<>();
|
|
@@ -111,6 +97,10 @@ public class MatrixService {
|
|
|
List<String> wpPoints = new ArrayList<>();
|
|
|
List<String> wpglPoints = new ArrayList<>();
|
|
|
List<String> wtPoints = new ArrayList<>();
|
|
|
+ List<String> fjztPoints = new ArrayList<>();
|
|
|
+ List<String> zktjPoints = new ArrayList<>();
|
|
|
+ List<String> xglyxPoints = new ArrayList<>();
|
|
|
+ List<String> jlgzPoints = new ArrayList<>();
|
|
|
List<String> wtmxPoints = new ArrayList<>();
|
|
|
List<String> wtPoints1 = new ArrayList<>();
|
|
|
Map<String, ProBasicPowerstationPoint> pointMap = wppointmap.get(wp.getId());
|
|
@@ -140,6 +130,13 @@ public class MatrixService {
|
|
|
wtmxPoints.add(equipmentPointMap.get(ContantXk.MXZT).getNemCode());
|
|
|
wtPoints.add(equipmentPointMap.get(ContantXk.SSQFZT).getNemCode());
|
|
|
wtPoints.add(equipmentPointMap.get(ContantXk.RQFDL).getNemCode());
|
|
|
+
|
|
|
+ if (wt.getProjectId().equals("NX_FGS_HAF02_EG")) {
|
|
|
+ fjztPoints.add(equipmentPointMap.get(ContantXk.FJZT).getNemCode());
|
|
|
+ jlgzPoints.add(equipmentPointMap.get(ContantXk.JLGZ).getNemCode());
|
|
|
+ xglyxPoints.add(equipmentPointMap.get(ContantXk.XGLYX).getNemCode());
|
|
|
+ zktjPoints.add(equipmentPointMap.get(ContantXk.ZGTJ).getNemCode());
|
|
|
+ }
|
|
|
});
|
|
|
equipments.stream().forEach(wt -> {
|
|
|
Map<String, ProBasicEquipmentPoint> equipmentPointMap = wtpAimap.get(wt.getId());
|
|
@@ -156,10 +153,7 @@ public class MatrixService {
|
|
|
try {
|
|
|
|
|
|
List<PointData> wtRealdatas = edosUtil.getRealData(wtPoints);
|
|
|
- List<PointData> wtmxRealdatas = edosUtil.getRealData(wtmxPoints);
|
|
|
List<PointData> wtRealdatas1 = edosUtil.getRealData(wtPoints1);
|
|
|
- List<PointData> wpRealdatagl = edosUtil.getRealData(wpglPoints);
|
|
|
-
|
|
|
List<PointData> wpsfgl = null;
|
|
|
List<PointData> wpzllgl = null;
|
|
|
List<AiPoints> laps = getAiPoints(wp.getId());
|
|
@@ -199,30 +193,30 @@ public class MatrixService {
|
|
|
Double jxts = 0.0;
|
|
|
Double xdts = 0.0;
|
|
|
Double lxts = 0.0;
|
|
|
- for (PointData zt : wtmxRealdatas){
|
|
|
- if (zt.getPointValueInDouble() == 2.0){
|
|
|
- bwts++;
|
|
|
- } else if (zt.getPointValueInDouble() == 0.0){
|
|
|
- djts++;
|
|
|
- } else if (zt.getPointValueInDouble() == 4.0){
|
|
|
- gzts++;
|
|
|
- } else if (zt.getPointValueInDouble() == 6.0){
|
|
|
- jxts++;
|
|
|
- } else if (zt.getPointValueInDouble() == 8.0){
|
|
|
- xdts++;
|
|
|
- } else if (zt.getPointValueInDouble() == 12.0){
|
|
|
- lxts++;
|
|
|
- } else if (zt.getPointValueInDouble() == 1.0){
|
|
|
- tjts++;
|
|
|
- }
|
|
|
- }
|
|
|
- powerVo.setBwts(bwts);
|
|
|
- powerVo.setDjts(djts);
|
|
|
- powerVo.setGzts(gzts);
|
|
|
- powerVo.setJxts(jxts);
|
|
|
- powerVo.setXdts(xdts);
|
|
|
- powerVo.setSlts(tjts);
|
|
|
- powerVo.setLxts(lxts);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
if (wpzllgl.size()>0) {
|
|
|
powerVo.setLlgl(StringUtils.round(wpzllgl.get(0).getPointValueInDouble(),2));
|
|
|
} else {
|
|
@@ -244,7 +238,6 @@ public class MatrixService {
|
|
|
|
|
|
AtomicReference<Double> cxgl = new AtomicReference<>((double) 0);
|
|
|
AtomicReference<Double> agc = new AtomicReference<>((double) 0);
|
|
|
- AtomicReference<Double> ycgl = new AtomicReference<>((double) 0);
|
|
|
List<ProBasicSubStation> subStations = subwpls.stream().filter(sub -> sub.getWindpowerstationId().equals(wp.getId())).collect(Collectors.toList());
|
|
|
subStations.stream().forEach(sub -> {
|
|
|
Map<String, ProBasicPowerstationPoint> powerstationPointMap = subwppointmap.get(sub.getId());
|
|
@@ -290,24 +283,6 @@ public class MatrixService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- ProBasicPowerstationPoint ycglcd = null;
|
|
|
-
|
|
|
- double sum = 0.0;
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
powerVo.setCxgl(cxgl.get());
|
|
|
powerVo.setAgc(agc.get());
|
|
|
|
|
@@ -348,8 +323,72 @@ public class MatrixService {
|
|
|
vo.setSsqfzt(DoubleUtils.keepPrecision(wtRealdatas.get(j * index + 1).getPointValueInDouble(), 2));
|
|
|
vo.setQfdl(DoubleUtils.keepPrecision(wtRealdatas.get(j * index + 2).getPointValueInDouble(), 2));
|
|
|
vo.setRate(DoubleUtils.keepPrecision(modelpower.containsKey(equipments.get(j).getId()) ? vo.getPower() / modelpower.get(equipments.get(j).getId()) * 100 : 0, 2));
|
|
|
+ vo.setProject(equipments.get(j).getProjectId());
|
|
|
volist.add(vo);
|
|
|
}
|
|
|
+ for (MatrixVo ztvo: volist){
|
|
|
+ if (ztvo.getProject().equals("NX_FGS_HAF02_EG")){
|
|
|
+ List<String> fjztstream = fjztPoints.stream().filter(c -> c.contains(ztvo.getWtname())).collect(Collectors.toList());
|
|
|
+ List<PointData> ztls = edosUtil.getRealData(fjztstream);
|
|
|
+ List<String> zktjstream = zktjPoints.stream().filter(c -> c.contains(ztvo.getWtname())).collect(Collectors.toList());
|
|
|
+ List<PointData> zktjls = edosUtil.getRealData(zktjstream);
|
|
|
+ List<String> jlgzstream = jlgzPoints.stream().filter(c -> c.contains(ztvo.getWtname())).collect(Collectors.toList());
|
|
|
+ List<PointData> jlls = edosUtil.getRealData(jlgzstream);
|
|
|
+ List<String> xglyxstream = xglyxPoints.stream().filter(c -> c.contains(ztvo.getWtname())).collect(Collectors.toList());
|
|
|
+ List<PointData> xglls = edosUtil.getRealData(xglyxstream);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ if (xglls.get(0).getPointValue().equals("true")){
|
|
|
+ ztvo.setStatus(8.0);
|
|
|
+ } else if (jlls.get(0).getPointValue().equals("true")) {
|
|
|
+ ztvo.setStatus(3.0);
|
|
|
+ } else if (zktjls.get(0).getPointValue().equals("true")) {
|
|
|
+ ztvo.setStatus(1.0);
|
|
|
+ } else if (ztls.get(0).getPointValueInDouble() == 0.0) {
|
|
|
+ ztvo.setStatus(12.0);
|
|
|
+ } else if (ztls.get(0).getPointValueInDouble() == 1.0) {
|
|
|
+ ztvo.setStatus(4.0);
|
|
|
+ } else if (ztls.get(0).getPointValueInDouble() == 2.0) {
|
|
|
+ ztvo.setStatus(6.0);
|
|
|
+ } else if (ztls.get(0).getPointValueInDouble() == 3.0) {
|
|
|
+ ztvo.setStatus(0.0);
|
|
|
+ } else if (ztls.get(0).getPointValueInDouble() == 4.0) {
|
|
|
+ ztvo.setStatus(5.0);
|
|
|
+ } else if (ztls.get(0).getPointValueInDouble() == 5.0) {
|
|
|
+ ztvo.setStatus(2.0);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ for (MatrixVo zt : volist){
|
|
|
+ if (zt.getStatus() == 2.0){
|
|
|
+ bwts++;
|
|
|
+ } else if (zt.getStatus() == 0.0){
|
|
|
+ djts++;
|
|
|
+ } else if (zt.getStatus() == 4.0){
|
|
|
+ gzts++;
|
|
|
+ } else if (zt.getStatus() == 6.0){
|
|
|
+ jxts++;
|
|
|
+ } else if (zt.getStatus() == 8.0){
|
|
|
+ xdts++;
|
|
|
+ } else if (zt.getStatus() == 12.0){
|
|
|
+ lxts++;
|
|
|
+ } else if (zt.getStatus() == 1.0){
|
|
|
+ tjts++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ powerVo.setBwts(bwts);
|
|
|
+ powerVo.setDjts(djts);
|
|
|
+ powerVo.setGzts(gzts);
|
|
|
+ powerVo.setJxts(jxts);
|
|
|
+ powerVo.setXdts(xdts);
|
|
|
+ powerVo.setSlts(tjts);
|
|
|
+ powerVo.setLxts(lxts);
|
|
|
powerVo.setWtlist(volist);
|
|
|
qf0.updateAndGet(v -> new Double((double) (v + volist.stream().filter(i -> i.getSsqfzt() == 0).mapToDouble(MatrixVo::getQfdl).sum())));
|
|
|
qf1.updateAndGet(v -> new Double((double) (v + volist.stream().filter(i -> i.getSsqfzt() == 1).mapToDouble(MatrixVo::getQfdl).sum())));
|