Browse Source

0416.1

master
zhangye 5 years ago
parent
commit
724ff58327
  1. 2
      ct/src/main/resources/application-test.yml
  2. 4
      ct/src/main/resources/druid-test.yml
  3. 2
      game/src/main/resources/application-test.yml
  4. 4
      game/src/main/resources/application.yml
  5. 6
      game/src/main/resources/druid-test.yml
  6. 7
      health/src/main/java/com/ccsens/health/api/AbnormalController.java
  7. 6
      health/src/main/java/com/ccsens/health/api/ClockController.java
  8. 4
      health/src/main/java/com/ccsens/health/api/JourneyController.java
  9. 26
      health/src/main/java/com/ccsens/health/bean/dto/AbnormalDto.java
  10. 9
      health/src/main/java/com/ccsens/health/bean/dto/ClockDto.java
  11. 17
      health/src/main/java/com/ccsens/health/bean/dto/JourneyDto.java
  12. 7
      health/src/main/java/com/ccsens/health/bean/dto/MemberDto.java
  13. 2
      health/src/main/java/com/ccsens/health/bean/dto/UserDto.java
  14. 29
      health/src/main/java/com/ccsens/health/bean/vo/ClockVo.java
  15. 32
      health/src/main/java/com/ccsens/health/bean/vo/MemberVo.java
  16. 2
      health/src/main/java/com/ccsens/health/persist/dao/SiteDao.java
  17. 142
      health/src/main/java/com/ccsens/health/service/AbnormalService.java
  18. 153
      health/src/main/java/com/ccsens/health/service/ClockService.java
  19. 2
      health/src/main/java/com/ccsens/health/service/HealthService.java
  20. 3
      health/src/main/java/com/ccsens/health/service/IAbnormalService.java
  21. 2
      health/src/main/java/com/ccsens/health/service/IClockService.java
  22. 2
      health/src/main/java/com/ccsens/health/service/IJourneyService.java
  23. 9
      health/src/main/java/com/ccsens/health/service/JourneyService.java
  24. 42
      health/src/main/java/com/ccsens/health/service/StudentService.java
  25. 32
      health/src/main/java/com/ccsens/health/service/UserService.java
  26. 2
      health/src/main/resources/application-test.yml
  27. 4
      health/src/main/resources/application.yml
  28. 4
      health/src/main/resources/druid-test.yml
  29. 1
      health/src/main/resources/mapper_dao/HealthAbnormalDao.xml
  30. 1
      health/src/main/resources/mapper_dao/JourneyAbnormalDao.xml
  31. 30
      health/src/main/resources/mapper_dao/SiteDao.xml
  32. 4
      ht/src/main/resources/application.yml
  33. 2
      mt/src/main/resources/application-test.yml
  34. 4
      mt/src/main/resources/application.yml
  35. 4
      mt/src/main/resources/druid-test.yml
  36. 30
      tall/src/main/resources/mapper_dao/TaskDetailDao.xml
  37. 3
      util/src/main/java/com/ccsens/util/CodeEnum.java
  38. 5
      util/src/test/java/com/ccsens/util/RandomRest.java

2
ct/src/main/resources/application-test.yml

@ -28,4 +28,4 @@ swagger:
enable: true
eureka:
instance:
ip-address: 119.28.76.62
ip-address: 49.233.89.188

4
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

2
game/src/main/resources/application-test.yml

@ -28,4 +28,4 @@ swagger:
enable: true
eureka:
instance:
ip-address: 119.28.76.62
ip-address: 49.233.89.188

4
game/src/main/resources/application.yml

@ -1,4 +1,4 @@
spring:
profiles:
active: dev
include: common, util-dev
active: test
include: common, util-test

6
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

7
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<List<AbnormalVo.AbnormalStatisticsVo>> abnormalStatistics(
public JsonResponse<PageInfo<AbnormalVo.AbnormalStatisticsVo>> abnormalStatistics(
@ApiParam @Validated @RequestBody QueryDto<AbnormalDto.AbnormalStatisticsDto> params) throws Exception {
log.info("异常人员添加:{}",params);
List<AbnormalVo.AbnormalStatisticsVo> abnormalStatisticsVoList = abnormalService.abnormalStatistics(params);
log.info("异常人员统计:{}",params);
PageInfo<AbnormalVo.AbnormalStatisticsVo> abnormalStatisticsVoList = abnormalService.abnormalStatistics(params);
return JsonResponse.newInstance().ok(abnormalStatisticsVoList);
}

6
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<List<ClockVo.RealTimeStatistics>> getRealTimeStatistics(@ApiParam @Validated @RequestBody QueryDto<ClockDto.RealTimeStatistics> params) throws Exception {
public JsonResponse<ClockVo.RealTimeStatistics> getRealTimeStatistics(@ApiParam @Validated @RequestBody QueryDto<ClockDto.RealTimeStatistics> params) throws Exception {
log.info("场所实时统计:{}", params);
List<ClockVo.RealTimeStatistics> siteOverviewList = clockService.getRealTimeStatistics(params.getParam());
return JsonResponse.newInstance().ok(siteOverviewList);
ClockVo.RealTimeStatistics siteOverview = clockService.getRealTimeStatistics(params.getParam());
return JsonResponse.newInstance().ok(siteOverview);
}
}

4
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<List<JourneyVo.AddAbnormalJourney>> selectAbnormalJourney(@ApiParam @Validated @RequestBody QueryDto<JourneyDto.SelectAbnormalJourney> params) throws Exception {
public JsonResponse<PageInfo<JourneyVo.AddAbnormalJourney>> selectAbnormalJourney(@ApiParam @Validated @RequestBody QueryDto<JourneyDto.SelectAbnormalJourney> params) throws Exception {
log.info("查询异常行程:{}",params);
List<JourneyVo.AddAbnormalJourney> addAbnormalJourneyList = journeyService.selectAbnormalJourney(params);
PageInfo<JourneyVo.AddAbnormalJourney> addAbnormalJourneyList = journeyService.selectAbnormalJourney(params);
return JsonResponse.newInstance().ok(addAbnormalJourneyList);
}

26
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:确诊")

9
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("开始时间")

17
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;
}

7
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("开始时间")

2
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("开始时间")

29
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<StatisticsCount> statisticsCounts;
@ApiModelProperty("分段及颜色")
private List<StatisticsColor> 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;
}
}

