Bladeren bron

修改配置信息和多适配器切换

shilin 2 jaren geleden
bovenliggende
commit
c19a47c910

+ 2 - 0
web/health-hb/src/main/java/com/gyee/frame/common/spring/Constant.java

@@ -379,6 +379,8 @@ public class Constant {
 	public static final String FJZYSL = "JKSLZY001";// 风机注意健康状态数量
 	public static final String FJYZSL = "JKSLYZ001";// 风机严重健康状态数量
 
+    public static final String FJJKJGZ = "JKJL001";// 风机健康结果值
+
 
 	public static final String PCS_WD = "AI287";//Pcs温度
 	public static final String TPOINT_WT_U2YZWD = "AI046";//U2绕组温度

+ 4 - 5
web/health-hb/src/main/java/com/gyee/frame/controller/health/ReliabilityAnalysisController.java

@@ -5,7 +5,6 @@ import com.gyee.frame.common.conf.AjaxStatus;
 import com.gyee.frame.common.domain.AjaxResult;
 import com.gyee.frame.common.feign.RemoteServiceBuilder;
 import com.gyee.frame.mapper.auto.WindturbineMapper;
-import com.gyee.frame.model.auto.MetricsCode;
 import com.gyee.frame.model.auto.Windturbine;
 import com.gyee.frame.model.auto.Windturbinetestingpointnew;
 import com.gyee.frame.model.custom.export.TsPointData;
@@ -82,7 +81,7 @@ public class ReliabilityAnalysisController {
                     List<TsPointData> data = null;
                     if (null !=interval)
                     {
-                        System.out.println(windAI.getCode());
+                        //System.out.println(windAI.getCode());
                         data = remoteService.ShardingService().getHistorySnap(windAI.getCode(), startTs, endTs, interval);
                     }
                     else{
@@ -102,10 +101,10 @@ public class ReliabilityAnalysisController {
                         desc = metrics.get(1).getMetricname();
                     }
                 }*/
-                    MetricsCode metrics=uniformCodeService.getListName(wtId,windAI.getUniformcode());
-                    String nm = metrics==null?"":metrics.getName();
+//                    MetricsCode metrics=uniformCodeService.getListName(wtId,windAI.getUniformcode());
+//                    String nm = metrics==null?"":metrics.getName();
                     map.put("unit", unit);
-                    map.put("name", nm);
+                    map.put("name", name);
                     map.put("data", data);
 
                     list.add(map);

+ 56 - 36
web/health-hb/src/main/java/com/gyee/frame/service/health/HealthSubService.java

@@ -31,8 +31,7 @@ public class HealthSubService {
 //    private Monthlygradeassessmentmain2Service monthlygradeassessmentmain2Service;
     @Resource
     private ShutdowneventService shutdowneventService;
-    @Resource
-    private StatejudgmentrecordService statejudgmentrecordService;
+
     @Resource
     private CurvefittingsubService curvefittingsubService;
     @Resource
@@ -98,11 +97,37 @@ public class HealthSubService {
 
     private double getWtScore(String wtId) throws Exception {
 
-        double score = 0.0;
+        double score = 100.0;
         if (StringUtils.notEmp(wtId)) {
-            String pointid = windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wtId, Constant.FJJKZZ).getCode();
-            PointData po = realApiUtil.getRealData(pointid);
-            score = po.getPointValueInDouble();
+
+            List<Statejudgmentrecord2> ls = statejudgmentrecord2Service.findStatejudgmentrecord2(wtId);
+
+
+            Windturbinetestingpointnew ai = windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wtId, Constant.FJZT);
+            PointData point=realApiUtil.getRealData(ai);
+
+
+            if(StringUtils.notEmp(ls) && !ls.isEmpty() && StringUtils.notEmp(ls.get(0).getScore()))
+            {
+                score=ls.get(0).getScore();
+            }
+
+            if(StringUtils.notEmp(point))
+            {
+                if(point.getPointValueInDouble()==2)
+                {
+                    score=score-50;
+                }
+
+                if(score<0)
+                {
+                    score=0;
+                }
+            }
+
+//            String pointid = windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wtId, Constant.FJJKZZ).getCode();
+//            PointData po = realApiUtil.getRealData(pointid);
+//            score = po.getPointValueInDouble();
 
         }
         return score;
@@ -433,12 +458,10 @@ public class HealthSubService {
         List<XnfxVo> ls = new ArrayList<XnfxVo>();
 
 
-        cal.set(Calendar.HOUR_OF_DAY, 0);
-        cal.set(Calendar.MINUTE, 0);
-        cal.set(Calendar.SECOND, 0);
-        Date beginDate = cal.getTime();
-        cal.add(Calendar.DAY_OF_MONTH, 1);
-        Date  endDate= cal.getTime();
+
+        Date endDate = cal.getTime();
+        cal.add(Calendar.DAY_OF_MONTH, -1);
+        Date  beginDate= cal.getTime();
 
        List<Windturbineinfodaytop2> day1ls = windturbineinfodaytop2Service.gaDaytopList(wtId, beginDate, endDate);
         if (!day1ls.isEmpty()) {
@@ -509,34 +532,31 @@ public class HealthSubService {
         if (StringUtils.notEmp(wtId)) {
 
 
-            List<Statejudgmentrecord> ls = statejudgmentrecordService.getStatejudgmentrecordListBywtId(wtId);
+            List<Statejudgmentrecord2> ls = statejudgmentrecord2Service.findStatejudgmentrecord2(wtId);
 
 
-            if (!ls.isEmpty()) {
-                String[] str = ls.get(0).getStatejudgment().split("-");
-                if (str.length == 4) {
-                    ValueVo vo1 = new ValueVo();
-                    ValueVo vo2 = new ValueVo();
-                    ValueVo vo3 = new ValueVo();
-                    ValueVo vo4 = new ValueVo();
-
+            Windturbinetestingpointnew ai = windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wtId, Constant.FJZT);
+            PointData point=realApiUtil.getRealData(ai);
 
+            if(StringUtils.notEmp(point))
+            {
+                if(point.getPointValueInDouble()==2)
+                {
+                    ValueVo vo1 = new ValueVo();
                     vo1.setName("运行状态为故障!");
-                    vo2.setName("风机部件温度超出合理值范围!");
-                    vo3.setName("性能损失率连续三天大于基准值");
-                    vo4.setName("曲线偏差率率连续三天大于基准值");
-
-
-                    setScoreValue(str[0], vo1);
-                    setScoreValue(str[1], vo2);
-                    setScoreValue(str[2], vo3);
-                    setScoreValue(str[3], vo4);
-
-
-                    vols.add(vo1);
-                    vols.add(vo2);
-                    vols.add(vo3);
-                    vols.add(vo4);
+                    vo1.setValue("进行扣分处理!");
+                }
+            }
+            if (!ls.isEmpty()) {
+                String[] str = ls.get(0).getStatejudgment().split(",");
+                if (str.length>0) {
+                    for(int i=0;i<str.length;i++)
+                    {
+                        ValueVo vo1 = new ValueVo();
+                        vo1.setName(str[i]);
+                        vo1.setValue("进行扣分处理!");
+                        vols.add(vo1);
+                    }
 
                 }
             }

+ 16 - 2
web/health-hb/src/main/java/com/gyee/frame/service/health/WindTurbineHealthListService.java

@@ -34,7 +34,7 @@ public class WindTurbineHealthListService {
     public List<HealthmodelrecordsVo> windTurbineHealthList(String wpId) throws Exception {
 
         List<String> codels = new ArrayList<String>();
-        codels.add(Constant.FJJKZZ);
+        codels.add(Constant.FJJKJGZ);
         codels.add(Constant.CLXJKZT);
         codels.add(Constant.FDJJKZT);
         codels.add(Constant.BJJKZT);
@@ -73,7 +73,7 @@ public class WindTurbineHealthListService {
                 for (int i = 0; i < codels.size(); i++) {
 
                     Windturbinetestingpointnew ai =windTurbineTestingPointAiService.getWindTurbineTestingPointAi2(wt.getId(),codels.get(i));
-                    points[i] = ai.getId();
+                    points[i] = ai.getCode();
                 }
 
                 // 获得风机健康状态结果数组
@@ -85,6 +85,20 @@ public class WindTurbineHealthListService {
                 double bjzt = jkvalues[3].DValue;
                 double zkzt = jkvalues[4].DValue;
 
+//                double total=clxzt+fdjzt+bjzt+zkzt;
+//                if(total<=4)
+//                {
+//                    score=90;
+//                }else if(total>4 && total<=8)
+//                {
+//                    score=80;
+//                }else if(total>8 && total<=12)
+//                {
+//                    score=70;
+//                }else
+//                {
+//                    score=50;
+//                }
                 vo.setScore(StringUtils.round(score, 2));
 
                 vo.setClx(getStateValue(clxzt));

+ 21 - 13
web/health-hb/src/main/java/com/gyee/frame/util/StringUtils.java

@@ -17,50 +17,58 @@ import java.util.regex.Pattern;
  * 
  * @author fc
  */
-public class StringUtils extends org.apache.commons.lang3.StringUtils
-{
-    /** 空字符串 */
+public class StringUtils extends org.apache.commons.lang3.StringUtils {
+    /**
+     * 空字符串
+     */
     private static final String NULLSTR = "";
 
-    /** 下划线 */
+    /**
+     * 下划线
+     */
     private static final char SEPARATOR = '_';
 
     /**
      * 获取参数不为空值
-     * 
+     *
      * @param value defaultValue 要判断的value
      * @return value 返回值
      */
-    public static <T> T nvl(T value, T defaultValue)
-    {
+    public static <T> T nvl(T value, T defaultValue) {
         return value != null ? value : defaultValue;
     }
 
     /**
      * * 判断一个Collection是否为空, 包含List,Set,Queue
-     * 
+     *
      * @param coll 要判断的Collection
      * @return true:为空 false:非空
      */
-    public static boolean isEmpty(Collection<?> coll)
-    {
+    public static boolean isEmpty(Collection<?> coll) {
         return isNull(coll) || coll.isEmpty();
     }
 
     /**
      * * 判断一个Collection是否非空,包含List,Set,Queue
-     * 
+     *
      * @param coll 要判断的Collection
      * @return true:非空 false:空
      */
-    public static boolean isNotEmpty(Collection<?> coll)
-    {
+    public static boolean isNotEmpty(Collection<?> coll) {
         return !isEmpty(coll);
     }
+
     public static int roundToInt(double num) {
 
         return new BigDecimal(num).setScale(0, RoundingMode.HALF_UP).intValue();
     }
+
+    public   static double roundToDouble(int min ,int max)
+    {
+        double number =  (min + Math.random() * (max - 20 + 1));
+
+        return number;
+    }
     /**
      * * 判断一个对象数组是否为空
      *