|
|
@@ -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("禁用对应租户及其用户状态完毕"); |