32
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<String> contactSiteList = new HashSet<>();
@ApiModelProperty("接触病人")

2
health/src/main/java/com/ccsens/health/persist/dao/SiteDao.java

@ -23,5 +23,5 @@ public interface SiteDao extends SiteMapper {
List<ClockVo.SiteMemberList> selectSiteMemberList(ClockDto.SelectSiteMember param);
List<ClockVo.RealTimeStatistics> getRealTimeStatistics(ClockDto.RealTimeStatistics param);
List<ClockVo.StatisticsCount> getRealTimeStatistics(@Param("siteName") String siteName, @Param("startTime")Long startTime,@Param("endTime")Long endTime,@Param("precision")String precision);
}

142
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<HealthVo.HealthTypeNumber> 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<HealthVo.HealthTypeNumber> 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<AbnormalDto.AddAbnormal> 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<Member> 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<String> 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<HealthQRCode> 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<String> 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<HealthQRCode> 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<AbnormalVo.AbnormalStatisticsVo> abnormalStatistics(QueryDto<AbnormalDto.AbnormalStatisticsDto> params) {
public PageInfo<AbnormalVo.AbnormalStatisticsVo> abnormalStatistics(QueryDto<AbnormalDto.AbnormalStatisticsDto> 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<AbnormalVo.AbnormalStatisticsVo> 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);

153
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<HealthVo.HealthInfo> 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<HealthVo.HealthInfo> 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<Site> 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<ClockVo.RealTimeStatistics> getRealTimeStatistics(ClockDto.RealTimeStatistics param) {
List<ClockVo.RealTimeStatistics> realTimeStatisticsList = siteDao.getRealTimeStatistics(param);
return realTimeStatisticsList;
public ClockVo.RealTimeStatistics getRealTimeStatistics(ClockDto.RealTimeStatistics param) throws Exception {
ClockVo.RealTimeStatistics realTimeStatistics = new ClockVo.RealTimeStatistics();
List<ClockVo.StatisticsCount> 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<ClockVo.StatisticsColor> 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;
}
}

2
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("调用微信生成二维码");

3
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<AbnormalDto.AddAbnormal> params) throws Exception;
List<AbnormalVo.AbnormalStatisticsVo> abnormalStatistics(QueryDto<AbnormalDto.AbnormalStatisticsDto> params);
PageInfo<AbnormalVo.AbnormalStatisticsVo> abnormalStatistics(QueryDto<AbnormalDto.AbnormalStatisticsDto> params);
void updateAbnormal(QueryDto<AbnormalDto.UpdateAbnormal> params);

2
health/src/main/java/com/ccsens/health/service/IClockService.java

@ -33,5 +33,5 @@ public interface IClockService {
PageInfo<ClockVo.SiteMemberList> selectSiteMemberList(ClockDto.SelectSiteMember param);
List<ClockVo.RealTimeStatistics> getRealTimeStatistics(ClockDto.RealTimeStatistics param);
ClockVo.RealTimeStatistics getRealTimeStatistics(ClockDto.RealTimeStatistics param) throws Exception;
}

2
health/src/main/java/com/ccsens/health/service/IJourneyService.java

