瀏覽代碼

智能检修 可靠性分析 加弹窗曲线名称

xushili 3 年之前
父節點
當前提交
01e7129b9d

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

@@ -5,10 +5,8 @@ import com.gyee.frame.common.conf.AjaxStatus;
 import com.gyee.frame.common.domain.AjaxResult;
 import com.gyee.frame.common.exception.enums.QiNiuErrorEnum;
 import com.gyee.frame.common.feign.RemoteServiceBuilder;
-import com.gyee.frame.model.auto.Metrics;
-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.common.spring.InitialRunner;
+import com.gyee.frame.model.auto.*;
 import com.gyee.frame.model.custom.export.TsPointData;
 import com.gyee.frame.model.custom.weather.Sys;
 import com.gyee.frame.service.Alertrule2ervice;
@@ -79,7 +77,7 @@ public class ReliabilityAnalysisController {
                 // 查询点的单位和描述属性
                 String unit = "--";
                 String desc = "----";
-                List<MetricsUniformCode> metricsList = uniformCodeService.getListByStationAndUniforCode(station, windAI.getUniformcode());
+                /*List<MetricsUniformCode> metricsList = uniformCodeService.getListByStationAndUniforCode(station, windAI.getUniformcode());
                 if (metricsList != null && metricsList.size() > 0) {
                     MetricsUniformCode metricsUniformCode = metricsList.get(0);
                     List<Metrics> metrics = metricsService.getMetricsByMetricsId(metricsUniformCode.getMetricid());
@@ -87,9 +85,11 @@ public class ReliabilityAnalysisController {
                         unit = metrics.get(0).getUnitname();
                         desc = metrics.get(1).getMetricname();
                     }
-                }
+                }*/
+                MetricsCode metrics=uniformCodeService.getListName(wtId,windAI.getUniformcode());
+                String nm = metrics==null?"":metrics.getName();
                 map.put("unit", unit);
-                map.put("name", desc);
+                map.put("name", nm);
                 map.put("data", data);
 
                 list.add(map);

+ 12 - 0
src/main/java/com/gyee/frame/mapper/auto/MetricsCodeMapper.java

@@ -0,0 +1,12 @@
+package com.gyee.frame.mapper.auto;
+
+import com.gyee.frame.model.auto.MetricsCode;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Select;
+
+import java.util.List;
+@Mapper
+public interface MetricsCodeMapper {
+    @Select("select * from view_uniform_info where windturbineid=#{w} and uniformcode=#{u} and rownum=1")
+    MetricsCode selectName(String w, String u);
+}

+ 43 - 0
src/main/java/com/gyee/frame/model/auto/MetricsCode.java

@@ -0,0 +1,43 @@
+package com.gyee.frame.model.auto;
+
+
+import java.io.Serializable;
+
+public class MetricsCode implements Serializable {
+    private String name;
+    private String uniformCode;
+    private String modelId;
+    private String stationId;
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getUniformCode() {
+        return uniformCode;
+    }
+
+    public void setUniformCode(String uniformCode) {
+        this.uniformCode = uniformCode;
+    }
+
+    public String getModelId() {
+        return modelId;
+    }
+
+    public void setModelId(String modelId) {
+        this.modelId = modelId;
+    }
+
+    public String getStatonId() {
+        return stationId;
+    }
+
+    public void setStatonId(String statonId) {
+        this.stationId = statonId;
+    }
+}

+ 20 - 0
src/main/java/com/gyee/frame/service/health/MetricsUniformCodeService.java

@@ -2,9 +2,12 @@ package com.gyee.frame.service.health;
 
 import com.gyee.frame.common.exception.QiNiuException;
 import com.gyee.frame.common.exception.enums.QiNiuErrorEnum;
+import com.gyee.frame.mapper.auto.MetricsCodeMapper;
 import com.gyee.frame.mapper.auto.MetricsUniformCodeMapper;
+import com.gyee.frame.model.auto.MetricsCode;
 import com.gyee.frame.model.auto.MetricsUniformCode;
 import com.gyee.frame.model.auto.MetricsUniformCodeExample;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
@@ -15,6 +18,8 @@ public class MetricsUniformCodeService {
 
     @Resource
     private MetricsUniformCodeMapper uniformCodeMapper;
+    @Autowired
+    private MetricsCodeMapper codeMapper;
 
 
     /**
@@ -39,5 +44,20 @@ public class MetricsUniformCodeService {
 
         return list;
     }
+    private MetricsCode mc;
+    public MetricsCode getListName(String station, String uniformCode){
+        if(mc==null){
+            try{
+                mc = codeMapper.selectName(station,uniformCode);
+                if(mc!=null){
+                    return mc;
+                }
+            }catch (Exception e){
+                throw new QiNiuException(QiNiuErrorEnum.ERROR_DATA);
+            }
+            return null;
+        }
+        return mc;
+    }
 
 }