|
@@ -1,5 +1,7 @@
|
|
|
package com.xy.job;
|
|
|
|
|
|
+import cn.hutool.core.date.DatePattern;
|
|
|
+import cn.hutool.core.date.DateUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.xxl.job.core.biz.model.ReturnT;
|
|
|
import com.xxl.job.core.handler.annotation.XxlJob;
|
|
@@ -11,6 +13,7 @@ import com.xy.entity.DeviceInfo;
|
|
|
import com.xy.service.DeviceAlgorithmChargingServiceImpl;
|
|
|
import com.xy.service.DeviceInfoServiceImpl;
|
|
|
import com.xy.service.MercAccountService;
|
|
|
+import com.xy.utils.DataTime;
|
|
|
import com.xy.utils.Emptys;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
@@ -60,7 +63,7 @@ public class DeviceAlgorithmChargingJob {
|
|
|
}
|
|
|
JMap<Long, DeviceInfo> deviceInfosJMaps = new JArrayList<>(deviceInfos).toMap(DeviceInfo::getDeviceId).cover();
|
|
|
//分组统计设备可用算法卡包
|
|
|
- LocalDate now1 = LocalDate.now();
|
|
|
+ String algorithmDate = DateUtil.format(DateUtil.date(), DatePattern.PURE_DATE_PATTERN);
|
|
|
LambdaQueryWrapper<DeviceAlgorithmCharging> lambdaQueryWrapper = new LambdaQueryWrapper<DeviceAlgorithmCharging>()
|
|
|
.select(DeviceAlgorithmCharging::getDeviceId)
|
|
|
.gt(DeviceAlgorithmCharging::getMercId, mercAccount.getMercId())
|
|
@@ -69,8 +72,8 @@ public class DeviceAlgorithmChargingJob {
|
|
|
.and(deviceAlgorithmChargingLambdaQueryWrapper -> deviceAlgorithmChargingLambdaQueryWrapper
|
|
|
.eq(DeviceAlgorithmCharging::getTimeout, -1)
|
|
|
.or(deviceAlgorithmChargingLambdaQueryWrapper1 -> deviceAlgorithmChargingLambdaQueryWrapper1
|
|
|
- .le(DeviceAlgorithmCharging::getBeginTime, now1)
|
|
|
- .ge(DeviceAlgorithmCharging::getTimeout, now1)
|
|
|
+ .le(DeviceAlgorithmCharging::getBeginTime, Integer.valueOf(algorithmDate))
|
|
|
+ .ge(DeviceAlgorithmCharging::getTimeout, Integer.valueOf(algorithmDate))
|
|
|
)
|
|
|
)
|
|
|
.groupBy(DeviceAlgorithmCharging::getDeviceId);
|