Browse Source

Merge remote-tracking branch 'origin/master'

xieshengjie 2 years ago
parent
commit
6bd59c42e8
29 changed files with 2586 additions and 783 deletions
  1. 41 0
      web/monitor-hb/src/main/java/com/gyee/frame/common/spring/Constant.java
  2. 88 51
      web/monitor-hb/src/main/java/com/gyee/frame/controller/monitor/MonitorInverterPushController.java
  3. 66 0
      web/monitor-hb/src/main/java/com/gyee/frame/model/custom/InverterVo.java
  4. 200 0
      web/monitor-hb/src/main/java/com/gyee/frame/model/custom/JunctionboxVo.java
  5. 82 85
      web/monitor-hb/src/main/java/com/gyee/frame/service/photovolatic/PhotovoltaicTestingPointNewService.java
  6. 11 9
      web/monitor-hb/src/main/java/com/gyee/frame/service/websocket/GenreSetPushService.java
  7. 7 5
      web/monitor-hb/src/main/java/com/gyee/frame/service/websocket/GenreSetPushService_bak.java
  8. 14 12
      web/monitor-hb/src/main/java/com/gyee/frame/service/websocket/MatrixDetialGfPushService.java
  9. 7 5
      web/monitor-hb/src/main/java/com/gyee/frame/service/websocket/MatrixDetialPushService.java
  10. 136 42
      web/monitor-hb/src/main/java/com/gyee/frame/service/websocket/MatrixPushService.java
  11. 15 4
      web/monitor-hb/src/main/java/com/gyee/frame/service/websocket/MatrixQfPushService.java
  12. 423 124
      web/monitor-hb/src/main/java/com/gyee/frame/service/websocket/WtInfoPushService.java
  13. 22 7
      web/monitor-web-sxjn/src/main/java/com/gyee/frame/common/spring/Constant.java
  14. 66 0
      web/monitor-web-sxjn/src/main/java/com/gyee/frame/controller/monitor/GenreSetPushController.java
  15. 43 3
      web/monitor-web-sxjn/src/main/java/com/gyee/frame/controller/monitor/MonitorInverterPushController.java
  16. 66 0
      web/monitor-web-sxjn/src/main/java/com/gyee/frame/model/custom/InverterVo.java
  17. 1 1
      web/monitor-web-sxjn/src/main/java/com/gyee/frame/service/WindPowerstationTestingPoint2Service.java
  18. 4 1
      web/monitor-web-sxjn/src/main/java/com/gyee/frame/service/initialpoint/InitialPointGoldenService.java
  19. 4 4
      web/monitor-web-sxjn/src/main/java/com/gyee/frame/service/photovolatic/PhotovoltaicTestingPointNewService.java
  20. 11 1
      web/monitor-web-sxjn/src/main/java/com/gyee/frame/service/websocket/AgcService.java
  21. 5 5
      web/monitor-web-sxjn/src/main/java/com/gyee/frame/service/websocket/GenreSetPushService.java
  22. 100 89
      web/monitor-web-sxjn/src/main/java/com/gyee/frame/service/websocket/MatrixDetialGfPushService.java
  23. 7 5
      web/monitor-web-sxjn/src/main/java/com/gyee/frame/service/websocket/MatrixDetialPushService.java
  24. 108 47
      web/monitor-web-sxjn/src/main/java/com/gyee/frame/service/websocket/MatrixPushByWpService.java
  25. 130 42
      web/monitor-web-sxjn/src/main/java/com/gyee/frame/service/websocket/MatrixPushService.java
  26. 15 4
      web/monitor-web-sxjn/src/main/java/com/gyee/frame/service/websocket/MatrixQfPushService.java
  27. 563 179
      web/monitor-web-sxjn/src/main/java/com/gyee/frame/service/websocket/WpInfoPushService.java
  28. 341 48
      web/monitor-web-sxjn/src/main/java/com/gyee/frame/service/websocket/WtInfoPushService.java
  29. 10 10
      web/monitor-web-sxjn/src/main/resources/application-jn.yml

+ 41 - 0
web/monitor-hb/src/main/java/com/gyee/frame/common/spring/Constant.java

@@ -587,4 +587,45 @@ public static final String TPOINT_WT_60FX = "AI011";// 风机60秒风向
 
 
 	public static final String JSZT = "JSZT";// 接收状态
+
+    /*************************************************************************/
+
+    public static final String TPOINT_NBQ_AB_DY = "AIG003";// 电网AB线电压
+    public static final String TPOINT_NBQ_BC_DY = "AIG004";// 电网BC线电压
+    public static final String TPOINT_NBQ_CA_DY = "AIG005";// 1电网CA线电压
+    public static final String TPOINT_NBQ_A_DL = "AIG009";// 电网A相电流
+    public static final String TPOINT_NBQ_B_DL = "AIG010";//电网B相电流
+    public static final String TPOINT_NBQ_C_DL = "AIG011";//电网C相电流
+    public static final String TPOINT_NBQ_DWPL = "AIG012";// 电网频率
+    public static final String TPOINT_NBQ_GL = "AIG013";// 功率
+    public static final String TPOINT_NBQ_WGGL = "AIG014";// 功率
+    public static final String TPOINT_NBQ_GLYS = "AIG015";// 功率因数
+    public static final String TPOINT_NBQ_WD = "AIG017";// 机内温度
+    public static final String TPOINT_NBQ_XL = "AIG018";// 效率
+    public static final String TPOINT_NBQ_EYHT = "AIG022";// 累计二氧化碳减排量
+    public static final String TPOINT_NBQ_JLDY = "AIG023";// 交流电压
+    public static final String TPOINT_NBQ_JLDL = "AIG024";// 交流电流
+    public static final String TPOINT_NBQ_ZLDY = "AIG025";// 直流电压
+    public static final String TPOINT_NBQ_ZLDL = "AIG026";// 直流电流
+    public static final String TPOINT_NBQ_RFDL = "AIG027";// 日发电量
+    public static final String TPOINT_NBQ_YFDL = "AIG028";// 月发电量
+    public static final String TPOINT_NBQ_NFDL = "AIG029";// 年发电量
+    public static final String TPOINT_NBQ_ZFDL = "AIG030";// 总发电量
+    public static final String TPOINT_NBQ_RBWFZ = "AIG034";// 日并网分钟
+    public static final String TPOINT_NBQ_ZYXSJ = "AIG035";// 总运行时间
+
+
+
+
+    //汇流箱测点
+    public static final String[] TPOINT_Inverter_Junctionbox = { "AIG051", "AIG052",
+            "AIG053", "AIG054", "AIG055", "AIG056", "AIG057", "AIG058", "AIG059",
+            "AIG060", "AIG061", "AIG062", "AIG063", "AIG064", "AIG065", "AIG066",
+            "AIG067"};
+
+    //逆变器矩阵测点
+    public static final String[] TPOINT_Inverter_Matrix = { "FJZT", "AIG013",
+            "AIG027"};
+
+
 }

+ 88 - 51
web/monitor-hb/src/main/java/com/gyee/frame/controller/monitor/MonitorInverterPushController.java

@@ -1,77 +1,114 @@
 package com.gyee.frame.controller.monitor;
 
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import javax.annotation.Resource;
-
-import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.ResponseBody;
-
 import com.google.common.collect.Maps;
 import com.gyee.frame.common.conf.AjaxStatus;
 import com.gyee.frame.common.domain.AjaxResult;
 import com.gyee.frame.common.spring.InitialRunner;
+import com.gyee.frame.model.agc.AgcVo;
+import com.gyee.frame.model.auto.Inverter;
 import com.gyee.frame.model.auto.Windturbine;
+import com.gyee.frame.model.custom.InverterVo;
+import com.gyee.frame.model.custom.JunctionboxVo;
 import com.gyee.frame.service.websocket.WtInfoPushService;
 import com.gyee.frame.service.websocket.WtWarnPushService;
-
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
 
 @Controller
 @RequestMapping("/monitorinverter")
 @Api(value = "逆变器监视", tags = "逆变器监视")
 public class MonitorInverterPushController {
 
-	@Resource
-	private WtInfoPushService wtInfoPushService;
-	@Resource
-	private WtWarnPushService wtWarnPushService;
-
-	@GetMapping("/findInverterInfo")
-	@ResponseBody
-	@ApiOperation(value = "逆变器信息", notes = "逆变器AI点、报警点")
-	@ApiImplicitParams({ @ApiImplicitParam(name = "wtId", value = "逆变器ID", required = true, dataType = "string", paramType = "query") })
-	public AjaxResult findWtInfo(String wtId) throws Exception {
-		List<Object> listAI = wtInfoPushService.findInverterInfo(wtId);
-		Object listDI = wtInfoPushService.findInverterDI(wtId);
-		Windturbine wt = InitialRunner.wtmap.get(wtId);
-		Map<String, Object> map = Maps.newHashMap();
-		map.put("listAI", listAI);
-		map.put("listDI", listDI);
-		map.put("info",wt);
-		return AjaxResult.successData(AjaxStatus.success.code, map);
-	}
+    @Resource
+    private WtInfoPushService wtInfoPushService;
+    @Resource
+    private WtWarnPushService wtWarnPushService;
+
+    @GetMapping("/findInverterInfo")
+    @ResponseBody
+    @ApiOperation(value = "逆变器信息", notes = "逆变器AI点、报警点")
+    @ApiImplicitParams({ @ApiImplicitParam(name = "wtId", value = "逆变器ID", required = true, dataType = "string", paramType = "query") })
+    public AjaxResult findWtInfo(String wtId) throws Exception {
+        List<Object> listAI = wtInfoPushService.findInverterInfo(wtId);
+        Object listDI = wtInfoPushService.findInverterDI(wtId);
+
+
+
+        Map<String, Object> map = Maps.newHashMap();
+        map.put("listAI", listAI);
+        map.put("listDI", listDI);
+
+        if(InitialRunner.wtmap.containsKey(wtId))
+        {
+            Windturbine wt = InitialRunner.wtmap.get(wtId);
+            map.put("info",wt);
+        }else if(InitialRunner.nbqmap.containsKey(wtId))
+        {
+            Inverter wt = InitialRunner.nbqmap.get(wtId);
+            map.put("info",wt);
+        }
+
+        return AjaxResult.successData(AjaxStatus.success.code, map);
+    }
 
     @GetMapping("/findInverterInfoList")
     @ResponseBody
-    @ApiOperation(value = "逆变器信息列表", notes = "逆变器信息列表")
+    @ApiOperation(value = "汇流箱信息列表", notes = "汇流箱信息列表")
     @ApiImplicitParams({@ApiImplicitParam(name = "wpId", value = "风场编号", required = true, dataType = "string", paramType = "query")
     })
 
-	public AjaxResult findWtInfoList(String wpId) throws Exception {
-		List<Map<String, Object>> vos = new ArrayList<>();
-		vos = wtInfoPushService.findInverterInfoList(wpId);
-		if (null != vos) {
-			return AjaxResult.successData(AjaxStatus.success.code, vos);
-		} else {
-			return AjaxResult.successData(AjaxStatus.error.code, vos);
-		}
-	}
-
-	@GetMapping("/findInverterPowerLine")
-	@ResponseBody
-	@ApiOperation(value = "逆变器开网频率", notes = "逆变器当日0点至今功率,间隔30分钟")
-	@ApiImplicitParams({ @ApiImplicitParam(name = "wtId", value = "逆变器ID", required = true, dataType = "string", paramType = "query") })
-	public AjaxResult findInverterPowerLine(String wtId) throws Exception {
-		List<Object> list = wtInfoPushService.findInverterPowerCurve(wtId);
-		return AjaxResult.successData(AjaxStatus.success.code, list);
-	}
+    public AjaxResult findWtInfoList(String wpId) throws Exception {
+        List<JunctionboxVo> vos=new ArrayList<>();
+        vos = wtInfoPushService.findInverterInfoList(wpId);
+        if (null != vos) {
+            return AjaxResult.successData(AjaxStatus.success.code, vos);
+        } else {
+            return AjaxResult.successData(AjaxStatus.error.code, vos);
+        }
+    }
+
+    @GetMapping("/findInverterPowerLine")
+    @ResponseBody
+    @ApiOperation(value = "逆变器开网频率", notes = "逆变器当日0点至今功率,间隔30分钟")
+    @ApiImplicitParams({ @ApiImplicitParam(name = "wtId", value = "逆变器ID", required = true, dataType = "string", paramType = "query") })
+    public AjaxResult findInverterPowerLine(String wtId) throws Exception {
+        List<AgcVo> list = wtInfoPushService.findInverterPowerCurve(wtId);
+        return AjaxResult.successData(AjaxStatus.success.code, list);
+    }
+
+    @GetMapping("/findMatrixByWpId")
+    @ResponseBody
+    @ApiOperation(value = "场站逆变器矩阵", notes = "场站逆变器矩阵")
+    @ApiImplicitParams({ @ApiImplicitParam(name = "wpId", value = "场站编号", required = true, dataType = "string", paramType = "query") })
+    public AjaxResult findMatrixByWpId(String wpId) throws Exception {
+
+        Map<String,List<InverterVo>> map = wtInfoPushService.findMatrixByWpId(wpId);
+
+        return AjaxResult.successData(AjaxStatus.success.code, map);
+    }
+
+
+    @GetMapping("/findMatrix")
+    @ResponseBody
+    @ApiOperation(value = "逆变器矩阵", notes = "逆变器矩阵")
+    @ApiImplicitParams({ })
+    public AjaxResult findMatrix() throws Exception {
+
+
+        Map<String,Map<String,List<InverterVo>>>  map = wtInfoPushService.findMatrix();
+
+        return AjaxResult.successData(AjaxStatus.success.code, map);
+    }
+
 }

+ 66 - 0
web/monitor-hb/src/main/java/com/gyee/frame/model/custom/InverterVo.java

@@ -0,0 +1,66 @@
+
+package com.gyee.frame.model.custom;
+
+
+
+public class InverterVo {
+
+    private Integer zt;
+    private Double fdl;
+
+    private Double gl;
+
+    private String id;
+
+    private String name;
+
+    private String sqname;
+
+    public String getSqname() {
+        return sqname;
+    }
+
+    public void setSqname(String sqname) {
+        this.sqname = sqname;
+    }
+
+    public Integer getZt() {
+        return zt;
+    }
+
+    public void setZt(Integer zt) {
+        this.zt = zt;
+    }
+
+    public Double getFdl() {
+        return fdl;
+    }
+
+    public void setFdl(Double fdl) {
+        this.fdl = fdl;
+    }
+
+    public Double getGl() {
+        return gl;
+    }
+
+    public void setGl(Double gl) {
+        this.gl = gl;
+    }
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+}

+ 200 - 0
web/monitor-hb/src/main/java/com/gyee/frame/model/custom/JunctionboxVo.java

@@ -0,0 +1,200 @@
+
+package com.gyee.frame.model.custom;
+
+/**
+ *
+ */
+
+public class JunctionboxVo {
+
+    private String id;
+    private String name;
+    private Double zdy;
+    
+    private Double dl1;
+
+    private Double dl2;
+
+    private Double dl3;
+
+    private Double dl4;
+
+    private Double dl5;
+
+    private Double dl6;
+
+    private Double dl7;
+
+    private Double dl8;
+
+    private Double dl9;
+
+    private Double dl10;
+
+    private Double dl11;
+
+    private Double dl12;
+
+    private Double dl13;
+
+    private Double dl14;
+
+    private Double dl15;
+
+    private Double dl16;
+
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public Double getZdy() {
+        return zdy;
+    }
+
+    public void setZdy(Double zdy) {
+        this.zdy = zdy;
+    }
+
+    public Double getDl1() {
+        return dl1;
+    }
+
+    public void setDl1(Double dl1) {
+        this.dl1 = dl1;
+    }
+
+    public Double getDl2() {
+        return dl2;
+    }
+
+    public void setDl2(Double dl2) {
+        this.dl2 = dl2;
+    }
+
+    public Double getDl3() {
+        return dl3;
+    }
+
+    public void setDl3(Double dl3) {
+        this.dl3 = dl3;
+    }
+
+    public Double getDl4() {
+        return dl4;
+    }
+
+    public void setDl4(Double dl4) {
+        this.dl4 = dl4;
+    }
+
+    public Double getDl5() {
+        return dl5;
+    }
+
+    public void setDl5(Double dl5) {
+        this.dl5 = dl5;
+    }
+
+    public Double getDl6() {
+        return dl6;
+    }
+
+    public void setDl6(Double dl6) {
+        this.dl6 = dl6;
+    }
+
+    public Double getDl7() {
+        return dl7;
+    }
+
+    public void setDl7(Double dl7) {
+        this.dl7 = dl7;
+    }
+
+    public Double getDl8() {
+        return dl8;
+    }
+
+    public void setDl8(Double dl8) {
+        this.dl8 = dl8;
+    }
+
+    public Double getDl9() {
+        return dl9;
+    }
+
+    public void setDl9(Double dl9) {
+        this.dl9 = dl9;
+    }
+
+    public Double getDl10() {
+        return dl10;
+    }
+
+    public void setDl10(Double dl10) {
+        this.dl10 = dl10;
+    }
+
+    public Double getDl11() {
+        return dl11;
+    }
+
+    public void setDl11(Double dl11) {
+        this.dl11 = dl11;
+    }
+
+    public Double getDl12() {
+        return dl12;
+    }
+
+    public void setDl12(Double dl12) {
+        this.dl12 = dl12;
+    }
+
+    public Double getDl13() {
+        return dl13;
+    }
+
+    public void setDl13(Double dl13) {
+        this.dl13 = dl13;
+    }
+
+    public Double getDl14() {
+        return dl14;
+    }
+
+    public void setDl14(Double dl14) {
+        this.dl14 = dl14;
+    }
+
+    public Double getDl15() {
+        return dl15;
+    }
+
+    public void setDl15(Double dl15) {
+        this.dl15 = dl15;
+    }
+
+    public Double getDl16() {
+        return dl16;
+    }
+
+    public void setDl16(Double dl16) {
+        this.dl16 = dl16;
+    }
+
+
+}

+ 82 - 85
web/monitor-hb/src/main/java/com/gyee/frame/service/photovolatic/PhotovoltaicTestingPointNewService.java

@@ -18,81 +18,81 @@ import java.util.Map;
 
 @Service
 public class PhotovoltaicTestingPointNewService implements BaseService<PhotovoltaicTestingPointNew, PhotovoltaicTestingPointNewExample> {
-	@Resource
-	private PhotovoltaicTestingPointNewMapper photovoltaicTestingPointNewMapper;
-	
-	@Override
-	public int deleteByPrimaryKey(String ids) {
-				
-			List<String> lista=Convert.toListStrArray(ids);
-			PhotovoltaicTestingPointNewExample example=new PhotovoltaicTestingPointNewExample();
-			example.createCriteria().andIdIn(lista);
-			return photovoltaicTestingPointNewMapper.deleteByExample(example);
-			
-				
-	}
-	
-	
-	@Override
-	public PhotovoltaicTestingPointNew selectByPrimaryKey(String id) {
-				
-			return photovoltaicTestingPointNewMapper.selectByPrimaryKey(id);
-				
-	}
-
-	
-	@Override
-	public int updateByPrimaryKeySelective(PhotovoltaicTestingPointNew record) {
-		return photovoltaicTestingPointNewMapper.updateByPrimaryKeySelective(record);
-	}
-	
-	
-	/**
-	 * 添加
-	 */
-	@Override
-	public int insertSelective(PhotovoltaicTestingPointNew record) {
-				
-		//添加雪花主键id
-		record.setId(SnowflakeIdWorker.getUUID());
-			
-				
-		return photovoltaicTestingPointNewMapper.insertSelective(record);
-	}
-	
-	
-	@Override
-	public int updateByExampleSelective(PhotovoltaicTestingPointNew record, PhotovoltaicTestingPointNewExample example) {
-		
-		return photovoltaicTestingPointNewMapper.updateByExampleSelective(record, example);
-	}
-
-	
-	@Override
-	public int updateByExample(PhotovoltaicTestingPointNew record, PhotovoltaicTestingPointNewExample example) {
-		
-		return photovoltaicTestingPointNewMapper.updateByExample(record, example);
-	}
-
-	@Override
-	public List<PhotovoltaicTestingPointNew> selectByExample(PhotovoltaicTestingPointNewExample example) {
-		
-		return photovoltaicTestingPointNewMapper.selectByExample(example);
-	}
-
-	
-	@Override
-	public long countByExample(PhotovoltaicTestingPointNewExample example) {
-		
-		return photovoltaicTestingPointNewMapper.countByExample(example);
-	}
-
-	
-	@Override
-	public int deleteByExample(PhotovoltaicTestingPointNewExample example) {
-		
-		return photovoltaicTestingPointNewMapper.deleteByExample(example);
-	}
+    @Resource
+    private PhotovoltaicTestingPointNewMapper photovoltaicTestingPointNewMapper;
+
+    @Override
+    public int deleteByPrimaryKey(String ids) {
+
+        List<String> lista=Convert.toListStrArray(ids);
+        PhotovoltaicTestingPointNewExample example=new PhotovoltaicTestingPointNewExample();
+        example.createCriteria().andIdIn(lista);
+        return photovoltaicTestingPointNewMapper.deleteByExample(example);
+
+
+    }
+
+
+    @Override
+    public PhotovoltaicTestingPointNew selectByPrimaryKey(String id) {
+
+        return photovoltaicTestingPointNewMapper.selectByPrimaryKey(id);
+
+    }
+
+
+    @Override
+    public int updateByPrimaryKeySelective(PhotovoltaicTestingPointNew record) {
+        return photovoltaicTestingPointNewMapper.updateByPrimaryKeySelective(record);
+    }
+
+
+    /**
+     * 添加
+     */
+    @Override
+    public int insertSelective(PhotovoltaicTestingPointNew record) {
+
+        //添加雪花主键id
+        record.setId(SnowflakeIdWorker.getUUID());
+
+
+        return photovoltaicTestingPointNewMapper.insertSelective(record);
+    }
+
+
+    @Override
+    public int updateByExampleSelective(PhotovoltaicTestingPointNew record, PhotovoltaicTestingPointNewExample example) {
+
+        return photovoltaicTestingPointNewMapper.updateByExampleSelective(record, example);
+    }
+
+
+    @Override
+    public int updateByExample(PhotovoltaicTestingPointNew record, PhotovoltaicTestingPointNewExample example) {
+
+        return photovoltaicTestingPointNewMapper.updateByExample(record, example);
+    }
+
+    @Override
+    public List<PhotovoltaicTestingPointNew> selectByExample(PhotovoltaicTestingPointNewExample example) {
+
+        return photovoltaicTestingPointNewMapper.selectByExample(example);
+    }
+
+
+    @Override
+    public long countByExample(PhotovoltaicTestingPointNewExample example) {
+
+        return photovoltaicTestingPointNewMapper.countByExample(example);
+    }
+
+
+    @Override
+    public int deleteByExample(PhotovoltaicTestingPointNewExample example) {
+
+        return photovoltaicTestingPointNewMapper.deleteByExample(example);
+    }
 
 
     public List<PhotovoltaicTestingPointNew> selectAll() {
@@ -108,15 +108,12 @@ public class PhotovoltaicTestingPointNewService implements BaseService<Photovolt
         PhotovoltaicTestingPointNew point=new PhotovoltaicTestingPointNew();
         if(StringUtils.notEmp(wtId) && StringUtils.notEmp(unicode) )
         {
-            if(InitialRunner.nbqmap.containsKey(wtId))
+            if(InitialRunner.phPointmap.containsKey(wtId))
             {
-                if(InitialRunner.phPointmap.containsKey(wtId))
+                Map<String, PhotovoltaicTestingPointNew> map=InitialRunner.phPointmap.get(wtId);
+                if(map.containsKey(unicode))
                 {
-                    Map<String, PhotovoltaicTestingPointNew> map=InitialRunner.phPointmap.get(wtId);
-                    if(map.containsKey(unicode))
-                    {
-                        point=map.get(unicode);
-                    }
+                    point=map.get(unicode);
                 }
             }
         }
@@ -125,7 +122,7 @@ public class PhotovoltaicTestingPointNewService implements BaseService<Photovolt
     }
 
 
-    public List<PhotovoltaicTestingPointNew> getPhotovoltaicTestingPointNewList(String wtId)  {
+    public List<PhotovoltaicTestingPointNew> getPhotovoltaicTestingPointNewDiList(String wtId)  {
 
         List<PhotovoltaicTestingPointNew> list=new ArrayList<>();
 
@@ -134,10 +131,10 @@ public class PhotovoltaicTestingPointNewService implements BaseService<Photovolt
         {
             PhotovoltaicTestingPointNewExample example=new PhotovoltaicTestingPointNewExample();
             example.setOrderByClause("id ASC");
-            example.isDistinct();
             PhotovoltaicTestingPointNewExample.Criteria criteria =example.createCriteria();
             criteria.andWindturbineidEqualTo(wtId);
-            criteria.andUniformcodeLike("DI");
+            criteria.andUniformcodeLike("%DI%");
+            criteria.andCodeNotEqualTo("INITIAL");
             list= photovoltaicTestingPointNewMapper.selectByExample(example);
 
         }

+ 11 - 9
web/monitor-hb/src/main/java/com/gyee/frame/service/websocket/GenreSetPushService.java

@@ -10,6 +10,7 @@ import com.gyee.frame.model.custom.DataVo;
 import com.gyee.frame.model.custom.MatrixVo;
 import com.gyee.frame.model.custom.PointData;
 import com.gyee.frame.service.*;
+import com.gyee.frame.service.photovolatic.PhotovoltaicTestingPointNewService;
 import com.gyee.frame.service.weather.WeatherDay5Service;
 import com.gyee.frame.service.weather.WeatherService;
 import com.gyee.frame.util.*;
@@ -51,7 +52,8 @@ public class GenreSetPushService {
     private WobugeqService wobugeqService;
     @Resource
     private RecommenmainService recommenmainService;
-
+    @Resource
+    private PhotovoltaicTestingPointNewService photovoltaicTestingPointNewService;
 
     private final String QS = "0";
     private final String FD = "-1";
@@ -406,7 +408,7 @@ public class GenreSetPushService {
                         List<Inverter> wtls = InitialRunner.gp_nbqmap.get(wp.getId());
                         for (Inverter wt : wtls) {
                             //状态
-                            gfzbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wt.getId(), Constant.FJZT).getCode());
+                            gfzbls.add(photovoltaicTestingPointNewService.getPhotovoltaicTestingPointNew(wt.getId(), Constant.FJZT).getCode());
                         }
                     }
 
@@ -656,19 +658,19 @@ public class GenreSetPushService {
                         List<Inverter> wtls = InitialRunner.gp_nbqmap.get(id);
                         for(Inverter wt:wtls) {
                             //状态
-                            gfzbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wt.getId(), Constant.FJZT).getCode());
+                            gfzbls.add(photovoltaicTestingPointNewService.getPhotovoltaicTestingPointNew(wt.getId(), Constant.FJZT).getCode());
                         }
                     }  else  if( InitialRunner.pj_nbqmap.containsKey(id)){
                         List<Inverter> wtls = InitialRunner.pj_nbqmap.get(id);
                         for(Inverter wt:wtls) {
                             //状态
-                            gfzbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wt.getId(), Constant.FJZT).getCode());
+                            gfzbls.add(photovoltaicTestingPointNewService.getPhotovoltaicTestingPointNew(wt.getId(), Constant.FJZT).getCode());
                         }
                     }else if( InitialRunner.ln_nbqmap.containsKey(id)){
                         List<Inverter> wtls = InitialRunner.ln_nbqmap.get(id);
                         for(Inverter wt:wtls) {
                             //状态
-                            gfzbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wt.getId(), Constant.FJZT).getCode());
+                            gfzbls.add(photovoltaicTestingPointNewService.getPhotovoltaicTestingPointNew(wt.getId(), Constant.FJZT).getCode());
                         }
                     } else  if( InitialRunner.pj_wtmap.containsKey(id)){
                         List<Windturbine> wtls = InitialRunner.pj_wtmap.get(id);
@@ -2185,7 +2187,7 @@ public class GenreSetPushService {
                         List<Inverter> wtls = InitialRunner.gp_nbqmap.get(wp.getId());
                         for (Inverter wt : wtls) {
                             //状态
-                            gfzbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wt.getId(), Constant.FJZT).getCode());
+                            gfzbls.add(photovoltaicTestingPointNewService.getPhotovoltaicTestingPointNew(wt.getId(), Constant.FJZT).getCode());
                         }
                     }
 
