Commit 69815ecf authored by 罗可心's avatar 罗可心 😕 Committed by 王琮

导入员工修复,通道管理查询与导出功能修复

parent c2f339b6
...@@ -8,6 +8,8 @@ import lombok.*; ...@@ -8,6 +8,8 @@ import lombok.*;
import org.rcisoft.core.entity.CyIdIncreEntity; import org.rcisoft.core.entity.CyIdIncreEntity;
import org.springframework.data.annotation.Transient; import org.springframework.data.annotation.Transient;
import java.util.Date;
/** /**
* Created with cy on 2022年12月23日 下午2:04:50. * Created with cy on 2022年12月23日 下午2:04:50.
*/ */
...@@ -16,7 +18,10 @@ import org.springframework.data.annotation.Transient; ...@@ -16,7 +18,10 @@ import org.springframework.data.annotation.Transient;
public class DoorDeviceInfo extends CyIdIncreEntity<DoorDeviceInfo> { public class DoorDeviceInfo extends CyIdIncreEntity<DoorDeviceInfo> {
//id //id
private Integer id; private Integer id;
//设备所在地址中文 /**
* 设备所在地址中文(前端显示:所在位置)
*/
@Excel(name = "通道名称",orderNum = "1", width = 30)
private String deviceAddressLabel; private String deviceAddressLabel;
//排序 //排序
...@@ -58,16 +63,19 @@ public class DoorDeviceInfo extends CyIdIncreEntity<DoorDeviceInfo> { ...@@ -58,16 +63,19 @@ public class DoorDeviceInfo extends CyIdIncreEntity<DoorDeviceInfo> {
private String endTime; private String endTime;
/** /**
* @desc 设备imei码 * @desc 设备imei码(前端显示:门磁设备编号)
* @column device_imei * @column device_imei
* @default * @default
*/ */
@Excel(name = "门磁设备编号",orderNum = "2", width = 20)
private String deviceImei; private String deviceImei;
/** /**
* @desc 设备名称 * @desc 设备名称(前端显示:通道名称)
* @column device_name * @column device_name
* @default * @default
*/ */
@Excel(name = "通道名称",orderNum = "3", width = 20)
private String deviceName; private String deviceName;
/** /**
* @desc 设备所在地址 * @desc 设备所在地址
...@@ -76,16 +84,18 @@ public class DoorDeviceInfo extends CyIdIncreEntity<DoorDeviceInfo> { ...@@ -76,16 +84,18 @@ public class DoorDeviceInfo extends CyIdIncreEntity<DoorDeviceInfo> {
*/ */
private String deviceAddress; private String deviceAddress;
/** /**
* @desc 设备所在区域 * @desc 设备所在区域(前端显示:所在楼层)
* @column device_area * @column device_area
* @default * @default
*/ */
@Excel(name = "所在楼层",orderNum = "4", width = 20)
private String deviceArea; private String deviceArea;
/** /**
* @desc 设备所在点位 * @desc 设备所在点位
* @column device_point * @column device_point
* @default * @default
*/ */
@Excel(name = "所在点位",orderNum = "5", width = 20)
private String devicePoint; private String devicePoint;
...@@ -96,5 +106,23 @@ public class DoorDeviceInfo extends CyIdIncreEntity<DoorDeviceInfo> { ...@@ -96,5 +106,23 @@ public class DoorDeviceInfo extends CyIdIncreEntity<DoorDeviceInfo> {
*/ */
private Long linkVideoId; private Long linkVideoId;
/**
* 上报时间
*/
@Excel(name = "设备上报时间", format ="yyyy/MM/dd HH:mm:ss",orderNum = "6", width = 20)
private Date reportTime;
/**
* 抓拍图像
*/
private String capturePic;
/**
* 设备上班数据内容 (告警原因)
*/
@Excel(name = "告警原因",orderNum = "7", width = 20)
private String dataVal;
} }
...@@ -69,4 +69,7 @@ public class ExportUserDTO extends CyIdIncreEntity<SysUser> { ...@@ -69,4 +69,7 @@ public class ExportUserDTO extends CyIdIncreEntity<SysUser> {
//班次中文 //班次中文
private String nltBzLabel; private String nltBzLabel;
//是否显示考勤 默认0 (0-是,1-否)
private String attendanceShow;
} }
...@@ -157,6 +157,12 @@ public class SysUser extends CyIdIncreEntity<SysUser> { ...@@ -157,6 +157,12 @@ public class SysUser extends CyIdIncreEntity<SysUser> {
@Excel(name = "用户性别", orderNum = "6", width = 20) @Excel(name = "用户性别", orderNum = "6", width = 20)
private String sex; private String sex;
/**
* @desc 是否显示考勤(0是 1否)
* @column attendance_show
* @default 0
*/
private String attendanceShow; private String attendanceShow;
/** /**
......
...@@ -395,6 +395,8 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserRepositorys, SysUser> ...@@ -395,6 +395,8 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserRepositorys, SysUser>
ArrayList<SysUser> list = new ArrayList<>(); ArrayList<SysUser> list = new ArrayList<>();
for (int i = 0; i < sysUserList.size(); i++) { for (int i = 0; i < sysUserList.size(); i++) {
String deptId = sysUserList.get(i).getDeptId(); String deptId = sysUserList.get(i).getDeptId();
// 清空部门id 到处的数据有部门id
sysUserList.get(i).setDeptId("");
//根据部门id查询部门表 //根据部门id查询部门表
List<SysDept> sysDepts = sysDeptRepositorys.queryDeptById(deptId); List<SysDept> sysDepts = sysDeptRepositorys.queryDeptById(deptId);
if (sysDepts.size() != 0) { if (sysDepts.size() != 0) {
...@@ -592,6 +594,8 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserRepositorys, SysUser> ...@@ -592,6 +594,8 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserRepositorys, SysUser>
sysUser.setUserType("0"); sysUser.setUserType("0");
//身份 //身份
sysUser.setIdentity("1"); sysUser.setIdentity("1");
// 是否显示考勤 默认(0-是)
sysUser.setAttendanceShow("0");
sysUser.setUsername(sysUser.getPhone()); sysUser.setUsername(sysUser.getPhone());
sysUser.setCreateDate(new Date()); sysUser.setCreateDate(new Date());
SysUser user = new SysUser(); SysUser user = new SysUser();
......
...@@ -3,29 +3,68 @@ ...@@ -3,29 +3,68 @@
<mapper namespace="org.rcisoft.sys.doordeviceinfo.dao.DoorDeviceInfoRepository"> <mapper namespace="org.rcisoft.sys.doordeviceinfo.dao.DoorDeviceInfoRepository">
<resultMap id="BaseResultMap" type="org.rcisoft.sys.doordeviceinfo.entity.DoorDeviceInfo"> <resultMap id="BaseResultMap" type="org.rcisoft.sys.doordeviceinfo.entity.DoorDeviceInfo">
<id column="business_id" jdbcType="BIGINT" property="businessId"/> <id column="business_id" jdbcType="BIGINT" property="businessId"/>
<result column="device_imei" jdbcType="VARCHAR" property="deviceImei"/> <result column="device_imei" jdbcType="VARCHAR" property="deviceImei"/>
<result column="device_name" jdbcType="VARCHAR" property="deviceName"/> <result column="device_name" jdbcType="VARCHAR" property="deviceName"/>
<result column="device_address" jdbcType="VARCHAR" property="deviceAddress"/> <result column="device_address" jdbcType="VARCHAR" property="deviceAddress"/>
<result column="device_address_label" jdbcType="VARCHAR" property="deviceAddressLabel"/>
<result column="device_area" jdbcType="VARCHAR" property="deviceArea"/> <result column="device_area" jdbcType="VARCHAR" property="deviceArea"/>
<result column="device_point" jdbcType="VARCHAR" property="devicePoint"/> <result column="device_point" jdbcType="VARCHAR" property="devicePoint"/>
<result column="remark" jdbcType="VARCHAR" property="remarks"/> <result column="remark" jdbcType="VARCHAR" property="remarks"/>
<result column="link_video_id" jdbcType="BIGINT" property="linkVideoId"/> <result column="link_video_id" jdbcType="BIGINT" property="linkVideoId"/>
<result column="del_flag" jdbcType="CHAR" property="delFlag"/> <result column="del_flag" jdbcType="CHAR" property="delFlag"/>
<result column="report_time" jdbcType="TIMESTAMP" property="reportTime"/>
<result column="capture_pic" jdbcType="VARCHAR" property="capturePic"/>
<result column="data_val" jdbcType="VARCHAR" property="dataVal"/>
</resultMap> </resultMap>
<!--<cache type="${corePackag!}.util.RedisCache"/>--> <!--<cache type="${corePackag!}.util.RedisCache"/>-->
<!-- todo 导出-->
<select id="queryDoorDeviceInfos" resultMap="BaseResultMap"> <select id="queryDoorDeviceInfos" resultMap="BaseResultMap">
select * SELECT drd.business_id AS id,
from door_device_info drd.report_time report_time,
where 1 = 1 drd.capture_pic capture_pic,
drd.data_val data_val,
ddi.device_address_label device_address_label,
ddi.*,drd.*
FROM door_report_data drd
LEFT JOIN door_device_info ddi ON ddi.business_id = drd.device_id
WHERE ddi.del_flag = 0
<if test="entity.flag !=null and entity.flag != '' ">
and ddi.flag = #{entity.flag}
</if>
<if test="entity.beginTime != null and entity.beginTime !='' "><!-- 开始时间检索 -->
and date_format(ddi.create_date,'%Y-%m-%d') &gt;= date_format(#{entity.beginTime},'%Y-%m-%d')
</if>
<if test="entity.endTime != null and entity.endTime !='' "><!-- 结束时间检索 -->
and date_format(ddi.create_date,'%Y-%m-%d') &lt;= date_format(#{entity.endTime},'%Y-%m-%d')
</if>
<if test="entity.deviceAddressLabel != null and entity.deviceAddressLabel != ''">
and ddi.device_address_label like concat('%', #{entity.deviceAddressLabel}, '%' )
</if>
<if test="entity.dataType !=null and entity.dataType != '' ">
and drd.data_type = #{entity.dataType}
</if>
<if test="entity.abnormal !=null and entity.abnormal != '' ">
and drd.abnormal = #{entity.abnormal}
</if>
<if test="entity.px == '1'.toString() "><!-- 排序-->
order BY drd.report_time desc
</if>
<if test="entity.px == '2'.toString() "><!-- 排序-->
ORDER BY ddi.device_address_label
</if>
</select> </select>
<!-- todo 条件查询-->
<select id="queryDoorDeviceInfosPaged" resultMap="BaseResultMap"> <select id="queryDoorDeviceInfosPaged" resultMap="BaseResultMap">
SELECT drd.business_id AS id,ddi.*,drd.* SELECT drd.business_id AS id,
FROM door_device_info ddi drd.report_time report_time,
LEFT JOIN door_report_data drd ON ddi.business_id = drd.device_id drd.capture_pic capture_pic,
LEFT JOIN sys_dict_data sdd ON ddi.device_address = sdd.dict_value drd.data_val data_val,
ddi.device_address_label device_address_label,
ddi.*,drd.*
FROM door_report_data drd
LEFT JOIN door_device_info ddi ON ddi.business_id = drd.device_id
WHERE ddi.del_flag = 0 WHERE ddi.del_flag = 0
<if test="entity.flag !=null and entity.flag != '' "> <if test="entity.flag !=null and entity.flag != '' ">
and ddi.flag = #{entity.flag} and ddi.flag = #{entity.flag}
...@@ -36,8 +75,8 @@ ...@@ -36,8 +75,8 @@
<if test="entity.endTime != null and entity.endTime !='' "><!-- 结束时间检索 --> <if test="entity.endTime != null and entity.endTime !='' "><!-- 结束时间检索 -->
and date_format(ddi.create_date,'%Y-%m-%d') &lt;= date_format(#{entity.endTime},'%Y-%m-%d') and date_format(ddi.create_date,'%Y-%m-%d') &lt;= date_format(#{entity.endTime},'%Y-%m-%d')
</if> </if>
<if test="entity.deviceAddress !=null and entity.deviceAddress != '' "> <if test="entity.deviceAddressLabel != null and entity.deviceAddressLabel != ''">
and ddi.device_address = #{entity.deviceAddress} and ddi.device_address_label like concat('%', #{entity.deviceAddressLabel}, '%' )
</if> </if>
<if test="entity.dataType !=null and entity.dataType != '' "> <if test="entity.dataType !=null and entity.dataType != '' ">
and drd.data_type = #{entity.dataType} and drd.data_type = #{entity.dataType}
...@@ -46,10 +85,10 @@ ...@@ -46,10 +85,10 @@
and drd.abnormal = #{entity.abnormal} and drd.abnormal = #{entity.abnormal}
</if> </if>
<if test="entity.px == '1'.toString() "><!-- 排序--> <if test="entity.px == '1'.toString() "><!-- 排序-->
order BY ddi.create_date desc order BY drd.report_time desc
</if> </if>
<if test="entity.px == '2'.toString() "><!-- 排序--> <if test="entity.px == '2'.toString() "><!-- 排序-->
ORDER BY sdd.dict_sort desc ORDER BY ddi.device_address_label
</if> </if>
</select> </select>
......
...@@ -109,8 +109,10 @@ ...@@ -109,8 +109,10 @@
</resultMap> </resultMap>
<!--<cache type="${corePackag!}.util.RedisCache"/>--> <!--<cache type="${corePackag!}.util.RedisCache"/>-->
<select id="querySysUsers" resultMap="BaseResultMap"> <select id="querySysUsers" resultMap="BaseResultMap">
select * select distinct sdd.dict_sort,su.*
from sys_user su from sys_user su
LEFT JOIN sys_dict_data sdd
ON su.position = sdd.dict_value
where su.del_flag = 0 where su.del_flag = 0
and su.user_type = 0 and su.user_type = 0
and (su.identity = 2 or su.identity = 1) and (su.identity = 2 or su.identity = 1)
...@@ -140,13 +142,13 @@ ...@@ -140,13 +142,13 @@
</if> </if>
<if test="entity.px == '1'.toString() "><!-- 排序--> <if test="entity.px == '1'.toString() "><!-- 排序-->
order BY su.create_date desc order BY su.create_date desc , su.business_id
</if> </if>
<if test="entity.px == '2'.toString() "><!-- 排序--> <if test="entity.px == '2'.toString() "><!-- 排序-->
order BY sdd.dict_sort desc order BY sdd.dict_sort desc , su.business_id
</if> </if>
<if test="entity.px == '3'.toString() "><!-- 排序--> <if test="entity.px == '3'.toString() "><!-- 排序-->
order BY F_GET_PYJM(su.name) order BY F_GET_PYJM(su.name) , su.business_id
</if> </if>
</select> </select>
...@@ -198,13 +200,13 @@ ...@@ -198,13 +200,13 @@
</if> </if>
<if test="entity.px == '1'.toString() "><!-- 排序--> <if test="entity.px == '1'.toString() "><!-- 排序-->
order BY su.create_date desc order BY su.create_date desc, su.business_id
</if> </if>
<if test="entity.px == '2'.toString() "><!-- 排序--> <if test="entity.px == '2'.toString() "><!-- 排序-->
order BY sdd.dict_sort desc order BY sdd.dict_sort desc, su.business_id
</if> </if>
<if test="entity.px == '3'.toString() "><!-- 排序--> <if test="entity.px == '3'.toString() "><!-- 排序-->
order BY F_GET_PYJM(su.name) order BY F_GET_PYJM(su.name), su.business_id
</if> </if>
</select> </select>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment