Commit 15d2a115 authored by 赵啸非's avatar 赵啸非

添加适配直连考勤机定时任务代码

parent c993d21a
package com.mortals.xhx.daemon.task; package com.mortals.xhx.daemon.task;
import cn.hutool.http.HttpUtil;
import com.mortals.framework.exception.AppException; import com.mortals.framework.exception.AppException;
import com.mortals.framework.service.ITask; import com.mortals.framework.service.ITask;
import com.mortals.framework.service.ITaskExcuteService; import com.mortals.framework.service.ITaskExcuteService;
import com.mortals.framework.utils.ServletUtils; import com.mortals.framework.utils.ServletUtils;
import com.mortals.xhx.base.system.upload.service.UploadService; import com.mortals.xhx.base.system.upload.service.UploadService;
import com.mortals.xhx.module.door.model.DoorEntity;
import com.mortals.xhx.module.door.model.DoorQuery;
import com.mortals.xhx.module.door.service.DoorService;
import com.mortals.xhx.module.hik.face.model.req.img.ImgReq; import com.mortals.xhx.module.hik.face.model.req.img.ImgReq;
import com.mortals.xhx.module.hik.face.service.IHikFaceService; import com.mortals.xhx.module.hik.face.service.IHikFaceService;
import com.mortals.xhx.module.staff.model.StaffEntity; import com.mortals.xhx.module.staff.model.StaffEntity;
import com.mortals.xhx.module.staff.model.StaffQuery; import com.mortals.xhx.module.staff.model.StaffQuery;
import com.mortals.xhx.module.staff.service.StaffService; import com.mortals.xhx.module.staff.service.StaffService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import java.io.ByteArrayInputStream;
import java.io.InputStream; import java.io.InputStream;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -38,11 +38,25 @@ public class SyncRegisterUserPicTaskImpl implements ITaskExcuteService { ...@@ -38,11 +38,25 @@ public class SyncRegisterUserPicTaskImpl implements ITaskExcuteService {
@Autowired @Autowired
private StaffService staffService; private StaffService staffService;
@Value("${hik.host:}")
protected String hikhost;
@Autowired
private DoorService doorService;
@Override @Override
public void excuteTask(ITask task) throws AppException { public void excuteTask(ITask task) throws AppException {
log.info("同步员工照片任务"); log.info("同步员工照片任务");
syncRegisterUsersPhotos(); if (!ObjectUtils.isEmpty(hikhost)) {
staffService.syncRegisterUsersPhotos();
} else {
List<DoorEntity> doorEntities = doorService.find(new DoorQuery());
for (DoorEntity doorEntity : doorEntities) {
//todo 直连设备
}
}
// syncRegisterUsersPhotos();
log.info("同步员工任务照片完成"); log.info("同步员工任务照片完成");
} }
...@@ -53,7 +67,6 @@ public class SyncRegisterUserPicTaskImpl implements ITaskExcuteService { ...@@ -53,7 +67,6 @@ public class SyncRegisterUserPicTaskImpl implements ITaskExcuteService {
.filter(item -> ObjectUtils.isEmpty(item.getPhotoPath())) .filter(item -> ObjectUtils.isEmpty(item.getPhotoPath()))
.filter(item -> !ObjectUtils.isEmpty(item.getPicUri())).collect(Collectors.toList()); .filter(item -> !ObjectUtils.isEmpty(item.getPicUri())).collect(Collectors.toList());
for (StaffEntity staff : staffList) { for (StaffEntity staff : staffList) {
ImgReq imgReq = new ImgReq(); ImgReq imgReq = new ImgReq();
imgReq.setServerIndexCode(staff.getServerIndexCode()); imgReq.setServerIndexCode(staff.getServerIndexCode());
......
...@@ -23,6 +23,7 @@ import com.mortals.xhx.module.staff.service.StaffLeaveService; ...@@ -23,6 +23,7 @@ import com.mortals.xhx.module.staff.service.StaffLeaveService;
import com.mortals.xhx.module.staff.service.StaffService; import com.mortals.xhx.module.staff.service.StaffService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
...@@ -47,10 +48,13 @@ public class SyncUserTaskImpl implements ITaskExcuteService { ...@@ -47,10 +48,13 @@ public class SyncUserTaskImpl implements ITaskExcuteService {
private IHikPersonService hikPersonService; private IHikPersonService hikPersonService;
@Autowired @Autowired
private IDingPersonService dingPersonService; private IDingPersonService dingPersonService;
@Value("${hik.host:}")
protected String hikhost;
@Override @Override
public void excuteTask(ITask task) throws AppException { public void excuteTask(ITask task) throws AppException {
try { try {
if (!ObjectUtils.isEmpty(hikhost)) {
log.info("同步部门"); log.info("同步部门");
deptService.syncDept(null); deptService.syncDept(null);
log.info("同步用户"); log.info("同步用户");
...@@ -94,6 +98,17 @@ public class SyncUserTaskImpl implements ITaskExcuteService { ...@@ -94,6 +98,17 @@ public class SyncUserTaskImpl implements ITaskExcuteService {
} catch (Exception e) { } catch (Exception e) {
log.error("同步钉钉usreId失败"); log.error("同步钉钉usreId失败");
} }
} else {
//todo 设备直连
deptService.syncDeptByDevice(null);
staffService.syncPersonsByDevices(null);
}
} catch (Exception e) { } catch (Exception e) {
log.error("同步人事异常", e); log.error("同步人事异常", e);
} }
......
...@@ -91,4 +91,12 @@ public interface DeptService extends ICRUDService<DeptEntity, Long> { ...@@ -91,4 +91,12 @@ public interface DeptService extends ICRUDService<DeptEntity, Long> {
*/ */
Rest<String> syncDept(Context context); Rest<String> syncDept(Context context);
/**
* 通过设备同步部门信息
* @param context
* @return
*/
Rest<String> syncDeptByDevice(Context context);
} }
\ No newline at end of file
...@@ -341,4 +341,12 @@ public class DeptServiceImpl extends AbstractCRUDServiceImpl<DeptDao, DeptEntity ...@@ -341,4 +341,12 @@ public class DeptServiceImpl extends AbstractCRUDServiceImpl<DeptDao, DeptEntity
return Rest.ok(); return Rest.ok();
} }
@Override
public Rest<String> syncDeptByDevice(Context context) {
//todo
return Rest.ok();
}
} }
package com.mortals.xhx.module.door.model; package com.mortals.xhx.module.door.model;
import java.util.List;
import java.util.ArrayList;
import java.math.BigDecimal;
import cn.hutool.core.date.DateUtil;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.door.model.vo.DoorVo; import com.mortals.xhx.module.door.model.vo.DoorVo;
import lombok.Data; import lombok.Data;
/** /**
* 门禁设备实体对象 * 门禁设备实体对象
* *
* @author zxfei * @author zxfei
* @date 2023-11-22 * @date 2024-03-18
*/ */
@Data @Data
public class DoorEntity extends DoorVo { public class DoorEntity extends DoorVo {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
...@@ -35,6 +43,18 @@ public class DoorEntity extends DoorVo { ...@@ -35,6 +43,18 @@ public class DoorEntity extends DoorVo {
* 密码 * 密码
*/ */
private String password; private String password;
/**
* 所属部门id
*/
private String deptId;
/**
* 所属部门名称
*/
private String deptName;
/**
* 备注
*/
private String remark;
@Override @Override
public int hashCode() { public int hashCode() {
return this.getId().hashCode(); return this.getId().hashCode();
...@@ -58,5 +78,8 @@ public class DoorEntity extends DoorVo { ...@@ -58,5 +78,8 @@ public class DoorEntity extends DoorVo {
this.port = 0; this.port = 0;
this.username = ""; this.username = "";
this.password = ""; this.password = "";
this.deptId = "";
this.deptName = "";
this.remark = "";
} }
} }
\ No newline at end of file
package com.mortals.xhx.module.door.model; package com.mortals.xhx.module.door.model;
import java.util.List; import java.util.List;
import com.mortals.xhx.module.door.model.DoorEntity;
/** /**
* 门禁设备查询对象 * 门禁设备查询对象
* *
* @author zxfei * @author zxfei
* @date 2023-11-22 * @date 2024-03-18
*/ */
public class DoorQuery extends DoorEntity { public class DoorQuery extends DoorEntity {
/** 开始 序号,主键,自增长 */ /** 开始 序号,主键,自增长 */
private Long idStart; private Long idStart;
...@@ -106,6 +106,21 @@ public class DoorQuery extends DoorEntity { ...@@ -106,6 +106,21 @@ public class DoorQuery extends DoorEntity {
/** 结束 修改时间 */ /** 结束 修改时间 */
private String updateTimeEnd; private String updateTimeEnd;
/** 所属部门id */
private List<String> deptIdList;
/** 所属部门id排除列表 */
private List <String> deptIdNotList;
/** 所属部门名称 */
private List<String> deptNameList;
/** 所属部门名称排除列表 */
private List <String> deptNameNotList;
/** 备注 */
private List<String> remarkList;
/** 备注排除列表 */
private List <String> remarkNotList;
/** OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4) */ /** OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4) */
private List<DoorQuery> orConditionList; private List<DoorQuery> orConditionList;
...@@ -662,6 +677,102 @@ public class DoorQuery extends DoorEntity { ...@@ -662,6 +677,102 @@ public class DoorQuery extends DoorEntity {
this.updateTimeEnd = updateTimeEnd; this.updateTimeEnd = updateTimeEnd;
} }
/**
* 获取 所属部门id
* @return deptIdList
*/
public List<String> getDeptIdList(){
return this.deptIdList;
}
/**
* 设置 所属部门id
* @param deptIdList
*/
public void setDeptIdList(List<String> deptIdList){
this.deptIdList = deptIdList;
}
/**
* 获取 所属部门id
* @return deptIdNotList
*/
public List<String> getDeptIdNotList(){
return this.deptIdNotList;
}
/**
* 设置 所属部门id
* @param deptIdNotList
*/
public void setDeptIdNotList(List<String> deptIdNotList){
this.deptIdNotList = deptIdNotList;
}
/**
* 获取 所属部门名称
* @return deptNameList
*/
public List<String> getDeptNameList(){
return this.deptNameList;
}
/**
* 设置 所属部门名称
* @param deptNameList
*/
public void setDeptNameList(List<String> deptNameList){
this.deptNameList = deptNameList;
}
/**
* 获取 所属部门名称
* @return deptNameNotList
*/
public List<String> getDeptNameNotList(){
return this.deptNameNotList;
}
/**
* 设置 所属部门名称
* @param deptNameNotList
*/
public void setDeptNameNotList(List<String> deptNameNotList){
this.deptNameNotList = deptNameNotList;
}
/**
* 获取 备注
* @return remarkList
*/
public List<String> getRemarkList(){
return this.remarkList;
}
/**
* 设置 备注
* @param remarkList
*/
public void setRemarkList(List<String> remarkList){
this.remarkList = remarkList;
}
/**
* 获取 备注
* @return remarkNotList
*/
public List<String> getRemarkNotList(){
return this.remarkNotList;
}
/**
* 设置 备注
* @param remarkNotList
*/
public void setRemarkNotList(List<String> remarkNotList){
this.remarkNotList = remarkNotList;
}
/** /**
* 设置 序号,主键,自增长 * 设置 序号,主键,自增长
* @param id * @param id
...@@ -975,6 +1086,63 @@ public class DoorQuery extends DoorEntity { ...@@ -975,6 +1086,63 @@ public class DoorQuery extends DoorEntity {
} }
/**
* 设置 所属部门id
* @param deptId
*/
public DoorQuery deptId(String deptId){
setDeptId(deptId);
return this;
}
/**
* 设置 所属部门id
* @param deptIdList
*/
public DoorQuery deptIdList(List<String> deptIdList){
this.deptIdList = deptIdList;
return this;
}
/**
* 设置 所属部门名称
* @param deptName
*/
public DoorQuery deptName(String deptName){
setDeptName(deptName);
return this;
}
/**
* 设置 所属部门名称
* @param deptNameList
*/
public DoorQuery deptNameList(List<String> deptNameList){
this.deptNameList = deptNameList;
return this;
}
/**
* 设置 备注
* @param remark
*/
public DoorQuery remark(String remark){
setRemark(remark);
return this;
}
/**
* 设置 备注
* @param remarkList
*/
public DoorQuery remarkList(List<String> remarkList){
this.remarkList = remarkList;
return this;
}
/** /**
* 获取 OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4) * 获取 OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4)
* @return orConditionList * @return orConditionList
......
...@@ -51,11 +51,6 @@ public class DoorServiceImpl extends AbstractCRUDServiceImpl<DoorDao, DoorEntity ...@@ -51,11 +51,6 @@ public class DoorServiceImpl extends AbstractCRUDServiceImpl<DoorDao, DoorEntity
@Autowired @Autowired
private IHikDoorService hikDoorService; private IHikDoorService hikDoorService;
private Integer day;
@Autowired
private ICacheService cacheService;
@Override @Override
public Rest<Void> syncDoorDeviceEvents(DoorEntity doorEntity, HikDoorEventReq hikDoorEventReq) { public Rest<Void> syncDoorDeviceEvents(DoorEntity doorEntity, HikDoorEventReq hikDoorEventReq) {
......
...@@ -53,4 +53,10 @@ public interface StaffService extends ICRUDCacheService<StaffEntity,Long> { ...@@ -53,4 +53,10 @@ public interface StaffService extends ICRUDCacheService<StaffEntity,Long> {
*/ */
void doUpdateSala(); void doUpdateSala();
/**
* 通过海康云同步用户 照片
* @return
*/
Rest<Void> syncRegisterUsersPhotos();
} }
\ No newline at end of file
...@@ -9,10 +9,12 @@ import com.mortals.framework.model.Context; ...@@ -9,10 +9,12 @@ import com.mortals.framework.model.Context;
import com.mortals.framework.model.PageInfo; import com.mortals.framework.model.PageInfo;
import com.mortals.framework.service.impl.AbstractCRUDCacheServiceImpl; import com.mortals.framework.service.impl.AbstractCRUDCacheServiceImpl;
import com.mortals.framework.util.SecurityUtil; import com.mortals.framework.util.SecurityUtil;
import com.mortals.framework.utils.ServletUtils;
import com.mortals.xhx.base.system.idgenerator.service.IdgeneratorService; import com.mortals.xhx.base.system.idgenerator.service.IdgeneratorService;
import com.mortals.xhx.base.system.idgenerator.service.impl.IdgeneratorServiceImpl; import com.mortals.xhx.base.system.idgenerator.service.impl.IdgeneratorServiceImpl;
import com.mortals.xhx.base.system.role.model.RoleUserQuery; import com.mortals.xhx.base.system.role.model.RoleUserQuery;
import com.mortals.xhx.base.system.role.service.RoleUserService; import com.mortals.xhx.base.system.role.service.RoleUserService;
import com.mortals.xhx.base.system.upload.service.UploadService;
import com.mortals.xhx.base.system.user.model.UserEntity; import com.mortals.xhx.base.system.user.model.UserEntity;
import com.mortals.xhx.base.system.user.service.UserService; import com.mortals.xhx.base.system.user.service.UserService;
import com.mortals.xhx.common.code.*; import com.mortals.xhx.common.code.*;
...@@ -26,6 +28,8 @@ import com.mortals.xhx.module.dept.service.DeptService; ...@@ -26,6 +28,8 @@ import com.mortals.xhx.module.dept.service.DeptService;
import com.mortals.xhx.module.door.model.DoorEntity; import com.mortals.xhx.module.door.model.DoorEntity;
import com.mortals.xhx.module.door.model.DoorQuery; import com.mortals.xhx.module.door.model.DoorQuery;
import com.mortals.xhx.module.door.service.DoorService; import com.mortals.xhx.module.door.service.DoorService;
import com.mortals.xhx.module.hik.face.model.req.img.ImgReq;
import com.mortals.xhx.module.hik.face.service.IHikFaceService;
import com.mortals.xhx.module.hik.person.model.req.person.PersonReq; import com.mortals.xhx.module.hik.person.model.req.person.PersonReq;
import com.mortals.xhx.module.hik.person.model.rsp.person.PersonDataInfo; import com.mortals.xhx.module.hik.person.model.rsp.person.PersonDataInfo;
import com.mortals.xhx.module.hik.person.model.rsp.person.PersonInfo; import com.mortals.xhx.module.hik.person.model.rsp.person.PersonInfo;
...@@ -51,7 +55,9 @@ import org.apache.commons.collections4.CollectionUtils; ...@@ -51,7 +55,9 @@ import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.web.multipart.MultipartFile;
import java.io.InputStream;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -95,6 +101,11 @@ public class StaffServiceImpl extends AbstractCRUDCacheServiceImpl<StaffDao, Sta ...@@ -95,6 +101,11 @@ public class StaffServiceImpl extends AbstractCRUDCacheServiceImpl<StaffDao, Sta
@Autowired @Autowired
private IHikStaffService hikStaffService; private IHikStaffService hikStaffService;
@Autowired
private UploadService uploadService;
@Autowired
private IHikFaceService hikFaceService;
@Override @Override
protected String getExtKey(StaffEntity data) { protected String getExtKey(StaffEntity data) {
//工号作为redis 扩展key //工号作为redis 扩展key
...@@ -178,13 +189,13 @@ public class StaffServiceImpl extends AbstractCRUDCacheServiceImpl<StaffDao, Sta ...@@ -178,13 +189,13 @@ public class StaffServiceImpl extends AbstractCRUDCacheServiceImpl<StaffDao, Sta
staffEntity.initAttrValue(); staffEntity.initAttrValue();
if (!ObjectUtils.isEmpty(deptEntity)) { if (!ObjectUtils.isEmpty(deptEntity)) {
staffEntity.setDeptId(deptEntity.getId()); staffEntity.setDeptId(deptEntity.getId());
if(deptEntity.getParentId()==71l){ if (deptEntity.getParentId() == 71l) {
//市民中心id为71,代表是大厅 //市民中心id为71,代表是大厅
staffEntity.setSalaId(deptEntity.getId()); staffEntity.setSalaId(deptEntity.getId());
staffEntity.setSalaName(deptEntity.getDeptName()); staffEntity.setSalaName(deptEntity.getDeptName());
}else { } else {
DeptEntity salaEntity = deptService.get(deptEntity.getParentId()); DeptEntity salaEntity = deptService.get(deptEntity.getParentId());
if(!ObjectUtils.isEmpty(salaEntity)){ if (!ObjectUtils.isEmpty(salaEntity)) {
staffEntity.setSalaId(salaEntity.getId()); staffEntity.setSalaId(salaEntity.getId());
staffEntity.setSalaName(salaEntity.getDeptName()); staffEntity.setSalaName(salaEntity.getDeptName());
} }
...@@ -192,8 +203,8 @@ public class StaffServiceImpl extends AbstractCRUDCacheServiceImpl<StaffDao, Sta ...@@ -192,8 +203,8 @@ public class StaffServiceImpl extends AbstractCRUDCacheServiceImpl<StaffDao, Sta
} }
staffEntity.setName(personInfo.getPersonName()); staffEntity.setName(personInfo.getPersonName());
staffEntity.setRemarkId(personInfo.getPersonId()); staffEntity.setRemarkId(personInfo.getPersonId());
staffEntity.setPicUri(personInfo.getPersonPhoto()==null?"":personInfo.getPersonPhoto().getPicUri()); staffEntity.setPicUri(personInfo.getPersonPhoto() == null ? "" : personInfo.getPersonPhoto().getPicUri());
staffEntity.setServerIndexCode(personInfo.getPersonPhoto()==null?"":personInfo.getPersonPhoto().getServerIndexCode()); staffEntity.setServerIndexCode(personInfo.getPersonPhoto() == null ? "" : personInfo.getPersonPhoto().getServerIndexCode());
staffEntity.setDeptName(personInfo.getOrgName()); staffEntity.setDeptName(personInfo.getOrgName());
staffEntity.setGender(personInfo.getGender()); staffEntity.setGender(personInfo.getGender());
staffEntity.setWorkNum(personInfo.getJobNo()); staffEntity.setWorkNum(personInfo.getJobNo());
...@@ -205,13 +216,13 @@ public class StaffServiceImpl extends AbstractCRUDCacheServiceImpl<StaffDao, Sta ...@@ -205,13 +216,13 @@ public class StaffServiceImpl extends AbstractCRUDCacheServiceImpl<StaffDao, Sta
//更新 //更新
if (!ObjectUtils.isEmpty(deptEntity)) { if (!ObjectUtils.isEmpty(deptEntity)) {
staffEntity.setDeptId(deptEntity.getId()); staffEntity.setDeptId(deptEntity.getId());
if(deptEntity.getParentId()==71l){ if (deptEntity.getParentId() == 71l) {
//市民中心id为71,代表是大厅 //市民中心id为71,代表是大厅
staffEntity.setSalaId(deptEntity.getId()); staffEntity.setSalaId(deptEntity.getId());
staffEntity.setSalaName(deptEntity.getDeptName()); staffEntity.setSalaName(deptEntity.getDeptName());
}else { } else {
DeptEntity salaEntity = deptService.get(deptEntity.getParentId()); DeptEntity salaEntity = deptService.get(deptEntity.getParentId());
if(!ObjectUtils.isEmpty(salaEntity)){ if (!ObjectUtils.isEmpty(salaEntity)) {
staffEntity.setSalaId(salaEntity.getId()); staffEntity.setSalaId(salaEntity.getId());
staffEntity.setSalaName(salaEntity.getDeptName()); staffEntity.setSalaName(salaEntity.getDeptName());
} }
...@@ -219,8 +230,8 @@ public class StaffServiceImpl extends AbstractCRUDCacheServiceImpl<StaffDao, Sta ...@@ -219,8 +230,8 @@ public class StaffServiceImpl extends AbstractCRUDCacheServiceImpl<StaffDao, Sta
} }
staffEntity.setName(personInfo.getPersonName()); staffEntity.setName(personInfo.getPersonName());
staffEntity.setRemarkId(personInfo.getPersonId()); staffEntity.setRemarkId(personInfo.getPersonId());
staffEntity.setPicUri(personInfo.getPersonPhoto()==null?"":personInfo.getPersonPhoto().getPicUri()); staffEntity.setPicUri(personInfo.getPersonPhoto() == null ? "" : personInfo.getPersonPhoto().getPicUri());
staffEntity.setServerIndexCode(personInfo.getPersonPhoto()==null?"":personInfo.getPersonPhoto().getServerIndexCode()); staffEntity.setServerIndexCode(personInfo.getPersonPhoto() == null ? "" : personInfo.getPersonPhoto().getServerIndexCode());
staffEntity.setDeptName(personInfo.getOrgName()); staffEntity.setDeptName(personInfo.getOrgName());
staffEntity.setGender(personInfo.getGender()); staffEntity.setGender(personInfo.getGender());
staffEntity.setWorkNum(personInfo.getJobNo()); staffEntity.setWorkNum(personInfo.getJobNo());
...@@ -279,7 +290,7 @@ public class StaffServiceImpl extends AbstractCRUDCacheServiceImpl<StaffDao, Sta ...@@ -279,7 +290,7 @@ public class StaffServiceImpl extends AbstractCRUDCacheServiceImpl<StaffDao, Sta
// if (!ObjectUtils.isEmpty(attendanceGroupStaffEntities)) { // if (!ObjectUtils.isEmpty(attendanceGroupStaffEntities)) {
// attendanceGroupStaffService.removeList(attendanceGroupStaffEntities,context); // attendanceGroupStaffService.removeList(attendanceGroupStaffEntities,context);
// } // }
Long[] groudStaffIds = attendanceGroupStaffService.find(new AttendanceGroupStaffQuery().staffId(staff.getId())).stream().map(i->i.getId()).toArray(Long[]::new); Long[] groudStaffIds = attendanceGroupStaffService.find(new AttendanceGroupStaffQuery().staffId(staff.getId())).stream().map(i -> i.getId()).toArray(Long[]::new);
if (!ObjectUtils.isEmpty(groudStaffIds)) { if (!ObjectUtils.isEmpty(groudStaffIds)) {
attendanceGroupStaffService.remove(groudStaffIds, null); attendanceGroupStaffService.remove(groudStaffIds, null);
} }
...@@ -292,7 +303,6 @@ public class StaffServiceImpl extends AbstractCRUDCacheServiceImpl<StaffDao, Sta ...@@ -292,7 +303,6 @@ public class StaffServiceImpl extends AbstractCRUDCacheServiceImpl<StaffDao, Sta
} }
@Override @Override
protected void saveAfter(StaffEntity entity, Context context) throws AppException { protected void saveAfter(StaffEntity entity, Context context) throws AppException {
super.saveAfter(entity, context); super.saveAfter(entity, context);
...@@ -379,7 +389,6 @@ public class StaffServiceImpl extends AbstractCRUDCacheServiceImpl<StaffDao, Sta ...@@ -379,7 +389,6 @@ public class StaffServiceImpl extends AbstractCRUDCacheServiceImpl<StaffDao, Sta
} }
@Override @Override
protected StaffEntity findBefore(StaffEntity params, PageInfo pageInfo, Context context) throws AppException { protected StaffEntity findBefore(StaffEntity params, PageInfo pageInfo, Context context) throws AppException {
if (params.getDeptId() != null) { if (params.getDeptId() != null) {
...@@ -394,77 +403,77 @@ public class StaffServiceImpl extends AbstractCRUDCacheServiceImpl<StaffDao, Sta ...@@ -394,77 +403,77 @@ public class StaffServiceImpl extends AbstractCRUDCacheServiceImpl<StaffDao, Sta
params.setDeptIdList(deptIdList); params.setDeptIdList(deptIdList);
} }
} }
if(params.getStatus()==null && CollectionUtils.isEmpty(params.getStatusList())){ if (params.getStatus() == null && CollectionUtils.isEmpty(params.getStatusList())) {
params.setStatusList(Arrays.asList(StaffSatusEnum.正式.getValue(), StaffSatusEnum.试用.getValue())); params.setStatusList(Arrays.asList(StaffSatusEnum.正式.getValue(), StaffSatusEnum.试用.getValue()));
} }
return params; return params;
} }
@Override @Override
public int checkAuthorize(StaffCheckAuthorizePdu pdu,Context context) throws AppException { public int checkAuthorize(StaffCheckAuthorizePdu pdu, Context context) throws AppException {
StaffEntity temp = this.get(pdu.getStaffId()); StaffEntity temp = this.get(pdu.getStaffId());
if(temp == null){ if (temp == null) {
throw new AppException("人员信息ID不正确"); throw new AppException("人员信息ID不正确");
} }
CheckTypeEnum checkTypeEnum = CheckTypeEnum.getByValue(pdu.getType()); CheckTypeEnum checkTypeEnum = CheckTypeEnum.getByValue(pdu.getType());
if(checkTypeEnum==null){ if (checkTypeEnum == null) {
throw new AppException("考核类型不正确"); throw new AppException("考核类型不正确");
} }
StaffEntity update = new StaffEntity(); StaffEntity update = new StaffEntity();
update.setId(pdu.getStaffId()); update.setId(pdu.getStaffId());
//1.考勤绩效,2.评价绩效,3.办件绩效,4.效能绩效,5.其它绩效,6.投诉绩效 //1.考勤绩效,2.评价绩效,3.办件绩效,4.效能绩效,5.其它绩效,6.投诉绩效
switch(checkTypeEnum){ switch (checkTypeEnum) {
case 考勤绩效: case 考勤绩效:
if(temp.getAttendCheck()==1){ if (temp.getAttendCheck() == 1) {
update.setAttendCheck(0); update.setAttendCheck(0);
}else { } else {
update.setAttendCheck(1); update.setAttendCheck(1);
} }
break; break;
case 评价绩效: case 评价绩效:
if(temp.getComplainCheck()==1){ if (temp.getComplainCheck() == 1) {
update.setComplainCheck(0); update.setComplainCheck(0);
}else { } else {
update.setComplainCheck(1); update.setComplainCheck(1);
} }
break; break;
case 办件绩效: case 办件绩效:
if(temp.getGoworkCheck()==1){ if (temp.getGoworkCheck() == 1) {
update.setGoworkCheck(0); update.setGoworkCheck(0);
}else { } else {
update.setGoworkCheck(1); update.setGoworkCheck(1);
} }
break; break;
case 效能绩效: case 效能绩效:
if(temp.getEffectCheck()==1){ if (temp.getEffectCheck() == 1) {
update.setEffectCheck(0); update.setEffectCheck(0);
}else { } else {
update.setEffectCheck(1); update.setEffectCheck(1);
} }
break; break;
case 其它绩效: case 其它绩效:
if(temp.getOtherCheck()==1){ if (temp.getOtherCheck() == 1) {
update.setOtherCheck(0); update.setOtherCheck(0);
}else { } else {
update.setOtherCheck(1); update.setOtherCheck(1);
} }
break; break;
case 投诉绩效: case 投诉绩效:
if(temp.getReviewCheck()==1){ if (temp.getReviewCheck() == 1) {
update.setReviewCheck(0); update.setReviewCheck(0);
}else { } else {
update.setReviewCheck(1); update.setReviewCheck(1);
} }
break; break;
default: default:
if(temp.getOtherCheck()==1){ if (temp.getOtherCheck() == 1) {
update.setOtherCheck(0); update.setOtherCheck(0);
}else { } else {
update.setOtherCheck(1); update.setOtherCheck(1);
} }
} }
update.setUpdateTime(new Date()); update.setUpdateTime(new Date());
if(context.getUser()!=null) { if (context.getUser() != null) {
update.setUpdateUserId(context.getUser().getId()); update.setUpdateUserId(context.getUser().getId());
} }
return dao.update(update); return dao.update(update);
...@@ -473,15 +482,15 @@ public class StaffServiceImpl extends AbstractCRUDCacheServiceImpl<StaffDao, Sta ...@@ -473,15 +482,15 @@ public class StaffServiceImpl extends AbstractCRUDCacheServiceImpl<StaffDao, Sta
@Override @Override
public void doUpdateSala() { public void doUpdateSala() {
List<StaffEntity> staffList = this.getAllList(); List<StaffEntity> staffList = this.getAllList();
for(StaffEntity staffEntity:staffList){ for (StaffEntity staffEntity : staffList) {
DeptEntity deptEntity = deptService.get(staffEntity.getDeptId()); DeptEntity deptEntity = deptService.get(staffEntity.getDeptId());
if(deptEntity.getParentId()==71l){ if (deptEntity.getParentId() == 71l) {
//市民中心id为71,代表是大厅 //市民中心id为71,代表是大厅
staffEntity.setSalaId(deptEntity.getId()); staffEntity.setSalaId(deptEntity.getId());
staffEntity.setSalaName(deptEntity.getDeptName()); staffEntity.setSalaName(deptEntity.getDeptName());
}else { } else {
DeptEntity salaEntity = deptService.get(deptEntity.getParentId()); DeptEntity salaEntity = deptService.get(deptEntity.getParentId());
if(!ObjectUtils.isEmpty(salaEntity)){ if (!ObjectUtils.isEmpty(salaEntity)) {
staffEntity.setSalaId(salaEntity.getId()); staffEntity.setSalaId(salaEntity.getId());
staffEntity.setSalaName(salaEntity.getDeptName()); staffEntity.setSalaName(salaEntity.getDeptName());
} }
...@@ -491,6 +500,7 @@ public class StaffServiceImpl extends AbstractCRUDCacheServiceImpl<StaffDao, Sta ...@@ -491,6 +500,7 @@ public class StaffServiceImpl extends AbstractCRUDCacheServiceImpl<StaffDao, Sta
} }
@Override @Override
public Rest<Void> syncPersonsByDevices(Context context) { public Rest<Void> syncPersonsByDevices(Context context) {
log.info("同步人员!"); log.info("同步人员!");
...@@ -603,11 +613,6 @@ public class StaffServiceImpl extends AbstractCRUDCacheServiceImpl<StaffDao, Sta ...@@ -603,11 +613,6 @@ public class StaffServiceImpl extends AbstractCRUDCacheServiceImpl<StaffDao, Sta
if (count == 0) { if (count == 0) {
staffLeaveService.save(staffLeaveEntity); staffLeaveService.save(staffLeaveEntity);
} }
//考勤人员中有离职的 删除
// List<AttendanceGroupStaffEntity> attendanceGroupStaffEntities = attendanceGroupStaffService.find(new AttendanceGroupStaffQuery().staffId(staff.getId()));
// if (!ObjectUtils.isEmpty(attendanceGroupStaffEntities)) {
// attendanceGroupStaffService.removeList(attendanceGroupStaffEntities,context);
// }
Long[] groudStaffIds = attendanceGroupStaffService.find(new AttendanceGroupStaffQuery().staffId(staff.getId())).stream().map(m -> m.getId()).toArray(Long[]::new); Long[] groudStaffIds = attendanceGroupStaffService.find(new AttendanceGroupStaffQuery().staffId(staff.getId())).stream().map(m -> m.getId()).toArray(Long[]::new);
if (!ObjectUtils.isEmpty(groudStaffIds)) { if (!ObjectUtils.isEmpty(groudStaffIds)) {
attendanceGroupStaffService.remove(groudStaffIds, null); attendanceGroupStaffService.remove(groudStaffIds, null);
...@@ -616,16 +621,41 @@ public class StaffServiceImpl extends AbstractCRUDCacheServiceImpl<StaffDao, Sta ...@@ -616,16 +621,41 @@ public class StaffServiceImpl extends AbstractCRUDCacheServiceImpl<StaffDao, Sta
}); });
} }
} }
} }
} else {
} }
} }
return Rest.ok(); return Rest.ok();
} }
@Override
public Rest<Void> syncRegisterUsersPhotos() {
List<StaffEntity> staffList = this.find(new StaffQuery().source(1)).stream()
.filter(item -> ObjectUtils.isEmpty(item.getPhotoPath()))
.filter(item -> !ObjectUtils.isEmpty(item.getPicUri())).collect(Collectors.toList());
for (StaffEntity staff : staffList) {
ImgReq imgReq = new ImgReq();
imgReq.setServerIndexCode(staff.getServerIndexCode());
imgReq.setPicUri(staff.getPicUri());
try {
InputStream inputStream = hikFaceService.callPostImgs(imgReq);
if (!ObjectUtils.isEmpty(inputStream)) {
MultipartFile file = ServletUtils.getMultipartFile(inputStream, "photo.jpg");
String filePath = uploadService.saveFileUpload(file, "file/fileupload/staff", null);
staff.setPhotoPath(filePath);
this.update(staff);
} else {
log.error("获取图片异常!");
}
} catch (Exception e) {
log.error("下载图片异常", e.getMessage());
}
}
return Rest.ok();
}
public static void main(String[] args) { public static void main(String[] args) {
System.out.println("1" + StrUtil.padPre("125", 7, "0")); System.out.println("1" + StrUtil.padPre("125", 7, "0"));
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"mybatis-3-mapper.dtd"> "mybatis-3-mapper.dtd">
<mapper namespace="com.mortals.xhx.module.door.dao.ibatis.DoorDaoImpl"> <mapper namespace="com.mortals.xhx.module.door.dao.ibatis.DoorDaoImpl">
<!-- 字段和属性映射 --> <!-- 字段和属性映射 -->
...@@ -16,6 +16,9 @@ ...@@ -16,6 +16,9 @@
<result property="createUserId" column="createUserId" /> <result property="createUserId" column="createUserId" />
<result property="updateUserId" column="updateUserId" /> <result property="updateUserId" column="updateUserId" />
<result property="updateTime" column="updateTime" /> <result property="updateTime" column="updateTime" />
<result property="deptId" column="deptId" />
<result property="deptName" column="deptName" />
<result property="remark" column="remark" />
</resultMap> </resultMap>
...@@ -56,23 +59,32 @@ ...@@ -56,23 +59,32 @@
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('updateTime') or colPickMode == 1 and data.containsKey('updateTime')))"> <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('updateTime') or colPickMode == 1 and data.containsKey('updateTime')))">
a.updateTime, a.updateTime,
</if> </if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('deptId') or colPickMode == 1 and data.containsKey('deptId')))">
a.deptId,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('deptName') or colPickMode == 1 and data.containsKey('deptName')))">
a.deptName,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('remark') or colPickMode == 1 and data.containsKey('remark')))">
a.remark,
</if>
</trim> </trim>
</sql> </sql>
<!-- 新增 区分主键自增加还是业务插入 --> <!-- 新增 区分主键自增加还是业务插入 -->
<insert id="insert" parameterType="DoorEntity" useGeneratedKeys="true" keyProperty="id"> <insert id="insert" parameterType="DoorEntity" useGeneratedKeys="true" keyProperty="id">
insert into mortals_xhx_door insert into mortals_xhx_door
(deviceName,deviceCode,ip,port,username,password,createTime,createUserId,updateUserId,updateTime) (deviceName,deviceCode,ip,port,username,password,createTime,createUserId,updateUserId,updateTime,deptId,deptName,remark)
VALUES VALUES
(#{deviceName},#{deviceCode},#{ip},#{port},#{username},#{password},#{createTime},#{createUserId},#{updateUserId},#{updateTime}) (#{deviceName},#{deviceCode},#{ip},#{port},#{username},#{password},#{createTime},#{createUserId},#{updateUserId},#{updateTime},#{deptId},#{deptName},#{remark})
</insert> </insert>
<!-- 批量新增 --> <!-- 批量新增 -->
<insert id="insertBatch" parameterType="paramDto"> <insert id="insertBatch" parameterType="paramDto">
insert into mortals_xhx_door insert into mortals_xhx_door
(deviceName,deviceCode,ip,port,username,password,createTime,createUserId,updateUserId,updateTime) (deviceName,deviceCode,ip,port,username,password,createTime,createUserId,updateUserId,updateTime,deptId,deptName,remark)
VALUES VALUES
<foreach collection="data.dataList" item="item" index="index" separator="," > <foreach collection="data.dataList" item="item" index="index" separator="," >
(#{item.deviceName},#{item.deviceCode},#{item.ip},#{item.port},#{item.username},#{item.password},#{item.createTime},#{item.createUserId},#{item.updateUserId},#{item.updateTime}) (#{item.deviceName},#{item.deviceCode},#{item.ip},#{item.port},#{item.username},#{item.password},#{item.createTime},#{item.createUserId},#{item.updateUserId},#{item.updateTime},#{item.deptId},#{item.deptName},#{item.remark})
</foreach> </foreach>
</insert> </insert>
...@@ -121,6 +133,15 @@ ...@@ -121,6 +133,15 @@
<if test="(colPickMode==0 and data.containsKey('updateTime')) or (colPickMode==1 and !data.containsKey('updateTime'))"> <if test="(colPickMode==0 and data.containsKey('updateTime')) or (colPickMode==1 and !data.containsKey('updateTime'))">
a.updateTime=#{data.updateTime}, a.updateTime=#{data.updateTime},
</if> </if>
<if test="(colPickMode==0 and data.containsKey('deptId')) or (colPickMode==1 and !data.containsKey('deptId'))">
a.deptId=#{data.deptId},
</if>
<if test="(colPickMode==0 and data.containsKey('deptName')) or (colPickMode==1 and !data.containsKey('deptName'))">
a.deptName=#{data.deptName},
</if>
<if test="(colPickMode==0 and data.containsKey('remark')) or (colPickMode==1 and !data.containsKey('remark'))">
a.remark=#{data.remark},
</if>
</trim> </trim>
<trim suffixOverrides="where" suffix=""> <trim suffixOverrides="where" suffix="">
where where
...@@ -218,6 +239,27 @@ ...@@ -218,6 +239,27 @@
</if> </if>
</foreach> </foreach>
</trim> </trim>
<trim prefix="deptId=(case" suffix="ELSE deptId end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('deptId')) or (colPickMode==1 and !item.containsKey('deptId'))">
when a.id=#{item.id} then #{item.deptId}
</if>
</foreach>
</trim>
<trim prefix="deptName=(case" suffix="ELSE deptName end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('deptName')) or (colPickMode==1 and !item.containsKey('deptName'))">
when a.id=#{item.id} then #{item.deptName}
</if>
</foreach>
</trim>
<trim prefix="remark=(case" suffix="ELSE remark end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('remark')) or (colPickMode==1 and !item.containsKey('remark'))">
when a.id=#{item.id} then #{item.remark}
</if>
</foreach>
</trim>
</trim> </trim>
where id in where id in
<foreach collection="data.dataList" item="item" index="index" open="(" separator="," close=")"> <foreach collection="data.dataList" item="item" index="index" open="(" separator="," close=")">
...@@ -577,6 +619,69 @@ ...@@ -577,6 +619,69 @@
<if test="conditionParamRef.containsKey('updateTimeEnd') and conditionParamRef.updateTimeEnd != null and conditionParamRef.updateTimeEnd!=''"> <if test="conditionParamRef.containsKey('updateTimeEnd') and conditionParamRef.updateTimeEnd != null and conditionParamRef.updateTimeEnd!=''">
${_conditionType_} a.updateTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.updateTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s') ${_conditionType_} a.updateTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.updateTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s')
</if> </if>
<if test="conditionParamRef.containsKey('deptId')">
<if test="conditionParamRef.deptId != null and conditionParamRef.deptId != ''">
${_conditionType_} a.deptId like #{${_conditionParam_}.deptId}
</if>
<if test="conditionParamRef.deptId == null">
${_conditionType_} a.deptId is null
</if>
</if>
<if test="conditionParamRef.containsKey('deptIdList') and conditionParamRef.deptIdList.size() > 0">
${_conditionType_} a.deptId in
<foreach collection="conditionParamRef.deptIdList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('deptIdNotList') and conditionParamRef.deptIdNotList.size() > 0">
${_conditionType_} a.deptId not in
<foreach collection="conditionParamRef.deptIdNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('deptName')">
<if test="conditionParamRef.deptName != null and conditionParamRef.deptName != ''">
${_conditionType_} a.deptName like #{${_conditionParam_}.deptName}
</if>
<if test="conditionParamRef.deptName == null">
${_conditionType_} a.deptName is null
</if>
</if>
<if test="conditionParamRef.containsKey('deptNameList') and conditionParamRef.deptNameList.size() > 0">
${_conditionType_} a.deptName in
<foreach collection="conditionParamRef.deptNameList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('deptNameNotList') and conditionParamRef.deptNameNotList.size() > 0">
${_conditionType_} a.deptName not in
<foreach collection="conditionParamRef.deptNameNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('remark')">
<if test="conditionParamRef.remark != null and conditionParamRef.remark != ''">
${_conditionType_} a.remark like #{${_conditionParam_}.remark}
</if>
<if test="conditionParamRef.remark == null">
${_conditionType_} a.remark is null
</if>
</if>
<if test="conditionParamRef.containsKey('remarkList') and conditionParamRef.remarkList.size() > 0">
${_conditionType_} a.remark in
<foreach collection="conditionParamRef.remarkList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('remarkNotList') and conditionParamRef.remarkNotList.size() > 0">
${_conditionType_} a.remark not in
<foreach collection="conditionParamRef.remarkNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
</sql> </sql>
<sql id="_orderCols_"> <sql id="_orderCols_">
<if test="orderColList != null and !orderColList.isEmpty()"> <if test="orderColList != null and !orderColList.isEmpty()">
...@@ -701,6 +806,21 @@ ...@@ -701,6 +806,21 @@
<if test='orderCol.updateTime != null and "DESC".equalsIgnoreCase(orderCol.updateTime)'>DESC</if> <if test='orderCol.updateTime != null and "DESC".equalsIgnoreCase(orderCol.updateTime)'>DESC</if>
, ,
</if> </if>
<if test="orderCol.containsKey('deptId')">
a.deptId
<if test='orderCol.deptId != null and "DESC".equalsIgnoreCase(orderCol.deptId)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('deptName')">
a.deptName
<if test='orderCol.deptName != null and "DESC".equalsIgnoreCase(orderCol.deptName)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('remark')">
a.remark
<if test='orderCol.remark != null and "DESC".equalsIgnoreCase(orderCol.remark)'>DESC</if>
,
</if>
</trim> </trim>
</if> </if>
......
...@@ -1175,29 +1175,6 @@ ADD COLUMN `salaId` bigint(20) COMMENT '所属大厅' AFTER `deptName`, ...@@ -1175,29 +1175,6 @@ ADD COLUMN `salaId` bigint(20) COMMENT '所属大厅' AFTER `deptName`,
ADD COLUMN `salaName` varchar(128) COMMENT '所属大厅名称' AFTER `salaId`; ADD COLUMN `salaName` varchar(128) COMMENT '所属大厅名称' AFTER `salaId`;
-- ----------------------------
2024-02-29
-- ----------------------------
-- ----------------------------
-- 门禁设备表
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_door`;
CREATE TABLE mortals_xhx_door(
`id` bigint(20) AUTO_INCREMENT COMMENT '序号,主键,自增长',
`deviceName` varchar(64) COMMENT '设备名称',
`deviceCode` varchar(64) COMMENT '设备编码',
`ip` varchar(64) COMMENT 'Ip地址',
`port` int(9) COMMENT '端口',
`username` varchar(64) COMMENT '用户名',
`password` varchar(64) COMMENT '密码',
`createTime` datetime COMMENT '创建时间',
`createUserId` bigint(20) COMMENT '创建用户',
`updateUserId` bigint(20) COMMENT '更新用户',
`updateTime` datetime COMMENT '修改时间',
PRIMARY KEY (`id`)
,KEY `deviceCode` (`deviceCode`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='门禁设备';
-- ------------------ -- ------------------
-- 2024-03-12 -- 2024-03-12
-- 绩效表增加人员大厅字段 -- 绩效表增加人员大厅字段
...@@ -1271,3 +1248,30 @@ ALTER TABLE `mortals_xhx_staff_perform_stat` ...@@ -1271,3 +1248,30 @@ ALTER TABLE `mortals_xhx_staff_perform_stat`
ALTER TABLE `mortals_xhx_staff_perform_summary` ALTER TABLE `mortals_xhx_staff_perform_summary`
ADD COLUMN `salaId` bigint(20) DEFAULT NULL COMMENT '所属大厅' AFTER `deptName`, ADD COLUMN `salaId` bigint(20) DEFAULT NULL COMMENT '所属大厅' AFTER `deptName`,
ADD COLUMN `salaName` varchar(128) DEFAULT NULL COMMENT '所属大厅名称' AFTER `salaId`; ADD COLUMN `salaName` varchar(128) DEFAULT NULL COMMENT '所属大厅名称' AFTER `salaId`;
-- ----------------------------
2024-03-18
-- ----------------------------
-- ----------------------------
-- 门禁设备表
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_door`;
CREATE TABLE mortals_xhx_door(
`id` bigint(20) AUTO_INCREMENT COMMENT '序号,主键,自增长',
`deviceName` varchar(64) COMMENT '设备名称',
`deviceCode` varchar(64) COMMENT '设备编码',
`ip` varchar(64) COMMENT 'Ip地址',
`port` int(9) COMMENT '端口',
`username` varchar(64) COMMENT '用户名',
`password` varchar(64) COMMENT '密码',
`createTime` datetime COMMENT '创建时间',
`createUserId` bigint(20) COMMENT '创建用户',
`updateUserId` bigint(20) COMMENT '更新用户',
`updateTime` datetime COMMENT '修改时间',
`deptId` bigint (20) COMMENT '所属部门id',
`deptName` varchar(64) COMMENT '所属部门名称',
`remark` varchar(256) COMMENT '备注',
PRIMARY KEY (`id`)
,KEY `deviceCode` (`deviceCode`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='门禁设备';
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment