|
|
@@ -45,8 +45,8 @@ public class PbCseFeeobjupdateServiceImpl extends MPJBaseServiceImpl<PbCseFeeobj
|
|
|
if(dto.getYearMonth() != null && !dto.getYearMonth().equals("")){
|
|
|
LocalDate date = LocalDate.parse(dto.getYearMonth() + "-01"); // 假设给定日期为2022年9月15日
|
|
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
|
- // 获取上月的最后一天
|
|
|
- LocalDate firstDayOfMonth = date.minusMonths(1).withDayOfMonth(date.minusMonths(1).lengthOfMonth());
|
|
|
+ // 获取本月的第一天
|
|
|
+ LocalDate firstDayOfMonth = date.withDayOfMonth(1);
|
|
|
firstDayOfMonthStr = firstDayOfMonth.format(formatter);
|
|
|
// 获取下月的第一天
|
|
|
LocalDate lastDayOfMonth = date.plusMonths(1).withDayOfMonth(1);
|
|
|
@@ -55,9 +55,9 @@ public class PbCseFeeobjupdateServiceImpl extends MPJBaseServiceImpl<PbCseFeeobj
|
|
|
LocalDate today = LocalDate.now();
|
|
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
|
// 获取月份的第一天
|
|
|
- LocalDate firstDayOfMonth = today.minusMonths(1).withDayOfMonth(today.minusMonths(1).lengthOfMonth());
|
|
|
+ LocalDate firstDayOfMonth = today.withDayOfMonth(1);
|
|
|
firstDayOfMonthStr = firstDayOfMonth.format(formatter);
|
|
|
- // 获取月份的最后一天
|
|
|
+ // 获取下月的第一天
|
|
|
LocalDate lastDayOfMonth = today.plusMonths(1).withDayOfMonth(1);
|
|
|
lastDayOfMonthStr = lastDayOfMonth.format(formatter);
|
|
|
}
|