|
@@ -94,8 +94,8 @@ public class StaffManageServiceImpl implements IStaffManageService {
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
- public StaffManageVo getInfoByUserId(Long userId,String tenantId) {
|
|
|
- return baseMapper.getInfoByUserId(userId,tenantId);
|
|
|
+ public StaffManageVo getInfoByUserId(Long userId, String tenantId) {
|
|
|
+ return baseMapper.getInfoByUserId(userId, tenantId);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -173,11 +173,11 @@ public class StaffManageServiceImpl implements IStaffManageService {
|
|
|
validEntityBeforeSave(add);
|
|
|
flag = baseMapper.insert(add) > 0;
|
|
|
//待认证的员工人员数量,统计使用
|
|
|
- if(RedisUtils.hasKey(STAFF_MANAGE_AUTHENTICATION)){
|
|
|
+ if (RedisUtils.hasKey(STAFF_MANAGE_AUTHENTICATION)) {
|
|
|
Object count = RedisUtils.getCacheObject(STAFF_MANAGE_AUTHENTICATION);
|
|
|
- RedisUtils.setCacheObject(STAFF_MANAGE_AUTHENTICATION,Integer.parseInt(count.toString())+1);
|
|
|
- }else {
|
|
|
- RedisUtils.setCacheObject(STAFF_MANAGE_AUTHENTICATION,1);
|
|
|
+ RedisUtils.setCacheObject(STAFF_MANAGE_AUTHENTICATION, Integer.parseInt(count.toString()) + 1);
|
|
|
+ } else {
|
|
|
+ RedisUtils.setCacheObject(STAFF_MANAGE_AUTHENTICATION, 1);
|
|
|
}
|
|
|
/*
|
|
|
SysUserBo sysUser = new SysUserBo();
|
|
@@ -230,7 +230,7 @@ public class StaffManageServiceImpl implements IStaffManageService {
|
|
|
user.setUserType(APP_STAFF.getUserType() + "," + PC_USER.getUserType());
|
|
|
boolean exist = TenantHelper.ignore(() -> {
|
|
|
return userMapper.exists(new LambdaQueryWrapper<SysUser>()
|
|
|
- .eq(SysUser::getUserName, user.getUserName()));
|
|
|
+ .eq(SysUser::getUserName, user.getUserName()));
|
|
|
});
|
|
|
SysUser sysUser = MapstructUtils.convert(user, SysUser.class);
|
|
|
sysUser.setTenantId(tenantId);
|
|
@@ -251,9 +251,9 @@ public class StaffManageServiceImpl implements IStaffManageService {
|
|
|
userId = sysUserVo.getUserId();
|
|
|
String userType = sysUserVo.getUserType();
|
|
|
if (!userType.contains(APP_STAFF.getUserType())) {
|
|
|
- userType = userType+ "," + APP_STAFF.getUserType();
|
|
|
- }else if (!userType.contains(PC_USER.getUserType())) {
|
|
|
- userType = userType+ "," + PC_USER.getUserType();
|
|
|
+ userType = userType + "," + APP_STAFF.getUserType();
|
|
|
+ } else if (!userType.contains(PC_USER.getUserType())) {
|
|
|
+ userType = userType + "," + PC_USER.getUserType();
|
|
|
}
|
|
|
sysUser.setUserType(userType);
|
|
|
sysUser.setIsAuthentication(THR);
|
|
@@ -313,13 +313,13 @@ public class StaffManageServiceImpl implements IStaffManageService {
|
|
|
@Override
|
|
|
public Boolean updateByBo(StaffManageBo bo) {
|
|
|
StaffManage update = MapstructUtils.convert(bo, StaffManage.class);
|
|
|
- if (THR.equals(update.getExamine())){
|
|
|
- //员工待认证数量-1
|
|
|
- if (RedisUtils.hasKey(STAFF_MANAGE_AUTHENTICATION)){
|
|
|
- Object count = RedisUtils.getCacheObject(STAFF_MANAGE_AUTHENTICATION);
|
|
|
- RedisUtils.setCacheObject(STAFF_MANAGE_AUTHENTICATION,Math.max(Integer.parseInt(count.toString()),0));
|
|
|
- }
|
|
|
- }
|
|
|
+ if (THR.equals(update.getExamine())) {
|
|
|
+ //员工待认证数量-1
|
|
|
+ if (RedisUtils.hasKey(STAFF_MANAGE_AUTHENTICATION)) {
|
|
|
+ Object count = RedisUtils.getCacheObject(STAFF_MANAGE_AUTHENTICATION);
|
|
|
+ RedisUtils.setCacheObject(STAFF_MANAGE_AUTHENTICATION, Math.max(Integer.parseInt(count.toString())-1, 0));
|
|
|
+ }
|
|
|
+ }
|
|
|
update.setExamine(ONE);
|
|
|
if (bo.getIsFilter()) {
|
|
|
return TenantHelper.ignore(() -> {
|
|
@@ -397,11 +397,13 @@ public class StaffManageServiceImpl implements IStaffManageService {
|
|
|
//TODO 做一些业务上的校验,判断是否需要校验
|
|
|
}
|
|
|
//员工待认证数量-1
|
|
|
- if (RedisUtils.hasKey(STAFF_MANAGE_AUTHENTICATION)){
|
|
|
+ if (RedisUtils.hasKey(STAFF_MANAGE_AUTHENTICATION)) {
|
|
|
Object count = RedisUtils.getCacheObject(STAFF_MANAGE_AUTHENTICATION);
|
|
|
- RedisUtils.setCacheObject(STAFF_MANAGE_AUTHENTICATION,Math.max(Integer.parseInt(count.toString()),0));
|
|
|
+ RedisUtils.setCacheObject(STAFF_MANAGE_AUTHENTICATION, Math.max(Integer.parseInt(count.toString())-1, 0));
|
|
|
}
|
|
|
- return baseMapper.deleteByIds(ids) > 0;
|
|
|
+ return TenantHelper.ignore(() -> {
|
|
|
+ return baseMapper.deleteByIds(ids) > 0;
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
|
|
@@ -436,9 +438,9 @@ public class StaffManageServiceImpl implements IStaffManageService {
|
|
|
}
|
|
|
String userType = sysUserVo.getUserType();
|
|
|
if (!userType.contains(APP_STAFF.getUserType())) {
|
|
|
- userType = userType+ "," + APP_STAFF.getUserType();
|
|
|
- }else if (!userType.contains(PC_USER.getUserType())) {
|
|
|
- userType = userType+ "," + PC_USER.getUserType();
|
|
|
+ userType = userType + "," + APP_STAFF.getUserType();
|
|
|
+ } else if (!userType.contains(PC_USER.getUserType())) {
|
|
|
+ userType = userType + "," + PC_USER.getUserType();
|
|
|
}
|
|
|
sysUser.setUserType(userType);
|
|
|
userService.updateUserByIdNoTenantId(sysUser);
|
|
@@ -478,15 +480,15 @@ public class StaffManageServiceImpl implements IStaffManageService {
|
|
|
}*/
|
|
|
|
|
|
//员工待认证数量-1
|
|
|
- if (RedisUtils.hasKey(STAFF_MANAGE_AUTHENTICATION)){
|
|
|
+ if (RedisUtils.hasKey(STAFF_MANAGE_AUTHENTICATION)) {
|
|
|
Object count = RedisUtils.getCacheObject(STAFF_MANAGE_AUTHENTICATION);
|
|
|
- RedisUtils.setCacheObject(STAFF_MANAGE_AUTHENTICATION,Math.max(Integer.parseInt(count.toString()),0));
|
|
|
+ RedisUtils.setCacheObject(STAFF_MANAGE_AUTHENTICATION, Math.max(Integer.parseInt(count.toString())-1, 0));
|
|
|
}
|
|
|
- }else if (THR.equals(examine)){
|
|
|
+ } else if (THR.equals(examine)) {
|
|
|
//员工待认证数量-1
|
|
|
- if (RedisUtils.hasKey(STAFF_MANAGE_AUTHENTICATION)){
|
|
|
+ if (RedisUtils.hasKey(STAFF_MANAGE_AUTHENTICATION)) {
|
|
|
Object count = RedisUtils.getCacheObject(STAFF_MANAGE_AUTHENTICATION);
|
|
|
- RedisUtils.setCacheObject(STAFF_MANAGE_AUTHENTICATION,Math.max(Integer.parseInt(count.toString()),0));
|
|
|
+ RedisUtils.setCacheObject(STAFF_MANAGE_AUTHENTICATION, Math.max(Integer.parseInt(count.toString())-1, 0));
|
|
|
}
|
|
|
}
|
|
|
return baseMapper.updateById(examineStaffManage) > 0;
|
|
@@ -522,7 +524,7 @@ public class StaffManageServiceImpl implements IStaffManageService {
|
|
|
});
|
|
|
// 删除用户与租户关联
|
|
|
TenantHelper.ignore(() -> {
|
|
|
- sysUserTenantMapper.updateByTenantId(tenantId,userId,ONE);
|
|
|
+ sysUserTenantMapper.updateByTenantId(tenantId, userId, ONE);
|
|
|
});
|
|
|
/* if (staffManageList != null && !staffManageList.isEmpty()) {
|
|
|
//判断用户的默认租户是否是被删除的那个租户,是的情况下换一个租户id给sysUser表中
|
|
@@ -552,16 +554,16 @@ public class StaffManageServiceImpl implements IStaffManageService {
|
|
|
sysUser.setIsAuthentication(TWO);
|
|
|
sysUser.setTenantId(list.get(0).getTenantId());
|
|
|
}
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
//一个居住人员都没有,说明该用户一个认证信息都没有提交
|
|
|
sysUser.setIsAuthentication(ONE);
|
|
|
}
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
//说明还有认证过的员工信息
|
|
|
List<StaffManage> list = staffManageList.stream().filter(e -> e.getExamine().equals(TWO)).toList();
|
|
|
if (!list.isEmpty()) {
|
|
|
sysUser.setTenantId(list.get(0).getTenantId());
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
//如果一个员工通过的都没有,去查询是否有居住人员认证通过的
|
|
|
List<ResidentInfoVo> infoByUserId = residentInfoMapper.getInfoByUserId(userId);
|
|
|
if (infoByUserId != null && !infoByUserId.isEmpty()) {
|
|
@@ -570,7 +572,7 @@ public class StaffManageServiceImpl implements IStaffManageService {
|
|
|
sysUser.setIsAuthentication(TWO);
|
|
|
sysUser.setTenantId(residentInfoVoList.get(0).getTenantId());
|
|
|
}
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
//一个居住人员都没有,说明该用户一个认证信息都没有提交
|
|
|
sysUser.setIsAuthentication(ONE);
|
|
|
}
|
|
@@ -583,9 +585,9 @@ public class StaffManageServiceImpl implements IStaffManageService {
|
|
|
|
|
|
if (ONE.equals(examine)) {
|
|
|
//员工待认证数量-1
|
|
|
- if (RedisUtils.hasKey(STAFF_MANAGE_AUTHENTICATION)){
|
|
|
+ if (RedisUtils.hasKey(STAFF_MANAGE_AUTHENTICATION)) {
|
|
|
Object count = RedisUtils.getCacheObject(STAFF_MANAGE_AUTHENTICATION);
|
|
|
- RedisUtils.setCacheObject(STAFF_MANAGE_AUTHENTICATION,Math.max(Integer.parseInt(count.toString()),0));
|
|
|
+ RedisUtils.setCacheObject(STAFF_MANAGE_AUTHENTICATION, Math.max(Integer.parseInt(count.toString())-1, 0));
|
|
|
}
|
|
|
}
|
|
|
} else {
|