dev_xd
姜玉琦 2025-03-06 23:05:32 +08:00
parent 20986f1a1f
commit e31a2e2c91
5 changed files with 31 additions and 12 deletions

View File

@ -126,7 +126,7 @@ public interface IUniService {
/**
*
*/
public void syncUniUser(ProProjectInfoSubdeptsUsers puser);
public void syncUniUser(ProProjectInfoSubdeptsUsers puser, boolean authFlag);
/**
*

View File

@ -157,7 +157,7 @@ public class ProProjectInfoSubdeptsGroupServiceImpl implements IProProjectInfoSu
subdeptsUser.setCreateTime(DateUtils.getNowDate());
res = proProjectInfoSubdeptsUsersMapper.insertProProjectInfoSubdeptsUsers(subdeptsUser);
// 系统添加的人员默认增加入场信息
uniService.syncUniUser(subdeptsUser);
uniService.syncUniUser(subdeptsUser,true);
if(res>0){
try {
String accessToken = wxMaService.getAccessToken();
@ -275,6 +275,8 @@ public class ProProjectInfoSubdeptsGroupServiceImpl implements IProProjectInfoSu
FileUtil.copyFile(file,new File(savePath));
subdeptsUser.setQrCode(profilePath);
res = proProjectInfoSubdeptsUsersMapper.updateProProjectInfoSubdeptsUsers(subdeptsUser);
// 系统添加的人员默认增加入场信息
uniService.syncUniUser(subdeptsUser,true);
}catch (Exception e){
log.error(e.getMessage());
}
@ -302,8 +304,6 @@ public class ProProjectInfoSubdeptsGroupServiceImpl implements IProProjectInfoSu
FileUtil.copyFile(file,new File(savePath));
subdeptsUser.setQrCode(profilePath);
res = proProjectInfoSubdeptsUsersMapper.updateProProjectInfoSubdeptsUsers(subdeptsUser);
// 系统添加的人员默认增加入场信息
uniService.syncUniUser(subdeptsUser);
}catch (Exception e){
log.error(e.getMessage());
}

View File

@ -190,7 +190,7 @@ public class ProProjectInfoSubdeptsServiceImpl implements IProProjectInfoSubdept
subdeptsUser.setCreateTime(DateUtils.getNowDate());
int r = proProjectInfoSubdeptsUsersMapper.insertProProjectInfoSubdeptsUsers(subdeptsUser);
// 系统添加的人员默认增加入场信息
uniService.syncUniUser(subdeptsUser);
uniService.syncUniUser(subdeptsUser,true);
try {
if(r>0){
String accessToken = wxMaService.getAccessToken();

View File

@ -205,7 +205,7 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu
Long userId= remoteUserService.registerUserInfo(sysUser, SecurityConstants.INNER).getData();
proProjectInfoSubdeptsUsers.setUserId(userId);
int res = proProjectInfoSubdeptsUsersMapper.insertProProjectInfoSubdeptsUsers(proProjectInfoSubdeptsUsers);
uniService.syncUniUser(proProjectInfoSubdeptsUsers);
uniService.syncUniUser(proProjectInfoSubdeptsUsers,true);
String userPost = proProjectInfoSubdeptsUsers.getUserPost();
if(res>0 && (Objects.equals(UserPostEnums.WTDL.getCode(),userPost) || Objects.equals(UserPostEnums.XMJL.getCode(),userPost) || Objects.equals(UserPostEnums.BZZ.getCode(),userPost))){
// 生成二维码
@ -286,7 +286,7 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu
proProjectInfoSubdeptsUsers.setSubDeptGroup(proProjectInfoSubdeptsGroup.getId());
proProjectInfoSubdeptsUsers.setSubDeptGroupName(proProjectInfoSubdeptsGroup.getGroupName());
proProjectInfoSubdeptsUsersMapper.insertProProjectInfoSubdeptsUsers(proProjectInfoSubdeptsUsers);
uniService.syncUniUser(proProjectInfoSubdeptsUsers);
uniService.syncUniUser(proProjectInfoSubdeptsUsers,true);
}else {
ProProjectInfoSubdeptsUsers deptUser = users.get(0);
deptUser.setUserName(proProjectInfoSubdeptsUsers.getUserName());
@ -297,7 +297,13 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu
deptUser.setUpdateBy(SecurityUtils.getUsername());
deptUser.setUpdateTime(DateUtils.getNowDate());
proProjectInfoSubdeptsUsersMapper.updateProProjectInfoSubdeptsUsers(deptUser);
uniService.syncUniUser(deptUser);
/**
* ...
*/
if(!Objects.equals(proProjectInfoSubdeptsUsers.getUserName(),deptUser.getUserName()) || !Objects.equals(proProjectInfoSubdeptsUsers.getCardCode(),deptUser.getCardCode()) ||
!Objects.equals(proProjectInfoSubdeptsUsers.getUserPhone(),deptUser.getUserPhone()) || !Objects.equals(proProjectInfoSubdeptsUsers.getUserPicture(),deptUser.getUserPicture())){
uniService.syncUniUser(proProjectInfoSubdeptsUsers,false);
}
}
}
@ -564,7 +570,13 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu
proProjectInfoSubdeptsUsers.setFaceGuid(old.getFaceGuid());
proProjectInfoSubdeptsUsers.setUserId(old.getUserId());
uniService.syncUniUser(proProjectInfoSubdeptsUsers);
/**
* ...
*/
if(!Objects.equals(proProjectInfoSubdeptsUsers.getUserName(),old.getUserName()) || !Objects.equals(proProjectInfoSubdeptsUsers.getCardCode(),old.getCardCode()) ||
!Objects.equals(proProjectInfoSubdeptsUsers.getUserPhone(),old.getUserPhone()) || !Objects.equals(proProjectInfoSubdeptsUsers.getUserPicture(),old.getUserPicture())){
uniService.syncUniUser(proProjectInfoSubdeptsUsers,false);
}
if(!Objects.equals(old.getUserPost(),proProjectInfoSubdeptsUsers.getUserPost())){
String userPost = proProjectInfoSubdeptsUsers.getUserPost();
@ -1119,7 +1131,7 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu
proProjectInfoSubdeptsUsers.setApproveStatus(ApproveStatus.exempt.getCode());
proProjectInfoSubdeptsUsersMapper.updateProProjectInfoSubdeptsUsers(proProjectInfoSubdeptsUsers);
// 人员入场信息
uniService.syncUniUser(proProjectInfoSubdeptsUsers);
uniService.syncUniUser(proProjectInfoSubdeptsUsers,true);
}
/**

View File

@ -490,8 +490,13 @@ public class UniServiceImpl implements IUniService{
return 0l;
}
/**
*
* @param puser
* @param authFlag
*/
@Override
public void syncUniUser(ProProjectInfoSubdeptsUsers puser) {
public void syncUniUser(ProProjectInfoSubdeptsUsers puser, boolean authFlag) {
JSONObject jo;
if(StringUtils.isNotEmpty(puser.getUserInfos())){
jo = JSON.parseObject(puser.getUserInfos());
@ -562,7 +567,9 @@ public class UniServiceImpl implements IUniService{
}
// 人员入场
if(authFlag){
syncUserAuthDeviceByInfo(puser);
}
}
}