java110 лет назад: 2
Родитель
Сommit
c772ff1e9e

+ 4 - 2
java110-db/src/main/resources/mapper/fee/PayFeeDetailMonthServiceDaoImplMapper.xml

@@ -39,7 +39,8 @@
         detailId,t.receivable_amount,t.receivable_amount receivableAmount,t.discount_amount,t.discount_amount
         discountAmount,t.remark,t.status_cd,t.status_cd statusCd,t.received_amount,t.received_amount
         receivedAmount,t.community_id,t.community_id communityId,t.fee_id,t.fee_id feeId,t.month_id,t.month_id monthId,
-        t.obj_name objName,t.obj_id objId,t.owner_name ownerName,t.owner_id ownerId,t.link,t.state,t.pay_fee_time payFeeTime
+        t.obj_name objName,t.obj_id objId,t.owner_name ownerName,t.owner_id ownerId,t.link,t.state,t.pay_fee_time payFeeTime,
+        t.cur_month_time curMonthTime
         from pay_fee_detail_month t
         where 1 =1
         <if test="detailMonth !=null and detailMonth != ''">
@@ -225,7 +226,8 @@
         detailId,t.receivable_amount,t.receivable_amount receivableAmount,t.discount_amount,t.discount_amount
         discountAmount,t.remark,t.status_cd,t.status_cd statusCd,t.received_amount,t.received_amount
         receivedAmount,t.community_id,t.community_id communityId,t.fee_id,t.fee_id feeId,t.month_id,t.month_id monthId,
-        t.obj_name objName,t.obj_id objId,t.owner_name ownerName,t.owner_id ownerId,t.link,t.state,t.pay_fee_time payFeeTime
+        t.obj_name objName,t.obj_id objId,t.owner_name ownerName,t.owner_id ownerId,t.link,t.state,t.pay_fee_time payFeeTime,
+        t.cur_month_time curMonthTime
         from pay_fee_detail_month t
         where 1 =1
         <if test="detailMonth !=null and detailMonth != ''">

+ 1 - 1
service-fee/src/main/java/com/java110/fee/feeMonth/IPayFeeMonthHelp.java

@@ -24,7 +24,7 @@ public interface IPayFeeMonthHelp {
      */
     Double getReceivedAmount(List<FeeDetailDto> feeDetailDtos, Double feePrice, Date curDate, FeeDto feeDto);
 
-    Double getDiscountAmount(Double feePrice, double parseDouble, Date curDate, FeeDto feeDto);
+    Double getDiscountAmount(Double feePrice, double receivedAmount, Date curDate, FeeDto feeDto);
 
     /**
      * 计算缴费DetailId

+ 2 - 2
service-fee/src/main/java/com/java110/fee/feeMonth/PayFeeMonthHelp.java

@@ -105,14 +105,14 @@ public class PayFeeMonthHelp implements IPayFeeMonthHelp {
     }
 
     @Override
-    public Double getDiscountAmount(Double feePrice, double parseDouble, Date curDate, FeeDto feeDto) {
+    public Double getDiscountAmount(Double feePrice, double receivedAmount, Date curDate, FeeDto feeDto) {
 
         //todo 这种情况下应该 优惠为0
         if (curDate.getTime() >= feeDto.getEndTime().getTime()) {
             return 0.00;
         }
 
-        BigDecimal discountAmountDec = new BigDecimal(feePrice).subtract(new BigDecimal(parseDouble)).setScale(2, BigDecimal.ROUND_HALF_UP);
+        BigDecimal discountAmountDec = new BigDecimal(feePrice).subtract(new BigDecimal(receivedAmount)).setScale(2, BigDecimal.ROUND_HALF_UP);
         return discountAmountDec.doubleValue();
     }
 

+ 6 - 1
service-fee/src/main/java/com/java110/fee/feeMonth/PayFeeMonthImpl.java

@@ -69,6 +69,7 @@ public class PayFeeMonthImpl implements IPayFeeMonth {
 
     public void doGeneratorOrRefreshFeeMonth(FeeDto feeDto, String communityId) {
 
+
         //todo 计算每月单价
         Double feePrice = payFeeMonthHelp.getMonthFeePrice(feeDto);
 
@@ -78,6 +79,7 @@ public class PayFeeMonthImpl implements IPayFeeMonth {
         //todo 离散start_time 或者 pay_fee_detail_month 最大月份 到  deadlineTime 的数据
         maxMonthDateToDeadlineTimeData(feeDto, payFeeMonthOwnerDto, feePrice);
 
+
     }
 
     /**
@@ -136,7 +138,10 @@ public class PayFeeMonthImpl implements IPayFeeMonth {
             tmpPayFeeDetailMonthPo.setDetailMonth((calendar.get(Calendar.MONTH) + 1) + "");
             tmpPayFeeDetailMonthPo.setReceivableAmount(payFeeMonthHelp.getReceivableAmount(feeDetailDtos, feePrice, calendar.getTime(), feeDto) + "");
             tmpPayFeeDetailMonthPo.setReceivedAmount(payFeeMonthHelp.getReceivedAmount(feeDetailDtos, feePrice, calendar.getTime(), feeDto) + "");
-            tmpPayFeeDetailMonthPo.setDiscountAmount(payFeeMonthHelp.getDiscountAmount(feePrice, Double.parseDouble(tmpPayFeeDetailMonthPo.getReceivedAmount()), calendar.getTime(), feeDto) + "");
+            tmpPayFeeDetailMonthPo.setDiscountAmount(
+                    payFeeMonthHelp.getDiscountAmount(Double.parseDouble(tmpPayFeeDetailMonthPo.getReceivableAmount()),
+                            Double.parseDouble(tmpPayFeeDetailMonthPo.getReceivedAmount()),
+                            calendar.getTime(), feeDto) + "");
             tmpPayFeeDetailMonthPo.setMonthId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_monthId));
             tmpPayFeeDetailMonthPo.setRemark("程序计算生成");
             tmpPayFeeDetailMonthPo.setObjName(payFeeMonthOwnerDto.getObjName());