소스 검색

Merge branch 'master' of http://49.4.49.126:3000/GYEE_R.D/Gyee_Frame_NX

shilin 3 년 전
부모
커밋
f1a54d6ded

+ 7 - 0
src/main/java/com/gyee/frame/common/feign/IAdapterService.java

@@ -2,9 +2,12 @@ package com.gyee.frame.common.feign;
 
 import com.alibaba.fastjson.JSONObject;
 import com.gyee.frame.model.custom.export.TsPointData;
+import com.gyee.frame.util.golden.timeseries.TsData;
 import feign.Headers;
 import feign.Param;
 import feign.RequestLine;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestParam;
 
 import java.util.List;
 
@@ -22,6 +25,10 @@ public interface IAdapterService {
     List<TsPointData> getHistorySnap(@Param(value = "tagName") String tagName, @Param(value = "startTs") long startTs,
                                      @Param(value = "endTs") long endTs, @Param(value = "interval") Integer interval);
 
+    @Headers({"Content-Type: application/json", "Accept: application/json"})
+    @RequestLine("GET /ts/history/raw?tagName={tagName}&startTs={startTs}&endTs={endTs}")
+    List<TsPointData> getHistoryRaw(@Param(value = "tagName") String tagName, @Param(value = "startTs") long startTs,
+                                     @Param(value = "endTs") long endTs);
 
     @Headers({"Content-Type: application/json", "Accept: application/json"})
     @RequestLine("GET /ts/history/section?tagNames={tagNames}&ts={ts}")

+ 31 - 8
src/main/java/com/gyee/frame/controller/health/ReliabilityAnalysisController.java

@@ -10,6 +10,7 @@ import com.gyee.frame.model.auto.MetricsUniformCode;
 import com.gyee.frame.model.auto.WindTurbineTestingPointAi2;
 import com.gyee.frame.model.auto.WindTurbineTestingPointDi2;
 import com.gyee.frame.model.custom.export.TsPointData;
+import com.gyee.frame.model.custom.weather.Sys;
 import com.gyee.frame.service.Alertrule2ervice;
 import com.gyee.frame.service.WindTurbineTestingPointAiService;
 import com.gyee.frame.service.WindTurbineTestingPointDiService;
@@ -19,12 +20,10 @@ import io.swagger.annotations.Api;
 import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 @RestController
+@CrossOrigin
 @RequestMapping("/analysis")
 @Api(value = "可靠性分析" ,tags =  "可靠性分析")
 public class ReliabilityAnalysisController {
@@ -58,7 +57,8 @@ public class ReliabilityAnalysisController {
             @RequestParam(name = "wtId") String wtId,
             @RequestParam(name = "name") String name,
             @RequestParam(name = "startTs") long startTs,
-            @RequestParam(name = "endTs") long endTs){
+            @RequestParam(name = "endTs") long endTs,
+            @RequestParam(name = "interval", required = false) Optional<Integer> interval){
 
         List<Object> list = new ArrayList<>();
 
@@ -70,11 +70,15 @@ public class ReliabilityAnalysisController {
             Map<String, Object> map = new HashMap<>();
             if (code.startsWith("AI")){
                 WindTurbineTestingPointAi2 windAI = windAIService.getWindTurbineTestingPointAi2(wtId, code);
-                List<TsPointData> data = remoteService.ShardingService().getHistorySnap(windAI.getId(), startTs, endTs, 60);
+                List<TsPointData> data = null;
+                if (interval.isPresent() && interval.get() > 0)
+                    data = remoteService.ShardingService().getHistorySnap(windAI.getId(), startTs, endTs, interval.get());
+                else
+                    data = remoteService.ShardingService().getHistoryRaw(windAI.getId(), startTs, endTs);
 
                 // 查询点的单位和描述属性
-                String unit = "";
-                String desc = "";
+                String unit = "--";
+                String desc = "----";
                 List<MetricsUniformCode> metricsList = uniformCodeService.getListByStationAndUniforCode(station, windAI.getUniformcode());
                 if (metricsList != null && metricsList.size() > 0) {
                     MetricsUniformCode metricsUniformCode = metricsList.get(0);
@@ -95,4 +99,23 @@ public class ReliabilityAnalysisController {
         return AjaxResult.successData(AjaxStatus.success.code, list);
     }
 
+
+    @Resource
+    WindTurbineTestingPointAiService windTurbineTestingPointAiService;
+
+    @GetMapping("/test")
+    public AjaxResult get(){
+        List<String> list = alertrule2ervice.getUniformCodeByNameAndStations();
+
+        List<String> modelID = alertrule2ervice.getModelID();
+
+
+//        for (String model : modelID)
+//            System.out.println(model);
+
+        List<String> winds = windTurbineTestingPointAiService.findPointByUniformcode(list, modelID);
+
+        return AjaxResult.successData(AjaxStatus.success.code, winds);
+    }
+
 }

+ 38 - 0
src/main/java/com/gyee/frame/service/Alertrule2ervice.java

@@ -261,4 +261,42 @@ public class Alertrule2ervice implements BaseService<Alertrule2, Alertrule2Examp
 
         return list;
     }
+
+    public List<String> getUniformCodeByNameAndStations(){
+        Alertrule2Example example = new Alertrule2Example();
+
+        List<Alertrule2> rules = alertrule2Mapper.selectByExample(example);
+        if (rules == null || rules.size() == 0)
+            return null;
+
+        List<String> list = new ArrayList<>();
+        for (Alertrule2 rule : rules){
+            String expression = "[AI,DI](.{4})";
+            List<String> lists = StringUtils.pattern(rule.getExpression(), expression);
+            for (String ls : lists){
+                if (!list.contains(ls) && (ls.startsWith("AI") || ls.startsWith("DI")))
+                    list.add(ls);
+            }
+        }
+
+        return list;
+    }
+
+    public List<String> getModelID(){
+        Alertrule2Example example = new Alertrule2Example();
+
+        List<Alertrule2> rules = alertrule2Mapper.selectByExample(example);
+        if (rules == null || rules.size() == 0)
+            return null;
+
+        List<String> list = new ArrayList<>();
+        for (Alertrule2 rule : rules){
+            String modelis = rule.getModelid();
+            if (!list.contains(modelis))
+                list.add(modelis);
+
+        }
+
+        return list;
+    }
 }

+ 32 - 3
src/main/java/com/gyee/frame/service/SysUserService.java

@@ -250,7 +250,36 @@ public class SysUserService implements BaseService<TsysUser, TsysUserExample>{
 		//修改用户信息
 		return tsysUserMapper.updateByPrimaryKeySelective(record);
 	}
-	
-	
-	
+
+	/**
+	 *
+	 * @param username
+	 * @return
+	 */
+	public TsysUser findUser(String username) {
+		TsysUserExample example=new TsysUserExample();
+		example.createCriteria().andUsernameEqualTo(username);
+		List<TsysUser> list=tsysUserMapper.selectByExample(example);
+		if(null == list || list.size()<=0){
+			return null;
+		}
+		return list.get(0);
+	}
+
+	/**
+	 *
+	 * @param username
+	 * @return
+	 */
+	public TsysUser findUser(String username,String password) {
+		TsysUserExample example=new TsysUserExample();
+		example.createCriteria().andUsernameEqualTo(username);
+		example.createCriteria().andPasswordEqualTo(password);
+		List<TsysUser> list=tsysUserMapper.selectByExample(example);
+		if(null == list || list.size()<=0){
+			return null;
+		}
+		return list.get(0);
+	}
+
 }

+ 29 - 0
src/main/java/com/gyee/frame/service/WindTurbineTestingPointAiService.java

@@ -9,6 +9,7 @@ import com.gyee.frame.mapper.auto.WindTurbineTestingPointAi2Mapper;
 import com.gyee.frame.model.auto.WindTurbineTestingPointAi2;
 import com.gyee.frame.model.auto.WindTurbineTestingPointAi2Example;
 import com.gyee.frame.model.custom.Tablepar;
+import com.gyee.frame.model.custom.weather.Sys;
 import com.gyee.frame.model.custom.weather.Wind;
 import com.gyee.frame.util.SnowflakeIdWorker;
 import com.gyee.frame.util.StringUtils;
@@ -17,6 +18,7 @@ import org.springframework.cache.annotation.CacheConfig;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
+import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 
@@ -180,4 +182,31 @@ public class WindTurbineTestingPointAiService implements BaseService<WindTurbine
 
 		return list;
 	}
+
+	public List<String> findPointByUniformcode(List<String> list,List<String> models){
+		List<String> lists = new ArrayList<>();
+
+		for (String model : models){
+			for (String ls : list){
+				WindTurbineTestingPointAi2Example example = new WindTurbineTestingPointAi2Example();
+				example.createCriteria().andUniformcodeEqualTo(ls).andModelidLike("%"+model+"%");
+
+				List<WindTurbineTestingPointAi2> winds = windTurbineTestingPointAi2Mapper.selectByExample(example);
+
+				if (winds == null || winds.size() == 0)
+					continue;
+
+				for (WindTurbineTestingPointAi2 wind : winds) {
+					if (wind != null && wind.getId().contains("FJ")) {
+						lists.add(wind.getId() + "$" + wind.getName() + "@" + wind.getModelid());
+//						System.out.println(wind.getId() + "," + wind.getModelid());
+						break;
+					}
+				}
+			}
+		}
+
+
+		return lists;
+	}
 }

