|
@@ -395,19 +395,16 @@ public class IotDeviceConfigServiceImpl extends BaseService implements IotDevice
|
|
|
LambdaQueryWrapper<AccountAuthConfig> awrapper = new LambdaQueryWrapper<>();
|
|
|
awrapper.eq(AccountAuthConfig::getAccountId, account.getId()).eq(AccountAuthConfig::getIsDeleted, Boolean.FALSE);
|
|
|
AccountAuthConfig config = accountAuthConfigMapper.selectOne(awrapper);
|
|
|
- if (Preconditions.isBlank(config) || Preconditions.isBlank(config.getHhAromeSwitch()) || !config.getHhAromeSwitch()) {
|
|
|
+ if (Preconditions.isBlank(config) || Preconditions.isBlank(config.getHhAromeSwitch()) || !config.getHhAromeSwitch() || Preconditions.isBlank(config.getPurchaserId())) {
|
|
|
throw new BusinessException("禁止访问该资源");
|
|
|
}
|
|
|
- List<Long> ampeIds = commonImpl.getAuthAmpeIds(account);
|
|
|
- List<Long> tenantIds = commonImpl.getAmpeTenantIds(account);
|
|
|
- if (Preconditions.isBlank(ampeIds) && Preconditions.isBlank(tenantIds)) {
|
|
|
-// throw new BusinessException("未找到访问资源");
|
|
|
- return RestResult.ok(initEmptyPage());
|
|
|
- }
|
|
|
- if (Preconditions.isNotBlank(dto.getTenantId()) && !tenantIds.contains(dto.getTenantId())) {
|
|
|
- throw new BusinessException("禁止访问该资源");
|
|
|
- }
|
|
|
-// if (Preconditions.isNotBlank(dto.getAmpeId()) && !ampeIds.contains(dto.getAmpeId())) {
|
|
|
+// List<Long> ampeIds = commonImpl.getAuthAmpeIds(account);
|
|
|
+// List<Long> tenantIds = commonImpl.getAmpeTenantIds(account);
|
|
|
+// if (Preconditions.isBlank(ampeIds) && Preconditions.isBlank(tenantIds)) {
|
|
|
+// //throw new BusinessException("未找到访问资源");
|
|
|
+// return RestResult.ok(initEmptyPage());
|
|
|
+// }
|
|
|
+// if (Preconditions.isNotBlank(dto.getTenantId()) && !tenantIds.contains(dto.getTenantId())) {
|
|
|
// throw new BusinessException("禁止访问该资源");
|
|
|
// }
|
|
|
LambdaQueryWrapper<IotDeviceConfig> wrapper = new LambdaQueryWrapper<>();
|
|
@@ -415,7 +412,7 @@ public class IotDeviceConfigServiceImpl extends BaseService implements IotDevice
|
|
|
wrapper.like(StrUtil.isNotBlank(dto.getSn()), IotDeviceConfig::getSn, dto.getSn());
|
|
|
wrapper.eq(Preconditions.isNotBlank(dto.getAmpeId()), IotDeviceConfig::getAmpeId, dto.getAmpeId());
|
|
|
wrapper.eq(Preconditions.isNotBlank(dto.getTenantId()), IotDeviceConfig::getTenantId, dto.getTenantId());
|
|
|
- wrapper.in(Preconditions.isNotBlank(tenantIds), IotDeviceConfig::getTenantId, tenantIds);
|
|
|
+ wrapper.eq(IotDeviceConfig::getPurchaserId, config.getPurchaserId());
|
|
|
//基础条件
|
|
|
wrapper.eq(IotDeviceConfig::getIsDeleted, Boolean.FALSE);
|
|
|
wrapper.orderByDesc(IotDeviceConfig::getId);
|