...
|
...
|
@@ -90,7 +90,7 @@ public class TkHomePageServiceImpl implements HomePageService { |
90
|
90
|
LocalDateTime nowTime = LocalDateTime.now();
|
91
|
91
|
LocalDateTime todayBegin = LocalDateTime.of(nowTime.toLocalDate(), LocalTime.MIN);
|
92
|
92
|
LocalDateTime todayEnd = LocalDateTime.of(nowTime.toLocalDate(), LocalTime.MAX);
|
93
|
|
- int zero = FastIotConstants.MagicNumber.ZERO;
|
|
93
|
+ long zero = FastIotConstants.MagicNumber.ZERO;
|
94
|
94
|
HomePageTopMessage messageInfo = new HomePageTopMessage(zero);
|
95
|
95
|
BaseHomePageTop alarm = new BaseHomePageTop(zero);
|
96
|
96
|
BaseHomePageTop product = new BaseHomePageTop(zero);
|
...
|
...
|
@@ -162,10 +162,9 @@ public class TkHomePageServiceImpl implements HomePageService { |
162
|
162
|
tenantId, new CustomerId(UUID.fromString(customerId)), null, null);
|
163
|
163
|
}
|
164
|
164
|
}
|
165
|
|
- int todayAdd = zero;
|
|
165
|
+ long todayAdd = zero;
|
166
|
166
|
if (null != deviceProfileDTOList && !deviceProfileDTOList.isEmpty()) {
|
167
|
167
|
todayAdd =
|
168
|
|
- (int)
|
169
|
168
|
deviceProfileDTOList.stream()
|
170
|
169
|
.filter(
|
171
|
170
|
item ->
|
...
|
...
|
@@ -568,11 +567,11 @@ public class TkHomePageServiceImpl implements HomePageService { |
568
|
567
|
* @param homeDeviceInfoDTO 首页信息
|
569
|
568
|
*/
|
570
|
569
|
private void setDeviceInfoData(List<DeviceDTO> deviceList, HomeDeviceInfoDTO homeDeviceInfoDTO) {
|
571
|
|
- homeDeviceInfoDTO.setSumCount(deviceList.size());
|
572
|
|
- int defaultValue = FastIotConstants.MagicNumber.ZERO;
|
573
|
|
- AtomicReference<Integer> gateWay = new AtomicReference<>(defaultValue);
|
574
|
|
- AtomicReference<Integer> directConnection = new AtomicReference<>(defaultValue);
|
575
|
|
- AtomicReference<Integer> sensor = new AtomicReference<>(defaultValue);
|
|
570
|
+ homeDeviceInfoDTO.setSumCount(deviceList.stream().count());
|
|
571
|
+ long defaultValue = FastIotConstants.MagicNumber.ZERO;
|
|
572
|
+ AtomicReference<Long> gateWay = new AtomicReference<>(defaultValue);
|
|
573
|
+ AtomicReference<Long> directConnection = new AtomicReference<>(defaultValue);
|
|
574
|
+ AtomicReference<Long> sensor = new AtomicReference<>(defaultValue);
|
576
|
575
|
deviceList.forEach(
|
577
|
576
|
device -> {
|
578
|
577
|
int basicNum = FastIotConstants.MagicNumber.ONE;
|
...
|
...
|
@@ -624,15 +623,14 @@ public class TkHomePageServiceImpl implements HomePageService { |
624
|
623
|
private void setTenantInfoData(
|
625
|
624
|
HomePageLeftTopDTO homePageLeftTopDTO, LocalDateTime startTime, LocalDateTime endTime) {
|
626
|
625
|
List<TenantDTO> tenants = tenantService.getAllTenant();
|
627
|
|
- int todayAdd =
|
628
|
|
- (int)
|
|
626
|
+ long todayAdd =
|
629
|
627
|
tenants.stream()
|
630
|
628
|
.filter(
|
631
|
629
|
tenant ->
|
632
|
630
|
tenant.getCreateTime().isAfter(startTime)
|
633
|
631
|
&& tenant.getCreateTime().isBefore(endTime))
|
634
|
632
|
.count();
|
635
|
|
- int sumCount = tenants.size();
|
|
633
|
+ long sumCount = tenants.size();
|
636
|
634
|
BaseHomePageTop baseHomePageTop = new BaseHomePageTop(sumCount, todayAdd);
|
637
|
635
|
homePageLeftTopDTO.setTenantInfo(baseHomePageTop);
|
638
|
636
|
}
|
...
|
...
|
@@ -710,7 +708,7 @@ public class TkHomePageServiceImpl implements HomePageService { |
710
|
708
|
result.forEach(
|
711
|
709
|
tsKvEntry -> {
|
712
|
710
|
if (tsKvEntry.getLongValue().isPresent()) {
|
713
|
|
- int count = tsKvEntry.getLongValue().get().intValue();
|
|
711
|
+ long count = tsKvEntry.getLongValue().get();
|
714
|
712
|
switch (tsKvEntry.getKey()) {
|
715
|
713
|
case FastIotConstants.Statistics.TRANSPORT_MSG_COUNT:
|
716
|
714
|
messageInfo.setMessageCount(count + messageInfo.getMessageCount());
|
...
|
...
|
@@ -719,7 +717,7 @@ public class TkHomePageServiceImpl implements HomePageService { |
719
|
717
|
messageInfo.setDataPointsCount(count + messageInfo.getDataPointsCount());
|
720
|
718
|
break;
|
721
|
719
|
case FastIotConstants.Statistics.CREATED_ALARMS_COUNT:
|
722
|
|
- alarm.setSumCount(count + alarm.getSumCount());
|
|
720
|
+ alarm.setSumCount( count + alarm.getSumCount());
|
723
|
721
|
break;
|
724
|
722
|
default:
|
725
|
723
|
break;
|
...
|
...
|
@@ -887,9 +885,9 @@ public class TkHomePageServiceImpl implements HomePageService { |
887
|
885
|
private void setCustomerInfoData(
|
888
|
886
|
HomePageLeftTopDTO homePageLeftTopDTO, LocalDateTime startTime, LocalDateTime endTime) {
|
889
|
887
|
List<UserDTO> userList = userMapper.getUserCountByRoleType(RoleEnum.CUSTOMER_USER);
|
890
|
|
- int sumCount = userList != null ? userList.size() : FastIotConstants.MagicNumber.ZERO;
|
|
888
|
+ long sumCount = userList != null ? userList.size() : FastIotConstants.MagicNumber.ZERO;
|
891
|
889
|
|
892
|
|
- int todayAdd = FastIotConstants.MagicNumber.ZERO;
|
|
890
|
+ long todayAdd = FastIotConstants.MagicNumber.ZERO;
|
893
|
891
|
if (userList != null && !userList.isEmpty()) {
|
894
|
892
|
todayAdd +=
|
895
|
893
|
(int) userList.stream()
|
...
|
...
|
|