|
@@ -31,128 +31,128 @@ public class AccessStatusService {
|
|
|
*
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
- public void accessStatus() throws Exception {
|
|
|
-
|
|
|
- List<PointData> resultList = new ArrayList<>();
|
|
|
- List<ProBasicMeterPoint> meterpoints = CacheContext.meterpoints;
|
|
|
- List<ProBasicPowerstation> wpls = CacheContext.wpls;
|
|
|
- List<ProBasicSubStation> subwpls = CacheContext.subwpls;
|
|
|
- List<ProBasicWeatherStation> wswpls = CacheContext.wswpls;
|
|
|
- Map<String, Map<String, ProBasicPowerstationPoint>> subwppointmap = CacheContext.subwppointmap;
|
|
|
- Map<String, Map<String, ProBasicPowerstationPoint>> wswppointmap = CacheContext.wswppointmap;
|
|
|
- Map<String, Map<String, ProBasicPowerstationPoint>> wppointmap = CacheContext.wppointmap;
|
|
|
- Date currentDate = DateUtils.getCurrentDate();
|
|
|
-
|
|
|
- wpls.stream().forEach(wp -> {
|
|
|
- Map<String, ProBasicPowerstationPoint> powerstationPointMap = wppointmap.get(wp.getId());
|
|
|
- ProBasicPowerstationPoint djlpoint = powerstationPointMap.get(ContantXk.DQJRZT);
|
|
|
- ProBasicPowerstationPoint agcpoint = powerstationPointMap.get(ContantXk.AGCJRZT);
|
|
|
- ProBasicPowerstationPoint glycpoint = powerstationPointMap.get(ContantXk.GLYCJRZT);
|
|
|
- ProBasicPowerstationPoint cftpoint = powerstationPointMap.get(ContantXk.QXZJRZT);
|
|
|
- ProBasicPowerstationPoint sbjrpoint = powerstationPointMap.get(ContantXk.SBJRZT);
|
|
|
- ProBasicPowerstationPoint czztpoint = powerstationPointMap.get(ContantXk.CZZT);
|
|
|
-
|
|
|
- ProBasicPowerstationPoint qcztPoint = powerstationPointMap.get(ContantXk.QCZT);
|
|
|
-
|
|
|
- ProBasicPowerstationPoint zycglpoint = powerstationPointMap.get(ContantXk.ZYCGL);
|
|
|
- double djlzt = 0;
|
|
|
- double fjzt = 0;
|
|
|
- double agczt = 0;
|
|
|
- double glyczt = 0;
|
|
|
- double cftzt = 0;
|
|
|
- double czzt = 0;
|
|
|
-
|
|
|
- double zycgl = 0;
|
|
|
- Optional<ProBasicMeterPoint> swdlOptional = meterpoints.stream().filter(me -> me.getWindpowerstationId().equals(wp.getId()) && "ZXYG".equals(me.getUniformCode()) && "出线".equals(me.getMeterType()) && "主".equals(me.getMeterSort())).findFirst();
|
|
|
- Optional<ProBasicSubStation> subStationOptional = subwpls.stream().filter(sub -> sub.getWindpowerstationId().equals(wp.getId())).findFirst();
|
|
|
- Optional<ProBasicWeatherStation> wsOptional = wswpls.stream().filter(ws -> ws.getWindpowerstationId().equals(wp.getId())).findFirst();
|
|
|
- List<ProBasicSubStation> stations = subwpls.stream().filter(sub -> sub.getWindpowerstationId().equals(wp.getId())).collect(Collectors.toList());
|
|
|
- List<String> pointList = new ArrayList<>();
|
|
|
- stations.stream().forEach(station -> {
|
|
|
- pointList.add(subwppointmap.get(station.getId()).get(ContantXk.TPOINT_WP_YCGL).getNemCode());
|
|
|
- });
|
|
|
- try {
|
|
|
- zycgl = edosUtil.getRealData(pointList).stream().mapToDouble(PointData::getPointValueInDouble).sum();
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- try {
|
|
|
- double qczt = edosUtil.getSectionData(qcztPoint, currentDate.getTime()).getPointValueInDouble();
|
|
|
- if (qczt != 6) {
|
|
|
- fjzt = 1;
|
|
|
- }
|
|
|
-
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
- if (swdlOptional.isPresent()) {
|
|
|
- ProBasicMeterPoint proBasicMeterPoint = swdlOptional.get();
|
|
|
- try {
|
|
|
- Long pointTime = edosUtil.getRealData(proBasicMeterPoint.getNemCode()).getPointTime();
|
|
|
- if ((currentDate.getTime() - pointTime) / 1000 < Integer.parseInt(second)) {
|
|
|
- djlzt = 1;
|
|
|
- }
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
- }
|
|
|
- if (wsOptional.isPresent()) {
|
|
|
- Map<String, ProBasicPowerstationPoint> basicPowerstationPointMap = wswppointmap.get(wsOptional.get().getId());
|
|
|
-
|
|
|
- ProBasicPowerstationPoint proBasicPowerstationPoint = null;
|
|
|
- if (wp.getWindType().equals("-1")) {
|
|
|
- proBasicPowerstationPoint = basicPowerstationPointMap.get(ContantXk.FCCFTWD);
|
|
|
- } else if (wp.getWindType().equals("-2")) {
|
|
|
- proBasicPowerstationPoint = basicPowerstationPointMap.get(ContantXk.QXZWD);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- try {
|
|
|
- Long pointTime = edosUtil.getRealData(proBasicPowerstationPoint.getNemCode()).getPointTime();
|
|
|
- if ((currentDate.getTime() - pointTime) / 1000 < Integer.parseInt(second)) {
|
|
|
- cftzt = 1;
|
|
|
- }
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
- }
|
|
|
- if (subStationOptional.isPresent()) {
|
|
|
- Map<String, ProBasicPowerstationPoint> basicPowerstationPointMap = subwppointmap.get(subStationOptional.get().getId());
|
|
|
- ProBasicPowerstationPoint agcpowerstationPoint = basicPowerstationPointMap.get(ContantXk.TPOINT_WP_CXGL);
|
|
|
- try {
|
|
|
- Long pointTime = edosUtil.getRealData(agcpowerstationPoint.getNemCode()).getPointTime();
|
|
|
- if ((currentDate.getTime() - pointTime) / 1000 < Integer.parseInt(second)) {
|
|
|
- agczt = 1;
|
|
|
- }
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
- ProBasicPowerstationPoint glycpowerstationPoint = basicPowerstationPointMap.get(ContantXk.TPOINT_WP_YCGL);
|
|
|
- try {
|
|
|
- Long pointTime = edosUtil.getRealData(glycpowerstationPoint.getNemCode()).getPointTime();
|
|
|
- if ((currentDate.getTime() - pointTime) / 1000 < Integer.parseInt(second)) {
|
|
|
- glyczt = 1;
|
|
|
- }
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
- }
|
|
|
- if (djlzt == 1 || agczt == 1 || glyczt == 1 || fjzt == 1 || cftzt == 1) {
|
|
|
- czzt = 1;
|
|
|
- }
|
|
|
- resultList.add(PointUtil.createPointData(currentDate, zycgl, zycglpoint.getNemCode(), zycglpoint.getName()));
|
|
|
- resultList.add(PointUtil.createPointData(currentDate, djlzt, djlpoint.getNemCode(), djlpoint.getName()));
|
|
|
- resultList.add(PointUtil.createPointData(currentDate, agczt, agcpoint.getNemCode(), agcpoint.getName()));
|
|
|
- resultList.add(PointUtil.createPointData(currentDate, glyczt, glycpoint.getNemCode(), glycpoint.getName()));
|
|
|
- resultList.add(PointUtil.createPointData(currentDate, cftzt, cftpoint.getNemCode(), cftpoint.getName()));
|
|
|
- resultList.add(PointUtil.createPointData(currentDate, fjzt, sbjrpoint.getNemCode(), sbjrpoint.getName()));
|
|
|
- resultList.add(PointUtil.createPointData(currentDate, czzt, czztpoint.getNemCode(), czztpoint.getName()));
|
|
|
- });
|
|
|
- edosUtil.sendMultiPoint(resultList);
|
|
|
-
|
|
|
- }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
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