Merge pull request '抽数删除任务修改' (#61) from xinwei into master
All checks were successful
continuous-integration/drone Build is passing

Reviewed-on: #61
This commit is contained in:
root 2024-08-29 17:53:04 +08:00
commit cd4e883093
3 changed files with 9 additions and 2 deletions

View File

@ -47,4 +47,8 @@ public class TicketingController {
public CommonResult<List<String>> testAlla(){ public CommonResult<List<String>> testAlla(){
return CommonResult.success(saleDataService.deleteTwoYearLastMonthAgo()); return CommonResult.success(saleDataService.deleteTwoYearLastMonthAgo());
} }
@GetMapping("/testSample")
public void testSample(){
ticketDataMigration.deleteTwoYearOneMonthAgoAndUpdateLastYearTomorrow();
}
} }

View File

@ -401,6 +401,9 @@ public class TicketDataMigration {
int currentDay = startDate.get(Calendar.DAY_OF_MONTH); int currentDay = startDate.get(Calendar.DAY_OF_MONTH);
result.add(String.format("抽数服务:%d年%d月%d日" + methodName + "数据抽数正常结束!总共:%d条数据%d条数据重复%d条数据插入成功", currentYear, currentMonth, currentDay, totalRows, duplicatesCount, successCount)); result.add(String.format("抽数服务:%d年%d月%d日" + methodName + "数据抽数正常结束!总共:%d条数据%d条数据重复%d条数据插入成功", currentYear, currentMonth, currentDay, totalRows, duplicatesCount, successCount));
XxlJobHelper.log("抽数服务:{}年{}月{}日:{}数据抽数正常结束!总共:{}条数据,{}条数据重复,{}条数据插入成功!", currentYear, currentMonth, currentDay, methodName, totalRows, duplicatesCount, successCount); XxlJobHelper.log("抽数服务:{}年{}月{}日:{}数据抽数正常结束!总共:{}条数据,{}条数据重复,{}条数据插入成功!", currentYear, currentMonth, currentDay, methodName, totalRows, duplicatesCount, successCount);
if (startDate.equals(endDate)){ // 如果日期相等退出循环
break;
}
// 日期递增一天 // 日期递增一天
startDate.add(Calendar.DAY_OF_MONTH, 1); startDate.add(Calendar.DAY_OF_MONTH, 1);
} }

View File

@ -139,8 +139,8 @@ public class CheckTicketServiceImpl implements CheckTicketService {
// TODO 使用这种方法删除会报错暂时使用mongoTemplate进行删除 // TODO 使用这种方法删除会报错暂时使用mongoTemplate进行删除
// checkTicketTodayRepository.deleteByCheckticketdateIn(filteredDate); // checkTicketTodayRepository.deleteByCheckticketdateIn(filteredDate);
Query query = new Query(); Query query = new Query();
query.addCriteria(Criteria.where("sddate").in(filteredDate)); query.addCriteria(Criteria.where("checkticketdate").in(filteredDate));
mongoTemplate.remove(query, "sale_data_today"); mongoTemplate.remove(query, "check_ticket_today");
return filteredDate; return filteredDate;
} }