@@ -2435,19 +2437,19 @@ public class GenreSetPushService {
                         List<Inverter> wtls = InitialRunner.gp_nbqmap.get(id);
                         for(Inverter wt:wtls) {
                             //状态
-                            gfzbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wt.getId(), Constant.FJZT).getCode());
+                            gfzbls.add(photovoltaicTestingPointNewService.getPhotovoltaicTestingPointNew(wt.getId(), Constant.FJZT).getCode());
                         }
                     }  else  if( InitialRunner.pj_nbqmap.containsKey(id)){
                         List<Inverter> wtls = InitialRunner.pj_nbqmap.get(id);
                         for(Inverter wt:wtls) {
                             //状态
-                            gfzbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wt.getId(), Constant.FJZT).getCode());
+                            gfzbls.add(photovoltaicTestingPointNewService.getPhotovoltaicTestingPointNew(wt.getId(), Constant.FJZT).getCode());
                         }
                     }else if( InitialRunner.ln_nbqmap.containsKey(id)){
                         List<Inverter> wtls = InitialRunner.ln_nbqmap.get(id);
                         for(Inverter wt:wtls) {
                             //状态
-                            gfzbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wt.getId(), Constant.FJZT).getCode());
+                            gfzbls.add(photovoltaicTestingPointNewService.getPhotovoltaicTestingPointNew(wt.getId(), Constant.FJZT).getCode());
                         }
                     } else  if( InitialRunner.pj_wtmap.containsKey(id)){
                         List<Windturbine> wtls = InitialRunner.pj_wtmap.get(id);

+ 7 - 5
web/monitor-hb/src/main/java/com/gyee/frame/service/websocket/GenreSetPushService_bak.java

@@ -10,6 +10,7 @@ import com.gyee.frame.model.custom.DataVo;
 import com.gyee.frame.model.custom.MatrixVo;
 import com.gyee.frame.model.custom.PointData;
 import com.gyee.frame.service.*;
+import com.gyee.frame.service.photovolatic.PhotovoltaicTestingPointNewService;
 import com.gyee.frame.service.weather.WeatherDay5Service;
 import com.gyee.frame.service.weather.WeatherService;
 import com.gyee.frame.util.*;
@@ -51,7 +52,8 @@ public class GenreSetPushService_bak {
     private WobugeqService wobugeqService;
     @Resource
     private RecommenmainService recommenmainService;
-
+    @Resource
+    private PhotovoltaicTestingPointNewService photovoltaicTestingPointNewService;
 
     private final String QS = "0";
     private final String FD = "-1";
@@ -330,7 +332,7 @@ public class GenreSetPushService_bak {
                     } else if (wp.getId().endsWith("GDC")) {
                         for (Windturbine wt : wtls) {
                             //状态
-                            gfzbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wt.getId(), Constant.FJZT).getCode());
+                            gfzbls.add(photovoltaicTestingPointNewService.getPhotovoltaicTestingPointNew(wt.getId(), Constant.FJZT).getCode());
                         }
                     }
 
@@ -590,7 +592,7 @@ public class GenreSetPushService_bak {
 
                     for(Windturbine wt:wtls) {
                         //状态
-                        gfzbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wt.getId(), Constant.FJZT).getCode());
+                        gfzbls.add(photovoltaicTestingPointNewService.getPhotovoltaicTestingPointNew(wt.getId(), Constant.FJZT).getCode());
                     }
                     List<PointData> gfzblist = realApiUtil.getRealData(gfzbls);
                     if (!gfzblist.isEmpty() && gfzblist.size() == gfzblist.size()) {
@@ -1995,7 +1997,7 @@ public class GenreSetPushService_bak {
                     } else if (wp.getId().endsWith("GDC")) {
                         for (Windturbine wt : wtls) {
                             //状态
-                            gfzbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wt.getId(), Constant.FJZT).getCode());
+                            gfzbls.add(photovoltaicTestingPointNewService.getPhotovoltaicTestingPointNew(wt.getId(), Constant.FJZT).getCode());
                         }
                     }
 
@@ -2255,7 +2257,7 @@ public class GenreSetPushService_bak {
 
                     for(Windturbine wt:wtls) {
                         //状态
-                        gfzbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wt.getId(), Constant.FJZT).getCode());
+                        gfzbls.add(photovoltaicTestingPointNewService.getPhotovoltaicTestingPointNew(wt.getId(), Constant.FJZT).getCode());
                     }
                     List<PointData> gfzblist = realApiUtil.getRealData(gfzbls);
                     if (!gfzblist.isEmpty() && gfzblist.size() == gfzblist.size()) {

+ 14 - 12
web/monitor-hb/src/main/java/com/gyee/frame/service/websocket/MatrixDetialGfPushService.java

@@ -3,14 +3,15 @@ package com.gyee.frame.service.websocket;
 
 import com.gyee.frame.common.spring.Constant;
 import com.gyee.frame.common.spring.InitialRunner;
+import com.gyee.frame.model.auto.Inverter;
 import com.gyee.frame.model.auto.Windpowerstation;
-import com.gyee.frame.model.auto.Windturbine;
 import com.gyee.frame.model.custom.MatrixVo;
 import com.gyee.frame.model.custom.PointData;
 import com.gyee.frame.service.ProjectPlanService;
 import com.gyee.frame.service.WindPowerstationTestingPoint2Service;
 import com.gyee.frame.service.WindTurbineTestingPointAiService;
 import com.gyee.frame.service.WindpowerinfodayService;
+import com.gyee.frame.service.photovolatic.PhotovoltaicTestingPointNewService;
 import com.gyee.frame.util.IRealTimeDataBaseUtil;
 import com.gyee.frame.util.MathUtil;
 import com.gyee.frame.util.RealTimeDataBaseFactory;
@@ -37,7 +38,8 @@ public class MatrixDetialGfPushService {
     private ProjectPlanService projectPlanService;
     @Resource
     private WindTurbineTestingPointAiService windTurbineTestingPointAiService;
-
+    @Resource
+    private PhotovoltaicTestingPointNewService photovoltaicTestingPointNewService;
 
 
     IRealTimeDataBaseUtil realApiUtil = RealTimeDataBaseFactory.createRealTimeDataBase();
@@ -81,7 +83,7 @@ public class MatrixDetialGfPushService {
             Map<String, Object> jczbmap = new HashMap<>();
             jczbmap.put("name", wp.getName());
 
-        /*************************************************风场指标统计*************************************************************/
+            /*************************************************风场指标统计*************************************************************/
 
 
             List<String> jczbls = new ArrayList<>();
@@ -152,20 +154,20 @@ public class MatrixDetialGfPushService {
 /*************************************************风机指标统计*************************************************************/
             List<String> fjzbls = new ArrayList<>();
 
-            List<Windturbine> wtls=InitialRunner.wp_wtmap.get(wp.getId());
+            List<Inverter> wtls=InitialRunner.gp_nbqmap.get(wp.getId());
 
             List<MatrixVo> vos = new ArrayList<>();
 
-            for(Windturbine wt:wtls)
+            for(Inverter wt:wtls)
             {
                 //状态
-                fjzbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wt.getId(), Constant.FJZT).getCode());
+                fjzbls.add(photovoltaicTestingPointNewService.getPhotovoltaicTestingPointNew(wt.getId(), Constant.FJZT).getCode());
                 //交流电流
-                fjzbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wt.getId(), Constant.TPOINT_WT_NBQJLDL).getCode());
+                fjzbls.add(photovoltaicTestingPointNewService.getPhotovoltaicTestingPointNew(wt.getId(), Constant.TPOINT_WT_NBQJLDL).getCode());
                 //功率
-                fjzbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wt.getId(), Constant.TPOINT_WT_FJGL).getCode());
+                fjzbls.add(photovoltaicTestingPointNewService.getPhotovoltaicTestingPointNew(wt.getId(), Constant.TPOINT_WT_FJGL).getCode());
                 //交流电压
-                fjzbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wt.getId(), Constant.TPOINT_WT_NBQJLDY).getCode());
+                fjzbls.add(photovoltaicTestingPointNewService.getPhotovoltaicTestingPointNew(wt.getId(), Constant.TPOINT_WT_NBQJLDY).getCode());
             }
 
             List<PointData> fjzblist = realApiUtil.getRealData(fjzbls);
@@ -185,14 +187,14 @@ public class MatrixDetialGfPushService {
                 double slts=0.0;
                 for(int i=0;i<wtls.size();i++)
                 {
-                    Windturbine wt=wtls.get(i);
+                    Inverter wt=wtls.get(i);
 
                     MatrixVo vo=new MatrixVo();
                     vo.setWtId(wt.getId());
 
-                    if(StringUtils.notEmp(wt.getStatus()))
+                    if(StringUtils.notEmp(wt.getId()))
                     {
-                        String num=wt.getStatus().substring(wt.getStatus().length()-3);
+                        String num=wt.getId().substring(wt.getId().indexOf("_")+1);
                         vo.setWtnum(num);
 
                     }

+ 7 - 5
web/monitor-hb/src/main/java/com/gyee/frame/service/websocket/MatrixDetialPushService.java

@@ -13,6 +13,7 @@ import com.gyee.frame.service.ProjectPlanService;
 import com.gyee.frame.service.WindPowerstationTestingPoint2Service;
 import com.gyee.frame.service.WindTurbineTestingPointAiService;
 import com.gyee.frame.service.WindpowerinfodayService;
+import com.gyee.frame.service.photovolatic.PhotovoltaicTestingPointNewService;
 import com.gyee.frame.util.IRealTimeDataBaseUtil;
 import com.gyee.frame.util.MathUtil;
 import com.gyee.frame.util.RealTimeDataBaseFactory;
@@ -38,7 +39,8 @@ public class MatrixDetialPushService {
     private ProjectPlanService projectPlanService;
     @Resource
     private WindTurbineTestingPointAiService windTurbineTestingPointAiService;
-
+    @Resource
+    private PhotovoltaicTestingPointNewService photovoltaicTestingPointNewService;
 
     IRealTimeDataBaseUtil realApiUtil = RealTimeDataBaseFactory.createRealTimeDataBase();
 
@@ -327,13 +329,13 @@ public class MatrixDetialPushService {
                 List<Inverter> wtls = InitialRunner.gp_nbqmap.get(wp.getId());
                 for (Inverter wt : wtls) {
                     //风机状态
-                    fjzbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wt.getId(), Constant.ZTMX).getCode());
+                    fjzbls.add(photovoltaicTestingPointNewService.getPhotovoltaicTestingPointNew(wt.getId(), Constant.ZTMX).getCode());
                     //风速
-                    fjzbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wt.getId(), Constant.TPOINT_WT_FJSSFS).getCode());
+                    fjzbls.add(photovoltaicTestingPointNewService.getPhotovoltaicTestingPointNew(wt.getId(), Constant.TPOINT_WT_FJSSFS).getCode());
                     //功率
-                    fjzbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wt.getId(), Constant.TPOINT_WT_FJGL).getCode());
+                    fjzbls.add(photovoltaicTestingPointNewService.getPhotovoltaicTestingPointNew(wt.getId(), Constant.TPOINT_WT_FJGL).getCode());
 
-                    fjzbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wt.getId(), Constant.TPOINT_WT_FDJZS).getCode());
+                    fjzbls.add(photovoltaicTestingPointNewService.getPhotovoltaicTestingPointNew(wt.getId(), Constant.TPOINT_WT_FDJZS).getCode());
 
                 }
             }

+ 136 - 42
web/monitor-hb/src/main/java/com/gyee/frame/service/websocket/MatrixPushService.java

@@ -12,6 +12,7 @@ import com.gyee.frame.service.ProjectPlanService;
 import com.gyee.frame.service.WindPowerstationTestingPoint2Service;
 import com.gyee.frame.service.WindTurbineTestingPointAiService;
 import com.gyee.frame.service.WindpowerinfodayService;
+import com.gyee.frame.service.photovolatic.PhotovoltaicTestingPointNewService;
 import com.gyee.frame.util.IRealTimeDataBaseUtil;
 import com.gyee.frame.util.MathUtil;
 import com.gyee.frame.util.RealTimeDataBaseFactory;
@@ -39,7 +40,8 @@ public class MatrixPushService {
     @Resource
     private WindTurbineTestingPointAiService windTurbineTestingPointAiService;
 
-
+    @Resource
+    private PhotovoltaicTestingPointNewService photovoltaicTestingPointNewService;
     IRealTimeDataBaseUtil realApiUtil = RealTimeDataBaseFactory.createRealTimeDataBase();
 
 
@@ -156,23 +158,23 @@ public class MatrixPushService {
                 Double xdts = MathUtil.twoBit(jczblist.get(12).getPointValueInDouble());
                 jczbmap.put("xdts", xdts);
 
-                if (wp.getId().endsWith("FDC")) {
-                    fcdjnum = fcdjnum + djts.intValue();
-                    fcyxnum = fcyxnum + yxts.intValue();
-                    fcgznum = fcgznum + gzts.intValue();
-                    fclxnum = fclxnum + lxts.intValue();
-                    fcwhnum = fcwhnum + whts.intValue();
-                    fcxdnum = fcxdnum + xdts.intValue();
-
-                } else if (wp.getId().endsWith("GDC")) {
-
-                    gfdjnum = gfdjnum + djts.intValue();
-                    gfyxnum = gfyxnum + yxts.intValue();
-                    gfgznum = gfgznum + gzts.intValue();
-                    gflxnum = gflxnum + lxts.intValue();
-                    gfwhnum = gfwhnum + whts.intValue();
-                    gfxdnum = gfxdnum + xdts.intValue();
-                }
+//                if (wp.getId().endsWith("FDC")) {
+//                    fcdjnum = fcdjnum + djts.intValue();
+//                    fcyxnum = fcyxnum + yxts.intValue();
+//                    fcgznum = fcgznum + gzts.intValue();
+//                    fclxnum = fclxnum + lxts.intValue();
+//                    fcwhnum = fcwhnum + whts.intValue();
+//                    fcxdnum = fcxdnum + xdts.intValue();
+//
+//                } else if (wp.getId().endsWith("GDC")) {
+//
+//                    gfdjnum = gfdjnum + djts.intValue();
+//                    gfyxnum = gfyxnum + yxts.intValue();
+//                    gfgznum = gfgznum + gzts.intValue();
+//                    gflxnum = gflxnum + lxts.intValue();
+//                    gfwhnum = gfwhnum + whts.intValue();
+//                    gfxdnum = gfxdnum + xdts.intValue();
+//                }
 
             } else {
                 //实时风速
@@ -211,8 +213,10 @@ public class MatrixPushService {
             List<String> fjzbls = new ArrayList<>();
 
 
+
             List<MatrixVo> vos = new ArrayList<>();
 
+
             if(wp.getId().endsWith("FDC") && InitialRunner.wp_wtmap.containsKey(wp.getId()))
             {
                 List<Windturbine> wtls = InitialRunner.wp_wtmap.get(wp.getId());
@@ -230,24 +234,33 @@ public class MatrixPushService {
                 List<Inverter> wtls = InitialRunner.gp_nbqmap.get(wp.getId());
                 for (Inverter wt : wtls) {
                     //风机状态
-                    fjzbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wt.getId(), Constant.FJZT).getCode());
+                    fjzbls.add(photovoltaicTestingPointNewService.getPhotovoltaicTestingPointNew(wt.getId(), Constant.FJZT).getCode());
                     //风速
-                    fjzbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wt.getId(), Constant.TPOINT_WT_FJSSFS).getCode());
+                    fjzbls.add(photovoltaicTestingPointNewService.getPhotovoltaicTestingPointNew(wt.getId(), Constant.TPOINT_WT_FJSSFS).getCode());
                     //功率
-                    fjzbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wt.getId(), Constant.TPOINT_WT_FJGL).getCode());
+                    fjzbls.add(photovoltaicTestingPointNewService.getPhotovoltaicTestingPointNew(wt.getId(), Constant.TPOINT_WT_FJGL).getCode());
 
                 }
             }
 
+
             List<PointData> fjzblist = realApiUtil.getRealData(fjzbls);
 
             if (!fjzblist.isEmpty() && fjzblist.size() == fjzbls.size()) {
 
 
                 int step = 3;
-                int slts = 0;
+                int djnum = 0;
+                int yxnum = 0;
+                int gznum = 0;
+                int lxnum = 0;
+                int whnum = 0;
+                int xdnum = 0;
+                int slnum = 0;
                 if(wp.getId().endsWith("FDC") && InitialRunner.wp_wtmap.containsKey(wp.getId()))
                 {
+
+
                     List<Windturbine> wtls = InitialRunner.wp_wtmap.get(wp.getId());
                     for (int i = 0; i < wtls.size(); i++) {
                         Windturbine wt = wtls.get(i);
@@ -263,9 +276,57 @@ public class MatrixPushService {
 
 
                         double fjzt = MathUtil.twoBit(fjzblist.get(i * step).getPointValueInDouble());
-                        if (fjzt == 6) {
-                            slts++;
+
+
+                        switch (Double.valueOf(fjzt).intValue()) {
+                            case 0:
+                                fcdjnum++;
+                                djnum++;
+                                break;
+                            case 1:
+                                fcyxnum++;
+                                yxnum++;
+                                break;
+                            case 2:
+                                fcgznum++;
+                                gznum++;
+
+                                break;
+                            case 3:
+                                fclxnum++;
+                                lxnum++;
+                                break;
+                            case 4:
+                                fcwhnum++;
+                                whnum++;
+                                break;
+                            case 5:
+                                fcxdnum++;
+                                xdnum++;
+                                break;
+                            case 6:
+                                fcslnum++;
+                                slnum++;
+                                break;
+
+                            default:
+
+                                break;
                         }
+                        //待机台数
+                        jczbmap.put("djts", djnum);
+                        //运行台数
+                        jczbmap.put("yxts", yxnum);
+                        //故障台数
+                        jczbmap.put("gzts", gznum);
+                        //离线台数
+                        jczbmap.put("lxts", lxnum);
+                        //维护台数
+                        jczbmap.put("whts", whnum);
+                        //限电台数
+                        jczbmap.put("xdts", xdnum);
+                        //受累台数
+                        jczbmap.put("slts", slnum);
                         vo.setFjzt(fjzt);
                         vo.setFs(MathUtil.twoBit(fjzblist.get(i * step + 1).getPointValueInDouble()));
                         vo.setGl(MathUtil.twoBit(fjzblist.get(i * step + 2).getPointValueInDouble()));
@@ -291,9 +352,55 @@ public class MatrixPushService {
 
 
                         double fjzt = MathUtil.twoBit(fjzblist.get(i * step).getPointValueInDouble());
-                        if (fjzt == 6) {
-                            slts++;
+                        switch (Double.valueOf(fjzt).intValue()) {
+                            case 0:
+                                gfdjnum++;
+                                djnum++;
+                                break;
+                            case 1:
+                                gfyxnum++;
+                                yxnum++;
+                                break;
+                            case 2:
+                                gfgznum++;
+                                gznum++;
+                                break;
+                            case 3:
+                                gflxnum++;
+                                lxnum++;
+                                break;
+                            case 4:
+                                gfwhnum++;
+                                whnum++;
+                                break;
+                            case 5:
+                                gfxdnum++;
+                                xdnum++;
+                                break;
+                            case 6:
+                                gfslnum++;
+                                slnum++;
+                                break;
+
+                            default:
+
+                                break;
                         }
+
+                        //待机台数
+                        jczbmap.put("djts", djnum);
+                        //运行台数
+                        jczbmap.put("yxts", yxnum);
+                        //故障台数
+                        jczbmap.put("gzts", gznum);
+                        //离线台数
+                        jczbmap.put("lxts", lxnum);
+                        //维护台数
+                        jczbmap.put("whts", whnum);
+                        //限电台数
+                        jczbmap.put("xdts", xdnum);
+                        //受累台数
+                        jczbmap.put("slts", slnum);
                         vo.setFjzt(fjzt);
                         vo.setFs(MathUtil.twoBit(fjzblist.get(i * step + 1).getPointValueInDouble()));
                         vo.setGl(MathUtil.twoBit(fjzblist.get(i * step + 2).getPointValueInDouble()));
@@ -305,36 +412,23 @@ public class MatrixPushService {
                 }
 
 
-
-                jczbmap.put("slts", 0.0);
-
-                double djts=(Double)jczbmap.get("djts");
-                double yxts=(Double)jczbmap.get("yxts");
-                double gzts=(Double)jczbmap.get("gzts");
-                double lxts=(Double)jczbmap.get("lxts");
-                double whts=(Double)jczbmap.get("whts");
-                double xdts=(Double)jczbmap.get("xdts");
-                jczbmap.put("jrts", Double.valueOf(slts)+djts+yxts+gzts+lxts+whts+xdts);
-                if (wp.getId().endsWith("FDC")) {
-                    fcslnum = fcslnum + slts;
-                } else {
-                    gfslnum = gfslnum + slts;
-                }
-
             }
             if(!vos.isEmpty())
             {
                 fjvos.add(vos);
             }
 
+
 /*************************************************风机指标统计*************************************************************/
 
         }
         //风场待机台数
         map.put("fczbmap", fczbmap);
+
         //风机指标对象
         map.put("fjmap", fjvos);
 
+
 /*******************************************风场、光伏状态数量统计***********************************************************/
 
         //风场待机台数

+ 15 - 4
web/monitor-hb/src/main/java/com/gyee/frame/service/websocket/MatrixQfPushService.java

@@ -13,6 +13,7 @@ import com.gyee.frame.service.ProjectPlanService;
 import com.gyee.frame.service.WindPowerstationTestingPoint2Service;
 import com.gyee.frame.service.WindTurbineTestingPointAiService;
 import com.gyee.frame.service.WindpowerinfodayService;
+import com.gyee.frame.service.photovolatic.PhotovoltaicTestingPointNewService;
 import com.gyee.frame.util.IRealTimeDataBaseUtil;
 import com.gyee.frame.util.MathUtil;
 import com.gyee.frame.util.RealTimeDataBaseFactory;
@@ -39,7 +40,8 @@ public class MatrixQfPushService {
     private ProjectPlanService projectPlanService;
     @Resource
     private WindTurbineTestingPointAiService windTurbineTestingPointAiService;
-
+    @Resource
+    private PhotovoltaicTestingPointNewService photovoltaicTestingPointNewService;
     private final String QS = "0";
     private final String FD = "-1";
     private final String GF = "-2";
@@ -221,11 +223,11 @@ public class MatrixQfPushService {
                 List<Inverter> wtls = InitialRunner.gp_nbqmap.get(wp.getId());
                 for (Inverter wt : wtls) {
                     //风机状态
-                    fjzbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wt.getId(), Constant.FJZT).getCode());
+                    fjzbls.add(photovoltaicTestingPointNewService.getPhotovoltaicTestingPointNew(wt.getId(), Constant.FJZT).getCode());
                     //风速
-                    fjzbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wt.getId(), Constant.TPOINT_WT_FJSSFS).getCode());
+                    fjzbls.add(photovoltaicTestingPointNewService.getPhotovoltaicTestingPointNew(wt.getId(), Constant.TPOINT_WT_FJSSFS).getCode());
                     //功率
-                    fjzbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wt.getId(), Constant.TPOINT_WT_FJGL).getCode());
+                    fjzbls.add(photovoltaicTestingPointNewService.getPhotovoltaicTestingPointNew(wt.getId(), Constant.TPOINT_WT_FJGL).getCode());
 
                 }
             }
