Commit 75bf6eaab0c8487e5a5bbae8de931e7d035da864
1 parent
f7c7ea33
fix: 增加显示属性
Showing
13 changed files
with
60 additions
and
130 deletions
ruoyi-admin/src/main/java/com/ruoyi/driver/domain/Driver.java
| ... | ... | @@ -138,7 +138,7 @@ public class Driver extends BaseEntity { |
| 138 | 138 | */ |
| 139 | 139 | @ApiModelProperty("头像") |
| 140 | 140 | private String image; |
| 141 | - @DateTimeFormat(pattern = "yyyy-MM-dd hh:mm:ss") | |
| 141 | + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") | |
| 142 | 142 | @ApiModelProperty("更新时间") |
| 143 | 143 | private Date updateTime; |
| 144 | 144 | ... | ... |
ruoyi-admin/src/main/java/com/ruoyi/driver/mapper/DriverMapper.java
ruoyi-admin/src/main/java/com/ruoyi/in/controller/SignInController.java
| ... | ... | @@ -6,6 +6,7 @@ import javax.servlet.http.HttpServletResponse; |
| 6 | 6 | |
| 7 | 7 | import com.ruoyi.common.exception.file.FileUploadException; |
| 8 | 8 | import com.ruoyi.pojo.request.FaceUpdateReqVo; |
| 9 | +import com.ruoyi.pojo.response.SignInResponseVo; | |
| 9 | 10 | import io.swagger.annotations.Api; |
| 10 | 11 | import io.swagger.annotations.ApiOperation; |
| 11 | 12 | import io.swagger.annotations.ApiParam; |
| ... | ... | @@ -50,7 +51,7 @@ public class SignInController extends BaseController { |
| 50 | 51 | @ApiOperation("查询签到列表") |
| 51 | 52 | public TableDataInfo list(SignIn signIn) { |
| 52 | 53 | startPage(); |
| 53 | - List<SignIn> list = signInService.selectSignInList(signIn); | |
| 54 | + List<SignInResponseVo> list = signInService.selectSignInList(signIn); | |
| 54 | 55 | return getDataTable(list); |
| 55 | 56 | } |
| 56 | 57 | |
| ... | ... | @@ -62,8 +63,8 @@ public class SignInController extends BaseController { |
| 62 | 63 | @PostMapping("/export") |
| 63 | 64 | @ApiOperation("导出签到列表") |
| 64 | 65 | public void export(HttpServletResponse response, SignIn signIn) { |
| 65 | - List<SignIn> list = signInService.selectSignInList(signIn); | |
| 66 | - ExcelUtil<SignIn> util = new ExcelUtil<SignIn>(SignIn.class); | |
| 66 | + List<SignInResponseVo> list = signInService.selectSignInList(signIn); | |
| 67 | + ExcelUtil<SignInResponseVo> util = new ExcelUtil<SignInResponseVo>(SignInResponseVo.class); | |
| 67 | 68 | util.exportExcel(response, list, "签到数据"); |
| 68 | 69 | } |
| 69 | 70 | ... | ... |
ruoyi-admin/src/main/java/com/ruoyi/in/in/SignInMapper.xml deleted
100644 → 0
| 1 | -<?xml version="1.0" encoding="UTF-8" ?> | |
| 2 | -<!DOCTYPE mapper | |
| 3 | -PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | |
| 4 | -"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |
| 5 | -<mapper namespace="com.ruoyi.in.mapper.SignInMapper"> | |
| 6 | - | |
| 7 | - <resultMap type="SignIn" id="SignInResult"> | |
| 8 | - <result property="id" column="id" /> | |
| 9 | - <result property="createTime" column="create_time" /> | |
| 10 | - <result property="jobCode" column="jobCode" /> | |
| 11 | - <result property="ip" column="ip" /> | |
| 12 | - <result property="updateTime" column="update_time" /> | |
| 13 | - <result property="image" column="image" /> | |
| 14 | - <result property="status" column="status" /> | |
| 15 | - <result property="updateBy" column="update_by" /> | |
| 16 | - <result property="singnIn" column="singn_in" /> | |
| 17 | - <result property="alcoholFlag" column="alcohol_flag" /> | |
| 18 | - <result property="type" column="type" /> | |
| 19 | - <result property="remark" column="remark" /> | |
| 20 | - </resultMap> | |
| 21 | - | |
| 22 | - <sql id="selectSignInVo"> | |
| 23 | - select id, create_time, jobCode, ip, update_time, image, status, update_by, singn_in, alcohol_flag, type, remark from sign_in | |
| 24 | - </sql> | |
| 25 | - | |
| 26 | - <select id="selectSignInList" parameterType="SignIn" resultMap="SignInResult"> | |
| 27 | - <include refid="selectSignInVo"/> | |
| 28 | - <where> | |
| 29 | - <if test="jobCode != null and jobCode != ''"> and jobCode = #{jobCode}</if> | |
| 30 | - <if test="ip != null and ip != ''"> and ip = #{ip}</if> | |
| 31 | - <if test="image != null and image != ''"> and image = #{image}</if> | |
| 32 | - <if test="status != null "> and status = #{status}</if> | |
| 33 | - <if test="singnIn != null and singnIn != ''"> and singn_in = #{singnIn}</if> | |
| 34 | - <if test="alcoholFlag != null "> and alcohol_flag = #{alcoholFlag}</if> | |
| 35 | - <if test="type != null "> and type = #{type}</if> | |
| 36 | - </where> | |
| 37 | - </select> | |
| 38 | - | |
| 39 | - <select id="selectSignInById" parameterType="Long" resultMap="SignInResult"> | |
| 40 | - <include refid="selectSignInVo"/> | |
| 41 | - where id = #{id} | |
| 42 | - </select> | |
| 43 | - | |
| 44 | - <insert id="insertSignIn" parameterType="SignIn" useGeneratedKeys="true" keyProperty="id"> | |
| 45 | - insert into sign_in | |
| 46 | - <trim prefix="(" suffix=")" suffixOverrides=","> | |
| 47 | - <if test="createTime != null">create_time,</if> | |
| 48 | - <if test="jobCode != null and jobCode != ''">jobCode,</if> | |
| 49 | - <if test="ip != null">ip,</if> | |
| 50 | - <if test="updateTime != null">update_time,</if> | |
| 51 | - <if test="image != null">image,</if> | |
| 52 | - <if test="status != null">status,</if> | |
| 53 | - <if test="updateBy != null">update_by,</if> | |
| 54 | - <if test="singnIn != null">singn_in,</if> | |
| 55 | - <if test="alcoholFlag != null">alcohol_flag,</if> | |
| 56 | - <if test="type != null">type,</if> | |
| 57 | - <if test="remark != null">remark,</if> | |
| 58 | - </trim> | |
| 59 | - <trim prefix="values (" suffix=")" suffixOverrides=","> | |
| 60 | - <if test="createTime != null">#{createTime},</if> | |
| 61 | - <if test="jobCode != null and jobCode != ''">#{jobCode},</if> | |
| 62 | - <if test="ip != null">#{ip},</if> | |
| 63 | - <if test="updateTime != null">#{updateTime},</if> | |
| 64 | - <if test="image != null">#{image},</if> | |
| 65 | - <if test="status != null">#{status},</if> | |
| 66 | - <if test="updateBy != null">#{updateBy},</if> | |
| 67 | - <if test="singnIn != null">#{singnIn},</if> | |
| 68 | - <if test="alcoholFlag != null">#{alcoholFlag},</if> | |
| 69 | - <if test="type != null">#{type},</if> | |
| 70 | - <if test="remark != null">#{remark},</if> | |
| 71 | - </trim> | |
| 72 | - </insert> | |
| 73 | - | |
| 74 | - <update id="updateSignIn" parameterType="SignIn"> | |
| 75 | - update sign_in | |
| 76 | - <trim prefix="SET" suffixOverrides=","> | |
| 77 | - <if test="createTime != null">create_time = #{createTime},</if> | |
| 78 | - <if test="jobCode != null and jobCode != ''">jobCode = #{jobCode},</if> | |
| 79 | - <if test="ip != null">ip = #{ip},</if> | |
| 80 | - <if test="updateTime != null">update_time = #{updateTime},</if> | |
| 81 | - <if test="image != null">image = #{image},</if> | |
| 82 | - <if test="status != null">status = #{status},</if> | |
| 83 | - <if test="updateBy != null">update_by = #{updateBy},</if> | |
| 84 | - <if test="singnIn != null">singn_in = #{singnIn},</if> | |
| 85 | - <if test="alcoholFlag != null">alcohol_flag = #{alcoholFlag},</if> | |
| 86 | - <if test="type != null">type = #{type},</if> | |
| 87 | - <if test="remark != null">remark = #{remark},</if> | |
| 88 | - </trim> | |
| 89 | - where id = #{id} | |
| 90 | - </update> | |
| 91 | - | |
| 92 | - <delete id="deleteSignInById" parameterType="Long"> | |
| 93 | - delete from sign_in where id = #{id} | |
| 94 | - </delete> | |
| 95 | - | |
| 96 | - <delete id="deleteSignInByIds" parameterType="String"> | |
| 97 | - delete from sign_in where id in | |
| 98 | - <foreach item="id" collection="array" open="(" separator="," close=")"> | |
| 99 | - #{id} | |
| 100 | - </foreach> | |
| 101 | - </delete> | |
| 102 | -</mapper> | |
| 103 | 0 | \ No newline at end of file |
ruoyi-admin/src/main/java/com/ruoyi/in/mapper/SignInMapper.java
| ... | ... | @@ -5,6 +5,7 @@ import com.ruoyi.in.domain.SignIn; |
| 5 | 5 | import com.ruoyi.pojo.request.ReportViewRequestVo; |
| 6 | 6 | import com.ruoyi.pojo.request.ReportErrorRequestVo; |
| 7 | 7 | import com.ruoyi.pojo.response.ReportViewResponseVo; |
| 8 | +import com.ruoyi.pojo.response.SignInResponseVo; | |
| 8 | 9 | |
| 9 | 10 | /** |
| 10 | 11 | * 签到Mapper接口 |
| ... | ... | @@ -28,7 +29,7 @@ public interface SignInMapper |
| 28 | 29 | * @param signIn 签到 |
| 29 | 30 | * @return 签到集合 |
| 30 | 31 | */ |
| 31 | - public List<SignIn> selectSignInList(SignIn signIn); | |
| 32 | + public List<SignInResponseVo> selectSignInList(SignIn signIn); | |
| 32 | 33 | |
| 33 | 34 | /** |
| 34 | 35 | * 新增签到 | ... | ... |
ruoyi-admin/src/main/java/com/ruoyi/in/service/ISignInService.java
| ... | ... | @@ -8,6 +8,7 @@ import com.ruoyi.common.exception.file.FileUploadException; |
| 8 | 8 | import com.ruoyi.in.domain.SignIn; |
| 9 | 9 | import com.ruoyi.pojo.request.ReportViewRequestVo; |
| 10 | 10 | import com.ruoyi.pojo.response.ReportViewResponseVo; |
| 11 | +import com.ruoyi.pojo.response.SignInResponseVo; | |
| 11 | 12 | |
| 12 | 13 | /** |
| 13 | 14 | * 签到Service接口 |
| ... | ... | @@ -31,7 +32,7 @@ public interface ISignInService |
| 31 | 32 | * @param signIn 签到 |
| 32 | 33 | * @return 签到集合 |
| 33 | 34 | */ |
| 34 | - public List<SignIn> selectSignInList(SignIn signIn); | |
| 35 | + public List<SignInResponseVo> selectSignInList(SignIn signIn); | |
| 35 | 36 | |
| 36 | 37 | /** |
| 37 | 38 | * 新增签到 | ... | ... |
ruoyi-admin/src/main/java/com/ruoyi/in/service/impl/SignInServiceImpl.java
| ... | ... | @@ -9,6 +9,7 @@ import java.util.Base64; |
| 9 | 9 | import java.util.Date; |
| 10 | 10 | import java.util.List; |
| 11 | 11 | import java.util.Objects; |
| 12 | +import java.util.stream.Collectors; | |
| 12 | 13 | |
| 13 | 14 | import com.ruoyi.common.config.RuoYiConfig; |
| 14 | 15 | import com.ruoyi.common.constant.Constants; |
| ... | ... | @@ -87,8 +88,9 @@ public class SignInServiceImpl implements ISignInService { |
| 87 | 88 | * @return 签到 |
| 88 | 89 | */ |
| 89 | 90 | @Override |
| 90 | - public List<SignIn> selectSignInList(SignIn signIn) { | |
| 91 | - return signInMapper.selectSignInList(signIn); | |
| 91 | + public List<SignInResponseVo> selectSignInList(SignIn signIn) { | |
| 92 | + List<SignInResponseVo> vos = signInMapper.selectSignInList(signIn); | |
| 93 | + return vos; | |
| 92 | 94 | } |
| 93 | 95 | |
| 94 | 96 | /** | ... | ... |
ruoyi-admin/src/main/java/com/ruoyi/pojo/response/ReportErrorResponseVo.java
| ... | ... | @@ -33,12 +33,12 @@ public class ReportErrorResponseVo {; |
| 33 | 33 | private String deviceId; |
| 34 | 34 | @ApiModelProperty("时间") |
| 35 | 35 | @ExcelProperty(value = "时间") |
| 36 | - @DateTimeFormat(pattern = "yyyy-MM-dd hh:mm:ss") | |
| 37 | - @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss" , timezone = "GMT+8") | |
| 36 | + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") | |
| 37 | + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8") | |
| 38 | 38 | private Date createTime; |
| 39 | 39 | @ApiModelProperty("备注") |
| 40 | 40 | @ExcelProperty(value = "备注") |
| 41 | - @DateTimeFormat(pattern = "yyyy-MM-dd hh:mm:ss") | |
| 42 | - @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss" , timezone = "GMT+8") | |
| 41 | + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") | |
| 42 | + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8") | |
| 43 | 43 | private String remark; |
| 44 | 44 | } | ... | ... |
ruoyi-admin/src/main/java/com/ruoyi/pojo/response/ReportSignInResponseVo.java
| ... | ... | @@ -21,6 +21,7 @@ public class ReportSignInResponseVo extends ReportViewResponseVo{ |
| 21 | 21 | public ReportSignInResponseVo(ReportViewResponseVo vo){ |
| 22 | 22 | this.count = 1; |
| 23 | 23 | this.children = new ArrayList<>(); |
| 24 | + this.setPosts(vo.getPosts()); | |
| 24 | 25 | this.setCreateTime(vo.getCreateTime()); |
| 25 | 26 | this.setId(vo.getId()); |
| 26 | 27 | this.setImage(vo.getImage()); | ... | ... |
ruoyi-admin/src/main/java/com/ruoyi/pojo/response/ReportViewResponseVo.java
ruoyi-admin/src/main/java/com/ruoyi/pojo/response/SignInResponseVo.java
| 1 | 1 | package com.ruoyi.pojo.response; |
| 2 | 2 | |
| 3 | +import com.alibaba.excel.annotation.ExcelIgnore; | |
| 4 | +import com.alibaba.excel.annotation.ExcelProperty; | |
| 5 | +import com.ruoyi.in.domain.SignIn; | |
| 3 | 6 | import lombok.Data; |
| 4 | 7 | |
| 5 | 8 | /** |
| ... | ... | @@ -7,15 +10,15 @@ import lombok.Data; |
| 7 | 10 | * @author 20412 |
| 8 | 11 | */ |
| 9 | 12 | @Data |
| 10 | -public class SignInResponseVo { | |
| 13 | +public class SignInResponseVo extends SignIn { | |
| 14 | + @ExcelIgnore | |
| 11 | 15 | String address; |
| 16 | + @ExcelIgnore | |
| 12 | 17 | String deviceId; |
| 18 | + @ExcelProperty(value = "姓名") | |
| 19 | + String name; | |
| 20 | + @ExcelProperty(value = "工种") | |
| 21 | + String posts; | |
| 22 | + | |
| 13 | 23 | |
| 14 | - @Override | |
| 15 | - public String toString() { | |
| 16 | - return "SignInResponseVo{" + | |
| 17 | - "address='" + address + '\'' + | |
| 18 | - ", deviceId='" + deviceId + '\'' + | |
| 19 | - '}'; | |
| 20 | - } | |
| 21 | 24 | } | ... | ... |
ruoyi-admin/src/main/resources/mapper/in/SignInMapper.xml
| ... | ... | @@ -3,7 +3,24 @@ |
| 3 | 3 | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| 4 | 4 | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| 5 | 5 | <mapper namespace="com.ruoyi.in.mapper.SignInMapper"> |
| 6 | - | |
| 6 | + <resultMap type="com.ruoyi.pojo.response.SignInResponseVo" id="SignInResultVO"> | |
| 7 | + <result property="id" column="id" /> | |
| 8 | + <result property="createTime" column="create_time" /> | |
| 9 | + <result property="jobCode" column="jobCode" /> | |
| 10 | + <result property="deviceId" column="device_id" /> | |
| 11 | + <result property="ip" column="ip" /> | |
| 12 | + <result property="image" column="image" /> | |
| 13 | + <result property="status" column="status" /> | |
| 14 | + <result property="updateBy" column="update_by" /> | |
| 15 | + <result property="singnIn" column="singn_in" /> | |
| 16 | + <result property="alcoholFlag" column="alcohol_flag" /> | |
| 17 | + <result property="type" column="type" /> | |
| 18 | + <result property="updateTime" column="update_time" /> | |
| 19 | + <result property="alcoholIntake" column="alcohol_intake" /> | |
| 20 | + <result property="remark" column="remark" /> | |
| 21 | + <result property="posts" column="posts" /> | |
| 22 | + <result property="name" column="personnel_name" /> | |
| 23 | + </resultMap> | |
| 7 | 24 | <resultMap type="SignIn" id="SignInResult"> |
| 8 | 25 | <result property="id" column="id" /> |
| 9 | 26 | <result property="createTime" column="create_time" /> |
| ... | ... | @@ -25,9 +42,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| 25 | 42 | select id, create_time, jobCode, device_id,ip,image, status, update_by, singn_in, alcohol_flag, type, update_time, alcohol_intake, remark from sign_in |
| 26 | 43 | </sql> |
| 27 | 44 | |
| 28 | - <select id="selectSignInList" parameterType="SignIn" resultMap="SignInResult"> | |
| 29 | - <include refid="selectSignInVo"/> | |
| 30 | - <where> | |
| 45 | + <select id="selectSignInList" parameterType="com.ruoyi.pojo.response.SignInResponseVo" resultMap="SignInResultVO"> | |
| 46 | + select sign_in.*,driver.posts,driver.personnel_name | |
| 47 | + from sign_in,driver | |
| 48 | + WHERE | |
| 49 | + driver.job_code = sign_in.jobCode | |
| 31 | 50 | <if test="jobCode != null and jobCode != ''"> and jobCode = #{jobCode}</if> |
| 32 | 51 | <if test="ip != null and ip != ''"> and ip = #{ip}</if> |
| 33 | 52 | <if test="image != null and image != ''"> and image = #{image}</if> |
| ... | ... | @@ -36,8 +55,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| 36 | 55 | <if test="alcoholFlag != null "> and alcohol_flag = #{alcoholFlag}</if> |
| 37 | 56 | <if test="type != null "> and type = #{type}</if> |
| 38 | 57 | <if test="alcoholIntake != null "> and alcohol_intake = #{alcoholIntake}</if> |
| 39 | - </where> | |
| 40 | - order by id desc | |
| 58 | + order by create_time desc | |
| 41 | 59 | </select> |
| 42 | 60 | |
| 43 | 61 | <select id="selectSignInById" parameterType="Long" resultMap="SignInResult"> |
| ... | ... | @@ -56,7 +74,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| 56 | 74 | alcohol_flag alcoholFlag, |
| 57 | 75 | alcohol_intake alcoholIntake, |
| 58 | 76 | sign_in.image, |
| 59 | - sign_in.remark | |
| 77 | + sign_in.remark, | |
| 78 | + driver.posts | |
| 60 | 79 | FROM |
| 61 | 80 | sign_in, |
| 62 | 81 | driver | ... | ... |
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java
| ... | ... | @@ -67,7 +67,7 @@ public class SysUser extends BaseEntity |
| 67 | 67 | private String loginIp; |
| 68 | 68 | |
| 69 | 69 | /** 最后登录时间 */ |
| 70 | - @Excel(name = "最后登录时间", width = 30, dateFormat = "yyyy-MM-dd hh:mm:ss", type = Type.EXPORT) | |
| 70 | + @Excel(name = "最后登录时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", type = Type.EXPORT) | |
| 71 | 71 | private Date loginDate; |
| 72 | 72 | |
| 73 | 73 | /** 部门对象 */ | ... | ... |