From 22d7512ecb341426ecaa5ac8d48d7aa2b37c1059 Mon Sep 17 00:00:00 2001
From: java110 <928255095@qq.com>
Date: 星期四, 09 六月 2022 16:27:41 +0800
Subject: [PATCH] 优化代码

---
 java110-core/src/main/java/com/java110/core/smo/impl/ComputeFeeSMOImpl.java |  354 ++++++++++++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 276 insertions(+), 78 deletions(-)

diff --git a/java110-core/src/main/java/com/java110/core/smo/impl/ComputeFeeSMOImpl.java b/java110-core/src/main/java/com/java110/core/smo/impl/ComputeFeeSMOImpl.java
index 6c99036..f24565d 100755
--- a/java110-core/src/main/java/com/java110/core/smo/impl/ComputeFeeSMOImpl.java
+++ b/java110-core/src/main/java/com/java110/core/smo/impl/ComputeFeeSMOImpl.java
@@ -1,11 +1,16 @@
 package com.java110.core.smo.impl;
 
+import com.java110.config.properties.code.Java110Properties;
+import com.java110.core.context.Environment;
+import com.java110.core.log.LoggerFactory;
 import com.java110.core.smo.IComputeFeeSMO;
 import com.java110.dto.RoomDto;
 import com.java110.dto.community.CommunityDto;
 import com.java110.dto.contract.ContractDto;
 import com.java110.dto.contractRoom.ContractRoomDto;
 import com.java110.dto.fee.*;
+import com.java110.dto.machine.CarInoutDetailDto;
+import com.java110.dto.machine.CarInoutDto;
 import com.java110.dto.owner.OwnerCarDto;
 import com.java110.dto.owner.OwnerDto;
 import com.java110.dto.parking.ParkingSpaceDto;
@@ -16,6 +21,8 @@
 import com.java110.intf.community.IParkingSpaceInnerServiceSMO;
 import com.java110.intf.community.IRoomInnerServiceSMO;
 import com.java110.intf.fee.IFeeInnerServiceSMO;
+import com.java110.intf.fee.ITempCarFeeConfigAttrInnerServiceSMO;
+import com.java110.intf.fee.ITempCarFeeConfigInnerServiceSMO;
 import com.java110.intf.store.IContractInnerServiceSMO;
 import com.java110.intf.store.IContractRoomInnerServiceSMO;
 import com.java110.intf.user.IOwnerCarInnerServiceSMO;
@@ -28,7 +35,6 @@
 import com.java110.utils.util.DateUtil;
 import com.java110.utils.util.StringUtil;
 import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -75,6 +81,15 @@
     @Autowired(required = false)
     private IContractInnerServiceSMO contractInnerServiceSMOImpl;
 
