瀏覽代碼

Merge remote-tracking branch 'origin/master'

wangchangsheng 2 年之前
父節點
當前提交
fd8cd7cf7b

+ 2 - 1
realtime/generationXK-service/src/main/java/com/gyee/generation/config/XxlJobConfig.java

@@ -18,7 +18,8 @@ import org.springframework.core.env.Environment;
 
 
 @Configuration
-@PropertySource("classpath:xxl-job-executorWP.properties")
+@PropertySource("classpath:xxl-job-executor.properties")
+//@PropertySource("classpath:xxl-job-executorWP.properties")
 //@PropertySource("classpath:xxl-job-executorRG.properties")
 public class XxlJobConfig implements EnvironmentAware {
     private Environment env;

+ 2 - 1
realtime/generationXK-service/src/main/java/com/gyee/generation/service/realtimelibrary/CalculationService.java

@@ -40,7 +40,8 @@ public class CalculationService {
         Date monthFirst = DateUtils.getMonthFirst(currentDate);
         double hoursDiff = DateUtils.hoursDiff2(currentDate, monthFirst);
 
-        String toDate1 = DateUtils.toDate1(currentDate);
+
+        Date toDate1 = DateUtils.parseDate(DateUtils.toDate1(currentDate));
         Map<String,ProEconPowerstationInfoDay2> tempMap = new HashMap<>();
         QueryWrapper<ProEconPowerstationInfoDay2> qw = new QueryWrapper<>();
         qw.eq("record_date",toDate1);

+ 22 - 16
realtime/generationXK-service/src/main/java/com/gyee/generation/service/realtimelibrary/ElectricityMeteringService.java

@@ -203,37 +203,38 @@ public class ElectricityMeteringService {
             AtomicReference<Double> ncydl = new AtomicReference<>((double) 0);
             proBasicPros.stream().forEach(line->{    //期次
                 try {
-                    double linerfdl = getLineValue(line.getId(), ContantXk.RFDLSYZ, currentDate, linepointmap);
+                    double linerfdl = getLineValue(line.getId(), ContantXk.RFDLSYZ, currentDate, propointmap);
                     rfdl.updateAndGet(v -> new Double((double) (v + linerfdl)));
-                    double lineyfdl = getLineValue(line.getId(), ContantXk.YFDLSYZ, currentDate, linepointmap);
+                    double lineyfdl = getLineValue(line.getId(), ContantXk.YFDLSYZ, currentDate, propointmap);
                     yfdl.updateAndGet(v -> new Double((double) (v + lineyfdl)));
-                    double linenfdl = getLineValue(line.getId(), ContantXk.NFDLSYZ, currentDate, linepointmap);
+                    double linenfdl = getLineValue(line.getId(), ContantXk.NFDLSYZ, currentDate, propointmap);
                     nfdl.updateAndGet(v -> new Double((double) (v + linenfdl)));
-                    double linerswdl = getLineValue(line.getId(), ContantXk.RSWDL, currentDate, linepointmap);
+                    double linerswdl = getLineValue(line.getId(), ContantXk.RSWDL, currentDate, propointmap);
                     rswdl.updateAndGet(v -> new Double((double) (v + linerswdl)));
-                    double lineyswdl = getLineValue(line.getId(), ContantXk.YSWDL, currentDate, linepointmap);
+                    double lineyswdl = getLineValue(line.getId(), ContantXk.YSWDL, currentDate, propointmap);
                     yswdl.updateAndGet(v -> new Double((double) (v + lineyswdl)));
-                    double linenswdl = getLineValue(line.getId(), ContantXk.NSWDL, currentDate, linepointmap);
+                    double linenswdl = getLineValue(line.getId(), ContantXk.NSWDL, currentDate, propointmap);
                     nswdl.updateAndGet(v -> new Double((double) (v + linenswdl)));
-                    double linergwgwdl = getLineValue(line.getId(), ContantXk.RGWGWDL, currentDate, linepointmap);
+                    double linergwgwdl = getLineValue(line.getId(), ContantXk.RGWGWDL, currentDate, propointmap);
                     rgwgwdl.updateAndGet(v -> new Double((double) (v + linergwgwdl)));
-                    double lineygwgwdl = getLineValue(line.getId(), ContantXk.YGWGWDL, currentDate, linepointmap);
+                    double lineygwgwdl = getLineValue(line.getId(), ContantXk.YGWGWDL, currentDate, propointmap);
                     ygwgwdl.updateAndGet(v -> new Double((double) (v + lineygwgwdl)));
-                    double linengwgwdl = getLineValue(line.getId(), ContantXk.NGWGWDL, currentDate, linepointmap);
+                    double linengwgwdl = getLineValue(line.getId(), ContantXk.NGWGWDL, currentDate, propointmap);
                     ngwgwdl.updateAndGet(v -> new Double((double) (v + linengwgwdl)));
-                    double linernwgwdl = getLineValue(line.getId(), ContantXk.RNWGWDL, currentDate, linepointmap);
+                    double linernwgwdl = getLineValue(line.getId(), ContantXk.RNWGWDL, currentDate, propointmap);
                     rnwgwdl.updateAndGet(v -> new Double((double) (v + linernwgwdl)));
-                    double lineynwgwdl = getLineValue(line.getId(), ContantXk.YNWGWDL, currentDate, linepointmap);
+                    double lineynwgwdl = getLineValue(line.getId(), ContantXk.YNWGWDL, currentDate, propointmap);
                     ynwgwdl.updateAndGet(v -> new Double((double) (v + lineynwgwdl)));
-                    double linennwgwdl = getLineValue(line.getId(), ContantXk.NNWGWDL, currentDate, linepointmap);
+                    double linennwgwdl = getLineValue(line.getId(), ContantXk.NNWGWDL, currentDate, propointmap);
                     nnwgwdl.updateAndGet(v -> new Double((double) (v + linennwgwdl)));
-                    double linercydl = getLineValue(line.getId(), ContantXk.RCYDL, currentDate, linepointmap);
+                    double linercydl = getLineValue(line.getId(), ContantXk.RCYDL, currentDate, propointmap);
                     rcydl.updateAndGet(v -> new Double((double) (v + linercydl)));
-                    double lineycydl = getLineValue(line.getId(), ContantXk.YCYDL, currentDate, linepointmap);
+                    double lineycydl = getLineValue(line.getId(), ContantXk.YCYDL, currentDate, propointmap);
                     ycydl.updateAndGet(v -> new Double((double) (v + lineycydl)));
-                    double linencydl = getLineValue(line.getId(), ContantXk.NCYDL, currentDate, linepointmap);
+                    double linencydl = getLineValue(line.getId(), ContantXk.NCYDL, currentDate, propointmap);
                     ncydl.updateAndGet(v -> new Double((double) (v + linencydl)));
                 } catch (Exception e) {
+
                     e.printStackTrace();
                 }
             });
@@ -278,7 +279,12 @@ public class ElectricityMeteringService {
     }
 
     private double getLineValue(String lineid, String uniformcode, Date currentDate, Map<String, Map<String, ProBasicPowerstationPoint>> linepointmap) throws Exception {
-        ProBasicPowerstationPoint proBasicWppoint = linepointmap.get(lineid).get(uniformcode);
+        ProBasicPowerstationPoint proBasicWppoint = null;
+        try{
+            proBasicWppoint = linepointmap.get(lineid).get(uniformcode);
+        }catch (Exception e){
+            linepointmap.get(lineid).get(uniformcode);
+        }
         return edosUtil.getSectionData(proBasicWppoint,currentDate.getTime()).getPointValueInDouble();
     }
 

文件差異過大導致無法顯示
+ 994 - 991
realtime/generationXK-service/src/main/java/com/gyee/generation/service/realtimelibrary/RegionCalService.java


+ 288 - 286
realtime/generationXK-service/src/main/java/com/gyee/generation/service/realtimelibrary/RegionCalreService.java

@@ -164,321 +164,323 @@ public class RegionCalreService  {
                 finalFcComCount.getAndIncrement();
             }
             Map<String, ProBasicPowerstationPoint> powerstationPointMap1 = companypointmap.get(company.getId()+type);
-            ProBasicPowerstationPoint sspjfsPoint = null;
-            ProBasicPowerstationPoint sspjgzdPoint = null;
-
-
-            if (type.equals("-1")){
-                sspjfsPoint = powerstationPointMap1.get(ContantXk.SSPJFS);
+            if (powerstationPointMap1.size()>0){
+                ProBasicPowerstationPoint sspjfsPoint = null;
+                ProBasicPowerstationPoint sspjgzdPoint = null;
+
+                if (type.equals("-1")){
+                    sspjfsPoint = powerstationPointMap1.get(ContantXk.SSPJFS);
+
+                }else if(type.equals("-2")){
+                    sspjgzdPoint = powerstationPointMap1.get(ContantXk.SSPJGZD);
+
+                }else {
+                    sspjfsPoint = powerstationPointMap1.get(ContantXk.SSPJFS);
+                    sspjgzdPoint = powerstationPointMap1.get(ContantXk.SSPJGZD);
+
+                }
+                ProBasicPowerstationPoint sszglPoint = powerstationPointMap1.get(ContantXk.SSZGL);
+                ProBasicPowerstationPoint sszllglPoint = powerstationPointMap1.get(ContantXk.SSZLLGL);
+                ProBasicPowerstationPoint sszbzglPoint = powerstationPointMap1.get(ContantXk.SSZBZGL);
+                ProBasicPowerstationPoint ssznhglzsPoint = powerstationPointMap1.get(ContantXk.SSZNHGLZS);
+                ProBasicPowerstationPoint sszzyglPoint = powerstationPointMap1.get(ContantXk.SSZZYGL);
+                ProBasicPowerstationPoint sszkyglPoint = powerstationPointMap1.get(ContantXk.SSZKYGL);
+                ProBasicPowerstationPoint sszycglPoint = powerstationPointMap1.get(ContantXk.ZYCGL);
+
+                ProBasicPowerstationPoint gztsmxPoint = powerstationPointMap1.get(ContantXk.GZTSMX);
+                ProBasicPowerstationPoint cnslmxPoint = powerstationPointMap1.get(ContantXk.CNSLGZTSMX);
+                ProBasicPowerstationPoint jxtsmxPoint = powerstationPointMap1.get(ContantXk.JXTSMX);
+                ProBasicPowerstationPoint cnjxmxPoint = powerstationPointMap1.get(ContantXk.CNSLJXTSMX);
+                ProBasicPowerstationPoint djtsmxPoint = powerstationPointMap1.get(ContantXk.DJTSMX);
+                ProBasicPowerstationPoint qxjclmxPoint = powerstationPointMap1.get(ContantXk.QXJCLTSMX);
+                ProBasicPowerstationPoint sdtjmxPoint = powerstationPointMap1.get(ContantXk.SDTJTSMX);
+                ProBasicPowerstationPoint xntsmxPoint = powerstationPointMap1.get(ContantXk.XNTSMX);
+                ProBasicPowerstationPoint xdtjmxPoint = powerstationPointMap1.get(ContantXk.XDTJTSMX);
+                ProBasicPowerstationPoint xdjclmxPoint = powerstationPointMap1.get(ContantXk.XDJCLTSMX);
+                ProBasicPowerstationPoint cwsldwmxPoint = powerstationPointMap1.get(ContantXk.CWSLDWTSMX);
+                ProBasicPowerstationPoint cwsltqmxPoint = powerstationPointMap1.get(ContantXk.CWSLTQTSMX);
+                ProBasicPowerstationPoint lxtsmxPoint = powerstationPointMap1.get(ContantXk.LXTSMX);
+                ProBasicPowerstationPoint txzdmxPoint = powerstationPointMap1.get(ContantXk.TXZDTSMX);
+                ProBasicPowerstationPoint djtsPoint = powerstationPointMap1.get(ContantXk.DJTS);
+                ProBasicPowerstationPoint yxtsPoint = powerstationPointMap1.get(ContantXk.YXTS);
+                ProBasicPowerstationPoint gztsPoint = powerstationPointMap1.get(ContantXk.GZTJTS);
+                ProBasicPowerstationPoint whtsPoint = powerstationPointMap1.get(ContantXk.JXTJTS);
+                ProBasicPowerstationPoint xdtsPoint = powerstationPointMap1.get(ContantXk.XDTS);
+                ProBasicPowerstationPoint sltsPoint = powerstationPointMap1.get(ContantXk.SLTS);
+                ProBasicPowerstationPoint lxtsPoint = powerstationPointMap1.get(ContantXk.TXZDTS);
+
+                if (type.equals("-1")){
+                    ProBasicPowerstationPoint finalSspjfsfsPoint = sspjfsPoint;
+                    sspjfs.updateAndGet(v -> {
+                        try {
+                            return new Double((double) (v + edosUtil.getSectionData(finalSspjfsfsPoint, currentDate.getTime() / 1000).getPointValueInDouble()));
+                        } catch (Exception e) {
+                            e.printStackTrace();
+                        }
+                        return v;
+                    });
+
+
+                }else if (type.equals("-2")){
+                    ProBasicPowerstationPoint finalSspjgzdPoint = sspjgzdPoint;
+                    sspjgzd.updateAndGet(v -> {
+                        try {
+                            return new Double((double) (v + edosUtil.getSectionData(finalSspjgzdPoint, currentDate.getTime() / 1000).getPointValueInDouble()));
+                        } catch (Exception e) {
+                            e.printStackTrace();
+                        }
+                        return v;
+                    });
+
+                }else {
+                    ProBasicPowerstationPoint finalSspjfsfsPoint = sspjfsPoint;
+                    sspjfs.updateAndGet(v -> {
+                        try {
+                            return new Double((double) (v + edosUtil.getSectionData(finalSspjfsfsPoint, currentDate.getTime() / 1000).getPointValueInDouble()));
+                        } catch (Exception e) {
+                            e.printStackTrace();
+                        }
+                        return v;
+                    });
+                    ProBasicPowerstationPoint finalSspjgzdPoint = sspjgzdPoint;
+                    sspjgzd.updateAndGet(v -> {
+                        try {
+                            return new Double((double) (v + edosUtil.getSectionData(finalSspjgzdPoint, currentDate.getTime() / 1000).getPointValueInDouble()));
+                        } catch (Exception e) {
+                            e.printStackTrace();
+                        }
+                        return v;
+                    });
+                }
+                sszgl.updateAndGet(v -> {
+                    try {
+                        return new Double((double) (v + edosUtil.getSectionData(sszglPoint, currentDate.getTime() / 1000).getPointValueInDouble()));
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                    return v;
+                });
+                zllgl.updateAndGet(v -> {
+                    try {
+                        return new Double((double) (v + edosUtil.getSectionData(sszllglPoint, currentDate.getTime() / 1000).getPointValueInDouble()));
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                    return v;
+                });
+                zbzgl.updateAndGet(v -> {
+                    try {
+                        return new Double((double) (v + edosUtil.getSectionData(sszbzglPoint, currentDate.getTime() / 1000).getPointValueInDouble()));
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                    return v;
+                });
+                znhglzs.updateAndGet(v -> {
+                    try {
+                        return new Double((double) (v + edosUtil.getSectionData(ssznhglzsPoint, currentDate.getTime() / 1000).getPointValueInDouble()));
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                    return v;
+                });
+                zzygl.updateAndGet(v -> {
+                    try {
+                        return new Double((double) (v + edosUtil.getSectionData(sszzyglPoint, currentDate.getTime() / 1000).getPointValueInDouble()));
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                    return v;
+                });
+                zkygl.updateAndGet(v -> {
+                    try {
+                        return new Double((double) (v + edosUtil.getSectionData(sszkyglPoint, currentDate.getTime() / 1000).getPointValueInDouble()));
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                    return v;
+                });
+                zycgl.updateAndGet(v -> {
+                    try {
+                        return new Double((double) (v + edosUtil.getSectionData(sszycglPoint, currentDate.getTime() / 1000).getPointValueInDouble()));
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                    return v;
+                });
 
-            }else if(type.equals("-2")){
-                sspjgzdPoint = powerstationPointMap1.get(ContantXk.SSPJGZD);
 
-            }else {
-                sspjfsPoint = powerstationPointMap1.get(ContantXk.SSPJFS);
-                sspjgzdPoint = powerstationPointMap1.get(ContantXk.SSPJGZD);
 
-            }
-            ProBasicPowerstationPoint sszglPoint = powerstationPointMap1.get(ContantXk.SSZGL);
-            ProBasicPowerstationPoint sszllglPoint = powerstationPointMap1.get(ContantXk.SSZLLGL);
-            ProBasicPowerstationPoint sszbzglPoint = powerstationPointMap1.get(ContantXk.SSZBZGL);
-            ProBasicPowerstationPoint ssznhglzsPoint = powerstationPointMap1.get(ContantXk.SSZNHGLZS);
-            ProBasicPowerstationPoint sszzyglPoint = powerstationPointMap1.get(ContantXk.SSZZYGL);
-            ProBasicPowerstationPoint sszkyglPoint = powerstationPointMap1.get(ContantXk.SSZKYGL);
-            ProBasicPowerstationPoint sszycglPoint = powerstationPointMap1.get(ContantXk.ZYCGL);
-
-            ProBasicPowerstationPoint gztsmxPoint = powerstationPointMap1.get(ContantXk.GZTSMX);
-            ProBasicPowerstationPoint cnslmxPoint = powerstationPointMap1.get(ContantXk.CNSLGZTSMX);
-            ProBasicPowerstationPoint jxtsmxPoint = powerstationPointMap1.get(ContantXk.JXTSMX);
-            ProBasicPowerstationPoint cnjxmxPoint = powerstationPointMap1.get(ContantXk.CNSLJXTSMX);
-            ProBasicPowerstationPoint djtsmxPoint = powerstationPointMap1.get(ContantXk.DJTSMX);
-            ProBasicPowerstationPoint qxjclmxPoint = powerstationPointMap1.get(ContantXk.QXJCLTSMX);
-            ProBasicPowerstationPoint sdtjmxPoint = powerstationPointMap1.get(ContantXk.SDTJTSMX);
-            ProBasicPowerstationPoint xntsmxPoint = powerstationPointMap1.get(ContantXk.XNTSMX);
-            ProBasicPowerstationPoint xdtjmxPoint = powerstationPointMap1.get(ContantXk.XDTJTSMX);
-            ProBasicPowerstationPoint xdjclmxPoint = powerstationPointMap1.get(ContantXk.XDJCLTSMX);
-            ProBasicPowerstationPoint cwsldwmxPoint = powerstationPointMap1.get(ContantXk.CWSLDWTSMX);
-            ProBasicPowerstationPoint cwsltqmxPoint = powerstationPointMap1.get(ContantXk.CWSLTQTSMX);
-            ProBasicPowerstationPoint lxtsmxPoint = powerstationPointMap1.get(ContantXk.LXTSMX);
-            ProBasicPowerstationPoint txzdmxPoint = powerstationPointMap1.get(ContantXk.TXZDTSMX);
-            ProBasicPowerstationPoint djtsPoint = powerstationPointMap1.get(ContantXk.DJTS);
-            ProBasicPowerstationPoint yxtsPoint = powerstationPointMap1.get(ContantXk.YXTS);
-            ProBasicPowerstationPoint gztsPoint = powerstationPointMap1.get(ContantXk.GZTJTS);
-            ProBasicPowerstationPoint whtsPoint = powerstationPointMap1.get(ContantXk.JXTJTS);
-            ProBasicPowerstationPoint xdtsPoint = powerstationPointMap1.get(ContantXk.XDTS);
-            ProBasicPowerstationPoint sltsPoint = powerstationPointMap1.get(ContantXk.SLTS);
-            ProBasicPowerstationPoint lxtsPoint = powerstationPointMap1.get(ContantXk.TXZDTS);
-
-            if (type.equals("-1")){
-                ProBasicPowerstationPoint finalSspjfsfsPoint = sspjfsPoint;
-                sspjfs.updateAndGet(v -> {
+                gztsmx.updateAndGet(v -> {
                     try {
-                        return new Double((double) (v + edosUtil.getSectionData(finalSspjfsfsPoint, currentDate.getTime() / 1000).getPointValueInDouble()));
+                        return new Double((double) (v + edosUtil.getSectionData(gztsmxPoint, currentDate.getTime() / 1000).getPointValueInDouble()));
                     } catch (Exception e) {
                         e.printStackTrace();
                     }
                     return v;
                 });
-
-
-            }else if (type.equals("-2")){
-                ProBasicPowerstationPoint finalSspjgzdPoint = sspjgzdPoint;
-                sspjgzd.updateAndGet(v -> {
+                cngzmx.updateAndGet(v -> {
                     try {
-                        return new Double((double) (v + edosUtil.getSectionData(finalSspjgzdPoint, currentDate.getTime() / 1000).getPointValueInDouble()));
+                        return new Double((double) (v + edosUtil.getSectionData(cnslmxPoint, currentDate.getTime() / 1000).getPointValueInDouble()));
                     } catch (Exception e) {
                         e.printStackTrace();
                     }
                     return v;
                 });
-
-            }else {
-                ProBasicPowerstationPoint finalSspjfsfsPoint = sspjfsPoint;
-                sspjfs.updateAndGet(v -> {
+                jxtsmx.updateAndGet(v -> {
                     try {
-                        return new Double((double) (v + edosUtil.getSectionData(finalSspjfsfsPoint, currentDate.getTime() / 1000).getPointValueInDouble()));
+                        return new Double((double) (v + edosUtil.getSectionData(jxtsmxPoint, currentDate.getTime() / 1000).getPointValueInDouble()));
                     } catch (Exception e) {
                         e.printStackTrace();
                     }
                     return v;
                 });
-                ProBasicPowerstationPoint finalSspjgzdPoint = sspjgzdPoint;
-                sspjgzd.updateAndGet(v -> {
+                cnjxmx.updateAndGet(v -> {
                     try {
-                        return new Double((double) (v + edosUtil.getSectionData(finalSspjgzdPoint, currentDate.getTime() / 1000).getPointValueInDouble()));
+                        return new Double((double) (v + edosUtil.getSectionData(cnjxmxPoint, currentDate.getTime() / 1000).getPointValueInDouble()));
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                    return v;
+                });
+                djtsmx.updateAndGet(v -> {
+                    try {
+                        return new Double((double) (v + edosUtil.getSectionData(djtsmxPoint, currentDate.getTime() / 1000).getPointValueInDouble()));
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                    return v;
+                });
+                qxjclmx.updateAndGet(v -> {
+                    try {
+                        return new Double((double) (v + edosUtil.getSectionData(qxjclmxPoint, currentDate.getTime() / 1000).getPointValueInDouble()));
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                    return v;
+                });
+                sdtjmx.updateAndGet(v -> {
+                    try {
+                        return new Double((double) (v + edosUtil.getSectionData(sdtjmxPoint, currentDate.getTime() / 1000).getPointValueInDouble()));
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                    return v;
+                });
+                xntsmx.updateAndGet(v -> {
+                    try {
+                        return new Double((double) (v + edosUtil.getSectionData(xntsmxPoint, currentDate.getTime() / 1000).getPointValueInDouble()));
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                    return v;
+                });
+                xdtjmx.updateAndGet(v -> {
+                    try {
+                        return new Double((double) (v + edosUtil.getSectionData(xdtjmxPoint, currentDate.getTime() / 1000).getPointValueInDouble()));
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                    return v;
+                });
+                xdjclmx.updateAndGet(v -> {
+                    try {
+                        return new Double((double) (v + edosUtil.getSectionData(xdjclmxPoint, currentDate.getTime() / 1000).getPointValueInDouble()));
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                    return v;
+                });
+                cwsldwmx.updateAndGet(v -> {
+                    try {
+                        return new Double((double) (v + edosUtil.getSectionData(cwsldwmxPoint, currentDate.getTime() / 1000).getPointValueInDouble()));
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                    return v;
+                });
+                cwsltqmx.updateAndGet(v -> {
+                    try {
+                        return new Double((double) (v + edosUtil.getSectionData(cwsltqmxPoint, currentDate.getTime() / 1000).getPointValueInDouble()));
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                    return v;
+                });
+                lxtsmx.updateAndGet(v -> {
+                    try {
+                        return new Double((double) (v + edosUtil.getSectionData(lxtsmxPoint, currentDate.getTime() / 1000).getPointValueInDouble()));
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                    return v;
+                });
+                txzdmx.updateAndGet(v -> {
+                    try {
+                        return new Double((double) (v + edosUtil.getSectionData(txzdmxPoint, currentDate.getTime() / 1000).getPointValueInDouble()));
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                    return v;
+                });
+                djts.updateAndGet(v -> {
+                    try {
+                        return new Double((double) (v + edosUtil.getSectionData(djtsPoint, currentDate.getTime() / 1000).getPointValueInDouble()));
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                    return v;
+                });
+                yxts.updateAndGet(v -> {
+                    try {
+                        return new Double((double) (v + edosUtil.getSectionData(yxtsPoint, currentDate.getTime() / 1000).getPointValueInDouble()));
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                    return v;
+                });
+                gzts.updateAndGet(v -> {
+                    try {
+                        return new Double((double) (v + edosUtil.getSectionData(gztsPoint, currentDate.getTime() / 1000).getPointValueInDouble()));
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                    return v;
+                });
+                whts.updateAndGet(v -> {
+                    try {
+                        return new Double((double) (v + edosUtil.getSectionData(whtsPoint, currentDate.getTime() / 1000).getPointValueInDouble()));
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                    return v;
+                });
+                xdts.updateAndGet(v -> {
+                    try {
+                        return new Double((double) (v + edosUtil.getSectionData(xdtsPoint, currentDate.getTime() / 1000).getPointValueInDouble()));
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                    return v;
+                });
+                slts.updateAndGet(v -> {
+                    try {
+                        return new Double((double) (v + edosUtil.getSectionData(sltsPoint, currentDate.getTime() / 1000).getPointValueInDouble()));
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                    return v;
+                });
+                lxts.updateAndGet(v -> {
+                    try {
+                        return new Double((double) (v + edosUtil.getSectionData(lxtsPoint, currentDate.getTime() / 1000).getPointValueInDouble()));
                     } catch (Exception e) {
                         e.printStackTrace();
                     }
                     return v;
                 });
             }
-            sszgl.updateAndGet(v -> {
-                try {
-                    return new Double((double) (v + edosUtil.getSectionData(sszglPoint, currentDate.getTime() / 1000).getPointValueInDouble()));
-                } catch (Exception e) {
-                    e.printStackTrace();
-                }
-                return v;
-            });
-            zllgl.updateAndGet(v -> {
-                try {
-                    return new Double((double) (v + edosUtil.getSectionData(sszllglPoint, currentDate.getTime() / 1000).getPointValueInDouble()));
-                } catch (Exception e) {
-                    e.printStackTrace();
-                }
-                return v;
-            });
-            zbzgl.updateAndGet(v -> {
-                try {
-                    return new Double((double) (v + edosUtil.getSectionData(sszbzglPoint, currentDate.getTime() / 1000).getPointValueInDouble()));
-                } catch (Exception e) {
-                    e.printStackTrace();
-                }
-                return v;
-            });
-            znhglzs.updateAndGet(v -> {
-                try {
-                    return new Double((double) (v + edosUtil.getSectionData(ssznhglzsPoint, currentDate.getTime() / 1000).getPointValueInDouble()));
-                } catch (Exception e) {
-                    e.printStackTrace();
-                }
-                return v;
-            });
-            zzygl.updateAndGet(v -> {
-                try {
-                    return new Double((double) (v + edosUtil.getSectionData(sszzyglPoint, currentDate.getTime() / 1000).getPointValueInDouble()));
-                } catch (Exception e) {
-                    e.printStackTrace();
-                }
-                return v;
-            });
-            zkygl.updateAndGet(v -> {
-                try {
-                    return new Double((double) (v + edosUtil.getSectionData(sszkyglPoint, currentDate.getTime() / 1000).getPointValueInDouble()));
-                } catch (Exception e) {
-                    e.printStackTrace();
-                }
-                return v;
-            });
-            zycgl.updateAndGet(v -> {
-                try {
-                    return new Double((double) (v + edosUtil.getSectionData(sszycglPoint, currentDate.getTime() / 1000).getPointValueInDouble()));
-                } catch (Exception e) {
-                    e.printStackTrace();
-                }
-                return v;
-            });
 
-
-
-            gztsmx.updateAndGet(v -> {
-                try {
-                    return new Double((double) (v + edosUtil.getSectionData(gztsmxPoint, currentDate.getTime() / 1000).getPointValueInDouble()));
-                } catch (Exception e) {
-                    e.printStackTrace();
-                }
-                return v;
-            });
-            cngzmx.updateAndGet(v -> {
-                try {
-                    return new Double((double) (v + edosUtil.getSectionData(cnslmxPoint, currentDate.getTime() / 1000).getPointValueInDouble()));
-                } catch (Exception e) {
-                    e.printStackTrace();
-                }
-                return v;
-            });
-            jxtsmx.updateAndGet(v -> {
-                try {
-                    return new Double((double) (v + edosUtil.getSectionData(jxtsmxPoint, currentDate.getTime() / 1000).getPointValueInDouble()));
-                } catch (Exception e) {
-                    e.printStackTrace();
-                }
-                return v;
-            });
-            cnjxmx.updateAndGet(v -> {
-                try {
-                    return new Double((double) (v + edosUtil.getSectionData(cnjxmxPoint, currentDate.getTime() / 1000).getPointValueInDouble()));
-                } catch (Exception e) {
-                    e.printStackTrace();
-                }
-                return v;
-            });
-            djtsmx.updateAndGet(v -> {
-                try {
-                    return new Double((double) (v + edosUtil.getSectionData(djtsmxPoint, currentDate.getTime() / 1000).getPointValueInDouble()));
-                } catch (Exception e) {
-                    e.printStackTrace();
-                }
-                return v;
-            });
-            qxjclmx.updateAndGet(v -> {
-                try {
-                    return new Double((double) (v + edosUtil.getSectionData(qxjclmxPoint, currentDate.getTime() / 1000).getPointValueInDouble()));
-                } catch (Exception e) {
-                    e.printStackTrace();
-                }
-                return v;
-            });
-            sdtjmx.updateAndGet(v -> {
-                try {
-                    return new Double((double) (v + edosUtil.getSectionData(sdtjmxPoint, currentDate.getTime() / 1000).getPointValueInDouble()));
-                } catch (Exception e) {
-                    e.printStackTrace();
-                }
-                return v;
-            });
-            xntsmx.updateAndGet(v -> {
-                try {
-                    return new Double((double) (v + edosUtil.getSectionData(xntsmxPoint, currentDate.getTime() / 1000).getPointValueInDouble()));
-                } catch (Exception e) {
-                    e.printStackTrace();
-                }
-                return v;
-            });
-            xdtjmx.updateAndGet(v -> {
-                try {
-                    return new Double((double) (v + edosUtil.getSectionData(xdtjmxPoint, currentDate.getTime() / 1000).getPointValueInDouble()));
-                } catch (Exception e) {
-                    e.printStackTrace();
-                }
-                return v;
-            });
-            xdjclmx.updateAndGet(v -> {
-                try {
-                    return new Double((double) (v + edosUtil.getSectionData(xdjclmxPoint, currentDate.getTime() / 1000).getPointValueInDouble()));
-                } catch (Exception e) {
-                    e.printStackTrace();
-                }
-                return v;
-            });
-            cwsldwmx.updateAndGet(v -> {
-                try {
-                    return new Double((double) (v + edosUtil.getSectionData(cwsldwmxPoint, currentDate.getTime() / 1000).getPointValueInDouble()));
-                } catch (Exception e) {
-                    e.printStackTrace();
-                }
-                return v;
-            });
-            cwsltqmx.updateAndGet(v -> {
-                try {
-                    return new Double((double) (v + edosUtil.getSectionData(cwsltqmxPoint, currentDate.getTime() / 1000).getPointValueInDouble()));
-                } catch (Exception e) {
-                    e.printStackTrace();
-                }
-                return v;
-            });
-            lxtsmx.updateAndGet(v -> {
-                try {
-                    return new Double((double) (v + edosUtil.getSectionData(lxtsmxPoint, currentDate.getTime() / 1000).getPointValueInDouble()));
-                } catch (Exception e) {
-                    e.printStackTrace();
-                }
-                return v;
-            });
-            txzdmx.updateAndGet(v -> {
-                try {
-                    return new Double((double) (v + edosUtil.getSectionData(txzdmxPoint, currentDate.getTime() / 1000).getPointValueInDouble()));
-                } catch (Exception e) {
-                    e.printStackTrace();
-                }
-                return v;
-            });
-            djts.updateAndGet(v -> {
-                try {
-                    return new Double((double) (v + edosUtil.getSectionData(djtsPoint, currentDate.getTime() / 1000).getPointValueInDouble()));
-                } catch (Exception e) {
-                    e.printStackTrace();
-                }
-                return v;
-            });
-            yxts.updateAndGet(v -> {
-                try {
-                    return new Double((double) (v + edosUtil.getSectionData(yxtsPoint, currentDate.getTime() / 1000).getPointValueInDouble()));
-                } catch (Exception e) {
-                    e.printStackTrace();
-                }
-                return v;
-            });
-            gzts.updateAndGet(v -> {
-                try {
-                    return new Double((double) (v + edosUtil.getSectionData(gztsPoint, currentDate.getTime() / 1000).getPointValueInDouble()));
-                } catch (Exception e) {
-                    e.printStackTrace();
-                }
-                return v;
-            });
-            whts.updateAndGet(v -> {
-                try {
-                    return new Double((double) (v + edosUtil.getSectionData(whtsPoint, currentDate.getTime() / 1000).getPointValueInDouble()));
-                } catch (Exception e) {
-                    e.printStackTrace();
-                }
-                return v;
-            });
-            xdts.updateAndGet(v -> {
-                try {
-                    return new Double((double) (v + edosUtil.getSectionData(xdtsPoint, currentDate.getTime() / 1000).getPointValueInDouble()));
-                } catch (Exception e) {
-                    e.printStackTrace();
-                }
-                return v;
-            });
-            slts.updateAndGet(v -> {
-                try {
-                    return new Double((double) (v + edosUtil.getSectionData(sltsPoint, currentDate.getTime() / 1000).getPointValueInDouble()));
-                } catch (Exception e) {
-                    e.printStackTrace();
-                }
-                return v;
-            });
-            lxts.updateAndGet(v -> {
-                try {
-                    return new Double((double) (v + edosUtil.getSectionData(lxtsPoint, currentDate.getTime() / 1000).getPointValueInDouble()));
-                } catch (Exception e) {
-                    e.printStackTrace();
-                }
-                return v;
-            });
         });
         if (fcComCount.get()==0){
             fcComCount.getAndIncrement();

+ 1 - 1
realtime/generationXK-service/src/main/java/com/gyee/generation/util/realtimesource/EdosUtil.java

@@ -1415,7 +1415,7 @@ public class EdosUtil implements IEdosUtil {
         JSONObject jo = new JSONObject();
         jo.put("tagName", pd.getEdnaId());
         JSONObject joo = new JSONObject();
-        joo.put("ts", pd.getPointTime()*1000);
+        joo.put("ts", pd.getPointTime());
         joo.put("status", 0);
         joo.put("doubleValue", pd.getPointValueInDouble());
         jo.put("tsData", joo);

+ 2 - 2
realtime/generationXK-service/src/main/resources/application-xk.yml

@@ -91,8 +91,8 @@ db:
   url: http://192.168.11.250:8011/ts
   #url: http://124.70.75.91:8011/ts
 #参与计算的场站
-#runWindpowerstation: SD_GDDL_RZLX_FDC_STA,SD_GDDL_QDJN_FDC_STA,SD_GDDL_WHWD_FDC_STA,SD_GDDL_WHXQ_FDC_STA,SD_GDDL_RZWL_FDC_STA,SD_GDDL_WFZC_FDC_STA,SD_GDDL_DZXJ_FDC_STA,SD_GDDL_XTTA_FDC_STA,SD_GDDL_BH1_FDC_STA,SD_GDDL_BH2_FDC_STA,SD_GDDL_CG_FDC_STA,SD_GDDL_FJ_FDC_STA,SD_GDDL_YS_FDC_STA,SD_GDDL_FXFC_FDC_STA,SD_GDDL_JNSS_FDC_STA,SD_GDDL_WFBH_FDC_STA,SD_GDDL_PLHS_FDC_STA,SD_GDDL_JNCQ_FDC_STA,SD_GDDL_LXLN_FDC_STA,SD_GDDL_LQJS_FDC_STA,SD_GDDL_ZYXD_FDC_STA,SD_GDDL_ZYFS_FDC_STA
-runWindpowerstation: SD_GDDL_RZLX_FDC_STA
+runWindpowerstation: SD_GDDL_WHWD_FDC_STA,SD_GDDL_WHXQ_FDC_STA,SD_GDDL_RZLX_FDC_STA,SD_GDDL_QDJN_FDC_STA,SD_SXNY_FXFC_FDC_STA,SD_SXNY_LXLN_FDC_STA,SD_SXNY_LQJS_FDC_STA,SD_SXNY_ZYFS_FDC_STA,SD_LYDL_BH2_FDC_STA,SD_GDDL_RZWL_FDC_STA,SD_SXNY_PLHS_FDC_STA,SD_SXNY_ZYXD_FDC_STA,SD_GDDL_DZXJ_FDC_STA,SD_GDDL_XTTA_FDC_STA,SD_GDDL_WFZC_FDC_STA,SD_SXNY_JNSS_FDC_STA,SD_SXNY_WFBH_FDC_STA,SD_LYDL_CG_FDC_STA,SD_LYDL_FJ_FDC_STA,SD_LYDL_YS_FDC_STA,SD_SXNY_JNCQ_FDC_STA,SD_LYDL_BH1_FDC_STA,SD_GHTZ_HZJ_GDC_STA
+#runWindpowerstation: SD_GDDL_RZLX_FDC_STA
 #计算状态用ai或者di
 clauStatus:
   ai: GJY03_GC,YLZ01_GC,PTZ02_GC   #配置期次

+ 2 - 2
realtime/generationXK-service/src/main/resources/application.yml

@@ -1,6 +1,6 @@
 spring:
   profiles:
-#    active: xk
-    active: yun
+    active: xk
+#    active: yun
 
 #    active: td

+ 26 - 0
realtime/generationXK-service/src/test/java/com/gyee/generation/GenerationTest.java

@@ -44,6 +44,10 @@ public class GenerationTest {
     private RegionCalreService regionCalreService;
     @Resource
     private RegionCalService regionCalService;
+    @Resource
+    private AccessStatusService accessStatusService;
+    @Resource
+    private CalculationService calculationService;
 
     @Test
     public void test1() throws Exception {
@@ -70,5 +74,27 @@ public class GenerationTest {
 
     @Test
     public void test3() throws Exception {
+//        //场站接入状态,总预测功率
+//        accessStatusService.accessStatus();
+//        //全场状态
+//        accessStatusService.fullFieldState();
+
+
+//                statusService.powerRationing();
+//        statusService.statusReal();
+//        statusService.calculateStatusNumber();
+
+//         realtimeService.savaRealtimeTarget();
+//        cycleCalculationService.saveCyle();
+
+//        electricityMeteringService.saveGenerationDatas();
+
+//        calculationService.calWp();
+
+//        regionCalService.companyCal();
+//        regionCalService.RegionCal();
+
+        regionCalreService.companyCal();
+        regionCalreService.RegionCal();
     }
 }