修复
This commit is contained in:
@@ -226,10 +226,17 @@ public class LeaseBillUtil {
|
||||
Map<String, String> bill = new HashMap<>();
|
||||
bill.put(fieldDisplayNameService.getDisplayName("开始日期"), getSdf().format(tempStart.getTime()));
|
||||
|
||||
// 计算本期结束日 = 开始时间 + 周期月数 - 1天
|
||||
// 计算本期结束日
|
||||
Calendar periodEnd = (Calendar) tempStart.clone();
|
||||
periodEnd.add(Calendar.MONTH, payCycleMonths);
|
||||
// 月末日期特殊处理:起始日为月末时,周期结束日也保持为目标月月末
|
||||
int startDay = tempStart.get(Calendar.DAY_OF_MONTH);
|
||||
int startMaxDay = tempStart.getActualMaximum(Calendar.DAY_OF_MONTH);
|
||||
if (startDay == startMaxDay) {
|
||||
periodEnd.set(Calendar.DATE, periodEnd.getActualMaximum(Calendar.DATE));
|
||||
} else {
|
||||
periodEnd.add(Calendar.DATE, -1);
|
||||
}
|
||||
|
||||
if (periodEnd.before(endTime)) {
|
||||
// 正常完整周期
|
||||
|
||||
Reference in New Issue
Block a user