Browse Source

提交

mine
袁强 5 months ago
parent
commit
78fdbc4f40
  1. 2
      yq-admin/src/main/java/yq/web/controller/mine/MineFaceController.java
  2. 20
      yq-system/src/main/java/yq/system/domain/MineFace.java
  3. 11
      yq-system/src/main/java/yq/system/domain/MineHealth.java
  4. 1
      yq-system/src/main/java/yq/system/service/impl/MineWarningServiceImpl.java
  5. 13
      yq-system/src/main/resources/mapper/system/MineFaceMapper.xml
  6. 2
      yq-system/src/main/resources/mapper/system/MineHealthMapper.xml
  7. 4
      yq-system/src/main/resources/mapper/system/MineWarningMapper.xml

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

@ -73,7 +73,7 @@ public class MineFaceController extends BaseController
{
List<MineFace> list = mineFaceService.selectMineFaceList(mineFace);
ExcelUtil<MineFace> util = new ExcelUtil<MineFace>(MineFace.class);
util.exportExcel(response, list, "【人列表】数据");
util.exportExcel(response, list, "【人列表】数据");
}
/**

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

@ -10,6 +10,7 @@ import yq.common.annotation.Excel;
import yq.common.core.domain.BaseEntity;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.util.Date;
@ -27,11 +28,20 @@ public class MineFace
/** $column.columnComment */
private Long id;
/** 组名 */
@Excel(name = "所属部门")
private String deptName;
@NotBlank(message = "姓名不能为空")
@Excel(name = "姓名")
private String faceName;
@Excel(name = "出生年月")
@NotBlank(message = "出生年月不能为空")
@Pattern(regexp = "/^\\d{4}-\\d{2}-\\d{2}$/", message = "出生年月格式不对(2000-01-01)")
private String birthDate;
@Excel(name = "年龄")
private Long age;
@ -41,21 +51,19 @@ public class MineFace
private String facePhone;
@NotBlank(message = "人脸图片不能为空")
@Excel(name = "图片", readConverterExp = "$column.readConverterExp()")
@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")
@Excel(name = "是否允许上岗 0:否 1:是")
@Excel(name = "是否允许上岗 ",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")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date useTime;
@Excel(name = "分组id")
private Long groupId;
@Excel(name = "创建时间", width = 20, dateFormat = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@ -69,8 +77,6 @@ public class MineFace
private String deptIdStr;
/** 组名 */
@Excel(name = "所属部门")
private String deptName;
}

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

@ -19,20 +19,21 @@ 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 = "高压")
private Integer bpHigh;
@Excel(name = "低压")
@ -60,9 +61,7 @@ public class MineHealth {
private Long deptId;
/** 组名 */
@Excel(name = "所属部门")
private String deptName;

1
yq-system/src/main/java/yq/system/service/impl/MineWarningServiceImpl.java

@ -101,7 +101,6 @@ public class MineWarningServiceImpl implements IMineWarningService
mineFace.setIsWork(0);
mineFace.setUseTime(DateUtils.getNowDate());
mineFaceService.updateMineFace(mineFace);
throw new ServiceException("检测异常,禁止上岗");
}
return 1;
}

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

@ -10,6 +10,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="deptName" column="dept_name" />
<result property="faceName" column="face_name" />
<result property="age" column="age" />
<result property="birthDate" column="birth_date" />
<result property="facePhone" column="face_phone" />
<result property="faceUrl" column="face_url" />
<result property="isWork" column="is_work" />
@ -20,7 +21,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectMineFaceVo">
select mf.id, mf.face_name, mf.age, mf.face_phone, mf.face_url,
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,
mf.is_work, mf.remark, mf.create_time,mf.use_time,mf.dept_id,d.dept_name
from mine_face mf
inner join sys_dept d on mf.dept_id = d.dept_id
@ -37,7 +38,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="isWork != null "> and mf.is_work = #{isWork}</if>
<if test="deptIdStr != null "> and d.dept_id in (#{deptIdStr})</if>
</where>
order by mf.face_name
order by d.dept_name desc
</select>
<select id="selectMineFaceById" parameterType="Long" resultMap="MineFaceResult">
@ -48,7 +49,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
SELECT
mf.id,
mf.face_name,
mf.age,
FLOOR(TIMESTAMPDIFF(MONTH,mf.birth_date , SYSDATE()) / 12) AS age,
mf.face_byte,
mf.face_url,
mf.face_phone,
@ -65,7 +66,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="faceName != null">face_name,</if>
<if test="age != null">age,</if>
<if test="birthDate != null">birth_date,</if>
<if test="facePhone != null">face_phone,</if>
<if test="faceUrl != null">face_url,</if>
<if test="isWork != null">is_work,</if>
@ -78,7 +79,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="faceName != null">#{faceName},</if>
<if test="age != null">#{age},</if>
<if test="birthDate != null">#{birthDate},</if>
<if test="facePhone != null">#{facePhone},</if>
<if test="faceUrl != null">#{faceUrl},</if>
<if test="isWork != null">#{isWork},</if>
@ -94,7 +95,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update mine_face
<trim prefix="SET" suffixOverrides=",">
<if test="faceName != null">face_name = #{faceName},</if>
<if test="age != null">age = #{age},</if>
<if test="birthDate != null">birth_date = #{birthDate},</if>
<if test="facePhone != null">face_phone = #{facePhone},</if>
<if test="faceUrl != null">face_url = #{faceUrl},</if>
<if test="isWork != null">is_work = #{isWork},</if>

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

@ -40,7 +40,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
mh.warning_id,
mf.face_name,
mf.face_phone ,
mf.age ,
FLOOR(TIMESTAMPDIFF(MONTH,mf.birth_date , SYSDATE()) / 12) AS age ,
mf.dept_id,
d.dept_name
FROM

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

@ -52,7 +52,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
mw.is_work,
mw.create_time,
mf.face_name,
mf.age,
FLOOR(TIMESTAMPDIFF(MONTH,mf.birth_date , SYSDATE()) / 12) AS age,
mf.face_phone,
mf.dept_id,
d.dept_name
@ -158,7 +158,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
ROW_NUMBER() OVER (PARTITION BY mf.face_name ORDER BY mw.create_time DESC) AS rn
FROM
mine_warning mw
INNER JOIN mine_face mf ON mf.id = mw.face_id
INNER JOIN mine_face mf ON mf.id = mw.face_id and mw.is_work=0
inner join sys_dept d on mf.dept_id = d.dept_id
<where>
<if test="deptName != null and deptName != ''"> and d.dept_name like concat('%', #{deptName}, '%')</if>

Loading…
Cancel
Save