diff --git a/ct/src/main/resources/application-test.yml b/ct/src/main/resources/application-test.yml index 895bf3e7..57d9ab85 100644 --- a/ct/src/main/resources/application-test.yml +++ b/ct/src/main/resources/application-test.yml @@ -28,4 +28,4 @@ swagger: enable: true eureka: instance: - ip-address: 119.28.76.62 \ No newline at end of file + ip-address: 49.233.89.188 \ No newline at end of file diff --git a/ct/src/main/resources/druid-test.yml b/ct/src/main/resources/druid-test.yml index d881a454..e38249c2 100644 --- a/ct/src/main/resources/druid-test.yml +++ b/ct/src/main/resources/druid-test.yml @@ -15,7 +15,7 @@ spring: maxWait: 60000 minEvictableIdleTimeMillis: 300000 minIdle: 5 - password: 37080c1f223685592316b02dad8816c019290a476e54ebb638f9aa3ba8b6bdb9 + password: poolPreparedStatements: true servletLogSlowSql: true servletLoginPassword: 111111 @@ -27,7 +27,7 @@ spring: testOnReturn: false testWhileIdle: true timeBetweenEvictionRunsMillis: 60000 - url: jdbc:mysql://49.233.89.188/ct?useUnicode=true&characterEncoding=UTF-8 + url: jdbc:mysql://127.0.0.1/ct?useUnicode=true&characterEncoding=UTF-8 username: root validationQuery: SELECT 1 FROM DUAL env: CCSENS_GAME \ No newline at end of file diff --git a/game/src/main/resources/application-test.yml b/game/src/main/resources/application-test.yml index c8e7cbc9..780923c8 100644 --- a/game/src/main/resources/application-test.yml +++ b/game/src/main/resources/application-test.yml @@ -28,4 +28,4 @@ swagger: enable: true eureka: instance: - ip-address: 119.28.76.62 \ No newline at end of file + ip-address: 49.233.89.188 \ No newline at end of file diff --git a/game/src/main/resources/application.yml b/game/src/main/resources/application.yml index 5c2cd5c4..5889ff7f 100644 --- a/game/src/main/resources/application.yml +++ b/game/src/main/resources/application.yml @@ -1,4 +1,4 @@ spring: profiles: - active: dev - include: common, util-dev \ No newline at end of file + active: test + include: common, util-test \ No newline at end of file diff --git a/game/src/main/resources/druid-test.yml b/game/src/main/resources/druid-test.yml index 79fab21f..579863aa 100644 --- a/game/src/main/resources/druid-test.yml +++ b/game/src/main/resources/druid-test.yml @@ -15,7 +15,7 @@ spring: maxWait: 60000 minEvictableIdleTimeMillis: 300000 minIdle: 5 - password: 37080c1f223685592316b02dad8816c019290a476e54ebb638f9aa3ba8b6bdb9 + password: poolPreparedStatements: true servletLogSlowSql: true servletLoginPassword: 111111 @@ -27,7 +27,7 @@ spring: testOnReturn: false testWhileIdle: true timeBetweenEvictionRunsMillis: 60000 - url: jdbc:mysql://49.233.89.188/game?useUnicode=true&characterEncoding=UTF-8 - username: root + url: jdbc:mysql://127.0.0.1/game?useUnicode=true&characterEncoding=UTF-8 + rname: root validationQuery: SELECT 1 FROM DUAL env: CCSENS_GAME \ No newline at end of file diff --git a/health/src/main/java/com/ccsens/health/api/AbnormalController.java b/health/src/main/java/com/ccsens/health/api/AbnormalController.java index 4f37fa12..9f594a51 100644 --- a/health/src/main/java/com/ccsens/health/api/AbnormalController.java +++ b/health/src/main/java/com/ccsens/health/api/AbnormalController.java @@ -8,6 +8,7 @@ import com.ccsens.health.bean.vo.HealthVo; import com.ccsens.health.service.IAbnormalService; import com.ccsens.util.JsonResponse; import com.ccsens.util.bean.dto.QueryDto; +import com.github.pagehelper.PageInfo; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; @@ -51,10 +52,10 @@ public class AbnormalController { @MustLogin @ApiOperation(value = "异常人员统计", notes = "") @RequestMapping(value = "statistics", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) - public JsonResponse> abnormalStatistics( + public JsonResponse> abnormalStatistics( @ApiParam @Validated @RequestBody QueryDto params) throws Exception { - log.info("异常人员添加:{}",params); - List abnormalStatisticsVoList = abnormalService.abnormalStatistics(params); + log.info("异常人员统计:{}",params); + PageInfo abnormalStatisticsVoList = abnormalService.abnormalStatistics(params); return JsonResponse.newInstance().ok(abnormalStatisticsVoList); } diff --git a/health/src/main/java/com/ccsens/health/api/ClockController.java b/health/src/main/java/com/ccsens/health/api/ClockController.java index bedfbd60..e2b11c8d 100644 --- a/health/src/main/java/com/ccsens/health/api/ClockController.java +++ b/health/src/main/java/com/ccsens/health/api/ClockController.java @@ -133,9 +133,9 @@ public class ClockController { @MustLogin @ApiOperation(value = "场所实时统计", notes = "") @RequestMapping(value = "real_time_statistics", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) - public JsonResponse> getRealTimeStatistics(@ApiParam @Validated @RequestBody QueryDto params) throws Exception { + public JsonResponse getRealTimeStatistics(@ApiParam @Validated @RequestBody QueryDto params) throws Exception { log.info("场所实时统计:{}", params); - List siteOverviewList = clockService.getRealTimeStatistics(params.getParam()); - return JsonResponse.newInstance().ok(siteOverviewList); + ClockVo.RealTimeStatistics siteOverview = clockService.getRealTimeStatistics(params.getParam()); + return JsonResponse.newInstance().ok(siteOverview); } } diff --git a/health/src/main/java/com/ccsens/health/api/JourneyController.java b/health/src/main/java/com/ccsens/health/api/JourneyController.java index 11d0e5d3..b9590f30 100644 --- a/health/src/main/java/com/ccsens/health/api/JourneyController.java +++ b/health/src/main/java/com/ccsens/health/api/JourneyController.java @@ -70,9 +70,9 @@ public class JourneyController { @MustLogin @ApiOperation(value = "查询异常行程(管理员输入的异常行程)", notes = "") @RequestMapping(value = "selectAbnormal", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) - public JsonResponse> selectAbnormalJourney(@ApiParam @Validated @RequestBody QueryDto params) throws Exception { + public JsonResponse> selectAbnormalJourney(@ApiParam @Validated @RequestBody QueryDto params) throws Exception { log.info("查询异常行程:{}",params); - List addAbnormalJourneyList = journeyService.selectAbnormalJourney(params); + PageInfo addAbnormalJourneyList = journeyService.selectAbnormalJourney(params); return JsonResponse.newInstance().ok(addAbnormalJourneyList); } diff --git a/health/src/main/java/com/ccsens/health/bean/dto/AbnormalDto.java b/health/src/main/java/com/ccsens/health/bean/dto/AbnormalDto.java index 17d1faf2..66b15f07 100644 --- a/health/src/main/java/com/ccsens/health/bean/dto/AbnormalDto.java +++ b/health/src/main/java/com/ccsens/health/bean/dto/AbnormalDto.java @@ -4,9 +4,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; -import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; +import javax.validation.constraints.*; import java.math.BigDecimal; @Data @@ -15,6 +13,7 @@ public class AbnormalDto { @Data @ApiModel("疫情概览查询") public static class SelectAbnormal{ + @Size(max = 16,min = 0,message = "信息格式错误") @ApiModelProperty("班级(所在机构)") private String department; @ApiModelProperty("开始时间") @@ -28,12 +27,18 @@ public class AbnormalDto { public static class AbnormalStatisticsDto{ @ApiModelProperty("身份 0学生 1老师 2其他") private Integer post; + @Size(max = 16,min = 0,message = "信息格式错误") @ApiModelProperty("班级(所在机构)") private String department; @ApiModelProperty("状态 0:健康 1:治愈 2:隔离 3:疑似 4:确诊") private Integer healthType; - @ApiModelProperty("分页") - private Integer page; + @ApiModelProperty("第几页") + @Min(value = 1) + private int page = 1; + @ApiModelProperty("每页多少条") + @Min(value = 1) + @Max(value=100) + private int pageSize = 10; } @@ -45,15 +50,20 @@ public class AbnormalDto { @Size(max = 16,min = 0,message = "信息格式错误") @ApiModelProperty("学号") private String wkno; + @Size(max = 16,min = 0,message = "信息格式错误") @NotEmpty @ApiModelProperty("姓名") private String name; + @Size(max = 16,min = 0,message = "信息格式错误") @NotEmpty @ApiModelProperty("班级(所在机构)") private String department; + @DecimalMax(value = "45",message = "体温输入异常") + @DecimalMin(value = "30",message = "体温输入异常") @NotNull @ApiModelProperty("体温") private BigDecimal animalHeat; + @Size(max = 144,min = 0,message = "信息格式错误") @ApiModelProperty("原因") private String reason; @NotNull @@ -71,14 +81,20 @@ public class AbnormalDto { public static class UpdateAbnormal{ @ApiModelProperty("异常信息id") private Long id; + @Size(max = 16,min = 0,message = "信息格式错误") @ApiModelProperty("学号") private String wkno; + @Size(max = 16,min = 0,message = "信息格式错误") @ApiModelProperty("姓名") private String name; + @Size(max = 16,min = 0,message = "信息格式错误") @ApiModelProperty("班级(所在机构)") private String department; + @DecimalMax(value = "45",message = "体温输入异常") + @DecimalMin(value = "30",message = "体温输入异常") @ApiModelProperty("体温") private BigDecimal animalHeat; + @Size(max = 144,min = 0,message = "信息格式错误") @ApiModelProperty("原因") private String reason; @ApiModelProperty("状态 0:健康 1:治愈 2:隔离 3:疑似 4:确诊") diff --git a/health/src/main/java/com/ccsens/health/bean/dto/ClockDto.java b/health/src/main/java/com/ccsens/health/bean/dto/ClockDto.java index 5965170d..b3dba3e3 100644 --- a/health/src/main/java/com/ccsens/health/bean/dto/ClockDto.java +++ b/health/src/main/java/com/ccsens/health/bean/dto/ClockDto.java @@ -7,6 +7,7 @@ import lombok.Data; import javax.validation.constraints.Max; import javax.validation.constraints.Min; import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; import java.math.BigDecimal; @Data @@ -49,6 +50,7 @@ public class ClockDto { @Data @ApiModel("时间段内场所人数统计") public static class SiteOverview{ + @Size(max = 16,min = 0,message = "信息格式错误") @ApiModelProperty("场所名") private String siteName; @ApiModelProperty("开始时间") @@ -58,12 +60,16 @@ public class ClockDto { @Data @ApiModel("查找场所内的学生列表") public static class SelectSiteMember{ + @Size(max = 16,min = 0,message = "信息格式错误") @ApiModelProperty("场所名") - private Long siteName; + private String siteName; + @Size(max = 16,min = 0,message = "信息格式错误") @ApiModelProperty("姓名") private String name; + @Size(max = 16,min = 0,message = "信息格式错误") @ApiModelProperty("学号") private String wkno; + @Size(max = 16,min = 0,message = "信息格式错误") @ApiModelProperty("班级(所在机构)") private String department; @ApiModelProperty("开始时间") @@ -82,6 +88,7 @@ public class ClockDto { @Data @ApiModel("场所实时统计") public static class RealTimeStatistics{ + @Size(max = 16,min = 0,message = "信息格式错误") @ApiModelProperty("场所名") private String siteName; @ApiModelProperty("开始时间") 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 808ec7d9..cddc85b0 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 @@ -58,7 +58,7 @@ public class JourneyDto { @ApiModelProperty("学号") private String wkno; @ApiModelProperty("出行方式 0铁路 1飞机 2客运车辆 3自驾 4船 5其他") - private int tripMode; + private Integer tripMode; @Size(max = 12,min = 0,message = "信息格式错误") @ApiModelProperty("车次号") private String carNo; @@ -125,6 +125,7 @@ public class JourneyDto { @Data @ApiModel("添加场所") public static class SiteAdd{ + @Size(max = 16,min = 0,message = "信息格式错误") @NotNull @ApiModelProperty("场所名字") private String siteName; @@ -153,6 +154,7 @@ public class JourneyDto { @NotNull @ApiModelProperty("场所id") private Long id; + @Size(max = 16,min = 0,message = "信息格式错误") @ApiModelProperty("场所名字") private String siteName; @ApiModelProperty("场所code") @@ -179,6 +181,7 @@ public class JourneyDto { @NotNull @ApiModelProperty("出行方式 0铁路 1飞机 2客运车辆 3自驾 4船 5其他") private int tripMode; + @Size(max = 12,min = 0,message = "信息格式错误") @NotEmpty @ApiModelProperty("车次号") private String carNo; @@ -197,14 +200,20 @@ public class JourneyDto { public static class SelectAbnormalJourney { @ApiModelProperty("出行方式 0铁路 1飞机 2客运车辆 3自驾 4船 5其他") private Integer tripMode; + @Size(max = 12,min = 0,message = "信息格式错误") @ApiModelProperty("车次号") private String carNo; @ApiModelProperty("出发时间") private Long startTime; @ApiModelProperty("到达时间") private Long endTime; - @ApiModelProperty("分页") - private Integer page; + @ApiModelProperty("第几页") + @Min(value = 1) + private int page = 1; + @ApiModelProperty("每页多少条") + @Min(value = 1) + @Max(value=100) + private int pageSize = 10; } @Data @@ -215,12 +224,14 @@ public class JourneyDto { private Long id; @ApiModelProperty("出行方式 0铁路 1飞机 2客运车辆 3自驾 4船 5其他") private Integer tripMode; + @Size(max = 12,min = 0,message = "信息格式错误") @ApiModelProperty("车次号") private String carNo; @ApiModelProperty("出发时间") private Long startTime; @ApiModelProperty("到达时间") private Long endTime; + @Size(max = 144,min = 0,message = "信息格式错误") @ApiModelProperty("备注") private String description; } diff --git a/health/src/main/java/com/ccsens/health/bean/dto/MemberDto.java b/health/src/main/java/com/ccsens/health/bean/dto/MemberDto.java index 0dea00b3..39b71627 100644 --- a/health/src/main/java/com/ccsens/health/bean/dto/MemberDto.java +++ b/health/src/main/java/com/ccsens/health/bean/dto/MemberDto.java @@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModelProperty; import lombok.Data; import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; @Data public class MemberDto { @@ -12,10 +13,13 @@ public class MemberDto { @Data @ApiModel("查询学生健康列表") public static class StudentHealth { + @Size(max = 16,min = 0,message = "信息格式错误") @ApiModelProperty("姓名") private String name; + @Size(max = 16,min = 0,message = "信息格式错误") @ApiModelProperty("学号") private String wkno; + @Size(max = 16,min = 0,message = "信息格式错误") @ApiModelProperty("班级(所在机构)") private String department; @ApiModelProperty("开始时间") @@ -29,8 +33,10 @@ public class MemberDto { @Data @ApiModel("接触病患的学生统计") public static class ContactPatientDto { + @Size(max = 16,min = 0,message = "信息格式错误") @ApiModelProperty("病患姓名") private String patientName; + @Size(max = 16,min = 0,message = "信息格式错误") @ApiModelProperty("病患学号") private String patientMkno; // @ApiModelProperty("姓名") @@ -41,6 +47,7 @@ public class MemberDto { // private String department; @ApiModelProperty("出行方式 0铁路 1飞机 2客运车辆 3自驾 4船 5其他") private Byte tripMode; + @Size(max = 16,min = 0,message = "信息格式错误") @ApiModelProperty("车次号") private String carNo; @ApiModelProperty("开始时间") diff --git a/health/src/main/java/com/ccsens/health/bean/dto/UserDto.java b/health/src/main/java/com/ccsens/health/bean/dto/UserDto.java index 7d09d39f..12353755 100644 --- a/health/src/main/java/com/ccsens/health/bean/dto/UserDto.java +++ b/health/src/main/java/com/ccsens/health/bean/dto/UserDto.java @@ -30,8 +30,10 @@ public class UserDto { @Data @ApiModel("查询个人轨迹") public static class selectTrack { + @Size(max = 16,min = 0,message = "信息格式错误") @ApiModelProperty("姓名") private String name; + @Size(max = 16,min = 0,message = "信息格式错误") @ApiModelProperty("学号") private String wkno; @ApiModelProperty("开始时间") diff --git a/health/src/main/java/com/ccsens/health/bean/vo/ClockVo.java b/health/src/main/java/com/ccsens/health/bean/vo/ClockVo.java index 1a00c27a..1db8aebd 100644 --- a/health/src/main/java/com/ccsens/health/bean/vo/ClockVo.java +++ b/health/src/main/java/com/ccsens/health/bean/vo/ClockVo.java @@ -132,14 +132,24 @@ public class ClockVo { private Long inTime; @ApiModelProperty("出去打卡时间") private Long outTime; - @ApiModelProperty("健康状态") - private Long healthType; +// @ApiModelProperty("健康状态") +// private Long healthType; } @Data - @ApiModel("实时统计场所的出入次数") + @ApiModel("实时统计场所信息") public static class RealTimeStatistics{ + @ApiModelProperty("分段及颜色") + private List statisticsCounts; + @ApiModelProperty("分段及颜色") + private List statisticsColor; + } + + + @Data + @ApiModel("实时统计场所的出入次数") + public static class StatisticsCount{ @ApiModelProperty("时间") private String time; @ApiModelProperty("进入打卡次数") @@ -147,4 +157,17 @@ public class ClockVo { @ApiModelProperty("出去打卡次数") private int outCount; } + + @Data + @ApiModel("实时统计的图标的分段及颜色") + public static class StatisticsColor{ + @ApiModelProperty("最小值") + private double gt; + @ApiModelProperty("最大值") + private double lte; + @ApiModelProperty("颜色") + private String color; + + } + } 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 ad346230..e028f8e5 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 @@ -59,22 +59,22 @@ public class MemberVo { private String wkno; @ApiModelProperty("班级(所在机构)") private String department; - @ApiModelProperty("上报健康的时间") - private Long time; - @ApiModelProperty("有无湖北武汉接触史 0没有 1有") - private int touchHubei; - @ApiModelProperty("有无接触患者 0无 1有") - private int touchSick; - @ApiModelProperty("体温") - private BigDecimal animalHeat; - @ApiModelProperty("状态") - private String healthType; - @ApiModelProperty("状态对应:名字") - private String healthTypeName; - @ApiModelProperty("就诊医院") - private String hospital; - @ApiModelProperty("上报时详细地址") - private String address; +// @ApiModelProperty("上报健康的时间") +// private Long time; +// @ApiModelProperty("有无湖北武汉接触史 0没有 1有") +// private int touchHubei; +// @ApiModelProperty("有无接触患者 0无 1有") +// private int touchSick; +// @ApiModelProperty("体温") +// private BigDecimal animalHeat; +// @ApiModelProperty("状态") +// private String healthType; +// @ApiModelProperty("状态对应:名字") +// private String healthTypeName; +// @ApiModelProperty("就诊医院") +// private String hospital; +// @ApiModelProperty("上报时详细地址") +// private String address; @ApiModelProperty("接触场所") private Set contactSiteList = new HashSet<>(); @ApiModelProperty("接触病人") diff --git a/health/src/main/java/com/ccsens/health/persist/dao/SiteDao.java b/health/src/main/java/com/ccsens/health/persist/dao/SiteDao.java index 2ef39560..701f5ea7 100644 --- a/health/src/main/java/com/ccsens/health/persist/dao/SiteDao.java +++ b/health/src/main/java/com/ccsens/health/persist/dao/SiteDao.java @@ -23,5 +23,5 @@ public interface SiteDao extends SiteMapper { List selectSiteMemberList(ClockDto.SelectSiteMember param); - List getRealTimeStatistics(ClockDto.RealTimeStatistics param); + List getRealTimeStatistics(@Param("siteName") String siteName, @Param("startTime")Long startTime,@Param("endTime")Long endTime,@Param("precision")String precision); } diff --git a/health/src/main/java/com/ccsens/health/service/AbnormalService.java b/health/src/main/java/com/ccsens/health/service/AbnormalService.java index fade8b3b..eb35d070 100644 --- a/health/src/main/java/com/ccsens/health/service/AbnormalService.java +++ b/health/src/main/java/com/ccsens/health/service/AbnormalService.java @@ -9,15 +9,14 @@ import com.ccsens.health.bean.dto.AbnormalDto; import com.ccsens.health.bean.po.*; import com.ccsens.health.bean.vo.AbnormalVo; import com.ccsens.health.bean.vo.HealthVo; -import com.ccsens.health.persist.dao.HealthAbnormalDao; -import com.ccsens.health.persist.dao.HealthQRCodeDao; -import com.ccsens.health.persist.dao.HealthRecordsDao; -import com.ccsens.health.persist.dao.HealthTypeDao; +import com.ccsens.health.persist.dao.*; +import com.ccsens.health.util.HealthConstant; import com.ccsens.util.CodeEnum; import com.ccsens.util.bean.dto.QueryDto; import com.ccsens.util.exception.BaseException; import com.ccsens.util.wx.WxXcxUtil; import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; @@ -42,6 +41,8 @@ public class AbnormalService implements IAbnormalService { @Autowired private HealthQRCodeDao healthQRCodeDao; @Autowired + private MemberDao memberDao; + @Autowired private HealthTypeDao healthTypeDao; @Autowired private IAsyncService asyncService; @@ -66,30 +67,30 @@ public class AbnormalService implements IAbnormalService { abnormalOverview.setAbnormalType(1); } } - //健康打卡 - List healthTypeNumberList = healthRecordsDao.selectHealthTypeNumber(selectAbnormal.getStartTime(), selectAbnormal.getEndTime()); - int other = 0; - if(CollectionUtil.isNotEmpty(healthTypeNumberList)){ - for(HealthVo.HealthTypeNumber healthTypeNumber : healthTypeNumberList){ - if(healthTypeNumber.getIndependent() == 0){ - other += healthTypeNumber.getNumber(); - }else { - if("发烧".equalsIgnoreCase(healthTypeNumber.getName())){ - AbnormalVo.AbnormalOverview abnormalOverview = new AbnormalVo.AbnormalOverview(); - abnormalOverview.setAbnormalType(0); - abnormalOverview.setAbnormalName(healthTypeNumber.getName()); - abnormalOverview.setCode(healthTypeNumber.getId()); - abnormalOverview.setNumber(healthTypeNumber.getNumber()); - abnormalOverviewList.add(abnormalOverview); - } - } - } - AbnormalVo.AbnormalOverview abnormalOverview = new AbnormalVo.AbnormalOverview(); - abnormalOverview.setAbnormalType(0); - abnormalOverview.setAbnormalName("其他"); - abnormalOverview.setNumber(other); - abnormalOverviewList.add(abnormalOverview); - } +// //健康打卡 +// List healthTypeNumberList = healthRecordsDao.selectHealthTypeNumber(selectAbnormal.getStartTime(), selectAbnormal.getEndTime()); +// int other = 0; +// if(CollectionUtil.isNotEmpty(healthTypeNumberList)){ +// for(HealthVo.HealthTypeNumber healthTypeNumber : healthTypeNumberList){ +// if(healthTypeNumber.getIndependent() == 0){ +// other += healthTypeNumber.getNumber(); +// }else { +// if("发烧".equalsIgnoreCase(healthTypeNumber.getName())){ +// AbnormalVo.AbnormalOverview abnormalOverview = new AbnormalVo.AbnormalOverview(); +// abnormalOverview.setAbnormalType(0); +// abnormalOverview.setAbnormalName(healthTypeNumber.getName()); +// abnormalOverview.setCode(healthTypeNumber.getId()); +// abnormalOverview.setNumber(healthTypeNumber.getNumber()); +// abnormalOverviewList.add(abnormalOverview); +// } +// } +// } +// AbnormalVo.AbnormalOverview abnormalOverview = new AbnormalVo.AbnormalOverview(); +// abnormalOverview.setAbnormalType(0); +// abnormalOverview.setAbnormalName("其他"); +// abnormalOverview.setNumber(other); +// abnormalOverviewList.add(abnormalOverview); +// } //行程异常 int journeyNumber = healthAbnormalDao.selectJourneyNumber(selectAbnormal.getDepartment(), selectAbnormal.getStartTime(), selectAbnormal.getEndTime()); @@ -98,8 +99,6 @@ public class AbnormalService implements IAbnormalService { abnormalOverview.setAbnormalName("出行异常"); abnormalOverview.setNumber(journeyNumber); abnormalOverviewList.add(abnormalOverview); - //未上报 - return abnormalOverviewList; } @@ -111,39 +110,52 @@ public class AbnormalService implements IAbnormalService { @Override public AbnormalVo.AbnormalStatisticsVo addAbnormal(QueryDto params) throws Exception { AbnormalDto.AddAbnormal addAbnormal = params.getParam(); + //判断时间是否正确 + if(ObjectUtil.isNotNull(addAbnormal.getEndTime()) && addAbnormal.getEndTime() <= addAbnormal.getStartTime()){ + throw new BaseException(CodeEnum.PARAM_ERROR); + } + //实名认证,检查是否属于该学校的学生 + MemberExample memberExample = new MemberExample(); + memberExample.createCriteria().andWknoEqualTo(addAbnormal.getWkno()).andNameEqualTo(addAbnormal.getName()); + List memberList = memberDao.selectByExample(memberExample); + log.info("校验身份信息:{}", memberList); + if (CollectionUtil.isEmpty(memberList)) { + throw new BaseException(CodeEnum.FILL_ERROR); + } + HealthAbnormal healthAbnormal = new HealthAbnormal(); healthAbnormal.setId(snowflake.nextId()); BeanUtil.copyProperties(addAbnormal, healthAbnormal); healthAbnormal.setHealthStatus(addAbnormal.getHealthType()); healthAbnormalDao.insertSelective(healthAbnormal); - //如果是确诊状态,检查该学生最新上报的健康信息,将二维码换成红色 - Future future = null; - if (addAbnormal.getHealthType() == 4) { - HealthRecords healthRecords = healthAbnormalDao.selectHealthRecordByWkno(addAbnormal.getWkno()); - if (ObjectUtil.isNotNull(healthAbnormal)) { - if ("prod".equals(active)) { - WxXcxUtil.LineColor color = new WxXcxUtil.LineColor(); - color.r = "226"; - color.g = "32"; - color.b = "24"; - future = asyncService.generateQRCode("d=" + healthRecords.getUserId(), color); - log.info("调用微信生成二维码"); - HealthQRCodeExample healthQRCodeExample = new HealthQRCodeExample(); - healthQRCodeExample.createCriteria().andHealthRecordsIdEqualTo(healthRecords.getId()); - List healthQRCodeList = healthQRCodeDao.selectByExample(healthQRCodeExample); - if(CollectionUtil.isNotEmpty(healthQRCodeList)){ - HealthQRCode healthQRCode = healthQRCodeList.get(0); - if(future != null){ - healthQRCode.setQrcodePath(future.get()); - healthQRCodeDao.updateByPrimaryKeySelective(healthQRCode); - } - } - } else { - log.info("测试环境,不调用生成二维码"); - } - } - } +// //如果是确诊状态,检查该学生最新上报的健康信息,将二维码换成红色 +// Future future = null; +// if (addAbnormal.getHealthType() == 4) { +// HealthRecords healthRecords = healthAbnormalDao.selectHealthRecordByWkno(addAbnormal.getWkno()); +// if (ObjectUtil.isNotNull(healthAbnormal)) { +// if ("prod".equals(active)) { +// WxXcxUtil.LineColor color = new WxXcxUtil.LineColor(); +// color.r = "226"; +// color.g = "32"; +// color.b = "24"; +// future = asyncService.generateQRCode("d=" + healthRecords.getUserId(), color); +// log.info("调用微信生成二维码"); +// HealthQRCodeExample healthQRCodeExample = new HealthQRCodeExample(); +// healthQRCodeExample.createCriteria().andHealthRecordsIdEqualTo(healthRecords.getId()); +// List healthQRCodeList = healthQRCodeDao.selectByExample(healthQRCodeExample); +// if(CollectionUtil.isNotEmpty(healthQRCodeList)){ +// HealthQRCode healthQRCode = healthQRCodeList.get(0); +// if(future != null){ +// healthQRCode.setQrcodePath(future.get()); +// healthQRCodeDao.updateByPrimaryKeySelective(healthQRCode); +// } +// } +// } else { +// log.info("测试环境,不调用生成二维码"); +// } +// } +// } AbnormalVo.AbnormalStatisticsVo abnormalStatisticsVo = new AbnormalVo.AbnormalStatisticsVo(); BeanUtil.copyProperties(healthAbnormal, abnormalStatisticsVo); abnormalStatisticsVo.setHealthType(healthAbnormal.getHealthStatus()); @@ -154,14 +166,13 @@ public class AbnormalService implements IAbnormalService { * 异常人员统计 */ @Override - public List abnormalStatistics(QueryDto params) { + public PageInfo abnormalStatistics(QueryDto params) { AbnormalDto.AbnormalStatisticsDto abnormalDto = params.getParam(); - Integer page = abnormalDto.getPage() == null ? 1 : abnormalDto.getPage(); - PageHelper.startPage(page, 10); + PageHelper.startPage(abnormalDto.getPage(), abnormalDto.getPageSize()); List abnormalList = healthAbnormalDao.getAbnormalList(abnormalDto.getPost(), abnormalDto.getDepartment(), abnormalDto.getHealthType()); - return abnormalList; + return new PageInfo<>(abnormalList); } /** @@ -196,9 +207,18 @@ public class AbnormalService implements IAbnormalService { healthAbnormal.setHealthStatus(updateAbnormal.getHealthType()); } if (ObjectUtil.isNotNull(updateAbnormal.getStartTime())) { + //判断时间是否正确 + if(ObjectUtil.isNull(updateAbnormal.getEndTime()) && ObjectUtil.isNotNull(healthAbnormal.getEndTime()) && + updateAbnormal.getStartTime() >= healthAbnormal.getEndTime()){ + throw new BaseException(CodeEnum.PARAM_ERROR); + } healthAbnormal.setStartTime(updateAbnormal.getStartTime()); } if (ObjectUtil.isNotNull(updateAbnormal.getEndTime())) { + //判断时间是否正确 + if(updateAbnormal.getEndTime() <= healthAbnormal.getStartTime()){ + throw new BaseException(CodeEnum.PARAM_ERROR); + } healthAbnormal.setEndTime(updateAbnormal.getEndTime()); } healthAbnormalDao.updateByPrimaryKeySelective(healthAbnormal); diff --git a/health/src/main/java/com/ccsens/health/service/ClockService.java b/health/src/main/java/com/ccsens/health/service/ClockService.java index 1af39b4e..2a057683 100644 --- a/health/src/main/java/com/ccsens/health/service/ClockService.java +++ b/health/src/main/java/com/ccsens/health/service/ClockService.java @@ -4,16 +4,11 @@ import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.lang.Snowflake; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; -import cn.hutool.core.util.ZipUtil; -import com.alibaba.fastjson.JSONObject; import com.ccsens.cloudutil.feign.TallFeignClient; import com.ccsens.health.bean.dto.ClockDto; -import com.ccsens.health.bean.dto.HealthDto; import com.ccsens.health.bean.dto.JourneyDto; import com.ccsens.health.bean.po.*; import com.ccsens.health.bean.vo.ClockVo; -import com.ccsens.health.bean.vo.HealthVo; -import com.ccsens.health.bean.vo.JourneyVo; import com.ccsens.health.persist.dao.RealNameAuthDao; import com.ccsens.health.persist.dao.SiteClockInDao; import com.ccsens.health.persist.dao.SiteDao; @@ -27,12 +22,11 @@ import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; -import java.io.IOException; -import java.sql.Struct; import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -61,10 +55,10 @@ public class ClockService implements IClockService { private IUserService userService; @Autowired private TallFeignClient tallFeignClient; - + @Value("${spring.profiles.active}") + private String active; /** * 场景扫码打卡 - * * @param params */ @Override @@ -100,26 +94,26 @@ public class ClockService implements IClockService { if (!inCircle) { throw new BaseException(CodeEnum.LOCATION_LONG); } - //判断该学生健康状态 - String key = HealthConstant.getHealthRecordKey(userId); - Object o = redisUtil.get(key); - log.info("redis读取健康状态:{},{}", userId, o); - if(o == null || StrUtil.isEmpty((String)o)){ - //如果redis为空,查询数据库 - JourneyDto.SelectDate selectDate = new JourneyDto.SelectDate(); - List healthInfoList = healthService.getHealthInfo(selectDate,userId); - if(CollectionUtil.isEmpty(healthInfoList)){ - throw new BaseException(CodeEnum.NOT_HEALTH_RECORD); - } - if(healthInfoList.get(0).getHealthLevel() != 0){ - throw new BaseException(CodeEnum.HEALTH_TYPE_ERROR); - } - }else { - HealthVo.HealthRecordRedis healthRecordRedis = JSONObject.parseObject((String) o, HealthVo.HealthRecordRedis.class); - if (healthRecordRedis.getHealthLevel() != 0) { - throw new BaseException(CodeEnum.HEALTH_TYPE_ERROR); - } - } +// //判断该学生健康状态 +// String key = HealthConstant.getHealthRecordKey(userId); +// Object o = redisUtil.get(key); +// log.info("redis读取健康状态:{},{}", userId, o); +// if(o == null || StrUtil.isEmpty((String)o)){ +// //如果redis为空,查询数据库 +// JourneyDto.SelectDate selectDate = new JourneyDto.SelectDate(); +// List healthInfoList = healthService.getHealthInfo(selectDate,userId); +// if(CollectionUtil.isEmpty(healthInfoList)){ +// throw new BaseException(CodeEnum.NOT_HEALTH_RECORD); +// } +// if(healthInfoList.get(0).getHealthLevel() != 0){ +// throw new BaseException(CodeEnum.HEALTH_TYPE_ERROR); +// } +// }else { +// HealthVo.HealthRecordRedis healthRecordRedis = JSONObject.parseObject((String) o, HealthVo.HealthRecordRedis.class); +// if (healthRecordRedis.getHealthLevel() != 0) { +// throw new BaseException(CodeEnum.HEALTH_TYPE_ERROR); +// } +// } //添加打卡记录 SiteClockIn prevClockIn = siteClockInDao.getPrevClockIn(userId); log.info("上一条打卡:{}", prevClockIn); @@ -294,13 +288,27 @@ public class ClockService implements IClockService { siteQrcode.setId(snowflake.nextId()); siteQrcode.setSiteId(createQRCode.getId()); siteQrcode.setOutOrIn((byte) createQRCode.getType()); - - //生成二维码 - String fileName = "/qrCode/" + cn.hutool.core.date.DateUtil.today() + "/" + System.currentTimeMillis() + ".png"; - String path = WebConstant.UPLOAD_PATH_BASE + fileName; - WxXcxUtil.getWxCode(WebConstant.QRCODE_SITE - , "d=" + siteQrcode.getId() + "&t=" + createQRCode.getType(), null, path); - qrcodePath = PropUtil.qrCode + fileName; + log.info("active:{}", active); + if ("prod".equals(active)) { + //生成二维码 + String fileName = "/qrCode/" + cn.hutool.core.date.DateUtil.today() + "/" + System.currentTimeMillis() + ".png"; + String path = WebConstant.UPLOAD_PATH_BASE + fileName; + WxXcxUtil.getWxCode(WebConstant.QRCODE_SITE + , "d=" + siteQrcode.getId() + "&t=" + createQRCode.getType(), null, path); + qrcodePath = PropUtil.qrCode + fileName; + log.info("调用微信生成二维码"); + } else { + log.info("测试环境,不调用生成二维码"); + } + if(qrcodePath == null){ + qrcodePath = "https://test.tall.wiki/gateway/health/uploads//qrCode/2020-04-13/1586759194721.png"; + } +// //生成二维码 +// String fileName = "/qrCode/" + cn.hutool.core.date.DateUtil.today() + "/" + System.currentTimeMillis() + ".png"; +// String path = WebConstant.UPLOAD_PATH_BASE + fileName; +// WxXcxUtil.getWxCode(WebConstant.QRCODE_SITE +// , "d=" + siteQrcode.getId() + "&t=" + createQRCode.getType(), null, path); +// siteQrcode.setQrcodePath(qrcodePath); //添加数据库 siteQrcodeDao.insertSelective(siteQrcode); @@ -341,6 +349,11 @@ public class ClockService implements IClockService { } + /** + * 添加场所 + * @param site + * @return + */ @Override public ClockVo.SiteList addSite(Site site) { @@ -390,6 +403,14 @@ public class ClockService implements IClockService { throw new BaseException(CodeEnum.NOT_SITE); } if(StrUtil.isNotEmpty(param.getSiteName())){ + //验证场所名是否重复 + SiteExample siteExample = new SiteExample(); + siteExample.createCriteria() + .andSiteNameEqualTo(param.getSiteName()).andIdNotEqualTo(param.getId()); + List siteList = siteDao.selectByExample(siteExample); + if(CollectionUtil.isNotEmpty(siteList)){ + throw new BaseException(CodeEnum.SITE_NAME_REPETITION); + } site.setSiteName(param.getSiteName()); } if(StrUtil.isNotEmpty(param.getSiteCode())){ @@ -442,8 +463,62 @@ public class ClockService implements IClockService { } @Override - public List getRealTimeStatistics(ClockDto.RealTimeStatistics param) { - List realTimeStatisticsList = siteDao.getRealTimeStatistics(param); - return realTimeStatisticsList; + public ClockVo.RealTimeStatistics getRealTimeStatistics(ClockDto.RealTimeStatistics param) throws Exception { + ClockVo.RealTimeStatistics realTimeStatistics = new ClockVo.RealTimeStatistics(); + + List statisticsCounts = new ArrayList<>(); + Long startTime = param.getStartTime(); + Long endTime = param.getEndTime(); + if(ObjectUtil.isNull(startTime) && ObjectUtil.isNull(endTime)){ + startTime = DateUtil.getZeroTime(new Date()); + endTime = System.currentTimeMillis(); + } + if(ObjectUtil.isNull(startTime) || ObjectUtil.isNull(endTime)){ + throw new BaseException(CodeEnum.SELECT_TIME_ERROR); + } + //判断查询精度 + long duration = endTime - startTime; + if(duration <= 0){ + throw new BaseException(CodeEnum.SELECT_TIME_ERROR); + } + if(duration / 1000 / 3600 / 24 <= 7){ + statisticsCounts = siteDao.getRealTimeStatistics(param.getSiteName(),param.getStartTime(),param.getEndTime(),"%Y-%m-%d %H"); + }else if(duration / 1000 / 3600 / 24 <= 90){ + statisticsCounts = siteDao.getRealTimeStatistics(param.getSiteName(),param.getStartTime(),param.getEndTime(),"%Y-%m-%d"); + }else { + statisticsCounts = siteDao.getRealTimeStatistics(param.getSiteName(),param.getStartTime(),param.getEndTime(),"%Y-%m"); + } + //获取分段及颜色 + List statisticsColorList = new ArrayList<>(); + double min = 0; + double max = 0; + if(CollectionUtil.isNotEmpty(statisticsCounts)){ + min = statisticsCounts.get(0).getInCount(); + max = statisticsCounts.get(0).getInCount(); + for(ClockVo.StatisticsCount s : statisticsCounts){ + min = s.getInCount() < min ? s.getInCount() : min; + min = s.getOutCount() < min ? s.getOutCount() : min; + max = s.getInCount() > max ? s.getInCount() : max; + max = s.getOutCount() > max ? s.getOutCount() : max; + } + } + String[] colors={"#096","#ffde33","#ff9933","#cc0033","#7e0023"}; + double a = (max - min) / 5 ; + for (int i = 0 ;i < 5 ; i++){ + ClockVo.StatisticsColor color = new ClockVo.StatisticsColor(); + color.setGt(min); + if(i != 4) { + color.setLte(Math.round(min + a)); + }else { + color.setLte(max); + } + color.setColor(colors[i]); + statisticsColorList.add(color); + min = Math.round(min + a); + } + realTimeStatistics.setStatisticsCounts(statisticsCounts); + realTimeStatistics.setStatisticsColor(statisticsColorList); + + return realTimeStatistics; } } 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 756d3fff..6f92cd93 100644 --- a/health/src/main/java/com/ccsens/health/service/HealthService.java +++ b/health/src/main/java/com/ccsens/health/service/HealthService.java @@ -113,7 +113,7 @@ public class HealthService implements IHealthService { Boolean flag = isAbnormal(userId); log.info("active:{}", active); - if ("prod".equals(active)) { + if ("prod".equals(active)) { WxXcxUtil.LineColor color = getLineColor(healthType,healthInfo,flag); future = asyncService.generateQRCode("d=" + userId, color); log.info("调用微信生成二维码"); diff --git a/health/src/main/java/com/ccsens/health/service/IAbnormalService.java b/health/src/main/java/com/ccsens/health/service/IAbnormalService.java index 88e51b88..321debaa 100644 --- a/health/src/main/java/com/ccsens/health/service/IAbnormalService.java +++ b/health/src/main/java/com/ccsens/health/service/IAbnormalService.java @@ -4,6 +4,7 @@ import com.ccsens.health.bean.dto.AbnormalDto; import com.ccsens.health.bean.vo.AbnormalVo; import com.ccsens.health.bean.vo.HealthVo; import com.ccsens.util.bean.dto.QueryDto; +import com.github.pagehelper.PageInfo; import java.util.List; @@ -12,7 +13,7 @@ public interface IAbnormalService { AbnormalVo.AbnormalStatisticsVo addAbnormal(QueryDto params) throws Exception; - List abnormalStatistics(QueryDto params); + PageInfo abnormalStatistics(QueryDto params); void updateAbnormal(QueryDto params); diff --git a/health/src/main/java/com/ccsens/health/service/IClockService.java b/health/src/main/java/com/ccsens/health/service/IClockService.java index b05e1825..536bf686 100644 --- a/health/src/main/java/com/ccsens/health/service/IClockService.java +++ b/health/src/main/java/com/ccsens/health/service/IClockService.java @@ -33,5 +33,5 @@ public interface IClockService { PageInfo selectSiteMemberList(ClockDto.SelectSiteMember param); - List getRealTimeStatistics(ClockDto.RealTimeStatistics param); + ClockVo.RealTimeStatistics getRealTimeStatistics(ClockDto.RealTimeStatistics param) throws Exception; } diff --git a/health/src/main/java/com/ccsens/health/service/IJourneyService.java b/health/src/main/java/com/ccsens/health/service/IJourneyService.java index fe667e35..e65c28da 100644 --- a/health/src/main/java/com/ccsens/health/service/IJourneyService.java +++ b/health/src/main/java/com/ccsens/health/service/IJourneyService.java @@ -15,7 +15,7 @@ public interface IJourneyService { JourneyVo.AddAbnormalJourney addAbnormalJourney(QueryDto params); - List selectAbnormalJourney(QueryDto params) throws Exception; + PageInfo selectAbnormalJourney(QueryDto params) throws Exception; void updateAbnormalJourney(QueryDto params); 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 471ec035..0878178e 100644 --- a/health/src/main/java/com/ccsens/health/service/JourneyService.java +++ b/health/src/main/java/com/ccsens/health/service/JourneyService.java @@ -188,16 +188,13 @@ public class JourneyService implements IJourneyService{ * @return */ @Override - public List selectAbnormalJourney(QueryDto params) throws Exception { + public PageInfo selectAbnormalJourney(QueryDto params) throws Exception { JourneyDto.SelectAbnormalJourney abnormalJourney = params.getParam(); -// Long startTime = abnormalJourney.getStartTime() == null ? DateUtil.getZeroTime(new Date()) : abnormalJourney.getStartTime(); -// Long endTime = abnormalJourney.getEndTime() == null ? System.currentTimeMillis() : abnormalJourney.getEndTime(); - int page = abnormalJourney.getPage() == null ? 1 : abnormalJourney.getPage(); - PageHelper.startPage(page, 10); + PageHelper.startPage(abnormalJourney.getPage(), abnormalJourney.getPageSize()); List addAbnormalJourneyList = journeyAbnormalDao.selectAbnormalJourney(abnormalJourney.getCarNo(),abnormalJourney.getTripMode(),abnormalJourney.getStartTime(),abnormalJourney.getEndTime()); - return addAbnormalJourneyList; + return new PageInfo<>(addAbnormalJourneyList); } /** 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 f747615a..e7fa1264 100644 --- a/health/src/main/java/com/ccsens/health/service/StudentService.java +++ b/health/src/main/java/com/ccsens/health/service/StudentService.java @@ -267,8 +267,8 @@ public class StudentService implements IStudentService{ inside.setWkno(clockInMsg.getNo()); inside.setDepartment(clockInMsg.getDepartment()); inside.setContactPatient(patientName); - //初始化健康信息 - initHealth(endTime, clockInMsg, inside); +// //初始化健康信息 +// initHealth(endTime, clockInMsg, inside); memberMap.put(no, inside); //将对象保存在list中 insides.add(inside); @@ -295,23 +295,23 @@ public class StudentService implements IStudentService{ return site; } - /** - * 初始化健康信息 - * @param endTime - * @param clockInMsg - * @param inside - */ - private void initHealth(Long endTime, ClockVo.ClockInMsg clockInMsg, MemberVo.ContactPatientInside inside) { - HealthVo.HealthDetail healthDetail = healthRecordsDao.queryDetail(clockInMsg.getUserId(), endTime); - if (healthDetail != null) { - inside.setHealthType(healthDetail.getCode()); - inside.setHealthTypeName(healthDetail.getName()); - inside.setAnimalHeat(healthDetail.getAnimalHeat()); - inside.setTouchHubei(healthDetail.getTouchHubei()); - inside.setTouchSick(healthDetail.getTouchSick()); - inside.setAddress(healthDetail.getDistrict() + healthDetail.getAddress()); - inside.setTime(healthDetail.getTime()); - inside.setHospital(healthDetail.getHospital()); - } - } +// /** +// * 初始化健康信息 +// * @param endTime +// * @param clockInMsg +// * @param inside +// */ +// private void initHealth(Long endTime, ClockVo.ClockInMsg clockInMsg, MemberVo.ContactPatientInside inside) { +// HealthVo.HealthDetail healthDetail = healthRecordsDao.queryDetail(clockInMsg.getUserId(), endTime); +// if (healthDetail != null) { +// inside.setHealthType(healthDetail.getCode()); +// inside.setHealthTypeName(healthDetail.getName()); +// inside.setAnimalHeat(healthDetail.getAnimalHeat()); +// inside.setTouchHubei(healthDetail.getTouchHubei()); +// inside.setTouchSick(healthDetail.getTouchSick()); +// inside.setAddress(healthDetail.getDistrict() + healthDetail.getAddress()); +// inside.setTime(healthDetail.getTime()); +// inside.setHospital(healthDetail.getHospital()); +// } +// } } diff --git a/health/src/main/java/com/ccsens/health/service/UserService.java b/health/src/main/java/com/ccsens/health/service/UserService.java index 31b5b4fa..b910f077 100644 --- a/health/src/main/java/com/ccsens/health/service/UserService.java +++ b/health/src/main/java/com/ccsens/health/service/UserService.java @@ -95,22 +95,22 @@ public class UserService implements IUserService { // userInfoVo.setSchoolMember(HealthConstant.SCHOOL_MEMBER_YES); // } - //查询健康码 - List healthCodeList = healthRecordsDao.getHealthQrCodeByEmployeeId(userId, startTime, endTime); - if (CollectionUtil.isNotEmpty(healthCodeList)) { - for (UserVo.HealthCode healthCode : healthCodeList) { - healthCode.setHealthLevel(0); - //获取健康状态 - HealthType healthType = healthTypeDao.selectByPrimaryKey(healthCode.getHealthTypeId()); - if (ObjectUtil.isNotNull(healthType)) { - //如果健康状态异常,健康码为橙色 - if (healthType.getQuarantine() != 0) { - healthCode.setHealthLevel(1); - } - } - } - } - userInfoVo.setHealthCodeList(healthCodeList); +// //查询健康码 +// List healthCodeList = healthRecordsDao.getHealthQrCodeByEmployeeId(userId, startTime, endTime); +// if (CollectionUtil.isNotEmpty(healthCodeList)) { +// for (UserVo.HealthCode healthCode : healthCodeList) { +// healthCode.setHealthLevel(0); +// //获取健康状态 +// HealthType healthType = healthTypeDao.selectByPrimaryKey(healthCode.getHealthTypeId()); +// if (ObjectUtil.isNotNull(healthType)) { +// //如果健康状态异常,健康码为橙色 +// if (healthType.getQuarantine() != 0) { +// healthCode.setHealthLevel(1); +// } +// } +// } +// } +// userInfoVo.setHealthCodeList(healthCodeList); } return userInfoVo; } diff --git a/health/src/main/resources/application-test.yml b/health/src/main/resources/application-test.yml index 5f486448..7c7fc658 100644 --- a/health/src/main/resources/application-test.yml +++ b/health/src/main/resources/application-test.yml @@ -31,7 +31,7 @@ swagger: enable: true eureka: instance: - ip-address: 119.28.76.62 + ip-address: 49.233.89.188 file: path: /home/cloud/health/uploads/ domain: https://test.tall.wiki/gateway/health/ diff --git a/health/src/main/resources/application.yml b/health/src/main/resources/application.yml index 2fb38e57..c3b11fb6 100644 --- a/health/src/main/resources/application.yml +++ b/health/src/main/resources/application.yml @@ -1,4 +1,4 @@ spring: profiles: - active: dev - include: common, util-dev + active: test + include: common, util-test diff --git a/health/src/main/resources/druid-test.yml b/health/src/main/resources/druid-test.yml index 85bed221..26b452e4 100644 --- a/health/src/main/resources/druid-test.yml +++ b/health/src/main/resources/druid-test.yml @@ -15,7 +15,7 @@ spring: maxWait: 60000 minEvictableIdleTimeMillis: 300000 minIdle: 5 - password: 37080c1f223685592316b02dad8816c019290a476e54ebb638f9aa3ba8b6bdb9 + password: poolPreparedStatements: true servletLogSlowSql: true servletLoginPassword: 111111 @@ -27,7 +27,7 @@ spring: testOnReturn: false testWhileIdle: true timeBetweenEvictionRunsMillis: 60000 - url: jdbc:mysql://49.233.89.188/health?useUnicode=true&characterEncoding=UTF-8 + url: jdbc:mysql://127.0.0.1/health?useUnicode=true&characterEncoding=UTF-8 username: root validationQuery: SELECT 1 FROM DUAL env: CCSENS_GAME \ No newline at end of file diff --git a/health/src/main/resources/mapper_dao/HealthAbnormalDao.xml b/health/src/main/resources/mapper_dao/HealthAbnormalDao.xml index 794843a9..4459adcd 100644 --- a/health/src/main/resources/mapper_dao/HealthAbnormalDao.xml +++ b/health/src/main/resources/mapper_dao/HealthAbnormalDao.xml @@ -54,6 +54,7 @@ and a.health_status = #{healthType} + ORDER BY a.start_time DESC \ No newline at end of file diff --git a/health/src/main/resources/mapper_dao/SiteDao.xml b/health/src/main/resources/mapper_dao/SiteDao.xml index b6e8a2ea..f309b089 100644 --- a/health/src/main/resources/mapper_dao/SiteDao.xml +++ b/health/src/main/resources/mapper_dao/SiteDao.xml @@ -38,7 +38,7 @@ where s.rec_status = 0 - and s.site_name = #{siteName} + and site_name like concat('%',#{siteName, jdbcType=VARCHAR},'%') GROUP BY s.id @@ -46,32 +46,24 @@ - select FROM_UNIXTIME(sc.time/1000,'%Y-%m-%d %H') as time, count(*) as inCount from t_site s, t_site_clock_in sc where s.id = sc.site_id + select FROM_UNIXTIME(sc.time/1000,#{precision}) as time, count(*) as inCount from t_site s, t_site_clock_in sc where s.id = sc.site_id and s.site_name = #{siteName} @@ -99,10 +91,10 @@ and sc.time <= #{endTime} - group by FROM_UNIXTIME(sc.time/1000,'%Y-%m-%d %H') + group by FROM_UNIXTIME(sc.time/1000,#{precision}) - select FROM_UNIXTIME(sc.out_time/1000,'%Y-%m-%d %H') as time, count(*) as outCount from t_site s, t_site_clock_in sc where s.id = sc.site_id + select FROM_UNIXTIME(sc.out_time/1000,#{precision}) as time, count(*) as outCount from t_site s, t_site_clock_in sc where s.id = sc.site_id and s.site_name = #{siteName} @@ -112,10 +104,10 @@ and sc.out_time <= #{endTime} - group by FROM_UNIXTIME(sc.out_time/1000,'%Y-%m-%d %H') + group by FROM_UNIXTIME(sc.out_time/1000,#{precision}) - select t1.time as time, t1.inCount as inCount, t2.outCount as outCount from ( @@ -137,6 +129,6 @@ ) t2 on t1.time = t2.time - order by time + order by time DESC \ No newline at end of file diff --git a/ht/src/main/resources/application.yml b/ht/src/main/resources/application.yml index d082c0ea..5889ff7f 100644 --- a/ht/src/main/resources/application.yml +++ b/ht/src/main/resources/application.yml @@ -1,4 +1,4 @@ spring: profiles: - active: prod - include: common, util-prod \ No newline at end of file + active: test + include: common, util-test \ No newline at end of file diff --git a/mt/src/main/resources/application-test.yml b/mt/src/main/resources/application-test.yml index c1697488..f2448086 100644 --- a/mt/src/main/resources/application-test.yml +++ b/mt/src/main/resources/application-test.yml @@ -28,4 +28,4 @@ swagger: enable: true eureka: instance: - ip-address: 119.28.76.62 \ No newline at end of file + ip-address: 49.233.89.188 \ No newline at end of file diff --git a/mt/src/main/resources/application.yml b/mt/src/main/resources/application.yml index 5c2cd5c4..5889ff7f 100644 --- a/mt/src/main/resources/application.yml +++ b/mt/src/main/resources/application.yml @@ -1,4 +1,4 @@ spring: profiles: - active: dev - include: common, util-dev \ No newline at end of file + active: test + include: common, util-test \ No newline at end of file diff --git a/mt/src/main/resources/druid-test.yml b/mt/src/main/resources/druid-test.yml index 1a0aa389..56cd9c56 100644 --- a/mt/src/main/resources/druid-test.yml +++ b/mt/src/main/resources/druid-test.yml @@ -15,7 +15,7 @@ spring: maxWait: 60000 minEvictableIdleTimeMillis: 300000 minIdle: 5 - password: 37080c1f223685592316b02dad8816c019290a476e54ebb638f9aa3ba8b6bdb9 + password: poolPreparedStatements: true servletLogSlowSql: true servletLoginPassword: 111111 @@ -27,7 +27,7 @@ spring: testOnReturn: false testWhileIdle: true timeBetweenEvictionRunsMillis: 60000 - url: jdbc:mysql://49.233.89.188/mt?useUnicode=true&characterEncoding=UTF-8 + url: jdbc:mysql://127.0.0.1/mt?useUnicode=true&characterEncoding=UTF-8 username: root validationQuery: SELECT 1 FROM DUAL env: CCSENS_GAME \ No newline at end of file diff --git a/tall/src/main/resources/mapper_dao/TaskDetailDao.xml b/tall/src/main/resources/mapper_dao/TaskDetailDao.xml index 097028e2..d2b0aa76 100644 --- a/tall/src/main/resources/mapper_dao/TaskDetailDao.xml +++ b/tall/src/main/resources/mapper_dao/TaskDetailDao.xml @@ -73,9 +73,9 @@ c.web_path as webPath, c.routine_location as routineLocation, c.import_param as importParam, - GROUP_CONCAT(p.id) as pId, - GROUP_CONCAT(sp.name) as pName, - GROUP_CONCAT(sp.description) as pDescription + GROUP_CONCAT(p.id ORDER BY p.id) as pId, + GROUP_CONCAT(sp.name ORDER BY sp.id) as pName, + GROUP_CONCAT(sp.description ORDER BY sp.id) as pDescription FROM t_pro_task_sub_time s LEFT JOIN t_pro_task_detail d ON s.task_detail_id = d.id LEFT JOIN t_pro_task_plugin p ON p.task_detail_id = d.id @@ -134,9 +134,9 @@ c.web_path as webPath, c.routine_location as routineLocation, c.import_param as importParam, - GROUP_CONCAT(p.id) as pId, - GROUP_CONCAT(sp.name) as pName, - GROUP_CONCAT(sp.description) as pDescription + GROUP_CONCAT(p.id ORDER BY p.id) as pId, + GROUP_CONCAT(sp.name ORDER BY sp.id) as pName, + GROUP_CONCAT(sp.description ORDER BY sp.id) as pDescription FROM t_pro_task_sub_time s LEFT JOIN t_pro_task_detail d ON s.task_detail_id = d.id LEFT JOIN t_pro_task_plugin p ON p.task_detail_id = d.id @@ -186,9 +186,9 @@ d.virtual as tVirtual, d.delay as tDelay, d.has_group as tHasGroup, - GROUP_CONCAT(p.id) as pId, - GROUP_CONCAT(sp.name) as pName, - GROUP_CONCAT(sp.description) as pDescription + GROUP_CONCAT(p.id ORDER BY p.id) as pId, + GROUP_CONCAT(sp.name ORDER BY sp.id) as pName, + GROUP_CONCAT(sp.description ORDER BY sp.id) as pDescription FROM t_pro_task_sub_time s LEFT JOIN t_pro_task_detail d ON s.task_detail_id = d.id LEFT JOIN t_pro_task_plugin p ON p.task_detail_id = d.id @@ -227,9 +227,9 @@ d.virtual as tVirtual, d.delay as tDelay, d.has_group as tHasGroup, - GROUP_CONCAT(p.id) as pId, - GROUP_CONCAT(sp.name) as pName, - GROUP_CONCAT(sp.description) as pDescription + GROUP_CONCAT(p.id ORDER BY p.id) as pId, + GROUP_CONCAT(sp.name ORDER BY sp.id) as pName, + GROUP_CONCAT(sp.description ORDER BY sp.id) as pDescription FROM t_pro_task_sub_time s LEFT JOIN t_pro_task_detail d ON s.task_detail_id = d.id LEFT JOIN t_pro_task_plugin p ON p.task_detail_id = d.id @@ -295,9 +295,9 @@ d.virtual as tVirtual, d.delay as tDelay, d.has_group as tHasGroup, - GROUP_CONCAT(p.id) as pId, - GROUP_CONCAT(sp.name) as pName, - GROUP_CONCAT(sp.description) as pDescription + GROUP_CONCAT(p.id ORDER BY p.id) as pId, + GROUP_CONCAT(sp.name ORDER BY sp.id) as pName, + GROUP_CONCAT(sp.description ORDER BY sp.id) as pDescription FROM t_pro_task_sub_time s LEFT JOIN t_pro_task_detail d ON s.task_detail_id = d.id LEFT JOIN t_pro_task_plugin p ON p.task_detail_id = d.id diff --git a/util/src/main/java/com/ccsens/util/CodeEnum.java b/util/src/main/java/com/ccsens/util/CodeEnum.java index d81f95eb..a95a48e0 100644 --- a/util/src/main/java/com/ccsens/util/CodeEnum.java +++ b/util/src/main/java/com/ccsens/util/CodeEnum.java @@ -110,7 +110,8 @@ public enum CodeEnum { REPORT_HAD_COMPLETED(92, "报告单已经完成,不能再修改答题记录。", true), NOT_REAL_AUTH(93,"您尚未填写基本信息,请补全信息后再试。",true), HEALTH_TYPE_ERROR(94,"您的健康状态异常,打卡失败。",true), - NOT_HEALTH_RECORD(94,"您今天还未上报健康信息,请上报后再试。",true), + NOT_HEALTH_RECORD(95,"您今天还未上报健康信息,请上报后再试。",true), + SELECT_TIME_ERROR(96,"请输入正确的查询时间",true), ; public CodeEnum addMsg(String msg){ diff --git a/util/src/test/java/com/ccsens/util/RandomRest.java b/util/src/test/java/com/ccsens/util/RandomRest.java index 8f6590f0..9bddc27f 100644 --- a/util/src/test/java/com/ccsens/util/RandomRest.java +++ b/util/src/test/java/com/ccsens/util/RandomRest.java @@ -8,8 +8,9 @@ public class RandomRest { @Test public void test01() throws Exception { - String a = RandomStringUtils.random(8, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"); - System.out.println(a); +// String a = RandomStringUtils.random(8, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"); +// System.out.println(a); + } }