+ 1 - 1
src/main/java/com/gyee/frame/service/health/HealthMainService.java

@@ -962,7 +962,7 @@ public class HealthMainService {
 
         //        Map<String, List<MatrixVo>> fjmap = new HashMap<>();
         List<List<MatrixVo>> fjvos = new ArrayList<>();
-        Map<String, Map<String, Object>> fczbmap = new HashMap<>();
+        Map<String, Map<String, Object>> fczbmap = new LinkedHashMap<>();
         for (Windpowerstation wp : InitialRunner.wpls) {
 
             Map<String, Object> jczbmap = new HashMap<>();

+ 441 - 291
src/main/java/com/gyee/frame/service/websocket/GenreSetPushService.java

@@ -364,13 +364,13 @@ public class GenreSetPushService {
 
             if (id.equals(QS)) {
                 // 减排二氧化碳
-                Double jpeyht = realApiUtil.getRealData(ConstantTR.JPEYHT).getPointValueInDouble();
+                int jpeyht = (int) (realApiUtil.getRealData(ConstantTR.JPEYHT).getPointValueInDouble() * 10000);
                 // 节约标煤
-                Double jybm = realApiUtil.getRealData(ConstantTR.JYBM).getPointValueInDouble();
+                int jybm = (int)(realApiUtil.getRealData(ConstantTR.JYBM).getPointValueInDouble() * 10000);
                 // 减排二氧化硫
-                Double jpeyhl = realApiUtil.getRealData(ConstantTR.JPEYHL).getPointValueInDouble();
+                int jpeyhl = (int)(realApiUtil.getRealData(ConstantTR.JPEYHL).getPointValueInDouble() * 10000);
                 // 节约水
-                Double jys = realApiUtil.getRealData(ConstantTR.JYS).getPointValueInDouble();
+                int jys = (int)(realApiUtil.getRealData(ConstantTR.JYS).getPointValueInDouble() * 10000);
 
                 Double gfsjgl = realApiUtil.getRealData(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(GF, Constant.TPOINT_WP_SJGL)).getPointValueInDouble();
 
@@ -541,13 +541,23 @@ public class GenreSetPushService {
 
                     List<MatrixVo> vos = new ArrayList<>();
                     List<String> fjzbls = new ArrayList<>();
+                    List<String> gfzbls = new ArrayList<>();
+                    //光伏没有明细计算点,所以区分开
+                    if (wp.getId().endsWith("FDC")) {
                         for (Windturbine wt : wtls) {
-                            //状态
+                            //明细状态
                             fjzbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wt.getId(), Constant.ZTMX).getId());
-
+                        }
+                    } else if (wp.getId().endsWith("GDC")) {
+                        for (Windturbine wt : wtls) {
+                            //状态
+                            gfzbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wt.getId(), Constant.FJZT).getId());
+                        }
                     }
 
+
                     List<PointData> fjzblist = realApiUtil.getRealData(fjzbls);
+                    List<PointData> gfzblist = realApiUtil.getRealData(gfzbls);
 
                     if (!fjzblist.isEmpty() && fjzblist.size() == fjzbls.size()) {
 
@@ -603,12 +613,43 @@ public class GenreSetPushService {
 
                                     break;
                             }
+                        }
+                    }
+
+                    if (!gfzblist.isEmpty() && gfzblist.size() == gfzblist.size()) {
+                        for (int i = 0; i < wtls.size(); i++) {
+                            double gfzt = MathUtil.twoBit(MathUtil.twoBit(gfzblist.get(i).getPointValueInDouble()));
+                            switch (Double.valueOf(gfzt).intValue()) {
+                                case 0:
+                                    djnum++;
+                                    break;
+                                case 1:
+                                    zcfdnum++;
+                                    break;
+                                case 2:
+                                    gztjnum++;
+                                    break;
+                                case 3:
+                                    lxnum++;
+                                    break;
+                                case 4:
+                                    jxtjnum++;
+                                    break;
+                                case 5:
+                                    xdjclnum++;
+                                    break;
+                                case 6:
+                                    xdjclnum++;
+                                    break;
 
+                                default:
 
+                                    break;
+                            }
                         }
 
-
                     }
+
                 }
 
                 mxztmap.put("jrts", djnum + sdtjnum + zcfdnum + qxjclnum + xdjclnum + xdtjnum + gztjnum + cnsltjnum + jxtjnum + cnsljxnum + dwslnum + hjslnum + lxnum);
@@ -629,85 +670,195 @@ public class GenreSetPushService {
                 mxztmap.put("lxts", lxnum);
 
             } else {
-                List<String> mxztls = new ArrayList<>();
+
                 //待机台数
-                mxztls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.DJNUM).getCode());
+                Double djnum = 0.0;
                 //手动停机台数
-                mxztls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.TJNUM).getCode());
+                Double sdtjnum = 0.0;
                 //正常发电台数
-                mxztls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.FDNUM).getCode());
-                // 缺陷降出力台数
-                mxztls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.FDJCLNUM).getCode());
+                Double zcfdnum = 0.0;
+                //缺陷降出力台数
+                Double qxjclnum = 0.0;
                 // 限电降出力台数
-                mxztls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.XDJCLNUM).getCode());
+                Double xdjclnum = 0.0;
                 // 限电停机台数
-                mxztls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.XDTJNUM).getCode());
+                Double xdtjnum = 0.0;
                 // 故障停机台数
-                mxztls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.GZNUM).getCode());
+                Double gztjnum = 0.0;
                 // 场内受累停机台数
-                mxztls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.CNGZNUM).getCode());
+                Double cnsltjnum = 0.0;
                 // 检修停机台数
-                mxztls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.JXNUM).getCode());
+                Double jxtjnum = 0.0;
                 // 场内受累检修台数
-                mxztls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.CNJXNUM).getCode());
+                Double cnsljxnum = 0.0;
                 // 电网受累台数