@@ -267,6 +269,10 @@ public class MatrixQfPushService {
                                 double generatingcapacity = ml.getPowerproduction();
                                 BigDecimal temp = new BigDecimal(generatingcapacity).divide(new BigDecimal(100), 2, RoundingMode.HALF_UP);
                                 double lyl = new BigDecimal(gl).divide(temp, 2, RoundingMode.HALF_UP).doubleValue();
+                                if(lyl>100)
+                                {
+                                    lyl=100;
+                                }
                                 vo.setLyl(lyl);
                             } else {
                                 vo.setLyl(0.0);
@@ -284,6 +290,7 @@ public class MatrixQfPushService {
 
                         }
 
+
                         vo.setWpId(wt.getWindpowerstationid());
                         vos.add(vo);
                     }
@@ -316,6 +323,10 @@ public class MatrixQfPushService {
                                 double generatingcapacity = ml.getPowerproduction();
                                 BigDecimal temp = new BigDecimal(generatingcapacity).divide(new BigDecimal(100), 2, RoundingMode.HALF_UP);
                                 double lyl = new BigDecimal(gl).divide(temp, 2, RoundingMode.HALF_UP).doubleValue();
+                                if(lyl>100)
+                                {
+                                    lyl=100;
+                                }
                                 vo.setLyl(lyl);
                             } else {
                                 vo.setLyl(0.0);

+ 423 - 124
web/monitor-hb/src/main/java/com/gyee/frame/service/websocket/WtInfoPushService.java

@@ -5,9 +5,14 @@ import cn.hutool.core.date.DateUtil;
 import com.google.common.collect.Maps;
 import com.gyee.frame.common.spring.Constant;
 import com.gyee.frame.common.spring.InitialRunner;
+import com.gyee.frame.model.agc.AgcVo;
 import com.gyee.frame.model.auto.*;
+import com.gyee.frame.model.custom.InverterVo;
+import com.gyee.frame.model.custom.JunctionboxVo;
 import com.gyee.frame.model.custom.PointData;
 import com.gyee.frame.service.*;
+import com.gyee.frame.service.photovolatic.JunctionboxService;
+import com.gyee.frame.service.photovolatic.PhotovoltaicTestingPointNewService;
 import com.gyee.frame.util.*;
 import org.apache.commons.compress.utils.Lists;
 import org.springframework.stereotype.Service;
@@ -27,13 +32,17 @@ public class WtInfoPushService {
     private WindturbineinfodayService windturbineinfodayService;
     @Resource
     private WarningRecordsService warningRecordsService;
-
+    @Resource
+    private PhotovoltaicTestingPointNewService photovoltaicTestingPointNewService;
     @Resource
     private AlarmsnapService alarmsnapService;
+    @Resource
+    private JunctionboxService junctionboxService;
     IRealTimeDataBaseUtil realApiUtil = RealTimeDataBaseFactory.createRealTimeDataBase();
 
     String QS_FDC = "QS_FDC";
-
+    String JZ = "JZ";
+    String ZC="ZC";
     public Map<String, Object> genreSetMap() throws Exception {
 
         Map<String, Object> map = new HashMap<>();
@@ -107,7 +116,6 @@ public class WtInfoPushService {
                 zbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.RSZSSDL).getCode());// 日场内受累故障
                 zbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.RQFSSDL).getCode());// 日场外受累电网
                 zbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.RXDSSDL).getCode());// 日场外受累天气
-
                 zbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.TPOINT_WT_FJSSFS).getCode());// 风速
                 zbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.TPOINT_WT_FJGL).getCode());// 风机功率
                 zbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, Constant.TPOINT_WT_FDJZS).getCode());// 风机转数