+    @Autowired(required = false)
+    private ITempCarFeeConfigInnerServiceSMO tempCarFeeConfigInnerServiceSMOImpl;
+
+    @Autowired(required = false)
+    private ITempCarFeeConfigAttrInnerServiceSMO tempCarFeeConfigAttrInnerServiceSMOImpl;
+
+    @Autowired
+    private Java110Properties java110Properties;
+
     @Override
     public Date getFeeEndTime() {
         return null;
@@ -93,6 +108,7 @@
     public void computeEveryOweFee(FeeDto tmpFeeDto, RoomDto roomDto) {
         computeFeePrice(tmpFeeDto, roomDto);
     }
+
 
     /**
      * 璁$畻娆犺垂閲戦
@@ -158,12 +174,12 @@
         }
 
         String computingFormula = feeDto.getComputingFormula();
-        double feePrice = getFeePrice(feeDto);
+        Map feePriceAll = getFeePrice(feeDto);
 
-        feeDto.setFeePrice(feePrice);
+        feeDto.setFeePrice(Double.parseDouble(feePriceAll.get("feePrice").toString()));
         BigDecimal price = new BigDecimal(feeDto.getFeePrice());
         price = price.multiply(new BigDecimal(oweMonth));
-        feeDto.setFeePrice(price.setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
+        feeDto.setFeePrice(price.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
         feeDto.setDeadlineTime(targetEndDate);
 
         //鍔ㄦ�佽垂鐢�
@@ -187,12 +203,12 @@
         double oweMonth = (double) targetEndDateAndOweMonth.get("oweMonth");
 
         String computingFormula = feeDto.getComputingFormula();
-        double feePrice = getFeePrice(feeDto, roomDto);
-        feeDto.setFeePrice(feePrice);
+        Map feePriceAll = getFeePrice(feeDto, roomDto);
+        feeDto.setFeePrice(Double.parseDouble(feePriceAll.get("feePrice").toString()));
         //double month = dayCompare(feeDto.getEndTime(), DateUtil.getCurrentDate());
         BigDecimal price = new BigDecimal(feeDto.getFeePrice());
         price = price.multiply(new BigDecimal(oweMonth));
-        feeDto.setFeePrice(price.setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
+        feeDto.setFeePrice(price.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
         feeDto.setDeadlineTime(targetEndDate);
 
         //鍔ㄦ�佽垂鐢�
@@ -215,12 +231,12 @@
         double oweMonth = (double) targetEndDateAndOweMonth.get("oweMonth");
 
         String computingFormula = feeDto.getComputingFormula();
-        double feePrice = getFeePrice(feeDto, roomDto);
-        feeDto.setFeePrice(feePrice);
+        Map feePriceAll = getFeePrice(feeDto, roomDto);
+        feeDto.setFeePrice(Double.parseDouble(feePriceAll.get("feePrice").toString()));
         //double month = dayCompare(feeDto.getEndTime(), DateUtil.getCurrentDate());
         BigDecimal price = new BigDecimal(feeDto.getFeePrice());
         price = price.multiply(new BigDecimal(oweMonth));
-        feeDto.setFeePrice(price.setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
+        feeDto.setFeePrice(price.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
         feeDto.setDeadlineTime(targetEndDate);
 
         //鍔ㄦ�佽垂鐢�
@@ -262,13 +278,13 @@
             } else if ("1101".equals(computingFormula)) { // 绉熼噾
                 feeReceiptDetailPo.setArea("");
                 feeReceiptDetailPo.setSquarePrice(roomDto.getRoomRent());
-            }else if ("4004".equals(computingFormula)) {
+            } else if ("4004".equals(computingFormula)) {
             } else if ("5005".equals(computingFormula)) {
                 if (StringUtil.isEmpty(feeDto.getCurDegrees())) {
                 } else {
                     BigDecimal curDegree = new BigDecimal(Double.parseDouble(feeDto.getCurDegrees()));
                     BigDecimal preDegree = new BigDecimal(Double.parseDouble(feeDto.getPreDegrees()));
-                    BigDecimal sub = curDegree.subtract(preDegree).setScale(2, BigDecimal.ROUND_HALF_EVEN);
+                    BigDecimal sub = curDegree.subtract(preDegree).setScale(2, BigDecimal.ROUND_HALF_UP);
                     feeReceiptDetailPo.setArea(sub.doubleValue() + "");
                     feeReceiptDetailPo.setSquarePrice(feeDto.getSquarePrice() + "/" + feeDto.getAdditionalAmount());
                 }
@@ -290,10 +306,13 @@
                 } else {
                     BigDecimal curDegree = new BigDecimal(Double.parseDouble(feeDto.getCurDegrees()));
                     BigDecimal preDegree = new BigDecimal(Double.parseDouble(feeDto.getPreDegrees()));
-                    BigDecimal sub = curDegree.subtract(preDegree).setScale(2, BigDecimal.ROUND_HALF_EVEN);
+                    BigDecimal sub = curDegree.subtract(preDegree).setScale(2, BigDecimal.ROUND_HALF_UP);
                     feeReceiptDetailPo.setArea(sub.doubleValue() + "");
                     feeReceiptDetailPo.setSquarePrice(feeDto.getMwPrice() + "/" + feeDto.getAdditionalAmount());
                 }
+            } else if ("1101".equals(computingFormula)) { //绉熼噾
+                feeReceiptDetailPo.setArea(roomDtos.get(0).getBuiltUpArea());
+                feeReceiptDetailPo.setSquarePrice(roomDtos.get(0).getRoomRent());
             } else {
             }
         } else if (FeeDto.PAYER_OBJ_TYPE_CAR.equals(feeDto.getPayerObjType())) {//杞︿綅鐩稿叧
@@ -322,13 +341,13 @@
             } else if ("1101".equals(computingFormula)) { // 绉熼噾
                 feeReceiptDetailPo.setArea("");
                 feeReceiptDetailPo.setSquarePrice("0");
-            }else if ("4004".equals(computingFormula)) {
+            } else if ("4004".equals(computingFormula)) {
             } else if ("5005".equals(computingFormula)) {
                 if (StringUtil.isEmpty(feeDto.getCurDegrees())) {
                 } else {
                     BigDecimal curDegree = new BigDecimal(Double.parseDouble(feeDto.getCurDegrees()));
                     BigDecimal preDegree = new BigDecimal(Double.parseDouble(feeDto.getPreDegrees()));
-                    BigDecimal sub = curDegree.subtract(preDegree).setScale(2, BigDecimal.ROUND_HALF_EVEN);
+                    BigDecimal sub = curDegree.subtract(preDegree).setScale(2, BigDecimal.ROUND_HALF_UP);
                     feeReceiptDetailPo.setArea(sub.doubleValue() + "");
                     feeReceiptDetailPo.setSquarePrice(feeDto.getSquarePrice() + "/" + feeDto.getAdditionalAmount());
                 }
@@ -357,7 +376,7 @@
                 } else {
                     BigDecimal curDegree = new BigDecimal(Double.parseDouble(feeDto.getCurDegrees()));
                     BigDecimal preDegree = new BigDecimal(Double.parseDouble(feeDto.getPreDegrees()));
-                    BigDecimal sub = curDegree.subtract(preDegree).setScale(2, BigDecimal.ROUND_HALF_EVEN);
+                    BigDecimal sub = curDegree.subtract(preDegree).setScale(2, BigDecimal.ROUND_HALF_UP);
                     feeReceiptDetailPo.setArea(sub.doubleValue() + "");
                     feeReceiptDetailPo.setSquarePrice(feeDto.getMwPrice() + "/" + feeDto.getAdditionalAmount());
                 }
@@ -399,13 +418,13 @@
                 }
                 feeReceiptDetailPo.setArea(builtUpArea.doubleValue() + "");
                 feeReceiptDetailPo.setSquarePrice(feeDto.getSquarePrice() + "/" + feeDto.getAdditionalAmount());
-            }else if ("4004".equals(computingFormula)) {
+            } else if ("4004".equals(computingFormula)) {
             } else if ("5005".equals(computingFormula)) {
                 if (StringUtil.isEmpty(feeDto.getCurDegrees())) {
                 } else {
                     BigDecimal curDegree = new BigDecimal(Double.parseDouble(feeDto.getCurDegrees()));
                     BigDecimal preDegree = new BigDecimal(Double.parseDouble(feeDto.getPreDegrees()));
-                    BigDecimal sub = curDegree.subtract(preDegree).setScale(2, BigDecimal.ROUND_HALF_EVEN);
+                    BigDecimal sub = curDegree.subtract(preDegree).setScale(2, BigDecimal.ROUND_HALF_UP);
                     feeReceiptDetailPo.setArea(sub.doubleValue() + "");
                     feeReceiptDetailPo.setSquarePrice(feeDto.getSquarePrice() + "/" + feeDto.getAdditionalAmount());
                 }
@@ -431,7 +450,7 @@
                 } else {
                     BigDecimal curDegree = new BigDecimal(Double.parseDouble(feeDto.getCurDegrees()));
                     BigDecimal preDegree = new BigDecimal(Double.parseDouble(feeDto.getPreDegrees()));
-                    BigDecimal sub = curDegree.subtract(preDegree).setScale(2, BigDecimal.ROUND_HALF_EVEN);
+                    BigDecimal sub = curDegree.subtract(preDegree).setScale(2, BigDecimal.ROUND_HALF_UP);
                     feeReceiptDetailPo.setArea(sub.doubleValue() + "");
                     feeReceiptDetailPo.setSquarePrice(feeDto.getMwPrice() + "/" + feeDto.getAdditionalAmount());
                 }
@@ -776,20 +795,20 @@
                 BigDecimal squarePrice = new BigDecimal(Double.parseDouble(tmpReportFeeDto.getSquarePrice()));
                 BigDecimal builtUpArea = new BigDecimal(Double.parseDouble(reportRoomDto.getBuiltUpArea()));
                 BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(tmpReportFeeDto.getAdditionalAmount()));
-                feePrice = squarePrice.multiply(builtUpArea).add(additionalAmount).setScale(2, BigDecimal.ROUND_HALF_EVEN);
+                feePrice = squarePrice.multiply(builtUpArea).add(additionalAmount).setScale(2, BigDecimal.ROUND_HALF_UP);
             } else if ("2002".equals(computingFormula)) { // 鍥哄畾璐圭敤
                 //feePrice = Double.parseDouble(feeDto.getAdditionalAmount());
                 BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(tmpReportFeeDto.getAdditionalAmount()));
-                feePrice = additionalAmount.setScale(2, BigDecimal.ROUND_HALF_EVEN);
+                feePrice = additionalAmount.setScale(2, BigDecimal.ROUND_HALF_UP);
             } else if ("3003".equals(computingFormula)) { // 鍥哄畾璐圭敤
                 BigDecimal squarePrice = new BigDecimal(Double.parseDouble(tmpReportFeeDto.getSquarePrice()));
                 BigDecimal builtUpArea = new BigDecimal(Double.parseDouble(tmpReportFeeDto.getRoomArea()));
                 BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(tmpReportFeeDto.getAdditionalAmount()));
-                feePrice = squarePrice.multiply(builtUpArea).add(additionalAmount).setScale(3, BigDecimal.ROUND_HALF_EVEN);
+                feePrice = squarePrice.multiply(builtUpArea).add(additionalAmount).setScale(3, BigDecimal.ROUND_HALF_UP);
             } else if ("1101".equals(computingFormula)) { // 绉熼噾
                 BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(tmpReportFeeDto.getRoomRent()));
-                feePrice = additionalAmount.setScale(3, BigDecimal.ROUND_HALF_EVEN);
-            }else if ("4004".equals(computingFormula)) {
+                feePrice = additionalAmount.setScale(3, BigDecimal.ROUND_HALF_UP);
+            } else if ("4004".equals(computingFormula)) {
                 feePrice = new BigDecimal(Double.parseDouble(tmpReportFeeDto.getAmount()));
             } else if ("5005".equals(computingFormula)) {
                 if (StringUtil.isEmpty(tmpReportFeeDto.getCurDegrees())) {
@@ -802,7 +821,7 @@
                     BigDecimal sub = curDegree.subtract(preDegree);
                     feePrice = sub.multiply(squarePrice)
                             .add(additionalAmount)
-                            .setScale(2, BigDecimal.ROUND_HALF_EVEN);
+                            .setScale(2, BigDecimal.ROUND_HALF_UP);
                 }
             } else if ("6006".equals(computingFormula)) {
                 feePrice = new BigDecimal(Double.parseDouble(tmpReportFeeDto.getAmount()));
@@ -819,7 +838,7 @@
                     BigDecimal sub = curDegree.subtract(preDegree);
                     feePrice = sub.multiply(squarePrice)
                             .add(additionalAmount)
-                            .setScale(2, BigDecimal.ROUND_HALF_EVEN);
+                            .setScale(2, BigDecimal.ROUND_HALF_UP);
                 }
             } else {
                 throw new IllegalArgumentException("鏆備笉鏀寔璇ョ被鍏紡");
@@ -831,17 +850,17 @@
                 BigDecimal squarePrice = new BigDecimal(Double.parseDouble(tmpReportFeeDto.getSquarePrice()));
                 BigDecimal builtUpArea = new BigDecimal(Double.parseDouble("0"));
                 BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(tmpReportFeeDto.getAdditionalAmount()));
-                feePrice = squarePrice.multiply(builtUpArea).add(additionalAmount).setScale(2, BigDecimal.ROUND_HALF_EVEN);
+                feePrice = squarePrice.multiply(builtUpArea).add(additionalAmount).setScale(2, BigDecimal.ROUND_HALF_UP);
             } else if ("2002".equals(computingFormula)) { // 鍥哄畾璐圭敤
                 //feePrice = Double.parseDouble(feeDto.getAdditionalAmount());
                 BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(tmpReportFeeDto.getAdditionalAmount()));
-                feePrice = additionalAmount.setScale(2, BigDecimal.ROUND_HALF_EVEN);
+                feePrice = additionalAmount.setScale(2, BigDecimal.ROUND_HALF_UP);
             } else if ("3003".equals(computingFormula)) { // 鍥哄畾璐圭敤
                 //feePrice = Double.parseDouble(feeDto.getAdditionalAmount());
                 feePrice = new BigDecimal(0);
             } else if ("1101".equals(computingFormula)) { // 绉熼噾
                 feePrice = new BigDecimal(0);
-            }else if ("4004".equals(computingFormula)) {
+            } else if ("4004".equals(computingFormula)) {
                 feePrice = new BigDecimal(Double.parseDouble(tmpReportFeeDto.getAmount()));
             } else if ("5005".equals(computingFormula)) {
                 if (StringUtil.isEmpty(tmpReportFeeDto.getCurDegrees())) {
@@ -854,7 +873,7 @@
                     BigDecimal sub = curDegree.subtract(preDegree);
                     feePrice = sub.multiply(squarePrice)
                             .add(additionalAmount)
-                            .setScale(2, BigDecimal.ROUND_HALF_EVEN);
+                            .setScale(2, BigDecimal.ROUND_HALF_UP);
                 }
             } else if ("6006".equals(computingFormula)) {
                 feePrice = new BigDecimal(Double.parseDouble(tmpReportFeeDto.getAmount()));
@@ -871,23 +890,28 @@
                     BigDecimal sub = curDegree.subtract(preDegree);
                     feePrice = sub.multiply(squarePrice)
                             .add(additionalAmount)
-                            .setScale(2, BigDecimal.ROUND_HALF_EVEN);
+                            .setScale(2, BigDecimal.ROUND_HALF_UP);
                 }
             } else {
                 throw new IllegalArgumentException("鏆備笉鏀寔璇ョ被鍏紡");
             }
         }
-        return feePrice.setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue();
+        return feePrice.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
     }
 
     @Override
-    public double getFeePrice(FeeDto feeDto) {
+    public Map getFeePrice(FeeDto feeDto) {
         return getFeePrice(feeDto, null);
     }
 
     @Override
-    public double getFeePrice(FeeDto feeDto, RoomDto roomDto) {
-        BigDecimal feePrice = new BigDecimal(0.0);
+    public Map getFeePrice(FeeDto feeDto, RoomDto roomDto) {
+        BigDecimal feePrice = new BigDecimal("0.0");
+        BigDecimal feeTotalPrice = new BigDecimal(0.0);
+        Map<String, Object> feeAmount = new HashMap<>();
+        if (Environment.isOwnerPhone(java110Properties)) {
+            return getOwnerPhoneFee(feeAmount);
+        }
         if (FeeDto.PAYER_OBJ_TYPE_ROOM.equals(feeDto.getPayerObjType())) { //鎴垮眿鐩稿叧
             String computingFormula = feeDto.getComputingFormula();
             if (roomDto == null) {
@@ -896,7 +920,7 @@
                 roomDto.setCommunityId(feeDto.getCommunityId());
                 List<RoomDto> roomDtos = roomInnerServiceSMOImpl.queryRooms(roomDto);
                 if (roomDtos == null || roomDtos.size() != 1) {
-                    throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_ERROR, "鏈煡鍒版埧灞嬩俊鎭紝鏌ヨ澶氭潯鏁版嵁");
+                    throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_ERROR, "鏈煡鍒版埧灞嬩俊鎭紝鏌ヨ澶氭潯鏁版嵁 roomId=" + feeDto.getPayerObjId());
                 }
                 roomDto = roomDtos.get(0);
             }
@@ -905,21 +929,42 @@
                 BigDecimal squarePrice = new BigDecimal(Double.parseDouble(feeDto.getSquarePrice()));
                 BigDecimal builtUpArea = new BigDecimal(Double.parseDouble(roomDto.getBuiltUpArea()));
                 BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(feeDto.getAdditionalAmount()));
-                feePrice = squarePrice.multiply(builtUpArea).add(additionalAmount).setScale(3, BigDecimal.ROUND_HALF_EVEN);
+                feePrice = squarePrice.multiply(builtUpArea).add(additionalAmount).setScale(3, BigDecimal.ROUND_HALF_UP);
+                if (!StringUtil.isEmpty(feeDto.getCycle())) {
+                    BigDecimal cycle = new BigDecimal(feeDto.getCycle());
+                    feeTotalPrice = (squarePrice.multiply(builtUpArea).add(additionalAmount)).multiply(cycle).setScale(3, BigDecimal.ROUND_HALF_UP);
+                }
             } else if ("2002".equals(computingFormula)) { // 鍥哄畾璐圭敤
                 //feePrice = Double.parseDouble(feeDto.getAdditionalAmount());
                 BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(feeDto.getAdditionalAmount()));
-                feePrice = additionalAmount.setScale(3, BigDecimal.ROUND_HALF_EVEN);
+                feePrice = additionalAmount.setScale(3, BigDecimal.ROUND_HALF_UP);
+                if (!StringUtil.isEmpty(feeDto.getCycle())) {
+                    BigDecimal cycle1 = new BigDecimal(feeDto.getCycle());
+                    feeTotalPrice = additionalAmount.multiply(cycle1).setScale(3, BigDecimal.ROUND_HALF_UP);
+                }
             } else if ("3003".equals(computingFormula)) { // 鍥哄畾璐圭敤
                 BigDecimal squarePrice = new BigDecimal(Double.parseDouble(feeDto.getSquarePrice()));
                 BigDecimal builtUpArea = new BigDecimal(Double.parseDouble(roomDto.getRoomArea()));
                 BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(feeDto.getAdditionalAmount()));
-                feePrice = squarePrice.multiply(builtUpArea).add(additionalAmount).setScale(3, BigDecimal.ROUND_HALF_EVEN);
+                feePrice = squarePrice.multiply(builtUpArea).add(additionalAmount).setScale(3, BigDecimal.ROUND_HALF_UP);
+                if (!StringUtil.isEmpty(feeDto.getCycle())) {
+                    BigDecimal cycle1 = new BigDecimal(feeDto.getCycle());
+                    feeTotalPrice = (squarePrice.multiply(builtUpArea).add(additionalAmount)).multiply(cycle1).setScale(3, BigDecimal.ROUND_HALF_UP);
+                }
             } else if ("1101".equals(computingFormula)) { // 绉熼噾
                 BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(roomDto.getRoomRent()));
-                feePrice = additionalAmount.setScale(3, BigDecimal.ROUND_HALF_EVEN);
+                feePrice = additionalAmount.setScale(3, BigDecimal.ROUND_HALF_UP);
+                if (!StringUtil.isEmpty(feeDto.getCycle())) {
+                    BigDecimal cycle1 = new BigDecimal(feeDto.getCycle());
+                    feeTotalPrice = additionalAmount.multiply(cycle1).setScale(3, BigDecimal.ROUND_HALF_UP);
+                }
             } else if ("4004".equals(computingFormula)) {  //鍔ㄦ�佽垂鐢�
                 feePrice = new BigDecimal(Double.parseDouble(feeDto.getAmount()));
+                if (!StringUtil.isEmpty(feeDto.getCycle())) {
+                    BigDecimal cycle1 = new BigDecimal(feeDto.getCycle());
+                    BigDecimal amount = new BigDecimal(feeDto.getAmount());
+                    feeTotalPrice = amount.multiply(cycle1).setScale(3, BigDecimal.ROUND_HALF_UP);
+                }
             } else if ("5005".equals(computingFormula)) {  //(鏈湡搴︽暟-涓婃湡搴︽暟)*鍗曚环+闄勫姞璐�
                 if (StringUtil.isEmpty(feeDto.getCurDegrees())) {
                     //throw new IllegalArgumentException("鎶勮〃鏁版嵁寮傚父");
@@ -931,14 +976,33 @@
                     BigDecimal sub = curDegree.subtract(preDegree);
                     feePrice = sub.multiply(squarePrice)
                             .add(additionalAmount)
-                            .setScale(2, BigDecimal.ROUND_HALF_EVEN);
+                            .setScale(2, BigDecimal.ROUND_HALF_UP);
+
+                    if (!StringUtil.isEmpty(feeDto.getCycle())) {
+                        BigDecimal cycle1 = new BigDecimal(feeDto.getCycle());
+                        feeTotalPrice = (sub.multiply(squarePrice).add(additionalAmount)).multiply(cycle1).setScale(3, BigDecimal.ROUND_HALF_UP);
+                    }
                 }
             } else if ("6006".equals(computingFormula)) {
                 feePrice = new BigDecimal(Double.parseDouble(feeDto.getAmount()));
+                if (!StringUtil.isEmpty(feeDto.getCycle())) {
+                    BigDecimal cycle1 = new BigDecimal(feeDto.getCycle());
+                    BigDecimal amount = new BigDecimal(feeDto.getAmount());
+                    feeTotalPrice = amount.multiply(cycle1).setScale(3, BigDecimal.ROUND_HALF_UP);
+                }
             } else if ("7007".equals(computingFormula)) { //鑷畾涔夊叕寮�
                 feePrice = computeRoomCustomizeFormula(feeDto, roomDto);
+                if (!StringUtil.isEmpty(feeDto.getCycle())) {
+                    BigDecimal cycle1 = new BigDecimal(feeDto.getCycle());
+                    feeTotalPrice = feePrice.multiply(cycle1).setScale(3, BigDecimal.ROUND_HALF_UP);
+                }
             } else if ("8008".equals(computingFormula)) {  //鎵嬪姩鍔ㄦ�佽垂鐢�
                 feePrice = new BigDecimal(Double.parseDouble(feeDto.getAmount()));
+                if (!StringUtil.isEmpty(feeDto.getCycle())) {
+                    BigDecimal cycle1 = new BigDecimal(feeDto.getCycle());
+                    BigDecimal amount = new BigDecimal(feeDto.getAmount());
+                    feeTotalPrice = amount.multiply(cycle1).setScale(3, BigDecimal.ROUND_HALF_UP);
+                }
             } else if ("9009".equals(computingFormula)) {  //(鏈湡搴︽暟-涓婃湡搴︽暟)*鍔ㄦ�佸崟浠�+闄勫姞璐�
                 if (StringUtil.isEmpty(feeDto.getCurDegrees())) {
                     //throw new IllegalArgumentException("鎶勮〃鏁版嵁寮傚父");
@@ -950,7 +1014,11 @@
                     BigDecimal sub = curDegree.subtract(preDegree);
                     feePrice = sub.multiply(squarePrice)
                             .add(additionalAmount)
-                            .setScale(2, BigDecimal.ROUND_HALF_EVEN);
+                            .setScale(2, BigDecimal.ROUND_HALF_UP);
+                    if (!StringUtil.isEmpty(feeDto.getCycle())) {
+                        BigDecimal cycle1 = new BigDecimal(feeDto.getCycle());
+                        feeTotalPrice = (sub.multiply(squarePrice).add(additionalAmount)).multiply(cycle1).setScale(3, BigDecimal.ROUND_HALF_UP);
+                    }
                 }
             } else {
                 throw new IllegalArgumentException("鏆備笉鏀寔璇ョ被鍏紡");
@@ -959,6 +1027,7 @@
             String computingFormula = feeDto.getComputingFormula();
 
             OwnerCarDto ownerCarDto = new OwnerCarDto();
+            ownerCarDto.setCarTypeCd("1001"); //涓氫富杞﹁締
             ownerCarDto.setCommunityId(feeDto.getCommunityId());
             ownerCarDto.setCarId(feeDto.getPayerObjId());
             List<OwnerCarDto> ownerCarDtos = ownerCarInnerServiceSMOImpl.queryOwnerCars(ownerCarDto);
@@ -974,21 +1043,42 @@
                 BigDecimal squarePrice = new BigDecimal(Double.parseDouble(feeDto.getSquarePrice()));
                 BigDecimal builtUpArea = new BigDecimal(Double.parseDouble(parkingSpaceDtos.get(0).getArea()));
                 BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(feeDto.getAdditionalAmount()));
-                feePrice = squarePrice.multiply(builtUpArea).add(additionalAmount).setScale(2, BigDecimal.ROUND_HALF_EVEN);
+                feePrice = squarePrice.multiply(builtUpArea).add(additionalAmount).setScale(2, BigDecimal.ROUND_HALF_UP);
+                if (!StringUtil.isEmpty(feeDto.getCycle())) {
+                    BigDecimal cycle1 = new BigDecimal(feeDto.getCycle());
+                    feeTotalPrice = (squarePrice.multiply(builtUpArea).add(additionalAmount)).multiply(cycle1).setScale(3, BigDecimal.ROUND_HALF_UP);
+                }
             } else if ("2002".equals(computingFormula)) { // 鍥哄畾璐圭敤
                 //feePrice = Double.parseDouble(feeDto.getAdditionalAmount());
                 BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(feeDto.getAdditionalAmount()));
-                feePrice = additionalAmount.setScale(2, BigDecimal.ROUND_HALF_EVEN);
+                feePrice = additionalAmount.setScale(2, BigDecimal.ROUND_HALF_UP);
+                if (!StringUtil.isEmpty(feeDto.getCycle())) {
+                    BigDecimal cycle1 = new BigDecimal(feeDto.getCycle());
+                    feeTotalPrice = additionalAmount.multiply(cycle1).setScale(3, BigDecimal.ROUND_HALF_UP);
+                }
             } else if ("3003".equals(computingFormula)) { // 鍥哄畾璐圭敤
                 BigDecimal squarePrice = new BigDecimal(Double.parseDouble(feeDto.getSquarePrice()));
                 BigDecimal builtUpArea = new BigDecimal(Double.parseDouble(roomDto.getRoomArea()));
                 BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(feeDto.getAdditionalAmount()));
-                feePrice = squarePrice.multiply(builtUpArea).add(additionalAmount).setScale(3, BigDecimal.ROUND_HALF_EVEN);
+                feePrice = squarePrice.multiply(builtUpArea).add(additionalAmount).setScale(3, BigDecimal.ROUND_HALF_UP);
+                if (!StringUtil.isEmpty(feeDto.getCycle())) {
+                    BigDecimal cycle1 = new BigDecimal(feeDto.getCycle());
+                    feeTotalPrice = (squarePrice.multiply(builtUpArea).add(additionalAmount)).multiply(cycle1).setScale(3, BigDecimal.ROUND_HALF_UP);
+                }
             } else if ("1101".equals(computingFormula)) { // 绉熼噾
                 BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(roomDto.getRoomRent()));
-                feePrice = additionalAmount.setScale(3, BigDecimal.ROUND_HALF_EVEN);
-            }else if ("4004".equals(computingFormula)) {
+                feePrice = additionalAmount.setScale(3, BigDecimal.ROUND_HALF_UP);
+                if (!StringUtil.isEmpty(feeDto.getCycle())) {
+                    BigDecimal cycle1 = new BigDecimal(feeDto.getCycle());
+                    feeTotalPrice = additionalAmount.multiply(cycle1).setScale(3, BigDecimal.ROUND_HALF_UP);
+                }
+            } else if ("4004".equals(computingFormula)) {
                 feePrice = new BigDecimal(Double.parseDouble(feeDto.getAmount()));
+                if (!StringUtil.isEmpty(feeDto.getCycle())) {
+                    BigDecimal cycle1 = new BigDecimal(feeDto.getCycle());
+                    BigDecimal amount = new BigDecimal(feeDto.getAmount());
+                    feeTotalPrice = amount.multiply(cycle1).setScale(3, BigDecimal.ROUND_HALF_UP);
+                }
             } else if ("5005".equals(computingFormula)) {
                 if (StringUtil.isEmpty(feeDto.getCurDegrees())) {
                     throw new IllegalArgumentException("鎶勮〃鏁版嵁寮傚父");
@@ -1000,12 +1090,25 @@
                     BigDecimal sub = curDegree.subtract(preDegree);
                     feePrice = sub.multiply(squarePrice)
                             .add(additionalAmount)
-                            .setScale(2, BigDecimal.ROUND_HALF_EVEN);
+                            .setScale(2, BigDecimal.ROUND_HALF_UP);
+                    if (!StringUtil.isEmpty(feeDto.getCycle())) {
+                        BigDecimal cycle1 = new BigDecimal(feeDto.getCycle());
+                        feeTotalPrice = (sub.multiply(squarePrice).add(additionalAmount)).multiply(cycle1).setScale(3, BigDecimal.ROUND_HALF_UP);
+                    }
                 }
             } else if ("6006".equals(computingFormula)) {
                 feePrice = new BigDecimal(Double.parseDouble(feeDto.getAmount()));
+                if (!StringUtil.isEmpty(feeDto.getCycle())) {
+                    BigDecimal cycle1 = new BigDecimal(feeDto.getCycle());
+                    BigDecimal amount = new BigDecimal(feeDto.getAmount());
+                    feeTotalPrice = amount.multiply(cycle1).setScale(3, BigDecimal.ROUND_HALF_UP);
+                }
             } else if ("7007".equals(computingFormula)) { //鑷畾涔夊叕寮�
                 feePrice = computeCarCustomizeFormula(feeDto, ownerCarDtos.get(0));
+                if (!StringUtil.isEmpty(feeDto.getCycle())) {
+                    BigDecimal cycle1 = new BigDecimal(feeDto.getCycle());
+                    feeTotalPrice = feePrice.multiply(cycle1).setScale(3, BigDecimal.ROUND_HALF_UP);
+                }
             } else if ("9009".equals(computingFormula)) {  //(鏈湡搴︽暟-涓婃湡搴︽暟)*鍔ㄦ�佸崟浠�+闄勫姞璐�
                 if (StringUtil.isEmpty(feeDto.getCurDegrees())) {
                     //throw new IllegalArgumentException("鎶勮〃鏁版嵁寮傚父");
@@ -1017,7 +1120,11 @@
                     BigDecimal sub = curDegree.subtract(preDegree);
                     feePrice = sub.multiply(squarePrice)
                             .add(additionalAmount)
-                            .setScale(2, BigDecimal.ROUND_HALF_EVEN);
+                            .setScale(2, BigDecimal.ROUND_HALF_UP);
+                    if (!StringUtil.isEmpty(feeDto.getCycle())) {
+                        BigDecimal cycle1 = new BigDecimal(feeDto.getCycle());
+                        feeTotalPrice = (sub.multiply(squarePrice).add(additionalAmount)).multiply(cycle1).setScale(3, BigDecimal.ROUND_HALF_UP);
+                    }
                 }
             } else {
                 throw new IllegalArgumentException("鏆備笉鏀寔璇ョ被鍏紡");
@@ -1040,23 +1147,44 @@
                 }
                 feeDto.setBuiltUpArea(builtUpArea.doubleValue() + "");
                 BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(feeDto.getAdditionalAmount()));
-                feePrice = squarePrice.multiply(builtUpArea).add(additionalAmount).setScale(3, BigDecimal.ROUND_HALF_EVEN);
+                feePrice = squarePrice.multiply(builtUpArea).add(additionalAmount).setScale(3, BigDecimal.ROUND_HALF_UP);
+                if (!StringUtil.isEmpty(feeDto.getCycle())) {
+                    BigDecimal cycle1 = new BigDecimal(feeDto.getCycle());
+                    feeTotalPrice = (squarePrice.multiply(builtUpArea).add(additionalAmount)).multiply(cycle1).setScale(3, BigDecimal.ROUND_HALF_UP);
+                }
             } else if ("2002".equals(computingFormula)) { // 鍥哄畾璐圭敤
                 //feePrice = Double.parseDouble(feeDto.getAdditionalAmount());
                 BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(feeDto.getAdditionalAmount()));
 //                BigDecimal roomDount = new BigDecimal(contractRoomDtos.size());
 //                additionalAmount = additionalAmount.multiply(roomDount);
-                feePrice = additionalAmount.setScale(3, BigDecimal.ROUND_HALF_EVEN);
+                feePrice = additionalAmount.setScale(3, BigDecimal.ROUND_HALF_UP);
+                if (!StringUtil.isEmpty(feeDto.getCycle())) {
+                    BigDecimal cycle1 = new BigDecimal(feeDto.getCycle());
+                    feeTotalPrice = additionalAmount.multiply(cycle1).setScale(3, BigDecimal.ROUND_HALF_UP);
+                }
             } else if ("3003".equals(computingFormula)) { // 鍥哄畾璐圭敤
                 BigDecimal squarePrice = new BigDecimal(Double.parseDouble(feeDto.getSquarePrice()));
                 BigDecimal builtUpArea = new BigDecimal(Double.parseDouble(roomDto.getRoomArea()));
                 BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(feeDto.getAdditionalAmount()));
-                feePrice = squarePrice.multiply(builtUpArea).add(additionalAmount).setScale(3, BigDecimal.ROUND_HALF_EVEN);
+                feePrice = squarePrice.multiply(builtUpArea).add(additionalAmount).setScale(3, BigDecimal.ROUND_HALF_UP);
+                if (!StringUtil.isEmpty(feeDto.getCycle())) {
+                    BigDecimal cycle1 = new BigDecimal(feeDto.getCycle());
+                    feeTotalPrice = (squarePrice.multiply(builtUpArea).add(additionalAmount)).multiply(cycle1).setScale(3, BigDecimal.ROUND_HALF_UP);
+                }
             } else if ("1101".equals(computingFormula)) { // 绉熼噾
                 BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(roomDto.getRoomRent()));
-                feePrice = additionalAmount.setScale(3, BigDecimal.ROUND_HALF_EVEN);
-            }else if ("4004".equals(computingFormula)) {  //鍔ㄦ�佽垂鐢�
+                feePrice = additionalAmount.setScale(3, BigDecimal.ROUND_HALF_UP);
+                if (!StringUtil.isEmpty(feeDto.getCycle())) {
+                    BigDecimal cycle1 = new BigDecimal(feeDto.getCycle());
+                    feeTotalPrice = additionalAmount.multiply(cycle1).setScale(3, BigDecimal.ROUND_HALF_UP);
+                }
+            } else if ("4004".equals(computingFormula)) {  //鍔ㄦ�佽垂鐢�
                 feePrice = new BigDecimal(Double.parseDouble(feeDto.getAmount()));
+                if (!StringUtil.isEmpty(feeDto.getCycle())) {
+                    BigDecimal cycle1 = new BigDecimal(feeDto.getCycle());
+                    BigDecimal amount = new BigDecimal(feeDto.getAmount());
+                    feeTotalPrice = amount.multiply(cycle1).setScale(3, BigDecimal.ROUND_HALF_UP);
+                }
             } else if ("5005".equals(computingFormula)) {  //(鏈湡搴︽暟-涓婃湡搴︽暟)*鍗曚环+闄勫姞璐�
                 if (StringUtil.isEmpty(feeDto.getCurDegrees())) {
                     //throw new IllegalArgumentException("鎶勮〃鏁版嵁寮傚父");
@@ -1068,14 +1196,32 @@
                     BigDecimal sub = curDegree.subtract(preDegree);
                     feePrice = sub.multiply(squarePrice)
                             .add(additionalAmount)
-                            .setScale(2, BigDecimal.ROUND_HALF_EVEN);
+                            .setScale(2, BigDecimal.ROUND_HALF_UP);
+                    if (!StringUtil.isEmpty(feeDto.getCycle())) {
+                        BigDecimal cycle1 = new BigDecimal(feeDto.getCycle());
+                        feeTotalPrice = (sub.multiply(squarePrice).add(additionalAmount)).multiply(cycle1).setScale(3, BigDecimal.ROUND_HALF_UP);
+                    }
                 }
             } else if ("6006".equals(computingFormula)) {
                 feePrice = new BigDecimal(Double.parseDouble(feeDto.getAmount()));
+                if (!StringUtil.isEmpty(feeDto.getCycle())) {
+                    BigDecimal cycle1 = new BigDecimal(feeDto.getCycle());
+                    BigDecimal amount = new BigDecimal(feeDto.getAmount());
+                    feeTotalPrice = amount.multiply(cycle1).setScale(3, BigDecimal.ROUND_HALF_UP);
+                }
             } else if ("7007".equals(computingFormula)) { //鑷畾涔夊叕寮�
                 feePrice = computeContractCustomizeFormula(feeDto, contractRoomDtos);
+                if (!StringUtil.isEmpty(feeDto.getCycle())) {
+                    BigDecimal cycle1 = new BigDecimal(feeDto.getCycle());
+                    feeTotalPrice = feePrice.multiply(cycle1).setScale(3, BigDecimal.ROUND_HALF_UP);
+                }
             } else if ("8008".equals(computingFormula)) {  //鎵嬪姩鍔ㄦ�佽垂鐢�
                 feePrice = new BigDecimal(Double.parseDouble(feeDto.getAmount()));
+                if (!StringUtil.isEmpty(feeDto.getCycle())) {
+                    BigDecimal cycle1 = new BigDecimal(feeDto.getCycle());
+                    BigDecimal amount = new BigDecimal(feeDto.getAmount());
+                    feeTotalPrice = amount.multiply(cycle1).setScale(3, BigDecimal.ROUND_HALF_UP);
+                }
             } else if ("9009".equals(computingFormula)) {  //(鏈湡搴︽暟-涓婃湡搴︽暟)*鍔ㄦ�佸崟浠�+闄勫姞璐�
                 if (StringUtil.isEmpty(feeDto.getCurDegrees())) {
                     //throw new IllegalArgumentException("鎶勮〃鏁版嵁寮傚父");
@@ -1087,13 +1233,21 @@
                     BigDecimal sub = curDegree.subtract(preDegree);
                     feePrice = sub.multiply(squarePrice)
                             .add(additionalAmount)
-                            .setScale(2, BigDecimal.ROUND_HALF_EVEN);
+                            .setScale(2, BigDecimal.ROUND_HALF_UP);
+                    if (!StringUtil.isEmpty(feeDto.getCycle())) {
+                        BigDecimal cycle1 = new BigDecimal(feeDto.getCycle());
+                        feeTotalPrice = sub.multiply(squarePrice).add(additionalAmount).multiply(cycle1).setScale(3, BigDecimal.ROUND_HALF_UP);
+                    }
                 }
             } else {
                 throw new IllegalArgumentException("鏆備笉鏀寔璇ョ被鍏紡");
             }
         }
-        return feePrice.setScale(3, BigDecimal.ROUND_HALF_EVEN).doubleValue();
+
+        feePrice.setScale(3, BigDecimal.ROUND_HALF_UP).doubleValue();
+        feeAmount.put("feePrice", feePrice);
+        feeAmount.put("feeTotalPrice", feeTotalPrice);
+        return feeAmount;
     }
 
     /**
@@ -1232,6 +1386,7 @@
 
     /**
      * 璁$畻 璁¤垂缁撴潫鏃堕棿鍜� 娆犺垂鏈堜唤锛堝彲鑳藉瓨鍦ㄥ皬鏁扮偣锛�
+     *
      * @param feeDto
      * @param ownerCarDto
      * @return
@@ -1241,7 +1396,6 @@
         double oweMonth = 0.0;
 
         Map<String, Object> targetEndDateAndOweMonth = new HashMap<>();
-
         //鍒ゆ柇褰撳墠璐圭敤鏄惁宸茬粨鏉�
         if (FeeDto.STATE_FINISH.equals(feeDto.getState())) {
             targetEndDate = feeDto.getEndTime();
@@ -1263,7 +1417,6 @@
             }
             //鍒ゆ柇褰撳墠璐圭敤鏄笉鏄鍏ヨ垂鐢�
             oweMonth = 1.0;
-
         } else { //鍛ㄦ湡鎬ц垂鐢�
             //褰撳墠鏃堕棿
             Date billEndTime = DateUtil.getCurrentDate();
@@ -1271,7 +1424,6 @@
             Date startDate = feeDto.getStartTime();
             //璁¤垂璧峰鏃堕棿
             Date endDate = feeDto.getEndTime();
-
             //缂磋垂鍛ㄦ湡
             long paymentCycle = Long.parseLong(feeDto.getPaymentCycle());
             // 褰撳墠鏃堕棿 - 寮�濮嬫椂闂�  = 鏈堜唤
@@ -1280,14 +1432,14 @@
 
             // 鏈堜唤/ 鍛ㄦ湡 = 杞暟锛堝悜涓婂彇鏁达級
             double round = 0.0;
-            if ("1200".equals(feeDto.getPaymentCd())) { // 棰勪粯璐�
+            if ("1200".equals(feeDto.getPaymentCd())) { // 1200棰勪粯璐�
                 round = Math.floor(mulMonth / paymentCycle) + 1;
-            } else { //鍚庝粯璐�
+            } else { //2100鍚庝粯璐�
                 round = Math.floor(mulMonth / paymentCycle);
             }
             // 杞暟 * 鍛ㄦ湡 * 30 + 寮�濮嬫椂闂� = 鐩爣 鍒版湡鏃堕棿
-            targetEndDate = getTargetEndTime(round * paymentCycle, startDate);
-            //璐圭敤 蹇粨鏉熶簡
+            targetEndDate = getTargetEndTime(round * paymentCycle, startDate);//鐩爣缁撴潫鏃堕棿
+            //璐圭敤椤圭殑缁撴潫鏃堕棿<缂磋垂鐨勭粨鏉熸椂闂�  璐圭敤蹇粨鏉熶簡   鍙栬垂鐢ㄩ」鐨勭粨鏉熸椂闂�
             if (feeDto.getConfigEndTime().getTime() < targetEndDate.getTime()) {
                 targetEndDate = feeDto.getConfigEndTime();
             }
@@ -1321,7 +1473,8 @@
 
     /**
      * 璁$畻 涓や釜鏃堕棿鐐规湀浠�
-     * @param fromDate  寮�濮嬫椂闂�
+     *
+     * @param fromDate 寮�濮嬫椂闂�
      * @param toDate   缁撴潫鏃堕棿
      * @return
      */
@@ -1381,6 +1534,30 @@
         return resMonth;
     }
 