-                mxztls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.DWSLNUM).getCode());
+                Double dwslnum = 0.0;
                 // 环境受累台数
-                mxztls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.HJSLNUM).getCode());
+                Double hjslnum = 0.0;
                 // 风机离线台数
-                mxztls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.LXNUM).getCode());
+                Double lxnum = 0.0;
 
 
-                List<PointData> mxztlist = realApiUtil.getRealData(mxztls);
+                if (id.endsWith("FDC")) {
+                    List<String> mxztls = new ArrayList<>();
+                    //待机台数
+                    mxztls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.DJNUM).getCode());
+                    //手动停机台数
+                    mxztls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.TJNUM).getCode());
+                    //正常发电台数
+                    mxztls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.FDNUM).getCode());
+                    // 缺陷降出力台数
+                    mxztls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.FDJCLNUM).getCode());
+                    // 限电降出力台数
+                    mxztls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.XDJCLNUM).getCode());
+                    // 限电停机台数
+                    mxztls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.XDTJNUM).getCode());
+                    // 故障停机台数
+                    mxztls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.GZNUM).getCode());
+                    // 场内受累停机台数
+                    mxztls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.CNGZNUM).getCode());
+                    // 检修停机台数
+                    mxztls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.JXNUM).getCode());
+                    // 场内受累检修台数
+                    mxztls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.CNJXNUM).getCode());
+                    // 电网受累台数
+                    mxztls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.DWSLNUM).getCode());
+                    // 环境受累台数
+                    mxztls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.HJSLNUM).getCode());
+                    // 风机离线台数
+                    mxztls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.LXNUM).getCode());
+
+
+                    List<PointData> mxztlist = realApiUtil.getRealData(mxztls);
+
+                    if (!mxztlist.isEmpty() && mxztlist.size() == mxztls.size()) {
+
+
+                        //待机台数
+                        djnum = MathUtil.twoBit(mxztlist.get(0).getPointValueInDouble());
+                        mxztmap.put("djts", djnum);
+                        //手动停机台数
+                        sdtjnum = MathUtil.twoBit(mxztlist.get(1).getPointValueInDouble());
+                        mxztmap.put("sdtjts", sdtjnum);
+                        //正常发电台数
+                        zcfdnum = MathUtil.twoBit(mxztlist.get(2).getPointValueInDouble());
+                        mxztmap.put("yxts", zcfdnum);
+                        //缺陷降出力台数
+                        qxjclnum = MathUtil.twoBit(mxztlist.get(3).getPointValueInDouble());
+                        mxztmap.put("fdjclts", qxjclnum);
+                        // 限电降出力台数
+                        xdjclnum = MathUtil.twoBit(mxztlist.get(4).getPointValueInDouble());
+                        mxztmap.put("xdjclts", xdjclnum);
+                        // 限电停机台数
+                        xdtjnum = MathUtil.twoBit(mxztlist.get(5).getPointValueInDouble());
+                        mxztmap.put("xdtjts", xdtjnum);
+                        // 故障停机台数
+                        gztjnum = MathUtil.twoBit(mxztlist.get(6).getPointValueInDouble());
+                        mxztmap.put("gzts", gztjnum);
+                        // 场内受累停机台数
+                        cnsltjnum = MathUtil.twoBit(mxztlist.get(7).getPointValueInDouble());
+                        mxztmap.put("cnslgzts", cnsltjnum);
+                        // 检修停机台数
+                        jxtjnum = MathUtil.twoBit(mxztlist.get(8).getPointValueInDouble());
+                        mxztmap.put("jxts", jxtjnum);
+                        // 场内受累检修台数
+                        cnsljxnum = MathUtil.twoBit(mxztlist.get(9).getPointValueInDouble());
+                        mxztmap.put("cnsljxts", cnsljxnum);
+                        // 电网受累台数
+                        dwslnum = MathUtil.twoBit(mxztlist.get(10).getPointValueInDouble());
+                        mxztmap.put("dwslts", dwslnum);
+                        // 环境受累台数
+                        hjslnum = MathUtil.twoBit(mxztlist.get(11).getPointValueInDouble());
+                        mxztmap.put("hjslts", hjslnum);
+                        // 风机离线台数
+                        lxnum = MathUtil.twoBit(mxztlist.get(12).getPointValueInDouble());
+                        mxztmap.put("lxts", lxnum);
+
+
+                        mxztmap.put("jrts", djnum + sdtjnum + zcfdnum + qxjclnum + xdjclnum + xdtjnum + gztjnum + cnsltjnum + jxtjnum + cnsljxnum + dwslnum + hjslnum + lxnum);
+
+                    } else {
+
+                        mxztmap.put("djts", 0.0);
+                        mxztmap.put("sdtjts", 0.0);
+                        mxztmap.put("yxts", 0.0);
+                        mxztmap.put("fdjclts", 0.0);
+                        mxztmap.put("xdjclts", 0.0);
+                        mxztmap.put("xdtjts", 0.0);
+                        mxztmap.put("gzts", 0.0);
+                        mxztmap.put("cnslgzts", 0.0);
+                        mxztmap.put("jxts", 0.0);
+                        mxztmap.put("cnsljxts", 0.0);
+                        mxztmap.put("dwslts", 0.0);
+                        mxztmap.put("hjslts", 0.0);
+                        mxztmap.put("lxts", 0.0);
+                        mxztmap.put("jrts", 0.0);
+                    }
+
+                }else if (id.endsWith("GDC")){
+                    List<String> gfzbls = new ArrayList<>();
 
-                if (!mxztlist.isEmpty() && mxztlist.size() == mxztls.size()) {
+                    List<Windturbine> wtls = InitialRunner.wp_wtmap.get(id);
+                    for(Windturbine wt:wtls) {
+                        //状态
+                        gfzbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wt.getId(), Constant.FJZT).getId());
+                    }
+                    List<PointData> gfzblist = realApiUtil.getRealData(gfzbls);
+                    if (!gfzblist.isEmpty() && gfzblist.size() == gfzblist.size()) {
+                        for (int i = 0; i < wtls.size(); i++) {
+                            double gfzt = MathUtil.twoBit(MathUtil.twoBit(gfzblist.get(i).getPointValueInDouble()));
+                            switch (Double.valueOf(gfzt).intValue()) {
+                                case 0:
+                                    djnum++;
+                                    break;
+                                case 1:
+                                    zcfdnum++;
+                                    break;
+                                case 2:
+                                    gztjnum++;
+                                    break;
+                                case 3:
+                                    lxnum++;
+                                    break;
+                                case 4:
+                                    jxtjnum++;
+                                    break;
+                                case 5:
+                                    xdjclnum++;
+                                    break;
+                                case 6:
+                                    xdjclnum++;
+                                    break;
+                                default:
+                                    break;
+                            }
 
+                        }
+                    }
 
                     //待机台数
-                    Double djnum = MathUtil.twoBit(mxztlist.get(0).getPointValueInDouble());
                     mxztmap.put("djts", djnum);
-                    //手动停机台数
-                    Double sdtjnum = MathUtil.twoBit(mxztlist.get(1).getPointValueInDouble());
-                    mxztmap.put("sdtjts", sdtjnum);
                     //正常发电台数
-                    Double zcfdnum = MathUtil.twoBit(mxztlist.get(2).getPointValueInDouble());
                     mxztmap.put("yxts", zcfdnum);
-                    //缺陷降出力台数
-                    Double qxjclnum = MathUtil.twoBit(mxztlist.get(3).getPointValueInDouble());
-                    mxztmap.put("fdjclts", qxjclnum);
                     // 限电降出力台数
-                    Double xdjclnum = MathUtil.twoBit(mxztlist.get(4).getPointValueInDouble());
                     mxztmap.put("xdjclts", xdjclnum);
