feat: 新车型预警在产车预警改为提前六个月
This commit is contained in:
@@ -200,4 +200,20 @@ public class DateUtil {
|
||||
//格式化前3月的时间
|
||||
return sdf.format(dBefore);
|
||||
}
|
||||
|
||||
public static List<String> getHalfYearAsString() {
|
||||
LocalDate today = LocalDate.now();
|
||||
LocalDate nextMonth = today.plusMonths(6);
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -76,8 +76,8 @@ public class LawsStandardEarlyWarningServiceImpl implements ILawsStandardEarlyWa
|
||||
**/
|
||||
private IPage<StandardEarlyWarning> pageList(StandardEarlyWarning standardEarlyWarning, Integer pageNo, Integer pageSize) {
|
||||
// 获取当前日前一月的日期字符串集合
|
||||
List<String> dayStrings = DateUtil.getNextMonthDateAsString();
|
||||
log.info("标准预警:当前一月的日期为{}", StringUtils.join(dayStrings, ","));
|
||||
List<String> dayStrings = DateUtil.getHalfYearAsString();
|
||||
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