From f502a7d9313bf161aa838e55a3fe798c89718cf7 Mon Sep 17 00:00:00 2001 From: zhangye <654600784@qq.com> Date: Mon, 9 Mar 2020 10:30:53 +0800 Subject: [PATCH] 0309.1 --- .../com/ccsens/health/bean/dto/JourneyDto.java | 2 +- .../ccsens/health/service/HealthService.java | 17 ++++++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/health/src/main/java/com/ccsens/health/bean/dto/JourneyDto.java b/health/src/main/java/com/ccsens/health/bean/dto/JourneyDto.java index 37359c5a..81216ac2 100644 --- a/health/src/main/java/com/ccsens/health/bean/dto/JourneyDto.java +++ b/health/src/main/java/com/ccsens/health/bean/dto/JourneyDto.java @@ -43,7 +43,7 @@ public class JourneyDto { } @Data - @ApiModel("查询个人信息") + @ApiModel("查询个人信息输入") public static class SelectUser{ @ApiModelProperty("userId") private Long userId; diff --git a/health/src/main/java/com/ccsens/health/service/HealthService.java b/health/src/main/java/com/ccsens/health/service/HealthService.java index 2e496500..40702ace 100644 --- a/health/src/main/java/com/ccsens/health/service/HealthService.java +++ b/health/src/main/java/com/ccsens/health/service/HealthService.java @@ -20,6 +20,7 @@ import com.ccsens.util.WebConstant; import com.ccsens.util.bean.dto.QueryDto; import com.ccsens.util.exception.BaseException; import com.ccsens.util.wx.WxXcxUtil; +import io.micrometer.shaded.org.pcollections.PCollection; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -76,7 +77,7 @@ public class HealthService implements IHealthService{ color.r = "243"; color.g = "139"; color.b = "0"; - healthInfoVo.setHealthLevel(0); + healthInfoVo.setHealthLevel(1); } healthInfoVo.setHealthTypeName(healthType.getName()); } @@ -122,6 +123,20 @@ public class HealthService implements IHealthService{ // Employee employee = userService.getEmployeeByUserId(Long.valueOf(userId)); //3、查询该成员符合时间的记录 List healthInfoList = healthRecordsDao.selectHealthInfoByDate(Long.valueOf(userId),startTime,endTime); + if(CollectionUtil.isNotEmpty(healthInfoList)){ + for(HealthVo.HealthInfo healthInfo : healthInfoList){ + healthInfo.setHealthLevel(0); + //获取健康状态 + HealthType healthType = healthTypeDao.selectByPrimaryKey(healthInfo.getHealthTypeId()); + if(ObjectUtil.isNotNull(healthType)){ + //如果健康状态异常,健康码为橙色 + if(healthType.getQuarantine() != 0){ + healthInfo.setHealthLevel(1); + } + healthInfo.setHealthTypeName(healthType.getName()); + } + } + } //4、返回 return healthInfoList; }