-                    // 限电停机台数
-                    Double xdtjnum = MathUtil.twoBit(mxztlist.get(5).getPointValueInDouble());
-                    mxztmap.put("xdtjts", xdtjnum);
                     // 故障停机台数
-                    Double gztjnum = MathUtil.twoBit(mxztlist.get(6).getPointValueInDouble());
                     mxztmap.put("gzts", gztjnum);
-                    // 场内受累停机台数
-                    Double cnsltjnum = MathUtil.twoBit(mxztlist.get(7).getPointValueInDouble());
-                    mxztmap.put("cnslgzts", cnsltjnum);
                     // 检修停机台数
-                    Double jxtjnum = MathUtil.twoBit(mxztlist.get(8).getPointValueInDouble());
                     mxztmap.put("jxts", jxtjnum);
-                    // 场内受累检修台数
-                    Double cnsljxnum = MathUtil.twoBit(mxztlist.get(9).getPointValueInDouble());
-                    mxztmap.put("cnsljxts", cnsljxnum);
                     // 电网受累台数
-                    Double dwslnum = MathUtil.twoBit(mxztlist.get(10).getPointValueInDouble());
                     mxztmap.put("dwslts", dwslnum);
-                    // 环境受累台数
-                    Double hjslnum = MathUtil.twoBit(mxztlist.get(11).getPointValueInDouble());
-                    mxztmap.put("hjslts", hjslnum);
                     // 风机离线台数
-                    Double lxnum = MathUtil.twoBit(mxztlist.get(12).getPointValueInDouble());
                     mxztmap.put("lxts", lxnum);
-
+                    mxztmap.put("sdtjts", 0.0);
+                    mxztmap.put("fdjclts", 0.0);
+                    mxztmap.put("xdtjts", 0.0);
+                    mxztmap.put("cnslgzts", 0.0);
+                    mxztmap.put("cnsljxts", 0.0);
+                    mxztmap.put("hjslts", 0.0);
 
                     mxztmap.put("jrts", djnum + sdtjnum + zcfdnum + qxjclnum + xdjclnum + xdtjnum + gztjnum + cnsltjnum + jxtjnum + cnsljxnum + dwslnum + hjslnum + lxnum);
-
-                } else {
-
+                }else {
                     mxztmap.put("djts", 0.0);
                     mxztmap.put("sdtjts", 0.0);
                     mxztmap.put("yxts", 0.0);
@@ -724,7 +875,6 @@ public class GenreSetPushService {
                     mxztmap.put("jrts", 0.0);
                 }
             }
-
             map.put("mxztmap", mxztmap);
 //
 
@@ -959,7 +1109,7 @@ public class GenreSetPushService {
                 }
 
                 //环比风能利用率
-                 Map<String, Double> hbmap=getHbWs(id);
+                Map<String, Double> hbmap=getHbWs(id);
                 if(hbmap.containsKey("rfnlyl"))
                 {
                     double rhb=hbmap.get("rfnlyl");
@@ -1221,27 +1371,27 @@ public class GenreSetPushService {
 
 
     public Map<String, Object> findPowerInfo(String id) throws Exception {
-            Map<String, Object> map = new HashMap<String, Object>();
-            if (StringUtils.notEmp(id)) {
-
+        Map<String, Object> map = new HashMap<String, Object>();
+        if (StringUtils.notEmp(id)) {
 
-    /****************************************************日功率曲线**********************************************************/
 
-                List<DataVo> glvos = realPowerPushService.findRealPower(id);
-                map.put("glvos", glvos);
-    /*************************************************日功率曲线*************************************************************/
+            /****************************************************日功率曲线**********************************************************/
 
-    /****************************************************日电量历史**********************************************************/
+            List<DataVo> glvos = realPowerPushService.findRealPower(id);
+            map.put("glvos", glvos);
+            /*************************************************日功率曲线*************************************************************/
 
-                List<DataVo> rdlvos = findPowerWpBar(id);
-                map.put("rdlvos", rdlvos);
-    /*************************************************日电量历史*************************************************************/
+            /****************************************************日电量历史**********************************************************/
 
-            }
+            List<DataVo> rdlvos = findPowerWpBar(id);
+            map.put("rdlvos", rdlvos);
+            /*************************************************日电量历史*************************************************************/
 
-            return map;
         }
 
+        return map;
+    }
+
 
 
 
@@ -1257,7 +1407,7 @@ public class GenreSetPushService {
             if (id.equals(GF)) {
                 return 0;
             } else if (InitialRunner.wpmap.containsKey(id)) {
-                    wpId=id;
+                wpId=id;
             } else if (InitialRunner.pjmap.containsKey(id)) {
                 for (Windturbine wt : InitialRunner.pj_wtmap.get(id)) {
                     sb.append("'").append(wt.getId()).append("',");
@@ -1372,112 +1522,112 @@ public class GenreSetPushService {
         return vos;
     }
 
-private   Map<String, Double> getHbWs(String id) throws Exception {
-    Calendar cal = Calendar.getInstance();
-    cal.setTime(new Date());
-    cal.add(Calendar.MONTH,-1);
-    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.YLZSSDL).getCode());
-    // 月场内受累故障
-    wxssls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.YSZSSDL).getCode());
-    // 年场内受累检修
-    wxssls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.NLZSSDL).getCode());
-    // 年场内受累故障
-    wxssls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.NSZSSDL).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.YSDJZSDL).getCode());
-    //月手动停机损失
-    wxssls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.YSSTZSDL).getCode());
-    //月性能损失
-    wxssls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.YXNZSDL).getCode());
-    //月缺陷降出力损失
-    wxssls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.YSQXZSDL).getCode());
-    //月故障损失
-    wxssls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.YGZSSDL).getCode());
-    //月检修损失
-    wxssls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.YJXSSDL).getCode());
-
-
-    //年待机损失
-    wxssls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.NSDJZSDL).getCode());
-    //年手动停机损失
-    wxssls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.NSSTZSDL).getCode());
-    //年性能损失
-    wxssls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.NXNZSDL).getCode());
-    //年缺陷降出力损失
-    wxssls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.NSQXZSDL).getCode());
-    //年故障损失
-    wxssls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.NGZSSDL).getCode());
-    //年检修损失
-    wxssls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.NJXSSDL).getCode());
-
-
-    //日限电损失
-    wxssls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.RXDSSDL).getCode());
-    //月限电损失
-    wxssls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.YXDSSDL).getCode());
-    //年限电损失
-    wxssls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.NXDSSDL).getCode());
-
-
-    //日场外受累电网
-    wxssls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.RWZSSDL).getCode());
-    // 日场外受累天气
-    wxssls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.RTZSSDL).getCode());
-    // 月场外受累电网
-    wxssls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.YWZSSDL).getCode());
-    // 月场外受累天气
-    wxssls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.YTZSSDL).getCode());
-    // 年场外受累电网
-    wxssls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.NWZSSDL).getCode());
-    // 年场外受累天气
-    wxssls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.NTZSSDL).getCode());
-    wxssls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.TPOINT_WP_RFDL).getCode());
-    wxssls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.TPOINT_WP_YFDL).getCode());
-    wxssls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.TPOINT_WP_NFDL).getCode());
-
-
-    String[] ids=new String[wxssls.size()];
-
-    DNAVal[] wxsslist = realApiUtil.getHistMatrix(wxssls.toArray(ids),DateUtils.truncate(cal.getTime()).getTime());
-
-    if (wxsslist.length == wxssls.size()) {
-
-
-
-
-        Double rjxsl = MathUtil.twoBit(wxsslist[0].DValue);
+    private   Map<String, Double> getHbWs(String id) throws Exception {
+        Calendar cal = Calendar.getInstance();
+        cal.setTime(new Date());
+        cal.add(Calendar.MONTH,-1);
+        Map<String, Double> wxssmap = new HashMap<>();
+        List<String> wxssls = new ArrayList<>();
+
+        // 日场内受累检修
+        wxssls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.RLZSSDL).getCode());
         // 日场内受累故障