@@ -557,28 +565,8 @@ public class WtInfoPushService {
                 msls=new ArrayList<>();
                 uids=new ArrayList<>();
 
-                if (wt.getWindpowerstationid().equals(QS_FDC)) {
-
-                    uids.add(Constant.TPOINT_WT_YPWZ1);
-                    uids.add(Constant.TPOINT_WT_YPWZ2);
-                    uids.add(Constant.TPOINT_WT_YPWZ3);
-                    uids.add(Constant.TPOINT_WT_FJSSFS);
-                    uids.add(Constant.TPOINT_WT_FJGL);
-                    uids.add(Constant.TPOINT_WT_GLYS);
-                    uids.add(Constant.QSTPOINT_WT_BJJD1);
-                    uids.add(Constant.TPOINT_WT_FJPL);
-                    uids.add(Constant.TPOINT_WT_WGGL);
-                    uids.add(Constant.TPOINT_WT_FJFX);
-                    uids.add(Constant.TPOINT_WT_YLZS);
-                    uids.add(Constant.TPOINT_WT_FDJZS);
-                    uids.add(Constant.TPOINT_WT_JCWWD);
-                    uids.add(Constant.TPOINT_WT_JCWD);
-                    uids.add(Constant.TPOINT_WT_TDGWD);
-                    uids.add(Constant.TPOINT_WT_JCGWD);
 
 
-                } else {
-
                     uids.add(Constant.TPOINT_WT_YPWZ1);
                     uids.add(Constant.TPOINT_WT_YPWZ2);
                     uids.add(Constant.TPOINT_WT_YPWZ3);
@@ -598,7 +586,7 @@ public class WtInfoPushService {
 
 
 
-                }
+
 
                 msls.add("YPWZ1");
                 msls.add("YPWZ2");
@@ -1001,6 +989,26 @@ public class WtInfoPushService {
 
 
     }
+
+
+    private void initialNbqpoint(String id, List<String> zbls, List<String> keyls, Map<String, Integer> bjnamemap,List<String> uids ,List<String> msls) {
+
+        if(msls.size()==uids.size())
+        {
+            for(int i=0;i<uids.size();i++)
+            {
+                PhotovoltaicTestingPointNew point= photovoltaicTestingPointNewService.getPhotovoltaicTestingPointNew(id, uids.get(i));
+                if(null!=point && null!=point.getCode())
+                {
+                    zbls.add(point.getCode());//
+                    keyls.add(msls.get(i));//
+                    bjnamemap.put(msls.get(i),zbls.size()-1);
+                }
+            }
+        }
+
+
+    }
 //    private void initialpoint(String id, List<String> zbls, List<String> keyls, Map<String, Integer> bjnamemap,List<String> uids) {
 //
 //        for(String uid:uids)
@@ -1049,24 +1057,15 @@ public class WtInfoPushService {
                     msls.add("FJGL");//有功功率
                     msls.add("YYYW");//液压油温
                     msls.add("PCS_WD");//PSC温度
-                    if (wt.getWindpowerstationid().equals(QS_FDC)) {
-                        uids.add(Constant.QSTPOINT_WT_U1YZWD);//U1绕组温度
-                        uids.add(Constant.QSTPOINT_WT_V1YZWD);//V1绕组温度
-                        uids.add(Constant.QSTPOINT_WT_W1YZWD);//W1绕组温度
-
-                        msls.add("U1YZWD");//U1绕组温度
-                        msls.add("V1YZWD");//V1绕组温度
-                        msls.add("W1YZWD");//W1绕组温度
-                    }else
-                    {
-                        uids.add(Constant.TPOINT_WT_U1YZWD);//U1绕组温度
-                        uids.add(Constant.TPOINT_WT_V1YZWD);//V1绕组温度
-                        uids.add(Constant.TPOINT_WT_W1YZWD);//W1绕组温度
 
-                        msls.add("U1YZWD");//U1绕组温度
-                        msls.add("V1YZWD");//V1绕组温度
-                        msls.add("W1YZWD");//W1绕组温度
-                    }
+                    uids.add(Constant.TPOINT_WT_U1YZWD);//U1绕组温度
+                    uids.add(Constant.TPOINT_WT_V1YZWD);//V1绕组温度
+                    uids.add(Constant.TPOINT_WT_W1YZWD);//W1绕组温度
+
+                    msls.add("U1YZWD");//U1绕组温度
+                    msls.add("V1YZWD");//V1绕组温度
+                    msls.add("W1YZWD");//W1绕组温度
+
                     uids.add(Constant.TPOINT_WT_U2YZWD);//U2绕组温度
                     uids.add(Constant.TPOINT_WT_V2YZWD);//V2绕组温度
                     uids.add(Constant.TPOINT_WT_W2YZWD);//W2绕组温度
@@ -1094,7 +1093,7 @@ public class WtInfoPushService {
 
 
                     initialpoint(id, zbls, keyls, namemap,uids,msls);
-/*******************************************************************************************************************************************************/
+
 
                     Map<String, Object> zbmap = new HashMap<>();
 
@@ -1107,7 +1106,7 @@ public class WtInfoPushService {
 
 
                     if (!zblist.isEmpty() && zblist.size() == zbls.size() && keyls.size() == zbls.size()) {
-/**************************************************************基础指标***********************************************************************************/
+
 
 
 
@@ -1122,7 +1121,6 @@ public class WtInfoPushService {
                         }
 
 
-/**************************************************************基础指标***********************************************************************************/
 
 
                     } else {
@@ -1139,8 +1137,98 @@ public class WtInfoPushService {
                     vos.add(zbmap);
 
                 }
-            }
+            }else if (InitialRunner.gp_nbqmap.containsKey(wpId)) {
 
+                List<Inverter> wtls=InitialRunner.gp_nbqmap.get(wpId);
+
+                for(Inverter wt:wtls)
+                {
+                    String id=wt.getId();
+
+
+                    List<String> msls = new ArrayList<>();
+                    List<String> zbls = new ArrayList<>();
+                    List<String> keyls = new ArrayList<>();
+                    List<String> uids = new ArrayList<>();
+                    Map<String, Integer> namemap = new HashMap<>();
+
+                    uids.add(Constant.TPOINT_NBQ_AB_DY);//电网AB线电压
+                    uids.add(Constant.TPOINT_NBQ_BC_DY);//电网BC线电压
+                    uids.add(Constant.TPOINT_NBQ_CA_DY);//电网CA线电压
+                    uids.add(Constant.TPOINT_NBQ_A_DL);//电网A相电流
+                    uids.add(Constant.TPOINT_NBQ_B_DL);//电网B相电流
+                    uids.add(Constant.TPOINT_NBQ_C_DL);//电网C相电流
+                    uids.add(Constant.TPOINT_NBQ_DWPL);//电网频率
+                    uids.add(Constant.TPOINT_NBQ_GL);//功率
+                    uids.add(Constant.TPOINT_NBQ_WGGL);//无功功率
+                    uids.add(Constant.TPOINT_NBQ_GLYS);//功率因数
+                    uids.add(Constant.TPOINT_NBQ_WD);//机内温度
+                    uids.add(Constant.TPOINT_NBQ_ZLDY);//直流电压
+                    uids.add(Constant.TPOINT_NBQ_ZLDL);//直流电流
+                    uids.add(Constant.TPOINT_NBQ_RFDL);//日发电量
+                    uids.add(Constant.TPOINT_NBQ_ZFDL);//总发电量
+                    uids.add(Constant.TPOINT_NBQ_RBWFZ);//日并网分钟
+                    uids.add(Constant.TPOINT_NBQ_ZYXSJ);//总运行时间
+
+
+                    msls.add("AB_DY");//电网AB线电压
+                    msls.add("BC_DY");//电网BC线电压
+                    msls.add("CA_DY");//电网CA线电压
+                    msls.add("A_DL");//电网A相电流
+                    msls.add("B_DL");//电网B相电流
+                    msls.add("C_DL");//电网C相电流
+                    msls.add("DWPL");//电网频率
+                    msls.add("YGGL");//功率
+                    msls.add("WGGL");//无功功率
+                    msls.add("GLYS");//功率因数
+                    msls.add("JNWD");//机内温度
+                    msls.add("ZLDY");// 直流电压
+                    msls.add("ZLDL");//直流电流
+                    msls.add("RFDL");//日发电量
+                    msls.add("ZFDL");//总发电量
+                    msls.add("RBWFZ");//日并网分钟
+                    msls.add("ZYXSJ");//总运行时间
+
+                    initialNbqpoint(id, zbls, keyls, namemap,uids,msls);
+
+
+                    Map<String, Object> zbmap = new HashMap<>();
+
+                    zbmap.put("model", wt.getModelid());
+                    zbmap.put("wpid", wt.getWindpowerstationid());
+                    zbmap.put("pjid", wt.getProjectid());
+                    zbmap.put("lnid", wt.getLineid());
+                    zbmap.put("code", wt.getCode());
+                    zbmap.put("wtid", wt.getId());
+                    List<PointData> zblist = realApiUtil.getRealData(zbls);
+
+
+                    if (!zblist.isEmpty() && zblist.size() == zbls.size() && keyls.size() == zbls.size()) {
+
+
+                        for(int i=0;i<keyls.size();i++)
+                        {
+                            if(namemap.containsKey(keyls.get(i)))
+                            {
+                                int num=namemap.get(keyls.get(i));
+                                zbmap.put(keyls.get(i), MathUtil.twoBit(zblist.get(num).getPointValueInDouble()));//
+                            }
+
+                        }
+
+                    }
+
+                    for(String str:msls)
+                    {
+                        if(!zbmap.containsKey(str))
+                        {
+                            zbmap.put(str,null);
+                        }
+                    }
+                    vos.add(zbmap);
+
+                }
+            }
 
 
         }
@@ -1148,64 +1236,266 @@ public class WtInfoPushService {
         return vos;
     }
 
-    public List<Map<String, Object>> findInverterInfoList(String wpId) throws Exception {
-        List<Map<String, Object>> vos = new ArrayList<>();
-        if (StringUtils.notEmp(wpId) && InitialRunner.wp_wtmap.containsKey(wpId)) {
-            List<Windturbine> wtls = InitialRunner.wp_wtmap.get(wpId);
-            for (Windturbine wt : wtls) {
-                Map<String, Object> map = new HashMap<String, Object>();
-                map.put("model", wt.getModelid());
-                map.put("wpid", wt.getWindpowerstationid());
-                map.put("pjid", wt.getProjectid());
-                map.put("lnid", wt.getLineid());
-                map.put("code", wt.getCode());
-                map.put("wtId", wt.getId());
+    public List<JunctionboxVo> findInverterInfoList(String wpId) throws Exception {
+        List<JunctionboxVo> vos=new ArrayList<>();
+        if (StringUtils.notEmp(wpId) && InitialRunner.gp_nbqmap.containsKey(wpId)) {
+            List<Inverter> wtls = InitialRunner.gp_nbqmap.get(wpId);
+            for (Inverter wt : wtls) {
 
-                Line ln = InitialRunner.lnmap.get(wt.getLineid());
-                map.put("lnname", ln.getName());
-                List<String> zbls = new ArrayList<>();
+                if(StringUtils.notEmp(wt.getSquareid()) && InitialRunner.sqmap.containsKey(wt.getSquareid()))
+                {
+                    Square square=InitialRunner.sqmap.get(wt.getSquareid());
 
-                String[] codeName[] = {
-                        { "JSSSFS", "光照强度"},
-                        { "AI130", "有功功率"},
-                        { "AI067", "功率因数"},
-                        { "AIG071", "机内温度"},
-                        { "AIG072", "逆变效率" },
-                        { "AI130", "功率"},
-                        { "AI067", "功率因数" },
-                        { "RFDL", "日发电量" },
-                        { "YFDL", "月发电量" },
-                        { "NFDL", "年发电量" },
-                        { "AIG064", "累计发电量" }
-                };
-                // 遍历定义码,获取测点Id集合
-                Map<String, String> pointUniformMap = Maps.newHashMap();
-                for (String[] str1 : codeName) {
-                    String pointid = windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wt.getId(), str1[0]).getCode();
-                    zbls.add(pointid);
-                    pointUniformMap.put(pointid, str1[0]);
+                    if(square.getTypes().equals(ZC))
+                    {
+                        continue;
+                    }
                 }
-                // 获取测点值,与定义码绑定
-                List<PointData> zblist = realApiUtil.getRealData(zbls);
-//				Map<String, Object> uniformValueMap = Maps.newHashMap();
-//				uniformValueMap.put("定义码对照", codeName);
-                for (PointData p : zblist) {
-                    String ednaId = p.getEdnaId();
-                    Double val = MathUtil.twoBit(p.getPointValueInDouble());
-                    String uniformCode = pointUniformMap.get(ednaId);
-                    map.put(uniformCode, val);
+
+                List<Junctionbox> jbls=junctionboxService.selectByInverterId(wt.getId());
+
+                if(!jbls.isEmpty())
+                {
+                    List<String> pointcodes=new ArrayList<>();
+                    for(Junctionbox jb:jbls)
+                    {
+                        String[] strs=Constant.TPOINT_Inverter_Junctionbox;
+                        for(int i=0;i<strs.length;i++)
+                        {
+                            PhotovoltaicTestingPointNew pt=photovoltaicTestingPointNewService.getPhotovoltaicTestingPointNew(jb.getId(),strs[i]);
+                            if(StringUtils.notEmp(pt) && StringUtils.notEmp(pt.getCode()))
+                            {
+                                pointcodes.add(pt.getCode());
+                            }
+                        }
+
+                        List<PointData> ptlist = realApiUtil.getRealData(pointcodes);
+
+                        if(!ptlist.isEmpty() && ptlist.size()==pointcodes.size())
+                        {
+                            JunctionboxVo vo=new JunctionboxVo();
+                            vo.setId(jb.getId());
+                            vo.setName(jb.getName());
+                            vo.setZdy(StringUtils.round(ptlist.get(0).getPointValueInDouble(),2));
+                            vo.setDl1(StringUtils.round(ptlist.get(1).getPointValueInDouble(),2));
+                            vo.setDl2(StringUtils.round(ptlist.get(2).getPointValueInDouble(),2));
+                            vo.setDl3(StringUtils.round(ptlist.get(3).getPointValueInDouble(),2));
+                            vo.setDl4(StringUtils.round(ptlist.get(4).getPointValueInDouble(),2));
+                            vo.setDl5(StringUtils.round(ptlist.get(5).getPointValueInDouble(),2));
+                            vo.setDl6(StringUtils.round(ptlist.get(6).getPointValueInDouble(),2));
+                            vo.setDl7(StringUtils.round(ptlist.get(7).getPointValueInDouble(),2));
+                            vo.setDl8(StringUtils.round(ptlist.get(8).getPointValueInDouble(),2));
+                            vo.setDl9(StringUtils.round(ptlist.get(9).getPointValueInDouble(),2));
+                            vo.setDl10(StringUtils.round(ptlist.get(10).getPointValueInDouble(),2));
+                            vo.setDl11(StringUtils.round(ptlist.get(11).getPointValueInDouble(),2));
+                            vo.setDl12(StringUtils.round(ptlist.get(12).getPointValueInDouble(),2));
+                            vo.setDl13(StringUtils.round(ptlist.get(13).getPointValueInDouble(),2));
+                            vo.setDl14(StringUtils.round(ptlist.get(14).getPointValueInDouble(),2));
+                            vo.setDl15(StringUtils.round(ptlist.get(15).getPointValueInDouble(),2));
+                            vo.setDl16(StringUtils.round(ptlist.get(16).getPointValueInDouble(),2));
+                            vos.add(vo);
+                        }
+
+                    }
+
+
                 }
-                vos.add(map);
+
             }
         }
         return vos;
     }
 
+
+
+    public Map<String,List<InverterVo>> findMatrixByWpId(String wpId) throws Exception {
+        Map<String,List<InverterVo>> map=new HashMap<>();
+
+
+        List<InverterVo> vos=new ArrayList<>();
+        if (StringUtils.notEmp(wpId) && InitialRunner.gp_nbqmap.containsKey(wpId)) {
+            List<Inverter> wtls = InitialRunner.gp_nbqmap.get(wpId);
+            for (Inverter wt : wtls) {
+                double gl=0.0;
+                double fdl=0.0;
+                int zt=0;
+
+                List<String> pointcodes=new ArrayList<>();
+
+                String[] strs=Constant.TPOINT_Inverter_Matrix;
+                for(int i=0;i<strs.length;i++)
+                {
+                    PhotovoltaicTestingPointNew pt=photovoltaicTestingPointNewService.getPhotovoltaicTestingPointNew(wt.getId(),strs[i]);
+                    if(StringUtils.notEmp(pt) && StringUtils.notEmp(pt.getCode()))
+                    {
+                        pointcodes.add(pt.getCode());
+                    }
+                }
+
+                List<PointData> ptlist = realApiUtil.getRealData(pointcodes);
+
+                if(!ptlist.isEmpty() && ptlist.size()==pointcodes.size())
+                {
+                    zt=Double.valueOf(ptlist.get(0).getPointValueInDouble()).intValue();
+                    gl=StringUtils.round(ptlist.get(1).getPointValueInDouble(),2);
+                    fdl=StringUtils.round(ptlist.get(2).getPointValueInDouble(),2);
+                }
+                if (StringUtils.notEmp(wt.getSquareid()) && InitialRunner.sqmap.containsKey(wt.getSquareid())) {
+                    Square square = InitialRunner.sqmap.get(wt.getSquareid());
+
+                    if (square.getTypes().equals(ZC)) {
+
+                        if(map.containsKey(square.getId()))
+                        {
+                            List<InverterVo> ls=map.get(square.getId());;
+                            InverterVo vo=new InverterVo();
+                            vo.setId(wt.getId());
+                            vo.setName(wt.getName());
+                            vo.setFdl(fdl);
+                            vo.setGl(gl);
+                            vo.setZt(zt);
+                            vo.setSqname(square.getName());
+                            ls.add(vo);
+                            map.put(square.getId(),ls);
+                        }else
+                        {
+                            List<InverterVo> ls=new ArrayList<>();
+                            InverterVo vo=new InverterVo();
+                            vo.setId(wt.getId());
+                            vo.setName(wt.getName());
+                            vo.setFdl(fdl);
+                            vo.setGl(gl);
+                            vo.setZt(zt);
+                            vo.setSqname(square.getName());
+                            ls.add(vo);
+                            map.put(square.getId(),ls);
+
+                        }
+                    }else
+                    {
+                        InverterVo vo=new InverterVo();
+                        vo.setId(wt.getId());
+                        vo.setName(wt.getName());
+                        vo.setFdl(fdl);
+                        vo.setGl(gl);
+                        vo.setZt(zt);
+                        vo.setSqname(square.getName());
+                        vos.add(vo);
+                    }
+                }
+
+            }
+        }
+
+        map.put(JZ,vos);
+
+        return map;
+    }
+
+
+
+    public Map<String,Map<String,List<InverterVo>>> findMatrix() throws Exception {
+
+        Map<String,Map<String,List<InverterVo>>> matrixmap=new HashMap<>();
+
+
+        List<Windpowerstation> wpls=InitialRunner.wpallls;
+
+        if(!wpls.isEmpty())
+        {
+            for(Windpowerstation wp:wpls)
+            {
+                String wpId=wp.getId();
+                Map<String,List<InverterVo>> map=new HashMap<>();
+
+                List<InverterVo> vos=new ArrayList<>();
+                if (StringUtils.notEmp(wpId) && InitialRunner.gp_nbqmap.containsKey(wpId)) {
+                    List<Inverter> wtls = InitialRunner.gp_nbqmap.get(wpId);
+                    for (Inverter wt : wtls) {
+                        double gl=0.0;
+                        double fdl=0.0;
+                        int zt=0;
+
+                        List<String> pointcodes=new ArrayList<>();
+
+                        String[] strs=Constant.TPOINT_Inverter_Matrix;
+                        for(int i=0;i<strs.length;i++)
+                        {
+                            PhotovoltaicTestingPointNew pt=photovoltaicTestingPointNewService.getPhotovoltaicTestingPointNew(wt.getId(),strs[i]);
+                            if(StringUtils.notEmp(pt) && StringUtils.notEmp(pt.getCode()))
+                            {
+                                pointcodes.add(pt.getCode());
+                            }
+                        }
+
+                        List<PointData> ptlist = realApiUtil.getRealData(pointcodes);
+
+                        if(!ptlist.isEmpty() && ptlist.size()==pointcodes.size())
+                        {
+                            zt=Double.valueOf(ptlist.get(0).getPointValueInDouble()).intValue();
+                            gl=StringUtils.round(ptlist.get(1).getPointValueInDouble(),2);
+                            fdl=StringUtils.round(ptlist.get(2).getPointValueInDouble(),2);
+                        }
+                        if (StringUtils.notEmp(wt.getSquareid()) && InitialRunner.sqmap.containsKey(wt.getSquareid())) {
+                            Square square = InitialRunner.sqmap.get(wt.getSquareid());
+
+                            if (square.getTypes().equals(ZC)) {
+
+                                if(map.containsKey(square.getId()))
+                                {
+                                    List<InverterVo> ls=map.get(square.getId());;
+                                    InverterVo vo=new InverterVo();
+                                    vo.setId(wt.getId());
+                                    vo.setName(wt.getName());
+                                    vo.setFdl(fdl);
+                                    vo.setGl(gl);
+                                    vo.setSqname(square.getName());
+                                    vo.setZt(zt);
+                                    ls.add(vo);
+                                    map.put(square.getId(),ls);
+                                }else
+                                {
+                                    List<InverterVo> ls=new ArrayList<>();
+                                    InverterVo vo=new InverterVo();
+                                    vo.setId(wt.getId());
+                                    vo.setName(wt.getName());
+                                    vo.setFdl(fdl);
+                                    vo.setGl(gl);
+                                    vo.setZt(zt);
+                                    vo.setSqname(square.getName());
+                                    ls.add(vo);
+                                    map.put(square.getId(),ls);
+
+                                }
+                            }else
+                            {
+                                InverterVo vo=new InverterVo();
+                                vo.setId(wt.getId());
+                                vo.setName(wt.getName());
+                                vo.setSqname(square.getName());
+                                vo.setFdl(fdl);
+                                vo.setGl(gl);
+                                vo.setZt(zt);
+                                vos.add(vo);
+                            }
+                        }
+
+                    }
+                    map.put(JZ,vos);
+                }
+
+                matrixmap.put(wpId,map);
+            }
+
+        }
+
+        return matrixmap;
+    }
     public Object findInverterDI(String id) throws Exception {
-        List<Windturbinetestingpointnew> pointList = windTurbineTestingPointDiService.getWindTurbineTestingPointDi2List(id);
+        List<PhotovoltaicTestingPointNew> pointList = photovoltaicTestingPointNewService.getPhotovoltaicTestingPointNewDiList(id);
         Map<String, String> idName = Maps.newHashMap();
         List<String> pointids = Lists.newArrayList();
-        for (Windturbinetestingpointnew point : pointList) {
+        for (PhotovoltaicTestingPointNew point : pointList) {
             idName.put(point.getCode(), point.getName());
             pointids.add(point.getCode());
         }
@@ -1228,30 +1518,37 @@ public class WtInfoPushService {
         return map;
     }
 
-    public List<Object> findInverterPowerCurve(String id) throws Exception {
-        List<Object> list = Lists.newArrayList();
-        Date now = new Date();
-        Date date = DateUtil.beginOfDay(now);
-        String pointid = windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, "AI130").getCode();
-        while (date.before(now)) {
-            Date begin = DateUtils.addMinutes(date, -30);
-            List<PointData> histStat = realApiUtil.getHistStat(pointid, begin.getTime() / 1000, date.getTime() / 1000, 1L, 30L * 60, 0);
-            Double val = 0D;
-            if (histStat != null && !histStat.isEmpty() && histStat.get(0) != null) {
-                val = histStat.get(0).getPointValueInDouble();
-                val = MathUtil.twoBit(val);
-            }
-            list.add(val);
-            date = DateUtils.addMinutes(date, 30);
+    public List<AgcVo> findInverterPowerCurve(String id) throws Exception {
+
+        Map<String,Object> map =new HashMap<>();
+        Date endDate = new Date();
+        Date beginDate = DateUtil.beginOfDay(endDate);
+
+        int length=DateUtils.hoursDiff(beginDate,endDate)*2;
+
+        List<AgcVo> vos = new ArrayList<>();
+        for (int i = 0; i < length; i++) {
+            AgcVo vo = new AgcVo();
+            vo.setSjgl(0.0);
+            vos.add(vo);
+        }
+        String pointid = photovoltaicTestingPointNewService.getPhotovoltaicTestingPointNew(id, Constant.TPOINT_NBQ_GL).getCode();
+        List<PointData> sjglls = realApiUtil.getHistoryDatasSnap(pointid, beginDate.getTime() / 1000,
+                endDate.getTime() / 1000, (long) length, 1800L);
+        double temp = 0;
+        for (int i = 0; i < vos.size(); i++) {
+            temp = sjglls.get(i).getPointValueInDouble();
+            vos.get(i).setTime(sjglls.get(i).getPointTime()*1000);
+            vos.get(i).setSjgl(StringUtils.round(temp, 2));// 实际功率
         }
-        return list;
+        return vos;
     }
 
     public List<Object> findInverterInfo(String id) throws Exception {
         Map<String, Object> map = new HashMap<String, Object>();
         if (StringUtils.notEmp(id)) {
-            if (InitialRunner.wtmap.containsKey(id)) {
-                Windturbine wt = InitialRunner.wtmap.get(id);
+            if (InitialRunner.nbqmap.containsKey(id)) {
+                Inverter wt = InitialRunner.nbqmap.get(id);
                 map.put("model", wt.getModelid());
                 map.put("wpid", wt.getWindpowerstationid());
                 map.put("pjid", wt.getProjectid());
@@ -1260,26 +1557,28 @@ public class WtInfoPushService {
                 Line ln = InitialRunner.lnmap.get(wt.getLineid());
                 map.put("lnname", ln.getName());
                 List<String> zbls = new ArrayList<>();
+
+
                 String[] codeName[] = {
-                        {"AIG061", "交流电压","V"},
-                        {"AIG081", "直流电压","V"},
-                        {"AIG060", "交流电流","A"},
-                        {"AIG078", "直流电流","A"},
-                        {"AI068", "电网频率","Hz"},
-                        {"AI130", "功率","W"},
-                        {"AI067", "功率因数",""},
-                        {"RFDL", "日发电量","kwh"},//TODO 疑似 各厂发电量单位不統一
-                        {"YFDL", "月发电量","kwh"},
-                        {"NFDL", "年发电量","kwh"},
-                        {"AIG064", "累计发电量","kwh"},
-                        {"AIG071", "逆变器温度","℃"},
-                        {"AIG072", "效率",""},
-                        {"AI962", "累计二氧化碳减排量","kg"}
+                        {Constant.TPOINT_NBQ_JLDY, "交流电压","V"},
+                        {Constant.TPOINT_NBQ_ZLDY, "直流电压","V"},
+                        {Constant.TPOINT_NBQ_JLDL, "交流电流","A"},
+                        {Constant.TPOINT_NBQ_ZLDL, "直流电流","A"},
+                        {Constant.TPOINT_NBQ_DWPL, "电网频率","Hz"},
+                        {Constant.TPOINT_NBQ_GL, "功率","W"},
+                        {Constant.TPOINT_NBQ_GLYS, "功率因数",""},
+                        {Constant.TPOINT_NBQ_RFDL, "日发电量","kwh"},//TODO 疑似 各厂发电量单位不統一
+                        {Constant.TPOINT_NBQ_YFDL, "月发电量","kwh"},
+                        {Constant.TPOINT_NBQ_NFDL, "年发电量","kwh"},
+                        {Constant.TPOINT_NBQ_ZFDL, "累计发电量","kwh"},
+                        {Constant.TPOINT_NBQ_WD, "逆变器温度","℃"},
+                        {Constant.TPOINT_NBQ_XL, "效率",""},
+                        {Constant.TPOINT_NBQ_EYHT, "累计二氧化碳减排量","kg"}
                 };
                 // 遍历定义码,获取测点Id集合
                 Map<String, String> pointUniformMap = Maps.newHashMap();
                 for (String[] str1 : codeName) {
-                    String pointid = windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(id, str1[0]).getCode();
+                    String pointid = photovoltaicTestingPointNewService.getPhotovoltaicTestingPointNew(id, str1[0]).getCode();
                     zbls.add(pointid);
                     pointUniformMap.put(pointid, str1[0]);
                 }

+ 22 - 7
web/monitor-web-sxjn/src/main/java/com/gyee/frame/common/spring/Constant.java

@@ -592,21 +592,32 @@ public static final String TPOINT_WT_60FX = "AI011";// 风机60秒风向
 
     /*************************************************************************/
 
-    public static final String TPOINT_NBQ_JLDY = "AIG023";// 交流电压
-    public static final String TPOINT_NBQ_ZLDY = "AIG025";// 直流电压
-    public static final String TPOINT_NBQ_JLDL = "AIG024";// 交流电流
-    public static final String TPOINT_NBQ_ZLDL = "AIG026";// 直流电流
+    public static final String TPOINT_NBQ_AB_DY = "AIG003";// 电网AB线电压
+    public static final String TPOINT_NBQ_BC_DY = "AIG004";// 电网BC线电压
+    public static final String TPOINT_NBQ_CA_DY = "AIG005";// 1电网CA线电压
+    public static final String TPOINT_NBQ_A_DL = "AIG009";// 电网A相电流
+    public static final String TPOINT_NBQ_B_DL = "AIG010";//电网B相电流
+    public static final String TPOINT_NBQ_C_DL = "AIG011";//电网C相电流
     public static final String TPOINT_NBQ_DWPL = "AIG012";// 电网频率
     public static final String TPOINT_NBQ_GL = "AIG013";// 功率
+    public static final String TPOINT_NBQ_WGGL = "AIG014";// 功率
     public static final String TPOINT_NBQ_GLYS = "AIG015";// 功率因数
+    public static final String TPOINT_NBQ_WD = "AIG017";// 机内温度
+    public static final String TPOINT_NBQ_XL = "AIG018";// 效率
+    public static final String TPOINT_NBQ_EYHT = "AIG022";// 累计二氧化碳减排量
+    public static final String TPOINT_NBQ_JLDY = "AIG023";// 交流电压
+    public static final String TPOINT_NBQ_JLDL = "AIG024";// 交流电流
+    public static final String TPOINT_NBQ_ZLDY = "AIG025";// 直流电压
+    public static final String TPOINT_NBQ_ZLDL = "AIG026";// 直流电流
     public static final String TPOINT_NBQ_RFDL = "AIG027";// 日发电量
     public static final String TPOINT_NBQ_YFDL = "AIG028";// 月发电量
     public static final String TPOINT_NBQ_NFDL = "AIG029";// 年发电量
     public static final String TPOINT_NBQ_ZFDL = "AIG030";// 总发电量
+    public static final String TPOINT_NBQ_RBWFZ = "AIG034";// 日并网分钟
+    public static final String TPOINT_NBQ_ZYXSJ = "AIG035";// 总运行时间
+
+
 
-    public static final String TPOINT_NBQ_WD = "AIG017";// 机内温度
-    public static final String TPOINT_NBQ_XL = "AIG018";// 效率
-    public static final String TPOINT_NBQ_EYHT = "AIG022";// 累计二氧化碳减排量
 
     //汇流箱测点
     public static final String[] TPOINT_Inverter_Junctionbox = { "AIG051", "AIG052",
@@ -614,4 +625,8 @@ public static final String TPOINT_WT_60FX = "AI011";// 风机60秒风向
             "AIG060", "AIG061", "AIG062", "AIG063", "AIG064", "AIG065", "AIG066",
             "AIG067"};
 
+    //逆变器矩阵测点
+    public static final String[] TPOINT_Inverter_Matrix = { "FJZT", "AIG013",
+            "AIG027"};
+
 }

+ 66 - 0
web/monitor-web-sxjn/src/main/java/com/gyee/frame/controller/monitor/GenreSetPushController.java

@@ -44,6 +44,11 @@ public class GenreSetPushController {
     @Resource
     private ForecastwindspeedService forecastwindspeedService;
 
+    private final String QY = "QY";
+    private final String QS = "0";
+    private final String FD = "-1";
+    private final String GF = "-2";
+
     @GetMapping("/getAgcValues")
     @ResponseBody
     @ApiOperation(value = "获取AGC信息", notes = "获取AGC信息")
@@ -74,6 +79,11 @@ public class GenreSetPushController {
 
         if(StringUtils.notEmp(id))
         {
+            if (id.equals(QS) || id.equals(FD) || id.equals(GF)) {
+
+                id=QY+id;
+            }
+
             map=genreSetPushService.findBasicDataInfo(id);
         }
 
@@ -97,6 +107,10 @@ public class GenreSetPushController {
 
         if(StringUtils.notEmp(id))
         {
+            if (id.equals(QS) || id.equals(FD) || id.equals(GF)) {
+
+                id=QY+id;
+            }
             map=genreSetPushService.findBasicDataInfo_fcmap(id);
         }
 
@@ -119,6 +133,10 @@ public class GenreSetPushController {
 
         if(StringUtils.notEmp(id))
         {
+            if (id.equals(QS) || id.equals(FD) || id.equals(GF)) {
+
+                id=QY+id;
+            }
             map=genreSetPushService.findBasicDataInfo_mxztmap(id);
         }
 
@@ -141,6 +159,10 @@ public class GenreSetPushController {
 
         if(StringUtils.notEmp(id))
         {
+            if (id.equals(QS) || id.equals(FD) || id.equals(GF)) {
+
+                id=QY+id;
+            }
             map=genreSetPushService.findBasicDataInfo_jczbmap(id);
         }
 
@@ -163,6 +185,10 @@ public class GenreSetPushController {
 
         if(StringUtils.notEmp(id))
         {
+            if (id.equals(QS) || id.equals(FD) || id.equals(GF)) {
+
+                id=QY+id;
+            }
             map=genreSetPushService.findBasicDataInfo_tqmap_xtmap(id);
         }
 
@@ -185,6 +211,10 @@ public class GenreSetPushController {
 
         if(StringUtils.notEmp(id))
         {
+            if (id.equals(QS) || id.equals(FD) || id.equals(GF)) {
+
+                id=QY+id;
+            }
             map=genreSetPushService.findBasicDataInfo_wxssmap(id);
         }
 
@@ -206,6 +236,10 @@ public class GenreSetPushController {
 
         if(StringUtils.notEmp(id))
         {
+            if (id.equals(QS) || id.equals(FD) || id.equals(GF)) {
+
+                id=QY+id;
+            }
             map=genreSetPushService.findBasicDataInfo_gxkmap(id);
         }
 
@@ -227,6 +261,10 @@ public class GenreSetPushController {
 
         if(StringUtils.notEmp(id))
         {
+            if (id.equals(QS) || id.equals(FD) || id.equals(GF)) {
+
+                id=QY+id;
+            }
             map=genreSetPushService.findPowerInfo(id);
         }
 
@@ -251,6 +289,10 @@ public class GenreSetPushController {
         Map<String, Object> map = new HashMap<String, Object>();
 
         if (StringUtils.notEmp(id) && StringUtils.notEmp(targetName) ) {
+            if (id.equals(QS) || id.equals(FD) || id.equals(GF)) {
+
+                id=QY+id;
+            }
             if (InitialRunner.wpmap.containsKey(id)) {
 
                 map = genreSetPushDetailWpService.findDayInfo(id, targetName);
@@ -288,6 +330,11 @@ public class GenreSetPushController {
         Map<String, Object> map = new HashMap<String, Object>();
 
         if (StringUtils.notEmp(id) && StringUtils.notEmp(targetName) ) {
+
+            if (id.equals(QS) || id.equals(FD) || id.equals(GF)) {
+
+                id=QY+id;
+            }
             if (InitialRunner.wpmap.containsKey(id)) {
 
                 map = genreSetPushDetailWpService.findMonthInfo(id, targetName);
@@ -324,6 +371,10 @@ public class GenreSetPushController {
         Map<String, Object> map = new HashMap<String, Object>();
 
         if (StringUtils.notEmp(id) && StringUtils.notEmp(targetName) ) {
+            if (id.equals(QS) || id.equals(FD) || id.equals(GF)) {
+
+                id=QY+id;
+            }
             if (InitialRunner.wpmap.containsKey(id)) {
 
                 map = genreSetPushDetailWpService.findYearInfo(id, targetName);
@@ -360,6 +411,11 @@ public class GenreSetPushController {
 
         List<DataVo> vos = new ArrayList<DataVo>();
         if (StringUtils.notEmp(id)  ) {
+
+            if (id.equals(QS) || id.equals(FD) || id.equals(GF)) {
+
+                id=QY+id;
+            }
             if (InitialRunner.wpmap.containsKey(id)) {
 
                 vos = genreSetPushDetailWpService.findProjectPlanPower(id);
@@ -394,7 +450,10 @@ public class GenreSetPushController {
 
     public AjaxResult findGLDetail(String id, String targetName) throws Exception {
 
+        if (id.equals(QS) || id.equals(FD) || id.equals(GF)) {
 
+            id=QY+id;
+        }
         List<Object> vos = new ArrayList<Object>();
         //       Map<String, List> vos = new HashMap<String, List>();
 
@@ -441,7 +500,10 @@ public class GenreSetPushController {
 
     public AjaxResult getWeatherRealDay5Info(String wpId) throws Exception {
 
+        if (wpId.equals(QS) || wpId.equals(FD) || wpId.equals(GF)) {
 
+            wpId=QY+wpId;
+        }
         Map<String,Object> retValue = new HashMap<String, Object>();
         if (StringUtils.notEmp(wpId) ) {
             retValue = genreSetPushService.getWeatherRealDay5Info(wpId);
@@ -463,6 +525,10 @@ public class GenreSetPushController {
 
     public AjaxResult getForecastwindspeedInfo(String wpId) throws Exception {
 
+        if (wpId.equals(QS) || wpId.equals(FD) || wpId.equals(GF)) {
+
+            wpId=QY+wpId;
+        }
         Map<String,Object> map=new HashMap<>();
         List<DataVo> retValue = new ArrayList<>();
         List<String> datels=new ArrayList<>();

+ 43 - 3
web/monitor-web-sxjn/src/main/java/com/gyee/frame/controller/monitor/MonitorInverterPushController.java

@@ -4,7 +4,10 @@ import com.google.common.collect.Maps;
 import com.gyee.frame.common.conf.AjaxStatus;
 import com.gyee.frame.common.domain.AjaxResult;
 import com.gyee.frame.common.spring.InitialRunner;
+import com.gyee.frame.model.agc.AgcVo;
+import com.gyee.frame.model.auto.Inverter;
 import com.gyee.frame.model.auto.Windturbine;
+import com.gyee.frame.model.custom.InverterVo;
 import com.gyee.frame.model.custom.JunctionboxVo;
 import com.gyee.frame.service.websocket.WtInfoPushService;
 import com.gyee.frame.service.websocket.WtWarnPushService;
@@ -39,11 +42,23 @@ public class MonitorInverterPushController {
 	public AjaxResult findWtInfo(String wtId) throws Exception {
 		List<Object> listAI = wtInfoPushService.findInverterInfo(wtId);
 		Object listDI = wtInfoPushService.findInverterDI(wtId);
-		Windturbine wt = InitialRunner.wtmap.get(wtId);
+
+
+
 		Map<String, Object> map = Maps.newHashMap();
 		map.put("listAI", listAI);
 		map.put("listDI", listDI);
-		map.put("info",wt);
+
+        if(InitialRunner.wtmap.containsKey(wtId))
+        {
+            Windturbine wt = InitialRunner.wtmap.get(wtId);
+            map.put("info",wt);
+        }else if(InitialRunner.nbqmap.containsKey(wtId))
+        {
+            Inverter wt = InitialRunner.nbqmap.get(wtId);
+            map.put("info",wt);
+        }
+
 		return AjaxResult.successData(AjaxStatus.success.code, map);
 	}
 
@@ -68,7 +83,32 @@ public class MonitorInverterPushController {
 	@ApiOperation(value = "逆变器开网频率", notes = "逆变器当日0点至今功率,间隔30分钟")
 	@ApiImplicitParams({ @ApiImplicitParam(name = "wtId", value = "逆变器ID", required = true, dataType = "string", paramType = "query") })
 	public AjaxResult findInverterPowerLine(String wtId) throws Exception {
-		List<Object> list = wtInfoPushService.findInverterPowerCurve(wtId);
+		List<AgcVo> list = wtInfoPushService.findInverterPowerCurve(wtId);
 		return AjaxResult.successData(AjaxStatus.success.code, list);
 	}
+
+    @GetMapping("/findMatrixByWpId")
+    @ResponseBody
+    @ApiOperation(value = "场站逆变器矩阵", notes = "场站逆变器矩阵")
+    @ApiImplicitParams({ @ApiImplicitParam(name = "wpId", value = "场站编号", required = true, dataType = "string", paramType = "query") })
+    public AjaxResult findMatrixByWpId(String wpId) throws Exception {
+
+        Map<String,List<InverterVo>> map = wtInfoPushService.findMatrixByWpId(wpId);
+
+        return AjaxResult.successData(AjaxStatus.success.code, map);
+    }
+
+
+    @GetMapping("/findMatrix")
+    @ResponseBody
+    @ApiOperation(value = "逆变器矩阵", notes = "逆变器矩阵")
+    @ApiImplicitParams({ })
+    public AjaxResult findMatrix() throws Exception {
+
+
+        Map<String,Map<String,List<InverterVo>>>  map = wtInfoPushService.findMatrix();
+
+        return AjaxResult.successData(AjaxStatus.success.code, map);
+    }
+
 }

+ 66 - 0
web/monitor-web-sxjn/src/main/java/com/gyee/frame/model/custom/InverterVo.java

@@ -0,0 +1,66 @@
+
+package com.gyee.frame.model.custom;
+
+
+
+public class InverterVo {
+
+    private Integer zt;
+    private Double fdl;
+
+    private Double gl;
+
+    private String id;
+
+    private String name;
+
+    private String sqname;
+
+    public String getSqname() {
+        return sqname;
+    }
+
+    public void setSqname(String sqname) {
+        this.sqname = sqname;
+    }
+
+    public Integer getZt() {
+        return zt;
+    }
+
+    public void setZt(Integer zt) {
+        this.zt = zt;
+    }
+
+    public Double getFdl() {
+        return fdl;
+    }
+
+    public void setFdl(Double fdl) {
+        this.fdl = fdl;
+    }
+
+    public Double getGl() {
+        return gl;
+    }
+
+    public void setGl(Double gl) {
+        this.gl = gl;
+    }
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+}

+ 1 - 1
web/monitor-web-sxjn/src/main/java/com/gyee/frame/service/WindPowerstationTestingPoint2Service.java

@@ -144,7 +144,7 @@ public class WindPowerstationTestingPoint2Service implements BaseService<Windpow
 
 		if(StringUtils.notEmp(wpId) && StringUtils.notEmp(unicode) )
 		{
-			if(wpId.equals("0") || wpId.equals("-1") ||wpId.equals("-2") || InitialRunner.wpmap.containsKey(wpId))
+			if(wpId.endsWith("0") || wpId.endsWith("-1") ||wpId.endsWith("-2") || InitialRunner.wpmap.containsKey(wpId))
 			{
 				if(InitialRunner.wpPointmap.containsKey(wpId))
 				{

+ 4 - 1
web/monitor-web-sxjn/src/main/java/com/gyee/frame/service/initialpoint/InitialPointGoldenService.java

@@ -1148,7 +1148,10 @@ public class InitialPointGoldenService implements  IinitialPoint{
         for (Windpowerstation wp:InitialRunner.wpls)
         {
 
-
+            if(!wp.getId().equals("DJY_FDC"))
+            {
+                continue;
+            }
             List<Windturbine> wtls=InitialRunner.wp_wtmap.get(wp.getId());
 
 

+ 4 - 4
web/monitor-web-sxjn/src/main/java/com/gyee/frame/service/photovolatic/PhotovoltaicTestingPointNewService.java

@@ -105,7 +105,7 @@ public class PhotovoltaicTestingPointNewService implements BaseService<Photovolt
 
     public PhotovoltaicTestingPointNew getPhotovoltaicTestingPointNew(String wtId, String unicode)  {
 
-        PhotovoltaicTestingPointNew point=null;
+        PhotovoltaicTestingPointNew point=new PhotovoltaicTestingPointNew();
         if(StringUtils.notEmp(wtId) && StringUtils.notEmp(unicode) )
         {
             if(InitialRunner.phPointmap.containsKey(wtId))
@@ -131,10 +131,10 @@ public class PhotovoltaicTestingPointNewService implements BaseService<Photovolt
         {
             PhotovoltaicTestingPointNewExample example=new PhotovoltaicTestingPointNewExample();
             example.setOrderByClause("id ASC");
-            example.isDistinct();
-            PhotovoltaicTestingPointNewExample.Criteria criteria =example.createCriteria();
+              PhotovoltaicTestingPointNewExample.Criteria criteria =example.createCriteria();
             criteria.andWindturbineidEqualTo(wtId);
-            criteria.andUniformcodeLike("DI");
+            criteria.andUniformcodeLike("%DI%");
+            criteria.andCodeNotEqualTo("INITIAL");
             list= photovoltaicTestingPointNewMapper.selectByExample(example);
 
         }

+ 11 - 1
web/monitor-web-sxjn/src/main/java/com/gyee/frame/service/websocket/AgcService.java

@@ -126,6 +126,12 @@ public class AgcService {
                             }
 
                         }
+                    }else
+                    {
+                        for (int i = 0; i < agcPoints.length; i++) {
+
+                            resultmap.put( agcPoints[i],0.0);
+                        }
                     }
                     objmap.put(sub.getId(),resultmap);
                 }
@@ -176,6 +182,8 @@ public class AgcService {
                     List<AgcVo> vos = new ArrayList<>();
                     for (int i = 0; i < length; i++) {
                         AgcVo vo = new AgcVo();
+                        vo.setSjgl(0.0);
+                        vo.setXdzl(0.0);
                         vo.setTime(cal2.getTime().getTime());
                         cal2.add(Calendar.MINUTE, 30);
                         vos.add(vo);
@@ -228,8 +236,10 @@ public class AgcService {
 
                         }
 
-                        resultmap.put(sub.getId(), vos);
+
                     }
+
+                    resultmap.put(sub.getId(), vos);
                 }
 
             }

+ 5 - 5
web/monitor-web-sxjn/src/main/java/com/gyee/frame/service/websocket/GenreSetPushService.java

@@ -101,9 +101,9 @@ public class GenreSetPushService {
 
             Map<String, Object> fcmap = new HashMap<>();
 
-            if (id.equals(QS) || id.equals(FD) || id.equals(GF) || InitialRunner.re_wpmap.containsKey(id)) {
-
+            if (id.endsWith(QS) || id.endsWith(FD) || id.endsWith(GF) || InitialRunner.re_wpmap.containsKey(id)) {
 
+             
                 //初始化场站信息
 
                 List<Windpowerstation> wplist = new ArrayList<>();
@@ -321,7 +321,7 @@ public class GenreSetPushService {
 
             Map<String, Double> mxztmap = new HashMap<>();
 
-            if (id.equals(QS) || id.equals(FD) || id.equals(GF) || InitialRunner.re_wpmap.containsKey(id)) {
+            if (id.endsWith(QS) || id.endsWith(FD) || id.endsWith(GF) || InitialRunner.re_wpmap.containsKey(id)) {
 
                 //初始化场站信息
 
@@ -1606,7 +1606,7 @@ public class GenreSetPushService {
 
             Map<String, Object> fcmap = new HashMap<>();
 
-            if (id.equals(QS) || id.equals(FD) || id.equals(GF) || InitialRunner.re_wpmap.containsKey(id)) {
+            if (id.endsWith(QS) || id.endsWith(FD) || id.endsWith(GF) || InitialRunner.re_wpmap.containsKey(id)) {
 
 
                 //初始化场站信息
@@ -2060,7 +2060,7 @@ public class GenreSetPushService {
 
             Map<String, Double> mxztmap = new HashMap<>();
 
-            if (id.equals(QS) || id.equals(FD) || id.equals(GF) || InitialRunner.re_wpmap.containsKey(id)) {
+            if (id.endsWith(QS) || id.endsWith(FD) || id.endsWith(GF) || InitialRunner.re_wpmap.containsKey(id)) {
 
                 //初始化场站信息
 

+ 100 - 89
web/monitor-web-sxjn/src/main/java/com/gyee/frame/service/websocket/MatrixDetialGfPushService.java

@@ -3,14 +3,15 @@ package com.gyee.frame.service.websocket;
 
 import com.gyee.frame.common.spring.Constant;
 import com.gyee.frame.common.spring.InitialRunner;
+import com.gyee.frame.model.auto.Inverter;
 import com.gyee.frame.model.auto.Windpowerstation;
-import com.gyee.frame.model.auto.Windturbine;
 import com.gyee.frame.model.custom.MatrixVo;
 import com.gyee.frame.model.custom.PointData;
 import com.gyee.frame.service.ProjectPlanService;
 import com.gyee.frame.service.WindPowerstationTestingPoint2Service;
 import com.gyee.frame.service.WindTurbineTestingPointAiService;
 import com.gyee.frame.service.WindpowerinfodayService;
+import com.gyee.frame.service.photovolatic.PhotovoltaicTestingPointNewService;
 import com.gyee.frame.util.IRealTimeDataBaseUtil;
 import com.gyee.frame.util.MathUtil;
 import com.gyee.frame.util.RealTimeDataBaseFactory;
@@ -37,7 +38,8 @@ public class MatrixDetialGfPushService {
     private ProjectPlanService projectPlanService;
     @Resource
     private WindTurbineTestingPointAiService windTurbineTestingPointAiService;
-
+    @Resource
+    private PhotovoltaicTestingPointNewService photovoltaicTestingPointNewService;
 
 
     IRealTimeDataBaseUtil realApiUtil = RealTimeDataBaseFactory.createRealTimeDataBase();
@@ -152,118 +154,127 @@ public class MatrixDetialGfPushService {
 /*************************************************风机指标统计*************************************************************/
             List<String> fjzbls = new ArrayList<>();
 
-            List<Windturbine> wtls=InitialRunner.wp_wtmap.get(wp.getId());
-
-            List<MatrixVo> vos = new ArrayList<>();
 
-            for(Windturbine wt:wtls)
+            if(InitialRunner.gp_nbqmap.containsKey(wp.getId()))
             {
-                //状态
-                fjzbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wt.getId(), Constant.FJZT).getCode());
-                //交流电流
-                fjzbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wt.getId(), Constant.TPOINT_WT_NBQJLDL).getCode());
-                //功率
-                fjzbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wt.getId(), Constant.TPOINT_WT_FJGL).getCode());
-                //交流电压
-                fjzbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wt.getId(), Constant.TPOINT_WT_NBQJLDY).getCode());
-            }
+                List<Inverter> wtls=InitialRunner.gp_nbqmap.get(wp.getId());
 
-            List<PointData> fjzblist = realApiUtil.getRealData(fjzbls);
+                List<MatrixVo> vos = new ArrayList<>();
 
-            if (!fjzblist.isEmpty() && fjzblist.size() == fjzbls.size()) {
+                if(!wtls.isEmpty())
+                {
+                    for(Inverter wt:wtls)
+                    {
+                        //状态
+                        fjzbls.add(photovoltaicTestingPointNewService.getPhotovoltaicTestingPointNew(wt.getId(), Constant.FJZT).getCode());
+                        //交流电流
+                        fjzbls.add(photovoltaicTestingPointNewService.getPhotovoltaicTestingPointNew(wt.getId(), Constant.TPOINT_WT_NBQJLDL).getCode());
+                        //功率
+                        fjzbls.add(photovoltaicTestingPointNewService.getPhotovoltaicTestingPointNew(wt.getId(), Constant.TPOINT_WT_FJGL).getCode());
+                        //交流电压
+                        fjzbls.add(photovoltaicTestingPointNewService.getPhotovoltaicTestingPointNew(wt.getId(), Constant.TPOINT_WT_NBQJLDY).getCode());
+                    }
 
+                    List<PointData> fjzblist = realApiUtil.getRealData(fjzbls);
 
-                int step=4;
+                    if (!fjzblist.isEmpty() && fjzblist.size() == fjzbls.size()) {
 
 
-                double djts=0.0;
-                double yxts=0.0;
-                double gzts=0.0;
-                double lxts=0.0;
-                double whts=0.0;
-                double xdts=0.0;
-                double slts=0.0;
-                for(int i=0;i<wtls.size();i++)
-                {
-                    Windturbine wt=wtls.get(i);
+                        int step=4;
 
-                    MatrixVo vo=new MatrixVo();
-                    vo.setWtId(wt.getId());
 
-                    if(StringUtils.notEmp(wt.getStatus()))
-                    {
-                        String num=wt.getStatus().substring(wt.getStatus().length()-3);
-                        vo.setWtnum(num);
+                        double djts=0.0;
+                        double yxts=0.0;
+                        double gzts=0.0;
+                        double lxts=0.0;
+                        double whts=0.0;
+                        double xdts=0.0;
+                        double slts=0.0;
+                        for(int i=0;i<wtls.size();i++)
+                        {
+                            Inverter wt=wtls.get(i);
 
-                    }
+                            MatrixVo vo=new MatrixVo();
+                            vo.setWtId(wt.getId());
 
-                    double fjzt = MathUtil.twoBit(MathUtil.twoBit(fjzblist.get(i*step).getPointValueInDouble()));
-
-                    switch (Double.valueOf(fjzt).intValue()) {
-                        case 0:
-                            djts++;
-                            break;
-                        case 1:
-                            yxts++;
-                            break;
-                        case 2:
-                            gzts++;
-                            break;
-                        case 3:
-                            lxts++;
-                            break;
-                        case 4:
-                            whts++;
-                            break;
-                        case 5:
-                            xdts++;
-                            break;
-                        case 6:
-                            xdts++;
-                            break;
-
-                        default:
-
-                            break;
-                    }
-                    vo.setFjzt(fjzt);
-                    vo.setFs(MathUtil.twoBit(fjzblist.get(i*step+1).getPointValueInDouble()));
-                    vo.setGl(MathUtil.twoBit(fjzblist.get(i*step+2).getPointValueInDouble()));
-                    vo.setFdl(MathUtil.twoBit(fjzblist.get(i*step+3).getPointValueInDouble()));
-                    vo.setWtCode(wt.getCode());
-                    vo.setWpId(wt.getWindpowerstationid());
-                    vos.add(vo);
+                            if(StringUtils.notEmp(wt.getId()))
+                            {
+                                String num=wt.getId().substring(wt.getId().indexOf("_")+1);
+                                vo.setWtnum(num);
 
-                }
+                            }
+
+                            double fjzt = MathUtil.twoBit(MathUtil.twoBit(fjzblist.get(i*step).getPointValueInDouble()));
+
+                            switch (Double.valueOf(fjzt).intValue()) {
+                                case 0:
+                                    djts++;
+                                    break;
+                                case 1:
+                                    yxts++;
+                                    break;
+                                case 2:
+                                    gzts++;
+                                    break;
+                                case 3:
+                                    lxts++;
+                                    break;
+                                case 4:
+                                    whts++;
+                                    break;
+                                case 5:
+                                    xdts++;
+                                    break;
+                                case 6:
+                                    xdts++;
+                                    break;
+
+                                default:
+
+                                    break;
+                            }
+                            vo.setFjzt(fjzt);
+                            vo.setFs(MathUtil.twoBit(fjzblist.get(i*step+1).getPointValueInDouble()));
+                            vo.setGl(MathUtil.twoBit(fjzblist.get(i*step+2).getPointValueInDouble()));
+                            vo.setFdl(MathUtil.twoBit(fjzblist.get(i*step+3).getPointValueInDouble()));
+                            vo.setWtCode(wt.getCode());
+                            vo.setWpId(wt.getWindpowerstationid());
+                            vos.add(vo);
 
+                        }
 
 
 
 
-                jczbmap.put("djts", djts);
-                jczbmap.put("yxts", yxts);
-                jczbmap.put("gzts", gzts);
-                jczbmap.put("lxts", lxts);
-                jczbmap.put("whts", whts);
-                jczbmap.put("xdts", xdts);
-                jczbmap.put("slts", slts);
 
-                jczbmap.put("jrts",djts+yxts+gzts+lxts+whts+xdts+slts);
+                        jczbmap.put("djts", djts);
+                        jczbmap.put("yxts", yxts);
+                        jczbmap.put("gzts", gzts);
+                        jczbmap.put("lxts", lxts);
+                        jczbmap.put("whts", whts);
+                        jczbmap.put("xdts", xdts);
+                        jczbmap.put("slts", slts);
 
-                fczbmap.put(wp.getId(),jczbmap);
+                        jczbmap.put("jrts",djts+yxts+gzts+lxts+whts+xdts+slts);
 
-                gfdjts = gfdjts + Double.valueOf(djts).intValue();
-                gfyxts = gfyxts + Double.valueOf(yxts).intValue();
-                gfgzts = gfgzts + Double.valueOf(gzts).intValue();
-                gflxts = gflxts + Double.valueOf(lxts).intValue();
-                gfwhts = gfwhts + Double.valueOf(whts).intValue();
-                gfxdts = gfxdts + Double.valueOf(xdts).intValue();
-                gfslts = gfslts + Double.valueOf(slts).intValue();
+                        fczbmap.put(wp.getId(),jczbmap);
 
+                        gfdjts = gfdjts + Double.valueOf(djts).intValue();
+                        gfyxts = gfyxts + Double.valueOf(yxts).intValue();
+                        gfgzts = gfgzts + Double.valueOf(gzts).intValue();
+                        gflxts = gflxts + Double.valueOf(lxts).intValue();
+                        gfwhts = gfwhts + Double.valueOf(whts).intValue();
+                        gfxdts = gfxdts + Double.valueOf(xdts).intValue();
+                        gfslts = gfslts + Double.valueOf(slts).intValue();
 
+
+                    }
+
+                    fjvos.add(vos);
+
+                }
             }
 
-            fjvos.add(vos);
 
 /*************************************************风机指标统计*************************************************************/
 

+ 7 - 5
web/monitor-web-sxjn/src/main/java/com/gyee/frame/service/websocket/MatrixDetialPushService.java

@@ -13,6 +13,7 @@ import com.gyee.frame.service.ProjectPlanService;
 import com.gyee.frame.service.WindPowerstationTestingPoint2Service;
 import com.gyee.frame.service.WindTurbineTestingPointAiService;
 import com.gyee.frame.service.WindpowerinfodayService;
+import com.gyee.frame.service.photovolatic.PhotovoltaicTestingPointNewService;
 import com.gyee.frame.util.IRealTimeDataBaseUtil;
 import com.gyee.frame.util.MathUtil;
 import com.gyee.frame.util.RealTimeDataBaseFactory;
@@ -38,7 +39,8 @@ public class MatrixDetialPushService {
     private ProjectPlanService projectPlanService;
     @Resource
     private WindTurbineTestingPointAiService windTurbineTestingPointAiService;
-
+    @Resource
+    private PhotovoltaicTestingPointNewService photovoltaicTestingPointNewService;
 
     IRealTimeDataBaseUtil realApiUtil = RealTimeDataBaseFactory.createRealTimeDataBase();
 
@@ -327,13 +329,13 @@ public class MatrixDetialPushService {
                 List<Inverter> wtls = InitialRunner.gp_nbqmap.get(wp.getId());
                 for (Inverter wt : wtls) {
                     //风机状态
-                    fjzbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wt.getId(), Constant.ZTMX).getCode());
+                    fjzbls.add(photovoltaicTestingPointNewService.getPhotovoltaicTestingPointNew(wt.getId(), Constant.ZTMX).getCode());
                     //风速
-                    fjzbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wt.getId(), Constant.TPOINT_WT_FJSSFS).getCode());
+                    fjzbls.add(photovoltaicTestingPointNewService.getPhotovoltaicTestingPointNew(wt.getId(), Constant.TPOINT_WT_FJSSFS).getCode());
                     //功率
-                    fjzbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wt.getId(), Constant.TPOINT_WT_FJGL).getCode());
+                    fjzbls.add(photovoltaicTestingPointNewService.getPhotovoltaicTestingPointNew(wt.getId(), Constant.TPOINT_WT_FJGL).getCode());
 
-                    fjzbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wt.getId(), Constant.TPOINT_WT_FDJZS).getCode());
+                    fjzbls.add(photovoltaicTestingPointNewService.getPhotovoltaicTestingPointNew(wt.getId(), Constant.TPOINT_WT_FDJZS).getCode());
 
                 }
             }

+ 108 - 47
web/monitor-web-sxjn/src/main/java/com/gyee/frame/service/websocket/MatrixPushByWpService.java

@@ -9,6 +9,7 @@ import com.gyee.frame.model.custom.MatrixVo;
 import com.gyee.frame.model.custom.PointData;
 import com.gyee.frame.model.custom.SimpleVo;
 import com.gyee.frame.service.*;
+import com.gyee.frame.service.photovolatic.PhotovoltaicTestingPointNewService;
 import com.gyee.frame.util.IRealTimeDataBaseUtil;
 import com.gyee.frame.util.MathUtil;
 import com.gyee.frame.util.RealTimeDataBaseFactory;
@@ -39,7 +40,8 @@ public class MatrixPushByWpService {
     IRealTimeDataBaseUtil realApiUtil = RealTimeDataBaseFactory.createRealTimeDataBase();
     @Resource
     private WindturbinestandardpointService windturbinestandardpointService;
-
+    @Resource
+    private PhotovoltaicTestingPointNewService photovoltaicTestingPointNewService;
     public Map<String, Object> findMatrixById(String wpId) throws Exception {
         Map<String, Object> map =new HashMap<>();
         if(StringUtils.notEmp(wpId))
@@ -245,78 +247,137 @@ public class MatrixPushByWpService {
 /*************************************************风机指标统计*************************************************************/
                 List<String> fjzbls = new ArrayList<>();
 
-                List<Windturbine> wtls=InitialRunner.wp_wtmap.get(wpId);
-
-               // Map<String, MatrixVo> vomap = new HashMap<>();
                 List<MatrixVo> vos = new ArrayList<>();
-                for(Windturbine wt:wtls)
+
+
+                if(wp.getId().endsWith("FDC") && InitialRunner.wp_wtmap.containsKey(wp.getId()))
                 {
-                    //风机状态
-                    fjzbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wt.getId(), Constant.FJZT).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<Windturbine> wtls = InitialRunner.wp_wtmap.get(wp.getId());
 
-                }
+                    for (Windturbine wt : wtls) {
+                        //风机状态
+                        fjzbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wt.getId(), Constant.FJZT).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());
+
+
+                    }
+                }else   if(wp.getId().endsWith("GDC") && InitialRunner.gp_nbqmap.containsKey(wp.getId()))
+                {
+                    List<Inverter> wtls = InitialRunner.gp_nbqmap.get(wp.getId());
+
+                    for (Inverter wt : wtls) {
+                        //风机状态
+                        fjzbls.add(photovoltaicTestingPointNewService.getPhotovoltaicTestingPointNew(wt.getId(), Constant.FJZT).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_NBQ_RFDL).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++)
+
+                    if(wp.getId().endsWith("FDC") && InitialRunner.wp_wtmap.containsKey(wp.getId()))
                     {
-                        Windturbine wt=wtls.get(i);
+                        List<Windturbine> wtls = InitialRunner.wp_wtmap.get(wp.getId());
+                        for (int i = 0; i < wtls.size(); i++) {
+                            Windturbine wt=wtls.get(i);
 
-                        MatrixVo vo=new MatrixVo();
-                        vo.setWtId(wt.getId());
+                            MatrixVo vo=new MatrixVo();
+                            vo.setWtId(wt.getId());
 
-                        if(StringUtils.notEmp(wt.getStatus()))
-                        {
-                            String num=wt.getStatus().substring(wt.getStatus().length()-3);
-                            vo.setWtnum(num);
+                            if(StringUtils.notEmp(wt.getId()))
+                            {
+                                String num = wt.getId().substring(wt.getId().indexOf("_")+1);
+                                vo.setWtnum(num);
 
-                        }
+                            }
 
-                        vo.setWpId(wt.getWindpowerstationid());
-                        double fjzt = MathUtil.twoBit(fjzblist.get(i * step).getPointValueInDouble());
-                        vo.setFjzt(fjzt);
-                        vo.setFs(MathUtil.twoBit(fjzblist.get(i*step+1).getPointValueInDouble()));
-                        double gl = MathUtil.twoBit(fjzblist.get(i * step + 2).getPointValueInDouble());
-                        vo.setGl(gl);
-                        vo.setFdjzs(MathUtil.twoBit(fjzblist.get(i*step+3).getPointValueInDouble()));
-                        vo.setWtCode(wt.getCode());
+                            vo.setWpId(wt.getWindpowerstationid());
+                            double fjzt = MathUtil.twoBit(fjzblist.get(i * step).getPointValueInDouble());
+                            vo.setFjzt(fjzt);
+                            vo.setFs(MathUtil.twoBit(fjzblist.get(i*step+1).getPointValueInDouble()));
+                            double gl = MathUtil.twoBit(fjzblist.get(i * step + 2).getPointValueInDouble());
+                            vo.setGl(gl);
+                            vo.setFdjzs(MathUtil.twoBit(fjzblist.get(i*step+3).getPointValueInDouble()));
+                            vo.setWtCode(wt.getCode());
 
-                        if (fjzt == 3) {
-                            vo.setLyl(0.0);
-                        } else {
-                            if (InitialRunner.mlmap.containsKey(wt.getModelid())) {
-                                Equipmentmodel ml = InitialRunner.mlmap.get(wt.getModelid());
-                                double generatingcapacity = ml.getPowerproduction();
-                                BigDecimal temp = new BigDecimal(generatingcapacity).divide(new BigDecimal(100), 2, RoundingMode.HALF_UP);
-                                double lyl = new BigDecimal(gl).divide(temp, 2, RoundingMode.HALF_UP).doubleValue();
-                                vo.setLyl(lyl);
-                            } else {
+                            if (fjzt == 3) {
                                 vo.setLyl(0.0);
+                            } else {
+                                if (InitialRunner.mlmap.containsKey(wt.getModelid())) {
+                                    Equipmentmodel ml = InitialRunner.mlmap.get(wt.getModelid());
+                                    double generatingcapacity = ml.getPowerproduction();
+                                    BigDecimal temp = new BigDecimal(generatingcapacity).divide(new BigDecimal(100), 2, RoundingMode.HALF_UP);
+                                    double lyl = new BigDecimal(gl).divide(temp, 2, RoundingMode.HALF_UP).doubleValue();
+                                    vo.setLyl(lyl);
+                                } else {
+                                    vo.setLyl(0.0);
+                                }
                             }
+
+                            vos.add(vo);
                         }
-                        //vomap.put(wt.getId(),vo);
-                        vos.add(vo);
+                    }else  if(wp.getId().endsWith("GDC") && InitialRunner.gp_nbqmap.containsKey(wp.getId()))
+                    {
+                        List<Inverter> wtls = InitialRunner.gp_nbqmap.get(wp.getId());
+                        for (int i = 0; i < wtls.size(); i++) {
+                            Inverter wt = wtls.get(i);
+
+                            MatrixVo vo=new MatrixVo();
+                            vo.setWtId(wt.getId());
 
+                            if(StringUtils.notEmp(wt.getId()))
+                            {
+                                String num = wt.getId().substring(wt.getId().indexOf("_")+1);
+                                vo.setWtnum(num);
+
+                            }
+
+                            vo.setWpId(wt.getWindpowerstationid());
+                            double fjzt = MathUtil.twoBit(fjzblist.get(i * step).getPointValueInDouble());
+                            vo.setFjzt(fjzt);
+                            vo.setFs(MathUtil.twoBit(fjzblist.get(i*step+1).getPointValueInDouble()));
+                            double gl = MathUtil.twoBit(fjzblist.get(i * step + 2).getPointValueInDouble());
+                            vo.setGl(gl);
+                            vo.setFdjzs(MathUtil.twoBit(fjzblist.get(i*step+3).getPointValueInDouble()));
+                            vo.setWtCode(wt.getCode());
+
+                            if (fjzt == 3) {
+                                vo.setLyl(0.0);
+                            } else {
+                                if (InitialRunner.mlmap.containsKey(wt.getModelid())) {
+                                    Equipmentmodel ml = InitialRunner.mlmap.get(wt.getModelid());
+                                    double generatingcapacity = ml.getPowerproduction();
+                                    BigDecimal temp = new BigDecimal(generatingcapacity).divide(new BigDecimal(100), 2, RoundingMode.HALF_UP);
+                                    double lyl = new BigDecimal(gl).divide(temp, 2, RoundingMode.HALF_UP).doubleValue();
+                                    vo.setLyl(lyl);
+                                } else {
+                                    vo.setLyl(0.0);
+                                }
+                            }
+
+                            vos.add(vo);
+                        }
                     }
 
                 }
-                //fjmap.put(wpId,vomap);
+
                 fjvos.add(vos);
 /*************************************************风机指标统计*************************************************************/
 
-
-
-
             }
 
             //风场指标MAP

+ 130 - 42
web/monitor-web-sxjn/src/main/java/com/gyee/frame/service/websocket/MatrixPushService.java

@@ -12,6 +12,7 @@ import com.gyee.frame.service.ProjectPlanService;
 import com.gyee.frame.service.WindPowerstationTestingPoint2Service;
 import com.gyee.frame.service.WindTurbineTestingPointAiService;
 import com.gyee.frame.service.WindpowerinfodayService;
+import com.gyee.frame.service.photovolatic.PhotovoltaicTestingPointNewService;
 import com.gyee.frame.util.IRealTimeDataBaseUtil;
 import com.gyee.frame.util.MathUtil;
 import com.gyee.frame.util.RealTimeDataBaseFactory;
@@ -39,7 +40,8 @@ public class MatrixPushService {
     @Resource
     private WindTurbineTestingPointAiService windTurbineTestingPointAiService;
 
-
+    @Resource
+    private PhotovoltaicTestingPointNewService photovoltaicTestingPointNewService;
     IRealTimeDataBaseUtil realApiUtil = RealTimeDataBaseFactory.createRealTimeDataBase();
 
 
@@ -156,23 +158,23 @@ public class MatrixPushService {
                 Double xdts = MathUtil.twoBit(jczblist.get(12).getPointValueInDouble());
                 jczbmap.put("xdts", xdts);
 
-                if (wp.getId().endsWith("FDC")) {
-                    fcdjnum = fcdjnum + djts.intValue();
-                    fcyxnum = fcyxnum + yxts.intValue();
-                    fcgznum = fcgznum + gzts.intValue();
-                    fclxnum = fclxnum + lxts.intValue();
-                    fcwhnum = fcwhnum + whts.intValue();
-                    fcxdnum = fcxdnum + xdts.intValue();
-
-                } else if (wp.getId().endsWith("GDC")) {
-
-                    gfdjnum = gfdjnum + djts.intValue();
-                    gfyxnum = gfyxnum + yxts.intValue();
-                    gfgznum = gfgznum + gzts.intValue();
-                    gflxnum = gflxnum + lxts.intValue();
-                    gfwhnum = gfwhnum + whts.intValue();
-                    gfxdnum = gfxdnum + xdts.intValue();
-                }
+//                if (wp.getId().endsWith("FDC")) {
+//                    fcdjnum = fcdjnum + djts.intValue();
+//                    fcyxnum = fcyxnum + yxts.intValue();
+//                    fcgznum = fcgznum + gzts.intValue();
+//                    fclxnum = fclxnum + lxts.intValue();
+//                    fcwhnum = fcwhnum + whts.intValue();
+//                    fcxdnum = fcxdnum + xdts.intValue();
+//
+//                } else if (wp.getId().endsWith("GDC")) {
+//
+//                    gfdjnum = gfdjnum + djts.intValue();
+//                    gfyxnum = gfyxnum + yxts.intValue();
+//                    gfgznum = gfgznum + gzts.intValue();
+//                    gflxnum = gflxnum + lxts.intValue();
+//                    gfwhnum = gfwhnum + whts.intValue();
+//                    gfxdnum = gfxdnum + xdts.intValue();
+//                }
 
             } else {
                 //实时风速
@@ -232,11 +234,11 @@ public class MatrixPushService {
                 List<Inverter> wtls = InitialRunner.gp_nbqmap.get(wp.getId());
                 for (Inverter wt : wtls) {
                     //风机状态
-                    fjzbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wt.getId(), Constant.FJZT).getCode());
+                    fjzbls.add(photovoltaicTestingPointNewService.getPhotovoltaicTestingPointNew(wt.getId(), Constant.FJZT).getCode());
                     //风速
-                    fjzbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wt.getId(), Constant.TPOINT_WT_FJSSFS).getCode());
+                    fjzbls.add(photovoltaicTestingPointNewService.getPhotovoltaicTestingPointNew(wt.getId(), Constant.TPOINT_WT_FJSSFS).getCode());
                     //功率
-                    fjzbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wt.getId(), Constant.TPOINT_WT_FJGL).getCode());
+                    fjzbls.add(photovoltaicTestingPointNewService.getPhotovoltaicTestingPointNew(wt.getId(), Constant.TPOINT_WT_FJGL).getCode());
 
                 }
             }
@@ -248,9 +250,17 @@ public class MatrixPushService {
 
 
                 int step = 3;
-                int slts = 0;
+                int djnum = 0;
+                int yxnum = 0;
+                int gznum = 0;
+                int lxnum = 0;
+                int whnum = 0;
+                int xdnum = 0;
+                int slnum = 0;
                 if(wp.getId().endsWith("FDC") && InitialRunner.wp_wtmap.containsKey(wp.getId()))
                 {
+
+
                     List<Windturbine> wtls = InitialRunner.wp_wtmap.get(wp.getId());
                     for (int i = 0; i < wtls.size(); i++) {
                         Windturbine wt = wtls.get(i);
@@ -266,9 +276,57 @@ public class MatrixPushService {
 
 
                         double fjzt = MathUtil.twoBit(fjzblist.get(i * step).getPointValueInDouble());
-                        if (fjzt == 6) {
-                            slts++;
+
+
+                        switch (Double.valueOf(fjzt).intValue()) {
+                            case 0:
+                                fcdjnum++;
+                                djnum++;
+                                break;
+                            case 1:
+                                fcyxnum++;
+                                yxnum++;
+                                break;
+                            case 2:
+                                fcgznum++;
+                                gznum++;
+
+                                break;
+                            case 3:
+                                fclxnum++;
+                                lxnum++;
+                                break;
+                            case 4:
+                                fcwhnum++;
+                                whnum++;
+                                break;
+                            case 5:
+                                fcxdnum++;
+                                xdnum++;
+                                break;
+                            case 6:
+                                fcslnum++;
+                                slnum++;
+                                break;
+
+                            default:
+
+                                break;
                         }
+                        //待机台数
+                        jczbmap.put("djts", djnum);
+                        //运行台数
+                        jczbmap.put("yxts", yxnum);
+                        //故障台数
+                        jczbmap.put("gzts", gznum);
+                        //离线台数
+                        jczbmap.put("lxts", lxnum);
+                        //维护台数
+                        jczbmap.put("whts", whnum);
+                        //限电台数
+                        jczbmap.put("xdts", xdnum);
+                        //受累台数
+                        jczbmap.put("slts", slnum);
                         vo.setFjzt(fjzt);
                         vo.setFs(MathUtil.twoBit(fjzblist.get(i * step + 1).getPointValueInDouble()));
                         vo.setGl(MathUtil.twoBit(fjzblist.get(i * step + 2).getPointValueInDouble()));
@@ -294,9 +352,55 @@ public class MatrixPushService {
 
 
                         double fjzt = MathUtil.twoBit(fjzblist.get(i * step).getPointValueInDouble());
-                        if (fjzt == 6) {
-                            slts++;
+                        switch (Double.valueOf(fjzt).intValue()) {
+                            case 0:
+                                gfdjnum++;
+                                djnum++;
+                                break;
+                            case 1:
+                                gfyxnum++;
+                                yxnum++;
+                                break;
+                            case 2:
+                                gfgznum++;
+                                gznum++;
+                                break;
+                            case 3:
+                                gflxnum++;
+                                lxnum++;
+                                break;
+                            case 4:
+                                gfwhnum++;
+                                whnum++;
+                                break;
+                            case 5:
+                                gfxdnum++;
+                                xdnum++;
+                                break;
+                            case 6:
+                                gfslnum++;
+                                slnum++;
+                                break;
+
+                            default:
+
+                                break;
                         }
+
+                        //待机台数
+                        jczbmap.put("djts", djnum);
+                        //运行台数
+                        jczbmap.put("yxts", yxnum);
+                        //故障台数
+                        jczbmap.put("gzts", gznum);
+                        //离线台数
+                        jczbmap.put("lxts", lxnum);
+                        //维护台数
+                        jczbmap.put("whts", whnum);
+                        //限电台数
+                        jczbmap.put("xdts", xdnum);
+                        //受累台数
+                        jczbmap.put("slts", slnum);
                         vo.setFjzt(fjzt);
                         vo.setFs(MathUtil.twoBit(fjzblist.get(i * step + 1).getPointValueInDouble()));
                         vo.setGl(MathUtil.twoBit(fjzblist.get(i * step + 2).getPointValueInDouble()));
@@ -308,22 +412,6 @@ public class MatrixPushService {
                 }
 
 
-
-                jczbmap.put("slts", 0.0);
-
-                double djts=(Double)jczbmap.get("djts");
-                double yxts=(Double)jczbmap.get("yxts");
-                double gzts=(Double)jczbmap.get("gzts");
-                double lxts=(Double)jczbmap.get("lxts");
-                double whts=(Double)jczbmap.get("whts");
-                double xdts=(Double)jczbmap.get("xdts");
-                jczbmap.put("jrts", Double.valueOf(slts)+djts+yxts+gzts+lxts+whts+xdts);
-                if (wp.getId().endsWith("FDC")) {
-                    fcslnum = fcslnum + slts;
-                } else {
-                    gfslnum = gfslnum + slts;
-                }
-
             }
             if(!vos.isEmpty())
             {

+ 15 - 4
web/monitor-web-sxjn/src/main/java/com/gyee/frame/service/websocket/MatrixQfPushService.java

@@ -13,6 +13,7 @@ import com.gyee.frame.service.ProjectPlanService;
 import com.gyee.frame.service.WindPowerstationTestingPoint2Service;
 import com.gyee.frame.service.WindTurbineTestingPointAiService;
 import com.gyee.frame.service.WindpowerinfodayService;
+import com.gyee.frame.service.photovolatic.PhotovoltaicTestingPointNewService;
 import com.gyee.frame.util.IRealTimeDataBaseUtil;
 import com.gyee.frame.util.MathUtil;
 import com.gyee.frame.util.RealTimeDataBaseFactory;
@@ -39,7 +40,8 @@ public class MatrixQfPushService {
     private ProjectPlanService projectPlanService;
     @Resource
     private WindTurbineTestingPointAiService windTurbineTestingPointAiService;
-
+    @Resource
+    private PhotovoltaicTestingPointNewService photovoltaicTestingPointNewService;
     private final String QS = "0";
     private final String FD = "-1";
     private final String GF = "-2";
@@ -221,11 +223,11 @@ public class MatrixQfPushService {
                 List<Inverter> wtls = InitialRunner.gp_nbqmap.get(wp.getId());
                 for (Inverter wt : wtls) {
                     //风机状态
-                    fjzbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wt.getId(), Constant.FJZT).getCode());
+                    fjzbls.add(photovoltaicTestingPointNewService.getPhotovoltaicTestingPointNew(wt.getId(), Constant.FJZT).getCode());
                     //风速
-                    fjzbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wt.getId(), Constant.TPOINT_WT_FJSSFS).getCode());
+                    fjzbls.add(photovoltaicTestingPointNewService.getPhotovoltaicTestingPointNew(wt.getId(), Constant.TPOINT_WT_FJSSFS).getCode());
                     //功率
-                    fjzbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wt.getId(), Constant.TPOINT_WT_FJGL).getCode());
+                    fjzbls.add(photovoltaicTestingPointNewService.getPhotovoltaicTestingPointNew(wt.getId(), Constant.TPOINT_WT_FJGL).getCode());
 
                 }
             }
@@ -267,6 +269,10 @@ public class MatrixQfPushService {
                                 double generatingcapacity = ml.getPowerproduction();
                                 BigDecimal temp = new BigDecimal(generatingcapacity).divide(new BigDecimal(100), 2, RoundingMode.HALF_UP);
                                 double lyl = new BigDecimal(gl).divide(temp, 2, RoundingMode.HALF_UP).doubleValue();
+                                if(lyl>100)
+                                {
+                                    lyl=100;
+                                }
                                 vo.setLyl(lyl);
                             } else {
                                 vo.setLyl(0.0);
@@ -284,6 +290,7 @@ public class MatrixQfPushService {
 
                         }
 
+
                         vo.setWpId(wt.getWindpowerstationid());
                         vos.add(vo);
                     }
@@ -316,6 +323,10 @@ public class MatrixQfPushService {
                                 double generatingcapacity = ml.getPowerproduction();
                                 BigDecimal temp = new BigDecimal(generatingcapacity).divide(new BigDecimal(100), 2, RoundingMode.HALF_UP);
                                 double lyl = new BigDecimal(gl).divide(temp, 2, RoundingMode.HALF_UP).doubleValue();
+                                if(lyl>100)
+                                {
+                                    lyl=100;
+                                }
                                 vo.setLyl(lyl);
                             } else {
                                 vo.setLyl(0.0);

+ 563 - 179
web/monitor-web-sxjn/src/main/java/com/gyee/frame/service/websocket/WpInfoPushService.java

@@ -95,258 +95,642 @@ public class WpInfoPushService {
     public Map<String, Object> findWpInfo() throws Exception {
         Map<String, Object> map = new HashMap<String, Object>();
 
-
+        List<ZtjsVo> vos = new ArrayList<>();
         List<Map<String, Object>> maps = new ArrayList<>();
         for (Windpowerstation wp : InitialRunner.wpallls) {
 
+            ZtjsVo vo = new ZtjsVo();
+
+
+            vo.setFdl(0.0);
+            vo.setSwdl(0.0);
+            vo.setLyxs(0.0);
+            vo.setFs(0.0);
+            vo.setGl(0.0);
+            vo.setCxgl(0.0);
+            vo.setLlgl(0.0);
+            vo.setBzgl(0.0);
+            vo.setYcgl(0.0);
+            vo.setAGCzl(0.0);
+            vo.setLlfdl(0.0);
+            vo.setScadafdl(0.0);
+            vo.setWhss(0.0);
+            vo.setGzss(0.0);
+            vo.setSlss(0.0);
+            vo.setXdss(0.0);
+            vo.setXnss(0.0);
+
             String id = wp.getId();
+            double scadafdl = 0.0;
+            Double zjrl = 0.0;
+            Double zjts = 0.0;
+
+            Double sjgl = 0.0;
+            Double bzgl = 0.0;
+            Double yfgl = 0.0;
+
+/*************************************************基础指标*************************************************************/
+
+            zjrl = wp.getCapacity();
+            zjts = Double.valueOf(wp.getQuantity());
+
+            vo.setWpId(wp.getId());
+            vo.setWpName(wp.getName());
+            vo.setZjrl(zjrl);
+            Map<String, Object> jczbmap = new HashMap<>();
+
+
+            jczbmap.put("zjts", zjts);
+            jczbmap.put("name", wp.getName());
+            List<String> jczbls = new ArrayList<>();
+
+            jczbls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.TPOINT_WP_SJGL).getCode());
+            jczbls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.TPOINT_WP_RFDL).getCode());
+            jczbls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.TPOINT_WP_YFDL).getCode());
+            jczbls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.TPOINT_WP_NFDL).getCode());
+            jczbls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.TPOINT_WP_SSFS).getCode());
+            jczbls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.TPOINT_WP_SWDL).getCode());
+            jczbls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.ZBZGL).getCode());
+            jczbls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.TPOINT_WP_ZZSGL).getCode());
+            jczbls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.FJZT).getCode());
+            jczbls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.TPOINT_WT_RFDL).getCode());
+            jczbls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, ycPoints1[0]).getCode());
+
+
+
+            List<PointData> jczblist = realApiUtil.getRealData(jczbls);
+
+            if (!jczblist.isEmpty() && jczblist.size() == jczbls.size()) {
+                //实际功率
+                sjgl = MathUtil.twoBit(jczblist.get(0).getPointValueInDouble());
+                vo.setGl(sjgl);
+                //jczbmap.put("sjgl", sjgl);
+                //日发电量
+                double fdl = MathUtil.twoBit(jczblist.get(1).getPointValueInDouble());
+                vo.setFdl(fdl);
+                // jczbmap.put("rfdl", rfdl);
+
+//                //月发电量
+//                double yfdl=MathUtil.twoBit(jczblist.get(2).getPointValueInDouble());
+//                jczbmap.put("yfdl", yfdl);
+//                //年发电量
+//                double nfdl=MathUtil.twoBit(jczblist.get(3).getPointValueInDouble());
+//                jczbmap.put("nfdl", nfdl);
+                if(zjrl!=0)
+                {
+                    //月利用小时
+                    double ylyxs = (new BigDecimal(jczblist.get(2).getPointValueInDouble()).multiply(new BigDecimal(10))).divide(new BigDecimal(zjrl), 2, RoundingMode.HALF_EVEN).doubleValue();
+                    //jczbmap.put("ylyxs",ylyxs );
+                    vo.setLyxs(ylyxs);
+                }else
+                {
+                    vo.setLyxs(0.0);
+                }
+
+                //实时风速
+                double ssfs = MathUtil.twoBit(jczblist.get(4).getPointValueInDouble());
+                //        jczbmap.put("ssfs",ssfs );
+                vo.setFs(ssfs);
+                //上网电量
+                double swdl = MathUtil.twoBit(jczblist.get(5).getPointValueInDouble());
+                // jczbmap.put("swdl",swdl );
+                vo.setSwdl(swdl);
+                //保证功率
+                bzgl = new BigDecimal(jczblist.get(6).getPointValueInDouble()).divide(new BigDecimal(1000), 2, RoundingMode.HALF_EVEN).doubleValue();
+                //jczbmap.put("bzgl", bzgl);
+                vo.setBzgl(bzgl);
+                //应发功率
+                yfgl = new BigDecimal(jczblist.get(7).getPointValueInDouble()).divide(new BigDecimal(1000), 2, RoundingMode.HALF_EVEN).doubleValue();
+                // jczbmap.put("yfgl", yfgl);
+                vo.setLlgl(yfgl);
+                //目标状态
+                double fczt = StringUtils.round(jczblist.get(8).getPointValueInDouble(), 0);
+                jczbmap.put("fczt", fczt);
+
+                //SCADA发电量
+                scadafdl = StringUtils.round(jczblist.get(9).getPointValueInDouble(), 2);
+                //jczbmap.put("scadafdl",scadafdl );
+                vo.setScadafdl(scadafdl);
+                //预测功率
+                double ycgl = StringUtils.round(jczblist.get(10).getPointValueInDouble(), 2);
+                jczbmap.put("ycgl", ycgl);
+                vo.setYcgl(ycgl);
+
+            } else {
+                //实际功率
+                jczbmap.put("sjgl", 0.0);
+                //日发电量
+                jczbmap.put("rfdl", 0.0);
+                //月发电量
+                jczbmap.put("yfdl", 0.0);
+                //年发电量
+                jczbmap.put("nfdl", 0.0);
+                //月利用小时
+                jczbmap.put("ylyxs", 0.0);
+                //年利用小时
+                jczbmap.put("nlyxs", 0.0);
+                //实时风速
+                jczbmap.put("ssfs", 0.0);
+                //上网电量
+                jczbmap.put("swdl", 0.0);
+                //保证功率
+                jczbmap.put("bzgl", 0.0);
+                //应发功率
+                jczbmap.put("yfgl", 0.0);
+                //目标状态
+                jczbmap.put("fczt", -1.0);
+                //SCADA发电量
+                jczbmap.put("scadafdl", 0.0);
+                //预测功率
+                jczbmap.put("ycgl", 0.0);
+
+
+            }
+
             List<Windsubstation> subls = windsubstationService.findByWpId(wp.getId());
             if (!subls.isEmpty()) {
+
+                double agccxyg=0.0;
+                double agcygsd=0.0;
                 for (Windsubstation sub : subls) {
-                    Map<String, Object> jczbmap = new HashMap<>();
-                    jczbmap.put("name", sub.getName());
-                    double zjts = Double.valueOf(wp.getQuantity());
 
 
-/*****************************************************各调度AGC指标******************************************************************/
                     Map<String, Windsubstationtestingpointnew> submap = windsubstationtestingpointnewService.findBySubIdMap(sub.getId());
                     if (!submap.isEmpty()) {
-                        List<String> jczbls = new ArrayList<>();
+                        List<String> subjczbls = new ArrayList<>();
 
 
                         if (submap.containsKey(Constant.AGC001)) {
-                            jczbls.add(submap.get(Constant.AGC001).getCode());
+                            subjczbls.add(submap.get(Constant.AGC001).getCode());
                         }
 
                         if (submap.containsKey(Constant.AGC002)) {
-                            jczbls.add(submap.get(Constant.AGC002).getCode());
+                            subjczbls.add(submap.get(Constant.AGC002).getCode());
                         }
 
-                        List<PointData> jczblist = realApiUtil.getRealData(jczbls);
+                        List<PointData> subjczblist = realApiUtil.getRealData(subjczbls);
 
-                        if (!jczblist.isEmpty() && jczblist.size() == jczbls.size()) {
+                        if (!subjczblist.isEmpty() && subjczblist.size() == subjczbls.size()) {
 
                             //AGC出线有功
-                            double agccxyg = StringUtils.round(jczblist.get(0).getPointValueInDouble(), 2);
+                            agccxyg = agccxyg+ StringUtils.round(subjczblist.get(0).getPointValueInDouble(), 2);
                             jczbmap.put("agccxyg", agccxyg);
                             //AGC有功设定
-                            double agcygsd = StringUtils.round(jczblist.get(1).getPointValueInDouble(), 2);
+                            agcygsd = agcygsd+StringUtils.round(subjczblist.get(1).getPointValueInDouble(), 2);
                             jczbmap.put("agcygsd", agcygsd);
 
-                        } else {
-                            //AGC出线有功
-                            jczbmap.put("agccxyg", 0.0);
-                            //AGC有功设定
-                            jczbmap.put("agcygsd", 0.0);
-
                         }
-/*****************************************************各调度AGC指标******************************************************************/
-/*****************************************************各模块通信状态******************************************************************/
-
-
-                        List<Windpowerstationpointnew> wpoints = windPowerstationTestingPoint2Service.getJsztList(id);
-
-                        if (!wpoints.isEmpty()) {
-                            for (Windpowerstationpointnew wpoint : wpoints) {
-                                if (StringUtils.notEmp(wpoint) && StringUtils.notEmp(wpoint.getName())) {
-                                    String name = wpoint.getName();
-                                    if (name.indexOf("风机") != -1) {
-                                        PointData pointData = realApiUtil.getRealData(wpoint.getCode());
-                                        jczbmap.put("zxzt_fjzt", pointData.getPointValueInDouble());
-                                    } else if (name.indexOf("升压站") != -1) {
-                                        PointData pointData = realApiUtil.getRealData(wpoint.getCode());
-                                        jczbmap.put("zxzt_syzzt", pointData.getPointValueInDouble());
-                                    } else if (name.indexOf("电计量") != -1) {
-                                        PointData pointData = realApiUtil.getRealData(wpoint.getCode());
-                                        jczbmap.put("zxzt_djlzt", pointData.getPointValueInDouble());
-                                    } else if (name.indexOf("agc") != -1) {
-                                        PointData pointData = realApiUtil.getRealData(wpoint.getCode());
-                                        jczbmap.put("zxzt_acgzt", pointData.getPointValueInDouble());
-                                    } else if (name.indexOf("测风塔") != -1) {
-                                        PointData pointData = realApiUtil.getRealData(wpoint.getCode());
-                                        jczbmap.put("zxzt_cftzt", pointData.getPointValueInDouble());
-                                    }
-                                }
-                            }
+                    }
+
+                }
 
+            }
+
+            List<Windpowerstationpointnew> wpoints= windPowerstationTestingPoint2Service.getJsztList(id);
+
+            if(!wpoints.isEmpty())
+            {
+                for(Windpowerstationpointnew wpoint:wpoints)
+                {
+                    if(StringUtils.notEmp(wpoint) && StringUtils.notEmp(wpoint.getName()))
+                    {
+                        String name=wpoint.getName();
+                        if(name.indexOf("风机")!=-1)
+                        {
+                            PointData pointData=realApiUtil.getRealData(wpoint.getCode());
+                            jczbmap.put("zxzt_fjzt",pointData.getPointValueInDouble());
+                        }else if(name.indexOf("升压站")!=-1)
+                        {
+                            PointData pointData=realApiUtil.getRealData(wpoint.getCode());
+                            jczbmap.put("zxzt_syzzt",pointData.getPointValueInDouble());
+                        }else if(name.indexOf("电计量")!=-1)
+                        {
+                            PointData pointData=realApiUtil.getRealData(wpoint.getCode());
+                            jczbmap.put("zxzt_djlzt",pointData.getPointValueInDouble());
+                        }else if(name.indexOf("agc")!=-1)
+                        {
+                            PointData pointData=realApiUtil.getRealData(wpoint.getCode());
+                            jczbmap.put("zxzt_acgzt",pointData.getPointValueInDouble());
+                        }else if(name.indexOf("测风塔")!=-1)
+                        {
+                            PointData pointData=realApiUtil.getRealData(wpoint.getCode());
+                            jczbmap.put("zxzt_cftzt",pointData.getPointValueInDouble());
                         }
-/*****************************************************各模块通信状态******************************************************************/
+                    }
+                }
+            }
+            Calendar c = Calendar.getInstance();
+
+            int tempyear = c.get(Calendar.YEAR);
+            int tempmonth = c.get(Calendar.MONTH) + 1;
+            int daynum = c.get(Calendar.DAY_OF_MONTH);
+            List<WpMttrAndMtbMonth> mmls = wpMttrAndMtbMonthService.getMttrAndMtbf(id, tempyear, tempmonth);
+
+            if (!mmls.isEmpty()) {
+                WpMttrAndMtbMonth mm = mmls.get(0);
+                double stoptimes = mm.getStoprtimes();
+                double stophours = mm.getStophours();
+                double mttr = 0.0;
+                double mtbf = mm.getWthours();
+                if (stoptimes != 0) {
+                    mttr = new BigDecimal(stophours).divide(new BigDecimal(stoptimes), 2, RoundingMode.HALF_EVEN).doubleValue();
+                    mtbf = new BigDecimal(mm.getWthours()).divide(new BigDecimal(stoptimes), 2, RoundingMode.HALF_EVEN).doubleValue();
+
+                }
+
+                jczbmap.put("mttr", mttr);
+                jczbmap.put("mtbf", mtbf);
+            }
+
+
+/*************************************************基础指标*************************************************************/
+
 /*****************************************************升压站指标******************************************************************/
 
 
-                        if (ZtConfig.getMaps().containsKey(id + "_UAB")) {
-                            List<String> ls = new ArrayList<>();
+            if (ZtConfig.getMaps().containsKey(id + "_UAB")) {
+                List<String> ls = new ArrayList<>();
 
-                            ls = ZtConfig.getMaps().get(id + "_UAB");
-                            if (!ls.isEmpty()) {
-                                List<PointData> zblist = realApiUtil.getRealData(ls);
-                                double temp = 0.0;
-                                if (!zblist.isEmpty()) {
+                ls = ZtConfig.getMaps().get(id + "_UAB");
+                if (!ls.isEmpty()) {
+                    List<PointData> zblist = realApiUtil.getRealData(ls);
+                    double temp = 0.0;
+                    if (!zblist.isEmpty()) {
 
-                                    for (int i = 0; i < zblist.size(); i++)
-                                        temp = temp + zblist.get(i).getPointValueInDouble();
+                        for (int i = 0; i < zblist.size(); i++)
+                            temp = temp + zblist.get(i).getPointValueInDouble();
 
-                                }
-                                jczbmap.put("uab", MathUtil.twoBit(temp));
-                            }
-                        }
+                    }
+                    jczbmap.put("uab", MathUtil.twoBit(temp));
+                }
+            }
 
 
-                        if (ZtConfig.getMaps().containsKey(id + "_IA")) {
-                            List<String> ls = new ArrayList<>();
+            if (ZtConfig.getMaps().containsKey(id + "_IA")) {
+                List<String> ls = new ArrayList<>();
 
-                            ls = ZtConfig.getMaps().get(id + "_IA");
-                            if (!ls.isEmpty()) {
-                                List<PointData> zblist = realApiUtil.getRealData(ls);
-                                double temp = 0.0;
-                                if (!zblist.isEmpty()) {
+                ls = ZtConfig.getMaps().get(id + "_IA");
+                if (!ls.isEmpty()) {
+                    List<PointData> zblist = realApiUtil.getRealData(ls);
+                    double temp = 0.0;
+                    if (!zblist.isEmpty()) {
 
-                                    for (int i = 0; i < zblist.size(); i++)
-                                        temp = temp + zblist.get(i).getPointValueInDouble();
+                        for (int i = 0; i < zblist.size(); i++)
+                            temp = temp + zblist.get(i).getPointValueInDouble();
 
-                                }
-                                jczbmap.put("ia", MathUtil.twoBit(temp));
-                            }
-                        }
+                    }
+                    jczbmap.put("ia", MathUtil.twoBit(temp));
+                }
+            }
 
-                        if (ZtConfig.getMaps().containsKey(id + "_DNLB")) {
-                            List<String> ls = new ArrayList<>();
+            if (ZtConfig.getMaps().containsKey(id + "_DNLB")) {
+                List<String> ls = new ArrayList<>();
 
-                            ls = ZtConfig.getMaps().get(id + "_DNLB");
-                            if (!ls.isEmpty()) {
-                                List<PointData> zblist = realApiUtil.getRealData(ls);
-                                double temp = 0.0;
-                                if (!zblist.isEmpty()) {
+                ls = ZtConfig.getMaps().get(id + "_DNLB");
+                if (!ls.isEmpty()) {
+                    List<PointData> zblist = realApiUtil.getRealData(ls);
+                    double temp = 0.0;
+                    if (!zblist.isEmpty()) {
 
-                                    for (int i = 0; i < zblist.size(); i++)
-                                        temp = temp + zblist.get(i).getPointValueInDouble();
+                        for (int i = 0; i < zblist.size(); i++)
+                            temp = temp + zblist.get(i).getPointValueInDouble();
 
-                                }
-                                jczbmap.put("dnlb", MathUtil.twoBit(temp));
-                            }
-                        }
+                    }
+                    jczbmap.put("dnlb", MathUtil.twoBit(temp));
+                }
+            }
 
 
 /*****************************************************升压站指标******************************************************************/
 /*************************************************测风塔*************************************************************/
 
-                        if (InitialRunner.wpmap.containsKey(id)) {
-                            Windpowerstationpointnew point2 = windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.FCCFTFX30);
+            if (InitialRunner.wpmap.containsKey(id)) {
+                Windpowerstationpointnew point2 = windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.FCCFTFX30);
 
-                            if (StringUtils.notEmp(point2.getCode())) {
-                                PointData value = realApiUtil.getRealData(point2);
-                                jczbmap.put("cftfx", MathUtil.twoBit(value.getPointValueInDouble()));
-                            }
-                            point2 = windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.FCCFTFS30);
+                if (StringUtils.notEmp(point2.getCode())) {
+                    PointData value = realApiUtil.getRealData(point2);
+                    jczbmap.put("cftfx", MathUtil.twoBit(value.getPointValueInDouble()));
+                }
+                point2 = windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.FCCFTFS30);
 
-                            if (StringUtils.notEmp(point2.getCode())) {
-                                PointData value = realApiUtil.getRealData(point2);
-                                jczbmap.put("cftfs", MathUtil.twoBit(value.getPointValueInDouble()));
-                            }
+                if (StringUtils.notEmp(point2.getCode())) {
+                    PointData value = realApiUtil.getRealData(point2);
+                    jczbmap.put("cftfs", MathUtil.twoBit(value.getPointValueInDouble()));
+                }
 
-                            //map.put(wp.getId() + "cftmap", cftmap);
-                        }
+                //map.put(wp.getId() + "cftmap", cftmap);
+            }
 
 /*************************************************测风塔*************************************************************/
 
 /*************************************************6种状态*************************************************************/
 
 
-                        List<Windsubandwindturbiinereal> list=windsubandwindturbiinerealService.findWtBySub(sub.getId());
 
-                        if(!list.isEmpty())
-                        {
 
-                            List<String> fjzbls = new ArrayList<>();
-                            List<String> gfzbls = new ArrayList<>();
-                            //光伏没有明细计算点,所以区分开
-                            if(wp.getId().endsWith("FDC") && InitialRunner.wp_wtmap.containsKey(wp.getId())){
-                                List<Windturbine> wtls = InitialRunner.wp_wtmap.get(wp.getId());
-                                for(Windsubandwindturbiinereal wsub:list)
-                                {
-                                    //明细状态
-                                    fjzbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wsub.getWindturbineid(), Constant.ZTMX).getCode());
-                                }
-                                for (Windturbine wt : wtls) {
-
-                                }
-                            } else  if(wp.getId().endsWith("GDC") && InitialRunner.gp_nbqmap.containsKey(wp.getId())){
-                                List<Inverter> wtls = InitialRunner.gp_nbqmap.get(wp.getId());
-                                for (Inverter wt : wtls) {
-                                    //状态
-                                    gfzbls.add(photovoltaicTestingPointNewService.getPhotovoltaicTestingPointNew(wt.getId(), Constant.FJZT).getCode());
-                                }
-                            }
+            List<String> zbls = new ArrayList<>();
+            //光伏没有明细计算点,所以区分开
+            if(wp.getId().endsWith("FDC") && InitialRunner.wp_wtmap.containsKey(wp.getId())){
+                List<Windturbine> wtls = InitialRunner.wp_wtmap.get(wp.getId());
+                for(Windturbine wt:wtls)
+                {
+                    //明细状态
+                    zbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wt.getId(), Constant.FJZT).getCode());
+                }
+                for (Windturbine wt : wtls) {
 
-                            int djts=0;
-                            int yxts=0;
-                            int gzts=0;
-                            int lxts=0;
-                            int whts=0;
-                            int xdts=0;
-                            int slts=0;
-                            int jrts=0;
-                            List<PointData> gfzblist = realApiUtil.getRealData(gfzbls);
-                            if (!gfzblist.isEmpty() && gfzbls.size() == gfzblist.size()) {
-                                for (int i = 0; i < gfzblist.size(); i++) {
-                                    double gfzt = MathUtil.twoBit(MathUtil.twoBit(gfzblist.get(i).getPointValueInDouble()));
-                                    switch (Double.valueOf(gfzt).intValue()) {
-                                        case 0:
-                                            djts++;
-                                            break;
-                                        case 1:
-                                            yxts++;
-                                            break;
-                                        case 2:
-                                            gzts++;
-                                            break;
-                                        case 3:
-                                            lxts++;
-                                            break;
-                                        case 4:
-                                            whts++;
-                                            break;
-                                        case 5:
-                                            xdts++;
-                                            break;
-                                        case 6:
-                                            slts++;
-                                            break;
-
-                                        default:
-
-                                            break;
-                                    }
-                                }
-
-                                jrts=djts+yxts+gzts+lxts+whts+xdts+slts;
-
-                                jczbmap.put("zjts", jrts);
-                                jczbmap.put("djts", djts);
-                                jczbmap.put("yxts", yxts);
-                                jczbmap.put("gzts", gzts);
-                                jczbmap.put("lxts", lxts);
-                                jczbmap.put("whts", whts);
-                                jczbmap.put("xdts", xdts);
-                                jczbmap.put("slts", slts);
-                            }
+                }
+            } else  if(wp.getId().endsWith("GDC") && InitialRunner.gp_nbqmap.containsKey(wp.getId())){
+                List<Inverter> wtls = InitialRunner.gp_nbqmap.get(wp.getId());
+                for (Inverter wt : wtls) {
+                    //状态
+                    zbls.add(photovoltaicTestingPointNewService.getPhotovoltaicTestingPointNew(wt.getId(), Constant.FJZT).getCode());
+                }
+            }
 
+            int djts=0;
+            int yxts=0;
+            int gzts=0;
+            int lxts=0;
+            int whts=0;
+            int xdts=0;
+            int slts=0;
+            int jrts=0;
+            List<PointData> gfzblist = realApiUtil.getRealData(zbls);
+            if (!gfzblist.isEmpty() && zbls.size() == gfzblist.size()) {
+                for (int i = 0; i < gfzblist.size(); i++) {
+                    double gfzt = MathUtil.twoBit(MathUtil.twoBit(gfzblist.get(i).getPointValueInDouble()));
+                    switch (Double.valueOf(gfzt).intValue()) {
+                        case 0:
+                            djts++;
+                            break;
+                        case 1:
+                            yxts++;
+                            break;
+                        case 2:
+                            gzts++;
+                            break;
+                        case 3:
+                            lxts++;
+                            break;
+                        case 4:
+                            whts++;
+                            break;
+                        case 5:
+                            xdts++;
+                            break;
+                        case 6:
+                            slts++;
+                            break;
+
+                        default:
+
+                            break;
+                    }
+                }
 
-                        }
+                jrts=djts+yxts+gzts+lxts+whts+xdts+slts;
+
+                jczbmap.put("zjts", jrts);
+                jczbmap.put("djts", djts);
+                jczbmap.put("yxts", yxts);
+                jczbmap.put("gzts", gzts);
+                jczbmap.put("lxts", lxts);
+                jczbmap.put("whts", whts);
+                jczbmap.put("xdts", xdts);
+                jczbmap.put("slts", slts);
+
+            }
 
+            map.put("maps", maps);
 /*************************************************6种状态*************************************************************/
-                    }
 
-                    maps.add(jczbmap);
+/*************************************************五项损失**************************************************************/
+
 
 
-                }
+            Map<String, Double> wxssmap = new HashMap<>();
+            List<String> wxssls = new ArrayList<>();
+
+            // 日场内受累检修
+            wxssls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.RLZSSDL).getCode());
+            // 日场内受累故障
+            wxssls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.RSZSSDL).getCode());
+            //日待机损失
+            wxssls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.RSDJZSDL).getCode());
+            //日手动停机损失
+            wxssls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.RSSTZSDL).getCode());
+            //日性能损失
+            wxssls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.RXNZSDL).getCode());
+            //日缺陷降出力损失
+            wxssls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.RSQXZSDL).getCode());
+            //日故障损失
+            wxssls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.RGZSSDL).getCode());
+            //日检修损失
+            wxssls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.RJXSSDL).getCode());
+            //日限电损失
+            wxssls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.RXDSSDL).getCode());
+
+            //日场外受累电网
+            wxssls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.RWZSSDL).getCode());
+            // 日场外受累天气
+            wxssls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.RTZSSDL).getCode());
+
+            List<PointData> wxsslist = realApiUtil.getRealData(wxssls);
+
+            if (!wxsslist.isEmpty() && wxsslist.size() == wxssls.size()) {
+
+                Double rjxsl = MathUtil.twoBit(wxsslist.get(0).getPointValueInDouble());
+                // 日场内受累故障
+                Double rgzzsl = MathUtil.twoBit(wxsslist.get(1).getPointValueInDouble());
+
+
+                wxssmap.put("rjxsl", rjxsl);
+                wxssmap.put("rgzzsl", rgzzsl);
+
+
+                //日待机损失
+                Double rdjss = MathUtil.twoBit(wxsslist.get(2).getPointValueInDouble());
+                //日手动停机损失
+                Double rsdtjss = MathUtil.twoBit(wxsslist.get(3).getPointValueInDouble());
+                //日性能损失
+                Double rxnss = MathUtil.twoBit(wxsslist.get(4).getPointValueInDouble());
+                //日缺陷降出力损失
+                Double rqxjclss = MathUtil.twoBit(wxsslist.get(5).getPointValueInDouble());
+
+                //日欠发损失=日待机损失+日手动停机损失+日性能损失+日缺陷降出力损失
+                Double rqfssdl = new BigDecimal(rdjss + rsdtjss + rxnss + rqxjclss).divide(new BigDecimal(10000), 2, RoundingMode.HALF_EVEN).doubleValue();
+
+                Double rgzss = MathUtil.twoBit(wxsslist.get(6).getPointValueInDouble());
+                //日故障损失电量=日故障损失+日故障受累
+                Double rgzssdl = new BigDecimal(rgzss + rgzzsl).divide(new BigDecimal(10000), 2, RoundingMode.HALF_EVEN).doubleValue();
+                //日检修损失电量=日检修损失+日检修受累
+                Double rjxss = MathUtil.twoBit(wxsslist.get(7).getPointValueInDouble());
+                Double rjxssdl = new BigDecimal(rjxss + rjxsl).divide(new BigDecimal(10000), 2, RoundingMode.HALF_EVEN).doubleValue();
+
+
+                vo.setWhss(rjxssdl);
+                vo.setGzss(rgzssdl);
+                vo.setXnss(rqfssdl);
+//                wxssmap.put("rqfssdl", rqfssdl);
+//                wxssmap.put("rgzssdl", rgzssdl);
+//                wxssmap.put("rjxssdl", rjxssdl);
+
+
+                double temp = 0.0;
+                temp = MathUtil.twoBit(wxsslist.get(8).getPointValueInDouble());
+                Double rxdssdl = new BigDecimal(temp).divide(new BigDecimal(10000), 2, RoundingMode.HALF_EVEN).doubleValue();
+
+                // wxssmap.put("rxdssdl", StringUtils.round(rxdssdl < 0.0 ? 0.0 : rxdssdl, 2));
+                vo.setXdss(rxdssdl);
+                Double rdwsl = MathUtil.twoBit(wxsslist.get(9).getPointValueInDouble());
+                Double rtqsl = MathUtil.twoBit(wxsslist.get(10).getPointValueInDouble());
+                Double rslssdl = new BigDecimal(rdwsl + rtqsl).divide(new BigDecimal(10000), 2, RoundingMode.HALF_EVEN).doubleValue();
+
+                //wxssmap.put("rslssdl", rslssdl);
+                vo.setSlss(rslssdl);
+                vo.setLlfdl(MathUtil.twoBit(scadafdl + rjxssdl + rgzssdl + rqfssdl + rxdssdl + rslssdl));
+
+            } else {
+
+                wxssmap.put("rjxsl", 0.0);
+                wxssmap.put("rgzzsl", 0.0);
+                wxssmap.put("rqfssdl", 0.0);
+                wxssmap.put("rgzssdl", 0.0);
+                wxssmap.put("rjxssdl", 0.0);
+                wxssmap.put("rxdssdl", 0.0);
+                wxssmap.put("rslssdl", 0.0);
+
 
             }
