调整代码
This commit is contained in:
parent
4f79eb01bb
commit
c7da74d85b
@ -1,10 +1,6 @@
|
||||
package com.evotech.hd.cloud.task;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.evotech.hd.cloud.service.OrderSwapBatteryService;
|
||||
import com.evotech.hd.cloud.service.newthread.GZHTemplateMessageService;
|
||||
@ -12,10 +8,13 @@ import com.evotech.hd.common.core.dao.cloud.OrderSwapBatteryDao;
|
||||
import com.evotech.hd.common.core.entity.Result;
|
||||
import com.evotech.hd.common.core.entity.cloud.OrderSwapBattery;
|
||||
import com.evotech.hd.common.core.enums.CodeMsg;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Component
|
||||
@ -35,19 +34,21 @@ public class OrderCostCalculateTask {
|
||||
public void calculateOrder() {
|
||||
log.info("\r\n===>>>开始查找订单计算费用");
|
||||
// 查询状态为5的订单
|
||||
Boolean flag = true;
|
||||
// Boolean flag = true;
|
||||
int n = 0;
|
||||
while (flag) {
|
||||
// while (flag) {
|
||||
List<OrderSwapBattery> list = orderSwapBatteryDao.selectList(new QueryWrapper<OrderSwapBattery>()
|
||||
.eq("status", 5).ne("del_flag", 1)
|
||||
.ge("order_time", DateUtil.beginOfYear(new Date()))
|
||||
.last("limit 20"));
|
||||
if (!list.isEmpty()) {
|
||||
n = orderCalculate(n, list);
|
||||
} else {
|
||||
flag = false;
|
||||
// flag = false;
|
||||
}
|
||||
}
|
||||
// else {
|
||||
// flag = false;
|
||||
// }
|
||||
// }
|
||||
|
||||
log.info("\r\n===>>>订单计算费用完成:{} 条数据", n);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user