-        Double rgzzsl = MathUtil.twoBit(wxsslist[1].DValue);
+        wxssls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.RSZSSDL).getCode());
         // 月场内受累检修
-        Double yjxsl = MathUtil.twoBit(wxsslist[2].DValue);
+        wxssls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.YLZSSDL).getCode());
         // 月场内受累故障
-        Double ygzzsl = MathUtil.twoBit(wxsslist[3].DValue);
+        wxssls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.YSZSSDL).getCode());
         // 年场内受累检修
-        Double njxsl = MathUtil.twoBit(wxsslist[4].DValue);
+        wxssls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.NLZSSDL).getCode());
         // 年场内受累故障
-        Double ngzzsl = MathUtil.twoBit(wxsslist[5].DValue);
+        wxssls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.NSZSSDL).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.YSDJZSDL).getCode());
+        //月手动停机损失
+        wxssls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.YSSTZSDL).getCode());
+        //月性能损失
+        wxssls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.YXNZSDL).getCode());
+        //月缺陷降出力损失
+        wxssls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.YSQXZSDL).getCode());
+        //月故障损失
+        wxssls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.YGZSSDL).getCode());
+        //月检修损失
+        wxssls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.YJXSSDL).getCode());
+
+
+        //年待机损失
+        wxssls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.NSDJZSDL).getCode());
+        //年手动停机损失
+        wxssls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.NSSTZSDL).getCode());
+        //年性能损失
+        wxssls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.NXNZSDL).getCode());
+        //年缺陷降出力损失
+        wxssls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.NSQXZSDL).getCode());
+        //年故障损失
+        wxssls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.NGZSSDL).getCode());
+        //年检修损失
+        wxssls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.NJXSSDL).getCode());
+
+
+        //日限电损失
+        wxssls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.RXDSSDL).getCode());
+        //月限电损失
+        wxssls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.YXDSSDL).getCode());
+        //年限电损失
+        wxssls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.NXDSSDL).getCode());
+
+
+        //日场外受累电网
+        wxssls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.RWZSSDL).getCode());
+        // 日场外受累天气
+        wxssls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.RTZSSDL).getCode());
+        // 月场外受累电网
+        wxssls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.YWZSSDL).getCode());
+        // 月场外受累天气
+        wxssls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.YTZSSDL).getCode());
+        // 年场外受累电网
+        wxssls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.NWZSSDL).getCode());
+        // 年场外受累天气
+        wxssls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.NTZSSDL).getCode());
+        wxssls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.TPOINT_WP_RFDL).getCode());
+        wxssls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.TPOINT_WP_YFDL).getCode());
+        wxssls.add(windPowerstationTestingPoint2Service.getWindPowerStationTestingPoint2(id, Constant.TPOINT_WP_NFDL).getCode());
+
+
+        String[] ids=new String[wxssls.size()];
+
+        DNAVal[] wxsslist = realApiUtil.getHistMatrix(wxssls.toArray(ids),DateUtils.truncate(cal.getTime()).getTime());
+
+        if (wxsslist.length == wxssls.size()) {
+
+
+
+
+            Double rjxsl = MathUtil.twoBit(wxsslist[0].DValue);
+            // 日场内受累故障
+            Double rgzzsl = MathUtil.twoBit(wxsslist[1].DValue);
+            // 月场内受累检修
+            Double yjxsl = MathUtil.twoBit(wxsslist[2].DValue);
+            // 月场内受累故障
+            Double ygzzsl = MathUtil.twoBit(wxsslist[3].DValue);
+            // 年场内受累检修
+            Double njxsl = MathUtil.twoBit(wxsslist[4].DValue);
+            // 年场内受累故障
+            Double ngzzsl = MathUtil.twoBit(wxsslist[5].DValue);
 
 //                wxssmap.put("rjxsl", rjxsl);
 //                wxssmap.put("rgzzsl", rgzzsl);
@@ -1486,140 +1636,140 @@ private   Map<String, Double> getHbWs(String id) throws Exception {
 //                wxssmap.put("njxsl", njxsl);
 //                wxssmap.put("ngzzsl", ngzzsl);
 
-        //日待机损失
-        Double rdjss = MathUtil.twoBit(wxsslist[6].DValue);
-        //日手动停机损失
-        Double rsdtjss = MathUtil.twoBit(wxsslist[7].DValue);
-        //日性能损失
-        Double rxnss = MathUtil.twoBit(wxsslist[8].DValue);
-        //日缺陷降出力损失
-        Double rqxjclss = MathUtil.twoBit(wxsslist[9].DValue);
+            //日待机损失
+            Double rdjss = MathUtil.twoBit(wxsslist[6].DValue);
+            //日手动停机损失
+            Double rsdtjss = MathUtil.twoBit(wxsslist[7].DValue);
+            //日性能损失
+            Double rxnss = MathUtil.twoBit(wxsslist[8].DValue);
+            //日缺陷降出力损失
+            Double rqxjclss = MathUtil.twoBit(wxsslist[9].DValue);
 
-        //日欠发损失=日待机损失+日手动停机损失+日性能损失+日缺陷降出力损失
-        Double rqfssdl = new BigDecimal(rdjss + rsdtjss + rxnss + rqxjclss).divide(new BigDecimal(10000), 2, RoundingMode.HALF_EVEN).doubleValue();
+            //日欠发损失=日待机损失+日手动停机损失+日性能损失+日缺陷降出力损失
+            Double rqfssdl = new BigDecimal(rdjss + rsdtjss + rxnss + rqxjclss).divide(new BigDecimal(10000), 2, RoundingMode.HALF_EVEN).doubleValue();
 
-        Double rgzss = MathUtil.twoBit(wxsslist[10].DValue);
-        //日故障损失电量=日故障损失+日故障受累
-        Double rgzssdl = new BigDecimal(rgzss + rgzzsl).divide(new BigDecimal(10000), 2, RoundingMode.HALF_EVEN).doubleValue();
-        //日检修损失电量=日检修损失+日检修受累
-        Double rjxss = MathUtil.twoBit(wxsslist[11].DValue);
-        Double rjxssdl = new BigDecimal(rjxss + rjxsl).divide(new BigDecimal(10000), 2, RoundingMode.HALF_EVEN).doubleValue();
+            Double rgzss = MathUtil.twoBit(wxsslist[10].DValue);
+            //日故障损失电量=日故障损失+日故障受累
+            Double rgzssdl = new BigDecimal(rgzss + rgzzsl).divide(new BigDecimal(10000), 2, RoundingMode.HALF_EVEN).doubleValue();
+            //日检修损失电量=日检修损失+日检修受累
+            Double rjxss = MathUtil.twoBit(wxsslist[11].DValue);
+            Double rjxssdl = new BigDecimal(rjxss + rjxsl).divide(new BigDecimal(10000), 2, RoundingMode.HALF_EVEN).doubleValue();
 
 
-        wxssmap.put("rqfssdl", rqfssdl);
-        wxssmap.put("rgzssdl", rgzssdl);
-        wxssmap.put("rjxssdl", rjxssdl);
+            wxssmap.put("rqfssdl", rqfssdl);
+            wxssmap.put("rgzssdl", rgzssdl);
+            wxssmap.put("rjxssdl", rjxssdl);
 
-        // 月场内受累检修
-        Double ydjss = MathUtil.twoBit(wxsslist[12].DValue);
-        // 月场内受累检修
-        Double ysdtjss = MathUtil.twoBit(wxsslist[13].DValue);
-        // 月场内受累检修
-        Double yxnss = MathUtil.twoBit(wxsslist[14].DValue);
-        // 月场内受累检修
-        Double yqxjclss = MathUtil.twoBit(wxsslist[15].DValue);
-        //月欠发损失=月待机损失+月手动停机损失+月性能损失+月缺陷降出力损失
-        Double yqfssdl = new BigDecimal(ydjss + ysdtjss + yxnss + yqxjclss).divide(new BigDecimal(10000), 2, RoundingMode.HALF_EVEN).doubleValue();
+            // 月场内受累检修
+            Double ydjss = MathUtil.twoBit(wxsslist[12].DValue);
+            // 月场内受累检修
+            Double ysdtjss = MathUtil.twoBit(wxsslist[13].DValue);
+            // 月场内受累检修
+            Double yxnss = MathUtil.twoBit(wxsslist[14].DValue);
+            // 月场内受累检修
+            Double yqxjclss = MathUtil.twoBit(wxsslist[15].DValue);
+            //月欠发损失=月待机损失+月手动停机损失+月性能损失+月缺陷降出力损失
+            Double yqfssdl = new BigDecimal(ydjss + ysdtjss + yxnss + yqxjclss).divide(new BigDecimal(10000), 2, RoundingMode.HALF_EVEN).doubleValue();
 
-        Double ygzss = MathUtil.twoBit(wxsslist[16].DValue);
-        //月故障损失电量=月故障损失+月故障受累
-        Double ygzssdl = new BigDecimal(ygzss + ygzzsl).divide(new BigDecimal(10000), 2, RoundingMode.HALF_EVEN).doubleValue();
-        Double yjxss = MathUtil.twoBit(wxsslist[17].DValue);
-        //月检修损失电量=月检修损失+月检修受累
-        Double yjxssdl = new BigDecimal(yjxss + yjxsl).divide(new BigDecimal(10000), 2, RoundingMode.HALF_EVEN).doubleValue();
+            Double ygzss = MathUtil.twoBit(wxsslist[16].DValue);
+            //月故障损失电量=月故障损失+月故障受累
+            Double ygzssdl = new BigDecimal(ygzss + ygzzsl).divide(new BigDecimal(10000), 2, RoundingMode.HALF_EVEN).doubleValue();
+            Double yjxss = MathUtil.twoBit(wxsslist[17].DValue);
+            //月检修损失电量=月检修损失+月检修受累
+            Double yjxssdl = new BigDecimal(yjxss + yjxsl).divide(new BigDecimal(10000), 2, RoundingMode.HALF_EVEN).doubleValue();
 
-        wxssmap.put("yqfssdl", yqfssdl);
-        wxssmap.put("ygzssdl", ygzssdl);
-        wxssmap.put("yjxssdl", yjxssdl);
+            wxssmap.put("yqfssdl", yqfssdl);
+            wxssmap.put("ygzssdl", ygzssdl);
+            wxssmap.put("yjxssdl", yjxssdl);
 
-        // 年场内受累检修
-        Double ndjss = MathUtil.twoBit(wxsslist[18].DValue);
-        // 年场内受累检修
-        Double nsdtjss = MathUtil.twoBit(wxsslist[19].DValue);
-        // 年场内受累检修
-        Double nxnss = MathUtil.twoBit(wxsslist[20].DValue);
-        // 年场内受累检修
-        Double nqxjclss = MathUtil.twoBit(wxsslist[21].DValue);
-
-        Double nqfssdl = new BigDecimal(ndjss + nsdtjss + nxnss + nqxjclss).divide(new BigDecimal(10000), 2, RoundingMode.HALF_EVEN).doubleValue();
-
-        Double ngzss = MathUtil.twoBit(wxsslist[22].DValue);
-        //年故障损失电量=年故障损失+年故障受累
-        Double ngzssdl = new BigDecimal(ngzss + ngzzsl).divide(new BigDecimal(10000), 2, RoundingMode.HALF_EVEN).doubleValue();
-        Double njxss = MathUtil.twoBit(wxsslist[23].DValue);
-        //年检修损失电量=年检修损失+年检修受累
-        Double njxssdl = new BigDecimal(njxss + njxsl).divide(new BigDecimal(10000), 2, RoundingMode.HALF_EVEN).doubleValue();
-
-        wxssmap.put("nqfssdl", nqfssdl);
-        wxssmap.put("ngzssdl", ngzssdl);
-        wxssmap.put("njxssdl", njxssdl);
-
-        double temp = 0.0;
-        temp = MathUtil.twoBit(wxsslist[24].DValue);
-        Double rxdssdl = new BigDecimal(temp).divide(new BigDecimal(10000), 2, RoundingMode.HALF_EVEN).doubleValue();
-        temp = MathUtil.twoBit(wxsslist[25].DValue);
-        Double yxdssdl = new BigDecimal(temp).divide(new BigDecimal(10000), 2, RoundingMode.HALF_EVEN).doubleValue();
-        temp = MathUtil.twoBit(wxsslist[26].DValue);
-        Double nxdssdl = new BigDecimal(temp).divide(new BigDecimal(10000), 2, RoundingMode.HALF_EVEN).doubleValue();
-
-        wxssmap.put("rxdssdl", StringUtils.round(rxdssdl < 0.0 ? 0.0 : rxdssdl, 2));
-        wxssmap.put("yxdssdl", StringUtils.round(yxdssdl < 0.0 ? 0.0 : yxdssdl, 2));
-        wxssmap.put("nxdssdl", StringUtils.round(nxdssdl < 0.0 ? 0.0 : nxdssdl, 2));
-
-        Double rdwsl = MathUtil.twoBit(wxsslist[27].DValue);
-        Double rtqsl = MathUtil.twoBit(wxsslist[28].DValue);
-        Double rslssdl = new BigDecimal(rdwsl + rtqsl).divide(new BigDecimal(10000), 2, RoundingMode.HALF_EVEN).doubleValue();
-        Double ydwsl = MathUtil.twoBit(wxsslist[29].DValue);
-        Double ytqsl = MathUtil.twoBit(wxsslist[30].DValue);
-        Double yslssdl = new BigDecimal(ydwsl + ytqsl).divide(new BigDecimal(10000), 2, RoundingMode.HALF_EVEN).doubleValue();
-        Double ndwsl = MathUtil.twoBit(wxsslist[31].DValue);
-        Double ntqsl = MathUtil.twoBit(wxsslist[32].DValue);
-        Double nslssdl = new BigDecimal(ndwsl + ntqsl).divide(new BigDecimal(10000), 2, RoundingMode.HALF_EVEN).doubleValue();
-
-
-        double rfdl=MathUtil.twoBit(wxsslist[33].DValue);
-        double yfdl=MathUtil.twoBit(wxsslist[34].DValue);
-        double nfdl=MathUtil.twoBit(wxsslist[35].DValue);
-        wxssmap.put("rslssdl", rslssdl);
-        wxssmap.put("yslssdl", yslssdl);
-        wxssmap.put("nslssdl", nslssdl);
-
-
-        double rllfdl=rfdl+rgzssdl+rjxssdl+rqfssdl+rxdssdl+rslssdl;
-        if(rllfdl!=0)
-        {
-            double rfnlyl=new BigDecimal(rfdl).divide(new BigDecimal(rllfdl), 4, RoundingMode.HALF_EVEN).multiply(new BigDecimal(100)).doubleValue();
-            wxssmap.put("rfnlyl", rfnlyl);
-        }else
-        {
-            wxssmap.put("rfnlyl", 0.0);
-        }
+            // 年场内受累检修
+            Double ndjss = MathUtil.twoBit(wxsslist[18].DValue);
+            // 年场内受累检修
+            Double nsdtjss = MathUtil.twoBit(wxsslist[19].DValue);
+            // 年场内受累检修
+            Double nxnss = MathUtil.twoBit(wxsslist[20].DValue);
+            // 年场内受累检修
+            Double nqxjclss = MathUtil.twoBit(wxsslist[21].DValue);
+
+            Double nqfssdl = new BigDecimal(ndjss + nsdtjss + nxnss + nqxjclss).divide(new BigDecimal(10000), 2, RoundingMode.HALF_EVEN).doubleValue();
+
+            Double ngzss = MathUtil.twoBit(wxsslist[22].DValue);
+            //年故障损失电量=年故障损失+年故障受累
+            Double ngzssdl = new BigDecimal(ngzss + ngzzsl).divide(new BigDecimal(10000), 2, RoundingMode.HALF_EVEN).doubleValue();
+            Double njxss = MathUtil.twoBit(wxsslist[23].DValue);
+            //年检修损失电量=年检修损失+年检修受累
+            Double njxssdl = new BigDecimal(njxss + njxsl).divide(new BigDecimal(10000), 2, RoundingMode.HALF_EVEN).doubleValue();
+
+            wxssmap.put("nqfssdl", nqfssdl);
+            wxssmap.put("ngzssdl", ngzssdl);
+            wxssmap.put("njxssdl", njxssdl);
+
+            double temp = 0.0;
+            temp = MathUtil.twoBit(wxsslist[24].DValue);
+            Double rxdssdl = new BigDecimal(temp).divide(new BigDecimal(10000), 2, RoundingMode.HALF_EVEN).doubleValue();
+            temp = MathUtil.twoBit(wxsslist[25].DValue);
+            Double yxdssdl = new BigDecimal(temp).divide(new BigDecimal(10000), 2, RoundingMode.HALF_EVEN).doubleValue();
+            temp = MathUtil.twoBit(wxsslist[26].DValue);
+            Double nxdssdl = new BigDecimal(temp).divide(new BigDecimal(10000), 2, RoundingMode.HALF_EVEN).doubleValue();
+
+            wxssmap.put("rxdssdl", StringUtils.round(rxdssdl < 0.0 ? 0.0 : rxdssdl, 2));
+            wxssmap.put("yxdssdl", StringUtils.round(yxdssdl < 0.0 ? 0.0 : yxdssdl, 2));
+            wxssmap.put("nxdssdl", StringUtils.round(nxdssdl < 0.0 ? 0.0 : nxdssdl, 2));
+
+            Double rdwsl = MathUtil.twoBit(wxsslist[27].DValue);
+            Double rtqsl = MathUtil.twoBit(wxsslist[28].DValue);
+            Double rslssdl = new BigDecimal(rdwsl + rtqsl).divide(new BigDecimal(10000), 2, RoundingMode.HALF_EVEN).doubleValue();
+            Double ydwsl = MathUtil.twoBit(wxsslist[29].DValue);
+            Double ytqsl = MathUtil.twoBit(wxsslist[30].DValue);
+            Double yslssdl = new BigDecimal(ydwsl + ytqsl).divide(new BigDecimal(10000), 2, RoundingMode.HALF_EVEN).doubleValue();
+            Double ndwsl = MathUtil.twoBit(wxsslist[31].DValue);
+            Double ntqsl = MathUtil.twoBit(wxsslist[32].DValue);
+            Double nslssdl = new BigDecimal(ndwsl + ntqsl).divide(new BigDecimal(10000), 2, RoundingMode.HALF_EVEN).doubleValue();
+
+
+            double rfdl=MathUtil.twoBit(wxsslist[33].DValue);
+            double yfdl=MathUtil.twoBit(wxsslist[34].DValue);
+            double nfdl=MathUtil.twoBit(wxsslist[35].DValue);
+            wxssmap.put("rslssdl", rslssdl);
+            wxssmap.put("yslssdl", yslssdl);
+            wxssmap.put("nslssdl", nslssdl);
+
+
+            double rllfdl=rfdl+rgzssdl+rjxssdl+rqfssdl+rxdssdl+rslssdl;
+            if(rllfdl!=0)
+            {
+                double rfnlyl=new BigDecimal(rfdl).divide(new BigDecimal(rllfdl), 4, RoundingMode.HALF_EVEN).multiply(new BigDecimal(100)).doubleValue();
+                wxssmap.put("rfnlyl", rfnlyl);
+            }else
+            {
+                wxssmap.put("rfnlyl", 0.0);
+            }
 
-        double yllfdl=yfdl+ygzssdl+yjxssdl+yqfssdl+yxdssdl+yslssdl;
-        if(yllfdl!=0)
-        {
-            double yfnlyl=new BigDecimal(yfdl).divide(new BigDecimal(yllfdl), 4, RoundingMode.HALF_EVEN).multiply(new BigDecimal(100)).doubleValue();
-            wxssmap.put("yfnlyl", yfnlyl);
-        }else
-        {
-            wxssmap.put("yfnlyl", 0.0);
-        }
+            double yllfdl=yfdl+ygzssdl+yjxssdl+yqfssdl+yxdssdl+yslssdl;
+            if(yllfdl!=0)
+            {
+                double yfnlyl=new BigDecimal(yfdl).divide(new BigDecimal(yllfdl), 4, RoundingMode.HALF_EVEN).multiply(new BigDecimal(100)).doubleValue();
+                wxssmap.put("yfnlyl", yfnlyl);
+            }else
+            {
+                wxssmap.put("yfnlyl", 0.0);
+            }
 
-        double nllfdl=nfdl+ngzssdl+njxssdl+nqfssdl+nxdssdl+nslssdl;
-        if(nllfdl!=0)
-        {
-            double nfnlyl=new BigDecimal(nfdl).divide(new BigDecimal(nllfdl), 4, RoundingMode.HALF_EVEN).multiply(new BigDecimal(100)).doubleValue();
-            wxssmap.put("nfnlyl", nfnlyl);
-        }else
-        {
-            wxssmap.put("nfnlyl", 0.0);
-        }
+            double nllfdl=nfdl+ngzssdl+njxssdl+nqfssdl+nxdssdl+nslssdl;
+            if(nllfdl!=0)
+            {
+                double nfnlyl=new BigDecimal(nfdl).divide(new BigDecimal(nllfdl), 4, RoundingMode.HALF_EVEN).multiply(new BigDecimal(100)).doubleValue();
+                wxssmap.put("nfnlyl", nfnlyl);
+            }else
+            {
+                wxssmap.put("nfnlyl", 0.0);
+            }
 
 
-    }
+        }
 
