|
@@ -1,9 +1,21 @@
|
|
package com.bizmatics.service.impl;
|
|
package com.bizmatics.service.impl;
|
|
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
|
+import com.bizmatics.common.core.exception.BusinessException;
|
|
import com.bizmatics.common.mvc.base.AbstractCrudService;
|
|
import com.bizmatics.common.mvc.base.AbstractCrudService;
|
|
|
|
+import com.bizmatics.common.mvc.utils.ServletUtils;
|
|
|
|
+import com.bizmatics.model.DeviceAttribute;
|
|
import com.bizmatics.model.SysTenantConfig;
|
|
import com.bizmatics.model.SysTenantConfig;
|
|
|
|
+import com.bizmatics.model.system.SysUser;
|
|
|
|
+import com.bizmatics.model.vo.SysTenantConfigVo;
|
|
import com.bizmatics.persistence.mapper.SysTenantConfigMapper;
|
|
import com.bizmatics.persistence.mapper.SysTenantConfigMapper;
|
|
|
|
+import com.bizmatics.persistence.mapper.system.SysUserMapper;
|
|
import com.bizmatics.service.SysTenantConfigService;
|
|
import com.bizmatics.service.SysTenantConfigService;
|
|
|
|
+import com.bizmatics.service.config.security.LoginUser;
|
|
|
|
+import com.bizmatics.service.system.impl.TokenService;
|
|
|
|
+import com.bizmatics.service.util.SecurityUtils;
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
@@ -18,10 +30,24 @@ import java.util.List;
|
|
*/
|
|
*/
|
|
@Service
|
|
@Service
|
|
public class SysTenantConfigServiceImpl extends AbstractCrudService<SysTenantConfigMapper, SysTenantConfig> implements SysTenantConfigService {
|
|
public class SysTenantConfigServiceImpl extends AbstractCrudService<SysTenantConfigMapper, SysTenantConfig> implements SysTenantConfigService {
|
|
|
|
+ @Autowired
|
|
|
|
+ private SysUserMapper userMapper;
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public List<SysTenantConfig> getTenantConfig(String url) {
|
|
|
|
- List<SysTenantConfig> list = baseMapper.getTenantConfig(url);
|
|
|
|
|
|
+ public List<SysTenantConfigVo> getTenantConfig(String url) {
|
|
|
|
+ List<SysTenantConfigVo> list = baseMapper.getTenantConfig(url);
|
|
|
|
+ return list;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public List<SysTenantConfig> getMiddleConfig() {
|
|
|
|
+ List<SysUser> tenantDaya = userMapper.getTenantId(SecurityUtils.getUser().getUserId());
|
|
|
|
+ if (tenantDaya.size()<0) {
|
|
|
|
+ throw new BusinessException("无此租户,请联系管理员");
|
|
|
|
+ }
|
|
|
|
+ LambdaQueryWrapper<SysTenantConfig> queryWrapper = Wrappers.lambdaQuery();
|
|
|
|
+ queryWrapper.eq(SysTenantConfig::getTenantId, tenantDaya.get(0).getTenantId());
|
|
|
|
+ List<SysTenantConfig> list = this.list(queryWrapper);
|
|
return list;
|
|
return list;
|
|
}
|
|
}
|
|
}
|
|
}
|