Bläddra i källkod

更新

tags/v2.5.3
xiaoying 10 månader sedan
förälder
incheckning
a9f6fee053
2 ändrade filer med 8 tillägg och 4 borttagningar
  1. +3
    -0
      tuoheng_oidc_admin/src/main/java/com/tuoheng/service/impl/TenantServiceImpl.java
  2. +5
    -4
      tuoheng_oidc_admin/src/main/java/com/tuoheng/task/StatusTask.java

+ 3
- 0
tuoheng_oidc_admin/src/main/java/com/tuoheng/service/impl/TenantServiceImpl.java Visa fil

@@ -555,6 +555,9 @@ public class TenantServiceImpl implements TenantService {
return JsonResult.error(ServiceExceptionEnum.EXPIRATION_DATE.getMessage());
}
}

tenantPo.setStatus(CommonConstant.ZERO);
tenantMapper.updateById(tenantPo);
UserPo userPo = clientUserMapper.selectByUserId(tenantPo.getUserId());
//1正常 0禁用
userPo.setIsAble(dto.getStatus());

+ 5
- 4
tuoheng_oidc_admin/src/main/java/com/tuoheng/task/StatusTask.java Visa fil

@@ -3,6 +3,7 @@ package com.tuoheng.task;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.tuoheng.constant.CommonConstant;
import com.tuoheng.mapper.ClientUserMapper;
import com.tuoheng.mapper.ClientUserRoleMapper;
import com.tuoheng.mapper.TenantItemMapper;
@@ -48,19 +49,19 @@ public class StatusTask {
if (falg) {
//过了则更新租户对应项目状态
TenantPo tenantPo = tenantMapper.selectById(tenantItem.getTenantId());
tenantPo.setStatus(0);
tenantPo.setStatus(CommonConstant.ZERO);
//变更租户状态
tenantMapper.updateById(tenantPo);
UserPo userPo = clientUserMapper.selectByUserId(tenantPo.getUserId());
if (0 != userPo.getIsExpire()) {
if (CommonConstant.ZERO.equals(userPo.getIsExpire())) {
log.info("开始禁用对应租户及其用户状态,对应租户id:{}", tenantItem.getTenantId());
userPo.setIsExpire(0);
userPo.setIsExpire(CommonConstant.ZERO);
//租户状态完毕
clientUserMapper.updatePass(userPo);
//租户更新完毕 更新对应租户下的用户
List<UserPo> userPoList = clientUserMapper.selectByTenantId(userPo.getId());
for (UserPo po : userPoList) {
po.setIsExpire(0);
po.setIsExpire(CommonConstant.ZERO);
clientUserMapper.updatePass(userPo);
}
log.info("禁用对应租户及其用户状态完毕");

Laddar…
Avbryt
Spara