|
@@ -17,12 +17,15 @@
|
|
|
|
|
|
package com.qunzhixinxi.hnqz.daemon.quartz.task;
|
|
|
|
|
|
+import cn.hutool.core.bean.BeanUtil;
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.qunzhixinxi.hnqz.daemon.quartz.constants.HnqzQuartzEnum;
|
|
|
+import com.qunzhixinxi.hnqz.daemon.quartz.entity.SingleMemberSettleAmountOverrunInSeveralMonths;
|
|
|
import com.qunzhixinxi.hnqz.daemon.quartz.entity.SingleMemberSettleSameAmountInSeveralMonths;
|
|
|
import com.qunzhixinxi.hnqz.daemon.quartz.entity.WmTaskType;
|
|
|
+import com.qunzhixinxi.hnqz.daemon.quartz.mapper.SingleMemberSettleAmountOverrunInSeveralMonthsMapper;
|
|
|
import com.qunzhixinxi.hnqz.daemon.quartz.mapper.SingleMemberSettleSameAmountInSeveralMonthsMapper;
|
|
|
import com.qunzhixinxi.hnqz.daemon.quartz.service.*;
|
|
|
import com.qunzhixinxi.hnqz.daemon.quartz.zhuqu.ZhuaquTest;
|
|
@@ -57,6 +60,7 @@ public class SpringBeanTaskDemo {
|
|
|
private final WmWkArticleService wmWkArticleService;
|
|
|
private final WmStatisticsService wmStatisticsService;
|
|
|
private final SingleMemberSettleSameAmountInSeveralMonthsMapper singleMemberSettleSameAmountInSeveralMonthsMapper;
|
|
|
+ private final SingleMemberSettleAmountOverrunInSeveralMonthsMapper singleMemberSettleAmountOverrunInSeveralMonthsMapper;
|
|
|
|
|
|
// /**
|
|
|
// * 测试Spring Bean的演示方法
|
|
@@ -143,9 +147,6 @@ public class SpringBeanTaskDemo {
|
|
|
LocalDateTime startTime = LocalDateTime.of(now.minusMonths(period), LocalTime.MIN);
|
|
|
LocalDateTime endTime = LocalDateTime.of(now, LocalTime.MIN).minusSeconds(1);
|
|
|
|
|
|
- System.out.println(startTime);
|
|
|
- System.out.println(endTime);
|
|
|
-
|
|
|
log.info("singleMemberSettleSameAmountInSeveralMonths开始于:{},输入参数{}", LocalDateTime.now(), para);
|
|
|
|
|
|
List<SingleMemberSettleSameAmountInSeveralMonths> result = scorePackageSettleNoteService.singleMemberSettleSameAmountInSeveralMonths(startTime, endTime);
|
|
@@ -182,14 +183,14 @@ public class SpringBeanTaskDemo {
|
|
|
return HnqzQuartzEnum.JOB_LOG_STATUS_FAIL.getType();
|
|
|
}
|
|
|
|
|
|
- if (!para.contains(StrUtil.COMMA)){
|
|
|
+ if (!para.contains(StrUtil.COMMA)) {
|
|
|
log.error("参数错误");
|
|
|
return HnqzQuartzEnum.JOB_LOG_STATUS_FAIL.getType();
|
|
|
}
|
|
|
|
|
|
List<String> params = StrUtil.split(para.trim(), StrUtil.COMMA);
|
|
|
|
|
|
- if (params.size() != 2){
|
|
|
+ if (params.size() != 2) {
|
|
|
log.error("参数错误");
|
|
|
return HnqzQuartzEnum.JOB_LOG_STATUS_FAIL.getType();
|
|
|
}
|
|
@@ -208,24 +209,28 @@ public class SpringBeanTaskDemo {
|
|
|
LocalDateTime endTime = LocalDateTime.of(now, LocalTime.MIN).minusSeconds(1);
|
|
|
|
|
|
log.info("singleMemberSettleAmountOverrunInSeveralMonths开始于:{},输入参数{}", LocalDateTime.now(), para);
|
|
|
- //
|
|
|
- // List<SingleMemberSettleSameAmountInSeveralMonths> result = scorePackageSettleNoteService.singleMemberSettleAmountOverrunInSeveralMonths(startTime, endTime, limit);
|
|
|
- //
|
|
|
- // if (CollUtil.isNotEmpty(result)) {
|
|
|
- // List<SingleMemberSettleSameAmountInSeveralMonths> history = singleMemberSettleSameAmountInSeveralMonthsMapper.selectList(Wrappers.<SingleMemberSettleSameAmountInSeveralMonths>lambdaQuery().between(SingleMemberSettleSameAmountInSeveralMonths::getCreateTime, LocalDateTime.of(LocalDate.now(), LocalTime.MIN), LocalDateTime.of(LocalDate.now(), LocalTime.MAX)));
|
|
|
- // // 删除历史记录
|
|
|
- // log.warn("删除当期的历史记录:{}", history);
|
|
|
- // if (CollUtil.isNotEmpty(history)) {
|
|
|
- // List<Integer> ids = history.stream().mapToInt(SingleMemberSettleSameAmountInSeveralMonths::getRecordId).boxed().collect(Collectors.toList());
|
|
|
- // singleMemberSettleSameAmountInSeveralMonthsMapper.deleteBatchIds(ids);
|
|
|
- // }
|
|
|
- //
|
|
|
- // result.forEach(e -> {
|
|
|
- // e.setPeriod(period);
|
|
|
- // singleMemberSettleSameAmountInSeveralMonthsMapper.insert(e);
|
|
|
- // });
|
|
|
- // }
|
|
|
- //
|
|
|
+
|
|
|
+ List<SingleMemberSettleSameAmountInSeveralMonths> result = scorePackageSettleNoteService.singleMemberSettleAmountOverrunInSeveralMonths(startTime, endTime, limit);
|
|
|
+
|
|
|
+ if (CollUtil.isNotEmpty(result)) {
|
|
|
+ List<SingleMemberSettleAmountOverrunInSeveralMonths> history = singleMemberSettleAmountOverrunInSeveralMonthsMapper.selectList(Wrappers.<SingleMemberSettleAmountOverrunInSeveralMonths>lambdaQuery().between(SingleMemberSettleAmountOverrunInSeveralMonths::getCreateTime, LocalDateTime.of(LocalDate.now(), LocalTime.MIN), LocalDateTime.of(LocalDate.now(), LocalTime.MAX)));
|
|
|
+ // 删除历史记录
|
|
|
+ log.warn("删除当期的历史记录:{}", history);
|
|
|
+ if (CollUtil.isNotEmpty(history)) {
|
|
|
+ List<Integer> ids = history.stream().mapToInt(SingleMemberSettleAmountOverrunInSeveralMonths::getRecordId).boxed().collect(Collectors.toList());
|
|
|
+ singleMemberSettleAmountOverrunInSeveralMonthsMapper.deleteBatchIds(ids);
|
|
|
+ }
|
|
|
+
|
|
|
+ result.forEach(e -> {
|
|
|
+ SingleMemberSettleAmountOverrunInSeveralMonths singleMemberSettleAmountOverrunInSeveralMonths
|
|
|
+ = BeanUtil.copyProperties(e, SingleMemberSettleAmountOverrunInSeveralMonths.class);
|
|
|
+ singleMemberSettleAmountOverrunInSeveralMonths.setPeriod(period);
|
|
|
+ singleMemberSettleAmountOverrunInSeveralMonths.setPlatformLimit(limit);
|
|
|
+ singleMemberSettleAmountOverrunInSeveralMonths.setCreateTime(LocalDateTime.now());
|
|
|
+ singleMemberSettleAmountOverrunInSeveralMonthsMapper.insert(singleMemberSettleAmountOverrunInSeveralMonths);
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
return HnqzQuartzEnum.JOB_LOG_STATUS_SUCCESS.getType();
|
|
|
|
|
|
}
|