修改日期查询问题

This commit is contained in:
zkzh_admin committed 2026-09-26 16:38:52 +08:00
1 parent 8cd210fd20
commit 89bb6d9e83
1 file changed
+7
@@ -2063,10 +2063,17 @@ public class EsRecordReportServiceImpl implements EsRecordReportService {
} }
} }
if (!flag) { if (!flag) {
String strFrom = param.getString("dateFrom");
String strTo = param.getString("dateTo");
if (strFrom != null && !strFrom.isEmpty() && strTo != null && !strTo.isEmpty()) {
dateFrom = strFrom;
dateTo = strTo;
} else {
LocalDate localDate = LocalDate.now(); LocalDate localDate = LocalDate.now();
dateFrom = localDate.with(TemporalAdjusters.firstDayOfMonth()).toString(); dateFrom = localDate.with(TemporalAdjusters.firstDayOfMonth()).toString();
dateTo = localDate.with(TemporalAdjusters.lastDayOfMonth()).toString(); dateTo = localDate.with(TemporalAdjusters.lastDayOfMonth()).toString();
} }
}
queryParam.put("dateFrom", dateFrom); queryParam.put("dateFrom", dateFrom);
queryParam.put("dateTo", dateTo); queryParam.put("dateTo", dateTo);
queryParam.put("speciesId", param.getLong("speciesId")); queryParam.put("speciesId", param.getLong("speciesId"));