Commit 2ae50db0dca7451e5540bf01a4f453dd937be7da

Authored by xp.Huang
1 parent 32d2f0d6

fix: 首页接口在大屏页面分享情况下的调用

... ... @@ -47,7 +47,8 @@ public class HomePageController extends BaseController {
47 47 getCurrentUser().isPtTenantAdmin(),
48 48 getCurrentUser().isPtCommonTenant(),
49 49 getCurrentUser().getCurrentTenantId(),
50   - getCurrentUser().getCurrentUserId());
  50 + getCurrentUser().getCurrentUserId(),
  51 + getCurrentUser().getCustomerId().getId().toString());
51 52 }
52 53
53 54 @GetMapping("right/overdue")
... ...
... ... @@ -40,7 +40,6 @@ import org.thingsboard.server.common.data.yunteng.enums.TrendType;
40 40 import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData;
41 41 import org.thingsboard.server.dao.entity.EntityService;
42 42 import org.thingsboard.server.dao.timeseries.TimeseriesService;
43   -import org.thingsboard.server.dao.usagerecord.ApiUsageStateDao;
44 43 import org.thingsboard.server.dao.usagerecord.ApiUsageStateService;
45 44 import org.thingsboard.server.dao.yunteng.mapper.DeviceMapper;
46 45 import org.thingsboard.server.dao.yunteng.mapper.TkAlarmMapper;
... ... @@ -79,7 +78,8 @@ public class TkHomePageServiceImpl implements HomePageService {
79 78 boolean isTenantAdmin,
80 79 boolean isPtCommonTenant,
81 80 String tenantId,
82   - String currentUserId)
  81 + String currentUserId,
  82 + String customerId)
83 83 throws ExecutionException, InterruptedException {
84 84 // 如果当前用户是超级管理员或平台管理员,查询所有的设备数量、租户数量、客户数量
85 85 // 如果当前用户是租户管理员,查询租户下的所有设备、告警、消息量
... ... @@ -96,7 +96,6 @@ public class TkHomePageServiceImpl implements HomePageService {
96 96 BaseHomePageTop product = new BaseHomePageTop(zero);
97 97 Map<String, Object> queryMap = new HashMap<>();
98 98 TenantId currentTenantId = TenantId.fromUUID(UUID.fromString(tenantId));
99   - String customerId = null;
100 99 List<DeviceDTO> deviceList;
101 100 List<String> orgIds = null;
102 101 if (isPtSysAdmin || isPtAdmin) {
... ... @@ -128,7 +127,6 @@ public class TkHomePageServiceImpl implements HomePageService {
128 127 devices.forEach(item -> finalTbDevices.add(item.getTbDeviceId()));
129 128 tbDevices = finalTbDevices;
130 129 }else{
131   - customerId = userMapper.findCustomerIdByUserId(currentUserId);
132 130 if (StringUtils.isNotEmpty(customerId)) {
133 131 // 查询customerId
134 132 queryMap.put("customerId", customerId);
... ...
... ... @@ -25,6 +25,8 @@ public interface HomePageService {
25 25 * @param isTenantAdmin 是否租户管理员
26 26 * @param tenantId 租户ID
27 27 * @param currentUserId 当前用户ID
  28 + * @param isPtCommonTenant 是否普通租户管理员
  29 + * @param customerId 客户ID
28 30 * @return 首页左边顶部信息
29 31 */
30 32 HomePageLeftTopDTO getHomePageLeftTopInfo(
... ... @@ -33,7 +35,8 @@ public interface HomePageService {
33 35 boolean isTenantAdmin,
34 36 boolean isPtCommonTenant,
35 37 String tenantId,
36   - String currentUserId)
  38 + String currentUserId,
  39 + String customerId)
37 40 throws ExecutionException, InterruptedException;
38 41
39 42 /**
... ...