+
+    //鎵嬫満绔即璐瑰鐞�
+    public Map getOwnerPhoneFee(Map feeAmount) {
+        feeAmount.put("feePrice", new BigDecimal(1.00 / 100));
+        feeAmount.put("feeTotalPrice", new BigDecimal(1.00 / 100));
+        return feeAmount;
+    }
+
+
+    /**
+     * 銆�銆� *瀛楃涓茬殑鏃ユ湡鏍煎紡鐨勮绠�
+     */
+    public long daysBetween(Date smdate, Date bdate) {
+        long between_days = 0;
+        Calendar cal = Calendar.getInstance();
+        cal.setTime(smdate);
+        long time1 = cal.getTimeInMillis();
+        cal.setTime(bdate);
+        long time2 = cal.getTimeInMillis();
+        between_days = (time2 - time1) / (1000 * 3600 * 24);
+
+        return between_days;
+    }
+
     @Override
     public Date getTargetEndTime(double month, Date startDate) {
         Calendar endDate = Calendar.getInstance();
@@ -1392,26 +1569,47 @@
         if (doubleMonth <= 0) {
             return endDate.getTime();
         }
-//        Calendar futureDate = Calendar.getInstance();
-//        futureDate.setTime(endDate.getTime());
-//        futureDate.add(Calendar.MONTH, 1);
         int futureDay = endDate.getActualMaximum(Calendar.DAY_OF_MONTH);
         Double hour = doubleMonth * futureDay * 24;
         endDate.add(Calendar.HOUR_OF_DAY, hour.intValue());
         return endDate.getTime();
     }
 
