mirror of https://gitee.com/stylefeng/roses
【8.1.9】【sys】整理sys代码
parent
c88622cec4
commit
6c4f952841
|
@ -135,7 +135,7 @@ public class SysUser extends BaseExpandFieldEntity implements GetSortKey {
|
||||||
/**
|
/**
|
||||||
* 冻结截止时间
|
* 冻结截止时间
|
||||||
*/
|
*/
|
||||||
@TableField("freeze_deadline_time")
|
@TableField(value = "freeze_deadline_time", updateStrategy = FieldStrategy.IGNORED, insertStrategy = FieldStrategy.IGNORED)
|
||||||
@ChineseDescription("冻结截止时间")
|
@ChineseDescription("冻结截止时间")
|
||||||
private Date freezeDeadlineTime;
|
private Date freezeDeadlineTime;
|
||||||
|
|
||||||
|
|
|
@ -497,14 +497,9 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
||||||
throw new ServiceException(SysUserExceptionEnum.ACCOUNT_NOT_EXIST);
|
throw new ServiceException(SysUserExceptionEnum.ACCOUNT_NOT_EXIST);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 判断用户状态是否被临时冻结,如果超过了临时冻结时间,将用户状态改为正常态
|
// 更新用户的冻结状态
|
||||||
if (UserStatusEnum.TEMP_FREEZE.getCode().equals(sysUserServiceOne.getStatusFlag())) {
|
this.updateSysUserFreezeStatus(account, sysUserServiceOne);
|
||||||
Date freezeDeadlineTime = sysUserServiceOne.getFreezeDeadlineTime();
|
|
||||||
if (freezeDeadlineTime != null && freezeDeadlineTime.before(new Date())) {
|
|
||||||
sysUserServiceOne.setStatusFlag(UserStatusEnum.ENABLE.getCode());
|
|
||||||
this.updateById(sysUserServiceOne);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} finally {
|
} finally {
|
||||||
TenantIdHolder.remove();
|
TenantIdHolder.remove();
|
||||||
}
|
}
|
||||||
|
@ -953,4 +948,29 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新用户冻结状态,如果用户被冻结了
|
||||||
|
*
|
||||||
|
* @author fengshuonan
|
||||||
|
* @since 2024/7/12 15:11
|
||||||
|
*/
|
||||||
|
private void updateSysUserFreezeStatus(String account, SysUser sysUserServiceOne) {
|
||||||
|
// 判断用户状态是否被临时冻结,如果超过了临时冻结时间,将用户状态改为正常态
|
||||||
|
if (UserStatusEnum.TEMP_FREEZE.getCode().equals(sysUserServiceOne.getStatusFlag())) {
|
||||||
|
Date freezeDeadlineTime = sysUserServiceOne.getFreezeDeadlineTime();
|
||||||
|
if (freezeDeadlineTime != null && freezeDeadlineTime.before(new Date())) {
|
||||||
|
|
||||||
|
// 修改用户状态为启用
|
||||||
|
sysUserServiceOne.setStatusFlag(UserStatusEnum.ENABLE.getCode());
|
||||||
|
|
||||||
|
// 修改库中的状态,并设置截止冻结日期为空
|
||||||
|
LambdaUpdateWrapper<SysUser> objectLambdaUpdateWrapper = new LambdaUpdateWrapper<>();
|
||||||
|
objectLambdaUpdateWrapper.set(SysUser::getStatusFlag, UserStatusEnum.ENABLE.getCode());
|
||||||
|
objectLambdaUpdateWrapper.set(SysUser::getFreezeDeadlineTime, null);
|
||||||
|
objectLambdaUpdateWrapper.eq(SysUser::getAccount, account);
|
||||||
|
this.update(objectLambdaUpdateWrapper);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue