Commit 0f48ab7d by 杨林龙

有效报表默认展示为当月~~~

1 parent 521b977a
...@@ -38,6 +38,12 @@ public class TrialDriveReportService { ...@@ -38,6 +38,12 @@ public class TrialDriveReportService {
} }
public List<TrialDriveReportExport> listEffectiveTestDriveReportPage(TrialDriveReportSearch search, List<TrialDriveReportExport> testDrivePageList) { public List<TrialDriveReportExport> listEffectiveTestDriveReportPage(TrialDriveReportSearch search, List<TrialDriveReportExport> testDrivePageList) {
// 没有年月查询消息时 默认显示当前年月
if (StringUtils.isNullOrEmpty(search.getMonth()) && StringUtils.isNullOrEmpty(search.getYear())) {
search.setYear(DateUtil.getYearOfNow());
search.setMonth(DateUtil.getMonthOfNow());
}
HashMap<String, TrialDriveReportExport> excelHashMap = new HashMap<>(); HashMap<String, TrialDriveReportExport> excelHashMap = new HashMap<>();
// 初始化map中的每个对象 // 初始化map中的每个对象
...@@ -188,6 +194,12 @@ public class TrialDriveReportService { ...@@ -188,6 +194,12 @@ public class TrialDriveReportService {
} }
public List<TrialDriveReportExport> exportEffectiveTestDriveReport(TrialDriveReportSearch search, List<TrialDriveReportExport> testDrivePageList) { public List<TrialDriveReportExport> exportEffectiveTestDriveReport(TrialDriveReportSearch search, List<TrialDriveReportExport> testDrivePageList) {
// 没有年月查询消息时 默认显示当前年月
if (StringUtils.isNullOrEmpty(search.getMonth()) && StringUtils.isNullOrEmpty(search.getYear())) {
search.setYear(DateUtil.getYearOfNow());
search.setMonth(DateUtil.getMonthOfNow());
}
HashMap<String, TrialDriveReportExport> excelHashMap = new HashMap<>(); HashMap<String, TrialDriveReportExport> excelHashMap = new HashMap<>();
// 初始化map中的每个对象 // 初始化map中的每个对象
for (TrialDriveReportExport drivePageExcel : testDrivePageList) { for (TrialDriveReportExport drivePageExcel : testDrivePageList) {
......
...@@ -1450,6 +1450,11 @@ public class DateUtil extends org.apache.commons.lang.time.DateUtils { ...@@ -1450,6 +1450,11 @@ public class DateUtil extends org.apache.commons.lang.time.DateUtils {
return maxDate; return maxDate;
} }
public static String getMonthOfNow() {
Calendar cal = Calendar.getInstance();
return String.valueOf(cal.get(Calendar.MONTH) + 1);
}
public static void main(String[] args) { public static void main(String[] args) {
// System.out.println(formatDate(getStartDateOfCurrentDay(new Date()))); // System.out.println(formatDate(getStartDateOfCurrentDay(new Date())));
System.out.println(getMaxDayOfCurrentMonth()); System.out.println(getMaxDayOfCurrentMonth());
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!