upate code
parent
953f85ffc8
commit
1cf74add92
|
@ -105,6 +105,16 @@ public class SysUser extends BaseEntity
|
|||
@Excel(name = "最后登录时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", type = Type.EXPORT)
|
||||
private Date loginDate;
|
||||
|
||||
private String admitGuid;
|
||||
|
||||
public String getAdmitGuid() {
|
||||
return admitGuid;
|
||||
}
|
||||
|
||||
public void setAdmitGuid(String admitGuid) {
|
||||
this.admitGuid = admitGuid;
|
||||
}
|
||||
|
||||
/** 部门对象 */
|
||||
@Excels({
|
||||
@Excel(name = "部门名称", targetAttr = "deptName", type = Type.EXPORT),
|
||||
|
|
|
@ -0,0 +1,285 @@
|
|||
package com.yanzhu.manage.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.yanzhu.common.core.annotation.Excel;
|
||||
import com.yanzhu.common.core.web.domain.BaseEntity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 考勤管理对象 attendance_ubi_data
|
||||
*
|
||||
* @author yanzhu
|
||||
* @date 2024-10-12
|
||||
*/
|
||||
public class AttendanceUbiData extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** $column.columnComment */
|
||||
private Long id;
|
||||
|
||||
/** 公司ID */
|
||||
@Excel(name = "公司ID")
|
||||
private Long comId;
|
||||
|
||||
/** 项目ID */
|
||||
@Excel(name = "项目ID")
|
||||
private Long projectId;
|
||||
|
||||
/** 用户ID */
|
||||
@Excel(name = "用户ID")
|
||||
private Long userId;
|
||||
|
||||
/** $column.columnComment */
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String userName;
|
||||
|
||||
/** 班组编号(外键) */
|
||||
@Excel(name = "班组编号(外键)")
|
||||
private Long subDeptGroup;
|
||||
|
||||
/** 班组名称 */
|
||||
@Excel(name = "班组名称")
|
||||
private String subDeptGroupName;
|
||||
|
||||
/** 工种类型 */
|
||||
@Excel(name = "工种类型")
|
||||
private String craftType;
|
||||
|
||||
/** 工种岗位 */
|
||||
@Excel(name = "工种岗位")
|
||||
private String craftPost;
|
||||
|
||||
/** 进场时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "进场时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date inTime;
|
||||
|
||||
/** 进场数据 */
|
||||
@Excel(name = "进场数据")
|
||||
private String inData;
|
||||
|
||||
/** 离场时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "离场时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date outTime;
|
||||
|
||||
/** 离场数据 */
|
||||
@Excel(name = "离场数据")
|
||||
private String outData;
|
||||
|
||||
/** 设备NO */
|
||||
@Excel(name = "设备NO")
|
||||
private String deviceNo;
|
||||
|
||||
/** $column.columnComment */
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private Long isDel;
|
||||
|
||||
/** $column.columnComment */
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private Long state;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setComId(Long comId)
|
||||
{
|
||||
this.comId = comId;
|
||||
}
|
||||
|
||||
public Long getComId()
|
||||
{
|
||||
return comId;
|
||||
}
|
||||
public void setProjectId(Long projectId)
|
||||
{
|
||||
this.projectId = projectId;
|
||||
}
|
||||
|
||||
public Long getProjectId()
|
||||
{
|
||||
return projectId;
|
||||
}
|
||||
public void setUserId(Long userId)
|
||||
{
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public Long getUserId()
|
||||
{
|
||||
return userId;
|
||||
}
|
||||
public void setUserName(String userName)
|
||||
{
|
||||
this.userName = userName;
|
||||
}
|
||||
|
||||
public String getUserName()
|
||||
{
|
||||
return userName;
|
||||
}
|
||||
public void setSubDeptGroup(Long subDeptGroup)
|
||||
{
|
||||
this.subDeptGroup = subDeptGroup;
|
||||
}
|
||||
|
||||
public Long getSubDeptGroup()
|
||||
{
|
||||
return subDeptGroup;
|
||||
}
|
||||
public void setSubDeptGroupName(String subDeptGroupName)
|
||||
{
|
||||
this.subDeptGroupName = subDeptGroupName;
|
||||
}
|
||||
|
||||
public String getSubDeptGroupName()
|
||||
{
|
||||
return subDeptGroupName;
|
||||
}
|
||||
public void setCraftType(String craftType)
|
||||
{
|
||||
this.craftType = craftType;
|
||||
}
|
||||
|
||||
public String getCraftType()
|
||||
{
|
||||
return craftType;
|
||||
}
|
||||
public void setCraftPost(String craftPost)
|
||||
{
|
||||
this.craftPost = craftPost;
|
||||
}
|
||||
|
||||
public String getCraftPost()
|
||||
{
|
||||
return craftPost;
|
||||
}
|
||||
public void setInTime(Date inTime)
|
||||
{
|
||||
this.inTime = inTime;
|
||||
}
|
||||
|
||||
public Date getInTime()
|
||||
{
|
||||
return inTime;
|
||||
}
|
||||
public void setInData(String inData)
|
||||
{
|
||||
this.inData = inData;
|
||||
}
|
||||
|
||||
public String getInData()
|
||||
{
|
||||
return inData;
|
||||
}
|
||||
public void setOutTime(Date outTime)
|
||||
{
|
||||
this.outTime = outTime;
|
||||
}
|
||||
|
||||
public Date getOutTime()
|
||||
{
|
||||
return outTime;
|
||||
}
|
||||
public void setOutData(String outData)
|
||||
{
|
||||
this.outData = outData;
|
||||
}
|
||||
|
||||
public String getOutData()
|
||||
{
|
||||
return outData;
|
||||
}
|
||||
public void setDeviceNo(String deviceNo)
|
||||
{
|
||||
this.deviceNo = deviceNo;
|
||||
}
|
||||
|
||||
public String getDeviceNo()
|
||||
{
|
||||
return deviceNo;
|
||||
}
|
||||
public void setIsDel(Long isDel)
|
||||
{
|
||||
this.isDel = isDel;
|
||||
}
|
||||
|
||||
public Long getIsDel()
|
||||
{
|
||||
return isDel;
|
||||
}
|
||||
public void setState(Long state)
|
||||
{
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
public Long getState()
|
||||
{
|
||||
return state;
|
||||
}
|
||||
|
||||
private String eventGuid;
|
||||
private String inPhoto;
|
||||
private String outPhoto;
|
||||
public String getEventGuid() {
|
||||
return eventGuid;
|
||||
}
|
||||
|
||||
public void setEventGuid(String eventGuid) {
|
||||
this.eventGuid = eventGuid;
|
||||
}
|
||||
|
||||
public String getInPhoto() {
|
||||
return inPhoto;
|
||||
}
|
||||
|
||||
public void setInPhoto(String inPhoto) {
|
||||
this.inPhoto = inPhoto;
|
||||
}
|
||||
|
||||
public String getOutPhoto() {
|
||||
return outPhoto;
|
||||
}
|
||||
|
||||
public void setOutPhoto(String outPhoto) {
|
||||
this.outPhoto = outPhoto;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("comId", getComId())
|
||||
.append("projectId", getProjectId())
|
||||
.append("userId", getUserId())
|
||||
.append("userName", getUserName())
|
||||
.append("subDeptGroup", getSubDeptGroup())
|
||||
.append("subDeptGroupName", getSubDeptGroupName())
|
||||
.append("craftType", getCraftType())
|
||||
.append("craftPost", getCraftPost())
|
||||
.append("inTime", getInTime())
|
||||
.append("inData", getInData())
|
||||
.append("outTime", getOutTime())
|
||||
.append("outData", getOutData())
|
||||
.append("deviceNo", getDeviceNo())
|
||||
.append("isDel", getIsDel())
|
||||
.append("state", getState())
|
||||
.append("remark", getRemark())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
|
@ -100,6 +100,35 @@ public class AttendanceUbiDevice extends BaseEntity
|
|||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private Long isDel;
|
||||
|
||||
private String compName;
|
||||
private String projectName;
|
||||
|
||||
public String getCompName() {
|
||||
return compName;
|
||||
}
|
||||
|
||||
public void setCompName(String compName) {
|
||||
this.compName = compName;
|
||||
}
|
||||
|
||||
public String getProjectName() {
|
||||
return projectName;
|
||||
}
|
||||
|
||||
public void setProjectName(String projectName) {
|
||||
this.projectName = projectName;
|
||||
}
|
||||
|
||||
public String getSouceName() {
|
||||
return souceName;
|
||||
}
|
||||
|
||||
public void setSouceName(String souceName) {
|
||||
this.souceName = souceName;
|
||||
}
|
||||
|
||||
private String souceName;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
|
|
|
@ -0,0 +1,61 @@
|
|||
package com.yanzhu.manage.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.yanzhu.manage.domain.AttendanceUbiData;
|
||||
|
||||
/**
|
||||
* 考勤管理Mapper接口
|
||||
*
|
||||
* @author yanzhu
|
||||
* @date 2024-10-12
|
||||
*/
|
||||
public interface AttendanceUbiDataMapper
|
||||
{
|
||||
/**
|
||||
* 查询考勤管理
|
||||
*
|
||||
* @param id 考勤管理主键
|
||||
* @return 考勤管理
|
||||
*/
|
||||
public AttendanceUbiData selectAttendanceUbiDataById(Long id);
|
||||
|
||||
/**
|
||||
* 查询考勤管理列表
|
||||
*
|
||||
* @param attendanceUbiData 考勤管理
|
||||
* @return 考勤管理集合
|
||||
*/
|
||||
public List<AttendanceUbiData> selectAttendanceUbiDataList(AttendanceUbiData attendanceUbiData);
|
||||
|
||||
/**
|
||||
* 新增考勤管理
|
||||
*
|
||||
* @param attendanceUbiData 考勤管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertAttendanceUbiData(AttendanceUbiData attendanceUbiData);
|
||||
|
||||
/**
|
||||
* 修改考勤管理
|
||||
*
|
||||
* @param attendanceUbiData 考勤管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateAttendanceUbiData(AttendanceUbiData attendanceUbiData);
|
||||
|
||||
/**
|
||||
* 删除考勤管理
|
||||
*
|
||||
* @param id 考勤管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAttendanceUbiDataById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除考勤管理
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAttendanceUbiDataByIds(Long[] ids);
|
||||
}
|
|
@ -0,0 +1,159 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.yanzhu.manage.mapper.AttendanceUbiDataMapper">
|
||||
|
||||
<resultMap type="AttendanceUbiData" id="AttendanceUbiDataResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="comId" column="comId" />
|
||||
<result property="projectId" column="projectId" />
|
||||
<result property="userId" column="userId" />
|
||||
<result property="userName" column="userName" />
|
||||
<result property="subDeptGroup" column="sub_dept_group" />
|
||||
<result property="subDeptGroupName" column="sub_dept_group_name" />
|
||||
<result property="craftType" column="craft_type" />
|
||||
<result property="craftPost" column="craft_post" />
|
||||
<result property="inTime" column="inTime" />
|
||||
<result property="inData" column="inData" />
|
||||
<result property="outTime" column="outTime" />
|
||||
<result property="outData" column="outData" />
|
||||
<result property="deviceNo" column="deviceNo" />
|
||||
<result property="isDel" column="is_del" />
|
||||
<result property="state" column="state" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="eventGuid" column="eventGuid"/>
|
||||
<result property="inPhoto" column="inPhoto"/>
|
||||
<result property="outPhoto" column="outPhoto"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectAttendanceUbiDataVo">
|
||||
select id, comId, projectId, userId, userName, sub_dept_group, sub_dept_group_name, craft_type, craft_post,
|
||||
eventGuid,inPhoto,outPhoto,
|
||||
inTime, inData, outTime, outData, deviceNo, is_del, state, remark, create_by, create_time, update_by, update_time from attendance_ubi_data
|
||||
</sql>
|
||||
|
||||
<select id="selectAttendanceUbiDataList" parameterType="AttendanceUbiData" resultMap="AttendanceUbiDataResult">
|
||||
<include refid="selectAttendanceUbiDataVo"/>
|
||||
<where>
|
||||
<if test="comId != null "> and comId = #{comId}</if>
|
||||
<if test="projectId != null "> and projectId = #{projectId}</if>
|
||||
<if test="userId != null "> and userId = #{userId}</if>
|
||||
<if test="userName != null and userName != ''"> and userName like concat('%', #{userName}, '%')</if>
|
||||
<if test="subDeptGroup != null "> and sub_dept_group = #{subDeptGroup}</if>
|
||||
<if test="subDeptGroupName != null and subDeptGroupName != ''"> and sub_dept_group_name like concat('%', #{subDeptGroupName}, '%')</if>
|
||||
<if test="craftType != null and craftType != ''"> and craft_type = #{craftType}</if>
|
||||
<if test="craftPost != null and craftPost != ''"> and craft_post = #{craftPost}</if>
|
||||
<if test="inTime != null "> and inTime = #{inTime}</if>
|
||||
<if test="inData != null and inData != ''"> and inData = #{inData}</if>
|
||||
<if test="outTime != null "> and outTime = #{outTime}</if>
|
||||
<if test="outData != null and outData != ''"> and outData = #{outData}</if>
|
||||
<if test="deviceNo != null and deviceNo != ''"> and deviceNo = #{deviceNo}</if>
|
||||
<if test="isDel != null "> and is_del = #{isDel}</if>
|
||||
<if test="state != null "> and state = #{state}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectAttendanceUbiDataById" parameterType="Long" resultMap="AttendanceUbiDataResult">
|
||||
<include refid="selectAttendanceUbiDataVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertAttendanceUbiData" parameterType="AttendanceUbiData" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into attendance_ubi_data
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="comId != null">comId,</if>
|
||||
<if test="projectId != null">projectId,</if>
|
||||
<if test="userId != null">userId,</if>
|
||||
<if test="userName != null">userName,</if>
|
||||
<if test="subDeptGroup != null">sub_dept_group,</if>
|
||||
<if test="subDeptGroupName != null">sub_dept_group_name,</if>
|
||||
<if test="craftType != null">craft_type,</if>
|
||||
<if test="craftPost != null">craft_post,</if>
|
||||
<if test="inTime != null">inTime,</if>
|
||||
<if test="inData != null">inData,</if>
|
||||
<if test="outTime != null">outTime,</if>
|
||||
<if test="outData != null">outData,</if>
|
||||
<if test="deviceNo != null">deviceNo,</if>
|
||||
<if test="isDel != null">is_del,</if>
|
||||
<if test="eventGuid != null">eventGuid,</if>
|
||||
<if test="inPhoto != null">inPhoto,</if>
|
||||
<if test="outPhoto != null">outPhoto,</if>
|
||||
<if test="state != null">state,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="comId != null">#{comId},</if>
|
||||
<if test="projectId != null">#{projectId},</if>
|
||||
<if test="userId != null">#{userId},</if>
|
||||
<if test="userName != null">#{userName},</if>
|
||||
<if test="subDeptGroup != null">#{subDeptGroup},</if>
|
||||
<if test="subDeptGroupName != null">#{subDeptGroupName},</if>
|
||||
<if test="craftType != null">#{craftType},</if>
|
||||
<if test="craftPost != null">#{craftPost},</if>
|
||||
<if test="inTime != null">#{inTime},</if>
|
||||
<if test="inData != null">#{inData},</if>
|
||||
<if test="outTime != null">#{outTime},</if>
|
||||
<if test="outData != null">#{outData},</if>
|
||||
<if test="deviceNo != null">#{deviceNo},</if>
|
||||
<if test="isDel != null">#{isDel},</if>
|
||||
<if test="eventGuid != null">#{eventGuid},</if>
|
||||
<if test="inPhoto != null">#{inPhoto},</if>
|
||||
<if test="outPhoto != null">#{outPhoto},</if>
|
||||
<if test="state != null">#{state},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateAttendanceUbiData" parameterType="AttendanceUbiData">
|
||||
update attendance_ubi_data
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="comId != null">comId = #{comId},</if>
|
||||
<if test="projectId != null">projectId = #{projectId},</if>
|
||||
<if test="userId != null">userId = #{userId},</if>
|
||||
<if test="userName != null">userName = #{userName},</if>
|
||||
<if test="subDeptGroup != null">sub_dept_group = #{subDeptGroup},</if>
|
||||
<if test="subDeptGroupName != null">sub_dept_group_name = #{subDeptGroupName},</if>
|
||||
<if test="craftType != null">craft_type = #{craftType},</if>
|
||||
<if test="craftPost != null">craft_post = #{craftPost},</if>
|
||||
<if test="inTime != null">inTime = #{inTime},</if>
|
||||
<if test="inData != null">inData = #{inData},</if>
|
||||
<if test="outTime != null">outTime = #{outTime},</if>
|
||||
<if test="outData != null">outData = #{outData},</if>
|
||||
<if test="deviceNo != null">deviceNo = #{deviceNo},</if>
|
||||
<if test="isDel != null">is_del = #{isDel},</if>
|
||||
<if test="eventGuid != null">is_del = #{eventGuid},</if>
|
||||
<if test="inPhoto != null">is_del = #{inPhoto},</if>
|
||||
<if test="outPhoto != null">is_del = #{outPhoto},</if>
|
||||
<if test="state != null">state = #{state},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteAttendanceUbiDataById" parameterType="Long">
|
||||
delete from attendance_ubi_data where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteAttendanceUbiDataByIds" parameterType="String">
|
||||
delete from attendance_ubi_data where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
|
@ -31,44 +31,52 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="compName" column="comp_name"/>
|
||||
<result property="projectName" column="project_name"/>
|
||||
<result property="souceName" column="souce_name"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectAttendanceUbiDeviceVo">
|
||||
select id, com_id, project_id, name, tag, scene_guid, source, device_no, addition, bind_default_scene, force_empty_device, password, device_model, device_state, rec_type, online_state, version_no, last_active_time, has_register, state, remark, is_del, create_by, create_time, update_by, update_time from attendance_ubi_device
|
||||
select ud.id, ud.com_id, ud.project_id, ud.name, ud.tag, ud.scene_guid, ud.source, ud.device_no, ud.addition, ud.bind_default_scene, ud.force_empty_device,
|
||||
ud.device_model, ud.device_state, ud.rec_type, ud.online_state, ud.version_no, ud.last_active_time, ud.has_register, ud.state, ud.remark, ud.is_del,
|
||||
ud.create_by, ud.create_time, ud.update_by, ud.update_time ,dp.`dept_name` comp_name,pp.`project_name`,dic.`dict_label` souce_name
|
||||
from attendance_ubi_device ud
|
||||
left join sys_dept dp on ud.`com_id`=dp.`dept_id`
|
||||
left join pro_project_info pp on ud.`project_id`=pp.`id`
|
||||
left join sys_dict_data dic on ud.`source`=dic.`dict_value` and dic.`dict_type`='ubi_device_source'
|
||||
</sql>
|
||||
|
||||
<select id="selectAttendanceUbiDeviceList" parameterType="AttendanceUbiDevice" resultMap="AttendanceUbiDeviceResult">
|
||||
<include refid="selectAttendanceUbiDeviceVo"/>
|
||||
<where>
|
||||
<if test="comId != null "> and com_id = #{comId}</if>
|
||||
<if test="projectId != null "> and project_id = #{projectId}</if>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
<if test="tag != null and tag != ''"> and tag = #{tag}</if>
|
||||
<if test="sceneGuid != null and sceneGuid != ''"> and scene_guid = #{sceneGuid}</if>
|
||||
<if test="source != null and source != ''"> and source = #{source}</if>
|
||||
<if test="deviceNo != null and deviceNo != ''"> and device_no = #{deviceNo}</if>
|
||||
<if test="addition != null and addition != ''"> and addition = #{addition}</if>
|
||||
<if test="bindDefaultScene != null "> and bind_default_scene = #{bindDefaultScene}</if>
|
||||
<if test="forceEmptyDevice != null "> and force_empty_device = #{forceEmptyDevice}</if>
|
||||
<if test="password != null and password != ''"> and password = #{password}</if>
|
||||
<if test="deviceModel != null and deviceModel != ''"> and device_model = #{deviceModel}</if>
|
||||
<if test="deviceState != null "> and device_state = #{deviceState}</if>
|
||||
<if test="recType != null "> and rec_type = #{recType}</if>
|
||||
<if test="onlineState != null "> and online_state = #{onlineState}</if>
|
||||
<if test="versionNo != null and versionNo != ''"> and version_no = #{versionNo}</if>
|
||||
<if test="lastActiveTime != null "> and last_active_time = #{lastActiveTime}</if>
|
||||
<if test="hasRegister != null "> and has_register = #{hasRegister}</if>
|
||||
<if test="state != null "> and state = #{state}</if>
|
||||
<if test="isDel != null "> and is_del = #{isDel}</if>
|
||||
<if test="comId != null "> and ud.com_id = #{comId}</if>
|
||||
<if test="projectId != null "> and ud.project_id = #{projectId}</if>
|
||||
<if test="name != null and name != ''"> and ud.name like concat('%', #{name}, '%')</if>
|
||||
<if test="tag != null and tag != ''"> and ud.tag = #{tag}</if>
|
||||
<if test="sceneGuid != null and sceneGuid != ''"> and ud.scene_guid = #{sceneGuid}</if>
|
||||
<if test="source != null and source != ''"> and ud.source = #{source}</if>
|
||||
<if test="deviceNo != null and deviceNo != ''"> and ud.device_no = #{deviceNo}</if>
|
||||
<if test="addition != null and addition != ''"> and ud.addition = #{addition}</if>
|
||||
<if test="bindDefaultScene != null "> and ud.bind_default_scene = #{bindDefaultScene}</if>
|
||||
<if test="forceEmptyDevice != null "> and ud.force_empty_device = #{forceEmptyDevice}</if>
|
||||
<if test="deviceModel != null and deviceModel != ''"> and ud.device_model = #{deviceModel}</if>
|
||||
<if test="deviceState != null "> and ud.device_state = #{deviceState}</if>
|
||||
<if test="recType != null "> and ud.rec_type = #{recType}</if>
|
||||
<if test="onlineState != null "> and ud.online_state = #{onlineState}</if>
|
||||
<if test="versionNo != null and versionNo != ''"> and ud.version_no = #{versionNo}</if>
|
||||
<if test="lastActiveTime != null "> and ud.last_active_time = #{lastActiveTime}</if>
|
||||
<if test="hasRegister != null "> and ud.has_register = #{hasRegister}</if>
|
||||
<if test="state != null "> and ud.state = #{state}</if>
|
||||
<if test="isDel != null "> and ud.is_del = #{isDel}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectAttendanceUbiDeviceById" parameterType="Long" resultMap="AttendanceUbiDeviceResult">
|
||||
<include refid="selectAttendanceUbiDeviceVo"/>
|
||||
where id = #{id}
|
||||
where ud.id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertAttendanceUbiDevice" parameterType="AttendanceUbiDevice">
|
||||
<insert id="insertAttendanceUbiDevice" parameterType="AttendanceUbiDevice" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into attendance_ubi_device
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
|
|
|
@ -0,0 +1,98 @@
|
|||
package com.yanzhu.manage.controller;
|
||||
|
||||
import com.yanzhu.common.core.utils.poi.ExcelUtil;
|
||||
import com.yanzhu.common.core.web.controller.BaseController;
|
||||
import com.yanzhu.common.core.web.domain.AjaxResult;
|
||||
import com.yanzhu.common.core.web.page.TableDataInfo;
|
||||
import com.yanzhu.common.log.annotation.Log;
|
||||
import com.yanzhu.common.log.enums.BusinessType;
|
||||
import com.yanzhu.common.security.annotation.RequiresPermissions;
|
||||
import com.yanzhu.manage.domain.AttendanceUbiData;
|
||||
import com.yanzhu.manage.service.IAttendanceUbiDataService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 考勤管理Controller
|
||||
*
|
||||
* @author yanzhu
|
||||
* @date 2024-10-12
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/attendanceUbiData")
|
||||
public class AttendanceUbiDataController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IAttendanceUbiDataService attendanceUbiDataService;
|
||||
|
||||
/**
|
||||
* 查询考勤管理列表
|
||||
*/
|
||||
@RequiresPermissions("manage:attendanceUbiData:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(AttendanceUbiData attendanceUbiData)
|
||||
{
|
||||
startPage();
|
||||
List<AttendanceUbiData> list = attendanceUbiDataService.selectAttendanceUbiDataList(attendanceUbiData);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出考勤管理列表
|
||||
*/
|
||||
@RequiresPermissions("manage:attendanceUbiData:export")
|
||||
@Log(title = "考勤管理", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, AttendanceUbiData attendanceUbiData)
|
||||
{
|
||||
List<AttendanceUbiData> list = attendanceUbiDataService.selectAttendanceUbiDataList(attendanceUbiData);
|
||||
ExcelUtil<AttendanceUbiData> util = new ExcelUtil<AttendanceUbiData>(AttendanceUbiData.class);
|
||||
util.exportExcel(response, list, "考勤管理数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取考勤管理详细信息
|
||||
*/
|
||||
@RequiresPermissions("manage:attendanceUbiData:query")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(attendanceUbiDataService.selectAttendanceUbiDataById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增考勤管理
|
||||
*/
|
||||
@RequiresPermissions("manage:attendanceUbiData:add")
|
||||
@Log(title = "考勤管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody AttendanceUbiData attendanceUbiData)
|
||||
{
|
||||
return toAjax(attendanceUbiDataService.insertAttendanceUbiData(attendanceUbiData));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改考勤管理
|
||||
*/
|
||||
@RequiresPermissions("manage:attendanceUbiData:edit")
|
||||
@Log(title = "考勤管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody AttendanceUbiData attendanceUbiData)
|
||||
{
|
||||
return toAjax(attendanceUbiDataService.updateAttendanceUbiData(attendanceUbiData));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除考勤管理
|
||||
*/
|
||||
@RequiresPermissions("manage:attendanceUbiData:remove")
|
||||
@Log(title = "考勤管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(attendanceUbiDataService.deleteAttendanceUbiDataByIds(ids));
|
||||
}
|
||||
}
|
|
@ -11,6 +11,7 @@ import com.yanzhu.manage.domain.AttendanceUbiDevice;
|
|||
import com.yanzhu.manage.domain.BusExamInfo;
|
||||
import com.yanzhu.manage.service.IAttendanceUbiDeviceService;
|
||||
import com.yanzhu.manage.service.IBusExamInfoService;
|
||||
import com.yanzhu.manage.service.IUniService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
|
@ -29,6 +30,8 @@ public class AttendanceUbiDeviceController extends BaseController
|
|||
@Autowired
|
||||
private IAttendanceUbiDeviceService attendanceUbiDeviceService;
|
||||
|
||||
@Autowired
|
||||
private IUniService uniService;
|
||||
/**
|
||||
* 查询宇泛的设备信息列表
|
||||
*/
|
||||
|
@ -72,6 +75,12 @@ public class AttendanceUbiDeviceController extends BaseController
|
|||
@PostMapping
|
||||
public AjaxResult add(@RequestBody AttendanceUbiDevice attendanceUbiDevice)
|
||||
{
|
||||
AttendanceUbiDevice where=new AttendanceUbiDevice();
|
||||
where.setDeviceNo(attendanceUbiDevice.getDeviceNo());
|
||||
List<AttendanceUbiDevice> list=attendanceUbiDeviceService.selectAttendanceUbiDeviceList(where);
|
||||
if(list.size()>0){
|
||||
return new AjaxResult(500,"此设备编号已存在!");
|
||||
}
|
||||
return toAjax(attendanceUbiDeviceService.insertAttendanceUbiDevice(attendanceUbiDevice));
|
||||
}
|
||||
|
||||
|
@ -83,6 +92,12 @@ public class AttendanceUbiDeviceController extends BaseController
|
|||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody AttendanceUbiDevice attendanceUbiDevice)
|
||||
{
|
||||
AttendanceUbiDevice where=new AttendanceUbiDevice();
|
||||
where.setDeviceNo(attendanceUbiDevice.getDeviceNo());
|
||||
List<AttendanceUbiDevice> list=attendanceUbiDeviceService.selectAttendanceUbiDeviceList(where);
|
||||
if(list.size()>1 || (list.size()==1 && !list.get(0).getId().equals(attendanceUbiDevice.getId()))){
|
||||
return new AjaxResult(500,"此设备编号已存在!");
|
||||
}
|
||||
return toAjax(attendanceUbiDeviceService.updateAttendanceUbiDevice(attendanceUbiDevice));
|
||||
}
|
||||
|
||||
|
@ -96,4 +111,16 @@ public class AttendanceUbiDeviceController extends BaseController
|
|||
{
|
||||
return toAjax(attendanceUbiDeviceService.deleteAttendanceUbiDeviceByIds(ids));
|
||||
}
|
||||
|
||||
@PostMapping("/auth")
|
||||
@RequiresPermissions("manage:attendance_ubi_device:add")
|
||||
@Log(title = "宇泛的设备授权", businessType = BusinessType.UPDATE)
|
||||
public AjaxResult auth(@RequestBody AttendanceUbiDevice attendanceUbiDevice){
|
||||
long ret= uniService.syncUniDeviceUser(attendanceUbiDevice.getId(),attendanceUbiDevice.getProjectId());
|
||||
if(ret==1){
|
||||
return AjaxResult.success();
|
||||
}else{
|
||||
return AjaxResult.error();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,76 @@
|
|||
package com.yanzhu.manage.controller;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.yanzhu.common.core.web.domain.AjaxResult;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/uni/callback")
|
||||
public class UniCallBackController {
|
||||
|
||||
/**
|
||||
* 识别回调
|
||||
* @param jo
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/recognize")
|
||||
public AjaxResult recognize(HttpServletRequest request){
|
||||
String data=request.getParameter("eventMsg");
|
||||
JSONObject json=JSONObject.parseObject(data);
|
||||
int type=json.getInteger("type");
|
||||
if(type==1){// 人员比对结果,1:比对成功 2:比对失败
|
||||
String eventGuid=request.getParameter("eventGuid");
|
||||
String admitGuid=json.getString("admitGuid");
|
||||
long projectId=Long.parseLong(json.getString("cardNo"));
|
||||
String deviceNo=json.getString("deviceNo");
|
||||
String filePath=json.getString("filePath");
|
||||
Date showTime=new Date(json.getLong("showTime"));
|
||||
|
||||
}
|
||||
return AjaxResult.success("--ok--");
|
||||
}
|
||||
|
||||
/**
|
||||
* 授权回调
|
||||
* @param jo
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/auth")
|
||||
public AjaxResult auth(@RequestBody JSONObject jo){
|
||||
return AjaxResult.success("--ok--");
|
||||
}
|
||||
|
||||
/**
|
||||
* 销权回调
|
||||
* @param jo
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/unauth")
|
||||
public AjaxResult unauth(@RequestBody JSONObject jo){
|
||||
return AjaxResult.success("--ok--");
|
||||
}
|
||||
|
||||
/**
|
||||
* 警报回调
|
||||
* @param jo
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/alarm")
|
||||
public AjaxResult alarm(@RequestBody JSONObject jo){
|
||||
return AjaxResult.success("--ok--");
|
||||
}
|
||||
|
||||
/**
|
||||
* 设备删除回调
|
||||
* @param jo
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/deviceDelete")
|
||||
public AjaxResult deviceDelete(@RequestBody JSONObject jo){
|
||||
return AjaxResult.success("--ok--");
|
||||
}
|
||||
}
|
|
@ -0,0 +1,61 @@
|
|||
package com.yanzhu.manage.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.yanzhu.manage.domain.AttendanceUbiData;
|
||||
|
||||
/**
|
||||
* 考勤管理Service接口
|
||||
*
|
||||
* @author yanzhu
|
||||
* @date 2024-10-12
|
||||
*/
|
||||
public interface IAttendanceUbiDataService
|
||||
{
|
||||
/**
|
||||
* 查询考勤管理
|
||||
*
|
||||
* @param id 考勤管理主键
|
||||
* @return 考勤管理
|
||||
*/
|
||||
public AttendanceUbiData selectAttendanceUbiDataById(Long id);
|
||||
|
||||
/**
|
||||
* 查询考勤管理列表
|
||||
*
|
||||
* @param attendanceUbiData 考勤管理
|
||||
* @return 考勤管理集合
|
||||
*/
|
||||
public List<AttendanceUbiData> selectAttendanceUbiDataList(AttendanceUbiData attendanceUbiData);
|
||||
|
||||
/**
|
||||
* 新增考勤管理
|
||||
*
|
||||
* @param attendanceUbiData 考勤管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertAttendanceUbiData(AttendanceUbiData attendanceUbiData);
|
||||
|
||||
/**
|
||||
* 修改考勤管理
|
||||
*
|
||||
* @param attendanceUbiData 考勤管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateAttendanceUbiData(AttendanceUbiData attendanceUbiData);
|
||||
|
||||
/**
|
||||
* 批量删除考勤管理
|
||||
*
|
||||
* @param ids 需要删除的考勤管理主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAttendanceUbiDataByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除考勤管理信息
|
||||
*
|
||||
* @param id 考勤管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAttendanceUbiDataById(Long id);
|
||||
}
|
|
@ -82,7 +82,7 @@ public interface IUniService {
|
|||
* @param data
|
||||
* @return
|
||||
*/
|
||||
public JSONObject deviceCreate(JSONObject data);
|
||||
public String deviceCreate(JSONObject data);
|
||||
|
||||
/**
|
||||
* 设备接口-设备更新
|
||||
|
@ -110,7 +110,7 @@ public interface IUniService {
|
|||
* @param data
|
||||
* @return
|
||||
*/
|
||||
public JSONObject authDevice(JSONObject data);
|
||||
public String authDevice(JSONObject data);
|
||||
|
||||
/**
|
||||
* 授权接口-设备修改识别主体权限
|
||||
|
@ -134,4 +134,20 @@ public interface IUniService {
|
|||
* @param projectId
|
||||
*/
|
||||
public Long syncUniUser(Long userId, Long projectId);
|
||||
|
||||
/**
|
||||
* 同步宇泛的设备信息
|
||||
* @param deviceId
|
||||
* @param projectId
|
||||
* @return
|
||||
*/
|
||||
public Long syncUniDevice(Long deviceId,Long projectId);
|
||||
|
||||
/**
|
||||
* 同步设备和主体
|
||||
* @param deviceId
|
||||
* @param projectId
|
||||
* @return
|
||||
*/
|
||||
public Long syncUniDeviceUser(Long deviceId,Long projectId);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,100 @@
|
|||
package com.yanzhu.manage.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.yanzhu.common.core.context.SecurityContextHolder;
|
||||
import com.yanzhu.common.core.utils.DateUtils;
|
||||
import com.yanzhu.manage.domain.AttendanceUbiData;
|
||||
import com.yanzhu.manage.mapper.AttendanceUbiDataMapper;
|
||||
import com.yanzhu.manage.service.IAttendanceUbiDataService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 考勤管理Service业务层处理
|
||||
*
|
||||
* @author yanzhu
|
||||
* @date 2024-10-12
|
||||
*/
|
||||
@Service
|
||||
public class AttendanceUbiDataServiceImpl implements IAttendanceUbiDataService
|
||||
{
|
||||
@Autowired
|
||||
private AttendanceUbiDataMapper attendanceUbiDataMapper;
|
||||
|
||||
/**
|
||||
* 查询考勤管理
|
||||
*
|
||||
* @param id 考勤管理主键
|
||||
* @return 考勤管理
|
||||
*/
|
||||
@Override
|
||||
public AttendanceUbiData selectAttendanceUbiDataById(Long id)
|
||||
{
|
||||
return attendanceUbiDataMapper.selectAttendanceUbiDataById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询考勤管理列表
|
||||
*
|
||||
* @param attendanceUbiData 考勤管理
|
||||
* @return 考勤管理
|
||||
*/
|
||||
@Override
|
||||
public List<AttendanceUbiData> selectAttendanceUbiDataList(AttendanceUbiData attendanceUbiData)
|
||||
{
|
||||
return attendanceUbiDataMapper.selectAttendanceUbiDataList(attendanceUbiData);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增考勤管理
|
||||
*
|
||||
* @param attendanceUbiData 考勤管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertAttendanceUbiData(AttendanceUbiData attendanceUbiData)
|
||||
{
|
||||
attendanceUbiData.setCreateBy(SecurityContextHolder.getUserName());
|
||||
attendanceUbiData.setCreateTime(DateUtils.getNowDate());
|
||||
return attendanceUbiDataMapper.insertAttendanceUbiData(attendanceUbiData);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改考勤管理
|
||||
*
|
||||
* @param attendanceUbiData 考勤管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateAttendanceUbiData(AttendanceUbiData attendanceUbiData)
|
||||
{
|
||||
attendanceUbiData.setUpdateBy(SecurityContextHolder.getUserName());
|
||||
attendanceUbiData.setUpdateTime(DateUtils.getNowDate());
|
||||
return attendanceUbiDataMapper.updateAttendanceUbiData(attendanceUbiData);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除考勤管理
|
||||
*
|
||||
* @param ids 需要删除的考勤管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteAttendanceUbiDataByIds(Long[] ids)
|
||||
{
|
||||
return attendanceUbiDataMapper.deleteAttendanceUbiDataByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除考勤管理信息
|
||||
*
|
||||
* @param id 考勤管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteAttendanceUbiDataById(Long id)
|
||||
{
|
||||
return attendanceUbiDataMapper.deleteAttendanceUbiDataById(id);
|
||||
}
|
||||
}
|
|
@ -4,6 +4,7 @@ import java.util.List;
|
|||
|
||||
import com.yanzhu.common.core.context.SecurityContextHolder;
|
||||
import com.yanzhu.common.core.utils.DateUtils;
|
||||
import com.yanzhu.manage.service.IUniService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.yanzhu.manage.mapper.AttendanceUbiDeviceMapper;
|
||||
|
@ -22,6 +23,8 @@ public class AttendanceUbiDeviceServiceImpl implements IAttendanceUbiDeviceServi
|
|||
@Autowired
|
||||
private AttendanceUbiDeviceMapper attendanceUbiDeviceMapper;
|
||||
|
||||
@Autowired
|
||||
private IUniService uniService;
|
||||
/**
|
||||
* 查询宇泛的设备信息
|
||||
*
|
||||
|
@ -57,7 +60,10 @@ public class AttendanceUbiDeviceServiceImpl implements IAttendanceUbiDeviceServi
|
|||
{
|
||||
attendanceUbiDevice.setCreateBy(SecurityContextHolder.getUserName());
|
||||
attendanceUbiDevice.setCreateTime(DateUtils.getNowDate());
|
||||
return attendanceUbiDeviceMapper.insertAttendanceUbiDevice(attendanceUbiDevice);
|
||||
int data= attendanceUbiDeviceMapper.insertAttendanceUbiDevice(attendanceUbiDevice);
|
||||
uniService.syncUniDevice(attendanceUbiDevice.getId(),attendanceUbiDevice.getProjectId());
|
||||
uniService.syncUniDeviceUser(attendanceUbiDevice.getId(),attendanceUbiDevice.getProjectId());
|
||||
return data;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -71,7 +77,9 @@ public class AttendanceUbiDeviceServiceImpl implements IAttendanceUbiDeviceServi
|
|||
{
|
||||
attendanceUbiDevice.setUpdateBy(SecurityContextHolder.getUserName());
|
||||
attendanceUbiDevice.setUpdateTime(DateUtils.getNowDate());
|
||||
return attendanceUbiDeviceMapper.updateAttendanceUbiDevice(attendanceUbiDevice);
|
||||
int data= attendanceUbiDeviceMapper.updateAttendanceUbiDevice(attendanceUbiDevice);
|
||||
uniService.syncUniDevice(attendanceUbiDevice.getId(),attendanceUbiDevice.getProjectId());
|
||||
return data;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -10,8 +10,11 @@ import com.yanzhu.common.core.constant.SecurityConstants;
|
|||
import com.yanzhu.common.core.utils.StringUtils;
|
||||
import com.yanzhu.common.redis.service.RedisService;
|
||||
import com.yanzhu.manage.domain.AttendanceCfg;
|
||||
import com.yanzhu.manage.domain.AttendanceUbiDevice;
|
||||
import com.yanzhu.manage.domain.ProProjectInfoSubdeptsUsers;
|
||||
import com.yanzhu.manage.mapper.AttendanceCfgMapper;
|
||||
import com.yanzhu.manage.mapper.AttendanceUbiDeviceMapper;
|
||||
import com.yanzhu.manage.mapper.ProProjectInfoSubdeptsUsersMapper;
|
||||
import com.yanzhu.manage.service.IUniService;
|
||||
import com.yanzhu.manage.utils.UniUtils;
|
||||
import com.yanzhu.system.api.RemoteUserService;
|
||||
|
@ -24,10 +27,7 @@ import org.springframework.web.context.request.ServletRequestAttributes;
|
|||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
@Service
|
||||
|
@ -42,6 +42,11 @@ public class UniServiceImpl implements IUniService{
|
|||
@Autowired
|
||||
private RemoteUserService remoteUserService;
|
||||
|
||||
@Autowired
|
||||
private AttendanceUbiDeviceMapper attendanceUbiDeviceMapper;
|
||||
|
||||
@Autowired
|
||||
private ProProjectInfoSubdeptsUsersMapper proProjectInfoSubdeptsUsersMapper;
|
||||
private void clearAuthCache(long projectId){
|
||||
String cacheKey=CacheConstants.UNI_AUTH+projectId;
|
||||
redisService.deleteObject(cacheKey);
|
||||
|
@ -205,8 +210,23 @@ public class UniServiceImpl implements IUniService{
|
|||
}
|
||||
|
||||
@Override
|
||||
public JSONObject deviceCreate(JSONObject data) {
|
||||
return null;
|
||||
public String deviceCreate(JSONObject data) {
|
||||
long projectId=data.getLong("projectId");
|
||||
Request request=new Request.Builder()
|
||||
.url(UniUtils.DEVICECREATE)
|
||||
.post(UniUtils.toJsonBody(data))
|
||||
.headers(UniUtils.setHeaderParams(auth(projectId)))
|
||||
.build();
|
||||
String res=UniUtils.getResult(request);
|
||||
JSONObject jo=JSON.parseObject(res);
|
||||
if(jo.getLong("result").intValue()==1){
|
||||
return "success";
|
||||
}
|
||||
if("token is illegal".equals(jo.getString("msg"))){
|
||||
clearAuthCache(projectId);
|
||||
return deviceCreate(data);
|
||||
}
|
||||
return jo.getString("msg");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -221,12 +241,42 @@ public class UniServiceImpl implements IUniService{
|
|||
|
||||
@Override
|
||||
public JSONObject deviceDetail(JSONObject data) {
|
||||
long projectId=data.getLong("projectId");
|
||||
Request request=new Request.Builder()
|
||||
.url(UniUtils.DEVICEDETAIL)
|
||||
.post(UniUtils.toJsonBody(data))
|
||||
.headers(UniUtils.setHeaderParams(auth(projectId)))
|
||||
.build();
|
||||
String res=UniUtils.getResult(request);
|
||||
JSONObject jo=JSON.parseObject(res);
|
||||
if(jo.getLong("result").intValue()==1){
|
||||
return jo.getJSONObject("data");
|
||||
}
|
||||
if("token is illegal".equals(jo.getString("msg"))){
|
||||
clearAuthCache(projectId);
|
||||
return deviceDetail(data);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject authDevice(JSONObject data) {
|
||||
return null;
|
||||
public String authDevice(JSONObject data) {
|
||||
long projectId=data.getLong("projectId");
|
||||
Request request=new Request.Builder()
|
||||
.url(UniUtils.AUTHDEVICE)
|
||||
.post(UniUtils.toJsonBody(data))
|
||||
.headers(UniUtils.setHeaderParams(auth(projectId)))
|
||||
.build();
|
||||
String res=UniUtils.getResult(request);
|
||||
JSONObject jo=JSON.parseObject(res);
|
||||
if(jo.getLong("result").intValue()==1){
|
||||
return "success";
|
||||
}
|
||||
if("token is illegal".equals(jo.getString("msg"))){
|
||||
clearAuthCache(projectId);
|
||||
return deviceCreate(data);
|
||||
}
|
||||
return jo.getString("msg");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -238,7 +288,65 @@ public class UniServiceImpl implements IUniService{
|
|||
public JSONObject authDeviceRevoke(JSONObject data) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long syncUniDeviceUser(Long deviceId,Long projectId){
|
||||
AttendanceUbiDevice device=attendanceUbiDeviceMapper.selectAttendanceUbiDeviceById(deviceId);
|
||||
ProProjectInfoSubdeptsUsers userWhere=new ProProjectInfoSubdeptsUsers();
|
||||
userWhere.setProjectId(projectId);
|
||||
List<ProProjectInfoSubdeptsUsers> userList=proProjectInfoSubdeptsUsersMapper.selectProProjectInfoSubdeptsUsersList(userWhere);
|
||||
JSONObject jo=new JSONObject();
|
||||
jo.put("projectId",projectId);
|
||||
jo.put("deviceNo",device.getDeviceNo());
|
||||
List<String> admitGuidList=new ArrayList<>();
|
||||
for(ProProjectInfoSubdeptsUsers u :userList){
|
||||
JSONObject json=JSON.parseObject(u.getUser().getUserInfos());
|
||||
String admitGuid=json.getString("admitGuid");
|
||||
if(StringUtils.isNotEmpty(admitGuid)){
|
||||
admitGuidList.add(admitGuid);
|
||||
}
|
||||
}
|
||||
for(int i=0;i<admitGuidList.size();i+=50){
|
||||
String admitGuids="";
|
||||
for(int j=0;j<50 && j+i<admitGuidList.size();j++){
|
||||
admitGuids+=admitGuidList.get((i+j))+",";
|
||||
}
|
||||
if(admitGuids.length()>0){
|
||||
admitGuids=admitGuids.substring(0,admitGuids.length()-1);
|
||||
}
|
||||
jo.put("admitGuids",admitGuids);
|
||||
authDevice(jo);
|
||||
}
|
||||
return 1l;
|
||||
}
|
||||
@Override
|
||||
public Long syncUniDevice(Long deviceId,Long projectId){
|
||||
AttendanceUbiDevice device=attendanceUbiDeviceMapper.selectAttendanceUbiDeviceById(deviceId);
|
||||
if(device!=null){
|
||||
JSONObject jo=new JSONObject();
|
||||
jo.put("projectId",projectId);
|
||||
jo.put("name",device.getName());
|
||||
jo.put("tag",device.getTag());
|
||||
jo.put("source",device.getSource());
|
||||
jo.put("sceneGuid","");
|
||||
jo.put("deviceNo",device.getDeviceNo());
|
||||
jo.put("addition","{'recType':'1'}");
|
||||
String ret= deviceCreate(jo);
|
||||
if("success".equals(ret)||"device is occupied".equals(ret)){
|
||||
JSONObject joDetail=deviceDetail(jo);
|
||||
device.setHasRegister(1l);
|
||||
device.setLastActiveTime(new Date());
|
||||
device.setDeviceModel(joDetail.getString("deviceModel"));
|
||||
device.setDeviceState(joDetail.getLong("state"));
|
||||
device.setOnlineState(joDetail.getLong("onlineState"));
|
||||
device.setVersionNo(joDetail.getString("versionNo"));
|
||||
device.setAddition(joDetail.getString("addition"));
|
||||
device.setRecType(joDetail.getLong("recType"));
|
||||
attendanceUbiDeviceMapper.updateAttendanceUbiDevice(device);
|
||||
return 1l;
|
||||
}
|
||||
}
|
||||
return 0l;
|
||||
}
|
||||
@Override
|
||||
public Long syncUniUser(Long userId, Long projectId) {
|
||||
SysUser user=remoteUserService.getSysUserInfo(userId, SecurityConstants.INNER).getData();
|
||||
|
@ -250,7 +358,7 @@ public class UniServiceImpl implements IUniService{
|
|||
userJo.put("name",user.getUserName());
|
||||
userJo.put("phone",user.getPhonenumber());
|
||||
userJo.put("tag",user.getNickName());
|
||||
userJo.put("cardNo",user.getUserId());
|
||||
userJo.put("cardNo",user.getUserId()+","+projectId);
|
||||
userJo.put("idCardNo",user.getCardCode());
|
||||
userJo.put("password","123456");
|
||||
userJo.put("addition","");
|
||||
|
@ -276,8 +384,8 @@ public class UniServiceImpl implements IUniService{
|
|||
faceJo.put("projectId",projectId);
|
||||
faceJo.put("base64","");
|
||||
faceJo.put("admitGuid",admitGuid);
|
||||
//faceJo.put("url",user.getUserPicture());
|
||||
faceJo.put("url","https://uniubi-aiot.oss-cn-hangzhou.aliyuncs.com/detect/20241007/211204-71D9BCBE526C4F57B8D31ECAE03AEBFB");
|
||||
faceJo.put("url",user.getUserPicture());
|
||||
//faceJo.put("url","https://uniubi-aiot.oss-cn-hangzhou.aliyuncs.com/detect/20241007/211204-71D9BCBE526C4F57B8D31ECAE03AEBFB");
|
||||
faceJo.put("faceTag","");
|
||||
HttpServletRequest request =((ServletRequestAttributes)RequestContextHolder.currentRequestAttributes()).getRequest();
|
||||
String url= request.getRemoteAddr();
|
||||
|
@ -306,5 +414,4 @@ public class UniServiceImpl implements IUniService{
|
|||
return 0l;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remark" column="remark" />
|
||||
|
||||
<result property="admitGuid" column="admitGuid"/>
|
||||
<association property="dept" column="dept_id" javaType="SysDept" resultMap="deptResult" />
|
||||
<association property="comp" column="com_id" javaType="SysDept" resultMap="compResult" />
|
||||
<collection property="roles" javaType="java.util.List" resultMap="RoleResult" />
|
||||
|
@ -66,7 +66,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</resultMap>
|
||||
|
||||
<sql id="selectUserVo">
|
||||
select u.user_id, u.com_id, com.dept_name as com_name, u.dept_id, u.user_name, u.nick_name, u.user_type, u.card_type, u.card_code, u.user_picture, u.card_img_pos, u.card_img_inv, u.user_infos, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,
|
||||
select u.user_id, u.com_id, com.dept_name as com_name, u.dept_id, u.user_name, u.nick_name, u.user_type, u.card_type,
|
||||
u.admitGuid,
|
||||
u.card_code, u.user_picture, u.card_img_pos, u.card_img_inv, u.user_infos, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,
|
||||
d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.dept_short_name, d.dept_code, d.dept_type, d.order_num, d.leader, d.status as dept_status,
|
||||
r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status,com.dept_name com_dept_name
|
||||
from sys_user u
|
||||
|
@ -77,7 +79,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</sql>
|
||||
|
||||
<select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult">
|
||||
select u.user_id, u.com_id, u.dept_id, u.nick_name, u.user_name, u.user_type, u.card_type, u.card_code, u.user_picture, u.card_img_pos, u.card_img_inv, u.user_infos, u.email, u.avatar, u.phonenumber, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from sys_user u
|
||||
select u.user_id, u.com_id, u.dept_id, u.nick_name, u.user_name, u.user_type, u.card_type,
|
||||
u.admitGuid,
|
||||
u.card_code, u.user_picture, u.card_img_pos, u.card_img_inv, u.user_infos, u.email, u.avatar, u.phonenumber, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from sys_user u
|
||||
left join sys_dept d on u.dept_id = d.dept_id
|
||||
where u.del_flag = '0'
|
||||
<if test="userId != null and userId != 0">
|
||||
|
@ -86,6 +90,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="userName != null and userName != ''">
|
||||
AND u.user_name like concat('%', #{userName}, '%')
|
||||
</if>
|
||||
<if test="admitGuid != null and admitGuid != ''">
|
||||
AND u.admitGuid =#{admitGuid}
|
||||
</if>
|
||||
<if test="userName != null and userName != ''">
|
||||
AND u.user_name like concat('%', #{userName}, '%')
|
||||
</if>
|
||||
|
@ -115,7 +122,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</select>
|
||||
|
||||
<select id="selectAllocatedList" parameterType="SysUser" resultMap="SysUserResult">
|
||||
select distinct u.user_id, u.com_id, u.dept_id, u.user_name, u.nick_name, u.user_type, u.card_type, u.card_code, u.email, u.phonenumber, u.status, u.create_time
|
||||
select distinct u.user_id, u.com_id, u.dept_id, u.user_name, u.nick_name,u.admitGuid,
|
||||
u.user_type, u.card_type, u.card_code, u.email, u.phonenumber, u.status, u.create_time
|
||||
from sys_user u
|
||||
left join sys_dept d on u.dept_id = d.dept_id
|
||||
left join sys_user_role ur on u.user_id = ur.user_id
|
||||
|
@ -132,7 +140,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</select>
|
||||
|
||||
<select id="selectUnallocatedList" parameterType="SysUser" resultMap="SysUserResult">
|
||||
select distinct u.user_id, u.com_id, u.dept_id, u.user_name, u.nick_name, u.user_type, u.card_type, u.card_code, u.email, u.phonenumber, u.status, u.create_time
|
||||
select distinct u.user_id, u.com_id, u.dept_id, u.user_name, u.nick_name, u.user_type,u.admitGuid,
|
||||
u.card_type, u.card_code, u.email, u.phonenumber, u.status, u.create_time
|
||||
from sys_user u
|
||||
left join sys_dept d on u.dept_id = d.dept_id
|
||||
left join sys_user_role ur on u.user_id = ur.user_id
|
||||
|
@ -206,6 +215,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="phonenumber != null and phonenumber != ''">phonenumber,</if>
|
||||
<if test="sex != null and sex != ''">sex,</if>
|
||||
<if test="password != null and password != ''">password,</if>
|
||||
<if test="admitGuid != null and admitGuid != ''">admitGuid,</if>
|
||||
<if test="status != null and status != ''">status,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
<if test="remark != null and remark != ''">remark,</if>
|
||||
|
@ -228,6 +238,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="phonenumber != null and phonenumber != ''">#{phonenumber},</if>
|
||||
<if test="sex != null and sex != ''">#{sex},</if>
|
||||
<if test="password != null and password != ''">#{password},</if>
|
||||
<if test="admitGuid != null and admitGuid != ''">#{admitGuid},</if>
|
||||
<if test="status != null and status != ''">#{status},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
<if test="remark != null and remark != ''">#{remark},</if>
|
||||
|
@ -254,6 +265,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="sex != null and sex != ''">sex = #{sex},</if>
|
||||
<if test="avatar != null and avatar != ''">avatar = #{avatar},</if>
|
||||
<if test="password != null and password != ''">password = #{password},</if>
|
||||
<if test="admitGuid != null and admitGuid != ''">admitGuid = #{admitGuid},</if>
|
||||
<if test="status != null and status != ''">status = #{status},</if>
|
||||
<if test="loginIp != null and loginIp != ''">login_ip = #{loginIp},</if>
|
||||
<if test="loginDate != null">login_date = #{loginDate},</if>
|
||||
|
|
|
@ -0,0 +1,44 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询考勤管理列表
|
||||
export function listAttendanceUbiData(query) {
|
||||
return request({
|
||||
url: '/manage/attendanceUbiData/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询考勤管理详细
|
||||
export function getAttendanceUbiData(id) {
|
||||
return request({
|
||||
url: '/manage/attendanceUbiData/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增考勤管理
|
||||
export function addAttendanceUbiData(data) {
|
||||
return request({
|
||||
url: '/manage/attendanceUbiData',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改考勤管理
|
||||
export function updateAttendanceUbiData(data) {
|
||||
return request({
|
||||
url: '/manage/attendanceUbiData',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除考勤管理
|
||||
export function delAttendanceUbiData(id) {
|
||||
return request({
|
||||
url: '/manage/attendanceUbiData/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
|
@ -42,3 +42,13 @@ export function delAttendance_ubi_device(id) {
|
|||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 宇泛的设备人员信息同步
|
||||
export function authAttendance_ubi_device(data) {
|
||||
return request({
|
||||
url: '/manage/attendance_ubi_device/auth',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
|
|
@ -0,0 +1,417 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="公司ID" prop="comId">
|
||||
<el-input
|
||||
v-model="queryParams.comId"
|
||||
placeholder="请输入公司ID"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="项目ID" prop="projectId">
|
||||
<el-input
|
||||
v-model="queryParams.projectId"
|
||||
placeholder="请输入项目ID"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="用户ID" prop="userId">
|
||||
<el-input
|
||||
v-model="queryParams.userId"
|
||||
placeholder="请输入用户ID"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="${comment}" prop="userName">
|
||||
<el-input
|
||||
v-model="queryParams.userName"
|
||||
placeholder="请输入${comment}"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="班组编号(外键)" prop="subDeptGroup">
|
||||
<el-input
|
||||
v-model="queryParams.subDeptGroup"
|
||||
placeholder="请输入班组编号(外键)"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="班组名称" prop="subDeptGroupName">
|
||||
<el-input
|
||||
v-model="queryParams.subDeptGroupName"
|
||||
placeholder="请输入班组名称"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="工种岗位" prop="craftPost">
|
||||
<el-input
|
||||
v-model="queryParams.craftPost"
|
||||
placeholder="请输入工种岗位"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="进场时间" prop="inTime">
|
||||
<el-date-picker clearable
|
||||
v-model="queryParams.inTime"
|
||||
type="date"
|
||||
value-format="YYYY-MM-DD"
|
||||
placeholder="请选择进场时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="离场时间" prop="outTime">
|
||||
<el-date-picker clearable
|
||||
v-model="queryParams.outTime"
|
||||
type="date"
|
||||
value-format="YYYY-MM-DD"
|
||||
placeholder="请选择离场时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备NO" prop="deviceNo">
|
||||
<el-input
|
||||
v-model="queryParams.deviceNo"
|
||||
placeholder="请输入设备NO"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="${comment}" prop="isDel">
|
||||
<el-input
|
||||
v-model="queryParams.isDel"
|
||||
placeholder="请输入${comment}"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="${comment}" prop="state">
|
||||
<el-input
|
||||
v-model="queryParams.state"
|
||||
placeholder="请输入${comment}"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="Plus"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['manage:attendanceUbiData:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="Edit"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['manage:attendanceUbiData:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="Delete"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['manage:attendanceUbiData:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="Download"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['manage:attendanceUbiData:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="attendanceUbiDataList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="${comment}" align="center" prop="id" />
|
||||
<el-table-column label="公司ID" align="center" prop="comId" />
|
||||
<el-table-column label="项目ID" align="center" prop="projectId" />
|
||||
<el-table-column label="用户ID" align="center" prop="userId" />
|
||||
<el-table-column label="${comment}" align="center" prop="userName" />
|
||||
<el-table-column label="班组编号(外键)" align="center" prop="subDeptGroup" />
|
||||
<el-table-column label="班组名称" align="center" prop="subDeptGroupName" />
|
||||
<el-table-column label="工种类型" align="center" prop="craftType" />
|
||||
<el-table-column label="工种岗位" align="center" prop="craftPost" />
|
||||
<el-table-column label="进场时间" align="center" prop="inTime" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.inTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="进场数据" align="center" prop="inData" />
|
||||
<el-table-column label="离场时间" align="center" prop="outTime" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.outTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="离场数据" align="center" prop="outData" />
|
||||
<el-table-column label="设备NO" align="center" prop="deviceNo" />
|
||||
<el-table-column label="${comment}" align="center" prop="isDel" />
|
||||
<el-table-column label="${comment}" align="center" prop="state" />
|
||||
<el-table-column label="${comment}" align="center" prop="remark" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['manage:attendanceUbiData:edit']">修改</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['manage:attendanceUbiData:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改考勤管理对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
||||
<el-form ref="attendanceUbiDataRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="公司ID" prop="comId">
|
||||
<el-input v-model="form.comId" placeholder="请输入公司ID" />
|
||||
</el-form-item>
|
||||
<el-form-item label="项目ID" prop="projectId">
|
||||
<el-input v-model="form.projectId" placeholder="请输入项目ID" />
|
||||
</el-form-item>
|
||||
<el-form-item label="用户ID" prop="userId">
|
||||
<el-input v-model="form.userId" placeholder="请输入用户ID" />
|
||||
</el-form-item>
|
||||
<el-form-item label="${comment}" prop="userName">
|
||||
<el-input v-model="form.userName" placeholder="请输入${comment}" />
|
||||
</el-form-item>
|
||||
<el-form-item label="班组编号(外键)" prop="subDeptGroup">
|
||||
<el-input v-model="form.subDeptGroup" placeholder="请输入班组编号(外键)" />
|
||||
</el-form-item>
|
||||
<el-form-item label="班组名称" prop="subDeptGroupName">
|
||||
<el-input v-model="form.subDeptGroupName" placeholder="请输入班组名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="工种岗位" prop="craftPost">
|
||||
<el-input v-model="form.craftPost" placeholder="请输入工种岗位" />
|
||||
</el-form-item>
|
||||
<el-form-item label="进场时间" prop="inTime">
|
||||
<el-date-picker clearable
|
||||
v-model="form.inTime"
|
||||
type="date"
|
||||
value-format="YYYY-MM-DD"
|
||||
placeholder="请选择进场时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="离场时间" prop="outTime">
|
||||
<el-date-picker clearable
|
||||
v-model="form.outTime"
|
||||
type="date"
|
||||
value-format="YYYY-MM-DD"
|
||||
placeholder="请选择离场时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备NO" prop="deviceNo">
|
||||
<el-input v-model="form.deviceNo" placeholder="请输入设备NO" />
|
||||
</el-form-item>
|
||||
<el-form-item label="${comment}" prop="isDel">
|
||||
<el-input v-model="form.isDel" placeholder="请输入${comment}" />
|
||||
</el-form-item>
|
||||
<el-form-item label="${comment}" prop="state">
|
||||
<el-input v-model="form.state" placeholder="请输入${comment}" />
|
||||
</el-form-item>
|
||||
<el-form-item label="${comment}" prop="remark">
|
||||
<el-input v-model="form.remark" placeholder="请输入${comment}" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="AttendanceUbiData">
|
||||
import { listAttendanceUbiData, getAttendanceUbiData, delAttendanceUbiData, addAttendanceUbiData, updateAttendanceUbiData } from "@/api/manage/attendanceUbiData";
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
|
||||
const attendanceUbiDataList = ref([]);
|
||||
const open = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const title = ref("");
|
||||
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
comId: null,
|
||||
projectId: null,
|
||||
userId: null,
|
||||
userName: null,
|
||||
subDeptGroup: null,
|
||||
subDeptGroupName: null,
|
||||
craftType: null,
|
||||
craftPost: null,
|
||||
inTime: null,
|
||||
inData: null,
|
||||
outTime: null,
|
||||
outData: null,
|
||||
deviceNo: null,
|
||||
isDel: null,
|
||||
state: null,
|
||||
},
|
||||
rules: {
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询考勤管理列表 */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
listAttendanceUbiData(queryParams.value).then(response => {
|
||||
attendanceUbiDataList.value = response.rows;
|
||||
total.value = response.total;
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
// 取消按钮
|
||||
function cancel() {
|
||||
open.value = false;
|
||||
reset();
|
||||
}
|
||||
|
||||
// 表单重置
|
||||
function reset() {
|
||||
form.value = {
|
||||
id: null,
|
||||
comId: null,
|
||||
projectId: null,
|
||||
userId: null,
|
||||
userName: null,
|
||||
subDeptGroup: null,
|
||||
subDeptGroupName: null,
|
||||
craftType: null,
|
||||
craftPost: null,
|
||||
inTime: null,
|
||||
inData: null,
|
||||
outTime: null,
|
||||
outData: null,
|
||||
deviceNo: null,
|
||||
isDel: null,
|
||||
state: null,
|
||||
remark: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null
|
||||
};
|
||||
proxy.resetForm("attendanceUbiDataRef");
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
proxy.resetForm("queryRef");
|
||||
handleQuery();
|
||||
}
|
||||
|
||||
// 多选框选中数据
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map(item => item.id);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
reset();
|
||||
open.value = true;
|
||||
title.value = "添加考勤管理";
|
||||
}
|
||||
|
||||
/** 修改按钮操作 */
|
||||
function handleUpdate(row) {
|
||||
reset();
|
||||
const _id = row.id || ids.value
|
||||
getAttendanceUbiData(_id).then(response => {
|
||||
form.value = response.data;
|
||||
open.value = true;
|
||||
title.value = "修改考勤管理";
|
||||
});
|
||||
}
|
||||
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
proxy.$refs["attendanceUbiDataRef"].validate(valid => {
|
||||
if (valid) {
|
||||
if (form.value.id != null) {
|
||||
updateAttendanceUbiData(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("修改成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
} else {
|
||||
addAttendanceUbiData(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("新增成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const _ids = row.id || ids.value;
|
||||
proxy.$modal.confirm('是否确认删除考勤管理编号为"' + _ids + '"的数据项?').then(function() {
|
||||
return delAttendanceUbiData(_ids);
|
||||
}).then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download('manage/attendanceUbiData/export', {
|
||||
...queryParams.value
|
||||
}, `attendanceUbiData_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
|
||||
getList();
|
||||
</script>
|
|
@ -1,11 +1,13 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="公司主键" prop="comId">
|
||||
<el-input v-model="queryParams.comId" placeholder="请输入公司主键" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="分包单位" prop="projectId">
|
||||
<el-input v-model="queryParams.projectId" placeholder="请输入分包单位" clearable @keyup.enter="handleQuery" />
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="90px">
|
||||
|
||||
<el-form-item label="项目" prop="projectId">
|
||||
<el-select :disabled="data.currentProId != ''" v-model="queryParams.projectId" placeholder="请选择项目" clearable
|
||||
@change="handleQuery">
|
||||
<el-option v-for="prj in data.projects" :key="prj.id" :label="prj.projectName" :value="prj.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备名称" prop="name">
|
||||
<el-input v-model="queryParams.name" placeholder="请输入设备名称" clearable @keyup.enter="handleQuery" />
|
||||
|
@ -13,54 +15,9 @@
|
|||
<el-form-item label="设备标签" prop="tag">
|
||||
<el-input v-model="queryParams.tag" placeholder="请输入设备标签" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="场景 Guid" prop="sceneGuid">
|
||||
<el-input v-model="queryParams.sceneGuid" placeholder="请输入场景 Guid" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="设备来源,字典ubi_device_source" prop="source">
|
||||
<el-input v-model="queryParams.source" placeholder="请输入设备来源,字典ubi_device_source" clearable
|
||||
@keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="设备序列号" prop="deviceNo">
|
||||
<el-input v-model="queryParams.deviceNo" placeholder="请输入设备序列号" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="是否绑定默认场景" prop="bindDefaultScene">
|
||||
<el-input v-model="queryParams.bindDefaultScene" placeholder="请输入是否绑定默认场景" clearable
|
||||
@keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="是否清空设备数据,默认为false" prop="forceEmptyDevice">
|
||||
<el-input v-model="queryParams.forceEmptyDevice" placeholder="请输入是否清空设备数据,默认为false" clearable
|
||||
@keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="当forceEmptyDevice为true,传入设备密码" prop="password">
|
||||
<el-input v-model="queryParams.password" placeholder="请输入当forceEmptyDevice为true,传入设备密码" clearable
|
||||
@keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="设备模式" prop="deviceModel">
|
||||
<el-input v-model="queryParams.deviceModel" placeholder="请输入设备模式" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="设备状态" prop="deviceState">
|
||||
<el-input v-model="queryParams.deviceState" placeholder="请输入设备状态" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="在线状态" prop="onlineState">
|
||||
<el-input v-model="queryParams.onlineState" placeholder="请输入在线状态" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="版本号" prop="versionNo">
|
||||
<el-input v-model="queryParams.versionNo" placeholder="请输入版本号" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="最后激活时间" prop="lastActiveTime">
|
||||
<el-date-picker clearable v-model="queryParams.lastActiveTime" type="date" value-format="YYYY-MM-DD"
|
||||
placeholder="请选择最后激活时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否已注册" prop="hasRegister">
|
||||
<el-input v-model="queryParams.hasRegister" placeholder="请输入是否已注册" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="state">
|
||||
<el-input v-model="queryParams.state" placeholder="请输入状态" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="${comment}" prop="isDel">
|
||||
<el-input v-model="queryParams.isDel" placeholder="请输入${comment}" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
|
@ -88,35 +45,49 @@
|
|||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="attendance_ubi_deviceList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="${comment}" align="center" prop="id" />
|
||||
<el-table-column label="公司主键" align="center" prop="comId" />
|
||||
<el-table-column label="分包单位" align="center" prop="projectId" />
|
||||
|
||||
<el-table-column label="公司" align="center" prop="compName" />
|
||||
<el-table-column label="所属项目" align="center" prop="projectName" />
|
||||
<el-table-column label="设备名称" align="center" prop="name" />
|
||||
<el-table-column label="设备标签" align="center" prop="tag" />
|
||||
<el-table-column label="场景 Guid" align="center" prop="sceneGuid" />
|
||||
<el-table-column label="设备来源,字典ubi_device_source" align="center" prop="source" />
|
||||
<el-table-column label="设备来源" align="center" prop="souceName" />
|
||||
<el-table-column label="设备序列号" align="center" prop="deviceNo" />
|
||||
<el-table-column label="扩展字段" align="center" prop="addition" />
|
||||
<el-table-column label="是否绑定默认场景" align="center" prop="bindDefaultScene" />
|
||||
<el-table-column label="是否清空设备数据,默认为false" align="center" prop="forceEmptyDevice" />
|
||||
<el-table-column label="当forceEmptyDevice为true,传入设备密码" align="center" prop="password" />
|
||||
<el-table-column label="设备模式" align="center" prop="deviceModel" />
|
||||
<el-table-column label="设备状态" align="center" prop="deviceState" />
|
||||
<el-table-column label="比对模式,1:本地识别 2:云端识别" align="center" prop="recType" />
|
||||
<el-table-column label="在线状态" align="center" prop="onlineState" />
|
||||
<el-table-column label="设备模式" align="center" prop="deviceModel" v-if="false" />
|
||||
<el-table-column label="设备状态" align="center" prop="deviceState">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.deviceState==1">未绑定</span>
|
||||
<span v-if="scope.row.deviceState==2">已绑定</span>
|
||||
<span v-if="scope.row.deviceState==3">已禁用</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="比对模式" align="center" prop="recType" >
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.recType==1">本地识别</span>
|
||||
<span v-if="scope.row.recType==2">云端识别</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="在线状态" align="center" prop="onlineState" >
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.onlineState==1">在线</span>
|
||||
<span v-if="scope.row.onlineState==2">离线</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="版本号" align="center" prop="versionNo" />
|
||||
<el-table-column label="最后激活时间" align="center" prop="lastActiveTime" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.lastActiveTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="是否已注册" align="center" prop="hasRegister" />
|
||||
<el-table-column label="状态" align="center" prop="state" />
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="${comment}" align="center" prop="isDel" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<el-table-column label="注册状态" align="center" prop="hasRegister" >
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.onlineState==1">已注册</span>
|
||||
<span v-else>未注册</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="150">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="ChromeFilled" @click="handleAuth(scope.row)"
|
||||
v-hasPermi="['manage:attendance_ubi_device:edit']">同步</el-button>
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['manage:attendance_ubi_device:edit']">修改</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)"
|
||||
|
@ -129,13 +100,11 @@
|
|||
@pagination="getList" />
|
||||
|
||||
<!-- 添加或修改宇泛的设备信息对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
||||
<el-form ref="attendance_ubi_deviceRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="公司主键" prop="comId">
|
||||
<el-input v-model="form.comId" placeholder="请输入公司主键" />
|
||||
</el-form-item>
|
||||
<el-form-item label="分包单位" prop="projectId">
|
||||
<el-input v-model="form.projectId" placeholder="请输入分包单位" />
|
||||
<el-dialog :title="title" v-model="open" width="600px" append-to-body :close-on-click-modal="false"
|
||||
:close-on-press-escape="false">
|
||||
<el-form ref="attendance_ubi_deviceRef" :model="form" :rules="rules" label-width="100px">
|
||||
<el-form-item label="所属项目">
|
||||
<el-tag effect="plain">{{ form.projectName }}</el-tag>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备名称" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入设备名称" />
|
||||
|
@ -143,56 +112,19 @@
|
|||
<el-form-item label="设备标签" prop="tag">
|
||||
<el-input v-model="form.tag" placeholder="请输入设备标签" />
|
||||
</el-form-item>
|
||||
<el-form-item label="场景 Guid" prop="sceneGuid">
|
||||
<el-input v-model="form.sceneGuid" placeholder="请输入场景 Guid" />
|
||||
</el-form-item>
|
||||
<el-form-item label="设备来源,字典ubi_device_source" prop="source">
|
||||
<el-input v-model="form.source" placeholder="请输入设备来源,字典ubi_device_source" />
|
||||
<el-form-item label="设备来源" prop="source">
|
||||
<el-select v-model="form.source" placeholder="请选择设备来源" clearable>
|
||||
<el-option
|
||||
v-for="dict in ubi_device_source"
|
||||
:key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备序列号" prop="deviceNo">
|
||||
<el-input v-model="form.deviceNo" placeholder="请输入设备序列号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="扩展字段" prop="addition">
|
||||
<el-input v-model="form.addition" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
<el-form-item label="是否绑定默认场景" prop="bindDefaultScene">
|
||||
<el-input v-model="form.bindDefaultScene" placeholder="请输入是否绑定默认场景" />
|
||||
</el-form-item>
|
||||
<el-form-item label="是否清空设备数据,默认为false" prop="forceEmptyDevice">
|
||||
<el-input v-model="form.forceEmptyDevice" placeholder="请输入是否清空设备数据,默认为false" />
|
||||
</el-form-item>
|
||||
<el-form-item label="当forceEmptyDevice为true,传入设备密码" prop="password">
|
||||
<el-input v-model="form.password" placeholder="请输入当forceEmptyDevice为true,传入设备密码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="设备模式" prop="deviceModel">
|
||||
<el-input v-model="form.deviceModel" placeholder="请输入设备模式" />
|
||||
</el-form-item>
|
||||
<el-form-item label="设备状态" prop="deviceState">
|
||||
<el-input v-model="form.deviceState" placeholder="请输入设备状态" />
|
||||
</el-form-item>
|
||||
<el-form-item label="在线状态" prop="onlineState">
|
||||
<el-input v-model="form.onlineState" placeholder="请输入在线状态" />
|
||||
</el-form-item>
|
||||
<el-form-item label="版本号" prop="versionNo">
|
||||
<el-input v-model="form.versionNo" placeholder="请输入版本号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="最后激活时间" prop="lastActiveTime">
|
||||
<el-date-picker clearable v-model="form.lastActiveTime" type="date" value-format="YYYY-MM-DD"
|
||||
placeholder="请选择最后激活时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否已注册" prop="hasRegister">
|
||||
<el-input v-model="form.hasRegister" placeholder="请输入是否已注册" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="state">
|
||||
<el-input v-model="form.state" placeholder="请输入状态" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
<el-form-item label="${comment}" prop="isDel">
|
||||
<el-input v-model="form.isDel" placeholder="请输入${comment}" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
|
@ -205,10 +137,12 @@
|
|||
</template>
|
||||
|
||||
<script setup name="Attendance_ubi_device">
|
||||
import { listAttendance_ubi_device, getAttendance_ubi_device, delAttendance_ubi_device, addAttendance_ubi_device, updateAttendance_ubi_device } from "@/api/manage/attendanceUbiDevice";
|
||||
|
||||
import { listAttendance_ubi_device, getAttendance_ubi_device, delAttendance_ubi_device, addAttendance_ubi_device, updateAttendance_ubi_device,authAttendance_ubi_device } from "@/api/manage/attendanceUbiDevice";
|
||||
import useUserStore from '@/store/modules/user'
|
||||
import { findMyProjectList } from "@/api/publics";
|
||||
const { proxy } = getCurrentInstance();
|
||||
|
||||
const userStore = useUserStore()
|
||||
const {ubi_device_source}=proxy.useDict('ubi_device_source');
|
||||
const attendance_ubi_deviceList = ref([]);
|
||||
const open = ref(false);
|
||||
const loading = ref(true);
|
||||
|
@ -246,10 +180,39 @@ const data = reactive({
|
|||
isDel: null,
|
||||
},
|
||||
rules: {
|
||||
}
|
||||
name: [{ required: true, trigger: ['blur', 'change'], message: "请输入设备名称" }],
|
||||
tag: [{ required: true, trigger: ['blur', 'change'], message: "请输入设备标签" }],
|
||||
source: [{ required: true, trigger: ['blur', 'change'], message: "请选择设备来源" }],
|
||||
deviceNo: [{ required: true, trigger: ['blur', 'change'], message: "请输入设备序列号" }],
|
||||
},
|
||||
projects: [],
|
||||
currentProId: '',
|
||||
mode:'',
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
/**
|
||||
* 设备人员同步
|
||||
*/
|
||||
function handleAuth(row){
|
||||
authAttendance_ubi_device(row).then(d=>{
|
||||
if(d.code==200){
|
||||
proxy.$modal.msgSuccess("同步成功!");
|
||||
}else{
|
||||
proxy.$modal.msgError("同步失败!");
|
||||
}
|
||||
});
|
||||
}
|
||||
/** 查询项目列表 */
|
||||
function getProjectList() {
|
||||
findMyProjectList({ pageNum: 1, pageSize: 100 }).then(response => {
|
||||
data.projects = response.rows;
|
||||
if (userStore.currentProId) {
|
||||
queryParams.value.projectId = userStore.currentProId
|
||||
data.currentProId = userStore.currentProId;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** 查询宇泛的设备信息列表 */
|
||||
function getList() {
|
||||
|
@ -275,7 +238,7 @@ function reset() {
|
|||
projectId: null,
|
||||
name: null,
|
||||
tag: null,
|
||||
sceneGuid: null,
|
||||
sceneGuid: "",
|
||||
source: null,
|
||||
deviceNo: null,
|
||||
addition: null,
|
||||
|
@ -321,13 +284,24 @@ function handleSelectionChange(selection) {
|
|||
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
if (!userStore.currentProId) {
|
||||
proxy.$modal.msgWarning("请切换到项目数据!!!");
|
||||
return false;
|
||||
}
|
||||
reset();
|
||||
form.value.projectId = userStore.currentProId;
|
||||
form.value.projectName = userStore.currentProName;
|
||||
form.value.source=ubi_device_source.value[0].value;
|
||||
open.value = true;
|
||||
title.value = "添加宇泛的设备信息";
|
||||
}
|
||||
|
||||
/** 修改按钮操作 */
|
||||
function handleUpdate(row) {
|
||||
if (!userStore.currentProId) {
|
||||
proxy.$modal.msgWarning("请切换到项目数据!!!");
|
||||
return false;
|
||||
}
|
||||
reset();
|
||||
const _id = row.id || ids.value
|
||||
getAttendance_ubi_device(_id).then(response => {
|
||||
|
@ -341,6 +315,7 @@ function handleUpdate(row) {
|
|||
function submitForm() {
|
||||
proxy.$refs["attendance_ubi_deviceRef"].validate(valid => {
|
||||
if (valid) {
|
||||
form.value.comId=userStore.currentComId;
|
||||
if (form.value.id != null) {
|
||||
updateAttendance_ubi_device(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("修改成功");
|
||||
|
@ -377,4 +352,5 @@ function handleExport() {
|
|||
}
|
||||
|
||||
getList();
|
||||
getProjectList();
|
||||
</script>
|
||||
|
|
Loading…
Reference in New Issue