| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.cache.utils.CacheUtil; |
| | | //import org.springblade.core.log.exception.ServiceException; |
| | | import org.springblade.core.mp.base.BaseServiceImpl; |
| | | import org.springblade.core.tenant.TenantId; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.constant.BladeConstant; |
| | | import org.springblade.core.tool.jackson.JsonUtil; |
| | | import org.springblade.core.tool.support.Kv; |
| | | import org.springblade.core.tool.utils.DesUtil; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.core.tool.utils.StringUtil; |
| | | import org.springblade.system.cache.ParamCache; |
| | | import org.springblade.common.cache.ParamCache; |
| | | import org.springblade.system.entity.*; |
| | | import org.springblade.system.mapper.TenantMapper; |
| | | import org.springblade.system.service.*; |
| | | import org.springblade.system.user.entity.User; |
| | | import org.springblade.system.user.enums.UserEnum; |
| | | import org.springblade.system.user.feign.IUserClient; |
| | | import org.springblade.system.user.service.IUserService; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | |
| | | private final IPostService postService; |
| | | private final IRoleMenuService roleMenuService; |
| | | private final IDictBizService dictBizService; |
| | | private final IUserClient userClient; |
| | | private final IUserService userClient; |
| | | |
| | | @Override |
| | | public IPage<Tenant> selectTenantPage(IPage<Tenant> page, Tenant tenant) { |
| | |
| | | user.setUserType(UserEnum.WEB.getCategory()); |
| | | user.setIsDeleted(BladeConstant.DB_NOT_DELETED); |
| | | boolean temp = super.saveOrUpdate(tenant); |
| | | R<Boolean> result = userClient.saveUser(user); |
| | | if (!result.isSuccess()) { |
| | | boolean result = userClient.save(user); |
| | | if (!result) { |
| | | // throw new ServiceException(result.getMsg()); |
| | | } |
| | | return temp; |
| | |
| | | // throw new ServiceException("不可删除管理租户!"); |
| | | } |
| | | boolean tenantTemp = this.deleteLogic(ids); |
| | | R<Boolean> result = userClient.removeUser(StringUtil.join(tenantIds)); |
| | | if (!result.isSuccess()) { |
| | | Boolean result = userClient.removeUser(StringUtil.join(tenantIds)); |
| | | if (!result) { |
| | | // throw new ServiceException(result.getMsg()); |
| | | } |
| | | return tenantTemp; |