-    return wxssmap;
-}
+        return wxssmap;
+    }
 
     public List<DataVo> findPowerWpChart(String wpId) throws Exception {
         List<DataVo> vos = new ArrayList<DataVo>();

+ 2 - 2
src/main/java/com/gyee/frame/service/websocket/MatrixPushByWpService.java

@@ -451,8 +451,8 @@ public class MatrixPushByWpService {
                     //限电台数
                     Double xdts = MathUtil.twoBit(jczblist.get(12).getPointValueInDouble());
                     jczbmap.put("xdts", xdts);
-
-
+                    //接入台数
+                    jczbmap.put("jrts", djts+yxts+gzts+lxts+whts+xdts);
 
                 } else {
                     //实时风速

+ 1 - 1
src/main/java/com/gyee/frame/service/websocket/MatrixPushService.java

@@ -298,7 +298,7 @@ public class MatrixPushService {
         map.put("fcxdnum", fcxdnum);
         //风场限电台数
         map.put("fcslnum", fcslnum);
-//风场受累台数
+        //风场受累台数
         double fcjrnum = fcdjnum + fcyxnum + fcgznum + fclxnum + fcwhnum + fcxdnum + fcslnum;
 
         map.put("fcjrnum", fcjrnum);

+ 68 - 5
src/main/java/com/gyee/frame/service/websocket/WpInfoPushService.java

@@ -5,15 +5,13 @@ import com.gyee.frame.common.spring.Constant;
 import com.gyee.frame.common.spring.InitialRunner;
 import com.gyee.frame.model.auto.WindPowerStationTestingPoint2;
 import com.gyee.frame.model.auto.Windpowerstation;
+import com.gyee.frame.model.auto.Windturbine;
 import com.gyee.frame.model.auto.WpMttrAndMtbMonth;
 import com.gyee.frame.model.custom.DNAVal;
 import com.gyee.frame.model.custom.DataVo;
 import com.gyee.frame.model.custom.PointData;
 import com.gyee.frame.model.custom.ZtjsVo;
-import com.gyee.frame.service.ProjectPlanService;
-import com.gyee.frame.service.WindPowerstationTestingPoint2Service;
-import com.gyee.frame.service.WindpowerinfodayService;
-import com.gyee.frame.service.WpMttrAndMtbMonthService;
+import com.gyee.frame.service.*;
 import com.gyee.frame.service.weather.WeatherService;
 import com.gyee.frame.util.IRealTimeDataBaseUtil;
 import com.gyee.frame.util.MathUtil;
@@ -46,6 +44,9 @@ public class WpInfoPushService {
     @Resource
     private WeatherService weatherService;
 
+    @Resource
+    WindTurbineTestingPointAiService windTurbineTestingPointAiService;
+
     IRealTimeDataBaseUtil realApiUtil = RealTimeDataBaseFactory.createRealTimeDataBase();
     private final double YCFDLXS = 1.08;
     String[] ycPoints1 = Constant.TPOINT_WP_FGLYC.split(",");
@@ -1217,7 +1218,7 @@ public class WpInfoPushService {
                 jczbmap.put("sjgl", sjgl);
 
 
-//待机台数
+                //待机台数
                 Double djnum = MathUtil.twoBit(jczblist.get(5).getPointValueInDouble());
                 jczbmap.put("djnum", djnum);
                 //手动停机台数
@@ -1257,6 +1258,68 @@ public class WpInfoPushService {
                 Double lxnum = MathUtil.twoBit(jczblist.get(17).getPointValueInDouble());
                 jczbmap.put("lxnum", lxnum);
 
+                /*************************************************光伏状态统计*************************************************************/
+
+                if(wp.getId().endsWith("GDC")){
+
+                    List<String> fjzbls = new ArrayList<>();
+                    List<Windturbine> wtls=InitialRunner.wp_wtmap.get(wp.getId());
+                    for(Windturbine wt:wtls) {
+
+                        //状态
+                        fjzbls.add(windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wt.getId(), Constant.FJZT).getId());
+                    }
+                    List<PointData> fjzblist = realApiUtil.getRealData(fjzbls);
+                    if (!fjzblist.isEmpty() && fjzblist.size() == fjzbls.size()) {
+                        for(int i=0;i<wtls.size();i++){
+                            double fjzt = MathUtil.twoBit(MathUtil.twoBit(fjzblist.get(i).getPointValueInDouble()));
+                            switch (Double.valueOf(fjzt).intValue()) {
+                                case 0:
+                                    djnum++;
+                                    break;
+                                case 1:
+                                    zcfdnum++;
+                                    break;
+                                case 2:
+                                    gztjnum++;
+                                    break;
+                                case 3:
+                                    lxnum++;
+                                    break;
+                                case 4:
+                                    jxtjnum++;
+                                    break;
+                                case 5:
+                                    xdjclnum++;
+                                    break;
+                                case 6:
+                                    xdjclnum++;
+                                    break;
+
+                                default:
+
+                                    break;
+                            }
+                        }
+
+                    }
+
+                    //待机台数
+                    jczbmap.put("djnum", djnum);
+                    //正常发电台数
+                    jczbmap.put("zcfdnum", zcfdnum);
+                    // 限电降出力台数
+                    jczbmap.put("xdjclnum", xdjclnum);
+                    // 故障停机台数
+                    jczbmap.put("gztjnum", gztjnum);
+                    // 检修停机台数
+                    jczbmap.put("jxtjnum", jxtjnum);
+                    // 电网受累台数
+                    jczbmap.put("dwslnum", dwslnum);
+                    // 风机离线台数
+                    jczbmap.put("lxnum", lxnum);
+                }
+
 //
 //                double djts=djnum+sdtjnum;
 //                double yxts=zcfdnum+qxjclnum;

+ 4 - 2
src/main/resources/application-dev.yml

@@ -11,7 +11,8 @@ spring:
 #        username: root
 #        password: 123456
 
-        url: jdbc:oracle:thin:@49.4.50.80:1521:gdnxfd
+        #url: jdbc:oracle:thin:@49.4.50.80:1521:gdnxfd
+        url: jdbc:oracle:thin:@192.168.1.105:1521:gdnxfd
         username: nxfdprod
         password: gdnxfd123
         driver-class-name: oracle.jdbc.driver.OracleDriver
@@ -23,7 +24,8 @@ spring:
         password: root
       #两票数据源
      ticket:
-       url: jdbc:sqlserver://49.4.50.80:1433;DatabaseName=fdeam
+       #url: jdbc:sqlserver://49.4.50.80:1433;DatabaseName=fdeam
+       url: jdbc:sqlserver://10.155.32.2:1433;DatabaseName=fdeam
        username: sa
        password: Gyee@321#!
        driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver

+ 7 - 7
src/main/resources/application.yml

@@ -26,14 +26,14 @@ gyee:
   #漂亮得拖动验证码 默认false普通验证码、true滚动验证码
   rollVerification: true
   #实时数据库Url
-  baseurl: http://49.4.50.80:8011/ts
-#  baseurl: http://10.155.32.4:8011/ts
+  #baseurl: http://49.4.50.80:8011/ts
+  baseurl: http://10.155.32.4:8011/ts
   #API访问ip
-  swaggerip: 49.4.50.80:8082
-#  swaggerip: 10.155.32.4:8082
+  #swaggerip: 49.4.50.80:8082
+  swaggerip: 10.155.32.4:8082
   #默认小数位数
   digit: 2
-  realtimedataBase: hwy
+  realtimedataBase: golden #数据查询模式 golden、hwy
 #tomcat config
 server :
   port : 8082
@@ -91,8 +91,8 @@ spring :
     date-format: yyyy-MM-dd HH:mm:ss
   redis:
     database: 1
-    host: 49.4.50.80
-#    host: 10.155.32.4
+#    host: 49.4.50.80
+    host: 10.155.32.4
     password: gdnxfd123
     pool:
       maxTotal: 20

+ 1 - 1
src/main/resources/mybatis-generator.xml

@@ -53,7 +53,7 @@
 <!--        </jdbcConnection>-->
         <jdbcConnection
                 driverClass="oracle.jdbc.driver.OracleDriver"
-                connectionURL="jdbc:oracle:thin:@49.4.50.80:1521:gdnxfd"
+                connectionURL="jdbc:oracle:thin:@192.168.1.105:1521:gdnxfd"
                 userId="nxfdprod"
                 password="gdnxfd123">
         </jdbcConnection>