Commit f9f6a7f45fa36eb549c66ec66095183627eae137
1 parent
0d8f9582
fix: 首页调整,获取租户、客户的统计,直接返回时间不返回时间戳了
Showing
8 changed files
with
99 additions
and
48 deletions
@@ -10,11 +10,11 @@ import org.springframework.security.access.prepost.PreAuthorize; | @@ -10,11 +10,11 @@ import org.springframework.security.access.prepost.PreAuthorize; | ||
10 | import org.springframework.web.bind.annotation.*; | 10 | import org.springframework.web.bind.annotation.*; |
11 | import org.springframework.web.context.request.async.DeferredResult; | 11 | import org.springframework.web.context.request.async.DeferredResult; |
12 | import org.thingsboard.server.common.data.exception.ThingsboardException; | 12 | import org.thingsboard.server.common.data.exception.ThingsboardException; |
13 | -import org.thingsboard.server.common.data.query.TsValue; | ||
14 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; | 13 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
15 | import org.thingsboard.server.common.data.yunteng.dto.HomePageLeftTopDTO; | 14 | import org.thingsboard.server.common.data.yunteng.dto.HomePageLeftTopDTO; |
16 | import org.thingsboard.server.common.data.yunteng.dto.TenantDTO; | 15 | import org.thingsboard.server.common.data.yunteng.dto.TenantDTO; |
17 | import org.thingsboard.server.common.data.yunteng.dto.TenantTransportMessageDTO; | 16 | import org.thingsboard.server.common.data.yunteng.dto.TenantTransportMessageDTO; |
17 | +import org.thingsboard.server.common.data.yunteng.dto.TkTsValue; | ||
18 | import org.thingsboard.server.common.data.yunteng.dto.statistics.HomePageAppDTO; | 18 | import org.thingsboard.server.common.data.yunteng.dto.statistics.HomePageAppDTO; |
19 | import org.thingsboard.server.common.data.yunteng.enums.TrendType; | 19 | import org.thingsboard.server.common.data.yunteng.enums.TrendType; |
20 | import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; | 20 | import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; |
@@ -71,7 +71,7 @@ public class HomePageController extends BaseController { | @@ -71,7 +71,7 @@ public class HomePageController extends BaseController { | ||
71 | @GetMapping("left/bottom") | 71 | @GetMapping("left/bottom") |
72 | @ApiOperation(value = "获取左侧底部信息") | 72 | @ApiOperation(value = "获取左侧底部信息") |
73 | @PreAuthorize("@check.checkPermissions({'SYS_ADMIN','PLATFORM_ADMIN','CUSTOMER_USER'},{})") | 73 | @PreAuthorize("@check.checkPermissions({'SYS_ADMIN','PLATFORM_ADMIN','CUSTOMER_USER'},{})") |
74 | - public DeferredResult<List<TsValue>> getLeftBottomInfo( | 74 | + public DeferredResult<List<TkTsValue>> getLeftBottomInfo( |
75 | @RequestParam(value = "startTs") long startTs, | 75 | @RequestParam(value = "startTs") long startTs, |
76 | @RequestParam("endTs") long endTs, | 76 | @RequestParam("endTs") long endTs, |
77 | @RequestParam("interval") long interval, | 77 | @RequestParam("interval") long interval, |
@@ -102,7 +102,7 @@ public class HomePageController extends BaseController { | @@ -102,7 +102,7 @@ public class HomePageController extends BaseController { | ||
102 | @GetMapping("app") | 102 | @GetMapping("app") |
103 | @ApiOperation(value = "小程序首页统计信息") | 103 | @ApiOperation(value = "小程序首页统计信息") |
104 | public ResponseEntity<HomePageAppDTO> appStatistics(@ApiParam(value = "只取告警数据") @RequestParam("login") Boolean login) | 104 | public ResponseEntity<HomePageAppDTO> appStatistics(@ApiParam(value = "只取告警数据") @RequestParam("login") Boolean login) |
105 | - throws ThingsboardException, ExecutionException, InterruptedException { | 105 | + throws ThingsboardException{ |
106 | SecurityUser user = getCurrentUser(); | 106 | SecurityUser user = getCurrentUser(); |
107 | if(user == null){ | 107 | if(user == null){ |
108 | return ResponseEntity.status(HttpStatus.FORBIDDEN).build(); | 108 | return ResponseEntity.status(HttpStatus.FORBIDDEN).build(); |
@@ -673,13 +673,13 @@ public class SysUserServiceImpl extends AbstractBaseService<UserMapper, SysUserE | @@ -673,13 +673,13 @@ public class SysUserServiceImpl extends AbstractBaseService<UserMapper, SysUserE | ||
673 | 673 | ||
674 | @Override | 674 | @Override |
675 | @Async | 675 | @Async |
676 | - public CompletableFuture<TsValue> findUsersAsyncByTs( | ||
677 | - LocalDateTime startTs, LocalDateTime endTs, long ts) { | 676 | + public CompletableFuture<TkTsValue> findUsersAsyncByTs( |
677 | + LocalDateTime startTs, LocalDateTime endTs, String date) { | ||
678 | DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); | 678 | DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); |
679 | String startTime = df.format(startTs); | 679 | String startTime = df.format(startTs); |
680 | String endTime = df.format(endTs); | 680 | String endTime = df.format(endTs); |
681 | List<UserDTO> list = baseMapper.findUsersAsyncByTs(startTime, endTime); | 681 | List<UserDTO> list = baseMapper.findUsersAsyncByTs(startTime, endTime); |
682 | - return CompletableFuture.supplyAsync(() -> new TsValue(ts, String.valueOf(list.size()))); | 682 | + return CompletableFuture.supplyAsync(() -> new TkTsValue(date, String.valueOf(list.size()))); |
683 | } | 683 | } |
684 | 684 | ||
685 | @Override | 685 | @Override |
@@ -35,10 +35,9 @@ import org.thingsboard.server.dao.yunteng.service.TkDeviceProfileService; | @@ -35,10 +35,9 @@ import org.thingsboard.server.dao.yunteng.service.TkDeviceProfileService; | ||
35 | import org.thingsboard.server.dao.yunteng.service.TkTenantService; | 35 | import org.thingsboard.server.dao.yunteng.service.TkTenantService; |
36 | import org.thingsboard.server.dao.yunteng.service.TkUserService; | 36 | import org.thingsboard.server.dao.yunteng.service.TkUserService; |
37 | 37 | ||
38 | -import java.time.LocalDate; | ||
39 | -import java.time.LocalDateTime; | ||
40 | -import java.time.LocalTime; | ||
41 | -import java.time.ZoneOffset; | 38 | +import java.time.*; |
39 | +import java.time.format.DateTimeFormatter; | ||
40 | +import java.time.temporal.TemporalAdjusters; | ||
42 | import java.util.*; | 41 | import java.util.*; |
43 | import java.util.concurrent.CompletableFuture; | 42 | import java.util.concurrent.CompletableFuture; |
44 | import java.util.concurrent.ExecutionException; | 43 | import java.util.concurrent.ExecutionException; |
@@ -388,51 +387,66 @@ public class TkHomePageServiceImpl implements HomePageService { | @@ -388,51 +387,66 @@ public class TkHomePageServiceImpl implements HomePageService { | ||
388 | } | 387 | } |
389 | 388 | ||
390 | @Override | 389 | @Override |
391 | - public DeferredResult<List<TsValue>> getHomePageLeftBottomInfo( | 390 | + public DeferredResult<List<TkTsValue>> getHomePageLeftBottomInfo( |
392 | String customerId, | 391 | String customerId, |
393 | long startTs, | 392 | long startTs, |
394 | long endTs, | 393 | long endTs, |
395 | long interval, | 394 | long interval, |
396 | TrendType trend, | 395 | TrendType trend, |
397 | boolean isCustomer) { | 396 | boolean isCustomer) { |
398 | - List<CompletableFuture<TsValue>> futures = new ArrayList<>(); | ||
399 | - interval = interval < 7200000 ? 7200000 : interval; | 397 | + List<CompletableFuture<TkTsValue>> futures = new ArrayList<>(); |
400 | long stepTs = startTs; | 398 | long stepTs = startTs; |
399 | + boolean isYearQuery = false; | ||
400 | + if((endTs - startTs)/86400000 >= 365){ | ||
401 | + isYearQuery =true; | ||
402 | + } | ||
401 | while (stepTs < endTs) { | 403 | while (stepTs < endTs) { |
402 | - long tempStartTs = stepTs; | ||
403 | - long tempEndTs = stepTs + interval; | ||
404 | - long ts = tempStartTs + (tempEndTs - tempStartTs) / 2; | ||
405 | - LocalDateTime startTime = | ||
406 | - LocalDateTime.ofEpochSecond(tempStartTs / 1000, 0, ZoneOffset.ofHours(8)); | ||
407 | - LocalDateTime endTime = | ||
408 | - LocalDateTime.ofEpochSecond(tempEndTs / 1000, 0, ZoneOffset.ofHours(8)); | ||
409 | - CompletableFuture<TsValue> tsValueCompletableFuture = null; | 404 | + Long tempStartTs = stepTs; |
405 | + Long tempEndTs = stepTs + interval; | ||
406 | + LocalDateTime startTime; | ||
407 | + LocalDateTime endTime; | ||
408 | + if(isYearQuery){ | ||
409 | + //按月份过滤 | ||
410 | + Instant instant = Instant.ofEpochMilli(tempStartTs); | ||
411 | + LocalDateTime dateTime = LocalDateTime.ofInstant(instant, ZoneId.systemDefault()); | ||
412 | + startTime = getMonthStartTime(dateTime); | ||
413 | + endTime = getNextMonthStartTime(dateTime); | ||
414 | + }else{ | ||
415 | + //按聚合条件过滤 | ||
416 | + startTime = | ||
417 | + LocalDateTime.ofEpochSecond(tempStartTs / 1000, 0, ZoneOffset.ofHours(8)); | ||
418 | + endTime = | ||
419 | + LocalDateTime.ofEpochSecond(tempEndTs / 1000, 0, ZoneOffset.ofHours(8)); | ||
420 | + } | ||
421 | + CompletableFuture<TkTsValue> tsValueCompletableFuture = null; | ||
410 | // 客户查询的是告警统计 消息统计 | 422 | // 客户查询的是告警统计 消息统计 |
411 | if (isCustomer) { | 423 | if (isCustomer) { |
424 | + String date = getDateByLocalTime(startTime,isYearQuery,true); | ||
412 | if (trend == TrendType.CUSTOMER_ALARM_STATISTICAL) { | 425 | if (trend == TrendType.CUSTOMER_ALARM_STATISTICAL) { |
413 | tsValueCompletableFuture = | 426 | tsValueCompletableFuture = |
414 | findDeviceInfoByTs( | 427 | findDeviceInfoByTs( |
415 | - customerId, tempStartTs, tempEndTs, ts, TrendType.CUSTOMER_ALARM_STATISTICAL); | 428 | + customerId, tempStartTs, tempEndTs, date, TrendType.CUSTOMER_ALARM_STATISTICAL); |
416 | } | 429 | } |
417 | if (trend == TrendType.CUSTOMER_MESSAGE_STATISTICAL) { | 430 | if (trend == TrendType.CUSTOMER_MESSAGE_STATISTICAL) { |
418 | tsValueCompletableFuture = | 431 | tsValueCompletableFuture = |
419 | findDeviceInfoByTs( | 432 | findDeviceInfoByTs( |
420 | - customerId, tempStartTs, tempEndTs, ts, TrendType.CUSTOMER_MESSAGE_STATISTICAL); | 433 | + customerId, tempStartTs, tempEndTs, date, TrendType.CUSTOMER_MESSAGE_STATISTICAL); |
421 | } | 434 | } |
422 | } else { | 435 | } else { |
436 | + String date = getDateByLocalTime(startTime,isYearQuery,false); | ||
423 | if (trend == TrendType.TENANT_TREND) { | 437 | if (trend == TrendType.TENANT_TREND) { |
424 | - tsValueCompletableFuture = tenantService.findTenantsByTs(startTime, endTime, ts); | 438 | + tsValueCompletableFuture = tenantService.findTenantsByTs(startTime, endTime, date); |
425 | } | 439 | } |
426 | if (trend == TrendType.CUSTOMER_TREND) { | 440 | if (trend == TrendType.CUSTOMER_TREND) { |
427 | - tsValueCompletableFuture = tkUserService.findUsersAsyncByTs(startTime, endTime, ts); | 441 | + tsValueCompletableFuture = tkUserService.findUsersAsyncByTs(startTime, endTime, date); |
428 | } | 442 | } |
429 | } | 443 | } |
430 | futures.add(tsValueCompletableFuture); | 444 | futures.add(tsValueCompletableFuture); |
431 | stepTs = tempEndTs; | 445 | stepTs = tempEndTs; |
432 | } | 446 | } |
433 | - final DeferredResult<List<TsValue>> deferredResult = new DeferredResult<>(); | 447 | + final DeferredResult<List<TkTsValue>> deferredResult = new DeferredResult<>(); |
434 | if (futures.size() > FastIotConstants.MagicNumber.ZERO) { | 448 | if (futures.size() > FastIotConstants.MagicNumber.ZERO) { |
435 | - ListenableFuture<List<TsValue>> listenableFuture = | 449 | + ListenableFuture<List<TkTsValue>> listenableFuture = |
436 | Futures.transform( | 450 | Futures.transform( |
437 | setFutures(futures), | 451 | setFutures(futures), |
438 | tsValues -> { | 452 | tsValues -> { |
@@ -765,9 +779,9 @@ public class TkHomePageServiceImpl implements HomePageService { | @@ -765,9 +779,9 @@ public class TkHomePageServiceImpl implements HomePageService { | ||
765 | homePageLeftTopDTO.setCustomerInfo(baseHomePageTop); | 779 | homePageLeftTopDTO.setCustomerInfo(baseHomePageTop); |
766 | } | 780 | } |
767 | 781 | ||
768 | - private SettableFuture<List<TsValue>> setFutures(List<CompletableFuture<TsValue>> tsFutures) { | ||
769 | - SettableFuture<List<TsValue>> listenableFuture = SettableFuture.create(); | ||
770 | - CompletableFuture<List<TsValue>> entities = | 782 | + private SettableFuture<List<TkTsValue>> setFutures(List<CompletableFuture<TkTsValue>> tsFutures) { |
783 | + SettableFuture<List<TkTsValue>> listenableFuture = SettableFuture.create(); | ||
784 | + CompletableFuture<List<TkTsValue>> entities = | ||
771 | CompletableFuture.allOf(tsFutures.toArray(new CompletableFuture[tsFutures.size()])) | 785 | CompletableFuture.allOf(tsFutures.toArray(new CompletableFuture[tsFutures.size()])) |
772 | .thenApply( | 786 | .thenApply( |
773 | v -> tsFutures.stream().map(CompletableFuture::join).collect(Collectors.toList())); | 787 | v -> tsFutures.stream().map(CompletableFuture::join).collect(Collectors.toList())); |
@@ -800,11 +814,11 @@ public class TkHomePageServiceImpl implements HomePageService { | @@ -800,11 +814,11 @@ public class TkHomePageServiceImpl implements HomePageService { | ||
800 | return listenableFuture; | 814 | return listenableFuture; |
801 | } | 815 | } |
802 | 816 | ||
803 | - private FutureCallback<List<TsValue>> getTsValueCallback( | ||
804 | - final DeferredResult<List<TsValue>> response) { | 817 | + private FutureCallback<List<TkTsValue>> getTsValueCallback( |
818 | + final DeferredResult<List<TkTsValue>> response) { | ||
805 | return new FutureCallback<>() { | 819 | return new FutureCallback<>() { |
806 | @Override | 820 | @Override |
807 | - public void onSuccess(@Nullable List<TsValue> tsValues) { | 821 | + public void onSuccess(@Nullable List<TkTsValue> tsValues) { |
808 | response.setResult(tsValues); | 822 | response.setResult(tsValues); |
809 | } | 823 | } |
810 | 824 | ||
@@ -852,14 +866,43 @@ public class TkHomePageServiceImpl implements HomePageService { | @@ -852,14 +866,43 @@ public class TkHomePageServiceImpl implements HomePageService { | ||
852 | }; | 866 | }; |
853 | } | 867 | } |
854 | 868 | ||
855 | - private CompletableFuture<TsValue> findDeviceInfoByTs( | ||
856 | - String customerId, Long startTs, Long endTs, long ts, TrendType trend) { | 869 | + private CompletableFuture<TkTsValue> findDeviceInfoByTs( |
870 | + String customerId, Long startTs, Long endTs, String date, TrendType trend) { | ||
857 | Integer value; | 871 | Integer value; |
858 | if (trend == TrendType.CUSTOMER_MESSAGE_STATISTICAL) { | 872 | if (trend == TrendType.CUSTOMER_MESSAGE_STATISTICAL) { |
859 | value = deviceMapper.findDeviceMessageInfoByTs(customerId, startTs, endTs); | 873 | value = deviceMapper.findDeviceMessageInfoByTs(customerId, startTs, endTs); |
860 | } else { | 874 | } else { |
861 | value = deviceMapper.findDeviceAlarmInfoByCreatedTime(customerId, startTs, endTs); | 875 | value = deviceMapper.findDeviceAlarmInfoByCreatedTime(customerId, startTs, endTs); |
862 | } | 876 | } |
863 | - return CompletableFuture.supplyAsync(() -> new TsValue(ts, String.valueOf(value))); | 877 | + return CompletableFuture.supplyAsync(() -> new TkTsValue(date, String.valueOf(value))); |
878 | + } | ||
879 | + | ||
880 | + /** | ||
881 | + * 获取本月的开始时间 | ||
882 | + * @param dateTime 本月时间 | ||
883 | + * @return 本月第一天时间 | ||
884 | + */ | ||
885 | + public LocalDateTime getMonthStartTime(LocalDateTime dateTime){ | ||
886 | + // 获取本月的第一天0点的时间戳 | ||
887 | + return dateTime.with(TemporalAdjusters.firstDayOfMonth()).withHour(0).withMinute(0).withSecond(0).withNano(0); | ||
888 | + } | ||
889 | + | ||
890 | + /** | ||
891 | + * 获取下个月的开始时间 | ||
892 | + * @param dateTime 本月时间 | ||
893 | + * @return 下个月第一天时间 | ||
894 | + */ | ||
895 | + public LocalDateTime getNextMonthStartTime(LocalDateTime dateTime){ | ||
896 | + // 获取下个月的第一天 | ||
897 | + LocalDateTime firstDayOfNextMonth = dateTime.with(TemporalAdjusters.firstDayOfNextMonth()).with(TemporalAdjusters.firstDayOfMonth()); | ||
898 | + // 将时间设置为0点 | ||
899 | + return firstDayOfNextMonth.withHour(0).withMinute(0).withSecond(0).withNano(0); | ||
900 | + } | ||
901 | + | ||
902 | + public String getDateByLocalTime(LocalDateTime startTime,boolean isYearQuery,boolean isCustomer){ | ||
903 | + String format = isYearQuery ?"yyyy-MM":"yyyy-MM-dd"; | ||
904 | + format = isCustomer?"yyyy-MM-dd HH:mm:ss":format; | ||
905 | + DateTimeFormatter formatter = DateTimeFormatter.ofPattern(format); | ||
906 | + return startTime.format(formatter); | ||
864 | } | 907 | } |
865 | } | 908 | } |
@@ -14,10 +14,10 @@ import org.springframework.stereotype.Service; | @@ -14,10 +14,10 @@ import org.springframework.stereotype.Service; | ||
14 | import org.springframework.transaction.annotation.Transactional; | 14 | import org.springframework.transaction.annotation.Transactional; |
15 | import org.thingsboard.server.common.data.id.EntityId; | 15 | import org.thingsboard.server.common.data.id.EntityId; |
16 | import org.thingsboard.server.common.data.id.UserId; | 16 | import org.thingsboard.server.common.data.id.UserId; |
17 | -import org.thingsboard.server.common.data.query.TsValue; | ||
18 | import org.thingsboard.server.common.data.yunteng.core.exception.TkDataValidationException; | 17 | import org.thingsboard.server.common.data.yunteng.core.exception.TkDataValidationException; |
19 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; | 18 | import org.thingsboard.server.common.data.yunteng.core.message.ErrorMessage; |
20 | import org.thingsboard.server.common.data.yunteng.dto.TenantDTO; | 19 | import org.thingsboard.server.common.data.yunteng.dto.TenantDTO; |
20 | +import org.thingsboard.server.common.data.yunteng.dto.TkTsValue; | ||
21 | import org.thingsboard.server.common.data.yunteng.dto.UserDTO; | 21 | import org.thingsboard.server.common.data.yunteng.dto.UserDTO; |
22 | import org.thingsboard.server.common.data.yunteng.dto.request.TenantReqDTO; | 22 | import org.thingsboard.server.common.data.yunteng.dto.request.TenantReqDTO; |
23 | import org.thingsboard.server.common.data.yunteng.enums.TenantStatusEnum; | 23 | import org.thingsboard.server.common.data.yunteng.enums.TenantStatusEnum; |
@@ -343,14 +343,14 @@ public class TkTenantServiceImpl extends AbstractBaseService<TenantMapper, SysTe | @@ -343,14 +343,14 @@ public class TkTenantServiceImpl extends AbstractBaseService<TenantMapper, SysTe | ||
343 | 343 | ||
344 | @Override | 344 | @Override |
345 | @Async | 345 | @Async |
346 | - public CompletableFuture<TsValue> findTenantsByTs( | ||
347 | - LocalDateTime startTs, LocalDateTime endTs, long ts) { | 346 | + public CompletableFuture<TkTsValue> findTenantsByTs( |
347 | + LocalDateTime startTs, LocalDateTime endTs, String date) { | ||
348 | List<SysTenantEntity> tenants = | 348 | List<SysTenantEntity> tenants = |
349 | baseMapper.selectList( | 349 | baseMapper.selectList( |
350 | new LambdaQueryWrapper<SysTenantEntity>() | 350 | new LambdaQueryWrapper<SysTenantEntity>() |
351 | .ge(SysTenantEntity::getCreateTime, startTs) | 351 | .ge(SysTenantEntity::getCreateTime, startTs) |
352 | .lt(SysTenantEntity::getCreateTime, endTs)); | 352 | .lt(SysTenantEntity::getCreateTime, endTs)); |
353 | - return CompletableFuture.supplyAsync(() -> new TsValue(ts, String.valueOf(tenants.size()))); | 353 | + return CompletableFuture.supplyAsync(() -> new TkTsValue(date, String.valueOf(tenants.size()))); |
354 | } | 354 | } |
355 | 355 | ||
356 | @Override | 356 | @Override |
@@ -3,10 +3,10 @@ package org.thingsboard.server.dao.yunteng.service; | @@ -3,10 +3,10 @@ package org.thingsboard.server.dao.yunteng.service; | ||
3 | import org.springframework.web.context.request.async.DeferredResult; | 3 | import org.springframework.web.context.request.async.DeferredResult; |
4 | import org.thingsboard.server.common.data.id.EntityId; | 4 | import org.thingsboard.server.common.data.id.EntityId; |
5 | import org.thingsboard.server.common.data.id.TenantId; | 5 | import org.thingsboard.server.common.data.id.TenantId; |
6 | -import org.thingsboard.server.common.data.query.TsValue; | ||
7 | import org.thingsboard.server.common.data.yunteng.dto.HomePageLeftTopDTO; | 6 | import org.thingsboard.server.common.data.yunteng.dto.HomePageLeftTopDTO; |
8 | import org.thingsboard.server.common.data.yunteng.dto.TenantDTO; | 7 | import org.thingsboard.server.common.data.yunteng.dto.TenantDTO; |
9 | import org.thingsboard.server.common.data.yunteng.dto.TenantTransportMessageDTO; | 8 | import org.thingsboard.server.common.data.yunteng.dto.TenantTransportMessageDTO; |
9 | +import org.thingsboard.server.common.data.yunteng.dto.TkTsValue; | ||
10 | import org.thingsboard.server.common.data.yunteng.dto.statistics.HomePageAppDTO; | 10 | import org.thingsboard.server.common.data.yunteng.dto.statistics.HomePageAppDTO; |
11 | import org.thingsboard.server.common.data.yunteng.enums.TrendType; | 11 | import org.thingsboard.server.common.data.yunteng.enums.TrendType; |
12 | import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; | 12 | import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; |
@@ -52,7 +52,7 @@ public interface HomePageService { | @@ -52,7 +52,7 @@ public interface HomePageService { | ||
52 | * @param trend 趋势类型 | 52 | * @param trend 趋势类型 |
53 | * @return 左侧底部信息 | 53 | * @return 左侧底部信息 |
54 | */ | 54 | */ |
55 | - DeferredResult<List<TsValue>> getHomePageLeftBottomInfo( | 55 | + DeferredResult<List<TkTsValue>> getHomePageLeftBottomInfo( |
56 | String customerId, long startTs, long endTs, long interval, TrendType trend, boolean isCustomer); | 56 | String customerId, long startTs, long endTs, long interval, TrendType trend, boolean isCustomer); |
57 | 57 | ||
58 | /** | 58 | /** |
@@ -3,8 +3,8 @@ package org.thingsboard.server.dao.yunteng.service; | @@ -3,8 +3,8 @@ package org.thingsboard.server.dao.yunteng.service; | ||
3 | 3 | ||
4 | 4 | ||
5 | import com.google.common.util.concurrent.ListenableFuture; | 5 | import com.google.common.util.concurrent.ListenableFuture; |
6 | -import org.thingsboard.server.common.data.query.TsValue; | ||
7 | import org.thingsboard.server.common.data.yunteng.dto.TenantDTO; | 6 | import org.thingsboard.server.common.data.yunteng.dto.TenantDTO; |
7 | +import org.thingsboard.server.common.data.yunteng.dto.TkTsValue; | ||
8 | import org.thingsboard.server.common.data.yunteng.dto.request.TenantReqDTO; | 8 | import org.thingsboard.server.common.data.yunteng.dto.request.TenantReqDTO; |
9 | import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; | 9 | import org.thingsboard.server.common.data.yunteng.utils.tools.TkPageData; |
10 | 10 | ||
@@ -33,7 +33,7 @@ public interface TkTenantService { | @@ -33,7 +33,7 @@ public interface TkTenantService { | ||
33 | 33 | ||
34 | List<TenantDTO> getAllTenant(); | 34 | List<TenantDTO> getAllTenant(); |
35 | 35 | ||
36 | - CompletableFuture<TsValue> findTenantsByTs(LocalDateTime startTs, LocalDateTime endTs,long ts); | 36 | + CompletableFuture<TkTsValue> findTenantsByTs(LocalDateTime startTs, LocalDateTime endTs, String date); |
37 | 37 | ||
38 | List<TenantDTO> checkTenantProfileIdUsedByTenants(String tenantProfileId); | 38 | List<TenantDTO> checkTenantProfileIdUsedByTenants(String tenantProfileId); |
39 | 39 |
1 | package org.thingsboard.server.dao.yunteng.service; | 1 | package org.thingsboard.server.dao.yunteng.service; |
2 | 2 | ||
3 | import org.thingsboard.server.common.data.id.UserId; | 3 | import org.thingsboard.server.common.data.id.UserId; |
4 | -import org.thingsboard.server.common.data.query.TsValue; | 4 | +import org.thingsboard.server.common.data.yunteng.dto.TkTsValue; |
5 | import org.thingsboard.server.common.data.yunteng.dto.UserDTO; | 5 | import org.thingsboard.server.common.data.yunteng.dto.UserDTO; |
6 | import org.thingsboard.server.common.data.yunteng.dto.UserDetailsDTO; | 6 | import org.thingsboard.server.common.data.yunteng.dto.UserDetailsDTO; |
7 | import org.thingsboard.server.common.data.yunteng.dto.UserInfoDTO; | 7 | import org.thingsboard.server.common.data.yunteng.dto.UserInfoDTO; |
@@ -133,11 +133,11 @@ public interface TkUserService { | @@ -133,11 +133,11 @@ public interface TkUserService { | ||
133 | * | 133 | * |
134 | * @param startTs 开始时间 | 134 | * @param startTs 开始时间 |
135 | * @param endTs 结束时间 | 135 | * @param endTs 结束时间 |
136 | - * @param ts 时间 | 136 | + * @param date 时间 |
137 | * @return 客户信息 | 137 | * @return 客户信息 |
138 | */ | 138 | */ |
139 | - CompletableFuture<TsValue> findUsersAsyncByTs( | ||
140 | - LocalDateTime startTs, LocalDateTime endTs, long ts); | 139 | + CompletableFuture<TkTsValue> findUsersAsyncByTs( |
140 | + LocalDateTime startTs, LocalDateTime endTs, String date); | ||
141 | 141 | ||
142 | /** | 142 | /** |
143 | * 检查账号是否存在 | 143 | * 检查账号是否存在 |