|
@@ -20,9 +20,7 @@ import org.springframework.stereotype.Component;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import java.math.BigDecimal;
|
|
|
-import java.util.Arrays;
|
|
|
-import java.util.Date;
|
|
|
-import java.util.List;
|
|
|
+import java.util.*;
|
|
|
|
|
|
|
|
|
/**
|
|
@@ -109,6 +107,7 @@ public class massageTask {
|
|
|
total = timeoutNotOrder(date);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
private Long timeoutNotOrder(Date nowDate) {
|
|
|
LambdaQueryWrapper<TOrder> objectLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
objectLambdaQueryWrapper.eq(TOrder::getnStatus, OrderStatusEnum.WAIT_JD.getCode()).
|
|
@@ -131,7 +130,6 @@ public class massageTask {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
public void isGetAmount() {
|
|
|
Date nowDate = new Date();
|
|
|
log.info("定时分配出账金额日期,{}", nowDate);
|
|
@@ -140,6 +138,7 @@ public class massageTask {
|
|
|
log.info("定时分配出账金额日期,{}", date);
|
|
|
isGetAmount(date);
|
|
|
}
|
|
|
+
|
|
|
private void isGetAmount(Date date) {
|
|
|
|
|
|
//查询所有部门
|
|
@@ -155,7 +154,7 @@ public class massageTask {
|
|
|
LambdaQueryWrapper<TConsumptionLog> logLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
logLambdaQueryWrapper.eq(TConsumptionLog::getIsGet, MassageConstants.INTEGER_ZERO).
|
|
|
eq(TConsumptionLog::getOpenId, js.getcOpenId()).
|
|
|
- in(TConsumptionLog::getBillType, Arrays.asList(BillTypeEnum.INCOME.getCode(),BillTypeEnum.DISTRIBUTION.getCode())).
|
|
|
+ in(TConsumptionLog::getBillType, Arrays.asList(BillTypeEnum.INCOME.getCode(), BillTypeEnum.DISTRIBUTION.getCode())).
|
|
|
le(TConsumptionLog::getCreateTime, date).
|
|
|
orderByAsc(TConsumptionLog::getCreateTime);
|
|
|
List<TConsumptionLog> consumptionLogList = consumptionLogService.list(logLambdaQueryWrapper);
|
|
@@ -180,20 +179,21 @@ public class massageTask {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
public void cancelNewJs() {
|
|
|
|
|
|
Date nowDate = new Date();
|
|
|
log.info("开始执行取消新技师标识任务当前时间,{}", nowDate);
|
|
|
|
|
|
- long total = 1L;
|
|
|
- while (total > 0L) {
|
|
|
+ long flag = 1L;
|
|
|
+ while (flag > 0L) {
|
|
|
LambdaQueryWrapper<TJs> objectLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
Date date = DateTimeUtils.addDays(nowDate, -7);
|
|
|
|
|
|
log.info("开始执行取新技师当前时间减7天,{}", date);
|
|
|
- objectLambdaQueryWrapper.eq(TJs::getnB2, MassageConstants.INTEGER_ONE).le(TJs::getcTime, date).orderByAsc(TJs::getcTime);
|
|
|
+ objectLambdaQueryWrapper.eq(TJs::getnB2, MassageConstants.INTEGER_ONE).
|
|
|
+ le(TJs::getcTime, date).
|
|
|
+ gt(TJs::getId, String.valueOf(flag)).
|
|
|
+ orderByAsc(TJs::getId);
|
|
|
|
|
|
Page<TJs> page = new Page<>();
|
|
|
page.setSize(MassageConstants.TWO_HUNDRED);
|
|
@@ -208,8 +208,11 @@ public class massageTask {
|
|
|
jsService.updateById(js);
|
|
|
log.info("取消新技师标识,{}", js.getcOpenId() + js.getcName());
|
|
|
});
|
|
|
+ Optional<String> maxId = page1.getRecords().stream().max(Comparator.comparing(TJs::getId)).map(TJs::getId);
|
|
|
+ flag = Long.parseLong(maxId.orElse("0"));
|
|
|
+ } else {
|
|
|
+ flag = 0L;
|
|
|
}
|
|
|
- total = page1.getTotal();
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -219,10 +222,10 @@ public class massageTask {
|
|
|
log.info("开始执行取消技师热度标识任务当前时间,{}", nowDate);
|
|
|
|
|
|
Date date = DateTimeUtils.addDays(nowDate, -3);
|
|
|
- long total = 1L;
|
|
|
- while (total > 0L) {
|
|
|
+ long flag = 1L;
|
|
|
+ while (flag > 0L) {
|
|
|
LambdaQueryWrapper<TJs> objectLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
- objectLambdaQueryWrapper.eq(TJs::getnB3, MassageConstants.INTEGER_ONE);
|
|
|
+ objectLambdaQueryWrapper.eq(TJs::getnB3, MassageConstants.INTEGER_ONE).gt(TJs::getId, String.valueOf(flag)).orderByAsc(TJs::getId);
|
|
|
|
|
|
Page<TJs> page = new Page<>();
|
|
|
page.setSize(MassageConstants.TWO_HUNDRED);
|
|
@@ -239,8 +242,11 @@ public class massageTask {
|
|
|
log.info("取消热度技师标识,{}", js.getcOpenId() + js.getcName());
|
|
|
}
|
|
|
});
|
|
|
+ Optional<String> maxId = page1.getRecords().stream().max(Comparator.comparing(TJs::getId)).map(TJs::getId);
|
|
|
+ flag = Long.parseLong(maxId.orElse("0"));
|
|
|
+ } else {
|
|
|
+ flag = 0L;
|
|
|
}
|
|
|
- total = page1.getTotal();
|
|
|
}
|
|
|
}
|
|
|
|