Explorar o código

智能检修 可靠性分析 数据bug修复

xushili %!s(int64=3) %!d(string=hai) anos
pai
achega
34e4d3b3ee

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

@@ -6,6 +6,7 @@ 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.common.spring.InitialRunner;
+import com.gyee.frame.mapper.auto.WindturbineMapper;
 import com.gyee.frame.model.auto.*;
 import com.gyee.frame.model.custom.export.TsPointData;
 import com.gyee.frame.model.custom.weather.Sys;
@@ -15,6 +16,7 @@ import com.gyee.frame.service.WindTurbineTestingPointDiService;
 import com.gyee.frame.service.health.MetricsService;
 import com.gyee.frame.service.health.MetricsUniformCodeService;
 import io.swagger.annotations.Api;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
@@ -38,6 +40,8 @@ public class ReliabilityAnalysisController {
     private WindTurbineTestingPointAiService windAIService;
     @Resource
     private WindTurbineTestingPointDiService windDIService;
+    @Autowired
+    private WindturbineMapper windturbineMapper;
 
 
     /**
@@ -59,8 +63,9 @@ public class ReliabilityAnalysisController {
             @RequestParam(name = "interval", required = false) Optional<Integer> interval){
 
         List<Object> list = new ArrayList<>();
+        Windturbine wtmid = windturbineMapper.selectByPrimaryKey(wtId);
 
-        List<String> codes = alertrule2ervice.getUniformCodeByNameAndStation(name, station, wtId);
+        List<String> codes = alertrule2ervice.getUniformCodeByNameAndStation(name, station, wtmid.getModelid());
         if (codes == null || codes.size() == 0)
             return AjaxResult.successData(AjaxStatus.success.code, list);
 

+ 4 - 3
src/main/java/com/gyee/frame/service/Alertrule2ervice.java

@@ -242,14 +242,15 @@ public class Alertrule2ervice implements BaseService<Alertrule2, Alertrule2Examp
      * 解析规则表达式,提取出所有uniformCode
      * @param name
      * @param station
-     * @param wtId
+     * @param modelid
      * @return
      */
-    public List<String> getUniformCodeByNameAndStation(String name, String station, String wtId){
+    public List<String> getUniformCodeByNameAndStation(String name, String station, String modelid){
         Alertrule2Example example = new Alertrule2Example();
         example.createCriteria().andNameEqualTo(name)
                .andStationEqualTo(station)
-               .andWindturbineLike("%" + wtId + "%");
+        .andModelidEqualTo(modelid);
+//               .andWindturbineLike("%" + wtId + "%");
 
         List<Alertrule2> rules = alertrule2Mapper.selectByExample(example);
         if (rules == null || rules.size() == 0)