Browse Source

单场矩阵

xieshengjie 1 year ago
parent
commit
7e68b79736

+ 19 - 13
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/service/monitor/MatrixService.java

@@ -596,45 +596,51 @@ public class MatrixService {
                 MatrixLineVo linevo = new MatrixLineVo();
                 List<ProBasicEquipment> equipments = lnwtmap.get(line.getId());
                 List<String> wtPoints = new ArrayList<>();
+                List<String> wtPoints1 = new ArrayList<>();
                 equipments.stream().forEach(wt->{
                     Map<String, ProBasicEquipmentPoint> equipmentPointMap = wtpAimap.get(wt.getId());
                     wtPoints.add(equipmentPointMap.get(ContantXk.MXZT).getNemCode());
-                    wtPoints.add(equipmentPointMap.get(ContantXk.CJ_SSGL).getNemCode());
+                    wtPoints1.add(equipmentPointMap.get(ContantXk.CJ_SSGL).getNemCode());
                     if (wt.getEquipmentCategory() == -1) {
-                        wtPoints.add(equipmentPointMap.get(ContantXk.CJ_SSFS).getNemCode());
-                        wtPoints.add(equipmentPointMap.get(ContantXk.CJ_SSZS).getNemCode());
+                        wtPoints1.add(equipmentPointMap.get(ContantXk.CJ_SSFS).getNemCode());
+                        wtPoints1.add(equipmentPointMap.get(ContantXk.CJ_SSZS).getNemCode());
                     } else if (wt.getEquipmentCategory() == -2) {
-                        wtPoints.add(equipmentPointMap.get(ContantXk.JLDL).getNemCode());
-                        wtPoints.add(equipmentPointMap.get(ContantXk.JLDY).getNemCode());
+                        wtPoints1.add(equipmentPointMap.get(ContantXk.JLDL).getNemCode());
+                        wtPoints1.add(equipmentPointMap.get(ContantXk.JLDY).getNemCode());
                     }
                     wtPoints.add(equipmentPointMap.get(ContantXk.SSQFZT).getNemCode());
                     wtPoints.add(equipmentPointMap.get(ContantXk.RQFDL).getNemCode());
                 });
                 List<PointData> wtRealdatas = null;
+                List<PointData> wtRealdatas1 = null;
                 try {
                     wtRealdatas = edosUtil.getRealData(wtPoints);
+                    wtRealdatas1 = edosUtil.getRealData(wtPoints1);
                 } catch (Exception e) {
                     e.printStackTrace();
                 }
                 List<MatrixVo> volist = new ArrayList<>();
                 if (StringUtils.isNotEmpty(wtRealdatas)){
-                    int index = 6;
+                    int index = 3;
                     for (int j = 0; j < equipments.size(); j++) {
                         MatrixVo vo = new MatrixVo();
                         vo.setWtid(equipments.get(j).getId());
                         vo.setWtname(equipments.get(j).getAname());
                         vo.setStatus(wtRealdatas.get(j * index).getPointValueInDouble());
-                        vo.setPower(DoubleUtils.keepPrecision(wtRealdatas.get(j * index + 1).getPointValueInDouble(), 2));
+                        vo.setSsqfzt(DoubleUtils.keepPrecision(wtRealdatas.get(j * index + 1).getPointValueInDouble(), 2));
+                        vo.setQfdl(DoubleUtils.keepPrecision(wtRealdatas.get(j * index + 2).getPointValueInDouble(), 2));
+
+
+                        vo.setPower(DoubleUtils.keepPrecision(wtRealdatas1.get(j * index).getPointValueInDouble(), 2));
 
                         if (equipments.get(j).getEquipmentCategory() == -1) {
-                            vo.setSpeed(DoubleUtils.keepPrecision(wtRealdatas.get(j * index + 2).getPointValueInDouble(), 2));
-                            vo.setTransfer(DoubleUtils.keepPrecision(wtRealdatas.get(j * index + 3).getPointValueInDouble(), 2));
+                            vo.setSpeed(DoubleUtils.keepPrecision(wtRealdatas1.get(j * index + 1).getPointValueInDouble(), 2));
+                            vo.setTransfer(DoubleUtils.keepPrecision(wtRealdatas1.get(j * index + 2).getPointValueInDouble(), 2));
                         } else if (equipments.get(j).getEquipmentCategory() == -2) {
-                            vo.setCurrent(DoubleUtils.keepPrecision(wtRealdatas.get(j * index + 2).getPointValueInDouble(), 2));
-                            vo.setVoltage(DoubleUtils.keepPrecision(wtRealdatas.get(j * index + 3).getPointValueInDouble(), 2));
+                            vo.setCurrent(DoubleUtils.keepPrecision(wtRealdatas1.get(j * index + 1).getPointValueInDouble(), 2));
+                            vo.setVoltage(DoubleUtils.keepPrecision(wtRealdatas1.get(j * index + 2).getPointValueInDouble(), 2));
                         }
-                        vo.setSsqfzt(DoubleUtils.keepPrecision(wtRealdatas.get(j * index + 4).getPointValueInDouble(), 2));
-                        vo.setQfdl(DoubleUtils.keepPrecision(wtRealdatas.get(j * index + 5).getPointValueInDouble(), 2));
+
                         vo.setRate(modelpower.containsKey(equipments.get(j).getId())?DoubleUtils.keepPrecision(vo.getPower()/ modelpower.get(equipments.get(j).getId()) * 100, 2):0);
                         volist.add(vo);
                     }