@ -15,7 +15,7 @@ public interface IJourneyService {
JourneyVo.AddAbnormalJourney addAbnormalJourney(QueryDto<JourneyDto.AddAbnormalJourney> params);
List<JourneyVo.AddAbnormalJourney> selectAbnormalJourney(QueryDto<JourneyDto.SelectAbnormalJourney> params) throws Exception;
PageInfo<JourneyVo.AddAbnormalJourney> selectAbnormalJourney(QueryDto<JourneyDto.SelectAbnormalJourney> params) throws Exception;
void updateAbnormalJourney(QueryDto<JourneyDto.UpdateAbnormalJourney> params);

9
health/src/main/java/com/ccsens/health/service/JourneyService.java

@ -188,16 +188,13 @@ public class JourneyService implements IJourneyService{
* @return
*/
@Override
public List<JourneyVo.AddAbnormalJourney> selectAbnormalJourney(QueryDto<JourneyDto.SelectAbnormalJourney> params) throws Exception {
public PageInfo<JourneyVo.AddAbnormalJourney> selectAbnormalJourney(QueryDto<JourneyDto.SelectAbnormalJourney> 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<JourneyVo.AddAbnormalJourney> addAbnormalJourneyList =
journeyAbnormalDao.selectAbnormalJourney(abnormalJourney.getCarNo(),abnormalJourney.getTripMode(),abnormalJourney.getStartTime(),abnormalJourney.getEndTime());
return addAbnormalJourneyList;
return new PageInfo<>(addAbnormalJourneyList);
}
/**

42
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());
// }
// }
}

32
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<UserVo.HealthCode> 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<UserVo.HealthCode> 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;
}

2
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/

4
health/src/main/resources/application.yml

@ -1,4 +1,4 @@
spring:
profiles:
active: dev
include: common, util-dev
active: test
include: common, util-test

4
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

1
health/src/main/resources/mapper_dao/HealthAbnormalDao.xml

@ -54,6 +54,7 @@
and
a.health_status = #{healthType}
</if>
ORDER BY a.start_time DESC
</select>
<select id="abnormalOverview" resultMap="resultMap_abnormal_overview" parameterType="java.util.Map">

1
health/src/main/resources/mapper_dao/JourneyAbnormalDao.xml

@ -39,5 +39,6 @@
and
end_time &gt;= #{startTime}
</if>
ORDER BY start_time DESC
</select>
</mapper>

30
health/src/main/resources/mapper_dao/SiteDao.xml

@ -38,7 +38,7 @@
where
s.rec_status = 0
<if test="siteName != null and siteName != ''">
and s.site_name = #{siteName}
and site_name like concat('%',#{siteName, jdbcType=VARCHAR},'%')
</if>
GROUP BY s.id
</select>
@ -46,32 +46,24 @@
<select id="selectSiteMemberList" resultType="com.ccsens.health.bean.vo.ClockVo$SiteMemberList">
SELECT
c.id as id,
s.site_name as sitrName,
s.site_name as siteName,
m.name as name,
m.wkno as wkno,
m.department as department,
c.time as inTime,
c.out_time as outTime,
a.user_id as userId,
h.health_type_id as healthType
a.user_id as userId
FROM
t_site_clock_in c left join t_site s on c.site_id = s.id
left join t_real_name_auth a on c.user_id = a.user_id
left join t_member m on a.`no` = m.wkno
left join (
SELECT *
FROM
t_health_records
ORDER BY time DESC
limit 1
) h on h.user_id = a.user_id
where
s. rec_status = 0
<if test="siteName != null and siteName != ''">
and s.site_name = #{siteName}
and s.site_name like concat('%',#{siteName},'%')
</if>
<if test="name != null and name != ''">
and m.name = #{name}
and m.`name` like concat('%',#{name},'%')
</if>
<if test="wkno != null and wkno != ''">
and m.wkno = #{wkno}
@ -89,7 +81,7 @@
</select>
<sql id="t1">
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
<if test="siteName != null and siteName != ''">
and s.site_name = #{siteName}
</if>
@ -99,10 +91,10 @@
<if test="endTime != null">
and sc.time &lt;= #{endTime}
</if>
group by FROM_UNIXTIME(sc.time/1000,'%Y-%m-%d %H')
group by FROM_UNIXTIME(sc.time/1000,#{precision})
</sql>
<sql id="t2">
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
<if test="siteName != null and siteName != ''">
and s.site_name = #{siteName}
</if>
@ -112,10 +104,10 @@
<if test="endTime != null">
and sc.out_time &lt;= #{endTime}
</if>
group by FROM_UNIXTIME(sc.out_time/1000,'%Y-%m-%d %H')
group by FROM_UNIXTIME(sc.out_time/1000,#{precision})
</sql>
<select id="getRealTimeStatistics" resultType="com.ccsens.health.bean.vo.ClockVo$RealTimeStatistics">
<select id="getRealTimeStatistics" resultType="com.ccsens.health.bean.vo.ClockVo$StatisticsCount" parameterType="java.util.Map">
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
</select>
</mapper>

4
ht/src/main/resources/application.yml

@ -1,4 +1,4 @@
spring:
profiles:
active: prod
include: common, util-prod
active: test
include: common, util-test

2
mt/src/main/resources/application-test.yml

@ -28,4 +28,4 @@ swagger:
enable: true
eureka:
instance:
ip-address: 119.28.76.62
ip-address: 49.233.89.188

4
mt/src/main/resources/application.yml

@ -1,4 +1,4 @@
spring:
profiles:
active: dev
include: common, util-dev
active: test
include: common, util-test

4
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

30
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

3
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){

5
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);
}
}

Loading…
Cancel
Save