Browse Source

0410.

master
zhangye 5 years ago
parent
commit
3bda98e7e7
  1. 18
      health/src/main/java/com/ccsens/health/api/ClockController.java
  2. 9
      health/src/main/java/com/ccsens/health/api/JourneyController.java
  3. 37
      health/src/main/java/com/ccsens/health/bean/dto/ClockDto.java
  4. 29
      health/src/main/java/com/ccsens/health/bean/dto/JourneyDto.java
  5. 2
      health/src/main/java/com/ccsens/health/bean/vo/AbnormalVo.java
  6. 34
      health/src/main/java/com/ccsens/health/bean/vo/ClockVo.java
  7. 1
      health/src/main/java/com/ccsens/health/bean/vo/HealthVo.java
  8. 28
      health/src/main/java/com/ccsens/health/bean/vo/JourneyVo.java
  9. 2
      health/src/main/java/com/ccsens/health/bean/vo/MemberVo.java
  10. 4
      health/src/main/java/com/ccsens/health/service/AbnormalService.java
  11. 18
      health/src/main/java/com/ccsens/health/service/ClockService.java
  12. 4
      health/src/main/java/com/ccsens/health/service/IClockService.java
  13. 2
      health/src/main/java/com/ccsens/health/service/IJourneyService.java
  14. 7
      health/src/main/java/com/ccsens/health/service/JourneyService.java
  15. 2
      health/src/main/resources/mapper_dao/HealthAbnormalDao.xml
  16. 2
      health/src/main/resources/mapper_dao/HealthRecordDao.xml
  17. 3
      health/src/main/resources/mapper_dao/MemberDao.xml

18
health/src/main/java/com/ccsens/health/api/ClockController.java

@ -111,4 +111,22 @@ public class ClockController {
clockService.updateSite(params.getParam());
return JsonResponse.newInstance().ok();
}
@MustLogin
@ApiOperation(value = "场所统计概览", notes = "")
@RequestMapping(value = "overview", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<List<ClockVo.SiteOverview>> selectSiteOverview(@ApiParam @Validated @RequestBody QueryDto<ClockDto.SiteOverview> params) throws Exception {
log.info("修改场所信息:{}", params);
List<ClockVo.SiteOverview> siteOverviewList = clockService.selectSiteOverview(params.getParam());
return JsonResponse.newInstance().ok(siteOverviewList);
}
@MustLogin
@ApiOperation(value = "场所内人员列表", notes = "")
@RequestMapping(value = "member", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<List<ClockVo.SiteMemberList>> selectSiteMemberList(@ApiParam @Validated @RequestBody QueryDto<ClockDto.SelectSiteMember> params) throws Exception {
log.info("修改场所信息:{}", params);
List<ClockVo.SiteMemberList> siteOverviewList = clockService.selectSiteMemberList(params.getParam());
return JsonResponse.newInstance().ok(siteOverviewList);
}
}

9
health/src/main/java/com/ccsens/health/api/JourneyController.java

@ -49,6 +49,15 @@ public class JourneyController {
return JsonResponse.newInstance().ok(journeyInfoList);
}
@MustLogin
@ApiOperation(value = "查询学生校外行程", notes = "")
@RequestMapping(value = "infoList", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<List<JourneyVo.StudentJourneyInfo>> getJourneyInfoList(@ApiParam @Validated @RequestBody QueryDto<JourneyDto.SelectJourneyByName> params) throws Exception {
log.info("查询行程:{}",params);
List<JourneyVo.StudentJourneyInfo> journeyInfoList = journeyService.getJourneyInfoList(params.getParam(),params.getUserId());
return JsonResponse.newInstance().ok(journeyInfoList);
}
@MustLogin
@ApiOperation(value = "添加异常行程信息", notes = "")
@RequestMapping(value = "addAbnormalJourney", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})

37
health/src/main/java/com/ccsens/health/bean/dto/ClockDto.java

@ -4,6 +4,8 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
@ -43,4 +45,39 @@ public class ClockDto {
@ApiModelProperty("出去时间")
private Long outTime;
}
@Data
@ApiModel("时间段内场所人数统计")
public static class SiteOverview{
@ApiModelProperty("场所ID")
private Long siteId;
@ApiModelProperty("开始时间 默认今天零点")
private Long startTime;
@ApiModelProperty("结束时间 默认当前时间")
private Long endTime;
}
@Data
@ApiModel("查找场所内的学生列表")
public static class SelectSiteMember{
@ApiModelProperty("场所ID")
private Long siteId;
@ApiModelProperty("姓名")
private String name;
@ApiModelProperty("学号")
private String wkno;
@ApiModelProperty("班级(所在机构)")
private String department;
@ApiModelProperty("开始时间")
private Long startTime;
@ApiModelProperty("结束时间")
private Long endTime;
@ApiModelProperty("第几页")
@Min(value = 1)
private int pageNum = 1;
@ApiModelProperty("每页多少条")
@Min(value = 1)
@Max(value=100)
private int pageSize = 10;
}
}

