Forráskód Böngészése

算法卡包修改业务逻辑

李进 1 éve
szülő
commit
d5b759bb74

+ 5 - 3
device-api-service/src/main/java/com/xy/job/DeviceAlgorithmChargingJob.java

@@ -16,6 +16,7 @@ import lombok.AllArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Component;
 
+import java.time.LocalDate;
 import java.time.LocalDateTime;
 import java.util.ArrayList;
 import java.util.List;
@@ -59,7 +60,7 @@ public class DeviceAlgorithmChargingJob {
             }
             JMap<Long, DeviceInfo> deviceInfosJMaps = new JArrayList<>(deviceInfos).toMap(DeviceInfo::getDeviceId).cover();
             //分组统计设备可用算法卡包
-            LocalDateTime now = LocalDateTime.now();
+            LocalDate now1 = LocalDate.now();
             LambdaQueryWrapper<DeviceAlgorithmCharging> lambdaQueryWrapper = new LambdaQueryWrapper<DeviceAlgorithmCharging>()
                     .select(DeviceAlgorithmCharging::getDeviceId)
                     .gt(DeviceAlgorithmCharging::getMercId, mercAccount.getMercId())
@@ -68,14 +69,15 @@ public class DeviceAlgorithmChargingJob {
                     .and(deviceAlgorithmChargingLambdaQueryWrapper -> deviceAlgorithmChargingLambdaQueryWrapper
                             .eq(DeviceAlgorithmCharging::getTimeout, -1)
                             .or(deviceAlgorithmChargingLambdaQueryWrapper1 -> deviceAlgorithmChargingLambdaQueryWrapper1
-                                    .le(DeviceAlgorithmCharging::getBeginTime, now)
-                                    .ge(DeviceAlgorithmCharging::getTimeout, now)
+                                    .le(DeviceAlgorithmCharging::getBeginTime, now1)
+                                    .ge(DeviceAlgorithmCharging::getTimeout, now1)
                             )
                     )
                     .groupBy(DeviceAlgorithmCharging::getDeviceId);
             List<DeviceAlgorithmCharging> deviceAlgorithmChargings = deviceAlgorithmChargingService.list(lambdaQueryWrapper);
             JMap<Long, DeviceAlgorithmCharging> deviceAlgorithmChargingsJMaps = new JArrayList<>(deviceAlgorithmChargings).toMap(DeviceAlgorithmCharging::getDeviceId).cover();
             //判断是否过期
+            LocalDateTime now = LocalDateTime.now();
             deviceInfosJMaps.forEach((deviceId, deviceInfo) -> {
                 if (deviceAlgorithmChargingsJMaps.containsKey(deviceId)) {
                     return;