|
@@ -166,19 +166,22 @@ public class StaffManageServiceImpl implements IStaffManageService {
|
|
|
@Override
|
|
|
public Boolean insertByBo(StaffManageBo bo) {
|
|
|
StaffManage add = MapstructUtils.convert(bo, StaffManage.class);
|
|
|
+ String tenantId = bo.getTenantId();
|
|
|
boolean flag = checkPhoneNumberUnique(add);
|
|
|
if (!flag) {
|
|
|
throw new UserException("staff.manage.error");
|
|
|
} else if (flag) {
|
|
|
validEntityBeforeSave(add);
|
|
|
flag = baseMapper.insert(add) > 0;
|
|
|
- //待认证的员工人员数量,统计使用
|
|
|
- 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);
|
|
|
- }
|
|
|
+ TenantHelper.ignore(() -> {
|
|
|
+ //待认证的员工人员数量,统计使用
|
|
|
+ if (RedisUtils.hasKey(tenantId + ":" + STAFF_MANAGE_AUTHENTICATION)) {
|
|
|
+ Object count = RedisUtils.getCacheObject(tenantId + ":" +STAFF_MANAGE_AUTHENTICATION);
|
|
|
+ RedisUtils.setCacheObject(tenantId + ":" +STAFF_MANAGE_AUTHENTICATION, Integer.parseInt(count.toString()) + 1);
|
|
|
+ } else {
|
|
|
+ RedisUtils.setCacheObject(tenantId + ":" +STAFF_MANAGE_AUTHENTICATION, 1);
|
|
|
+ }
|
|
|
+ });
|
|
|
/*
|
|
|
SysUserBo sysUser = new SysUserBo();
|
|
|
sysUser.setUserId(bo.getUserId());
|
|
@@ -313,12 +316,26 @@ public class StaffManageServiceImpl implements IStaffManageService {
|
|
|
@Override
|
|
|
public Boolean updateByBo(StaffManageBo bo) {
|
|
|
StaffManage update = MapstructUtils.convert(bo, StaffManage.class);
|
|
|
- if (THR.equals(update.getExamine())) {
|
|
|
+/* 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));
|
|
|
+ RedisUtils.setCacheObject(STAFF_MANAGE_AUTHENTICATION, Math.max(Integer.parseInt(count.toString()) - 1, 0));
|
|
|
}
|
|
|
+ }*/
|
|
|
+ //员工审核未通过的时候走修改就待认证的员工人员数量+1
|
|
|
+ String tenantId = bo.getTenantId();
|
|
|
+ String examine = update.getExamine();
|
|
|
+ if (THR.equals(examine)) {
|
|
|
+ TenantHelper.ignore(() -> {
|
|
|
+ //待认证的员工人员数量,统计使用
|
|
|
+ if (RedisUtils.hasKey(tenantId + ":" + STAFF_MANAGE_AUTHENTICATION)) {
|
|
|
+ Object count = RedisUtils.getCacheObject(tenantId + ":" +STAFF_MANAGE_AUTHENTICATION);
|
|
|
+ RedisUtils.setCacheObject(tenantId + ":" +STAFF_MANAGE_AUTHENTICATION, Integer.parseInt(count.toString()) + 1);
|
|
|
+ } else {
|
|
|
+ RedisUtils.setCacheObject(tenantId + ":" +STAFF_MANAGE_AUTHENTICATION, 1);
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
update.setExamine(ONE);
|
|
|
if (bo.getIsFilter()) {
|
|
@@ -399,7 +416,7 @@ public class StaffManageServiceImpl implements IStaffManageService {
|
|
|
//员工待认证数量-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));
|
|
|
+ RedisUtils.setCacheObject(STAFF_MANAGE_AUTHENTICATION, Math.max(Integer.parseInt(count.toString()) - 1, 0));
|
|
|
}
|
|
|
return TenantHelper.ignore(() -> {
|
|
|
return baseMapper.deleteByIds(ids) > 0;
|
|
@@ -478,18 +495,11 @@ public class StaffManageServiceImpl implements IStaffManageService {
|
|
|
RedisUtils.deleteObject(key);
|
|
|
}
|
|
|
}*/
|
|
|
-
|
|
|
- //员工待认证数量-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));
|
|
|
- }
|
|
|
- } else if (THR.equals(examine)) {
|
|
|
- //员工待认证数量-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));
|
|
|
- }
|
|
|
+ }
|
|
|
+ //员工待认证数量-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));
|
|
|
}
|
|
|
return baseMapper.updateById(examineStaffManage) > 0;
|
|
|
}
|
|
@@ -587,7 +597,7 @@ public class StaffManageServiceImpl implements IStaffManageService {
|
|
|
//员工待认证数量-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));
|
|
|
+ RedisUtils.setCacheObject(STAFF_MANAGE_AUTHENTICATION, Math.max(Integer.parseInt(count.toString()) - 1, 0));
|
|
|
}
|
|
|
}
|
|
|
} else {
|