feat: 新车型预警在产车预警改为提前一个月
This commit is contained in:
@@ -134,6 +134,27 @@ public class DateUtil {
|
||||
return dayStrings;
|
||||
}
|
||||
|
||||
/**
|
||||
* @Author: caihaohan
|
||||
* @Date: 2024/2/28
|
||||
* @Description: 获取当前天后一月的时间集合(字符串)
|
||||
**/
|
||||
public static List<String> getNextMonthDateAsString() {
|
||||
LocalDate today = LocalDate.now();
|
||||
LocalDate nextMonth = today.plusMonths(1);
|
||||
|
||||
List<String> dayStrings = new ArrayList<>();
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||
|
||||
nextMonth = nextMonth.minusDays(1);
|
||||
while (!today.isAfter(nextMonth)) {
|
||||
dayStrings.add(today.format(formatter));
|
||||
today = today.plusDays(1);
|
||||
}
|
||||
|
||||
return dayStrings;
|
||||
}
|
||||
|
||||
/**
|
||||
* 加减 月份
|
||||
* @author LQT
|
||||
|
||||
+3
-3
@@ -75,9 +75,9 @@ public class LawsStandardEarlyWarningServiceImpl implements ILawsStandardEarlyWa
|
||||
* @Description: 标准预警通用分页查询
|
||||
**/
|
||||
private IPage<StandardEarlyWarning> pageList(StandardEarlyWarning standardEarlyWarning, Integer pageNo, Integer pageSize) {
|
||||
// 获取当前日前一周的日期字符串集合
|
||||
List<String> dayStrings = DateUtil.getNextWeekDateAsString();
|
||||
log.info("标准预警:当前一周的日期为{}", StringUtils.join(dayStrings, ","));
|
||||
// 获取当前日前一月的日期字符串集合
|
||||
List<String> dayStrings = DateUtil.getNextMonthDateAsString();
|
||||
log.info("标准预警:当前一月的日期为{}", StringUtils.join(dayStrings, ","));
|
||||
standardEarlyWarning.setDayStrings(dayStrings);
|
||||
Page<StandardEarlyWarning> page = new Page<>(pageNo, pageSize);
|
||||
IPage<StandardEarlyWarning> pageList = lawsStandardEarlyWarningMapper.pageList(page, standardEarlyWarning);
|
||||
|
||||
Reference in New Issue
Block a user