| | |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.product.admin.service.SaasUserService; |
| | | import com.product.core.dao.BaseDao; |
| | | import com.product.core.entity.DataTableEntity; |
| | | import com.product.core.entity.FieldSetEntity; |
| | | import com.product.core.message.MessageFactory; |
| | | import com.product.core.service.support.AbstractBaseService; |
| | | import com.product.core.spring.context.SpringMVCContextHolder; |
| | | import com.product.core.transfer.Transactional; |
| | | import com.product.module.sys.entity.SystemUser; |
| | | import com.product.saas.config.SaasConst; |
| | | import com.product.saas.service.idel.ISaasClientService; |
| | | import com.product.util.BaseUtil; |
| | | |
| | |
| | | * 租户信息 |
| | | * |
| | | */ |
| | | @Service |
| | | @Service("saasClientService") |
| | | public class SaasClientService extends AbstractBaseService implements ISaasClientService{ |
| | | |
| | | @Autowired |
| | | BaseDao baseDao; |
| | | |
| | | @Autowired |
| | | MessageFactory messageFactory; |
| | | |
| | | @Autowired |
| | | SaasUserService saasUserService; |
| | | |
| | | /** |
| | | * 定时任务扫描没有租户管理员的租户 |
| | | */ |
| | | public void autoDetectTenant() { |
| | | DataTableEntity dt = baseDao.listTable(SaasConst.PRODUCT_SYS_CLIENTS, "platform_admin IS NULL OR platform_admin = ''"); |
| | | if (!BaseUtil.dataTableIsEmpty(dt)) { |
| | | String clientName = BaseUtil.joinObjectArray(dt.getFieldAllValues(SaasConst.CLIENT_NAME), ","); |
| | | |
| | | Set<String> platformDirector = saasUserService.getPlatformSuperAdmin(); |
| | | // 发送消息给平台主管 |
| | | messageFactory.sendMessage(String.join(",", platformDirector), |
| | | "【" + clientName + "】等租户没有平台管理员", |
| | | "租户缺乏平台管理员", 1, "5", null, |
| | | SaasConst.PRODUCT_SYS_CLIENTS, "23432432423", 1, new String[] {"system"}, null); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 租户列表 |
| | | * @param fse |