Browse Source

提价

mine
袁强 5 months ago
parent
commit
d44379b135
  1. 2
      yq-admin/src/main/java/yq/web/controller/mine/MineHealthController.java
  2. 18
      yq-admin/src/main/java/yq/web/controller/mine/MineWarningController.java
  3. 4
      yq-common/src/main/java/yq/common/annotation/Excel.java
  4. 21
      yq-system/src/main/java/yq/system/domain/MineFace.java
  5. 17
      yq-system/src/main/java/yq/system/domain/MineHealth.java
  6. 63
      yq-system/src/main/java/yq/system/domain/MineWarning.java
  7. 17
      yq-system/src/main/resources/mapper/system/MineFaceMapper.xml
  8. 14
      yq-system/src/main/resources/mapper/system/MineHealthMapper.xml
  9. 35
      yq-system/src/main/resources/mapper/system/MineWarningMapper.xml

2
yq-admin/src/main/java/yq/web/controller/mine/MineHealthController.java

@ -119,8 +119,8 @@ public class MineHealthController extends BaseController
// 获取当前的用户
LoginUser loginUser = SecurityUtils.getLoginUser();
mineHealth.setUserId(loginUser.getUserId());
mineHealth.setUserName(loginUser.getUser().getNickName());
if(ObjectUtil.isNotNull(mineHealth.getIsWork())&&mineHealth.getIsWork()==1){
MineFace mineFace=new MineFace();
mineFace.setId(mineHealth.getFaceId());
mineFace.setIsWork(1);

18
yq-admin/src/main/java/yq/web/controller/mine/MineWarningController.java

@ -2,6 +2,8 @@ package yq.web.controller.mine;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import cn.hutool.core.util.ObjectUtil;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
@ -25,6 +27,7 @@ import yq.system.domain.vo.StatisticVo;
import yq.system.service.IMineWarningService;
import yq.common.utils.poi.ExcelUtil;
import yq.common.core.page.TableDataInfo;
import yq.system.service.ISysDeptService;
/**
*
@ -39,6 +42,9 @@ public class MineWarningController extends BaseController
@Autowired
private IMineWarningService mineWarningService;
@Autowired
private ISysDeptService deptService;
/**
*/
@PreAuthorize("@ss.hasPermi('system:warning:list')")
@ -103,8 +109,15 @@ public class MineWarningController extends BaseController
@PostMapping("/export")
public void export(HttpServletResponse response, MineWarning mineWarning){
List<MineWarning> list = mineWarningService.selectMineWarningList(mineWarning);
String title="";
if(ObjectUtil.isNotNull(mineWarning.getDeptId())){
title=deptService.selectDeptById(mineWarning.getDeptId()).getDeptName();
}else {
title="职工";
}
title=title+"健康汇总报告";
ExcelUtil<MineWarning> util = new ExcelUtil<MineWarning>(MineWarning.class);
util.exportExcel(response, list, "健康数据");
util.exportExcel(response, list, "健康数据",title);
}
@ -116,8 +129,9 @@ public class MineWarningController extends BaseController
@PostMapping("/medicalExport")
public void medicalExport(HttpServletResponse response, MineWarning mineWarning){
List<MineWarning> list = mineWarningService.selectMineWarningmedicalList(mineWarning);
String title="新预警";
ExcelUtil<MineWarning> util = new ExcelUtil<MineWarning>(MineWarning.class);
util.exportExcel(response, list, "预警处理列表数据");
util.exportExcel(response, list, "预警处理",title);
}

4
yq-common/src/main/java/yq/common/annotation/Excel.java

@ -61,12 +61,12 @@ public @interface Excel
/**
* 导出时在excel中每个列的高度
*/
public double height() default 14;
public double height() default 16;
/**
* 导出时在excel中每个列的宽度
*/
public double width() default 16;
public double width() default 8;
/**
* 文字后缀,% 90 变成90%

21
yq-system/src/main/java/yq/system/domain/MineFace.java

@ -37,9 +37,8 @@ public class MineFace
private String faceName;
@Excel(name = "出生年月")
@NotBlank(message = "出生年月不能为空")
@Pattern(regexp = "/^\\d{4}-\\d{2}-\\d{2}$/", message = "出生年月格式不对(2000-01-01)")
@NotBlank(message = "身份证不能为空")
@Pattern(regexp = "^\\d{6}(\\d{2}|\\d{4})(\\d{2})(\\d{2})\\d{3}[0-9Xx]$\n", message = "身份证格式不正确")
private String birthDate;
@Excel(name = "年龄")
@ -54,7 +53,7 @@ public class MineFace
@Excel(name = "图片", cellType= Excel.ColumnType.IMAGE, type = Excel.Type.IMPORT)
private String faceUrl;
@Excel(name = "备注")
private String remark;
@Range(min = 0, max = 1, message = "是否允许上岗的值必须是 0 或 1")
@ -77,24 +76,20 @@ public class MineFace
private String deptIdStr;
@Excel(name = "高压")
@NotNull(message = "压不能为空")
@NotNull(message = "收缩压不能为空")
private Integer bpHigh;
@NotNull(message = "压不能为空")
@Excel(name = "低压")
@NotNull(message = "舒张压不能为空")
private Integer bpLow;
@NotNull(message = "呼吸频率不能为空")
@Excel(name = "呼吸频率")
private Integer br;
@NotNull(message = "心跳不能为空")
@Excel(name = "心跳")
private Integer hr;
@NotNull(message = "心跳变异率不能为空")
@Excel(name = "心跳变异率")
private Integer hrv;
@NotNull(message = "温度不能为空")
@Excel(name = "温度")
@NotNull(message = "体温不能为空")
private double temperature;
}

17
yq-system/src/main/java/yq/system/domain/MineHealth.java

@ -20,33 +20,26 @@ public class MineHealth {
private Long faceId;
/** 组名 */
@Excel(name = "所属部门")
private String deptName;
@Excel(name = "姓名")
private String faceName;
@Excel(name = "年龄")
private Long age;
/** 手机号 */
@Excel(name = "手机号")
private String facePhone;
@Excel(name = "高压")
@Excel(name = "收缩压")
private Integer bpHigh;
@Excel(name = "压")
@Excel(name = "舒张压")
private Integer bpLow;
@Excel(name = "心跳")
private Integer br;
@Excel(name = "呼吸频率")
private Integer hr;
@Excel(name = "心跳变异率")
private Integer hrv;
@Excel(name = "温")
@Excel(name = "温")
private Integer temperature;
@Excel(name = "是否允许上岗 0:否 1:是")
@Excel(name = "是否允许上岗",width = 12,readConverterExp = "0=否,1=是")
private Integer isWork;
@Excel(name = "处理时间", width = 20, dateFormat = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@ -55,7 +48,7 @@ public class MineHealth {
private Long userId;
@Excel(name = "处理人")
private String userName;
private Long warningId;

63
yq-system/src/main/java/yq/system/domain/MineWarning.java

@ -9,9 +9,9 @@ import org.hibernate.validator.constraints.Range;
import org.springframework.format.annotation.DateTimeFormat;
import yq.common.annotation.Excel;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
@ -24,34 +24,45 @@ import java.util.Map;
public class MineWarning {
private Long id;
@NotNull(message = "faceId不能为空")
private Long faceId;
private String deptName;
@Excel(name = "姓名",width = 8)
private String faceName;
private Long age;
private String facePhone;
private Long deptId;
@Excel(name = "高压")
@NotNull(message = "高压不能为空")
@Excel(name = "收缩压",width = 6)
private Integer bpHigh;
@NotNull(message = "低压不能为空")
@Excel(name = "低压")
@Excel(name = "舒张压",width =6)
private Integer bpLow;
@NotNull(message = "呼吸频率不能为空")
@Excel(name = "呼吸频率")
@Excel(name = "呼吸频率",width = 8)
private Integer br;
@NotNull(message = "心跳不能为空")
@Excel(name = "心跳")
@Excel(name = "心跳",width =6)
private Integer hr;
@NotNull(message = "心跳变异率不能为空")
@Excel(name = "心跳变异率")
private Integer hrv;
@NotNull(message = "温度不能为空")
@Excel(name = "温")
@Excel(name = "温",width = 6)
private double temperature;
@NotNull(message = "血氧不能为空")
private double spo2;
@Excel(name = "劳累指标",width =8,suffix = "%")
private double hd;
@Range(min = 0, max = 1, message = "是否适合上岗的值必须是 0 或 1")
@Excel(name = "是否适合上岗 0:否 1:是")
@Excel(name = "是否适宜上岗",width = 12,readConverterExp = "0=否,1=是")
private Integer isWork;
@Excel(name = "创建时间", width = 20, dateFormat = "yyyy-MM-dd HH:mm:ss")
@ -63,24 +74,6 @@ public class MineWarning {
@JsonInclude(JsonInclude.Include.NON_EMPTY)
private Map<String, Object> params = new HashMap<>();
@Excel(name = "姓名")
private String faceName;
@Excel(name = "年龄")
private Long age;
/** 手机号 */
@Excel(name = "手机号")
private String facePhone;
private Long deptId;
/** 组名 */
@Excel(name = "所属部门")
private String deptName;
private String deptIdStr;
private Long userId;
private String search;

17
yq-system/src/main/resources/mapper/system/MineFaceMapper.xml

@ -27,13 +27,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectMineFaceVo">
select mf.id, mf.face_name, mf.birth_date, FLOOR(TIMESTAMPDIFF(MONTH,mf.birth_date , SYSDATE()) / 12) AS age, mf.face_phone, mf.face_url,
select mf.id, mf.face_name, mf.birth_date,
CASE
WHEN LENGTH(birth_date) = 15 THEN
-- 15位身份证号,提取出生年份、月份、日期并计算年龄
FLOOR(DATEDIFF(CURDATE(), STR_TO_DATE(CONCAT('19', SUBSTRING(birth_date, 7, 6)), '%Y%m%d')) / 365.25)
WHEN LENGTH(birth_date) = 18 THEN
-- 18位身份证号,提取出生年份、月份、日期并计算年龄
FLOOR(DATEDIFF(CURDATE(), STR_TO_DATE(SUBSTRING(birth_date, 7, 8), '%Y%m%d')) / 365.25)
ELSE
NULL
END AS age,
mf.face_phone, mf.face_url,
mf.is_work, mf.remark, mf.create_time,mf.use_time,mf.dept_id,d.dept_name,
mf.bp_high,
mf.bp_low,
mf.br,
mf.hr,
mf.hrv,
mf.spo2,
mf.hd,
mf.temperature
from mine_face mf
inner join sys_dept d on mf.dept_id = d.dept_id
@ -128,6 +141,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="br != null">br = #{br},</if>
<if test="hr != null">hr = #{hr},</if>
<if test="hrv != null">hrv = #{hrv},</if>
<if test="hd != null "> hd = #{hd},</if>
<if test="spo2 != null "> spo2 = #{spo2},</if>
<if test="temperature != null">temperature = #{temperature},</if>
</trim>
where id = #{id}

14
yq-system/src/main/resources/mapper/system/MineHealthMapper.xml

@ -40,7 +40,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
mh.warning_id,
mf.face_name,
mf.face_phone ,
FLOOR(TIMESTAMPDIFF(MONTH,mf.birth_date , SYSDATE()) / 12) AS age ,
CASE
WHEN LENGTH(birth_date) = 15 THEN
-- 15位身份证号,提取出生年份、月份、日期并计算年龄
FLOOR(DATEDIFF(CURDATE(), STR_TO_DATE(CONCAT('19', SUBSTRING(birth_date, 7, 6)), '%Y%m%d')) / 365.25)
WHEN LENGTH(birth_date) = 18 THEN
-- 18位身份证号,提取出生年份、月份、日期并计算年龄
FLOOR(DATEDIFF(CURDATE(), STR_TO_DATE(SUBSTRING(birth_date, 7, 8), '%Y%m%d')) / 365.25)
ELSE
NULL
END AS age,
mf.dept_id,
d.dept_name
FROM
@ -85,6 +94,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="hr != null "> and mh.hr = #{hr}</if>
<if test="hrv != null "> and mh.hrv = #{hrv}</if>
<if test="userId != null "> and mh.user_id = #{userId}</if>
<if test="userName != null "> and mh.user_name = #{userName}</if>
<if test="warningId != null "> and mh.waring_id = #{warningId}</if>
<if test="temperature != null and temperature != ''"> and mh.temperature = #{temperature}</if>
<if test="isWork != null "> and mf.is_work = #{isWork}</if>
@ -100,6 +110,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="br != null">br,</if>
<if test="hr != null">hr,</if>
<if test="userId != null "> user_id,</if>
<if test="userName != null "> user_name,</if>
<if test="faceId != null">face_id,</if>
<if test="warningId != null">warning_id,</if>
<if test="hrv != null">hrv,</if>
@ -113,6 +124,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="br != null">#{br},</if>
<if test="hr != null">#{hr},</if>
<if test="userId != null "> #{userId},</if>
<if test="userName != null ">#{userName},</if>
<if test="faceId != null">#{faceId},</if>
<if test="warningId != null">#{warningId},</if>
<if test="hrv != null">#{hrv},</if>

35
yq-system/src/main/resources/mapper/system/MineWarningMapper.xml

@ -18,6 +18,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="faceName" column="face_name" />
<result property="facePhone" column="face_phone" />
<result property="age" column="age" />
<result property="spo2" column="spo2" />
<result property="hd" column="hd" />
</resultMap>
<resultMap type="MineWarning" id="MineWarningUnResult">
@ -28,6 +30,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="br" column="br" />
<result property="hr" column="hr" />
<result property="hrv" column="hrv" />
<result property="spo2" column="spo2" />
<result property="hd" column="hd" />
<result property="temperature" column="temperature" />
<result property="isWork" column="is_work" />
<result property="createTime" column="create_time" />
@ -48,11 +52,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
mw.br,
mw.hr,
mw.hrv,
mw.spo2,
mw.hd,
mw.temperature,
mw.is_work,
mw.create_time,
mf.face_name,
FLOOR(TIMESTAMPDIFF(MONTH,mf.birth_date , SYSDATE()) / 12) AS age,
CASE
WHEN LENGTH(birth_date) = 15 THEN
-- 15位身份证号,提取出生年份、月份、日期并计算年龄
FLOOR(DATEDIFF(CURDATE(), STR_TO_DATE(CONCAT('19', SUBSTRING(birth_date, 7, 6)), '%Y%m%d')) / 365.25)
WHEN LENGTH(birth_date) = 18 THEN
-- 18位身份证号,提取出生年份、月份、日期并计算年龄
FLOOR(DATEDIFF(CURDATE(), STR_TO_DATE(SUBSTRING(birth_date, 7, 8), '%Y%m%d')) / 365.25)
ELSE
NULL
END AS age,
mf.face_phone,
mf.dept_id,
d.dept_name
@ -71,6 +86,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
mw.br,
mw.hr,
mw.hrv,
mw.spo2,
mw.hd,
mw.temperature,
mf.is_work,
mw.create_time,
@ -91,6 +108,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
mw.face_id,
mw.hr,
mw.hrv,
mw.spo2,
mw.hd,
mw.temperature,
mw.is_work,
mw.create_time,
@ -132,6 +151,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
mw.br,
mw.hr,
mw.hrv,
mw.spo2,
mw.hd,
mw.temperature,
mw.is_work,
mw.create_time,
@ -161,6 +182,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
mw.br,
mw.hr,
mw.hrv,
mw.spo2,
mw.hd,
mw.temperature,
mf.is_work,
mw.create_time,
@ -198,6 +221,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
br,
hr,
hrv,
spo2,
hd,
temperature,
is_work as isWork,
create_time as createTime,
@ -235,6 +260,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
mw.br,
mw.hr,
mw.hrv,
mw.spo2,
mw.hd,
mw.temperature,
mw.is_work,
mw.create_time,
@ -288,6 +315,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="br != null">br,</if>
<if test="hr != null">hr,</if>
<if test="hrv != null">hrv,</if>
<if test="hd != null "> hd,</if>
<if test="spo2 != null "> spo2,</if>
<if test="temperature != null">temperature,</if>
<if test="isWork != null">is_work,</if>
<if test="createTime != null">create_time,</if>
@ -299,6 +328,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="br != null">#{br},</if>
<if test="hr != null">#{hr},</if>
<if test="hrv != null">#{hrv},</if>
<if test="hd != null "> #{hd},</if>
<if test="spo2 != null "> #{spo2},</if>
<if test="temperature != null">#{temperature},</if>
<if test="isWork != null">#{isWork},</if>
<if test="createTime != null">#{createTime},</if>
@ -313,6 +344,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="br != null">br = #{br},</if>
<if test="hr != null">hr = #{hr},</if>
<if test="hrv != null">hrv = #{hrv},</if>
<if test="hd != null "> hd = #{hd},</if>
<if test="spo2 != null "> spo2 = #{spo2},</if>
<if test="temperature != null">temperature = #{temperature},</if>
<if test="isWork != null">is_work = #{isWork},</if>
<if test="createTime != null">create_time = #{createTime},</if>

Loading…
Cancel
Save