|
|
@@ -1675,21 +1675,22 @@ public class RefundSettlementOrderServiceImpl implements RefundSettlementOrderSe
|
|
|
itemVO.setIsMonthlyExpense(BooleanEnum.FALSE.getValue());
|
|
|
itemVO.setDailyExpenseType(4);
|
|
|
itemVO.setCount(1);
|
|
|
- LocalDate endDate = bizUtil.getEndDateWithExpireDate(elderId,item.getContractId(),costDeadlineDate.with(TemporalAdjusters.lastDayOfMonth()));
|
|
|
- // 根据是否缴费来确定正负,若未缴费,那么需要抵扣长护险就是负,天数为月初到截止日期,如果已缴费那么就是收回长护险是正,天数为费用截止日期到月末
|
|
|
- long calDay = item.getPayStatus().equals(BooleanEnum.FALSE.getValue()) ?
|
|
|
- -(ChronoUnit.DAYS.between(costDeadlineDate.withDayOfMonth(1),costDeadlineDate)) :
|
|
|
- ChronoUnit.DAYS.between(costDeadlineDate,endDate);
|
|
|
- BigDecimal daysOfMonth = new BigDecimal(Math.abs(ChronoUnit.DAYS.between(costDeadlineDate.withDayOfMonth(1),endDate))).add(BigDecimal.ONE);
|
|
|
+// LocalDate endDate = bizUtil.getEndDateWithExpireDate(elderId,item.getContractId(),costDeadlineDate.with(TemporalAdjusters.lastDayOfMonth()));
|
|
|
+// // 根据是否缴费来确定正负,若未缴费,那么需要抵扣长护险就是负,天数为月初到截止日期,如果已缴费那么就是收回长护险是正,天数为费用截止日期到月末
|
|
|
+// long calDay = item.getPayStatus().equals(BooleanEnum.FALSE.getValue()) ?
|
|
|
+// -(ChronoUnit.DAYS.between(costDeadlineDate.withDayOfMonth(1),costDeadlineDate)) :
|
|
|
+// ChronoUnit.DAYS.between(costDeadlineDate,endDate);
|
|
|
+// BigDecimal daysOfMonth = new BigDecimal(Math.abs(ChronoUnit.DAYS.between(costDeadlineDate.withDayOfMonth(1),endDate))).add(BigDecimal.ONE);
|
|
|
ExpenseSubsidyDO expenseSubsidyDO = expenseSubsidyMapper.selectById(item.getSourceExpenseItemId());
|
|
|
// 长护险补充备注
|
|
|
- String subsidyRemarks = calDay > 0 ? ";收回" + calDay + "天的长护险" : ";抵扣" + (-calDay) + "天的长护险";
|
|
|
+// String subsidyRemarks = calDay > 0 ? ";收回" + calDay + "天的长护险" : ";抵扣" + (-calDay) + "天的长护险";
|
|
|
if (expenseSubsidyDO != null) {
|
|
|
YearMonth yearMonth = YearMonth.parse(expenseSubsidyDO.getMonth());
|
|
|
if(yearMonth.isAfter(costDeadlineYearMonth)){
|
|
|
itemVO.setSkip(true);
|
|
|
}
|
|
|
YearMonth decutionBillYearMonth = YearMonth.parse(expenseSubsidyDO.getDeductionBillMonth());
|
|
|
+ // 长户险抵扣账单月在费用截止日期后
|
|
|
if(decutionBillYearMonth.isAfter(costDeadlineYearMonth)){
|
|
|
if(item.getPayStatus().equals(BooleanEnum.TRUE.getValue())){
|
|
|
BigDecimal subsidyAmount = expenseSubsidyDO.getAmount() == null ? BigDecimal.ZERO : expenseSubsidyDO.getAmount();
|
|
|
@@ -1701,10 +1702,12 @@ public class RefundSettlementOrderServiceImpl implements RefundSettlementOrderSe
|
|
|
}else {
|
|
|
BigDecimal subsidyAmount = expenseSubsidyDO.getAmount() == null ? BigDecimal.ZERO : expenseSubsidyDO.getAmount();
|
|
|
// 计算长护险单日费用
|
|
|
- BigDecimal dayPrice = subsidyAmount.divide(daysOfMonth, RoundingMode.HALF_UP);
|
|
|
- itemVO.setAmount(dayPrice.multiply(new BigDecimal(calDay)));
|
|
|
- itemVO.setPrice(expenseSubsidyDO.getAmount().negate());
|
|
|
- itemVO.setRemarks(expenseSubsidyDO.getRemarks() + subsidyRemarks);
|
|
|
+// BigDecimal dayPrice = subsidyAmount.divide(daysOfMonth, RoundingMode.HALF_UP);
|
|
|
+// itemVO.setAmount(dayPrice.multiply(new BigDecimal(calDay)));
|
|
|
+ itemVO.setAmount(subsidyAmount);
|
|
|
+ itemVO.setPrice(subsidyAmount);
|
|
|
+// itemVO.setRemarks(expenseSubsidyDO.getRemarks() + subsidyRemarks);
|
|
|
+ itemVO.setRemarks(expenseSubsidyDO.getRemarks());
|
|
|
itemVO.setItemId(expenseSubsidyDO.getId());
|
|
|
}
|
|
|
} else { // 长护险录入成了日常费用
|
|
|
@@ -1723,10 +1726,12 @@ public class RefundSettlementOrderServiceImpl implements RefundSettlementOrderSe
|
|
|
}
|
|
|
}else {
|
|
|
// 计算长护险单日费用
|
|
|
- BigDecimal dayPrice = subsidyAmount.divide(daysOfMonth, RoundingMode.HALF_UP);
|
|
|
- itemVO.setAmount(dayPrice.multiply(new BigDecimal(calDay)));
|
|
|
+// BigDecimal dayPrice = subsidyAmount.divide(daysOfMonth, RoundingMode.HALF_UP);
|
|
|
+// itemVO.setAmount(dayPrice.multiply(new BigDecimal(calDay)));
|
|
|
+ itemVO.setAmount(subsidyAmount);
|
|
|
itemVO.setPrice(subsidyAmount);
|
|
|
- itemVO.setRemarks(dailyExpenses.getRemarks() + subsidyRemarks);
|
|
|
+// itemVO.setRemarks(dailyExpenses.getRemarks() + subsidyRemarks);
|
|
|
+ itemVO.setRemarks(dailyExpenses.getRemarks());
|
|
|
itemVO.setItemId(dailyExpenses.getId());
|
|
|
}
|
|
|
}
|