+            // map.put("wxssmap", wxssmap);
 
-            map.put("maps", maps);
+/****************************************************五项损失************************************************************/
+
+
+            vos.add(vo);
+
+            maps.add(jczbmap);
         }
 
+        int gfsl = 0;
+        int fcsl = 0;
+        ZtjsVo gfvo = new ZtjsVo();
+        gfvo.setWpId("-2");
+        gfvo.setWpName("光伏合计");
+        initalVo(gfvo);
+        ZtjsVo fcvo = new ZtjsVo();
+        fcvo.setWpId("-1");
+        fcvo.setWpName("风电合计");
+        initalVo(fcvo);
+        ZtjsVo qsvo = new ZtjsVo();
+        qsvo.setWpId("0");
+        qsvo.setWpName("总计");
+        initalVo(qsvo);
+        for (ZtjsVo vo : vos) {
+            if (vo.getWpId().endsWith("FDC")) {
+
+                fcvo.setZjrl(fcvo.getZjrl() + vo.getZjrl());
+                fcvo.setFdl(fcvo.getFdl() + vo.getFdl());
+                fcvo.setSwdl(fcvo.getSwdl() + vo.getSwdl());
+                fcvo.setLyxs(fcvo.getLyxs() + vo.getLyxs());
+                fcvo.setFs(fcvo.getFs() + vo.getFs());
+                fcvo.setGl(fcvo.getGl() + vo.getGl());
+                fcvo.setCxgl(fcvo.getCxgl() + vo.getCxgl());
+                fcvo.setLlgl(fcvo.getLlgl() + vo.getLlgl());
+                fcvo.setBzgl(fcvo.getBzgl() + vo.getBzgl());
+                fcvo.setYcgl(fcvo.getYcgl() + vo.getYcgl());
+                fcvo.setAGCzl(fcvo.getAGCzl() + vo.getAGCzl());
+                fcvo.setLlfdl(fcvo.getLlfdl() + vo.getLlfdl());
+                fcvo.setScadafdl(fcvo.getScadafdl() + vo.getScadafdl());
+                fcvo.setWhss(fcvo.getWhss() + vo.getWhss());
+                fcvo.setGzss(fcvo.getGzss() + vo.getGzss());
+                fcvo.setSlss(fcvo.getSlss() + vo.getSlss());
+                fcvo.setXdss(fcvo.getXdss() + vo.getXdss());
+                fcvo.setXnss(fcvo.getXnss() + vo.getXnss());
+
+                fcsl++;
+            } else if (vo.getWpId().endsWith("GDC")) {
+                gfvo.setZjrl(gfvo.getZjrl() + vo.getZjrl());
+                gfvo.setFdl(gfvo.getFdl() + vo.getFdl());
+                gfvo.setSwdl(gfvo.getSwdl() + vo.getSwdl());
+                gfvo.setLyxs(gfvo.getLyxs() + vo.getLyxs());
+                gfvo.setFs(gfvo.getFs() + vo.getFs());
+                gfvo.setGl(gfvo.getGl() + vo.getGl());
+                gfvo.setCxgl(gfvo.getCxgl() + vo.getCxgl());
+                gfvo.setLlgl(gfvo.getLlgl() + vo.getLlgl());
+                gfvo.setBzgl(gfvo.getBzgl() + vo.getBzgl());
+                gfvo.setYcgl(gfvo.getYcgl() + vo.getYcgl());
+                gfvo.setAGCzl(gfvo.getAGCzl() + vo.getAGCzl());
+                gfvo.setLlfdl(gfvo.getLlfdl() + vo.getLlfdl());
+                gfvo.setScadafdl(gfvo.getScadafdl() + vo.getScadafdl());
+                gfvo.setWhss(gfvo.getWhss() + vo.getWhss());
+                gfvo.setGzss(gfvo.getGzss() + vo.getGzss());
+                gfvo.setSlss(gfvo.getSlss() + vo.getSlss());
+                gfvo.setXdss(gfvo.getXdss() + vo.getXdss());
+                gfvo.setXnss(gfvo.getXnss() + vo.getXnss());
+                gfsl++;
+            }
+
+            qsvo.setZjrl(qsvo.getZjrl() + vo.getZjrl());
+            qsvo.setFdl(qsvo.getFdl() + vo.getFdl());
+            qsvo.setSwdl(qsvo.getSwdl() + vo.getSwdl());
+            qsvo.setLyxs(qsvo.getLyxs() + vo.getLyxs());
+            qsvo.setFs(qsvo.getFs() + vo.getFs());
+            qsvo.setGl(qsvo.getGl() + vo.getGl());
+            qsvo.setCxgl(qsvo.getCxgl() + vo.getCxgl());
+            qsvo.setLlgl(qsvo.getLlgl() + vo.getLlgl());
+            qsvo.setBzgl(qsvo.getBzgl() + vo.getBzgl());
+            qsvo.setYcgl(qsvo.getYcgl() + vo.getYcgl());
+            qsvo.setAGCzl(qsvo.getAGCzl() + vo.getAGCzl());
+            qsvo.setLlfdl(qsvo.getLlfdl() + vo.getLlfdl());
+            qsvo.setScadafdl(qsvo.getScadafdl() + vo.getScadafdl());
+            qsvo.setWhss(qsvo.getWhss() + vo.getWhss());
+            qsvo.setGzss(qsvo.getGzss() + vo.getGzss());
+            qsvo.setSlss(qsvo.getSlss() + vo.getSlss());
+            qsvo.setXdss(qsvo.getXdss() + vo.getXdss());
+            qsvo.setXnss(qsvo.getXnss() + vo.getXnss());
+        }
+
+        if (fcsl != 0) {
+            Double fs = new BigDecimal(fcvo.getFs()).divide(new BigDecimal(fcsl), 2, RoundingMode.HALF_EVEN).doubleValue();
+
+            fcvo.setFs(fs);
+        }
+
+        if (gfsl != 0) {
+            Double fs = new BigDecimal(gfvo.getFs()).divide(new BigDecimal(gfsl), 2, RoundingMode.HALF_EVEN).doubleValue();
+
+            gfvo.setFs(fs);
+        }
+        if (vos.size() != 0) {
+            Double fs = new BigDecimal(qsvo.getFs()).divide(new BigDecimal(vos.size()), 2, RoundingMode.HALF_EVEN).doubleValue();
+
+            qsvo.setFs(fs);
+        }
+
+        List<ZtjsVo> result = new ArrayList<>();
+
+        for (ZtjsVo vo : vos) {
+            if (vo.getWpId().endsWith("FDC")) {
+
+                result.add(vo);
+
+            }
+        }
+        roundVo(fcvo);
+        result.add(fcvo);
+        for (ZtjsVo vo : vos) {
+            if (vo.getWpId().endsWith("GDC")) {
+
+                result.add(vo);
+            }
+        }
+        roundVo(gfvo);
+        result.add(gfvo);
+        roundVo(qsvo);
+        result.add(qsvo);
+        map.put("vos", result);
         return map;
     }
 