-    public static void main(String[] args) {
-        ComputeFeeSMOImpl computeFeeSMO = new ComputeFeeSMOImpl();
-        try {
-            double month = computeFeeSMO.dayCompare(
-                    DateUtil.getDateFromString("2021-6-1 00:00:00", DateUtil.DATE_FORMATE_STRING_A),
-                    DateUtil.getDateFromString("2021-8-5 18:00:00", DateUtil.DATE_FORMATE_STRING_A)
-            );
-            System.out.println(month);
-        } catch (ParseException e) {
-            e.printStackTrace();
+
+    @Override
+    public List<CarInoutDto> computeTempCarStopTimeAndFee(List<CarInoutDto> carInoutDtos) {
+
+        if (carInoutDtos == null || carInoutDtos.size() < 1) {
+            return null;
         }
+
+
+        carInoutDtos = tempCarFeeConfigInnerServiceSMOImpl.computeTempCarFee(carInoutDtos);
+
+        return carInoutDtos;
+
+    }
+
+    @Override
+    public List<CarInoutDetailDto> computeTempCarInoutDetailStopTimeAndFee(List<CarInoutDetailDto> carInoutDtos) {
+        if (carInoutDtos == null || carInoutDtos.size() < 1) {
+            return null;
+        }
+
+
+        carInoutDtos = tempCarFeeConfigInnerServiceSMOImpl.computeTempCarInoutDetailFee(carInoutDtos);
+
+        return carInoutDtos;
+    }
+
+
+    public static void main(String[] args) {
+        BigDecimal squarePrice = new BigDecimal(Double.parseDouble("4.50"));
+        BigDecimal builtUpArea = new BigDecimal(Double.parseDouble("52.69"));
+        BigDecimal additionalAmount = new BigDecimal(Double.parseDouble("0"));
+            BigDecimal cycle = new BigDecimal(Double.parseDouble("3"));
+        BigDecimal  feeTotalPrice = (squarePrice.multiply(builtUpArea).add(additionalAmount)).multiply(cycle).setScale(3, BigDecimal.ROUND_HALF_DOWN);
+        System.out.println(feeTotalPrice.doubleValue());
     }
 
 //    public static void main(String[] args) {

--
Gitblit v1.8.0