Merge branch 'dev_xd' of http://62.234.3.186:3000/jiangyq/YZProjectCloud into dev_xd
# Conflicts: # yanzhu-modules/yanzhu-manage/pom.xmldev_xd
commit
0811adc4a9
|
@ -61,6 +61,6 @@ public interface RemoteUserService
|
||||||
@PostMapping("/user/register")
|
@PostMapping("/user/register")
|
||||||
public R<Long> registerUserInfo(@RequestBody SysUser sysUser, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
public R<Long> registerUserInfo(@RequestBody SysUser sysUser, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
||||||
|
|
||||||
@PutMapping("/user/register")
|
@PutMapping("/user")
|
||||||
public R<Long> updateUserInfo(@RequestBody SysUser sysUser, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
public R<Long> updateUserInfo(@RequestBody SysUser sysUser, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
||||||
}
|
}
|
||||||
|
|
|
@ -105,6 +105,16 @@ public class SysUser extends BaseEntity
|
||||||
@Excel(name = "最后登录时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", type = Type.EXPORT)
|
@Excel(name = "最后登录时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", type = Type.EXPORT)
|
||||||
private Date loginDate;
|
private Date loginDate;
|
||||||
|
|
||||||
|
private String admitGuid;
|
||||||
|
|
||||||
|
public String getAdmitGuid() {
|
||||||
|
return admitGuid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAdmitGuid(String admitGuid) {
|
||||||
|
this.admitGuid = admitGuid;
|
||||||
|
}
|
||||||
|
|
||||||
/** 部门对象 */
|
/** 部门对象 */
|
||||||
@Excels({
|
@Excels({
|
||||||
@Excel(name = "部门名称", targetAttr = "deptName", type = Type.EXPORT),
|
@Excel(name = "部门名称", targetAttr = "deptName", type = Type.EXPORT),
|
||||||
|
|
|
@ -77,4 +77,6 @@ public class CacheConstants
|
||||||
* 项目管理 cache key
|
* 项目管理 cache key
|
||||||
*/
|
*/
|
||||||
public static final String PRO_PROJECT = "pro_project:";
|
public static final String PRO_PROJECT = "pro_project:";
|
||||||
|
|
||||||
|
public static final String UNI_AUTH = "pro_project_uni_auth3:";
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,167 @@
|
||||||
|
package com.yanzhu.manage.domain;
|
||||||
|
|
||||||
|
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;
|
||||||
|
/**
|
||||||
|
* 考勤配置对象 attendance_cfg
|
||||||
|
*
|
||||||
|
* @author yanzhu
|
||||||
|
* @date 2024-10-08
|
||||||
|
*/
|
||||||
|
public class AttendanceCfg extends BaseEntity
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** 主键 */
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/** 公司主键 */
|
||||||
|
@Excel(name = "公司主键")
|
||||||
|
private Long comId;
|
||||||
|
|
||||||
|
/** 分包单位 */
|
||||||
|
@Excel(name = "分包单位")
|
||||||
|
private Long projectId;
|
||||||
|
|
||||||
|
/** 厂商编号(参考字典attendance_vendors) */
|
||||||
|
@Excel(name = " 厂商编号(参考字典attendance_vendors)")
|
||||||
|
private String vendorsCode;
|
||||||
|
|
||||||
|
/** 厂商参数 */
|
||||||
|
@Excel(name = "厂商参数")
|
||||||
|
private String vendorsParameter;
|
||||||
|
|
||||||
|
/** 1-启用,0-停用 */
|
||||||
|
@Excel(name = "1-启用,0-停用")
|
||||||
|
private Long enabled;
|
||||||
|
|
||||||
|
/** 状态 */
|
||||||
|
@Excel(name = "状态")
|
||||||
|
private Long state;
|
||||||
|
|
||||||
|
/** $column.columnComment */
|
||||||
|
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||||
|
private Long isDel;
|
||||||
|
|
||||||
|
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 setVendorsCode(String vendorsCode)
|
||||||
|
{
|
||||||
|
this.vendorsCode = vendorsCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getVendorsCode()
|
||||||
|
{
|
||||||
|
return vendorsCode;
|
||||||
|
}
|
||||||
|
public void setVendorsParameter(String vendorsParameter)
|
||||||
|
{
|
||||||
|
this.vendorsParameter = vendorsParameter;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getVendorsParameter()
|
||||||
|
{
|
||||||
|
return vendorsParameter;
|
||||||
|
}
|
||||||
|
public void setEnabled(Long enabled)
|
||||||
|
{
|
||||||
|
this.enabled = enabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getEnabled()
|
||||||
|
{
|
||||||
|
return enabled;
|
||||||
|
}
|
||||||
|
public void setState(Long state)
|
||||||
|
{
|
||||||
|
this.state = state;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getState()
|
||||||
|
{
|
||||||
|
return state;
|
||||||
|
}
|
||||||
|
public void setIsDel(Long isDel)
|
||||||
|
{
|
||||||
|
this.isDel = isDel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getIsDel()
|
||||||
|
{
|
||||||
|
return isDel;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String compName;
|
||||||
|
private String projectName;
|
||||||
|
private String vendorsName;
|
||||||
|
public String getProjectName() {
|
||||||
|
return projectName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProjectName(String projectName) {
|
||||||
|
this.projectName = projectName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getVendorsName() {
|
||||||
|
return vendorsName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVendorsName(String vendorsName) {
|
||||||
|
this.vendorsName = vendorsName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCompName() {
|
||||||
|
return compName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCompName(String compName) {
|
||||||
|
this.compName = compName;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
.append("id", getId())
|
||||||
|
.append("comId", getComId())
|
||||||
|
.append("projectId", getProjectId())
|
||||||
|
.append("vendorsCode", getVendorsCode())
|
||||||
|
.append("vendorsParameter", getVendorsParameter())
|
||||||
|
.append("enabled", getEnabled())
|
||||||
|
.append("state", getState())
|
||||||
|
.append("remark", getRemark())
|
||||||
|
.append("isDel", getIsDel())
|
||||||
|
.append("createBy", getCreateBy())
|
||||||
|
.append("createTime", getCreateTime())
|
||||||
|
.append("updateBy", getUpdateBy())
|
||||||
|
.append("updateTime", getUpdateTime())
|
||||||
|
.toString();
|
||||||
|
}
|
||||||
|
}
|
|
@ -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();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,353 @@
|
||||||
|
package com.yanzhu.manage.domain;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
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;
|
||||||
|
/**
|
||||||
|
* 宇泛的设备信息对象 attendance_ubi_device
|
||||||
|
*
|
||||||
|
* @author yanzhu
|
||||||
|
* @date 2024-10-08
|
||||||
|
*/
|
||||||
|
public class AttendanceUbiDevice extends BaseEntity
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** $column.columnComment */
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/** 公司主键 */
|
||||||
|
@Excel(name = "公司主键")
|
||||||
|
private Long comId;
|
||||||
|
|
||||||
|
/** 分包单位 */
|
||||||
|
@Excel(name = "分包单位")
|
||||||
|
private Long projectId;
|
||||||
|
|
||||||
|
/** 设备名称 */
|
||||||
|
@Excel(name = "设备名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/** 设备标签 */
|
||||||
|
@Excel(name = "设备标签")
|
||||||
|
private String tag;
|
||||||
|
|
||||||
|
/** 场景 Guid */
|
||||||
|
@Excel(name = "场景 Guid")
|
||||||
|
private String sceneGuid;
|
||||||
|
|
||||||
|
/** 设备来源,字典ubi_device_source */
|
||||||
|
@Excel(name = "设备来源,字典ubi_device_source")
|
||||||
|
private String source;
|
||||||
|
|
||||||
|
/** 设备序列号 */
|
||||||
|
@Excel(name = "设备序列号")
|
||||||
|
private String deviceNo;
|
||||||
|
|
||||||
|
/** 扩展字段(uface 设备(recType 设备的识别方式, 默认为 1) */
|
||||||
|
@Excel(name = "扩展字段", readConverterExp = "u=face,设=备(recType,设=备的识别方式,,默=认为,1=")
|
||||||
|
private String addition;
|
||||||
|
|
||||||
|
/** 是否绑定默认场景(场景 Guid 为空此字段生效) */
|
||||||
|
@Excel(name = "是否绑定默认场景", readConverterExp = "场=景,G=uid,为=空此字段生效")
|
||||||
|
private Integer bindDefaultScene;
|
||||||
|
|
||||||
|
/** 是否清空设备数据,默认为false */
|
||||||
|
@Excel(name = "是否清空设备数据,默认为false")
|
||||||
|
private Integer forceEmptyDevice;
|
||||||
|
|
||||||
|
/** 当forceEmptyDevice为true,传入设备密码 */
|
||||||
|
@Excel(name = "当forceEmptyDevice为true,传入设备密码")
|
||||||
|
private String password;
|
||||||
|
|
||||||
|
/** 设备模式 */
|
||||||
|
@Excel(name = "设备模式")
|
||||||
|
private String deviceModel;
|
||||||
|
|
||||||
|
/** 设备状态 */
|
||||||
|
@Excel(name = "设备状态")
|
||||||
|
private Long deviceState;
|
||||||
|
|
||||||
|
/** 比对模式,1:本地识别 2:云端识别 */
|
||||||
|
@Excel(name = "比对模式,1:本地识别 2:云端识别")
|
||||||
|
private Long recType;
|
||||||
|
|
||||||
|
/** 在线状态 */
|
||||||
|
@Excel(name = "在线状态")
|
||||||
|
private Long onlineState;
|
||||||
|
|
||||||
|
/** 版本号 */
|
||||||
|
@Excel(name = "版本号")
|
||||||
|
private String versionNo;
|
||||||
|
|
||||||
|
/** 最后激活时间 */
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@Excel(name = "最后激活时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||||
|
private Date lastActiveTime;
|
||||||
|
|
||||||
|
/** 是否已注册 */
|
||||||
|
@Excel(name = "是否已注册")
|
||||||
|
private Long hasRegister;
|
||||||
|
|
||||||
|
/** 状态 */
|
||||||
|
@Excel(name = "状态")
|
||||||
|
private Long state;
|
||||||
|
|
||||||
|
/** $column.columnComment */
|
||||||
|
@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;
|
||||||
|
}
|
||||||
|
|
||||||
|
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 setName(String name)
|
||||||
|
{
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName()
|
||||||
|
{
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
public void setTag(String tag)
|
||||||
|
{
|
||||||
|
this.tag = tag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTag()
|
||||||
|
{
|
||||||
|
return tag;
|
||||||
|
}
|
||||||
|
public void setSceneGuid(String sceneGuid)
|
||||||
|
{
|
||||||
|
this.sceneGuid = sceneGuid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSceneGuid()
|
||||||
|
{
|
||||||
|
return sceneGuid;
|
||||||
|
}
|
||||||
|
public void setSource(String source)
|
||||||
|
{
|
||||||
|
this.source = source;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSource()
|
||||||
|
{
|
||||||
|
return source;
|
||||||
|
}
|
||||||
|
public void setDeviceNo(String deviceNo)
|
||||||
|
{
|
||||||
|
this.deviceNo = deviceNo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDeviceNo()
|
||||||
|
{
|
||||||
|
return deviceNo;
|
||||||
|
}
|
||||||
|
public void setAddition(String addition)
|
||||||
|
{
|
||||||
|
this.addition = addition;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAddition()
|
||||||
|
{
|
||||||
|
return addition;
|
||||||
|
}
|
||||||
|
public void setBindDefaultScene(Integer bindDefaultScene)
|
||||||
|
{
|
||||||
|
this.bindDefaultScene = bindDefaultScene;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getBindDefaultScene()
|
||||||
|
{
|
||||||
|
return bindDefaultScene;
|
||||||
|
}
|
||||||
|
public void setForceEmptyDevice(Integer forceEmptyDevice)
|
||||||
|
{
|
||||||
|
this.forceEmptyDevice = forceEmptyDevice;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getForceEmptyDevice()
|
||||||
|
{
|
||||||
|
return forceEmptyDevice;
|
||||||
|
}
|
||||||
|
public void setPassword(String password)
|
||||||
|
{
|
||||||
|
this.password = password;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPassword()
|
||||||
|
{
|
||||||
|
return password;
|
||||||
|
}
|
||||||
|
public void setDeviceModel(String deviceModel)
|
||||||
|
{
|
||||||
|
this.deviceModel = deviceModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDeviceModel()
|
||||||
|
{
|
||||||
|
return deviceModel;
|
||||||
|
}
|
||||||
|
public void setDeviceState(Long deviceState)
|
||||||
|
{
|
||||||
|
this.deviceState = deviceState;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getDeviceState()
|
||||||
|
{
|
||||||
|
return deviceState;
|
||||||
|
}
|
||||||
|
public void setRecType(Long recType)
|
||||||
|
{
|
||||||
|
this.recType = recType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getRecType()
|
||||||
|
{
|
||||||
|
return recType;
|
||||||
|
}
|
||||||
|
public void setOnlineState(Long onlineState)
|
||||||
|
{
|
||||||
|
this.onlineState = onlineState;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getOnlineState()
|
||||||
|
{
|
||||||
|
return onlineState;
|
||||||
|
}
|
||||||
|
public void setVersionNo(String versionNo)
|
||||||
|
{
|
||||||
|
this.versionNo = versionNo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getVersionNo()
|
||||||
|
{
|
||||||
|
return versionNo;
|
||||||
|
}
|
||||||
|
public void setLastActiveTime(Date lastActiveTime)
|
||||||
|
{
|
||||||
|
this.lastActiveTime = lastActiveTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getLastActiveTime()
|
||||||
|
{
|
||||||
|
return lastActiveTime;
|
||||||
|
}
|
||||||
|
public void setHasRegister(Long hasRegister)
|
||||||
|
{
|
||||||
|
this.hasRegister = hasRegister;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getHasRegister()
|
||||||
|
{
|
||||||
|
return hasRegister;
|
||||||
|
}
|
||||||
|
public void setState(Long state)
|
||||||
|
{
|
||||||
|
this.state = state;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getState()
|
||||||
|
{
|
||||||
|
return state;
|
||||||
|
}
|
||||||
|
public void setIsDel(Long isDel)
|
||||||
|
{
|
||||||
|
this.isDel = isDel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getIsDel()
|
||||||
|
{
|
||||||
|
return isDel;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
.append("id", getId())
|
||||||
|
.append("comId", getComId())
|
||||||
|
.append("projectId", getProjectId())
|
||||||
|
.append("name", getName())
|
||||||
|
.append("tag", getTag())
|
||||||
|
.append("sceneGuid", getSceneGuid())
|
||||||
|
.append("source", getSource())
|
||||||
|
.append("deviceNo", getDeviceNo())
|
||||||
|
.append("addition", getAddition())
|
||||||
|
.append("bindDefaultScene", getBindDefaultScene())
|
||||||
|
.append("forceEmptyDevice", getForceEmptyDevice())
|
||||||
|
.append("password", getPassword())
|
||||||
|
.append("deviceModel", getDeviceModel())
|
||||||
|
.append("deviceState", getDeviceState())
|
||||||
|
.append("recType", getRecType())
|
||||||
|
.append("onlineState", getOnlineState())
|
||||||
|
.append("versionNo", getVersionNo())
|
||||||
|
.append("lastActiveTime", getLastActiveTime())
|
||||||
|
.append("hasRegister", getHasRegister())
|
||||||
|
.append("state", getState())
|
||||||
|
.append("remark", getRemark())
|
||||||
|
.append("isDel", getIsDel())
|
||||||
|
.append("createBy", getCreateBy())
|
||||||
|
.append("createTime", getCreateTime())
|
||||||
|
.append("updateBy", getUpdateBy())
|
||||||
|
.append("updateTime", getUpdateTime())
|
||||||
|
.toString();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,61 @@
|
||||||
|
package com.yanzhu.manage.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.yanzhu.manage.domain.AttendanceCfg;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 考勤配置Mapper接口
|
||||||
|
*
|
||||||
|
* @author yanzhu
|
||||||
|
* @date 2024-10-08
|
||||||
|
*/
|
||||||
|
public interface AttendanceCfgMapper
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询考勤配置
|
||||||
|
*
|
||||||
|
* @param id 考勤配置主键
|
||||||
|
* @return 考勤配置
|
||||||
|
*/
|
||||||
|
public AttendanceCfg selectAttendanceCfgById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询考勤配置列表
|
||||||
|
*
|
||||||
|
* @param attendanceCfg 考勤配置
|
||||||
|
* @return 考勤配置集合
|
||||||
|
*/
|
||||||
|
public List<AttendanceCfg> selectAttendanceCfgList(AttendanceCfg attendanceCfg);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增考勤配置
|
||||||
|
*
|
||||||
|
* @param attendanceCfg 考勤配置
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertAttendanceCfg(AttendanceCfg attendanceCfg);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改考勤配置
|
||||||
|
*
|
||||||
|
* @param attendanceCfg 考勤配置
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateAttendanceCfg(AttendanceCfg attendanceCfg);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除考勤配置
|
||||||
|
*
|
||||||
|
* @param id 考勤配置主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteAttendanceCfgById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除考勤配置
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteAttendanceCfgByIds(Long[] ids);
|
||||||
|
}
|
|
@ -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,61 @@
|
||||||
|
package com.yanzhu.manage.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.yanzhu.manage.domain.AttendanceUbiDevice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 宇泛的设备信息Mapper接口
|
||||||
|
*
|
||||||
|
* @author yanzhu
|
||||||
|
* @date 2024-10-08
|
||||||
|
*/
|
||||||
|
public interface AttendanceUbiDeviceMapper
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询宇泛的设备信息
|
||||||
|
*
|
||||||
|
* @param id 宇泛的设备信息主键
|
||||||
|
* @return 宇泛的设备信息
|
||||||
|
*/
|
||||||
|
public AttendanceUbiDevice selectAttendanceUbiDeviceById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询宇泛的设备信息列表
|
||||||
|
*
|
||||||
|
* @param attendanceUbiDevice 宇泛的设备信息
|
||||||
|
* @return 宇泛的设备信息集合
|
||||||
|
*/
|
||||||
|
public List<AttendanceUbiDevice> selectAttendanceUbiDeviceList(AttendanceUbiDevice attendanceUbiDevice);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增宇泛的设备信息
|
||||||
|
*
|
||||||
|
* @param attendanceUbiDevice 宇泛的设备信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertAttendanceUbiDevice(AttendanceUbiDevice attendanceUbiDevice);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改宇泛的设备信息
|
||||||
|
*
|
||||||
|
* @param attendanceUbiDevice 宇泛的设备信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateAttendanceUbiDevice(AttendanceUbiDevice attendanceUbiDevice);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除宇泛的设备信息
|
||||||
|
*
|
||||||
|
* @param id 宇泛的设备信息主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteAttendanceUbiDeviceById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除宇泛的设备信息
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteAttendanceUbiDeviceByIds(Long[] ids);
|
||||||
|
}
|
|
@ -0,0 +1,114 @@
|
||||||
|
<?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.AttendanceCfgMapper">
|
||||||
|
|
||||||
|
<resultMap type="AttendanceCfg" id="AttendanceCfgResult">
|
||||||
|
<result property="id" column="id" />
|
||||||
|
<result property="comId" column="com_id" />
|
||||||
|
<result property="projectId" column="project_id" />
|
||||||
|
<result property="vendorsCode" column="vendors_code" />
|
||||||
|
<result property="vendorsParameter" column="vendors_parameter" />
|
||||||
|
<result property="enabled" column="enabled" />
|
||||||
|
<result property="state" column="state" />
|
||||||
|
<result property="remark" column="remark" />
|
||||||
|
<result property="isDel" column="is_del" />
|
||||||
|
<result property="createBy" column="create_by" />
|
||||||
|
<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="vendorsName" column="vendors_name"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectAttendanceCfgVo">
|
||||||
|
SELECT ac.id, ac.com_id, ac.project_id, ac.vendors_code, ac.vendors_parameter, ac.enabled, ac.state, ac.remark, ac.is_del, ac.create_by, ac.create_time, ac.update_by
|
||||||
|
, ac.update_time,dp.`dept_name` comp_name,pp.`project_name`,dic.`dict_label` vendors_name
|
||||||
|
FROM attendance_cfg ac
|
||||||
|
LEFT JOIN sys_dept dp ON ac.`com_id`=dp.`dept_id`
|
||||||
|
LEFT JOIN pro_project_info pp ON ac.`project_id`=pp.`id`
|
||||||
|
LEFT JOIN sys_dict_data dic ON ac.`vendors_code`=dic.`dict_value` AND dic.`dict_type`='attendance_vendors'
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectAttendanceCfgList" parameterType="AttendanceCfg" resultMap="AttendanceCfgResult">
|
||||||
|
<include refid="selectAttendanceCfgVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="comId != null "> and ac.com_id = #{comId}</if>
|
||||||
|
<if test="projectId != null "> and ac.project_id = #{projectId}</if>
|
||||||
|
<if test="vendorsCode != null and vendorsCode != ''"> and ac.vendors_code = #{vendorsCode}</if>
|
||||||
|
<if test="vendorsParameter != null and vendorsParameter != ''"> and ac.vendors_parameter = #{vendorsParameter}</if>
|
||||||
|
<if test="enabled != null "> and ac.enabled = #{enabled}</if>
|
||||||
|
<if test="state != null "> and ac.state = #{state}</if>
|
||||||
|
<if test="isDel != null "> and ac.is_del = #{isDel}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectAttendanceCfgById" parameterType="Long" resultMap="AttendanceCfgResult">
|
||||||
|
<include refid="selectAttendanceCfgVo"/>
|
||||||
|
where ac.id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertAttendanceCfg" parameterType="AttendanceCfg" useGeneratedKeys="true" keyProperty="id">
|
||||||
|
insert into attendance_cfg
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="comId != null">com_id,</if>
|
||||||
|
<if test="projectId != null">project_id,</if>
|
||||||
|
<if test="vendorsCode != null">vendors_code,</if>
|
||||||
|
<if test="vendorsParameter != null">vendors_parameter,</if>
|
||||||
|
<if test="enabled != null">enabled,</if>
|
||||||
|
<if test="state != null">state,</if>
|
||||||
|
<if test="remark != null">remark,</if>
|
||||||
|
<if test="isDel != null">is_del,</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="vendorsCode != null">#{vendorsCode},</if>
|
||||||
|
<if test="vendorsParameter != null">#{vendorsParameter},</if>
|
||||||
|
<if test="enabled != null">#{enabled},</if>
|
||||||
|
<if test="state != null">#{state},</if>
|
||||||
|
<if test="remark != null">#{remark},</if>
|
||||||
|
<if test="isDel != null">#{isDel},</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="updateAttendanceCfg" parameterType="AttendanceCfg">
|
||||||
|
update attendance_cfg
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="comId != null">com_id = #{comId},</if>
|
||||||
|
<if test="projectId != null">project_id = #{projectId},</if>
|
||||||
|
<if test="vendorsCode != null">vendors_code = #{vendorsCode},</if>
|
||||||
|
<if test="vendorsParameter != null">vendors_parameter = #{vendorsParameter},</if>
|
||||||
|
<if test="enabled != null">enabled = #{enabled},</if>
|
||||||
|
<if test="state != null">state = #{state},</if>
|
||||||
|
<if test="remark != null">remark = #{remark},</if>
|
||||||
|
<if test="isDel != null">is_del = #{isDel},</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="deleteAttendanceCfgById" parameterType="Long">
|
||||||
|
delete from attendance_cfg where id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteAttendanceCfgByIds" parameterType="String">
|
||||||
|
delete from attendance_cfg where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
</mapper>
|
|
@ -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>
|
|
@ -0,0 +1,181 @@
|
||||||
|
<?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.AttendanceUbiDeviceMapper">
|
||||||
|
|
||||||
|
<resultMap type="AttendanceUbiDevice" id="AttendanceUbiDeviceResult">
|
||||||
|
<result property="id" column="id" />
|
||||||
|
<result property="comId" column="com_id" />
|
||||||
|
<result property="projectId" column="project_id" />
|
||||||
|
<result property="name" column="name" />
|
||||||
|
<result property="tag" column="tag" />
|
||||||
|
<result property="sceneGuid" column="scene_guid" />
|
||||||
|
<result property="source" column="source" />
|
||||||
|
<result property="deviceNo" column="device_no" />
|
||||||
|
<result property="addition" column="addition" />
|
||||||
|
<result property="bindDefaultScene" column="bind_default_scene" />
|
||||||
|
<result property="forceEmptyDevice" column="force_empty_device" />
|
||||||
|
<result property="password" column="password" />
|
||||||
|
<result property="deviceModel" column="device_model" />
|
||||||
|
<result property="deviceState" column="device_state" />
|
||||||
|
<result property="recType" column="rec_type" />
|
||||||
|
<result property="onlineState" column="online_state" />
|
||||||
|
<result property="versionNo" column="version_no" />
|
||||||
|
<result property="lastActiveTime" column="last_active_time" />
|
||||||
|
<result property="hasRegister" column="has_register" />
|
||||||
|
<result property="state" column="state" />
|
||||||
|
<result property="remark" column="remark" />
|
||||||
|
<result property="isDel" column="is_del" />
|
||||||
|
<result property="createBy" column="create_by" />
|
||||||
|
<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 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 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 ud.id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertAttendanceUbiDevice" parameterType="AttendanceUbiDevice" useGeneratedKeys="true" keyProperty="id">
|
||||||
|
insert into attendance_ubi_device
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="id != null">id,</if>
|
||||||
|
<if test="comId != null">com_id,</if>
|
||||||
|
<if test="projectId != null">project_id,</if>
|
||||||
|
<if test="name != null">name,</if>
|
||||||
|
<if test="tag != null">tag,</if>
|
||||||
|
<if test="sceneGuid != null">scene_guid,</if>
|
||||||
|
<if test="source != null">source,</if>
|
||||||
|
<if test="deviceNo != null">device_no,</if>
|
||||||
|
<if test="addition != null">addition,</if>
|
||||||
|
<if test="bindDefaultScene != null">bind_default_scene,</if>
|
||||||
|
<if test="forceEmptyDevice != null">force_empty_device,</if>
|
||||||
|
<if test="password != null">password,</if>
|
||||||
|
<if test="deviceModel != null">device_model,</if>
|
||||||
|
<if test="deviceState != null">device_state,</if>
|
||||||
|
<if test="recType != null">rec_type,</if>
|
||||||
|
<if test="onlineState != null">online_state,</if>
|
||||||
|
<if test="versionNo != null">version_no,</if>
|
||||||
|
<if test="lastActiveTime != null">last_active_time,</if>
|
||||||
|
<if test="hasRegister != null">has_register,</if>
|
||||||
|
<if test="state != null">state,</if>
|
||||||
|
<if test="remark != null">remark,</if>
|
||||||
|
<if test="isDel != null">is_del,</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="id != null">#{id},</if>
|
||||||
|
<if test="comId != null">#{comId},</if>
|
||||||
|
<if test="projectId != null">#{projectId},</if>
|
||||||
|
<if test="name != null">#{name},</if>
|
||||||
|
<if test="tag != null">#{tag},</if>
|
||||||
|
<if test="sceneGuid != null">#{sceneGuid},</if>
|
||||||
|
<if test="source != null">#{source},</if>
|
||||||
|
<if test="deviceNo != null">#{deviceNo},</if>
|
||||||
|
<if test="addition != null">#{addition},</if>
|
||||||
|
<if test="bindDefaultScene != null">#{bindDefaultScene},</if>
|
||||||
|
<if test="forceEmptyDevice != null">#{forceEmptyDevice},</if>
|
||||||
|
<if test="password != null">#{password},</if>
|
||||||
|
<if test="deviceModel != null">#{deviceModel},</if>
|
||||||
|
<if test="deviceState != null">#{deviceState},</if>
|
||||||
|
<if test="recType != null">#{recType},</if>
|
||||||
|
<if test="onlineState != null">#{onlineState},</if>
|
||||||
|
<if test="versionNo != null">#{versionNo},</if>
|
||||||
|
<if test="lastActiveTime != null">#{lastActiveTime},</if>
|
||||||
|
<if test="hasRegister != null">#{hasRegister},</if>
|
||||||
|
<if test="state != null">#{state},</if>
|
||||||
|
<if test="remark != null">#{remark},</if>
|
||||||
|
<if test="isDel != null">#{isDel},</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="updateAttendanceUbiDevice" parameterType="AttendanceUbiDevice">
|
||||||
|
update attendance_ubi_device
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="comId != null">com_id = #{comId},</if>
|
||||||
|
<if test="projectId != null">project_id = #{projectId},</if>
|
||||||
|
<if test="name != null">name = #{name},</if>
|
||||||
|
<if test="tag != null">tag = #{tag},</if>
|
||||||
|
<if test="sceneGuid != null">scene_guid = #{sceneGuid},</if>
|
||||||
|
<if test="source != null">source = #{source},</if>
|
||||||
|
<if test="deviceNo != null">device_no = #{deviceNo},</if>
|
||||||
|
<if test="addition != null">addition = #{addition},</if>
|
||||||
|
<if test="bindDefaultScene != null">bind_default_scene = #{bindDefaultScene},</if>
|
||||||
|
<if test="forceEmptyDevice != null">force_empty_device = #{forceEmptyDevice},</if>
|
||||||
|
<if test="password != null">password = #{password},</if>
|
||||||
|
<if test="deviceModel != null">device_model = #{deviceModel},</if>
|
||||||
|
<if test="deviceState != null">device_state = #{deviceState},</if>
|
||||||
|
<if test="recType != null">rec_type = #{recType},</if>
|
||||||
|
<if test="onlineState != null">online_state = #{onlineState},</if>
|
||||||
|
<if test="versionNo != null">version_no = #{versionNo},</if>
|
||||||
|
<if test="lastActiveTime != null">last_active_time = #{lastActiveTime},</if>
|
||||||
|
<if test="hasRegister != null">has_register = #{hasRegister},</if>
|
||||||
|
<if test="state != null">state = #{state},</if>
|
||||||
|
<if test="remark != null">remark = #{remark},</if>
|
||||||
|
<if test="isDel != null">is_del = #{isDel},</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="deleteAttendanceUbiDeviceById" parameterType="Long">
|
||||||
|
delete from attendance_ubi_device where id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteAttendanceUbiDeviceByIds" parameterType="String">
|
||||||
|
delete from attendance_ubi_device where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
</mapper>
|
|
@ -32,50 +32,71 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<result property="updateBy" column="update_by" />
|
<result property="updateBy" column="update_by" />
|
||||||
<result property="updateTime" column="update_time" />
|
<result property="updateTime" column="update_time" />
|
||||||
<result property="remark" column="remark" />
|
<result property="remark" column="remark" />
|
||||||
<association property="user" javaType="com.yanzhu.system.api.domain.SysUser" resultMap="com.yanzhu.system.mapper.SysUserMapper.SysUserResult"></association>
|
<association property="user" javaType="com.yanzhu.system.api.domain.SysUser" resultMap="ProSysUserResult"></association>
|
||||||
|
</resultMap>
|
||||||
|
<resultMap id="ProSysUserResult" type="com.yanzhu.system.api.domain.SysUser">
|
||||||
|
<result property="userName" column="user_name" />
|
||||||
|
<result property="nickName" column="nick_name" />
|
||||||
|
<result property="userType" column="user_type" />
|
||||||
|
<result property="cardType" column="card_type" />
|
||||||
|
<result property="cardCode" column="card_code" />
|
||||||
|
<result property="userPicture" column="user_picture" />
|
||||||
|
<result property="cardImgPos" column="card_img_pos" />
|
||||||
|
<result property="cardImgInv" column="card_img_inv" />
|
||||||
|
<result property="userInfos" column="user_infos" />
|
||||||
|
<result property="email" column="email" />
|
||||||
|
<result property="phonenumber" column="phonenumber" />
|
||||||
|
<result property="sex" column="sex" />
|
||||||
|
<result property="avatar" column="avatar" />
|
||||||
|
<result property="password" column="password" />
|
||||||
|
<result property="status" column="status" />
|
||||||
|
<result property="delFlag" column="del_flag" />
|
||||||
|
<result property="loginIp" column="login_ip" />
|
||||||
|
<result property="loginDate" column="login_date" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectProProjectInfoSubdeptsUsersVo">
|
<sql id="selectProProjectInfoSubdeptsUsersVo">
|
||||||
select pi.project_name,
|
SELECT pi.project_name, psu.id, psu.com_id, psu.project_id, psu.sub_dept_id, psu.sub_dept_type, psu.sub_dept_name, psu.user_id, psu.sub_dept_group,
|
||||||
psu.id, psu.com_id, psu.project_id, psu.sub_dept_id, psu.sub_dept_type, psu.sub_dept_name, psu.user_id,
|
psu.sub_dept_group_name, psu.craft_type, psu.craft_post, psu.edu_status, psu.edu_file_path, psu.edu_sign_path, psu.edu_date, psu.approve_status,
|
||||||
psu.sub_dept_group, psu.sub_dept_group_name, psu.craft_type, psu.craft_post, psu.edu_status,
|
psu.use_status, psu.sub_step, psu.illness_status, psu.sup_illness_status, psu.is_del, psu.create_by, psu.create_time, psu.update_by, psu.update_time,
|
||||||
psu.edu_file_path, psu.edu_sign_path, psu.edu_date, psu.approve_status, psu.use_status, psu.sub_step, psu.illness_status,
|
psu.remark,su.`user_name`,su.`nick_name`,su.`user_type`,su.`card_type`,su.`card_code`,
|
||||||
psu.sup_illness_status, psu.is_del, psu.create_by, psu.create_time, psu.update_by, psu.update_time, psu.remark
|
su.`user_picture`, su.`card_img_inv`,su.`card_img_pos`,su.`user_infos`,su.`email`,su.`phonenumber`,su.`sex`,su.`avatar`,su.`login_ip`,su.`login_date`
|
||||||
from pro_project_info_subdepts_users psu
|
FROM pro_project_info_subdepts_users psu
|
||||||
left join pro_project_info pi on pi.id = psu.project_id
|
LEFT JOIN sys_user su ON psu.user_id=su.user_id
|
||||||
left join sys_dept sd on sd.dept_id = pi.com_id
|
LEFT JOIN pro_project_info PI ON pi.id = psu.project_id
|
||||||
|
LEFT JOIN sys_dept sd ON sd.dept_id = pi.com_id
|
||||||
|
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectProProjectInfoSubdeptsUsersList" parameterType="ProProjectInfoSubdeptsUsers" resultMap="ProProjectInfoSubdeptsUsersResult">
|
<select id="selectProProjectInfoSubdeptsUsersList" parameterType="ProProjectInfoSubdeptsUsers" resultMap="ProProjectInfoSubdeptsUsersResult">
|
||||||
<include refid="selectProProjectInfoSubdeptsUsersVo"/>
|
<include refid="selectProProjectInfoSubdeptsUsersVo"/>
|
||||||
<where>
|
<where>
|
||||||
<if test="comId != null "> and com_id = #{comId}</if>
|
<if test="comId != null "> and psu.com_id = #{comId}</if>
|
||||||
<if test="projectId != null "> and project_id = #{projectId}</if>
|
<if test="projectId != null "> and psu.project_id = #{projectId}</if>
|
||||||
<if test="subDeptId != null "> and sub_dept_id = #{subDeptId}</if>
|
<if test="subDeptId != null "> and psu.sub_dept_id = #{subDeptId}</if>
|
||||||
<if test="subDeptType != null and subDeptType != ''"> and sub_dept_type = #{subDeptType}</if>
|
<if test="subDeptType != null and subDeptType != ''"> and psu.sub_dept_type = #{subDeptType}</if>
|
||||||
<if test="subDeptName != null and subDeptName != ''"> and sub_dept_name like concat('%', #{subDeptName}, '%')</if>
|
<if test="subDeptName != null and subDeptName != ''"> and psu.sub_dept_name like concat('%', #{subDeptName}, '%')</if>
|
||||||
<if test="userId != null "> and user_id = #{userId}</if>
|
<if test="userId != null "> and psu.user_id = #{userId}</if>
|
||||||
<if test="subDeptGroup != null "> and sub_dept_group = #{subDeptGroup}</if>
|
<if test="subDeptGroup != null "> and psu.sub_dept_group = #{subDeptGroup}</if>
|
||||||
<if test="subDeptGroupName != null and subDeptGroupName != ''"> and sub_dept_group_name like concat('%', #{subDeptGroupName}, '%')</if>
|
<if test="subDeptGroupName != null and subDeptGroupName != ''"> and psu.sub_dept_group_name like concat('%', #{subDeptGroupName}, '%')</if>
|
||||||
<if test="craftType != null and craftType != ''"> and craft_type = #{craftType}</if>
|
<if test="craftType != null and craftType != ''"> and psu.craft_type = #{craftType}</if>
|
||||||
<if test="craftPost != null and craftPost != ''"> and craft_post = #{craftPost}</if>
|
<if test="craftPost != null and craftPost != ''"> and psu.craft_post = #{craftPost}</if>
|
||||||
<if test="eduStatus != null and eduStatus != ''"> and edu_status = #{eduStatus}</if>
|
<if test="eduStatus != null and eduStatus != ''"> and psu.edu_status = #{eduStatus}</if>
|
||||||
<if test="eduFilePath != null and eduFilePath != ''"> and edu_file_path = #{eduFilePath}</if>
|
<if test="eduFilePath != null and eduFilePath != ''"> and psu.edu_file_path = #{eduFilePath}</if>
|
||||||
<if test="eduSignPath != null and eduSignPath != ''"> and edu_sign_path = #{eduSignPath}</if>
|
<if test="eduSignPath != null and eduSignPath != ''"> and psu.edu_sign_path = #{eduSignPath}</if>
|
||||||
<if test="eduDate != null "> and edu_date = #{eduDate}</if>
|
<if test="eduDate != null "> and psu.edu_date = #{eduDate}</if>
|
||||||
<if test="approveStatus != null "> and approve_status = #{approveStatus}</if>
|
<if test="approveStatus != null "> and psu.approve_status = #{approveStatus}</if>
|
||||||
<if test="useStatus != null and useStatus != ''"> and use_status = #{useStatus}</if>
|
<if test="useStatus != null and useStatus != ''"> and psu.use_status = #{useStatus}</if>
|
||||||
<if test="subStep != null "> and sub_step = #{subStep}</if>
|
<if test="subStep != null "> and psu.sub_step = #{subStep}</if>
|
||||||
<if test="illnessStatus != null "> and illness_status = #{illnessStatus}</if>
|
<if test="illnessStatus != null "> and psu.illness_status = #{illnessStatus}</if>
|
||||||
<if test="supIllnessStatus != null "> and sup_illness_status = #{supIllnessStatus}</if>
|
<if test="supIllnessStatus != null "> and psu.sup_illness_status = #{supIllnessStatus}</if>
|
||||||
<if test="isDel != null "> and is_del = #{isDel}</if>
|
<if test="isDel != null "> and psu.is_del = #{isDel}</if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
<select id="selectProProjectInfoSubdeptsUsersById" parameterType="Long" resultMap="ProProjectInfoSubdeptsUsersResult">
|
<select id="selectProProjectInfoSubdeptsUsersById" parameterType="Long" resultMap="ProProjectInfoSubdeptsUsersResult">
|
||||||
<include refid="selectProProjectInfoSubdeptsUsersVo"/>
|
<include refid="selectProProjectInfoSubdeptsUsersVo"/>
|
||||||
where id = #{id}
|
where psu.id = #{id}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<insert id="insertProProjectInfoSubdeptsUsers" parameterType="ProProjectInfoSubdeptsUsers" useGeneratedKeys="true" keyProperty="id">
|
<insert id="insertProProjectInfoSubdeptsUsers" parameterType="ProProjectInfoSubdeptsUsers" useGeneratedKeys="true" keyProperty="id">
|
||||||
|
|
|
@ -83,6 +83,12 @@
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.squareup.okhttp3</groupId>
|
||||||
|
<artifactId>okhttp</artifactId>
|
||||||
|
<version>4.9.3</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- YanZhu Common Swagger -->
|
<!-- YanZhu Common Swagger -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.yanzhu</groupId>
|
<groupId>com.yanzhu</groupId>
|
||||||
|
|
|
@ -0,0 +1,99 @@
|
||||||
|
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.AttendanceCfg;
|
||||||
|
import com.yanzhu.manage.domain.BusExamInfo;
|
||||||
|
import com.yanzhu.manage.service.IAttendanceCfgService;
|
||||||
|
import com.yanzhu.manage.service.IBusExamInfoService;
|
||||||
|
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-08
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/attendance_cfg")
|
||||||
|
public class AttendanceCfgController extends BaseController
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private IAttendanceCfgService attendanceCfgService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询考勤配置列表
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("manage:attendance_cfg:list")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(AttendanceCfg attendanceCfg)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<AttendanceCfg> list = attendanceCfgService.selectAttendanceCfgList(attendanceCfg);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出考勤配置列表
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("manage:attendance_cfg:export")
|
||||||
|
@Log(title = "考勤配置", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(HttpServletResponse response, AttendanceCfg attendanceCfg)
|
||||||
|
{
|
||||||
|
List<AttendanceCfg> list = attendanceCfgService.selectAttendanceCfgList(attendanceCfg);
|
||||||
|
ExcelUtil<AttendanceCfg> util = new ExcelUtil<AttendanceCfg>(AttendanceCfg.class);
|
||||||
|
util.exportExcel(response, list, "考勤配置数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取考勤配置详细信息
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("manage:attendance_cfg:query")
|
||||||
|
@GetMapping(value = "/{id}")
|
||||||
|
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||||
|
{
|
||||||
|
return success(attendanceCfgService.selectAttendanceCfgById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增考勤配置
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("manage:attendance_cfg:add")
|
||||||
|
@Log(title = "考勤配置", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public AjaxResult add(@RequestBody AttendanceCfg attendanceCfg)
|
||||||
|
{
|
||||||
|
return toAjax(attendanceCfgService.insertAttendanceCfg(attendanceCfg));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改考勤配置
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("manage:attendance_cfg:edit")
|
||||||
|
@Log(title = "考勤配置", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public AjaxResult edit(@RequestBody AttendanceCfg attendanceCfg)
|
||||||
|
{
|
||||||
|
return toAjax(attendanceCfgService.updateAttendanceCfg(attendanceCfg));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除考勤配置
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("manage:attendance_cfg:remove")
|
||||||
|
@Log(title = "考勤配置", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public AjaxResult remove(@PathVariable Long[] ids)
|
||||||
|
{
|
||||||
|
return toAjax(attendanceCfgService.deleteAttendanceCfgByIds(ids));
|
||||||
|
}
|
||||||
|
}
|
|
@ -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));
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,126 @@
|
||||||
|
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.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.*;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.util.List;
|
||||||
|
/**
|
||||||
|
* 宇泛的设备信息Controller
|
||||||
|
*
|
||||||
|
* @author yanzhu
|
||||||
|
* @date 2024-10-08
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/attendance_ubi_device")
|
||||||
|
public class AttendanceUbiDeviceController extends BaseController
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private IAttendanceUbiDeviceService attendanceUbiDeviceService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IUniService uniService;
|
||||||
|
/**
|
||||||
|
* 查询宇泛的设备信息列表
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("manage:attendance_ubi_device:list")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(AttendanceUbiDevice attendanceUbiDevice)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<AttendanceUbiDevice> list = attendanceUbiDeviceService.selectAttendanceUbiDeviceList(attendanceUbiDevice);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出宇泛的设备信息列表
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("manage:attendance_ubi_device:export")
|
||||||
|
@Log(title = "宇泛的设备信息", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(HttpServletResponse response, AttendanceUbiDevice attendanceUbiDevice)
|
||||||
|
{
|
||||||
|
List<AttendanceUbiDevice> list = attendanceUbiDeviceService.selectAttendanceUbiDeviceList(attendanceUbiDevice);
|
||||||
|
ExcelUtil<AttendanceUbiDevice> util = new ExcelUtil<AttendanceUbiDevice>(AttendanceUbiDevice.class);
|
||||||
|
util.exportExcel(response, list, "宇泛的设备信息数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取宇泛的设备信息详细信息
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("manage:attendance_ubi_device:query")
|
||||||
|
@GetMapping(value = "/{id}")
|
||||||
|
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||||
|
{
|
||||||
|
return success(attendanceUbiDeviceService.selectAttendanceUbiDeviceById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增宇泛的设备信息
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("manage:attendance_ubi_device:add")
|
||||||
|
@Log(title = "宇泛的设备信息", businessType = BusinessType.INSERT)
|
||||||
|
@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));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改宇泛的设备信息
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("manage:attendance_ubi_device:edit")
|
||||||
|
@Log(title = "宇泛的设备信息", businessType = BusinessType.UPDATE)
|
||||||
|
@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));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除宇泛的设备信息
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("manage:attendance_ubi_device:remove")
|
||||||
|
@Log(title = "宇泛的设备信息", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public AjaxResult remove(@PathVariable Long[] ids)
|
||||||
|
{
|
||||||
|
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.AttendanceCfg;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 考勤配置Service接口
|
||||||
|
*
|
||||||
|
* @author yanzhu
|
||||||
|
* @date 2024-10-08
|
||||||
|
*/
|
||||||
|
public interface IAttendanceCfgService
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询考勤配置
|
||||||
|
*
|
||||||
|
* @param id 考勤配置主键
|
||||||
|
* @return 考勤配置
|
||||||
|
*/
|
||||||
|
public AttendanceCfg selectAttendanceCfgById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询考勤配置列表
|
||||||
|
*
|
||||||
|
* @param attendanceCfg 考勤配置
|
||||||
|
* @return 考勤配置集合
|
||||||
|
*/
|
||||||
|
public List<AttendanceCfg> selectAttendanceCfgList(AttendanceCfg attendanceCfg);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增考勤配置
|
||||||
|
*
|
||||||
|
* @param attendanceCfg 考勤配置
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertAttendanceCfg(AttendanceCfg attendanceCfg);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改考勤配置
|
||||||
|
*
|
||||||
|
* @param attendanceCfg 考勤配置
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateAttendanceCfg(AttendanceCfg attendanceCfg);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除考勤配置
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的考勤配置主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteAttendanceCfgByIds(Long[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除考勤配置信息
|
||||||
|
*
|
||||||
|
* @param id 考勤配置主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteAttendanceCfgById(Long id);
|
||||||
|
}
|
|
@ -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);
|
||||||
|
}
|
|
@ -0,0 +1,61 @@
|
||||||
|
package com.yanzhu.manage.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.yanzhu.manage.domain.AttendanceUbiDevice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 宇泛的设备信息Service接口
|
||||||
|
*
|
||||||
|
* @author yanzhu
|
||||||
|
* @date 2024-10-08
|
||||||
|
*/
|
||||||
|
public interface IAttendanceUbiDeviceService
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询宇泛的设备信息
|
||||||
|
*
|
||||||
|
* @param id 宇泛的设备信息主键
|
||||||
|
* @return 宇泛的设备信息
|
||||||
|
*/
|
||||||
|
public AttendanceUbiDevice selectAttendanceUbiDeviceById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询宇泛的设备信息列表
|
||||||
|
*
|
||||||
|
* @param attendanceUbiDevice 宇泛的设备信息
|
||||||
|
* @return 宇泛的设备信息集合
|
||||||
|
*/
|
||||||
|
public List<AttendanceUbiDevice> selectAttendanceUbiDeviceList(AttendanceUbiDevice attendanceUbiDevice);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增宇泛的设备信息
|
||||||
|
*
|
||||||
|
* @param attendanceUbiDevice 宇泛的设备信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertAttendanceUbiDevice(AttendanceUbiDevice attendanceUbiDevice);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改宇泛的设备信息
|
||||||
|
*
|
||||||
|
* @param attendanceUbiDevice 宇泛的设备信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateAttendanceUbiDevice(AttendanceUbiDevice attendanceUbiDevice);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除宇泛的设备信息
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的宇泛的设备信息主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteAttendanceUbiDeviceByIds(Long[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除宇泛的设备信息信息
|
||||||
|
*
|
||||||
|
* @param id 宇泛的设备信息主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteAttendanceUbiDeviceById(Long id);
|
||||||
|
}
|
|
@ -58,4 +58,6 @@ public interface IProProjectInfoSubdeptsUsersService
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteProProjectInfoSubdeptsUsersById(Long id);
|
public int deleteProProjectInfoSubdeptsUsersById(Long id);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,153 @@
|
||||||
|
package com.yanzhu.manage.service;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson2.JSON;
|
||||||
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
|
import com.yanzhu.manage.domain.ProProjectInfoSubdeptsUsers;
|
||||||
|
|
||||||
|
import java.security.NoSuchAlgorithmException;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 宇泛服务封装
|
||||||
|
*/
|
||||||
|
public interface IUniService {
|
||||||
|
/**
|
||||||
|
* 鉴权接口
|
||||||
|
* @param data
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public Map<String,String> auth(long projectId) throws NoSuchAlgorithmException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 人员接口-识别主体创建
|
||||||
|
* @param data
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public String admitCreate(JSONObject data);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 人员接口-识别主体更新
|
||||||
|
* @param data
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public String admitUpdate(JSONObject data);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 人员接口-识别主体删除
|
||||||
|
* @param data
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public boolean admitDeletee(JSONObject data);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 人员接口-查询识别主体详情
|
||||||
|
* @param data
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public JSONObject admitDetail(JSONObject data);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 人员接口-识别主体列表
|
||||||
|
* @param data
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public JSONObject admitPage(JSONObject data);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 人员接口-人像注册
|
||||||
|
* @param data
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public JSONObject faceRegister(JSONObject data);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 人员接口-人像删除
|
||||||
|
* @param data
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public boolean faceDelete(JSONObject data);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 人员接口-人员照片信息查询
|
||||||
|
* @param data
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public JSONObject faceDetail(JSONObject data);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备接口-设备添加
|
||||||
|
* @param data
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public String deviceCreate(JSONObject data);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备接口-设备更新
|
||||||
|
* @param data
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public JSONObject deviceUpdate(JSONObject data);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备接口-设备删除
|
||||||
|
* @param data
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public JSONObject deviceDelete(JSONObject data);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备接口-设备详情
|
||||||
|
* @param data
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public JSONObject deviceDetail(JSONObject data);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 授权接口-设备授权识别主体
|
||||||
|
* @param data
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public String authDevice(JSONObject data);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 授权接口-设备修改识别主体权限
|
||||||
|
* @param data
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public JSONObject authDeviceUpdate(JSONObject data);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 授权接口-设备销权识别主体
|
||||||
|
* @param data
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public JSONObject authDeviceRevoke(JSONObject data);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 同步宇泛的人员和头像
|
||||||
|
* @param userId
|
||||||
|
* @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 org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.yanzhu.manage.mapper.AttendanceCfgMapper;
|
||||||
|
import com.yanzhu.manage.domain.AttendanceCfg;
|
||||||
|
import com.yanzhu.manage.service.IAttendanceCfgService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 考勤配置Service业务层处理
|
||||||
|
*
|
||||||
|
* @author yanzhu
|
||||||
|
* @date 2024-10-08
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class AttendanceCfgServiceImpl implements IAttendanceCfgService
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private AttendanceCfgMapper attendanceCfgMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询考勤配置
|
||||||
|
*
|
||||||
|
* @param id 考勤配置主键
|
||||||
|
* @return 考勤配置
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public AttendanceCfg selectAttendanceCfgById(Long id)
|
||||||
|
{
|
||||||
|
return attendanceCfgMapper.selectAttendanceCfgById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询考勤配置列表
|
||||||
|
*
|
||||||
|
* @param attendanceCfg 考勤配置
|
||||||
|
* @return 考勤配置
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<AttendanceCfg> selectAttendanceCfgList(AttendanceCfg attendanceCfg)
|
||||||
|
{
|
||||||
|
return attendanceCfgMapper.selectAttendanceCfgList(attendanceCfg);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增考勤配置
|
||||||
|
*
|
||||||
|
* @param attendanceCfg 考勤配置
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertAttendanceCfg(AttendanceCfg attendanceCfg)
|
||||||
|
{
|
||||||
|
attendanceCfg.setCreateBy(SecurityContextHolder.getUserName());
|
||||||
|
attendanceCfg.setCreateTime(DateUtils.getNowDate());
|
||||||
|
return attendanceCfgMapper.insertAttendanceCfg(attendanceCfg);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改考勤配置
|
||||||
|
*
|
||||||
|
* @param attendanceCfg 考勤配置
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateAttendanceCfg(AttendanceCfg attendanceCfg)
|
||||||
|
{
|
||||||
|
attendanceCfg.setUpdateBy(SecurityContextHolder.getUserName());
|
||||||
|
attendanceCfg.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
return attendanceCfgMapper.updateAttendanceCfg(attendanceCfg);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除考勤配置
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的考勤配置主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteAttendanceCfgByIds(Long[] ids)
|
||||||
|
{
|
||||||
|
return attendanceCfgMapper.deleteAttendanceCfgByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除考勤配置信息
|
||||||
|
*
|
||||||
|
* @param id 考勤配置主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteAttendanceCfgById(Long id)
|
||||||
|
{
|
||||||
|
return attendanceCfgMapper.deleteAttendanceCfgById(id);
|
||||||
|
}
|
||||||
|
}
|
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,108 @@
|
||||||
|
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.service.IUniService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.yanzhu.manage.mapper.AttendanceUbiDeviceMapper;
|
||||||
|
import com.yanzhu.manage.domain.AttendanceUbiDevice;
|
||||||
|
import com.yanzhu.manage.service.IAttendanceUbiDeviceService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 宇泛的设备信息Service业务层处理
|
||||||
|
*
|
||||||
|
* @author yanzhu
|
||||||
|
* @date 2024-10-08
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class AttendanceUbiDeviceServiceImpl implements IAttendanceUbiDeviceService
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private AttendanceUbiDeviceMapper attendanceUbiDeviceMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IUniService uniService;
|
||||||
|
/**
|
||||||
|
* 查询宇泛的设备信息
|
||||||
|
*
|
||||||
|
* @param id 宇泛的设备信息主键
|
||||||
|
* @return 宇泛的设备信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public AttendanceUbiDevice selectAttendanceUbiDeviceById(Long id)
|
||||||
|
{
|
||||||
|
return attendanceUbiDeviceMapper.selectAttendanceUbiDeviceById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询宇泛的设备信息列表
|
||||||
|
*
|
||||||
|
* @param attendanceUbiDevice 宇泛的设备信息
|
||||||
|
* @return 宇泛的设备信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<AttendanceUbiDevice> selectAttendanceUbiDeviceList(AttendanceUbiDevice attendanceUbiDevice)
|
||||||
|
{
|
||||||
|
return attendanceUbiDeviceMapper.selectAttendanceUbiDeviceList(attendanceUbiDevice);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增宇泛的设备信息
|
||||||
|
*
|
||||||
|
* @param attendanceUbiDevice 宇泛的设备信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertAttendanceUbiDevice(AttendanceUbiDevice attendanceUbiDevice)
|
||||||
|
{
|
||||||
|
attendanceUbiDevice.setCreateBy(SecurityContextHolder.getUserName());
|
||||||
|
attendanceUbiDevice.setCreateTime(DateUtils.getNowDate());
|
||||||
|
int data= attendanceUbiDeviceMapper.insertAttendanceUbiDevice(attendanceUbiDevice);
|
||||||
|
uniService.syncUniDevice(attendanceUbiDevice.getId(),attendanceUbiDevice.getProjectId());
|
||||||
|
uniService.syncUniDeviceUser(attendanceUbiDevice.getId(),attendanceUbiDevice.getProjectId());
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改宇泛的设备信息
|
||||||
|
*
|
||||||
|
* @param attendanceUbiDevice 宇泛的设备信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateAttendanceUbiDevice(AttendanceUbiDevice attendanceUbiDevice)
|
||||||
|
{
|
||||||
|
attendanceUbiDevice.setUpdateBy(SecurityContextHolder.getUserName());
|
||||||
|
attendanceUbiDevice.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
int data= attendanceUbiDeviceMapper.updateAttendanceUbiDevice(attendanceUbiDevice);
|
||||||
|
uniService.syncUniDevice(attendanceUbiDevice.getId(),attendanceUbiDevice.getProjectId());
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除宇泛的设备信息
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的宇泛的设备信息主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteAttendanceUbiDeviceByIds(Long[] ids)
|
||||||
|
{
|
||||||
|
return attendanceUbiDeviceMapper.deleteAttendanceUbiDeviceByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除宇泛的设备信息信息
|
||||||
|
*
|
||||||
|
* @param id 宇泛的设备信息主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteAttendanceUbiDeviceById(Long id)
|
||||||
|
{
|
||||||
|
return attendanceUbiDeviceMapper.deleteAttendanceUbiDeviceById(id);
|
||||||
|
}
|
||||||
|
}
|
|
@ -6,6 +6,7 @@ import com.yanzhu.common.core.utils.DateUtils;
|
||||||
import com.yanzhu.manage.domain.ProProjectInfoSubdeptsUsers;
|
import com.yanzhu.manage.domain.ProProjectInfoSubdeptsUsers;
|
||||||
import com.yanzhu.manage.mapper.ProProjectInfoSubdeptsUsersMapper;
|
import com.yanzhu.manage.mapper.ProProjectInfoSubdeptsUsersMapper;
|
||||||
import com.yanzhu.manage.service.IProProjectInfoSubdeptsUsersService;
|
import com.yanzhu.manage.service.IProProjectInfoSubdeptsUsersService;
|
||||||
|
import com.yanzhu.manage.service.IUniService;
|
||||||
import com.yanzhu.system.api.RemoteUserService;
|
import com.yanzhu.system.api.RemoteUserService;
|
||||||
import com.yanzhu.system.api.domain.SysUser;
|
import com.yanzhu.system.api.domain.SysUser;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
@ -28,6 +29,8 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu
|
||||||
@Autowired
|
@Autowired
|
||||||
private RemoteUserService remoteUserService;
|
private RemoteUserService remoteUserService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IUniService uniService;
|
||||||
/**
|
/**
|
||||||
* 查询分包单位工人
|
* 查询分包单位工人
|
||||||
*
|
*
|
||||||
|
@ -71,6 +74,7 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu
|
||||||
}else{
|
}else{
|
||||||
remoteUserService.updateUserInfo(user,SecurityConstants.INNER).getData();
|
remoteUserService.updateUserInfo(user,SecurityConstants.INNER).getData();
|
||||||
}
|
}
|
||||||
|
uniService.syncUniUser(user.getUserId(),proProjectInfoSubdeptsUsers.getProjectId());
|
||||||
return proProjectInfoSubdeptsUsersMapper.insertProProjectInfoSubdeptsUsers(proProjectInfoSubdeptsUsers);
|
return proProjectInfoSubdeptsUsersMapper.insertProProjectInfoSubdeptsUsers(proProjectInfoSubdeptsUsers);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -85,9 +89,20 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu
|
||||||
{
|
{
|
||||||
proProjectInfoSubdeptsUsers.setUpdateTime(DateUtils.getNowDate());
|
proProjectInfoSubdeptsUsers.setUpdateTime(DateUtils.getNowDate());
|
||||||
proProjectInfoSubdeptsUsers.setUpdateBy(SecurityContextHolder.getUserName());
|
proProjectInfoSubdeptsUsers.setUpdateBy(SecurityContextHolder.getUserName());
|
||||||
|
SysUser user=proProjectInfoSubdeptsUsers.getUser();
|
||||||
|
if(user.getUserId()==null||user.getUserId().intValue()==0){
|
||||||
|
Long userId= remoteUserService.registerUserInfo(user, SecurityConstants.INNER).getData();
|
||||||
|
user.setUserId(userId);
|
||||||
|
proProjectInfoSubdeptsUsers.setUserId(userId);
|
||||||
|
}else{
|
||||||
|
remoteUserService.updateUserInfo(user,SecurityConstants.INNER).getData();
|
||||||
|
}
|
||||||
|
uniService.syncUniUser(user.getUserId(),proProjectInfoSubdeptsUsers.getProjectId());
|
||||||
return proProjectInfoSubdeptsUsersMapper.updateProProjectInfoSubdeptsUsers(proProjectInfoSubdeptsUsers);
|
return proProjectInfoSubdeptsUsersMapper.updateProProjectInfoSubdeptsUsers(proProjectInfoSubdeptsUsers);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除分包单位工人
|
* 批量删除分包单位工人
|
||||||
*
|
*
|
||||||
|
|
|
@ -0,0 +1,417 @@
|
||||||
|
package com.yanzhu.manage.service.impl;
|
||||||
|
|
||||||
|
|
||||||
|
import com.alibaba.fastjson2.JSON;
|
||||||
|
import com.alibaba.fastjson2.JSONArray;
|
||||||
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
|
import com.alibaba.nacos.common.utils.MD5Utils;
|
||||||
|
import com.yanzhu.common.core.constant.CacheConstants;
|
||||||
|
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;
|
||||||
|
import com.yanzhu.system.api.domain.SysUser;
|
||||||
|
import okhttp3.Request;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.web.context.request.RequestContextHolder;
|
||||||
|
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import java.security.NoSuchAlgorithmException;
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class UniServiceImpl implements IUniService{
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private RedisService redisService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private AttendanceCfgMapper attendanceCfgMapper;
|
||||||
|
|
||||||
|
@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);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String,String> auth(long projectId) {
|
||||||
|
String cacheKey=CacheConstants.UNI_AUTH+projectId;
|
||||||
|
Map<String,String> authMap = redisService.getCacheObject(cacheKey);
|
||||||
|
String authInfo="404";
|
||||||
|
String projectGuid="404";
|
||||||
|
if(authMap!=null){
|
||||||
|
return authMap;
|
||||||
|
}else{
|
||||||
|
authMap=new HashMap<>();
|
||||||
|
}
|
||||||
|
AttendanceCfg where=new AttendanceCfg();
|
||||||
|
where.setProjectId(projectId);
|
||||||
|
List<AttendanceCfg> list=attendanceCfgMapper.selectAttendanceCfgList(where);
|
||||||
|
if(list.size()>0){
|
||||||
|
AttendanceCfg cfg=list.get(0);
|
||||||
|
if(cfg.getVendorsCode().equals("uni") && StringUtils.isNotEmpty(cfg.getVendorsParameter())){
|
||||||
|
JSONObject json=JSON.parseObject(cfg.getVendorsParameter());
|
||||||
|
String appKey=json.getString("AppKey");
|
||||||
|
String appSecret=json.getString("AppSecret");
|
||||||
|
projectGuid=json.getString("projectGuid");
|
||||||
|
String timestamp=""+new Date().getTime();
|
||||||
|
Map<String, String> headerParams=new HashMap<>();
|
||||||
|
headerParams.put("appKey",appKey);
|
||||||
|
headerParams.put("timestamp",timestamp);
|
||||||
|
String sign=appKey+timestamp+appSecret;
|
||||||
|
headerParams.put("sign", UniUtils.md5(sign).toLowerCase());
|
||||||
|
Request request = new Request.Builder()
|
||||||
|
.url(UniUtils.getAuthUrl(projectGuid))
|
||||||
|
.get().headers(UniUtils.setHeaderParams(headerParams))
|
||||||
|
.build();
|
||||||
|
String str=UniUtils.getResult(request);
|
||||||
|
JSONObject jo=JSON.parseObject(str);
|
||||||
|
String data= jo.getString("data");
|
||||||
|
if(StringUtils.isNotEmpty(data)){
|
||||||
|
authInfo=data;
|
||||||
|
authMap.put("token",authInfo);
|
||||||
|
authMap.put("projectGuid",projectGuid);
|
||||||
|
redisService.setCacheObject(cacheKey, authMap, 20l, TimeUnit.HOURS);//缓存20小时
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return authMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String admitCreate(JSONObject data) {
|
||||||
|
long projectId=data.getLong("projectId");
|
||||||
|
data.remove("projectId");
|
||||||
|
Request request=new Request.Builder()
|
||||||
|
.url(UniUtils.ADMITCREATE)
|
||||||
|
.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").getString("admitGuid");
|
||||||
|
}
|
||||||
|
if("token is illegal".equals(jo.getString("msg"))){
|
||||||
|
clearAuthCache(projectId);
|
||||||
|
return admitCreate(data);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String admitUpdate(JSONObject data) {
|
||||||
|
long projectId=data.getLong("projectId");
|
||||||
|
data.remove("projectId");
|
||||||
|
Request request=new Request.Builder()
|
||||||
|
.url(UniUtils.ADMITUPDATE)
|
||||||
|
.post(UniUtils.toJsonBody(data))
|
||||||
|
.headers(UniUtils.setHeaderParams(auth(projectId)))
|
||||||
|
.build();
|
||||||
|
String res=UniUtils.getResult(request);
|
||||||
|
JSONObject jo=JSON.parseObject(res);
|
||||||
|
if("token is illegal".equals(jo.getString("msg"))){
|
||||||
|
clearAuthCache(projectId);
|
||||||
|
return admitUpdate(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
return jo.getString("msg");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean admitDeletee(JSONObject data) {
|
||||||
|
long projectId=data.getLong("projectId");
|
||||||
|
data.remove("projectId");
|
||||||
|
Request request=new Request.Builder()
|
||||||
|
.url(UniUtils.ADMITDELETE)
|
||||||
|
.post(UniUtils.toJsonBody(data))
|
||||||
|
.headers(UniUtils.setHeaderParams(auth(projectId)))
|
||||||
|
.build();
|
||||||
|
String res=UniUtils.getResult(request);
|
||||||
|
JSONObject jo=JSON.parseObject(res);
|
||||||
|
if("token is illegal".equals(jo.getString("msg"))){
|
||||||
|
clearAuthCache(projectId);
|
||||||
|
return admitDeletee(data);
|
||||||
|
}
|
||||||
|
return jo.getLong("result").intValue()==1;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public JSONObject admitDetail(JSONObject data) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public JSONObject admitPage(JSONObject data) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public JSONObject faceRegister(JSONObject data) {
|
||||||
|
long projectId=data.getLong("projectId");
|
||||||
|
data.remove("projectId");
|
||||||
|
Request request=new Request.Builder()
|
||||||
|
.url(UniUtils.FACEREGISTER)
|
||||||
|
.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 faceRegister(data);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean faceDelete(JSONObject data) {
|
||||||
|
long projectId=data.getLong("projectId");
|
||||||
|
data.remove("projectId");
|
||||||
|
Request request=new Request.Builder()
|
||||||
|
.url(UniUtils.FACEDELETE)
|
||||||
|
.post(UniUtils.toJsonBody(data))
|
||||||
|
.headers(UniUtils.setHeaderParams(auth(projectId)))
|
||||||
|
.build();
|
||||||
|
String res=UniUtils.getResult(request);
|
||||||
|
JSONObject jo=JSON.parseObject(res);
|
||||||
|
if("token is illegal".equals(jo.getString("msg"))){
|
||||||
|
clearAuthCache(projectId);
|
||||||
|
return faceDelete(data);
|
||||||
|
}
|
||||||
|
return jo.getLong("result").intValue()==1;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public JSONObject faceDetail(JSONObject data) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
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
|
||||||
|
public JSONObject deviceUpdate(JSONObject data) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public JSONObject deviceDelete(JSONObject data) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@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 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
|
||||||
|
public JSONObject authDeviceUpdate(JSONObject data) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
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();
|
||||||
|
JSONObject jo=JSON.parseObject(user.getUserInfos());
|
||||||
|
String admitGuid=jo.getString("admitGuid");
|
||||||
|
String faceGuid=jo.getString("faceGuid");
|
||||||
|
JSONObject userJo=new JSONObject();
|
||||||
|
userJo.put("projectId",projectId);
|
||||||
|
userJo.put("name",user.getUserName());
|
||||||
|
userJo.put("phone",user.getPhonenumber());
|
||||||
|
userJo.put("tag",user.getNickName());
|
||||||
|
userJo.put("cardNo",user.getUserId()+","+projectId);
|
||||||
|
userJo.put("idCardNo",user.getCardCode());
|
||||||
|
userJo.put("password","123456");
|
||||||
|
userJo.put("addition","");
|
||||||
|
boolean hasUpdate=false;
|
||||||
|
if(StringUtils.isEmpty(admitGuid)){
|
||||||
|
//未注册人员
|
||||||
|
admitGuid=admitCreate(userJo);
|
||||||
|
jo.put("admitGuid",admitGuid);
|
||||||
|
hasUpdate=true;
|
||||||
|
}else{
|
||||||
|
//已注册
|
||||||
|
userJo.put("admitGuid",admitGuid);
|
||||||
|
String upMsg= admitUpdate(userJo);
|
||||||
|
if("admit not exist".equals(upMsg)){
|
||||||
|
userJo.remove("admitGuid");
|
||||||
|
userJo.put("projectId",projectId);
|
||||||
|
admitGuid=admitCreate(userJo);
|
||||||
|
jo.put("admitGuid",admitGuid);
|
||||||
|
hasUpdate=true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
JSONObject faceJo=new JSONObject();
|
||||||
|
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("faceTag","");
|
||||||
|
HttpServletRequest request =((ServletRequestAttributes)RequestContextHolder.currentRequestAttributes()).getRequest();
|
||||||
|
String url= request.getRemoteAddr();
|
||||||
|
if(StringUtils.isNotEmpty(faceGuid)){
|
||||||
|
JSONObject faceDel=new JSONObject();
|
||||||
|
faceDel.put("projectId",projectId);
|
||||||
|
faceDel.put("admitGuid",admitGuid);
|
||||||
|
faceDel.put("faceGuid",faceGuid);
|
||||||
|
faceDelete(faceDel);
|
||||||
|
}
|
||||||
|
//注册图像
|
||||||
|
JSONObject faceRes= faceRegister(faceJo);
|
||||||
|
if(faceRes!=null) {
|
||||||
|
jo.put("faceGuid", faceRes.getString("faceGuid"));
|
||||||
|
jo.put("uniFaceInfo", faceRes.toJSONString());
|
||||||
|
hasUpdate=true;
|
||||||
|
}
|
||||||
|
user.setUserInfos(jo.toJSONString());
|
||||||
|
if(hasUpdate){
|
||||||
|
Long ret= remoteUserService.updateUserInfo(user,SecurityConstants.INNER).getData();
|
||||||
|
if(ret==null){
|
||||||
|
return 0l;
|
||||||
|
}
|
||||||
|
return ret.longValue();
|
||||||
|
}
|
||||||
|
return 0l;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,75 @@
|
||||||
|
package com.yanzhu.manage.utils;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
|
import com.alibaba.nacos.common.utils.MD5Utils;
|
||||||
|
import com.yanzhu.common.core.utils.StringUtils;
|
||||||
|
import okhttp3.*;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class UniUtils {
|
||||||
|
public static final String UNIBASE="http://wo-api.uni-ubi.com/";
|
||||||
|
public static final String ADMITCREATE=UNIBASE+"v2/admit/create";
|
||||||
|
public static final String ADMITUPDATE=UNIBASE+"v2/admit/update";
|
||||||
|
public static final String ADMITDELETE=UNIBASE+"v2/admit/delete";
|
||||||
|
public static final String ADMITDETAIL=UNIBASE+"v2/admit/detail";
|
||||||
|
public static final String FACEREGISTER=UNIBASE+"v2/face/register";
|
||||||
|
public static final String FACEDELETE=UNIBASE+"v2/face/delete";
|
||||||
|
public static final String FACEDETAIL=UNIBASE+"v2/face/detail";
|
||||||
|
|
||||||
|
public static final String DEVICECREATE=UNIBASE+"v2/device/create";
|
||||||
|
public static final String DEVICEUPATE=UNIBASE+"v2/device/update";
|
||||||
|
public static final String DEVICEDELETE=UNIBASE+"v2/device/delete";
|
||||||
|
public static final String DEVICEDETAIL=UNIBASE+"v2/device/detail";
|
||||||
|
|
||||||
|
public static final String AUTHDEVICE=UNIBASE+"v2/auth/device";
|
||||||
|
public static final String AUTHDEVICEUPDATE=UNIBASE+"v2/auth/device/update";
|
||||||
|
public static String getAuthUrl(String projectGuid){
|
||||||
|
return UNIBASE+ "/v1/"+projectGuid+"/auth";
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Headers setHeaderParams(Map<String, String> headerParams) {
|
||||||
|
Headers headers = null;
|
||||||
|
Headers.Builder headersbuilder = new Headers.Builder();
|
||||||
|
if (headerParams != null && headerParams.size() > 0) {
|
||||||
|
for (String key : headerParams.keySet()) {
|
||||||
|
if (!StringUtils.isEmpty(key) && !StringUtils.isEmpty(headerParams.get(key))) {
|
||||||
|
//如果参数不是null并且不是"",就拼接起来
|
||||||
|
headersbuilder.add(key, headerParams.get(key));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
headers = headersbuilder.build();
|
||||||
|
return headers;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getResult(Request request) {
|
||||||
|
OkHttpClient client = new OkHttpClient();
|
||||||
|
Response response;
|
||||||
|
try {
|
||||||
|
response = client.newCall(request).execute();
|
||||||
|
if (response.body() != null) {
|
||||||
|
return response.body().string();
|
||||||
|
} else {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static RequestBody toJsonBody(JSONObject data) {
|
||||||
|
return RequestBody.create(MediaType.parse("application/json"),data.toJSONString());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String md5(String data){
|
||||||
|
try {
|
||||||
|
return MD5Utils.md5Hex(data.getBytes());
|
||||||
|
}catch (Exception ex){
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -32,7 +32,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<result property="updateBy" column="update_by" />
|
<result property="updateBy" column="update_by" />
|
||||||
<result property="updateTime" column="update_time" />
|
<result property="updateTime" column="update_time" />
|
||||||
<result property="remark" column="remark" />
|
<result property="remark" column="remark" />
|
||||||
|
<result property="admitGuid" column="admitGuid"/>
|
||||||
<association property="dept" column="dept_id" javaType="SysDept" resultMap="deptResult" />
|
<association property="dept" column="dept_id" javaType="SysDept" resultMap="deptResult" />
|
||||||
<association property="comp" column="com_id" javaType="SysDept" resultMap="compResult" />
|
<association property="comp" column="com_id" javaType="SysDept" resultMap="compResult" />
|
||||||
<collection property="roles" javaType="java.util.List" resultMap="RoleResult" />
|
<collection property="roles" javaType="java.util.List" resultMap="RoleResult" />
|
||||||
|
@ -66,7 +66,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectUserVo">
|
<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,
|
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
|
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
|
from sys_user u
|
||||||
|
@ -77,7 +79,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult">
|
<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
|
left join sys_dept d on u.dept_id = d.dept_id
|
||||||
where u.del_flag = '0'
|
where u.del_flag = '0'
|
||||||
<if test="userId != null and userId != 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 != ''">
|
<if test="userName != null and userName != ''">
|
||||||
AND u.user_name like concat('%', #{userName}, '%')
|
AND u.user_name like concat('%', #{userName}, '%')
|
||||||
</if>
|
</if>
|
||||||
|
<if test="admitGuid != null and admitGuid != ''">
|
||||||
|
AND u.admitGuid =#{admitGuid}
|
||||||
|
</if>
|
||||||
<if test="userName != null and userName != ''">
|
<if test="userName != null and userName != ''">
|
||||||
AND u.user_name like concat('%', #{userName}, '%')
|
AND u.user_name like concat('%', #{userName}, '%')
|
||||||
</if>
|
</if>
|
||||||
|
@ -115,7 +122,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectAllocatedList" parameterType="SysUser" resultMap="SysUserResult">
|
<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
|
from sys_user u
|
||||||
left join sys_dept d on u.dept_id = d.dept_id
|
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
|
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>
|
||||||
|
|
||||||
<select id="selectUnallocatedList" parameterType="SysUser" resultMap="SysUserResult">
|
<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
|
from sys_user u
|
||||||
left join sys_dept d on u.dept_id = d.dept_id
|
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
|
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="phonenumber != null and phonenumber != ''">phonenumber,</if>
|
||||||
<if test="sex != null and sex != ''">sex,</if>
|
<if test="sex != null and sex != ''">sex,</if>
|
||||||
<if test="password != null and password != ''">password,</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="status != null and status != ''">status,</if>
|
||||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||||
<if test="remark != null and remark != ''">remark,</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="phonenumber != null and phonenumber != ''">#{phonenumber},</if>
|
||||||
<if test="sex != null and sex != ''">#{sex},</if>
|
<if test="sex != null and sex != ''">#{sex},</if>
|
||||||
<if test="password != null and password != ''">#{password},</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="status != null and status != ''">#{status},</if>
|
||||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||||
<if test="remark != null and remark != ''">#{remark},</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="sex != null and sex != ''">sex = #{sex},</if>
|
||||||
<if test="avatar != null and avatar != ''">avatar = #{avatar},</if>
|
<if test="avatar != null and avatar != ''">avatar = #{avatar},</if>
|
||||||
<if test="password != null and password != ''">password = #{password},</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="status != null and status != ''">status = #{status},</if>
|
||||||
<if test="loginIp != null and loginIp != ''">login_ip = #{loginIp},</if>
|
<if test="loginIp != null and loginIp != ''">login_ip = #{loginIp},</if>
|
||||||
<if test="loginDate != null">login_date = #{loginDate},</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'
|
||||||
|
})
|
||||||
|
}
|
|
@ -0,0 +1,44 @@
|
||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询考勤配置列表
|
||||||
|
export function listAttendance_cfg(query) {
|
||||||
|
return request({
|
||||||
|
url: '/manage/attendance_cfg/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询考勤配置详细
|
||||||
|
export function getAttendance_cfg(id) {
|
||||||
|
return request({
|
||||||
|
url: '/manage/attendance_cfg/' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增考勤配置
|
||||||
|
export function addAttendance_cfg(data) {
|
||||||
|
return request({
|
||||||
|
url: '/manage/attendance_cfg',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改考勤配置
|
||||||
|
export function updateAttendance_cfg(data) {
|
||||||
|
return request({
|
||||||
|
url: '/manage/attendance_cfg',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除考勤配置
|
||||||
|
export function delAttendance_cfg(id) {
|
||||||
|
return request({
|
||||||
|
url: '/manage/attendance_cfg/' + id,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
|
@ -0,0 +1,54 @@
|
||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询宇泛的设备信息列表
|
||||||
|
export function listAttendance_ubi_device(query) {
|
||||||
|
return request({
|
||||||
|
url: '/manage/attendance_ubi_device/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询宇泛的设备信息详细
|
||||||
|
export function getAttendance_ubi_device(id) {
|
||||||
|
return request({
|
||||||
|
url: '/manage/attendance_ubi_device/' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增宇泛的设备信息
|
||||||
|
export function addAttendance_ubi_device(data) {
|
||||||
|
return request({
|
||||||
|
url: '/manage/attendance_ubi_device',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改宇泛的设备信息
|
||||||
|
export function updateAttendance_ubi_device(data) {
|
||||||
|
return request({
|
||||||
|
url: '/manage/attendance_ubi_device',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除宇泛的设备信息
|
||||||
|
export function delAttendance_ubi_device(id) {
|
||||||
|
return request({
|
||||||
|
url: '/manage/attendance_ubi_device/' + id,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 宇泛的设备人员信息同步
|
||||||
|
export function authAttendance_ubi_device(data) {
|
||||||
|
return request({
|
||||||
|
url: '/manage/attendance_ubi_device/auth',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
|
@ -57,6 +57,16 @@ app.config.globalProperties.handleTree = handleTree
|
||||||
app.config.globalProperties.addDateRange = addDateRange
|
app.config.globalProperties.addDateRange = addDateRange
|
||||||
app.config.globalProperties.selectDictLabel = selectDictLabel
|
app.config.globalProperties.selectDictLabel = selectDictLabel
|
||||||
app.config.globalProperties.selectDictLabels = selectDictLabels
|
app.config.globalProperties.selectDictLabels = selectDictLabels
|
||||||
|
app.config.globalProperties.$tryToJson=(str,df)=>{
|
||||||
|
try{
|
||||||
|
if(!str){
|
||||||
|
return df||{};
|
||||||
|
}
|
||||||
|
return JSON.parse(str)||(df||{});
|
||||||
|
}catch{
|
||||||
|
return (df||{});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 全局组件挂载
|
// 全局组件挂载
|
||||||
app.component('DictTag', DictTag)
|
app.component('DictTag', DictTag)
|
||||||
|
|
|
@ -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>
|
|
@ -0,0 +1,310 @@
|
||||||
|
<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" v-if="1 == 2">
|
||||||
|
<el-input v-model="queryParams.comId" placeholder="请输入公司主键" clearable @keyup.enter="handleQuery" />
|
||||||
|
</el-form-item>
|
||||||
|
<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="vendorsCode">
|
||||||
|
<el-select v-model="queryParams.vendorsCode" placeholder="请选择厂商" clearable @change="handleQuery">
|
||||||
|
<el-option v-for="dict in attendance_vendors" :key="dict.value" :label="dict.label" :value="dict.value">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="启停状态" prop="enabled">
|
||||||
|
<el-select v-model="queryParams.enabled" clearable style="width:100px;">
|
||||||
|
<el-option label="启用" :value="1"></el-option>
|
||||||
|
<el-option label="停用" :value="0"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</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:attendance_cfg:add']">新增</el-button>
|
||||||
|
</el-col>
|
||||||
|
<!--
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate"
|
||||||
|
v-hasPermi="['manage:attendance_cfg:edit']">修改</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete"
|
||||||
|
v-hasPermi="['manage:attendance_cfg:remove']">删除</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="warning" plain icon="Download" @click="handleExport"
|
||||||
|
v-hasPermi="['manage:attendance_cfg:export']">导出</el-button>
|
||||||
|
</el-col>
|
||||||
|
-->
|
||||||
|
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-table v-loading="loading" :data="attendance_cfgList" @selection-change="handleSelectionChange">
|
||||||
|
<el-table-column label="NO." align="center" prop="id" />
|
||||||
|
<el-table-column label="所属公司" align="center" prop="compName" />
|
||||||
|
<el-table-column label="所属项目" align="center" prop="projectName" />
|
||||||
|
<el-table-column label="考勤厂商" align="center" prop="vendorsName" />
|
||||||
|
<el-table-column label="是否启用" align="center" prop="enabled">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-switch v-model="scope.row.enabled" :active-value="1" @change="doUpdateRow(scope.row)" :inactive-value="0"></el-switch>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<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:attendance_cfg:edit']">修改</el-button>
|
||||||
|
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)"
|
||||||
|
v-hasPermi="['manage:attendance_cfg: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="800px" append-to-body :close-on-click-modal="false"
|
||||||
|
:close-on-press-escape="false">
|
||||||
|
<el-form ref="attendance_cfgRef" :model="form" :rules="rules" label-width="100px">
|
||||||
|
<el-form-item label="所属项目" prop="projectId">
|
||||||
|
<el-select :disabled="data.currentProId != ''||data.mode=='edit'" v-model="form.projectId" placeholder="请选择项目">
|
||||||
|
<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="vendorsCode">
|
||||||
|
<el-select v-model="form.vendorsCode" placeholder="请选择厂商">
|
||||||
|
<el-option v-for="dict in attendance_vendors" :key="dict.value" :label="dict.label" :value="dict.value">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<template v-if="form.vendorsCode == 'uni'">
|
||||||
|
<el-form-item label="应用KEY" prop="AppKey">
|
||||||
|
<el-input v-model="form.AppKey" placeholder="请输入内容" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="应用Secret" prop="AppSecret">
|
||||||
|
<el-input v-model="form.AppSecret" placeholder="请输入内容" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="项目Guid" prop="projectGuid">
|
||||||
|
<el-input v-model="form.projectGuid" placeholder="请输入内容" />
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<el-form-item label="已启用" prop="enabled">
|
||||||
|
<el-switch v-model="form.enabled" :active-value="1" :inactive-value="0"/>
|
||||||
|
</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="Attendance_cfg">
|
||||||
|
import { listAttendance_cfg, getAttendance_cfg, delAttendance_cfg, addAttendance_cfg, updateAttendance_cfg } from "@/api/manage/attendanceCfg";
|
||||||
|
import { findMyProjectList } from "@/api/publics";
|
||||||
|
import useUserStore from '@/store/modules/user'
|
||||||
|
const userStore = useUserStore()
|
||||||
|
const { proxy } = getCurrentInstance();
|
||||||
|
const { attendance_vendors } = proxy.useDict('attendance_vendors');
|
||||||
|
|
||||||
|
|
||||||
|
const attendance_cfgList = 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,
|
||||||
|
vendorsCode: null,
|
||||||
|
vendorsParameter: null,
|
||||||
|
enabled: null,
|
||||||
|
state: null,
|
||||||
|
isDel: null,
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
projectId: [{ required: true, trigger: ['blur', 'change'], message: "请选择所属项目" }],
|
||||||
|
vendorsCode: [{ required: true, trigger: ['blur', 'change'], message: "请选择考勤厂商" }],
|
||||||
|
AppKey: [{ required: true, trigger: ['blur', 'change'], message: "请输入应用KEY" }],
|
||||||
|
AppSecret: [{ required: true, trigger: ['blur', 'change'], message: "请输入应用Secret" }],
|
||||||
|
projectGuid: [{ required: true, trigger: ['blur', 'change'], message: "请输入项目Guid" }],
|
||||||
|
},
|
||||||
|
projects: [],
|
||||||
|
currentProId: '',
|
||||||
|
mode:'',
|
||||||
|
});
|
||||||
|
|
||||||
|
const { queryParams, form, rules } = toRefs(data);
|
||||||
|
|
||||||
|
function doUpdateRow(row){
|
||||||
|
updateAttendance_cfg(row).then(d=>{
|
||||||
|
proxy.$modal.msgSuccess("修改成功");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/** 查询项目列表 */
|
||||||
|
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() {
|
||||||
|
loading.value = true;
|
||||||
|
listAttendance_cfg(queryParams.value).then(response => {
|
||||||
|
attendance_cfgList.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: data.currentProId,
|
||||||
|
vendorsCode: 'uni',
|
||||||
|
AppKey: '',
|
||||||
|
AppSecret: '',
|
||||||
|
projectGuid: '',
|
||||||
|
vendorsParameter: null,
|
||||||
|
enabled: 1,
|
||||||
|
state: null,
|
||||||
|
remark: null,
|
||||||
|
isDel: null,
|
||||||
|
createBy: null,
|
||||||
|
createTime: null,
|
||||||
|
updateBy: null,
|
||||||
|
updateTime: null
|
||||||
|
};
|
||||||
|
proxy.resetForm("attendance_cfgRef");
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
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() {
|
||||||
|
data.mode="add"
|
||||||
|
reset();
|
||||||
|
open.value = true;
|
||||||
|
title.value = "添加考勤配置";
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 修改按钮操作 */
|
||||||
|
function handleUpdate(row) {
|
||||||
|
data.mode="edit"
|
||||||
|
reset();
|
||||||
|
const _id = row.id || ids.value
|
||||||
|
getAttendance_cfg(_id).then(response => {
|
||||||
|
let obj=response.data;
|
||||||
|
let info=proxy.$tryToJson(obj.vendorsParameter||"{}");
|
||||||
|
form.value =obj;
|
||||||
|
form.value.AppKey=info.AppKey;
|
||||||
|
form.value.AppSecret=info.AppSecret;
|
||||||
|
form.value.projectGuid=info.projectGuid;
|
||||||
|
open.value = true;
|
||||||
|
title.value = "修改考勤配置";
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 提交按钮 */
|
||||||
|
function submitForm() {
|
||||||
|
proxy.$refs["attendance_cfgRef"].validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
form.value.vendorsParameter = JSON.stringify({
|
||||||
|
AppKey: form.value.AppKey,
|
||||||
|
AppSecret: form.value.AppSecret,
|
||||||
|
projectGuid: form.value.projectGuid,
|
||||||
|
})
|
||||||
|
form.value.enabled = form.value.enabled;
|
||||||
|
if (form.value.id != null) {
|
||||||
|
updateAttendance_cfg(form.value).then(response => {
|
||||||
|
proxy.$modal.msgSuccess("修改成功");
|
||||||
|
open.value = false;
|
||||||
|
getList();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
addAttendance_cfg(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 delAttendance_cfg(_ids);
|
||||||
|
}).then(() => {
|
||||||
|
getList();
|
||||||
|
proxy.$modal.msgSuccess("删除成功");
|
||||||
|
}).catch(() => { });
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
function handleExport() {
|
||||||
|
proxy.download('manage/attendance_cfg/export', {
|
||||||
|
...queryParams.value
|
||||||
|
}, `attendance_cfg_${new Date().getTime()}.xlsx`)
|
||||||
|
}
|
||||||
|
getProjectList();
|
||||||
|
getList();
|
||||||
|
</script>
|
|
@ -0,0 +1,356 @@
|
||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<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" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="设备标签" prop="tag">
|
||||||
|
<el-input v-model="queryParams.tag" placeholder="请输入设备标签" 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>
|
||||||
|
<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:attendance_ubi_device:add']">新增</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate"
|
||||||
|
v-hasPermi="['manage:attendance_ubi_device:edit']">修改</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete"
|
||||||
|
v-hasPermi="['manage:attendance_ubi_device:remove']">删除</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="warning" plain icon="Download" @click="handleExport"
|
||||||
|
v-hasPermi="['manage:attendance_ubi_device:export']">导出</el-button>
|
||||||
|
</el-col>
|
||||||
|
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-table v-loading="loading" :data="attendance_ubi_deviceList" @selection-change="handleSelectionChange">
|
||||||
|
|
||||||
|
<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="设备来源" align="center" prop="souceName" />
|
||||||
|
<el-table-column label="设备序列号" align="center" prop="deviceNo" />
|
||||||
|
<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" >
|
||||||
|
<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)"
|
||||||
|
v-hasPermi="['manage:attendance_ubi_device: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="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="请输入设备名称" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="设备标签" prop="tag">
|
||||||
|
<el-input v-model="form.tag" placeholder="请输入设备标签" />
|
||||||
|
</el-form-item>
|
||||||
|
<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="remark">
|
||||||
|
<el-input v-model="form.remark" placeholder="请输入备注" />
|
||||||
|
</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="Attendance_ubi_device">
|
||||||
|
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);
|
||||||
|
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,
|
||||||
|
name: null,
|
||||||
|
tag: null,
|
||||||
|
sceneGuid: null,
|
||||||
|
source: null,
|
||||||
|
deviceNo: null,
|
||||||
|
addition: null,
|
||||||
|
bindDefaultScene: null,
|
||||||
|
forceEmptyDevice: null,
|
||||||
|
password: null,
|
||||||
|
deviceModel: null,
|
||||||
|
deviceState: null,
|
||||||
|
recType: null,
|
||||||
|
onlineState: null,
|
||||||
|
versionNo: null,
|
||||||
|
lastActiveTime: null,
|
||||||
|
hasRegister: null,
|
||||||
|
state: null,
|
||||||
|
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() {
|
||||||
|
loading.value = true;
|
||||||
|
listAttendance_ubi_device(queryParams.value).then(response => {
|
||||||
|
attendance_ubi_deviceList.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,
|
||||||
|
name: null,
|
||||||
|
tag: null,
|
||||||
|
sceneGuid: "",
|
||||||
|
source: null,
|
||||||
|
deviceNo: null,
|
||||||
|
addition: null,
|
||||||
|
bindDefaultScene: null,
|
||||||
|
forceEmptyDevice: null,
|
||||||
|
password: null,
|
||||||
|
deviceModel: null,
|
||||||
|
deviceState: null,
|
||||||
|
recType: null,
|
||||||
|
onlineState: null,
|
||||||
|
versionNo: null,
|
||||||
|
lastActiveTime: null,
|
||||||
|
hasRegister: null,
|
||||||
|
state: null,
|
||||||
|
remark: null,
|
||||||
|
isDel: null,
|
||||||
|
createBy: null,
|
||||||
|
createTime: null,
|
||||||
|
updateBy: null,
|
||||||
|
updateTime: null
|
||||||
|
};
|
||||||
|
proxy.resetForm("attendance_ubi_deviceRef");
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
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() {
|
||||||
|
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 => {
|
||||||
|
form.value = response.data;
|
||||||
|
open.value = true;
|
||||||
|
title.value = "修改宇泛的设备信息";
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 提交按钮 */
|
||||||
|
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("修改成功");
|
||||||
|
open.value = false;
|
||||||
|
getList();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
addAttendance_ubi_device(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 delAttendance_ubi_device(_ids);
|
||||||
|
}).then(() => {
|
||||||
|
getList();
|
||||||
|
proxy.$modal.msgSuccess("删除成功");
|
||||||
|
}).catch(() => { });
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
function handleExport() {
|
||||||
|
proxy.download('manage/attendance_ubi_device/export', {
|
||||||
|
...queryParams.value
|
||||||
|
}, `attendance_ubi_device_${new Date().getTime()}.xlsx`)
|
||||||
|
}
|
||||||
|
|
||||||
|
getList();
|
||||||
|
getProjectList();
|
||||||
|
</script>
|
|
@ -25,7 +25,9 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="工种岗位" prop="craftPost">
|
<el-form-item label="工种岗位" prop="craftPost">
|
||||||
<el-select v-model="queryParams.craftPost" placeholder="请选择工种岗位" clearable>
|
<el-select v-model="queryParams.craftPost" placeholder="请选择工种岗位" clearable>
|
||||||
<el-option v-for="dict in (queryParams.craftType?pro_craft_post.filter(d=>d.remark==queryParams.craftType):[])" :key="dict.value" :label="dict.label" :value="dict.value" />
|
<el-option
|
||||||
|
v-for="dict in (queryParams.craftType ? pro_craft_post.filter(d => d.remark == queryParams.craftType) : [])"
|
||||||
|
:key="dict.value" :label="dict.label" :value="dict.value" />
|
||||||
</el-select>
|
</el-select>
|
||||||
|
|
||||||
|
|
||||||
|
@ -59,8 +61,13 @@
|
||||||
<el-table v-loading="loading" :data="proProjectInfoSubdeptsUsersList" @selection-change="handleSelectionChange">
|
<el-table v-loading="loading" :data="proProjectInfoSubdeptsUsersList" @selection-change="handleSelectionChange">
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
<el-table-column label="所属单位" align="center" prop="subDeptName" />
|
<el-table-column label="所属单位" align="center" prop="subDeptName" />
|
||||||
<el-table-column label="姓名" align="center" prop="userName" />
|
<el-table-column label="姓名" align="center" prop="user.userName" />
|
||||||
<el-table-column label="联系电话" align="center" prop="userPhone" />
|
<el-table-column label="头像" align="center">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-image :src="scope.row.user.userPicture" style="height:80px;" :preview-teleported="true" :preview-src-list="[scope.row.user.userPicture]"></el-image>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="联系电话" align="center" prop="user.phonenumber" />
|
||||||
<el-table-column label="班组" align="center" prop="subDeptGroupName" />
|
<el-table-column label="班组" align="center" prop="subDeptGroupName" />
|
||||||
<el-table-column label="工种类型" align="center" prop="craftType">
|
<el-table-column label="工种类型" align="center" prop="craftType">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
|
@ -72,11 +79,11 @@
|
||||||
<dict-tag :options="pro_craft_post" :value="scope.row.craftPost" />
|
<dict-tag :options="pro_craft_post" :value="scope.row.craftPost" />
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="民族" align="center" prop="nation" width="80" />
|
<el-table-column label="民族" align="center" prop="info.nation" width="80" />
|
||||||
<el-table-column label="年龄" align="center" prop="age" width="80" />
|
<el-table-column label="年龄" align="center" prop="info.age" width="80" />
|
||||||
<el-table-column label="性别" align="center" prop="sex" width="80" />
|
<el-table-column label="性别" align="center" prop="user.sex" width="80" />
|
||||||
<el-table-column label="出生日期" align="center" prop="birthDay" />
|
<el-table-column label="出生日期" align="center" prop="info.birthDayStr" />
|
||||||
<el-table-column label="籍贯" align="center" prop="nativePlace" />
|
<el-table-column label="籍贯" align="center" prop="info.nativePlace" />
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="150">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="150">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)"
|
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)"
|
||||||
|
@ -95,11 +102,16 @@
|
||||||
<template #header>
|
<template #header>
|
||||||
<div style="position: relative;">{{ title }}</div>
|
<div style="position: relative;">{{ title }}</div>
|
||||||
</template>
|
</template>
|
||||||
<el-form ref="proProjectInfoSubdeptsUsersRef" :model="form" :rules="rules" label-width="120px" style="position: relative;">
|
<el-form ref="proProjectInfoSubdeptsUsersRef" :model="form" :rules="rules" label-width="120px"
|
||||||
|
style="position: relative;">
|
||||||
<div style="width: 50%;">
|
<div style="width: 50%;">
|
||||||
<el-form-item label="联系电话" prop="userPhone">
|
<el-form-item label="联系电话" prop="userPhone">
|
||||||
<el-input v-model="form.userPhone" placeholder="请输入联系电话" minlength="11" maxlength="11" style="width: 200px;" />
|
<el-input v-model="form.userPhone" disabled v-if="data.mode == 'edit'" placeholder="请输入联系电话" minlength="11"
|
||||||
<el-button type="primary" style="margin-left:10px;" @click="queryPhone">查询</el-button>
|
maxlength="11" style="width: 200px;" />
|
||||||
|
<el-input v-model="form.userPhone" v-else placeholder="请输入联系电话" minlength="11" maxlength="11"
|
||||||
|
style="width: 200px;" />
|
||||||
|
<el-button type="primary" v-if="data.mode != 'edit'" style="margin-left:10px;"
|
||||||
|
@click="queryPhone">查询</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</div>
|
</div>
|
||||||
<el-row v-if="data.phoneState">
|
<el-row v-if="data.phoneState">
|
||||||
|
@ -233,6 +245,7 @@ import { listProProjectInfoSubdepts } from "@/api/manage/proProjectInfoSubdepts"
|
||||||
import { listProProjectInfoSubdeptsGroup } from "@/api/manage/proProjectInfoSubdeptsGroup";
|
import { listProProjectInfoSubdeptsGroup } from "@/api/manage/proProjectInfoSubdeptsGroup";
|
||||||
import { listUser } from "@/api/system/user";
|
import { listUser } from "@/api/system/user";
|
||||||
import useUserStore from '@/store/modules/user'
|
import useUserStore from '@/store/modules/user'
|
||||||
|
import dayjs from 'dayjs'
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
const { proxy } = getCurrentInstance();
|
const { proxy } = getCurrentInstance();
|
||||||
const { sys_use_status, pro_craft_type, sys_is_del, pro_craft_post, certificate_type, educational_type } = proxy.useDict('sys_use_status', 'pro_craft_type', 'sys_is_del', 'pro_craft_post', 'certificate_type', 'educational_type');
|
const { sys_use_status, pro_craft_type, sys_is_del, pro_craft_post, certificate_type, educational_type } = proxy.useDict('sys_use_status', 'pro_craft_type', 'sys_is_del', 'pro_craft_post', 'certificate_type', 'educational_type');
|
||||||
|
@ -301,6 +314,7 @@ const data = reactive({
|
||||||
isManager: false,
|
isManager: false,
|
||||||
phoneState: '',
|
phoneState: '',
|
||||||
userInfo: null,
|
userInfo: null,
|
||||||
|
mode: '',
|
||||||
});
|
});
|
||||||
|
|
||||||
const { queryParams, form, rules } = toRefs(data);
|
const { queryParams, form, rules } = toRefs(data);
|
||||||
|
@ -315,25 +329,42 @@ function doImageUpload() {
|
||||||
//查询手机号码
|
//查询手机号码
|
||||||
function queryPhone() {
|
function queryPhone() {
|
||||||
listUser({ phonenumber: form.value.userPhone }).then(d => {
|
listUser({ phonenumber: form.value.userPhone }).then(d => {
|
||||||
|
let userPhone=form.value.userPhone;
|
||||||
if (d.rows.length > 0) {
|
if (d.rows.length > 0) {
|
||||||
let user = d.rows[0];
|
let user = d.rows[0];
|
||||||
data.userInfo = user;
|
data.userInfo = user;
|
||||||
data.phoneState = "edit";
|
data.phoneState = "edit";
|
||||||
form.value.userName=user.nickName||''
|
showEditUser(user);
|
||||||
form.value.certificateType=user.cardType||'';
|
|
||||||
form.value.certificateCode=user.cardCode||''
|
|
||||||
} else {
|
} else {
|
||||||
data.userInfo = null;
|
data.userInfo = null;
|
||||||
|
showEditUser({});
|
||||||
data.phoneState = "add";
|
data.phoneState = "add";
|
||||||
}
|
}
|
||||||
|
form.value.userPhone=userPhone;
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
function tryToJson(str) {
|
||||||
|
try {
|
||||||
|
return JSON.parse(str);
|
||||||
|
} catch {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
}
|
||||||
/** 查询分包单位工人列表 */
|
/** 查询分包单位工人列表 */
|
||||||
function getList() {
|
function getList() {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
listProProjectInfoSubdeptsUsers(queryParams.value).then(response => {
|
listProProjectInfoSubdeptsUsers(queryParams.value).then(response => {
|
||||||
proProjectInfoSubdeptsUsersList.value = response.rows || [];
|
proProjectInfoSubdeptsUsersList.value = (response.rows || []).map(d => {
|
||||||
|
d.info = tryToJson(d.user?.userInfos || "{}")
|
||||||
|
d.user = d.user || {};
|
||||||
|
if (d.info.birthDay) {
|
||||||
|
let birthDay = dayjs(d.info.birthDay).format("YYYY-MM-DD");
|
||||||
|
d.info.birthDayStr = birthDay;
|
||||||
|
d.info.age = dayjs(new Date()).diff(d.info.birthDay, 'year');
|
||||||
|
}
|
||||||
|
return d;
|
||||||
|
});
|
||||||
total.value = response.total;
|
total.value = response.total;
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
});
|
});
|
||||||
|
@ -488,7 +519,7 @@ function handleAdd() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
reset();
|
reset();
|
||||||
|
data.mode = 'add';
|
||||||
form.value.certificateType = "";
|
form.value.certificateType = "";
|
||||||
form.value.projectId = userStore.currentProId;
|
form.value.projectId = userStore.currentProId;
|
||||||
form.value.projectName = userStore.currentProName;
|
form.value.projectName = userStore.currentProName;
|
||||||
|
@ -500,10 +531,25 @@ function handleAdd() {
|
||||||
|
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
function handleUpdate(row) {
|
function handleUpdate(row) {
|
||||||
|
if (!userStore.currentProId) {
|
||||||
|
proxy.$modal.msgWarning("请切换到项目数据!!!");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
reset();
|
reset();
|
||||||
const _id = row.id || ids.value
|
const _id = row.id || ids.value
|
||||||
|
data.mode = 'edit'
|
||||||
getProProjectInfoSubdeptsUsers(_id).then(response => {
|
getProProjectInfoSubdeptsUsers(_id).then(response => {
|
||||||
form.value = JSON.parse(JSON.stringify(response.data));
|
let obj = JSON.parse(JSON.stringify(response.data));
|
||||||
|
obj.info = tryToJson(obj.user?.userInfos || "{}")
|
||||||
|
obj.user = obj.user || {};
|
||||||
|
|
||||||
|
form.value = obj;
|
||||||
|
form.value.userId = obj.userId;
|
||||||
|
|
||||||
|
form.value.projectId = userStore.currentProId;
|
||||||
|
form.value.projectName = userStore.currentProName;
|
||||||
|
showEditUser(obj.user);
|
||||||
|
data.phoneState = "edit";
|
||||||
open.value = true;
|
open.value = true;
|
||||||
title.value = "修改劳务人员信息";
|
title.value = "修改劳务人员信息";
|
||||||
doImageUpload();
|
doImageUpload();
|
||||||
|
@ -514,11 +560,58 @@ function handleUpdate(row) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function showEditUser(user) {
|
||||||
|
user = user || {};
|
||||||
|
let info = tryToJson(user?.userInfos || "{}")
|
||||||
|
if (info.birthDay) {
|
||||||
|
let birthDay = dayjs(info.birthDay).format("YYYY-MM-DD");
|
||||||
|
info.birthDayStr = birthDay;
|
||||||
|
info.age = dayjs(new Date()).diff(info.birthDay, 'year');
|
||||||
|
}
|
||||||
|
form.value.userPhone = user.phonenumber
|
||||||
|
form.value.userName = user.userName;
|
||||||
|
form.value.certificateType = user.cardType;
|
||||||
|
form.value.certificateCode = user.cardCode;
|
||||||
|
form.value.faceImage = user.userPicture;
|
||||||
|
form.value.certificatePhoto1 = user.cardImgPos;
|
||||||
|
form.value.certificatePhoto2 = user.cardImgInv;
|
||||||
|
|
||||||
|
form.value.nation = info.nation;
|
||||||
|
form.value.sex = user.sex;
|
||||||
|
form.value.educationalType = info.educationalType;
|
||||||
|
form.value.birthDay = info.birthDay;
|
||||||
|
form.value.nativePlace = info.nativePlace;
|
||||||
|
form.value.address = info.address;
|
||||||
|
form.value.emergencyContact = info.emergencyContact;
|
||||||
|
form.value.contactPhone = info.contactPhone;
|
||||||
|
form.value.bankName = info.bankName;
|
||||||
|
form.value.bankCardNo = info.bankCardNo;
|
||||||
|
form.value.bankOffice = info.bankOffice;
|
||||||
|
|
||||||
|
}
|
||||||
|
function imgUrl(url){
|
||||||
|
if(url.indexOf("http://")>=0||url.indexOf("https://")>=0){
|
||||||
|
return url;
|
||||||
|
}
|
||||||
|
return location.origin+url;
|
||||||
|
}
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
function submitForm() {
|
function submitForm() {
|
||||||
proxy.$refs["proProjectInfoSubdeptsUsersRef"].validate(valid => {
|
proxy.$refs["proProjectInfoSubdeptsUsersRef"].validate(valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
let depts = data.subdepts.filter(d => d.id == form.value.subDeptId);
|
let depts = data.subdepts.filter(d => d.id == form.value.subDeptId);
|
||||||
|
let info=form.value.info;
|
||||||
|
info.nation=form.value.nation;
|
||||||
|
info.educationalType=form.value.educationalType;
|
||||||
|
info.birthDay=form.value.birthDay;
|
||||||
|
info.nativePlace=form.value.nativePlace;
|
||||||
|
info.address=form.value.address;
|
||||||
|
info.emergencyContact=form.value.emergencyContact;
|
||||||
|
info.emergencyContact= form.value.emergencyContact;
|
||||||
|
info.contactPhone=form.value.contactPhone;
|
||||||
|
info.bankName=form.value.bankName;
|
||||||
|
info.bankCardNo= form.value.bankCardNo;
|
||||||
|
info.bankOffice= form.value.bankOffice;
|
||||||
form.value.subDeptName = depts.length > 0 ? depts[0].subDeptName : '';
|
form.value.subDeptName = depts.length > 0 ? depts[0].subDeptName : '';
|
||||||
form.value.comId = depts.length > 0 ? depts[0].comId : '';
|
form.value.comId = depts.length > 0 ? depts[0].comId : '';
|
||||||
let groups = data.deptGroups.filter(d => d.id == form.value.subDeptGroup);
|
let groups = data.deptGroups.filter(d => d.id == form.value.subDeptGroup);
|
||||||
|
@ -533,25 +626,16 @@ function submitForm() {
|
||||||
userType: 99,
|
userType: 99,
|
||||||
cardType: form.value.certificateType,
|
cardType: form.value.certificateType,
|
||||||
cardCode: form.value.certificateCode,
|
cardCode: form.value.certificateCode,
|
||||||
userPicture:form.value.faceImage,
|
userPicture: imgUrl(form.value.faceImage),
|
||||||
cardImgPos: form.value.certificatePhoto1,
|
cardImgPos: form.value.certificatePhoto1,
|
||||||
cardImgInv: form.value.certificatePhoto2,
|
cardImgInv: form.value.certificatePhoto2,
|
||||||
userInfos:JSON.stringify({nation:form.value.nation,
|
userInfos: JSON.stringify(info),
|
||||||
educationalType:form.value.educationalType,
|
|
||||||
birthDay:form.value.birthDay,
|
|
||||||
nativePlace:form.value.nativePlace,
|
|
||||||
address:form.value.address,
|
|
||||||
emergencyContact:form.value.emergencyContact,
|
|
||||||
contactPhone:form.value.contactPhone,
|
|
||||||
bankName:form.value.bankName,
|
|
||||||
bankCardNo:form.value.bankCardNo,
|
|
||||||
bankOffice:form.value.bankOffice
|
|
||||||
}),
|
|
||||||
phonenumber: form.value.userPhone,
|
phonenumber: form.value.userPhone,
|
||||||
sex: form.value.sex,
|
sex: form.value.sex,
|
||||||
avatar: form.value.faceImage
|
avatar: form.value.faceImage
|
||||||
};
|
};
|
||||||
if (form.value.id != null) {
|
if (form.value.id != null) {
|
||||||
|
form.value.user.userId = form.value.userId;
|
||||||
updateProProjectInfoSubdeptsUsers(form.value).then(response => {
|
updateProProjectInfoSubdeptsUsers(form.value).then(response => {
|
||||||
proxy.$modal.msgSuccess("修改成功");
|
proxy.$modal.msgSuccess("修改成功");
|
||||||
open.value = false;
|
open.value = false;
|
||||||
|
@ -628,6 +712,7 @@ loadSubDepts();
|
||||||
.el-upload__tip {
|
.el-upload__tip {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-upload-list--picture-card {
|
.el-upload-list--picture-card {
|
||||||
.el-upload-list__item {
|
.el-upload-list__item {
|
||||||
width: 240px;
|
width: 240px;
|
||||||
|
@ -651,6 +736,7 @@ loadSubDepts();
|
||||||
.el-upload__tip {
|
.el-upload__tip {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-upload-list--picture-card {
|
.el-upload-list--picture-card {
|
||||||
.el-upload-list__item {
|
.el-upload-list__item {
|
||||||
width: 240px;
|
width: 240px;
|
||||||
|
|
Loading…
Reference in New Issue