+ 341 - 48
web/monitor-web-sxjn/src/main/java/com/gyee/frame/service/websocket/WtInfoPushService.java

@@ -5,7 +5,9 @@ import cn.hutool.core.date.DateUtil;
 import com.google.common.collect.Maps;
 import com.gyee.frame.common.spring.Constant;
 import com.gyee.frame.common.spring.InitialRunner;
+import com.gyee.frame.model.agc.AgcVo;
 import com.gyee.frame.model.auto.*;
+import com.gyee.frame.model.custom.InverterVo;
 import com.gyee.frame.model.custom.JunctionboxVo;
 import com.gyee.frame.model.custom.PointData;
 import com.gyee.frame.service.*;
@@ -34,7 +36,6 @@ public class WtInfoPushService {
     private PhotovoltaicTestingPointNewService photovoltaicTestingPointNewService;
     @Resource
     private AlarmsnapService alarmsnapService;
-
     @Resource
     private JunctionboxService junctionboxService;
     IRealTimeDataBaseUtil realApiUtil = RealTimeDataBaseFactory.createRealTimeDataBase();
@@ -1015,6 +1016,26 @@ public class WtInfoPushService {
 
 
     }
+
+
+    private void initialNbqpoint(String id, List<String> zbls, List<String> keyls, Map<String, Integer> bjnamemap,List<String> uids ,List<String> msls) {
+
+        if(msls.size()==uids.size())
+        {
+            for(int i=0;i<uids.size();i++)
+            {
+                PhotovoltaicTestingPointNew point= photovoltaicTestingPointNewService.getPhotovoltaicTestingPointNew(id, uids.get(i));
+                if(null!=point && null!=point.getCode())
+                {
+                    zbls.add(point.getCode());//
+                    keyls.add(msls.get(i));//
+                    bjnamemap.put(msls.get(i),zbls.size()-1);
+                }
+            }
+        }
+
+
+    }
 //    private void initialpoint(String id, List<String> zbls, List<String> keyls, Map<String, Integer> bjnamemap,List<String> uids) {
 //
 //        for(String uid:uids)
@@ -1063,16 +1084,7 @@ public class WtInfoPushService {
                     msls.add("FJGL");//有功功率
                     msls.add("YYYW");//液压油温
                     msls.add("PCS_WD");//PSC温度
-                    if (wt.getWindpowerstationid().equals(QS_FDC)) {
-                        uids.add(Constant.QSTPOINT_WT_U1YZWD);//U1绕组温度
-                        uids.add(Constant.QSTPOINT_WT_V1YZWD);//V1绕组温度
-                        uids.add(Constant.QSTPOINT_WT_W1YZWD);//W1绕组温度
 
-                        msls.add("U1YZWD");//U1绕组温度
-                        msls.add("V1YZWD");//V1绕组温度
-                        msls.add("W1YZWD");//W1绕组温度
-                    }else
-                    {
                         uids.add(Constant.TPOINT_WT_U1YZWD);//U1绕组温度
                         uids.add(Constant.TPOINT_WT_V1YZWD);//V1绕组温度
                         uids.add(Constant.TPOINT_WT_W1YZWD);//W1绕组温度
@@ -1080,7 +1092,7 @@ public class WtInfoPushService {
                         msls.add("U1YZWD");//U1绕组温度
                         msls.add("V1YZWD");//V1绕组温度
                         msls.add("W1YZWD");//W1绕组温度
-                    }
+
                     uids.add(Constant.TPOINT_WT_U2YZWD);//U2绕组温度
                     uids.add(Constant.TPOINT_WT_V2YZWD);//V2绕组温度
                     uids.add(Constant.TPOINT_WT_W2YZWD);//W2绕组温度
@@ -1108,7 +1120,7 @@ public class WtInfoPushService {
                     
                     
                     initialpoint(id, zbls, keyls, namemap,uids,msls);
-/*******************************************************************************************************************************************************/
+
 
                     Map<String, Object> zbmap = new HashMap<>();
 
@@ -1121,7 +1133,7 @@ public class WtInfoPushService {
 
 
                     if (!zblist.isEmpty() && zblist.size() == zbls.size() && keyls.size() == zbls.size()) {
-/**************************************************************基础指标***********************************************************************************/
+
 
 
 
@@ -1136,7 +1148,6 @@ public class WtInfoPushService {
                         }
 
 
-/**************************************************************基础指标***********************************************************************************/
 
 
                     } else {
@@ -1153,9 +1164,99 @@ public class WtInfoPushService {
                     vos.add(zbmap);
 
                 }
-            }
+            }else if (InitialRunner.gp_nbqmap.containsKey(wpId)) {
+
+                List<Inverter> wtls=InitialRunner.gp_nbqmap.get(wpId);
+
+                for(Inverter wt:wtls)
+                {
+                    String id=wt.getId();
+
+
+                    List<String> msls = new ArrayList<>();
+                    List<String> zbls = new ArrayList<>();
+                    List<String> keyls = new ArrayList<>();
+                    List<String> uids = new ArrayList<>();
+                    Map<String, Integer> namemap = new HashMap<>();
+
+                    uids.add(Constant.TPOINT_NBQ_AB_DY);//电网AB线电压
+                    uids.add(Constant.TPOINT_NBQ_BC_DY);//电网BC线电压
+                    uids.add(Constant.TPOINT_NBQ_CA_DY);//电网CA线电压
+                    uids.add(Constant.TPOINT_NBQ_A_DL);//电网A相电流
+                    uids.add(Constant.TPOINT_NBQ_B_DL);//电网B相电流
+                    uids.add(Constant.TPOINT_NBQ_C_DL);//电网C相电流
+                    uids.add(Constant.TPOINT_NBQ_DWPL);//电网频率
+                    uids.add(Constant.TPOINT_NBQ_GL);//功率
+                    uids.add(Constant.TPOINT_NBQ_WGGL);//无功功率
+                    uids.add(Constant.TPOINT_NBQ_GLYS);//功率因数
+                    uids.add(Constant.TPOINT_NBQ_WD);//机内温度
+                    uids.add(Constant.TPOINT_NBQ_ZLDY);//直流电压
+                    uids.add(Constant.TPOINT_NBQ_ZLDL);//直流电流
+                    uids.add(Constant.TPOINT_NBQ_RFDL);//日发电量
+                    uids.add(Constant.TPOINT_NBQ_ZFDL);//总发电量
+                    uids.add(Constant.TPOINT_NBQ_RBWFZ);//日并网分钟
+                    uids.add(Constant.TPOINT_NBQ_ZYXSJ);//总运行时间
+
+
+                    msls.add("AB_DY");//电网AB线电压
+                    msls.add("BC_DY");//电网BC线电压
+                    msls.add("CA_DY");//电网CA线电压
+                    msls.add("A_DL");//电网A相电流
+                    msls.add("B_DL");//电网B相电流
+                    msls.add("C_DL");//电网C相电流
+                    msls.add("DWPL");//电网频率
+                    msls.add("YGGL");//功率
+                    msls.add("WGGL");//无功功率
+                    msls.add("GLYS");//功率因数
+                    msls.add("JNWD");//机内温度
+                    msls.add("ZLDY");// 直流电压
+                    msls.add("ZLDL");//直流电流
+                    msls.add("RFDL");//日发电量
+                    msls.add("ZFDL");//总发电量
+                    msls.add("RBWFZ");//日并网分钟
+                    msls.add("ZYXSJ");//总运行时间
+
+                    initialNbqpoint(id, zbls, keyls, namemap,uids,msls);
 
 
+                    Map<String, Object> zbmap = new HashMap<>();
+
+                    zbmap.put("model", wt.getModelid());
+                    zbmap.put("wpid", wt.getWindpowerstationid());
+                    zbmap.put("pjid", wt.getProjectid());
+                    zbmap.put("lnid", wt.getLineid());
+                    zbmap.put("code", wt.getCode());
+                    zbmap.put("wtid", wt.getId());
+                    List<PointData> zblist = realApiUtil.getRealData(zbls);
+
+
+                    if (!zblist.isEmpty() && zblist.size() == zbls.size() && keyls.size() == zbls.size()) {
+
+
+                        for(int i=0;i<keyls.size();i++)
+                        {
+                            if(namemap.containsKey(keyls.get(i)))
+                            {
+                                int num=namemap.get(keyls.get(i));
+                                zbmap.put(keyls.get(i), MathUtil.twoBit(zblist.get(num).getPointValueInDouble()));//
+                            }
+
+                        }
+
+                    }
+
+                    for(String str:msls)
+                    {
+                        if(!zbmap.containsKey(str))
+                        {
+                            zbmap.put(str,null);
+                        }
+                    }
+                    vos.add(zbmap);
+
+                }
+            }
+
 
         }
 
@@ -1202,23 +1303,23 @@ public class WtInfoPushService {
                             JunctionboxVo vo=new JunctionboxVo();
                             vo.setId(jb.getId());
                             vo.setName(jb.getName());
-                            vo.setZdy(ptlist.get(0).getPointValueInDouble());
-                            vo.setDl1(ptlist.get(1).getPointValueInDouble());
-                            vo.setDl2(ptlist.get(2).getPointValueInDouble());
-                            vo.setDl3(ptlist.get(3).getPointValueInDouble());
-                            vo.setDl4(ptlist.get(4).getPointValueInDouble());
-                            vo.setDl5(ptlist.get(5).getPointValueInDouble());
-                            vo.setDl6(ptlist.get(6).getPointValueInDouble());
-                            vo.setDl7(ptlist.get(7).getPointValueInDouble());
-                            vo.setDl8(ptlist.get(8).getPointValueInDouble());
-                            vo.setDl9(ptlist.get(9).getPointValueInDouble());
-                            vo.setDl10(ptlist.get(10).getPointValueInDouble());
-                            vo.setDl11(ptlist.get(11).getPointValueInDouble());
-                            vo.setDl12(ptlist.get(12).getPointValueInDouble());
-                            vo.setDl13(ptlist.get(13).getPointValueInDouble());
-                            vo.setDl14(ptlist.get(14).getPointValueInDouble());
-                            vo.setDl15(ptlist.get(15).getPointValueInDouble());
-                            vo.setDl16(ptlist.get(16).getPointValueInDouble());
+                            vo.setZdy(StringUtils.round(ptlist.get(0).getPointValueInDouble(),2));
+                            vo.setDl1(StringUtils.round(ptlist.get(1).getPointValueInDouble(),2));
+                            vo.setDl2(StringUtils.round(ptlist.get(2).getPointValueInDouble(),2));
+                            vo.setDl3(StringUtils.round(ptlist.get(3).getPointValueInDouble(),2));
+                            vo.setDl4(StringUtils.round(ptlist.get(4).getPointValueInDouble(),2));
+                            vo.setDl5(StringUtils.round(ptlist.get(5).getPointValueInDouble(),2));
+                            vo.setDl6(StringUtils.round(ptlist.get(6).getPointValueInDouble(),2));
+                            vo.setDl7(StringUtils.round(ptlist.get(7).getPointValueInDouble(),2));
+                            vo.setDl8(StringUtils.round(ptlist.get(8).getPointValueInDouble(),2));
+                            vo.setDl9(StringUtils.round(ptlist.get(9).getPointValueInDouble(),2));
+                            vo.setDl10(StringUtils.round(ptlist.get(10).getPointValueInDouble(),2));
+                            vo.setDl11(StringUtils.round(ptlist.get(11).getPointValueInDouble(),2));
+                            vo.setDl12(StringUtils.round(ptlist.get(12).getPointValueInDouble(),2));
+                            vo.setDl13(StringUtils.round(ptlist.get(13).getPointValueInDouble(),2));
+                            vo.setDl14(StringUtils.round(ptlist.get(14).getPointValueInDouble(),2));
+                            vo.setDl15(StringUtils.round(ptlist.get(15).getPointValueInDouble(),2));
+                            vo.setDl16(StringUtils.round(ptlist.get(16).getPointValueInDouble(),2));
                             vos.add(vo);
                         }
 
@@ -1232,6 +1333,191 @@ public class WtInfoPushService {
 		return vos;
 	}
 
+
+
+    public Map<String,List<InverterVo>> findMatrixByWpId(String wpId) throws Exception {
+        Map<String,List<InverterVo>> map=new HashMap<>();
+
+
+        List<InverterVo> vos=new ArrayList<>();
+        if (StringUtils.notEmp(wpId) && InitialRunner.gp_nbqmap.containsKey(wpId)) {
+            List<Inverter> wtls = InitialRunner.gp_nbqmap.get(wpId);
+            for (Inverter wt : wtls) {
+                double gl=0.0;
+                double fdl=0.0;
+                int zt=0;
+
+                List<String> pointcodes=new ArrayList<>();
+
+                String[] strs=Constant.TPOINT_Inverter_Matrix;
+                for(int i=0;i<strs.length;i++)
+                {
+                    PhotovoltaicTestingPointNew pt=photovoltaicTestingPointNewService.getPhotovoltaicTestingPointNew(wt.getId(),strs[i]);
+                    if(StringUtils.notEmp(pt) && StringUtils.notEmp(pt.getCode()))
+                    {
+                        pointcodes.add(pt.getCode());
+                    }
+                }
+
+                List<PointData> ptlist = realApiUtil.getRealData(pointcodes);
+
+                if(!ptlist.isEmpty() && ptlist.size()==pointcodes.size())
+                {
+                    zt=Double.valueOf(ptlist.get(0).getPointValueInDouble()).intValue();
+                    gl=StringUtils.round(ptlist.get(1).getPointValueInDouble(),2);
+                    fdl=StringUtils.round(ptlist.get(2).getPointValueInDouble(),2);
+                }
+                if (StringUtils.notEmp(wt.getSquareid()) && InitialRunner.sqmap.containsKey(wt.getSquareid())) {
+                    Square square = InitialRunner.sqmap.get(wt.getSquareid());
+
+                    if (square.getTypes().equals(ZC)) {
+
+                        if(map.containsKey(square.getId()))
+                        {
+                            List<InverterVo> ls=map.get(square.getId());;
+                            InverterVo vo=new InverterVo();
+                            vo.setId(wt.getId());
+                            vo.setName(wt.getName());
+                            vo.setFdl(fdl);
+                            vo.setGl(gl);
+                            vo.setZt(zt);
+                            vo.setSqname(square.getName());
+                            ls.add(vo);
+                            map.put(square.getId(),ls);
+                        }else
+                        {
+                            List<InverterVo> ls=new ArrayList<>();
+                            InverterVo vo=new InverterVo();
+                            vo.setId(wt.getId());
+                            vo.setName(wt.getName());
+                            vo.setFdl(fdl);
+                            vo.setGl(gl);
+                            vo.setZt(zt);
+                            vo.setSqname(square.getName());
+                            ls.add(vo);
+                            map.put(square.getId(),ls);
+
+                        }
+                    }else
+                    {
+                        InverterVo vo=new InverterVo();
+                        vo.setId(wt.getId());
+                        vo.setName(wt.getName());
+                        vo.setFdl(fdl);
+                        vo.setGl(gl);
+                        vo.setZt(zt);
+                        vo.setSqname(square.getName());
+                        vos.add(vo);
+                    }
+                }
+
+            }
+        }
+
+        map.put(JZ,vos);
+
+        return map;
+    }
+
+
+
+    public Map<String,Map<String,List<InverterVo>>> findMatrix() throws Exception {
+
+        Map<String,Map<String,List<InverterVo>>> matrixmap=new HashMap<>();
+
+
+        List<Windpowerstation> wpls=InitialRunner.wpallls;
+
+        if(!wpls.isEmpty())
+        {
+            for(Windpowerstation wp:wpls)
+            {
+                String wpId=wp.getId();
+                Map<String,List<InverterVo>> map=new HashMap<>();
+
+                List<InverterVo> vos=new ArrayList<>();
+                if (StringUtils.notEmp(wpId) && InitialRunner.gp_nbqmap.containsKey(wpId)) {
+                    List<Inverter> wtls = InitialRunner.gp_nbqmap.get(wpId);
+                    for (Inverter wt : wtls) {
+                        double gl=0.0;
+                        double fdl=0.0;
+                        int zt=0;
+
+                        List<String> pointcodes=new ArrayList<>();
+
+                        String[] strs=Constant.TPOINT_Inverter_Matrix;
+                        for(int i=0;i<strs.length;i++)
+                        {
+                            PhotovoltaicTestingPointNew pt=photovoltaicTestingPointNewService.getPhotovoltaicTestingPointNew(wt.getId(),strs[i]);
+                            if(StringUtils.notEmp(pt) && StringUtils.notEmp(pt.getCode()))
+                            {
+                                pointcodes.add(pt.getCode());
+                            }
+                        }
+
+                        List<PointData> ptlist = realApiUtil.getRealData(pointcodes);
+
+                        if(!ptlist.isEmpty() && ptlist.size()==pointcodes.size())
+                        {
+                            zt=Double.valueOf(ptlist.get(0).getPointValueInDouble()).intValue();
+                            gl=StringUtils.round(ptlist.get(1).getPointValueInDouble(),2);
+                            fdl=StringUtils.round(ptlist.get(2).getPointValueInDouble(),2);
+                        }
+                        if (StringUtils.notEmp(wt.getSquareid()) && InitialRunner.sqmap.containsKey(wt.getSquareid())) {
+                            Square square = InitialRunner.sqmap.get(wt.getSquareid());
+
+                            if (square.getTypes().equals(ZC)) {
+
+                                if(map.containsKey(square.getId()))
+                                {
+                                    List<InverterVo> ls=map.get(square.getId());;
+                                    InverterVo vo=new InverterVo();
+                                    vo.setId(wt.getId());
+                                    vo.setName(wt.getName());
+                                    vo.setFdl(fdl);
+                                    vo.setGl(gl);
+                                    vo.setSqname(square.getName());
+                                    vo.setZt(zt);
+                                    ls.add(vo);
+                                    map.put(square.getId(),ls);
+                                }else
+                                {
+                                    List<InverterVo> ls=new ArrayList<>();
+                                    InverterVo vo=new InverterVo();
+                                    vo.setId(wt.getId());
+                                    vo.setName(wt.getName());
+                                    vo.setFdl(fdl);
+                                    vo.setGl(gl);
+                                    vo.setZt(zt);
+                                    vo.setSqname(square.getName());
+                                    ls.add(vo);
+                                    map.put(square.getId(),ls);
+
+                                }
+                            }else
+                            {
+                                InverterVo vo=new InverterVo();
+                                vo.setId(wt.getId());
+                                vo.setName(wt.getName());
+                                vo.setSqname(square.getName());
+                                vo.setFdl(fdl);
+                                vo.setGl(gl);
+                                vo.setZt(zt);
+                                vos.add(vo);
+                            }
+                        }
+
+                    }
+                    map.put(JZ,vos);
+                }
+
+                matrixmap.put(wpId,map);
+            }
+
+        }
+
+        return matrixmap;
+    }
 	public Object findInverterDI(String id) throws Exception {
 		List<PhotovoltaicTestingPointNew> pointList = photovoltaicTestingPointNewService.getPhotovoltaicTestingPointNewDiList(id);
 		Map<String, String> idName = Maps.newHashMap();
@@ -1259,23 +1545,30 @@ public class WtInfoPushService {
 		return map;
 	}
 
-	public List<Object> findInverterPowerCurve(String id) throws Exception {
-		List<Object> list = Lists.newArrayList();
-		Date now = new Date();
-		Date date = DateUtil.beginOfDay(now);
+	public List<AgcVo> findInverterPowerCurve(String id) throws Exception {
+
+		Map<String,Object> map =new HashMap<>();
+		Date endDate = new Date();
+		Date beginDate = DateUtil.beginOfDay(endDate);
+
+		int length=DateUtils.hoursDiff(beginDate,endDate)*2;
+
+        List<AgcVo> vos = new ArrayList<>();
+        for (int i = 0; i < length; i++) {
+            AgcVo vo = new AgcVo();
+            vo.setSjgl(0.0);
+            vos.add(vo);
+        }
 		String pointid = photovoltaicTestingPointNewService.getPhotovoltaicTestingPointNew(id, Constant.TPOINT_NBQ_GL).getCode();
-		while (date.before(now)) {
-			Date begin = DateUtils.addMinutes(date, -30);
-			List<PointData> histStat = realApiUtil.getHistStat(pointid, begin.getTime() / 1000, date.getTime() / 1000, 1L, 30L * 60, 0);
-			Double val = 0D;
-			if (histStat != null && !histStat.isEmpty() && histStat.get(0) != null) {
-				val = histStat.get(0).getPointValueInDouble();
-				val = MathUtil.twoBit(val);
-			}
-			list.add(val);
-			date = DateUtils.addMinutes(date, 30);
-		}
-		return list;
+        List<PointData> sjglls = realApiUtil.getHistoryDatasSnap(pointid, beginDate.getTime() / 1000,
+                endDate.getTime() / 1000, (long) length, 1800L);
+        double temp = 0;
+        for (int i = 0; i < vos.size(); i++) {
+            temp = sjglls.get(i).getPointValueInDouble();
+            vos.get(i).setTime(sjglls.get(i).getPointTime()*1000);
+            vos.get(i).setSjgl(StringUtils.round(temp, 2));// 实际功率
+        }
+		return vos;
 	}
 
 	public List<Object> findInverterInfo(String id) throws Exception {

+ 10 - 10
web/monitor-web-sxjn/src/main/resources/application-jn.yml

@@ -57,16 +57,16 @@ server :
 #dev环境  mysql7.0
 spring :
   application:
-#    name: monitor-hb-provider
-#    cloud:
-#      nacos:
-#        discovery:
-#          server-addr: 10.81.3.155:8848
-#          #指定yaml格式的配置
-#          file-extension: yaml
-#          cluster-name: master
-#        username: nacos
-#        password: nacos
+    name: monitor-hb-provider
+    cloud:
+      nacos:
+        discovery:
+          server-addr: 10.81.3.155:8848
+          #指定yaml格式的配置
+          file-extension: yaml
+          cluster-name: master
+        username: nacos
+        password: nacos
     #引入其他配置文件,例如ftpHX 未配置文件application-ftpHX.yml
     #include: ftpHX,ftpCloud
   servlet: