|
@@ -40,7 +40,6 @@ import org.thingsboard.server.common.data.yunteng.enums.TrendType; |
|
@@ -40,7 +40,6 @@ import org.thingsboard.server.common.data.yunteng.enums.TrendType; |
40
|
import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData;
|
40
|
import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData;
|
41
|
import org.thingsboard.server.dao.entity.EntityService;
|
41
|
import org.thingsboard.server.dao.entity.EntityService;
|
42
|
import org.thingsboard.server.dao.timeseries.TimeseriesService;
|
42
|
import org.thingsboard.server.dao.timeseries.TimeseriesService;
|
43
|
-import org.thingsboard.server.dao.usagerecord.ApiUsageStateDao;
|
|
|
44
|
import org.thingsboard.server.dao.usagerecord.ApiUsageStateService;
|
43
|
import org.thingsboard.server.dao.usagerecord.ApiUsageStateService;
|
45
|
import org.thingsboard.server.dao.yunteng.mapper.DeviceMapper;
|
44
|
import org.thingsboard.server.dao.yunteng.mapper.DeviceMapper;
|
46
|
import org.thingsboard.server.dao.yunteng.mapper.TkAlarmMapper;
|
45
|
import org.thingsboard.server.dao.yunteng.mapper.TkAlarmMapper;
|
|
@@ -79,7 +78,8 @@ public class TkHomePageServiceImpl implements HomePageService { |
|
@@ -79,7 +78,8 @@ public class TkHomePageServiceImpl implements HomePageService { |
79
|
boolean isTenantAdmin,
|
78
|
boolean isTenantAdmin,
|
80
|
boolean isPtCommonTenant,
|
79
|
boolean isPtCommonTenant,
|
81
|
String tenantId,
|
80
|
String tenantId,
|
82
|
- String currentUserId)
|
81
|
+ String currentUserId,
|
|
|
82
|
+ String customerId)
|
83
|
throws ExecutionException, InterruptedException {
|
83
|
throws ExecutionException, InterruptedException {
|
84
|
// 如果当前用户是超级管理员或平台管理员,查询所有的设备数量、租户数量、客户数量
|
84
|
// 如果当前用户是超级管理员或平台管理员,查询所有的设备数量、租户数量、客户数量
|
85
|
// 如果当前用户是租户管理员,查询租户下的所有设备、告警、消息量
|
85
|
// 如果当前用户是租户管理员,查询租户下的所有设备、告警、消息量
|
|
@@ -96,7 +96,6 @@ public class TkHomePageServiceImpl implements HomePageService { |
|
@@ -96,7 +96,6 @@ public class TkHomePageServiceImpl implements HomePageService { |
96
|
BaseHomePageTop product = new BaseHomePageTop(zero);
|
96
|
BaseHomePageTop product = new BaseHomePageTop(zero);
|
97
|
Map<String, Object> queryMap = new HashMap<>();
|
97
|
Map<String, Object> queryMap = new HashMap<>();
|
98
|
TenantId currentTenantId = TenantId.fromUUID(UUID.fromString(tenantId));
|
98
|
TenantId currentTenantId = TenantId.fromUUID(UUID.fromString(tenantId));
|
99
|
- String customerId = null;
|
|
|
100
|
List<DeviceDTO> deviceList;
|
99
|
List<DeviceDTO> deviceList;
|
101
|
List<String> orgIds = null;
|
100
|
List<String> orgIds = null;
|
102
|
if (isPtSysAdmin || isPtAdmin) {
|
101
|
if (isPtSysAdmin || isPtAdmin) {
|
|
@@ -128,7 +127,6 @@ public class TkHomePageServiceImpl implements HomePageService { |
|
@@ -128,7 +127,6 @@ public class TkHomePageServiceImpl implements HomePageService { |
128
|
devices.forEach(item -> finalTbDevices.add(item.getTbDeviceId()));
|
127
|
devices.forEach(item -> finalTbDevices.add(item.getTbDeviceId()));
|
129
|
tbDevices = finalTbDevices;
|
128
|
tbDevices = finalTbDevices;
|
130
|
}else{
|
129
|
}else{
|
131
|
- customerId = userMapper.findCustomerIdByUserId(currentUserId);
|
|
|
132
|
if (StringUtils.isNotEmpty(customerId)) {
|
130
|
if (StringUtils.isNotEmpty(customerId)) {
|
133
|
// 查询customerId
|
131
|
// 查询customerId
|
134
|
queryMap.put("customerId", customerId);
|
132
|
queryMap.put("customerId", customerId);
|