diff --git a/health/src/main/java/com/ccsens/health/api/StudentController.java b/health/src/main/java/com/ccsens/health/api/StudentController.java index 07b9652c..bc90aac6 100644 --- a/health/src/main/java/com/ccsens/health/api/StudentController.java +++ b/health/src/main/java/com/ccsens/health/api/StudentController.java @@ -47,7 +47,7 @@ public class StudentController { return JsonResponse.newInstance().ok(contactPatientVo); } -// @MustLogin + @MustLogin @PostMapping("import") @ApiOperation(value = "导入成员", notes = "") public JsonResponse importMembers(@RequestParam(required = true) Part file) { diff --git a/health/src/main/java/com/ccsens/health/bean/vo/MemberVo.java b/health/src/main/java/com/ccsens/health/bean/vo/MemberVo.java index aa50bcb5..2b32ff2c 100644 --- a/health/src/main/java/com/ccsens/health/bean/vo/MemberVo.java +++ b/health/src/main/java/com/ccsens/health/bean/vo/MemberVo.java @@ -6,6 +6,7 @@ import lombok.Data; import javax.validation.constraints.Max; import java.math.BigDecimal; +import java.util.ArrayList; import java.util.List; @Data @@ -42,9 +43,9 @@ public class MemberVo { @ApiModel("接触病患学生列表") public static class ContactPatientVo { @ApiModelProperty("校内打卡") - private List contactPatientInsideList; + private List contactPatientInsideList = new ArrayList<>(); @ApiModelProperty("校外行程") - private List contactPatientOutsideList; + private List contactPatientOutsideList = new ArrayList<>(); } @Data diff --git a/health/src/main/java/com/ccsens/health/service/JourneyService.java b/health/src/main/java/com/ccsens/health/service/JourneyService.java index 128705a6..eb8f608b 100644 --- a/health/src/main/java/com/ccsens/health/service/JourneyService.java +++ b/health/src/main/java/com/ccsens/health/service/JourneyService.java @@ -89,7 +89,7 @@ public class JourneyService implements IJourneyService{ @Override public long updateBackNum() { long total = journeyDao.countByType(HealthConstant.JOURNEY_BACK_SCHOOL); - redisUtil.set(HealthConstant.BACK_SCHOOL_TOTAL_REDIS, total); + redisUtil.set(HealthConstant.BACK_SCHOOL_TOTAL_REDIS, total, HealthConstant.REDIS_TIME); log.info("填写返校行程的总人数:{}", total); return total; } diff --git a/health/src/main/java/com/ccsens/health/service/StudentService.java b/health/src/main/java/com/ccsens/health/service/StudentService.java index b6670259..87905b92 100644 --- a/health/src/main/java/com/ccsens/health/service/StudentService.java +++ b/health/src/main/java/com/ccsens/health/service/StudentService.java @@ -16,6 +16,7 @@ import com.ccsens.health.util.HealthConstant; import com.ccsens.util.*; import com.ccsens.util.bean.dto.QueryDto; import com.ccsens.util.exception.BaseException; +import io.swagger.annotations.ApiModelProperty; import lombok.extern.slf4j.Slf4j; import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; @@ -100,7 +101,7 @@ public class StudentService implements IStudentService{ public long updateStudentNum() { MemberExample example = new MemberExample(); long total = memberDao.countByExample(example); - redisUtil.set(HealthConstant.MEMBER_TOTAL_REDIS, total); + redisUtil.set(HealthConstant.MEMBER_TOTAL_REDIS, total, HealthConstant.REDIS_TIME); log.info("更新成员总数redis结束:{}", total); return total; } @@ -172,6 +173,10 @@ public class StudentService implements IStudentService{ */ @Override public MemberVo.ContactPatientVo getContactPatient(QueryDto params) { - return null; + log.info("查询接触病患学生列表:{}", params); + MemberVo.ContactPatientVo vo = new MemberVo.ContactPatientVo(); + + + return vo; } } diff --git a/health/src/main/java/com/ccsens/health/util/HealthConstant.java b/health/src/main/java/com/ccsens/health/util/HealthConstant.java index f49530c1..6a3c4435 100644 --- a/health/src/main/java/com/ccsens/health/util/HealthConstant.java +++ b/health/src/main/java/com/ccsens/health/util/HealthConstant.java @@ -10,6 +10,8 @@ public class HealthConstant { public static final String MEMBER_TOTAL_REDIS = "health_member_total_redis"; /** redis key: 返校行程总人数*/ public static final String BACK_SCHOOL_TOTAL_REDIS = "health_back_school_total_redis"; + /** redis有效时长:30天 */ + public static final long REDIS_TIME = 30 * 24 * 60 * 60; /**成员表 本科生*/ public static final byte MEMBER_UNDERGRADUATE = 0; diff --git a/tall/src/main/resources/application.yml b/tall/src/main/resources/application.yml index eca66951..1d881c2f 100644 --- a/tall/src/main/resources/application.yml +++ b/tall/src/main/resources/application.yml @@ -1,4 +1,4 @@ spring: profiles: - active: test - include: util-test,common \ No newline at end of file + active: dev + include: util-dev,common \ No newline at end of file