소스 검색

优化后台计算算法

shilin 1 년 전
부모
커밋
74e061880a
18개의 변경된 파일432개의 추가작업 그리고 254개의 파일을 삭제
  1. 3 0
      web/health/src/main/java/com/gyee/health/controller/health/HealthMainController.java
  2. 5 5
      web/health/src/main/java/com/gyee/health/controller/health/HealthReportController.java
  3. 14 14
      web/health/src/main/java/com/gyee/health/controller/health/RecommenController.java
  4. 1 1
      web/health/src/main/java/com/gyee/health/mapper/auto/AlarmcountMapper.java
  5. 1 1
      web/health/src/main/java/com/gyee/health/mapper/auto/ProEconRecommenMainMapper.java
  6. 2 0
      web/health/src/main/java/com/gyee/health/model/auto/ProEconHealthReportMain.java
  7. 9 2
      web/health/src/main/java/com/gyee/health/model/custom/HealthmodelrecordsVo.java
  8. 9 0
      web/health/src/main/java/com/gyee/health/model/custom/StopTypeTreeVo.java
  9. 91 0
      web/health/src/main/java/com/gyee/health/model/vo/ProEconRecommenMainVo.java
  10. 3 0
      web/health/src/main/java/com/gyee/health/service/auto/IProBasicProjectPlanService.java
  11. 23 12
      web/health/src/main/java/com/gyee/health/service/auto/impl/ProBasicProjectPlanServiceImpl.java
  12. 41 16
      web/health/src/main/java/com/gyee/health/service/health/HealthMainService.java
  13. 16 11
      web/health/src/main/java/com/gyee/health/service/health/HealthReportService.java
  14. 7 33
      web/health/src/main/java/com/gyee/health/service/health/HealthSubService.java
  15. 106 98
      web/health/src/main/java/com/gyee/health/service/health/WindTurbineHealthListService.java
  16. 55 17
      web/health/src/main/java/com/gyee/health/service/recommen/RecommenService.java
  17. 44 42
      web/health/src/main/java/com/gyee/health/util/golden/EdosUtil.java
  18. 2 2
      web/health/src/main/resources/application-jn.properties

+ 3 - 0
web/health/src/main/java/com/gyee/health/controller/health/HealthMainController.java

@@ -286,6 +286,7 @@ public class HealthMainController {
                 StopTypeTreeVo vo = new StopTypeTreeVo();
                 vo.setId(wt.getId());
                 vo.setName(wt.getName());
+                vo.setNemCode(wt.getNemCode());
                 vo.setpId("0");
                 vos.add(vo);
             }
@@ -325,6 +326,7 @@ public class HealthMainController {
                 StopTypeTreeVo vo = new StopTypeTreeVo();
                 vo.setId(wt.getId());
                 vo.setName(wt.getName());
+                vo.setNemCode(wt.getNemCode());
                 vo.setpId("0");
                 vos.add(vo);
             }
@@ -367,6 +369,7 @@ public class HealthMainController {
                 StopTypeTreeVo vo = new StopTypeTreeVo();
                 vo.setId(wt.getId());
                 vo.setName(wt.getName());
+                vo.setNemCode(wt.getNemCode());
                 vo.setpId("0");
                 vos.add(vo);
             }

+ 5 - 5
web/health/src/main/java/com/gyee/health/controller/health/HealthReportController.java