29
health/src/main/java/com/ccsens/health/bean/dto/JourneyDto.java

@ -42,14 +42,39 @@ public class JourneyDto {
@Data
@ApiModel("查询的时间范围")
public static class SelectDate{
// @ApiModelProperty("token")
// private String token;
@ApiModelProperty("开始时间 默认今天零点")
private Long startTime;
@ApiModelProperty("结束时间 默认当前时间")
private Long endTime;
}
@Data
@ApiModel("用学生信息和学号查询")
public static class SelectJourneyByName{
@Size(max = 6,min = 0,message = "信息格式错误")
@ApiModelProperty("学生姓名")
private Long name;
@Size(max = 16,min = 0,message = "信息格式错误")
@ApiModelProperty("学号")
private Long wkno;
@ApiModelProperty("出行方式 0铁路 1飞机 2客运车辆 3自驾 4船 5其他")
private int tripMode;
@Size(max = 12,min = 0,message = "信息格式错误")
@ApiModelProperty("车次号")
private String carNo;
@ApiModelProperty("开始时间 默认今天零点")
private Long startTime;
@ApiModelProperty("结束时间 默认当前时间")
private Long endTime;
@ApiModelProperty("第几页")
@Min(value = 1)
private int pageNum = 1;
@ApiModelProperty("每页多少条")
@Min(value = 1)
@Max(value=100)
private int pageSize = 10;
}
@Data
@ApiModel("查询个人信息输入")
public static class SelectUser{

2
health/src/main/java/com/ccsens/health/bean/vo/AbnormalVo.java

@ -20,7 +20,7 @@ public class AbnormalVo {
@ApiModelProperty("异常状态名称")
private String abnormalName;
@ApiModelProperty("异常状态code")
private String code;
private Long code;
@ApiModelProperty("数量")
private int number;
// public String getAbnormalName(){

34
health/src/main/java/com/ccsens/health/bean/vo/ClockVo.java

@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.List;
@Data
public class ClockVo {
@ -102,4 +103,37 @@ public class ClockVo {
@ApiModelProperty("出去打卡时间")
private Long outTime;
}
@Data
@ApiModel("场所信息概览")
public static class SiteOverview{
@ApiModelProperty("场景id")
private Long id;
@ApiModelProperty("场所名称")
private String siteName;
@ApiModelProperty("场所人数")
private int number;
}
@Data
@ApiModel("场所内人员列表")
public static class SiteMemberList{
@ApiModelProperty("场景id")
private Long id;
@ApiModelProperty("场所名称")
private String siteName;
@ApiModelProperty("学生名字")
private String name;
@ApiModelProperty("学生学号")
private String wkno;
@ApiModelProperty("班级")
private String department;
@ApiModelProperty("进入打卡时间")
private Long time;
@ApiModelProperty("出去打卡时间")
private Long outTime;
@ApiModelProperty("健康状态")
private Long healthType;
}
}

1
health/src/main/java/com/ccsens/health/bean/vo/HealthVo.java

@ -176,6 +176,7 @@ public class HealthVo {
@Data
public static class HealthTypeNumber{
private Long id;
private String name;
private int independent;
private int number;

28
health/src/main/java/com/ccsens/health/bean/vo/JourneyVo.java

@ -72,4 +72,32 @@ public class JourneyVo {
private int backNum;
private int noBackNum;
}
@Data
@ApiModel("学生校外行程列表")
public static class StudentJourneyInfo{
@ApiModelProperty("Id")
private Long id;
@ApiModelProperty("成员Id")
private Long userId;
@ApiModelProperty("姓名")
private String name;
@ApiModelProperty("学号")
private String wkno;
@ApiModelProperty("班级(所在机构)")
private String department;
@ApiModelProperty("'出行方式'")
private int tripMode;
@ApiModelProperty("车次号")
private String carNo;
@ApiModelProperty("行程类型 0未填写 1返校行程 2日常外出")
private int journeyType;
@ApiModelProperty("出发时间")
private Long startTime;
@ApiModelProperty("到达时间")
private Long endTime;
@ApiModelProperty("同行人员")
private String together;
}
}

2
health/src/main/java/com/ccsens/health/bean/vo/MemberVo.java

@ -34,7 +34,7 @@ public class MemberVo {
@ApiModelProperty("体温")
private BigDecimal animalHeat;
@ApiModelProperty("状态 0:健康 1:治愈 2:隔离 3:疑似 4:确诊")
private int healthType;
private Long healthType;
@ApiModelProperty("就诊医院")
private String hospital;
@ApiModelProperty("上报时详细地址")

4
health/src/main/java/com/ccsens/health/service/AbnormalService.java

@ -78,7 +78,7 @@ public class AbnormalService implements IAbnormalService {
AbnormalVo.AbnormalOverview abnormalOverview = new AbnormalVo.AbnormalOverview();
abnormalOverview.setAbnormalType(0);
abnormalOverview.setAbnormalName(healthTypeNumber.getName());
abnormalOverview.setCode("FS");
abnormalOverview.setCode(healthTypeNumber.getId());
abnormalOverview.setNumber(healthTypeNumber.getNumber());
abnormalOverviewList.add(abnormalOverview);
}
@ -87,7 +87,6 @@ public class AbnormalService implements IAbnormalService {
AbnormalVo.AbnormalOverview abnormalOverview = new AbnormalVo.AbnormalOverview();
abnormalOverview.setAbnormalType(0);
abnormalOverview.setAbnormalName("其他");
abnormalOverview.setCode("QT");
abnormalOverview.setNumber(other);
abnormalOverviewList.add(abnormalOverview);
}
@ -97,7 +96,6 @@ public class AbnormalService implements IAbnormalService {
AbnormalVo.AbnormalOverview abnormalOverview = new AbnormalVo.AbnormalOverview();
abnormalOverview.setAbnormalType(2);
abnormalOverview.setAbnormalName("出行异常");
abnormalOverview.setCode("CXYC");
abnormalOverview.setNumber(journeyNumber);
abnormalOverviewList.add(abnormalOverview);
//未上报

18
health/src/main/java/com/ccsens/health/service/ClockService.java

@ -108,12 +108,12 @@ public class ClockService implements IClockService {
if(healthInfoList.get(0).getHealthLevel() != 0){
throw new BaseException(CodeEnum.HEALTH_TYPE_ERROR);
}
}
HealthVo.HealthRecordRedis healthRecordRedis = JSONObject.parseObject((String)o, HealthVo.HealthRecordRedis.class);
if(healthRecordRedis.getHealthLevel() != 0){
}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);
@ -421,4 +421,14 @@ public class ClockService implements IClockService {
return siteInfo;
}
@Override
public List<ClockVo.SiteOverview> selectSiteOverview(ClockDto.SiteOverview param) {
return null;
}
@Override
public List<ClockVo.SiteMemberList> selectSiteMemberList(ClockDto.SelectSiteMember param) {
return null;
}
}

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

@ -28,4 +28,8 @@ public interface IClockService {
void delSite(Long id);
void updateSite(JourneyDto.UpdateSite param);
List<ClockVo.SiteOverview> selectSiteOverview(ClockDto.SiteOverview param);
List<ClockVo.SiteMemberList> selectSiteMemberList(ClockDto.SelectSiteMember param);
}

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

@ -45,4 +45,6 @@ public interface IJourneyService {
* @return
*/
PageInfo<JourneyVo.ClassBack> classBackStatistics(JourneyDto.BackClass backClass);
List<JourneyVo.StudentJourneyInfo> getJourneyInfoList(JourneyDto.SelectJourneyByName param, Long userId);
}

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

@ -154,6 +154,13 @@ public class JourneyService implements IJourneyService{
return journeyList;
}
/**
* 查询学生校外行程
*/
@Override
public List<JourneyVo.StudentJourneyInfo> getJourneyInfoList(JourneyDto.SelectJourneyByName param, Long userId) {
return null;
}
/**
* 添加异常行程

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

@ -59,7 +59,7 @@
<select id="abnormalOverview" resultMap="resultMap_abnormal_overview" parameterType="java.util.Map">
SELECT
t.`name` as abnormalName,
t.code as code,
t.id as code,
count(ha.id) as number
FROM
t_health_type t LEFT JOIN t_health_abnormal ha on ha.health_status = t.id

2
health/src/main/resources/mapper_dao/HealthRecordDao.xml

@ -39,6 +39,7 @@
</resultMap>
<resultMap id="resultMap_healthTypeNumber" type="com.ccsens.health.bean.vo.HealthVo$HealthTypeNumber">
<id column="hId" property="id"/>
<result column="name" property="name"/>
<result column="independent" property="independent"/>
<result column="number" property="number"/>
@ -119,6 +120,7 @@
<select id="selectHealthTypeNumber" resultMap="resultMap_healthTypeNumber" parameterType="java.util.Map">
SELECT
t.id as id,
if(t.independent = 1 , t.name , '其他') as name,
t.independent as independent,
if(a.num is null ,0,a.num) as number

3
health/src/main/resources/mapper_dao/MemberDao.xml

@ -53,6 +53,7 @@
hr.touch_hubei as touchHubei,
hr.touch_sick as touchSick,
hr.animal_heat as animalHeat,
hr.health_type_id as healthType,
hr.hospital as hospital,
hr.address as address
FROM
@ -60,6 +61,8 @@
LEFT join t_health_records hr on rn.user_id = hr.user_id
where
m.rec_status = 0
and
hr.id is not null
<if test="name != null and name != ''">
and
m.name = #{name}

Loading…
Cancel
Save