|
@@ -2,13 +2,17 @@ package com.gyee.frame.controller.powercompare;
|
|
|
|
|
|
import com.gyee.frame.common.conf.AjaxStatus;
|
|
|
import com.gyee.frame.common.domain.AjaxResult;
|
|
|
+import com.gyee.frame.common.spring.Constant;
|
|
|
import com.gyee.frame.common.spring.InitialRunner;
|
|
|
import com.gyee.frame.model.auto.*;
|
|
|
+import com.gyee.frame.model.custom.MatrixVo;
|
|
|
+import com.gyee.frame.model.custom.PointData;
|
|
|
import com.gyee.frame.model.custom.StopTypeTreeVo;
|
|
|
+import com.gyee.frame.service.WindTurbineTestingPointAiService;
|
|
|
import com.gyee.frame.service.Windpowerinfoday3Service;
|
|
|
import com.gyee.frame.service.Windturbineinfoday3Service;
|
|
|
-import com.gyee.frame.util.DateUtils;
|
|
|
-import com.gyee.frame.util.StringUtils;
|
|
|
+import com.gyee.frame.service.photovolatic.PhotovoltaicTestingPointNewService;
|
|
|
+import com.gyee.frame.util.*;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
|
import io.swagger.annotations.ApiImplicitParams;
|
|
@@ -32,7 +36,12 @@ public class PowerCompareController {
|
|
|
private Windpowerinfoday3Service windpowerinfoday3Service;
|
|
|
@Resource
|
|
|
private Windturbineinfoday3Service windturbineinfoday3Service;
|
|
|
+ @Resource
|
|
|
+ private WindTurbineTestingPointAiService windTurbineTestingPointAiService;
|
|
|
+ @Resource
|
|
|
+ private PhotovoltaicTestingPointNewService photovoltaicTestingPointNewService;
|
|
|
|
|
|
+ IRealTimeDataBaseUtil realApiUtil = RealTimeDataBaseFactory.createRealTimeDataBase();
|
|
|
/**
|
|
|
* 报警类型列表
|
|
|
* @return
|
|
@@ -98,6 +107,20 @@ public class PowerCompareController {
|
|
|
for (Windpowerstation station : InitialRunner.wpallls) {
|
|
|
StopTypeTreeVo vo = new StopTypeTreeVo();
|
|
|
vo.setId(station.getId());
|
|
|
+ List<StopTypeTreeVo> pjls = new ArrayList<StopTypeTreeVo>();
|
|
|
+
|
|
|
+ for(Project pj:InitialRunner.pjallls)
|
|
|
+ {
|
|
|
+ if(pj.getWindpowerstationid().equals(station.getId()))
|
|
|
+ {
|
|
|
+ StopTypeTreeVo pjvo = new StopTypeTreeVo();
|
|
|
+ pjvo.setId(pj.getId());
|
|
|
+ pjvo.setName(pj.getName());
|
|
|
+ pjls.add(pjvo);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ vo.setPjls(pjls);
|
|
|
vo.setName(station.getName());
|
|
|
vo.setpId("0");
|
|
|
vos.add(vo);
|
|
@@ -176,6 +199,7 @@ public class PowerCompareController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
/**
|
|
|
* 线路下拉接口
|
|
|
* @return
|
|
@@ -321,6 +345,142 @@ public class PowerCompareController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 通过项目D获取风机下拉接口
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping("/windturbineByPjIdAjax")
|
|
|
+ @ResponseBody
|
|
|
+ @CrossOrigin
|
|
|
+ @ApiOperation(value = "通过风场编号查询风机数据列表", notes = "通过风场编号查询风机数据列表")
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "pjId", value = "项目编号", required = true, dataType = "string", paramType = "query")})
|
|
|
+
|
|
|
+ public AjaxResult windturbineByPjIdAjax(String pjId) throws Exception {
|
|
|
+
|
|
|
+ List<MatrixVo> mvos = new ArrayList<>();
|
|
|
+
|
|
|
+ if (StringUtils.isNotEmpty(pjId)){
|
|
|
+
|
|
|
+
|
|
|
+ if (InitialRunner.pj_wtmap.containsKey(pjId)){
|
|
|
+ List<Windturbine> wtls=InitialRunner.pj_wtmap.get(pjId);
|
|
|
+
|
|
|
+ List<String> fjzbls = new ArrayList<>();
|
|
|
+
|
|
|
+ for (Windturbine wt : wtls) {
|
|
|
+ //风机状态
|
|
|
+ fjzbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wt.getId(), Constant.ZTMX).getCode());
|
|
|
+ //风速
|
|
|
+ fjzbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wt.getId(), Constant.TPOINT_WT_FJSSFS).getCode());
|
|
|
+ //功率
|
|
|
+ fjzbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wt.getId(), Constant.TPOINT_WT_FJGL).getCode());
|
|
|
+
|
|
|
+ fjzbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wt.getId(), Constant.TPOINT_WT_FDJZS).getCode());
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ List<PointData> fjzblist = realApiUtil.getRealData(fjzbls);
|
|
|
+
|
|
|
+ if (!fjzblist.isEmpty() && fjzblist.size() == fjzbls.size()) {
|
|
|
+
|
|
|
+
|
|
|
+ int step = 4;
|
|
|
+
|
|
|
+ for (int i = 0; i < wtls.size(); i++) {
|
|
|
+ Windturbine wt = wtls.get(i);
|
|
|
+
|
|
|
+ MatrixVo vo = new MatrixVo();
|
|
|
+ vo.setWtId(wt.getId());
|
|
|
+ String num = wt.getId().substring(wt.getId().indexOf("_") + 1);
|
|
|
+ vo.setWtnum(num);
|
|
|
+
|
|
|
+ vo.setFjzt(MathUtil.twoBit(fjzblist.get(i * step).getPointValueInDouble()));
|
|
|
+ vo.setFs(MathUtil.twoBit(fjzblist.get(i * step + 1).getPointValueInDouble()));
|
|
|
+ vo.setGl(MathUtil.twoBit(fjzblist.get(i * step + 2).getPointValueInDouble()));
|
|
|
+
|
|
|
+ //风机转数
|
|
|
+ double fdjzs = MathUtil.twoBit(fjzblist.get(i * step + 3).getPointValueInDouble());
|
|
|
+ vo.setFdjzs(fdjzs);
|
|
|
+ vo.setWtCode(wt.getCode());
|
|
|
+ vo.setWpId(wt.getWindpowerstationid());
|
|
|
+ mvos.add(vo);
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else if (InitialRunner.pj_nbqmap.containsKey(pjId))
|
|
|
+ {
|
|
|
+ List<Inverter> wtls=InitialRunner.pj_nbqmap.get(pjId);
|
|
|
+ List<String> fjzbls = new ArrayList<>();
|
|
|
+
|
|
|
+ for (Inverter wt : wtls) {
|
|
|
+ //风机状态
|
|
|
+ fjzbls.add(photovoltaicTestingPointNewService.getPhotovoltaicTestingPointNew(wt.getId(), Constant.ZTMX).getCode());
|
|
|
+ //风速
|
|
|
+ fjzbls.add(photovoltaicTestingPointNewService.getPhotovoltaicTestingPointNew(wt.getId(), Constant.TPOINT_WT_FJSSFS).getCode());
|
|
|
+ //功率
|
|
|
+ fjzbls.add(photovoltaicTestingPointNewService.getPhotovoltaicTestingPointNew(wt.getId(), Constant.TPOINT_WT_FJGL).getCode());
|
|
|
+
|
|
|
+ fjzbls.add(photovoltaicTestingPointNewService.getPhotovoltaicTestingPointNew(wt.getId(), Constant.TPOINT_WT_FDJZS).getCode());
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ List<PointData> fjzblist = realApiUtil.getRealData(fjzbls);
|
|
|
+
|
|
|
+ if (!fjzblist.isEmpty() && fjzblist.size() == fjzbls.size()) {
|
|
|
+
|
|
|
+
|
|
|
+ int step = 4;
|
|
|
+
|
|
|
+ for (int i = 0; i < wtls.size(); i++) {
|
|
|
+ Inverter wt = wtls.get(i);
|
|
|
+
|
|
|
+ MatrixVo vo = new MatrixVo();
|
|
|
+ vo.setWtId(wt.getId());
|
|
|
+ String num = wt.getId().substring(wt.getId().indexOf("_")+1);
|
|
|
+ vo.setWtnum(num);
|
|
|
+
|
|
|
+ vo.setFjzt(MathUtil.twoBit(fjzblist.get(i * step).getPointValueInDouble()));
|
|
|
+ vo.setFs(MathUtil.twoBit(fjzblist.get(i * step + 1).getPointValueInDouble()));
|
|
|
+ vo.setGl(MathUtil.twoBit(fjzblist.get(i * step + 2).getPointValueInDouble()));
|
|
|
+
|
|
|
+ //风机转数
|
|
|
+
|
|
|
+ double fdjzs = MathUtil.twoBit(fjzblist.get(i * step + 3).getPointValueInDouble());
|
|
|
+ Equipmentmodel model = InitialRunner.mlmap.get(wt.getModelid());
|
|
|
+// if (model.getPowerproduction() == 2000) {
|
|
|
+// vo.setFdjzs(fdjzs * 9.55);
|
|
|
+// } else {
|
|
|
+// vo.setFdjzs(fdjzs);
|
|
|
+// }
|
|
|
+ vo.setFdjzs(fdjzs);
|
|
|
+
|
|
|
+ vo.setWtCode(wt.getCode());
|
|
|
+ vo.setWpId(wt.getWindpowerstationid());
|
|
|
+ mvos.add(vo);
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ if(mvos !=null && !mvos.isEmpty())
|
|
|
+ {
|
|
|
+ return AjaxResult.successData(AjaxStatus.success.code,mvos);
|
|
|
+ }else
|
|
|
+ {
|
|
|
+ return AjaxResult.successData(AjaxStatus.success.code,mvos);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 获得所有风电场风机下拉接口
|
|
|
* @return
|