@@ -86,16 +86,16 @@ public class HealthReportController {
     public AjaxResult getStateJudgment(String recordDate, String wtId) throws Exception {
 
 
-        StateJudgmentVo vos = new StateJudgmentVo();
+        StateJudgmentVo vo = null;
 
         if (StringUtils.notEmp(recordDate) && StringUtils.notEmp(wtId)) {
-            vos = healthReportService.getStateJudgment(DateUtils.parseDate(recordDate), wtId);
+            vo = healthReportService.getStateJudgment(DateUtils.parseDate(recordDate), wtId);
 
         }
-        if (null != vos) {
-            return AjaxResult.successData(AjaxStatus.success.code, vos);
+        if (null != vo) {
+            return AjaxResult.successData(AjaxStatus.success.code, vo);
         } else {
-            return AjaxResult.successData(AjaxStatus.error.code, vos);
+            return AjaxResult.successData(AjaxStatus.error.code, vo);
         }
 
     }

+ 14 - 14
web/health/src/main/java/com/gyee/health/controller/health/RecommenController.java

@@ -3,7 +3,7 @@ package com.gyee.health.controller.health;
 
 import com.gyee.health.dto.AjaxResult;
 import com.gyee.health.dto.AjaxStatus;
-import com.gyee.health.model.auto.ProEconRecommenMain;
+import com.gyee.health.model.vo.ProEconRecommenMainVo;
 import com.gyee.health.service.recommen.RecommenService;
 import com.gyee.health.util.StringUtils;
 import io.swagger.annotations.Api;
@@ -39,7 +39,7 @@ public class RecommenController {
     @ApiOperation(value = "获得当日健康推荐检修风机", notes = "获得当日健康推荐检修风机")
      public AjaxResult getRecommenmainDay1() {
 
-        List<ProEconRecommenMain> vos=new ArrayList<>();
+        List<ProEconRecommenMainVo> vos=new ArrayList<>();
 
         vos=recommenService.getRecommenmainDay1();
 
@@ -59,7 +59,7 @@ public class RecommenController {
     @ApiOperation(value = "获得3日健康推荐检修风机", notes = "获得3日健康推荐检修风机")
     public AjaxResult getRecommenmainDay3() {
 
-        List<ProEconRecommenMain> vos=new ArrayList<>();
+        List<ProEconRecommenMainVo> vos=new ArrayList<>();
 
         vos=recommenService.getRecommenmainDay3();
 
@@ -79,7 +79,7 @@ public class RecommenController {
     @ApiOperation(value = "获得7日健康推荐检修风机", notes = "获得7日健康推荐检修风机")
     public AjaxResult getRecommenmainDay7() {
 
-        List<ProEconRecommenMain> vos=new ArrayList<>();
+        List<ProEconRecommenMainVo> vos=new ArrayList<>();
 
         vos=recommenService.getRecommenmainDay7();
 
@@ -126,7 +126,7 @@ public class RecommenController {
     public AjaxResult confirpushAll(String typeid)
     {
 
-        List<ProEconRecommenMain> vos=new ArrayList<>();
+        List<ProEconRecommenMainVo> vos=new ArrayList<>();
 
         if (StringUtils.notEmp(typeid)) {
             switch(typeid) {
@@ -134,7 +134,7 @@ public class RecommenController {
                     vos=recommenService.getRecommenmainDay1();
                     if(!vos.isEmpty())
                     {
-                        for(ProEconRecommenMain vo:vos)
+                        for(ProEconRecommenMainVo vo:vos)
                         {
                             recommenService.confirpush(vo.getId());
                         }
@@ -144,7 +144,7 @@ public class RecommenController {
                     vos=recommenService.getRecommenmainDay3();
                     if(!vos.isEmpty())
                     {
-                        for(ProEconRecommenMain vo:vos)
+                        for(ProEconRecommenMainVo vo:vos)
                         {
                             recommenService.confirpush(vo.getId());
                         }
@@ -154,7 +154,7 @@ public class RecommenController {
                     vos=recommenService.getRecommenmainDay7();
                     if(!vos.isEmpty())
                     {
-                        for(ProEconRecommenMain vo:vos)
+                        for(ProEconRecommenMainVo vo:vos)
                         {
                             recommenService.confirpush(vo.getId());
                         }
@@ -203,7 +203,7 @@ public class RecommenController {
     public AjaxResult ignorepushAll(String typeid)
     {
 
-        List<ProEconRecommenMain> vos=new ArrayList<>();
+        List<ProEconRecommenMainVo> vos=new ArrayList<>();
 
         if (StringUtils.notEmp(typeid)) {
             switch(typeid) {
@@ -211,7 +211,7 @@ public class RecommenController {
                     vos=recommenService.getRecommenmainDay1();
                     if(!vos.isEmpty())
                     {
-                        for(ProEconRecommenMain vo:vos)
+                        for(ProEconRecommenMainVo vo:vos)
                         {
                             recommenService.ignorepush(vo.getId());
                         }
@@ -221,7 +221,7 @@ public class RecommenController {
                     vos=recommenService.getRecommenmainDay3();
                     if(!vos.isEmpty())
                     {
-                        for(ProEconRecommenMain vo:vos)
+                        for(ProEconRecommenMainVo vo:vos)
                         {
                             recommenService.ignorepush(vo.getId());
                         }
@@ -231,7 +231,7 @@ public class RecommenController {
                     vos=recommenService.getRecommenmainDay7();
                     if(!vos.isEmpty())
                     {
-                        for(ProEconRecommenMain vo:vos)
+                        for(ProEconRecommenMainVo vo:vos)
                         {
                             recommenService.ignorepush(vo.getId());
                         }
@@ -255,7 +255,7 @@ public class RecommenController {
 
     public AjaxResult recommenConfirmedList() {
 
-        List<ProEconRecommenMain> vos=new ArrayList<>();
+        List<ProEconRecommenMainVo> vos=new ArrayList<>();
 
         vos=recommenService.recommenConfirmedList();
 
@@ -504,7 +504,7 @@ public class RecommenController {
 //
 //    public AjaxResult getRecommenmainMonth(String wtId) throws Exception {
 //
-//        List<ProEconRecommenMain> result=new ArrayList<>();
+//        List<ProEconRecommenMainVo> result=new ArrayList<>();
 //
 //        if(StringUtils.notEmp(wtId))
 //        {

+ 1 - 1
web/health/src/main/java/com/gyee/health/mapper/auto/AlarmcountMapper.java

@@ -37,7 +37,7 @@ public interface AlarmcountMapper extends BaseMapper<Alarmcount> {
             "    from   (select snapid,sum(count) as count,sum(time) as time from alarmcount" +
             "    where alarmdate>=#{beginDate} and  alarmdate<=#{endDate} group by snapid )" +
             "    a,alarmsnap s,windturbine_parts p,windturbine w where s.id=a.snapid and s.category3=p.id" +
-            "  and w.id=s.windturbineid and  s.modelid =w.modelid and w.modelid=#{wtId}  ")
+            "  and w.id=s.windturbineid and  s.modelid =w.modelid and w.modelid=#{modelId}  ")
     public List<AlarmcountVo> findAlarmCountByModelId(@Param(value = "modelId") String modelId, @Param(value = "beginDate") Date beginDate, @Param(value = "endDate")Date endDate);
 
 

+ 1 - 1
web/health/src/main/java/com/gyee/health/mapper/auto/ProEconRecommenMainMapper.java

@@ -36,7 +36,7 @@ public interface ProEconRecommenMainMapper extends BaseMapper<ProEconRecommenMai
     public List<ProEconRecommenMain> findRecommenmainList(@Param(value = "beginDate") Date beginDate, @Param(value = "endDate")Date endDate);
 
 
-    @Select(" select * from pro_econ_recommen_main t where record_date=#{recordDate} and wt_id<=#{wtId}    ")
+    @Select(" select * from pro_econ_recommen_main t where record_date=#{recordDate} and wt_id=#{wtId}    ")
     public List<ProEconRecommenMain> findRecommenmainListByWt(@Param(value = "wtId") String wtId,@Param(value = "recordDate") Date recordDate);
 
 }

+ 2 - 0
web/health/src/main/java/com/gyee/health/model/auto/ProEconHealthReportMain.java

@@ -160,5 +160,7 @@ public class ProEconHealthReportMain extends Model {
      */
     private Double y11mycqxpcl;
 
+    private String wpName;
 
+    private String nemCode;
 }

+ 9 - 2
web/health/src/main/java/com/gyee/health/model/custom/HealthmodelrecordsVo.java

@@ -17,6 +17,7 @@ public class HealthmodelrecordsVo  implements java.io.Serializable {
     private String wpname;
     private String wtid;
     private String wtname;
+    private String nemCode;
     private String model;       
     private Double score;
     private Double zxd;
@@ -31,8 +32,14 @@ public class HealthmodelrecordsVo  implements java.io.Serializable {
     private String jc;
     
     private Integer[] futureHealth;
-    
-    
+
+    public String getNemCode() {
+        return nemCode;
+    }
+
+    public void setNemCode(String nemCode) {
+        this.nemCode = nemCode;
+    }
 
     public Integer[] getFutureHealth() {
         return futureHealth;

+ 9 - 0
web/health/src/main/java/com/gyee/health/model/custom/StopTypeTreeVo.java

@@ -4,6 +4,8 @@ public class StopTypeTreeVo {
 	private String id;
 	private String pId;
 	private String name;
+
+	private String nemCode;
 	public String getId() {
 		return id;
 	}
@@ -23,4 +25,11 @@ public class StopTypeTreeVo {
 		this.name = name;
 	}
 
+	public String getNemCode() {
+		return nemCode;
+	}
+
+	public void setNemCode(String nemCode) {
+		this.nemCode = nemCode;
+	}
 }

+ 91 - 0
web/health/src/main/java/com/gyee/health/model/vo/ProEconRecommenMainVo.java

@@ -0,0 +1,91 @@
+package com.gyee.health.model.vo;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.util.Date;
+
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+public class ProEconRecommenMainVo {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 编码
+     */
+    private String id;
+
+    /**
+     * 风场编号
+     */
+    private String wpId;
+
+    /**
+     * 风机编号
+     */
+    private String wtId;
+
+    /**
+     * 风机名称
+     */
+    private String wtName;
+    /**
+     * 风机别名
+     */
+    private String nemCode;
+
+    /**
+     * 日期
+     */
+    private Date recordDate;
+
+    /**
+     * 创建记录时间
+     */
+    private Date createDate;
+
+    /**
+     * 速度
+     */
+    private Double speed;
+
+    /**
+     * 原因
+     */
+    private String reason;
+
+    /**
+     * 是否确认
+     */
+    private Integer ismain;
+
+    /**
+     * 操作人
+     */
+    private String operation;
+
+    /**
+     * 操作时间
+     */
+    private Date operationdate;
+
+    /**
+     * 公式
+     */
+    private String formulas;
+
+    /**
+     * 公式说明
+     */
+    private String formulasText;
+
+    /**
+     * 故障前三名
+     */
+    private String topThreeFault;
+
+
+}

+ 3 - 0
web/health/src/main/java/com/gyee/health/service/auto/IProBasicProjectPlanService.java

@@ -16,4 +16,7 @@ import java.util.List;
 public interface IProBasicProjectPlanService extends IService<ProBasicProjectPlan> {
     public List<ProBasicProjectPlan> getProjectPlanList(String year, String pageNum, String pageSize);
     List<ProBasicProjectPlan> getList(String year);
+
+
+
 }

+ 23 - 12
web/health/src/main/java/com/gyee/health/service/auto/impl/ProBasicProjectPlanServiceImpl.java

@@ -1,16 +1,15 @@
 package com.gyee.health.service.auto.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.gyee.common.model.StringUtils;
-import com.gyee.common.util.SortUtils;
 import com.gyee.health.mapper.auto.ProBasicProjectPlanMapper;
 import com.gyee.health.model.auto.ProBasicProjectPlan;
 import com.gyee.health.service.auto.IProBasicProjectPlanService;
 import org.springframework.stereotype.Service;
 
+import javax.annotation.Resource;
+import java.util.ArrayList;
 import java.util.List;
 
 /**
@@ -23,16 +22,28 @@ import java.util.List;
  */
 @Service
 public class ProBasicProjectPlanServiceImpl extends ServiceImpl<ProBasicProjectPlanMapper, ProBasicProjectPlan> implements IProBasicProjectPlanService {
+
+
+    @Resource
+    private ProBasicProjectPlanMapper proBasicProjectPlanMapper;
     @Override
-    public List<ProBasicProjectPlan> getProjectPlanList(String year, String pageNum, String pageSize) {
-        Page<ProBasicProjectPlan> page = new Page<>(Integer.parseInt(pageNum), Integer.parseInt(pageSize));
-        QueryWrapper<ProBasicProjectPlan> qw = new QueryWrapper<>();
-        if (StringUtils.isNotEmpty(year)) {
-            qw.lambda().eq(ProBasicProjectPlan::getYear, year);
+    public List<ProBasicProjectPlan> getProjectPlanList(String wpId, String year, String month) {
+
+        List<ProBasicProjectPlan> list =new ArrayList<>();
+        if(StringUtils.notEmp(wpId) && StringUtils.notEmp(year) )
+        {
+            QueryWrapper<ProBasicProjectPlan> queryWrapper = new QueryWrapper<>();
+            queryWrapper.eq("windpowerstation_id", wpId);
+            queryWrapper.eq("year", year);
+            if(StringUtils.notEmp(month))
+            {
+                queryWrapper.eq("month", month);
+            }
+
+            list = proBasicProjectPlanMapper.selectList(queryWrapper);
         }
-        IPage<ProBasicProjectPlan> ProBasicLine = getBaseMapper().selectPage(page, qw);
-        List<ProBasicProjectPlan> list = ProBasicLine.getRecords();
-        SortUtils.sort(list,"projectId",SortUtils.DESC);
+
+
         return list;
     }
 
@@ -42,7 +53,7 @@ public class ProBasicProjectPlanServiceImpl extends ServiceImpl<ProBasicProjectP
         if (StringUtils.isNotEmpty(year)){
             qw.like("year",year);
         }
-        List<ProBasicProjectPlan> list = baseMapper.selectList(qw);
+        List<ProBasicProjectPlan> list = proBasicProjectPlanMapper.selectList(qw);
         return list;
     }
 }

+ 41 - 16
web/health/src/main/java/com/gyee/health/service/health/HealthMainService.java

@@ -171,12 +171,20 @@ public class HealthMainService {
                     uniformcode = ContantXk.JKYC006;
                     break;
                 case 2:
+                    cal.add(Calendar.DAY_OF_MONTH, 1);
+                    cal.set(Calendar.HOUR_OF_DAY, 0);
+                    cal.set(Calendar.MINUTE, 0);
+                    cal.set(Calendar.SECOND, 0);
+                    num=7;
+                    uniformcode = ContantXk.JKYC021;
+                    //   uniformcode = ContantXk.YCFJJKZT7DAY;
+                    break;
                 case 3:
                     cal.add(Calendar.DAY_OF_MONTH, 1);
                     cal.set(Calendar.HOUR_OF_DAY, 0);
                     cal.set(Calendar.MINUTE, 0);
                     cal.set(Calendar.SECOND, 0);
-
+                    num=30;
                     uniformcode = ContantXk.JKYC021;
                     //   uniformcode = ContantXk.YCFJJKZT7DAY;
                     break;
@@ -315,7 +323,7 @@ public class HealthMainService {
 
             String wpId = wp.getId();
 
-            if (wpId.endsWith("FDC")) {
+            if (wpId.contains("FDC")) {
 
                 double tqyb = 1.0;// 天气预报
                 double ycfs = 0.0;// 预测风速
@@ -478,8 +486,8 @@ public class HealthMainService {
                         if (CacheContext.wtmap.containsKey(wtId)) {
                             ProBasicEquipment wt = CacheContext.wtmap.get(wtId);
                             if (StringUtils.notEmp(wt.getId())) {
-                                String num = wt.getId().substring(wt.getId().indexOf("_") + 1);
-                                vo.setName(num);
+//                                String num = wt.getId().substring(wt.getId().indexOf("_") + 1);
+                                vo.setName(wt.getNemCode());
 
                             }
                         }
@@ -500,8 +508,8 @@ public class HealthMainService {
                             if (CacheContext.wtmap.containsKey(wtId)) {
                                 ProBasicEquipment wt = CacheContext.wtmap.get(wtId);
                                 if (StringUtils.notEmp(wt.getId())) {
-                                    String num = wt.getId().substring(wt.getId().indexOf("_") + 1);
-                                    vo.setName(num);
+//                                    String num = wt.getId().substring(wt.getId().indexOf("_") + 1);
+                                    vo.setName(wt.getNemCode());
 
                                 }
                             }
@@ -557,7 +565,7 @@ public class HealthMainService {
         List<Map<String, String>> gzls = new ArrayList<>();
         if (StringUtils.notEmp(wpId) && CacheContext.wpmap.containsKey(wpId)) {
 
-            if (wpId.endsWith("FDC")) {
+            if (wpId.contains("FDC")) {
                 int ysl = 0;// 优数量
                 int lsl = 0;// 良数量
                 int csl = 0;// 差数量
@@ -581,12 +589,13 @@ public class HealthMainService {
                 ProBasicPowerstationPoint point = proBasicPowerstationPointService.getPowerstationPoint(wpId, ContantXk.RFDL);
                 String wppintId1 = point.getNemCode();
                 PointData ssfspoint1 = realApiUtil.getRealData(wppintId1);
-                double rfdl = StringUtils.round(ssfspoint1.getPointValueInDouble(), digit);
+                double rfdl =  new BigDecimal(ssfspoint1.getPointValueInDouble()).divide(new BigDecimal(10000), 2, RoundingMode.HALF_EVEN).doubleValue();
 
                 ProBasicPowerstationPoint point2 = proBasicPowerstationPointService.getPowerstationPoint(wpId, ContantXk.YFDL);
                 String wppintId2 = point2.getNemCode();
                 PointData ssfspoint2 = realApiUtil.getRealData(wppintId2);
-                double yfdl = StringUtils.round(ssfspoint2.getPointValueInDouble(), digit);
+                double yfdl = new BigDecimal(ssfspoint2.getPointValueInDouble()).divide(new BigDecimal(10000), 2, RoundingMode.HALF_EVEN).doubleValue();
+
 
                 List<String[]> wtIdls = new ArrayList<>();// 风机编号集合
                 List<Integer> yhls = new ArrayList<>();// 隐患集合
@@ -715,23 +724,33 @@ public class HealthMainService {
                 int minutesDiff = DateUtils.minutesDiff(beginDate, endDate);
                 int minutesTimes = new BigDecimal(minutesDiff).divide(new BigDecimal(15), 0, RoundingMode.HALF_EVEN).intValue();
                 if (minutesTimes != 0) {
-                    ycdl15minute = new BigDecimal(rfdl).divide(new BigDecimal(minutesTimes), 2, RoundingMode.HALF_EVEN).multiply(BigDecimal.valueOf(Math.random())).doubleValue();
+                    ycdl15minute = new BigDecimal(rfdl).divide(new BigDecimal(minutesTimes), 2, RoundingMode.HALF_EVEN)
+                            .divide(new BigDecimal(10000), 2, RoundingMode.HALF_EVEN)
+                            .multiply(BigDecimal.valueOf(Math.random())).doubleValue();
                     ycdl15minute = StringUtils.round(ycdl15minute, 2);
                 } else {
-                    ycdl15minute = new BigDecimal(rfdl).multiply(BigDecimal.valueOf(Math.random())).doubleValue();
+                    ycdl15minute = new BigDecimal(rfdl)
+                            .divide(new BigDecimal(10000), 2, RoundingMode.HALF_EVEN)
+                            .multiply(BigDecimal.valueOf(Math.random())).doubleValue();
                     ycdl15minute = StringUtils.round(ycdl15minute, 2);
                 }
 
                 int hoursDiff1 = DateUtils.hoursDiff1(beginDate, endDate);
                 if (hoursDiff1 != 0) {
-                    ycdl1hour = new BigDecimal(rfdl).divide(new BigDecimal(hoursDiff1), 2, RoundingMode.HALF_EVEN).multiply(BigDecimal.valueOf(Math.random())).doubleValue();
+                    ycdl1hour = new BigDecimal(rfdl).divide(new BigDecimal(hoursDiff1), 2, RoundingMode.HALF_EVEN)
+                            .divide(new BigDecimal(10000), 2, RoundingMode.HALF_EVEN)
+                            .multiply(BigDecimal.valueOf(Math.random())).doubleValue();
                     ycdl1hour = StringUtils.round(ycdl1hour, 2);
                 } else {
-                    ycdl1hour = new BigDecimal(rfdl).multiply(BigDecimal.valueOf(Math.random())).doubleValue();
+                    ycdl1hour = new BigDecimal(rfdl)
+                            .divide(new BigDecimal(10000), 2, RoundingMode.HALF_EVEN)
+                            .multiply(BigDecimal.valueOf(Math.random())).doubleValue();
                     ycdl1hour = StringUtils.round(ycdl1hour, 2);
                 }
 
-                ycdl1day = new BigDecimal(rfdl).multiply(BigDecimal.valueOf(Math.random())).doubleValue();
+                ycdl1day = new BigDecimal(rfdl)
+                        .divide(new BigDecimal(10000), 2, RoundingMode.HALF_EVEN)
+                        .multiply(BigDecimal.valueOf(Math.random())).doubleValue();
                 ycdl1day = StringUtils.round(ycdl1day, 2);
 
 
@@ -814,24 +833,29 @@ public class HealthMainService {
                         }
 
 
-                        String[] str = new String[3];
+                        String[] str = new String[4];
                         str[0] = wtId;
+
                         str[1] = "3";
                         if (CacheContext.wtmap.containsKey(wtId)) {
                             ProBasicEquipment wt = CacheContext.wtmap.get(wtId);
+                            str[3] = wt.getNemCode();
                             if (StringUtils.notEmp(wt.getId())) {
                                 String num = wt.getId().substring(wt.getId().indexOf("_") + 1);
                                 str[2] = num;
 
                             }
                         }
+
                         wtIdls.add(str);
                         csl++;
                     } else {
-                        String[] str = new String[3];
+                        String[] str = new String[4];
+
                         if (jk == HealthStatusValue.ZC.getCode()) {
                             str[0] = wtId;
                             str[1] = "1";
+
                             wtIdls.add(str);
                             ysl++;
                         } else if (jk == HealthStatusValue.LH.getCode() || jk == HealthStatusValue.ZY.getCode()) {
@@ -847,6 +871,7 @@ public class HealthMainService {
                         }
                         if (CacheContext.wtmap.containsKey(wtId)) {
                             ProBasicEquipment wt = CacheContext.wtmap.get(wtId);
+                            str[3] = wt.getNemCode();
                             if (StringUtils.notEmp(wt.getId())) {
                                 String num = wt.getId().substring(wt.getId().indexOf("_") + 1);
                                 str[2] = num;

+ 16 - 11
web/health/src/main/java/com/gyee/health/service/health/HealthReportService.java

@@ -234,21 +234,22 @@ public class HealthReportService {
                                     String gz2=gzarr[1];
                                     String gz3=gzarr[2];
 
+                                    vo.setTop1(gz1);
+                                    vo.setTop2(gz2);
+                                    vo.setTop3(gz3);
+
+                                    vo.setRecordDate(sj.getRecordDate());
+
+                                    vo.setWtId(wt.getId());
+                                    vo.setWtName(wt.getName());
                                     List<Alertrulefailure> afls=alertrulefailureService.getPartByAlertrule(gz1,wt.getModelId());
                                     if(!afls.isEmpty())
                                     {
-
                                         Alertrulefailure af=afls.get(0);
-                                        vo.setTop1(gz1);
-                                        vo.setTop2(gz2);
-                                        vo.setTop3(gz3);
                                         vo.setGzpc(af.getGzpc());
                                         vo.setGzcl(af.getGzyy());
                                         vo.setGqj(af.getGqj());
-                                        vo.setRecordDate(sj.getRecordDate());
                                         vo.setXqsc(af.getXqsc());
-                                        vo.setWtId(wt.getId());
-                                        vo.setWtName(wt.getName());
                                     }
                                 }
                             }
@@ -286,7 +287,7 @@ public class HealthReportService {
             HealthNumVo vo1 = new HealthNumVo();
             vo1.setDateRange("1天");
             getHealthNumVo(vo1, wt, endDate, beginDate);
-
+            vos.add(vo1);
             c.setTime(recordDate);
             endDate = c.getTime();
             c.add(Calendar.DAY_OF_MONTH, -3);
@@ -294,7 +295,7 @@ public class HealthReportService {
             HealthNumVo vo2 = new HealthNumVo();
             vo2.setDateRange("3天");
             getHealthNumVo(vo2, wt, endDate, beginDate);
-
+            vos.add(vo2);
             c.setTime(recordDate);
             endDate = c.getTime();
             c.set(Calendar.DAY_OF_MONTH, 1);
@@ -302,6 +303,7 @@ public class HealthReportService {
             HealthNumVo vo3 = new HealthNumVo();
             vo3.setDateRange("统计期内");
             getHealthNumVo(vo3, wt, endDate, beginDate);
+            vos.add(vo3);
         }
         return vos;
     }
@@ -319,6 +321,9 @@ public class HealthReportService {
         List<EquipmentInfoDayTopVo> vos = new ArrayList<>();
         if (StringUtils.notEmp(recordDate) && StringUtils.notEmp(wtId)) {
 
+//            Calendar c=Calendar.getInstance();
+//            c.setTime(recordDate);
+//            c.add(Calendar.DAY_OF_MONTH,-1);
 
             QueryWrapper<ProEconEquipmentInfoDayTop> queryWrapperTop = new QueryWrapper<>();
             queryWrapperTop.eq("record_date", recordDate);
@@ -654,7 +659,7 @@ public class HealthReportService {
                 }
             }
         }
-
+        vo.setClx(clx.intValue());
         fjjkzt = proBasicEquipmentPointService.getEquipmentPoint(wt.getId(), ContantXk.JKZT004);
         //变桨不良健康状态统计
         fjjkztls = realApiUtil.getHistoryDatasSnap(fjjkzt.getNemCode(), beginDate.getTime() / 1000, endDate.getTime() / 1000, null, 3600l);
@@ -683,7 +688,7 @@ public class HealthReportService {
         }
         vo.setZz(zz.intValue());
 
-        vo.setTotal(Integer.valueOf(String.valueOf(fdj + clx + bj + zz)));
+        vo.setTotal(Double.valueOf(String.valueOf(fdj + clx + bj + zz)).intValue());
         return vo;
     }
 

+ 7 - 33
web/health/src/main/java/com/gyee/health/service/health/HealthSubService.java

@@ -101,26 +101,10 @@ public class HealthSubService {
         double score = 100.0;
         if (StringUtils.notEmp(wtId)) {
 
-            List<ProEconStateJudgmentDay> ls = proEconStateJudgmentDayService.findStatejudgmentrecord(wtId);
-
-
-            ProBasicEquipmentPoint ai = proBasicEquipmentPointService.getEquipmentPoint(wtId, ContantXk.MXZT);
+            ProBasicEquipmentPoint ai = proBasicEquipmentPointService.getEquipmentPoint(wtId, ContantXk.JKZT100);
             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() == StatusDetailValue.GZ.getCode()) {
-                    score = score - 50;
-                }
-
-                if (score < 0) {
-                    score = 0;
-                }
-            }
+            score = point.getPointValueInDouble();
 
 
         }
@@ -1054,7 +1038,7 @@ public class HealthSubService {
         List<DatasetsVo> datasets = new ArrayList<DatasetsVo>();
 
 
-        ProBasicEquipmentPoint fj = proBasicEquipmentPointService.getEquipmentPoint(wtId, ContantXk.JKZT100);
+        ProBasicEquipmentPoint fj = proBasicEquipmentPointService.getEquipmentPoint(wtId, ContantXk.JKJL001);
         ProBasicEquipmentPoint clx = proBasicEquipmentPointService.getEquipmentPoint(wtId, ContantXk.JKJL002);
         ProBasicEquipmentPoint fdj = proBasicEquipmentPointService.getEquipmentPoint(wtId, ContantXk.JKJL003);
         ProBasicEquipmentPoint kzys = proBasicEquipmentPointService.getEquipmentPoint(wtId, ContantXk.JKJL004);
@@ -1078,8 +1062,8 @@ public class HealthSubService {
 
                 xData.add(fjls.get(i).getPointTime() * 1000);
 
-                double temp = fjls.get(i).getPointValueInDouble();
-                temp = new BigDecimal(temp).divide(new BigDecimal(100), 2, RoundingMode.HALF_EVEN).doubleValue();
+                double temp = StringUtils.round(fjls.get(i).getPointValueInDouble(),2);
+
                 data.add(temp);
 
             }
@@ -1153,10 +1137,7 @@ public class HealthSubService {
 
                 xData.add(jcxtls.get(i).getPointTime() * 1000);
                 // data.add(jcxtls.get(i).getPointValueInDouble());
-                if (jcxtls.get(i).getPointTime() * 1000 <= DateUtils.now().getTime()) {
-                    data.add(StringUtils.round(jcxtls.get(i).getPointValueInDouble(), 2));
-                    // data.add(jcxtls.get(i).getPointValueInDouble());
-                }
+                data.add(StringUtils.round(jcxtls.get(i).getPointValueInDouble(), 2));
             }
             dvo.setData(data);
             vo.setxData(xData);
@@ -1205,14 +1186,7 @@ public class HealthSubService {
                 xData.add(clxls.get(i).getPointTime() * 1000);
                 // data.add(clxls.get(i).getPointValueInDouble());
 
-                if (clxls.get(i).getPointTime() * 1000 <= DateUtils.now().getTime()) {
-                    data1.add(StringUtils.round(clxls.get(i).getPointValueInDouble(), 2));
-                    // data2.add(1.0);
-                    // data3.add(1.0);
-                    // data4.add(1.0);
-                    // data5.add(1.0);
-
-                }
+                data1.add(StringUtils.round(clxls.get(i).getPointValueInDouble(), 2));
             }
             dvo1.setData(data1);
             // dvo2.setData(data2);

+ 106 - 98
web/health/src/main/java/com/gyee/health/service/health/WindTurbineHealthListService.java

@@ -51,138 +51,146 @@ public class WindTurbineHealthListService {
 
         Map<String, List<PointData>> pointDataMap=new HashMap<>();
         List<String> points = new ArrayList<>();
-        List<ProBasicEquipment> wtls=CacheContext.wpwtmap.get(wpId);
-        for (ProBasicEquipment wt : CacheContext.wpwtmap.get(wpId)) {
 
-            for (int i = 0; i < codels.size(); i++) {
-                ProBasicEquipmentPoint ai =proBasicEquipmentPointService.getEquipmentPoint(wt.getId(),codels.get(i));
-                points.add( ai.getNemCode());
-            }
-        }
-        // 获得风机健康状态结果数组
-        List<PointData> pointDataList = realApiUtil.getRealData(points);
+        Map<String, List<String>> ahmap =getAlarmhistoryLMap(wpId);
 
+        Map<String, String> altypemap = findAlertrulefailuresubMap();
 
-        if(!pointDataList.isEmpty())
+        List<HealthmodelrecordsVo> vos = new ArrayList<>();
+        if(CacheContext.wpwtmap.containsKey(wpId))
         {
-            for(int i=0;i<wtls.size();i++)
-            {
-                ProBasicEquipment wt=wtls.get(i);
-                List<PointData> templs=new ArrayList<>();
-                for(int j=0;j<5;j++)
-                {
-                    templs.add(pointDataList.get(i*5+j));
+            List<ProBasicEquipment> wtls=CacheContext.wpwtmap.get(wpId);
+            for (ProBasicEquipment wt : wtls) {
+
+                for (int i = 0; i < codels.size(); i++) {
+                    ProBasicEquipmentPoint ai =proBasicEquipmentPointService.getEquipmentPoint(wt.getId(),codels.get(i));
+                    points.add( ai.getNemCode());
                 }
-                pointDataMap.put(wt.getId(),templs);
             }
-
-        }
+            // 获得风机健康状态结果数组
+            List<PointData> pointDataList = realApiUtil.getRealData(points);
 
 
+            if(!pointDataList.isEmpty())
+            {
+                for(int i=0;i<wtls.size();i++)
+                {
+                    ProBasicEquipment wt=wtls.get(i);
+                    List<PointData> templs=new ArrayList<>();
+                    for(int j=0;j<5;j++)
+                    {
+                        templs.add(pointDataList.get(i*5+j));
+                    }
+                    pointDataMap.put(wt.getId(),templs);
+                }
 
-        Map<String, List<String>> ahmap =getAlarmhistoryLMap(wpId);
+            }
 
-        Map<String, String> altypemap = findAlertrulefailuresubMap();
 
-        List<HealthmodelrecordsVo> vos = new ArrayList<>();
-        int id = 0;
-        if(CacheContext.wpwtmap.containsKey(wpId))
-        {
-            for (ProBasicEquipment wt : CacheContext.wpwtmap.get(wpId)) {
-                HealthmodelrecordsVo vo = new HealthmodelrecordsVo();
-                vo.setId(id);
-                vo.setRecodedate(beginDate);
-                vo.setWpid(wt.getWindpowerstationId());
-                vo.setWpname(CacheContext.wpmap.get(wt.getWindpowerstationId()).getName());
-                vo.setWtid(wt.getId());
-                vo.setWtname(wt.getId());
-                vo.setModel(wt.getModelId());
 
+            int id = 0;
+            if(CacheContext.wpwtmap.containsKey(wpId))
+            {
+                for (ProBasicEquipment wt : CacheContext.wpwtmap.get(wpId)) {
+                    HealthmodelrecordsVo vo = new HealthmodelrecordsVo();
+                    vo.setId(id);
+                    vo.setRecodedate(beginDate);
+                    vo.setWpid(wt.getWindpowerstationId());
+                    vo.setWpname(CacheContext.wpmap.get(wt.getWindpowerstationId()).getName());
+                    vo.setWtid(wt.getId());
+                    vo.setWtname(wt.getId());
+                    vo.setModel(wt.getModelId());
 
-                // 获得风机健康状态结果数组
-                List<PointData> jkvalues = pointDataMap.get(wt.getId());
 
-                double score = jkvalues.get(0).getPointValueInDouble();
-                double clxzt = jkvalues.get(1).getPointValueInDouble();
-                double fdjzt = jkvalues.get(2).getPointValueInDouble();
-                double bjzt = jkvalues.get(3).getPointValueInDouble();
-                double zkzt = jkvalues.get(4).getPointValueInDouble();
+                    // 获得风机健康状态结果数组
+                    List<PointData> jkvalues = pointDataMap.get(wt.getId());
 
+                    double score = jkvalues.get(0).getPointValueInDouble();
+                    double clxzt = jkvalues.get(1).getPointValueInDouble();
+                    double fdjzt = jkvalues.get(2).getPointValueInDouble();
+                    double bjzt = jkvalues.get(3).getPointValueInDouble();
+                    double zkzt = jkvalues.get(4).getPointValueInDouble();
 
-                vo.setScore(StringUtils.round(score, 2));
 
-                vo.setClx(getStateValue(clxzt));
-                vo.setFdj(getStateValue(fdjzt));
-                vo.setBj(getStateValue(bjzt));
-                vo.setZk(getStateValue(zkzt));
+                    vo.setScore(StringUtils.round(score, 2));
 
-                vo.setBpq("优");
-                vo.setPh("优");
-                vo.setJc("优");
-                vo.setZz("优");
+                    vo.setNemCode(wt.getNemCode());
+                    vo.setClx(getStateValue(clxzt));
+                    vo.setFdj(getStateValue(fdjzt));
+                    vo.setBj(getStateValue(bjzt));
+                    vo.setZk(getStateValue(zkzt));
 
-                if(ahmap.containsKey(wt.getId()))
-                {
-                    List<String> ahtypels=ahmap.get(wt.getId());
+                    vo.setBpq("优");
+                    vo.setPh("优");
+                    vo.setJc("优");
+                    vo.setZz("优");
 
-                    if(!ahtypels.isEmpty())
+                    if(ahmap.containsKey(wt.getId()))
                     {
-                        for(String type:ahtypels)
+                        List<String> ahtypels=ahmap.get(wt.getId());
+
+                        if(!ahtypels.isEmpty())
                         {
-                            if(altypemap.containsKey(type))
+                            for(String type:ahtypels)
                             {
-                                String typetext=altypemap.get(type);
-
-                                switch (typetext) {
-                                    case "CLX":
-                                        vo.setClx("差");
-                                        break;
-                                    case "FDJ":
-                                        vo.setFdj("差");
-                                        break;
-                                    case "BJ":
-                                        vo.setBj("差");
-                                        break;
-                                    case "ZK":
-                                        vo.setZk("差");
-                                        break;
-                                    case "PH":
-                                        vo.setPh("差");
-                                        break;
-                                    case "JC":
-                                        vo.setJc("差");
-                                        break;
-                                    case "ZZ":
-                                        vo.setZz("差");
-                                        break;
-                                    default:
-                                        break;
+                                if(altypemap.containsKey(type))
+                                {
+                                    String typetext=altypemap.get(type);
+
+                                    switch (typetext) {
+                                        case "CLX":
+                                            vo.setClx("差");
+                                            break;
+                                        case "FDJ":
+                                            vo.setFdj("差");
+                                            break;
+                                        case "BJ":
+                                            vo.setBj("差");
+                                            break;
+                                        case "ZK":
+                                            vo.setZk("差");
+                                            break;
+                                        case "PH":
+                                            vo.setPh("差");
+                                            break;
+                                        case "JC":
+                                            vo.setJc("差");
+                                            break;
+                                        case "ZZ":
+                                            vo.setZz("差");
+                                            break;
+                                        default:
+                                            break;
+                                    }
                                 }
-                            }
 
+                            }
                         }
-                    }
 
-                }
+                    }
 
-                Integer[] futureHealth = new Integer[12];
-                Random random = new Random();
-                for (int i = 0; i < 12; i++) {
-                    futureHealth[i] = random.nextInt(4) + 1;
-                }
-                vo.setFutureHealth(futureHealth);
+                    Integer[] futureHealth = new Integer[12];
+                    Random random = new Random();
+                    for (int i = 0; i < 12; i++) {
+                        futureHealth[i] = random.nextInt(4) + 1;
+                    }
+                    vo.setFutureHealth(futureHealth);
 
-                int max = 100;
-                int min = 80;
+                    int max = 100;
+                    int min = 80;
 
-                double zxd = random.nextInt(max) % (max - min + 1) + min;
-                vo.setZxd(StringUtils.round(zxd, 2));
-                vos.add(vo);
-                id++;
+                    double zxd = random.nextInt(max) % (max - min + 1) + min;
+                    vo.setZxd(StringUtils.round(zxd, 2));
+                    vos.add(vo);
+                    id++;
+                }
             }
         }
 
 
+
+
+
         return vos;
     }
 

+ 55 - 17
web/health/src/main/java/com/gyee/health/service/recommen/RecommenService.java

@@ -7,6 +7,7 @@ import com.gyee.health.model.auto.ProBasicEquipment;
 import com.gyee.health.model.auto.ProBasicEquipmentPoint;
 import com.gyee.health.model.auto.ProEconRecommenMain;
 import com.gyee.health.model.vo.HealthStatusValue;
+import com.gyee.health.model.vo.ProEconRecommenMainVo;
 import com.gyee.health.service.auto.IProBasicEquipmentPointService;
 import com.gyee.health.service.auto.IProEconRecommenMainService;
 import com.gyee.health.util.IRealTimeDataBaseUtil;
@@ -50,9 +51,11 @@ public class RecommenService {
 	 * 获得当日健康推荐检修风机
 	 * @return
 	 */
-	public List<ProEconRecommenMain> getRecommenmainDay1() {
+	public List<ProEconRecommenMainVo> getRecommenmainDay1() {
+
+
+		List<ProEconRecommenMainVo> vos=new ArrayList<>();
 
-		List<ProEconRecommenMain> list=new ArrayList<>();
 
 		Calendar cal = Calendar.getInstance();
 		cal.set(Calendar.HOUR_OF_DAY, 0);
@@ -64,18 +67,51 @@ public class RecommenService {
 		cal.add(Calendar.DAY_OF_MONTH, 1);
 		Date endDate = cal.getTime();
 
-		list=proEconRecommenMainService.getRecommenmainListByStatus("0",beginDate,endDate);
+		List<ProEconRecommenMain> list=proEconRecommenMainService.getRecommenmainListByStatus("0",beginDate,endDate);
+
+		convertVo(vos, list);
+
 
-		return list;
+		return vos;
+	}
+
+	private static void convertVo(List<ProEconRecommenMainVo> vos, List<ProEconRecommenMain> list) {
+		if(!list.isEmpty())
+		{
+			for(ProEconRecommenMain rm: list)
+			{
+				ProEconRecommenMainVo vo=new ProEconRecommenMainVo();
+				vo.setId(rm.getId());
+				vo.setFormulas(rm.getFormulas());
+				vo.setFormulasText(rm.getFormulasText());
+				vo.setIsmain(rm.getIsmain());
+				vo.setOperation(rm.getOperation());
+				vo.setCreateDate(rm.getCreateDate());
+				vo.setReason(rm.getReason());
+				vo.setSpeed(rm.getSpeed());
+				vo.setOperationdate(rm.getOperationdate());
+				vo.setWpId(rm.getWpId());
+				vo.setRecordDate(rm.getRecordDate());
+				vo.setTopThreeFault(rm.getTopThreeFault());
+				vo.setWtId(rm.getWtId());
+				if(StringUtils.notEmp(rm.getWtId()) && CacheContext.wtmap.containsKey(rm.getWtId()))
+				{
+					ProBasicEquipment wt=CacheContext.wtmap.get(rm.getWtId());
+					vo.setWtName(wt.getName());
+					vo.setNemCode(wt.getNemCode());
+				}
+				vos.add(vo);
+			}
+		}
 	}
 
 	/**
 	 * 获得3日健康推荐检修风机
 	 * @return
 	 */
-	public List<ProEconRecommenMain> getRecommenmainDay3() {
+	public List<ProEconRecommenMainVo> getRecommenmainDay3() {
 
-		List<ProEconRecommenMain> list=new ArrayList<>();
+		List<ProEconRecommenMainVo> vos=new ArrayList<>();
 
 		Calendar cal = Calendar.getInstance();
 		cal.set(Calendar.HOUR_OF_DAY, 0);
@@ -87,18 +123,18 @@ public class RecommenService {
 		cal.add(Calendar.DAY_OF_MONTH, 2);
 		Date endDate = cal.getTime();
 
-		list=proEconRecommenMainService.getRecommenmainListByStatus("0",beginDate,endDate);
-
-		return list;
+		List<ProEconRecommenMain> list=proEconRecommenMainService.getRecommenmainListByStatus("0",beginDate,endDate);
+		convertVo(vos, list);
+		return vos;
 	}
 
 	/**
 	 * 获得7日健康推荐检修风机
 	 * @return
 	 */
-	public List<ProEconRecommenMain> getRecommenmainDay7() {
+	public List<ProEconRecommenMainVo> getRecommenmainDay7() {
 
-		List<ProEconRecommenMain> list=new ArrayList<>();
+		List<ProEconRecommenMainVo> vos=new ArrayList<>();
 
 		Calendar cal = Calendar.getInstance();
 		cal.set(Calendar.HOUR_OF_DAY, 0);
@@ -111,9 +147,10 @@ public class RecommenService {
 		cal.add(Calendar.DAY_OF_MONTH, 7);
 		Date endDate = cal.getTime();
 
-		list=proEconRecommenMainService.getRecommenmainListByStatus("0",beginDate,endDate);
+		List<ProEconRecommenMain> list=proEconRecommenMainService.getRecommenmainListByStatus("0",beginDate,endDate);
 
-		return list;
+		convertVo(vos, list);
+		return vos;
 	}
 
 	/**
@@ -165,9 +202,9 @@ public class RecommenService {
 	 * 获得确认检修风机
 	 * @return
 	 */
-	public List<ProEconRecommenMain> recommenConfirmedList() {
+	public List<ProEconRecommenMainVo> recommenConfirmedList() {
 
-		List<ProEconRecommenMain> list=new ArrayList<>();
+		List<ProEconRecommenMainVo> vos=new ArrayList<>();
 
 		Calendar cal = Calendar.getInstance();
 		cal.set(Calendar.HOUR_OF_DAY, 0);
@@ -179,9 +216,10 @@ public class RecommenService {
 		cal.add(Calendar.DAY_OF_MONTH, 7);
 		Date endDate = cal.getTime();
 
-		list=proEconRecommenMainService.getRecommenmainListByStatus("1",beginDate,endDate);
+		List<ProEconRecommenMain> list=proEconRecommenMainService.getRecommenmainListByStatus("1",beginDate,endDate);
 
-		return list;
+		convertVo(vos, list);
+		return vos;
 	}
 
 	/**

+ 44 - 42
web/health/src/main/java/com/gyee/health/util/golden/EdosUtil.java

@@ -1099,49 +1099,51 @@ public class EdosUtil implements IRealTimeDataBaseUtil {
                         getHistsnapSameTiem(pointid, beginDate, pried, resultList);
                     }else
                     {
-                        for (PointData snapItem : list) {
-                            long subTime = snapItem.getPointTime() - pried;
-                            //查询时间区间的截面值(截面值为传入时间节点的上一个最近值,返回时间为值的真实时间),
-                            // 再进行比较,若截面值的时间戳在以快照时间节点前推一个单位的时间区间中,
-                            // 则代表该时间节点快照有效,否则为0
-                            String rawUrl = baseURL + "/history/section?null=0&tagNames=" +pointid+ "&ts=" + snapItem.getPointTime() ;
-                            ResponseEntity<JSONObject> sectionResp = restTemplate.getForEntity(rawUrl, JSONObject.class);
-                            JSONObject jsonObjectSection = sectionResp.getBody();
+//                        for (PointData snapItem : list) {
+//                            long subTime = snapItem.getPointTime() - pried;
+//                            //查询时间区间的截面值(截面值为传入时间节点的上一个最近值,返回时间为值的真实时间),
+//                            // 再进行比较,若截面值的时间戳在以快照时间节点前推一个单位的时间区间中,
+//                            // 则代表该时间节点快照有效,否则为0
+//                            String rawUrl = baseURL + "/history/section?null=0&tagNames=" +pointid+ "&ts=" + snapItem.getPointTime() ;
+//                            ResponseEntity<JSONObject> sectionResp = restTemplate.getForEntity(rawUrl, JSONObject.class);
+//                            JSONObject jsonObjectSection = sectionResp.getBody();
+//
+//                            if (jsonObjectSection != null) {
+//                                List<PointData> sectionlist = JsonObjectHelper.phrasePointData(jsonObjectSection);
+//                                if (sectionlist.size() > 0) {
+//                                    if(sectionlist.get(0).getPointTime()<=snapItem.getPointTime()){
+//                                        resultList.add(snapItem);
+//                                    }
+//                                    else{
+//                                        PointData data = new PointData();
+//                                        data.setEdnaId(pointid);
+//                                        data.setPointTime(snapItem.getPointTime());
+//                                        data.setPointValue("0");
+//                                        data.setPointName("1");
+//                                        data.setPointValueInDouble(0.0);
+//                                        resultList.add(data);
+//                                    }
+//                                } else {
+//                                    PointData data = new PointData();
+//                                    data.setEdnaId(pointid);
+//                                    data.setPointTime(0l);
+//                                    data.setPointValue("0");
+//                                    data.setPointName("1");
+//                                    data.setPointValueInDouble(0.0);
+//                                    resultList.add(data);
+//                                }
+//                            } else {
+//                                PointData data = new PointData();
+//                                data.setEdnaId(pointid);
+//                                data.setPointTime(0l);
+//                                data.setPointValue("0");
+//                                data.setPointName("1");
+//                                data.setPointValueInDouble(0.0);
+//                                resultList.add(data);
+//                            }
+//                        }
 
-                            if (jsonObjectSection != null) {
-                                List<PointData> sectionlist = JsonObjectHelper.phrasePointData(jsonObjectSection);
-                                if (sectionlist.size() > 0) {
-                                    if(sectionlist.get(0).getPointTime()<=snapItem.getPointTime()){
-                                        resultList.add(snapItem);
-                                    }
-                                    else{
-                                        PointData data = new PointData();
-                                        data.setEdnaId(pointid);
-                                        data.setPointTime(snapItem.getPointTime());
-                                        data.setPointValue("0");
-                                        data.setPointName("1");
-                                        data.setPointValueInDouble(0.0);
-                                        resultList.add(data);
-                                    }
-                                } else {
-                                    PointData data = new PointData();
-                                    data.setEdnaId(pointid);
-                                    data.setPointTime(0l);
-                                    data.setPointValue("0");
-                                    data.setPointName("1");
-                                    data.setPointValueInDouble(0.0);
-                                    resultList.add(data);
-                                }
-                            } else {
-                                PointData data = new PointData();
-                                data.setEdnaId(pointid);
-                                data.setPointTime(0l);
-                                data.setPointValue("0");
-                                data.setPointName("1");
-                                data.setPointValueInDouble(0.0);
-                                resultList.add(data);
-                            }
-                        }
+                        resultList=list;
                     }
 
                     return resultList;

+ 2 - 2
web/health/src/main/resources/application-jn.properties

@@ -3,8 +3,8 @@ server.port=8172
 
 #\u670D\u52A1\u540D\u79F0
 spring.application.name=health-hb-provider
-#spring.cloud.nacos.discovery.server-addr=10.81.3.155:8848
-spring.cloud.nacos.discovery.server-addr=127.0.0.1:8870
+spring.cloud.nacos.discovery.server-addr=10.81.3.155:8848
+#spring.cloud.nacos.discovery.server-addr=127.0.0.1:8870
 
 #nacos\u7684\u7528\u6237\u540D\u548C\u5BC6\u7801
 spring.cloud.nacos.username=nacos