소스 검색

状态AGC

GYEE 6 달 전
부모
커밋
d699447a72
1개의 변경된 파일16개의 추가작업 그리고 5개의 파일을 삭제
  1. 16 5
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/JavaFunctionJobHandler.java

+ 16 - 5
ruoyi-admin/src/main/java/com/ruoyi/web/controller/JavaFunctionJobHandler.java

@@ -3237,11 +3237,22 @@ public class JavaFunctionJobHandler extends IJobHandler {
                 }).collect(Collectors.toList());
                 pdsZsglMap.put(wtId, zsglSnap);
             });
-            List<PointData> agcc = agcInfo.getPointDatas().stream().peek(agc -> {
-                agc.setDoubleValue(agc.getValue() * agcInfo.getCoef());
-                agc.setLongValue(0L);
-            }).collect(Collectors.toList());
-            agcInfo.setPointDatas(agcc);
+            boolean b = agcInfo.getPointDatas().stream().allMatch(ad -> ad.getValue() == 0);
+            if(b){
+                PointInfo info = new PointInfo();
+                info.setPointKey(agcInfo.getPointKey());
+                getLatestByEntity(Collections.singletonList(info));
+                double agcd = info.getPointDatas().get(0).getValue();
+                agcInfo.getPointDatas().forEach(agc -> {
+                    agc.setDoubleValue(agcd * agcInfo.getCoef());
+                    agc.setLongValue(0L);
+                });
+            }else {
+                agcInfo.getPointDatas().forEach(agc -> {
+                    agc.setDoubleValue(agc.getValue() * agcInfo.getCoef());
+                    agc.setLongValue(0L);
+                });
+            }
             List<PointData> cxc = cxInfo.getPointDatas().stream().peek(cx -> {
                 cx.setDoubleValue(cx.getValue() * cxInfo.getCoef());
                 cx.setLongValue(0L);