java110 лет назад: 5
Родитель
Сommit
ee5b722a8d

+ 9 - 0
java110-bean/src/main/java/com/java110/dto/fee/FeeDto.java

@@ -64,6 +64,7 @@ public class FeeDto extends PageDto implements Serializable {
     private double feePrice;
     private String payerObjType;
     private String computingFormula;
+    private String computingFormulaText;
     private String isDefault;
     private double oweFee; // 欠费金额
     private String billType;
@@ -570,4 +571,12 @@ public class FeeDto extends PageDto implements Serializable {
     public void setCount(int count) {
         this.count = count;
     }
+
+    public String getComputingFormulaText() {
+        return computingFormulaText;
+    }
+
+    public void setComputingFormulaText(String computingFormulaText) {
+        this.computingFormulaText = computingFormulaText;
+    }
 }

+ 9 - 0
java110-bean/src/main/java/com/java110/dto/report/ReportFeeDto.java

@@ -29,6 +29,7 @@ public class ReportFeeDto extends PageDto implements Serializable {
 
     private String squarePrice;
     private String additionalAmount;
+    private String additionalAmountText;
     private String state;
     private String stateName;
     private String feeFlag;
@@ -492,4 +493,12 @@ public class ReportFeeDto extends PageDto implements Serializable {
     public void setStoreTypeCd(String storeTypeCd) {
         this.storeTypeCd = storeTypeCd;
     }
+
+    public String getAdditionalAmountText() {
+        return additionalAmountText;
+    }
+
+    public void setAdditionalAmountText(String additionalAmountText) {
+        this.additionalAmountText = additionalAmountText;
+    }
 }

+ 138 - 5
java110-core/src/main/java/com/java110/core/smo/impl/ComputeFeeSMOImpl.java

@@ -2,6 +2,7 @@ package com.java110.core.smo.impl;
 
 import com.java110.core.smo.IComputeFeeSMO;
 import com.java110.dto.RoomDto;
+import com.java110.dto.community.CommunityDto;
 import com.java110.dto.fee.BillDto;
 import com.java110.dto.fee.BillOweFeeDto;
 import com.java110.dto.fee.FeeAttrDto;
@@ -12,6 +13,7 @@ import com.java110.dto.parking.ParkingSpaceDto;
 import com.java110.dto.report.ReportCarDto;
 import com.java110.dto.report.ReportFeeDto;
 import com.java110.dto.report.ReportRoomDto;
+import com.java110.intf.community.ICommunityInnerServiceSMO;
 import com.java110.intf.community.IParkingSpaceInnerServiceSMO;
 import com.java110.intf.community.IRoomInnerServiceSMO;
 import com.java110.intf.fee.IFeeInnerServiceSMO;
@@ -20,6 +22,7 @@ import com.java110.po.feeReceiptDetail.FeeReceiptDetailPo;
 import com.java110.utils.constant.ResponseConstant;
 import com.java110.utils.exception.ListenerExecuteException;
 import com.java110.utils.util.Assert;
+import com.java110.utils.util.BeanConvertUtil;
 import com.java110.utils.util.DateUtil;
 import com.java110.utils.util.StringUtil;
 import org.slf4j.Logger;
@@ -27,8 +30,9 @@ import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import javax.script.ScriptEngine;
+import javax.script.ScriptEngineManager;
 import java.math.BigDecimal;
-import java.security.acl.Owner;
 import java.text.ParseException;
 import java.util.ArrayList;
 import java.util.Calendar;
@@ -62,6 +66,9 @@ public class ComputeFeeSMOImpl implements IComputeFeeSMO {
     @Autowired(required = false)
     private IParkingSpaceInnerServiceSMO parkingSpaceInnerServiceSMOImpl;
 
+    @Autowired
+    private ICommunityInnerServiceSMO communityInnerServiceSMOImpl;
+
     @Override
     public Date getFeeEndTime() {
         return null;
@@ -170,7 +177,7 @@ public class ComputeFeeSMOImpl implements IComputeFeeSMO {
         double oweMonth = (double) targetEndDateAndOweMonth.get("oweMonth");
 
         String computingFormula = feeDto.getComputingFormula();
-        double feePrice = getFeePrice(feeDto,roomDto);
+        double feePrice = getFeePrice(feeDto, roomDto);
         feeDto.setFeePrice(feePrice);
         //double month = dayCompare(feeDto.getEndTime(), DateUtil.getCurrentDate());
         BigDecimal price = new BigDecimal(feeDto.getFeePrice());
@@ -229,6 +236,9 @@ public class ComputeFeeSMOImpl implements IComputeFeeSMO {
                 }
                 feeReceiptDetailPo.setArea(value);
                 feeReceiptDetailPo.setSquarePrice(feeDto.getSquarePrice() + "/" + feeDto.getAdditionalAmount());
+            } else if ("7007".equals(computingFormula)) { //自定义公式
+                feeReceiptDetailPo.setArea(roomDtos.get(0).getBuiltUpArea());
+                feeReceiptDetailPo.setSquarePrice(feeDto.getComputingFormulaText());
             } else {
             }
         } else if (FeeDto.PAYER_OBJ_TYPE_CAR.equals(feeDto.getPayerObjType())) {//车位相关
@@ -271,6 +281,16 @@ public class ComputeFeeSMOImpl implements IComputeFeeSMO {
                 }
                 feeReceiptDetailPo.setArea(value);
                 feeReceiptDetailPo.setSquarePrice(feeDto.getSquarePrice() + "/" + feeDto.getAdditionalAmount());
+            }else if ("7007".equals(computingFormula)) { //自定义公式
+                ParkingSpaceDto parkingSpaceDto = new ParkingSpaceDto();
+                parkingSpaceDto.setCommunityId(feeDto.getCommunityId());
+                parkingSpaceDto.setPsId(ownerCarDtos.get(0).getPsId());
+                List<ParkingSpaceDto> parkingSpaceDtos = parkingSpaceInnerServiceSMOImpl.queryParkingSpaces(parkingSpaceDto);
+                if (parkingSpaceDtos == null || parkingSpaceDtos.size() < 1) { //数据有问题
+                    return;
+                }
+                feeReceiptDetailPo.setArea(parkingSpaceDtos.get(0).getArea());
+                feeReceiptDetailPo.setSquarePrice(feeDto.getComputingFormulaText());
             } else {
             }
         }
@@ -545,7 +565,9 @@ public class ComputeFeeSMOImpl implements IComputeFeeSMO {
                 }
             } else if ("6006".equals(computingFormula)) {
                 feePrice = new BigDecimal(Double.parseDouble(tmpReportFeeDto.getAmount()));
-            } else {
+            }else if ("7007".equals(computingFormula)) { //自定义公式
+                feePrice = computeRoomCustomizeFormula(BeanConvertUtil.covertBean(tmpReportFeeDto,FeeDto.class), BeanConvertUtil.covertBean(reportRoomDto,RoomDto.class));
+            }  else {
                 throw new IllegalArgumentException("暂不支持该类公式");
             }
         } else if (FeeDto.PAYER_OBJ_TYPE_CAR.equals(tmpReportFeeDto.getPayerObjType())) {//车位相关
@@ -577,7 +599,9 @@ public class ComputeFeeSMOImpl implements IComputeFeeSMO {
                 }
             } else if ("6006".equals(computingFormula)) {
                 feePrice = new BigDecimal(Double.parseDouble(tmpReportFeeDto.getAmount()));
-            } else {
+            }else if ("7007".equals(computingFormula)) { //自定义公式
+                feePrice = computeCarCustomizeFormula(BeanConvertUtil.covertBean(tmpReportFeeDto,FeeDto.class), BeanConvertUtil.covertBean(reportCarDto,OwnerCarDto.class));
+            }  else {
                 throw new IllegalArgumentException("暂不支持该类公式");
             }
         }
@@ -594,7 +618,7 @@ public class ComputeFeeSMOImpl implements IComputeFeeSMO {
         BigDecimal feePrice = new BigDecimal(0.0);
         if (FeeDto.PAYER_OBJ_TYPE_ROOM.equals(feeDto.getPayerObjType())) { //房屋相关
             String computingFormula = feeDto.getComputingFormula();
-            if(roomDto == null) {
+            if (roomDto == null) {
                 roomDto = new RoomDto();
                 roomDto.setRoomId(feeDto.getPayerObjId());
                 roomDto.setCommunityId(feeDto.getCommunityId());
@@ -631,6 +655,8 @@ public class ComputeFeeSMOImpl implements IComputeFeeSMO {
                 }
             } else if ("6006".equals(computingFormula)) {
                 feePrice = new BigDecimal(Double.parseDouble(feeDto.getAmount()));
+            } else if ("7007".equals(computingFormula)) { //自定义公式
+                feePrice = computeRoomCustomizeFormula(feeDto, roomDto);
             } else {
                 throw new IllegalArgumentException("暂不支持该类公式");
             }
@@ -675,6 +701,8 @@ public class ComputeFeeSMOImpl implements IComputeFeeSMO {
                 }
             } else if ("6006".equals(computingFormula)) {
                 feePrice = new BigDecimal(Double.parseDouble(feeDto.getAmount()));
+            }else if ("7007".equals(computingFormula)) { //自定义公式
+                feePrice = computeCarCustomizeFormula(feeDto, ownerCarDtos.get(0));
             } else {
                 throw new IllegalArgumentException("暂不支持该类公式");
             }
@@ -682,6 +710,111 @@ public class ComputeFeeSMOImpl implements IComputeFeeSMO {
         return feePrice.setScale(3, BigDecimal.ROUND_HALF_EVEN).doubleValue();
     }
 
+    /**
+     *  C 代表房屋对应小区面积
+
+     *  R 代表房屋面积
+     * @param feeDto
+     * @param ownerCarDto
+     * @return
+     */
+    private BigDecimal computeCarCustomizeFormula(FeeDto feeDto, OwnerCarDto ownerCarDto) {
+        String value = feeDto.getComputingFormulaText();
+        value = value.replace("\n", "")
+                .replace("\r", "")
+                .trim();
+
+        if (value.contains("C")) { //处理小区面积
+            CommunityDto communityDto = new CommunityDto();
+            communityDto.setCommunityId(feeDto.getCommunityId());
+            List<CommunityDto> communityDtos = communityInnerServiceSMOImpl.queryCommunitys(communityDto);
+            if (communityDtos == null || communityDtos.size() < 1) {
+                value = value.replace("C", "0");
+            } else {
+                value = value.replace("C", communityDtos.get(0).getCommunityArea());
+            }
+        } else if (value.contains("R")) { //处理 房屋面积
+            ParkingSpaceDto parkingSpaceDto = new ParkingSpaceDto();
+            parkingSpaceDto.setCommunityId(feeDto.getCommunityId());
+            parkingSpaceDto.setPsId(ownerCarDto.getPsId());
+            List<ParkingSpaceDto> parkingSpaceDtos = parkingSpaceInnerServiceSMOImpl.queryParkingSpaces(parkingSpaceDto);
+            if (parkingSpaceDtos == null || parkingSpaceDtos.size() < 1) { //数据有问题
+                //throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_ERROR, "未查到停车位信息,查询多条数据");
+                value = value.replace("R", "0");
+            }else {
+                value = value.replace("R", parkingSpaceDtos.get(0).getArea());
+            }
+        }
+
+        ScriptEngineManager manager = new ScriptEngineManager();
+        ScriptEngine engine = manager.getEngineByName("JavaScript");
+        BigDecimal valueObj = null;
+        try {
+            value = engine.eval(value).toString();
+            valueObj = new BigDecimal(Double.parseDouble(value));
+        } catch (Exception e) {
+            //throw new IllegalArgumentException("公式计算异常,公式为【" + feeDto.getComputingFormulaText() + "】,计算 【" + value + "】异常");
+            valueObj = new BigDecimal(0);
+        }
+
+        return valueObj;
+    }
+
+    /**
+     * 自定义公式计算
+     *
+     * @param feeDto
+     * @param roomDto
+     * @return C 代表房屋对应小区面积
+     * F 代表房屋对应楼栋面积
+     * U 代表房屋对应单元面积
+     * R 代表房屋面积
+     * X 代表房屋收费系数(房屋管理中配置)
+     * L 代表房屋层数
+     */
+    private BigDecimal computeRoomCustomizeFormula(FeeDto feeDto, RoomDto roomDto) {
+
+        String value = feeDto.getComputingFormulaText();
+        value = value.replace("\n", "")
+                .replace("\r", "")
+                .trim();
+
+        if (value.contains("C")) { //处理小区面积
+            CommunityDto communityDto = new CommunityDto();
+            communityDto.setCommunityId(feeDto.getCommunityId());
+            List<CommunityDto> communityDtos = communityInnerServiceSMOImpl.queryCommunitys(communityDto);
+            if (communityDtos == null || communityDtos.size() < 1) {
+                value = value.replace("C", "0");
+            } else {
+                value = value.replace("C", communityDtos.get(0).getCommunityArea());
+            }
+        } else if (value.contains("F")) { //处理楼栋
+            value = value.replace("F", roomDto.getFloorArea());
+        } else if (value.contains("U")) { //处理单元
+            value = value.replace("U", roomDto.getUnitArea());
+        } else if (value.contains("R")) { //处理 房屋面积
+            value = value.replace("R", roomDto.getBuiltUpArea());
+        } else if (value.contains("X")) {// 处理 房屋系数
+            value = value.replace("X", roomDto.getFeeCoefficient());
+        } else if (value.contains("L")) {//处理房屋层数
+            value = value.replace("L", roomDto.getLayer());
+        }
+
+        ScriptEngineManager manager = new ScriptEngineManager();
+        ScriptEngine engine = manager.getEngineByName("JavaScript");
+        BigDecimal valueObj = null;
+        try {
+            value = engine.eval(value).toString();
+            valueObj = new BigDecimal(Double.parseDouble(value));
+        } catch (Exception e) {
+            //throw new IllegalArgumentException("公式计算异常,公式为【" + feeDto.getComputingFormulaText() + "】,计算 【" + value + "】异常");
+            valueObj = new BigDecimal(0);
+        }
+
+        return valueObj;
+
+    }
+
     public Map getTargetEndDateAndOweMonth(FeeDto feeDto, OwnerCarDto ownerCarDto) {
         Date targetEndDate = null;
         double oweMonth = 0.0;

+ 4 - 3
java110-db/src/main/resources/mapper/fee/FeeServiceDaoImplMapper.xml

@@ -137,7 +137,7 @@
         userId,t.payer_obj_id,t.payer_obj_id payerObjId,pfc.square_price squarePrice,pfc.additional_amount
         additionalAmount,t.fee_flag,t.fee_flag feeFlag,t.state,t.config_id,t.config_id configId,
         pfc.fee_name feeName,td1.name feeTypeCdName,td2.name stateName,td3.name feeFlagName,pfc.computing_formula
-        computingFormula,
+        computingFormula,pfc.computing_formula_text computingFormulaText,
         pfc.bill_type billType,t.payer_obj_type,t.payer_obj_type payerObjType,pfc.is_default isDefault,pfc.start_time
         configStartTime,pfc.end_time configEndTime,pfc.payment_cd paymentCd,pfc.payment_cycle paymentCycle,td4.name
         billTypeName,pfa.value importFeeName,ifd.end_time importFeeEndTime,mw.cur_degrees curDegrees,mw.pre_degrees
@@ -690,7 +690,7 @@
         userId,t.payer_obj_id,t.payer_obj_id payerObjId,pfc.square_price squarePrice,pfc.additional_amount
         additionalAmount,t.fee_flag,t.fee_flag feeFlag,t.state,t.config_id,t.config_id configId,
         pfc.fee_name feeName,td1.name feeTypeCdName,td2.name stateName,td3.name feeFlagName,pfc.computing_formula
-        computingFormula,
+        computingFormula,pfc.computing_formula_text computingFormulaText,
         t.payer_obj_type,t.payer_obj_type payerObjType,pfc.is_default isDefault,pfc.start_time
         configStartTime,pfc.end_time configEndTime,pfc.payment_cd paymentCd,pfc.payment_cycle paymentCycle
         from pay_fee t
@@ -849,7 +849,8 @@
     <select id="computeEveryOweFee" parameterType="Map" resultType="Map">
         select pfc.fee_name feeName,pf.fee_id feeId,pf.end_time endTime,pf.payer_obj_id payerObjId,pf.payer_obj_type
         payerObjType,
-        pf.community_id communityId,pfc.computing_formula computingFormula,pfc.square_price
+        pf.community_id communityId,pfc.computing_formula computingFormula,pfc.computing_formula_text computingFormulaText,
+        pfc.square_price
         squarePrice,pfc.additional_amount additionalAmount
         from pay_fee pf
         INNER JOIN pay_fee_config pfc on pf.config_id = pfc.config_id and pfc.bill_type = '004' and pfc.status_cd = '0'

+ 2 - 1
java110-db/src/main/resources/mapper/report/ReportFeeServiceDaoImplMapper.xml

@@ -40,7 +40,8 @@
     <select id="getFees" parameterType="com.java110.dto.report.ReportFeeDto"
             resultType="com.java110.dto.report.ReportFeeDto">
                 select pfc.fee_name feeName,pfc.start_time configStartTime,pfc.end_time configEndTime,pfc.config_id configId,pfc.fee_type_cd feeTypeCd,
-        pfc.additional_amount additionalAmount,pfc.bill_type billType,pfc.computing_formula computingFormula,pfc.payment_cd paymentCd,
+        pfc.additional_amount additionalAmount,pfc.bill_type billType,pfc.computing_formula computingFormula,pfc.computing_formula_text computingFormulaText,
+        pfc.payment_cd paymentCd,
         pfc.payment_cycle paymentCycle,pfc.square_price squarePrice,pfc.fee_flag feeFlag,t.payer_obj_id payerObjId,t.payer_obj_type payerObjType,
         t.amount,t.create_time createTime,t.end_time endTime,t.fee_id feeId,t.income_obj_id incomeObjId,t.start_time startTime,t.state,
         br.room_id roomId,br.room_num roomNum,oc.car_num carNum,ss.store_id storeId,ss.`name` storeName,ss.store_type_cd storeTypeCd,

+ 5 - 91
service-api/src/main/java/com/java110/api/bmo/fee/impl/FeeBMOImpl.java

@@ -406,97 +406,11 @@ public class FeeBMOImpl extends ApiBaseBMO implements IFeeBMO {
         }
         businessFeeDetail.put("endTime", DateUtil.getFormatTimeString(endCalender.getTime(), DateUtil.DATE_FORMATE_STRING_A));
 
-        BigDecimal feePrice = new BigDecimal("0.00");
-
-        if ("3333".equals(feeDto.getPayerObjType())) { //房屋相关
-            String computingFormula = feeDto.getComputingFormula();
-            if ("1001".equals(computingFormula)) { //面积*单价+附加费
-                RoomDto roomDto = new RoomDto();
-                roomDto.setRoomId(feeDto.getPayerObjId());
-                roomDto.setCommunityId(feeDto.getCommunityId());
-                List<RoomDto> roomDtos = roomInnerServiceSMOImpl.queryRooms(roomDto);
-                if (roomDtos == null || roomDtos.size() != 1) {
-                    throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_ERROR, "未查到房屋信息,查询多条数据");
-                }
-                roomDto = roomDtos.get(0);
-                //feePrice = Double.parseDouble(feeDto.getSquarePrice()) * Double.parseDouble(roomDtos.get(0).getBuiltUpArea()) + Double.parseDouble(feeDto.getAdditionalAmount());
-                BigDecimal squarePrice = new BigDecimal(Double.parseDouble(feeDto.getSquarePrice()));
-                BigDecimal builtUpArea = new BigDecimal(Double.parseDouble(roomDtos.get(0).getBuiltUpArea()));
-                BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(feeDto.getAdditionalAmount()));
-                //获取支付方式
-                String primeRate = paramInJson.getString("primeRate");
-                //判断是否是线上支付
-                if (primeRate.equals("5") || primeRate.equals("6")) {
-                    feePrice = squarePrice.multiply(builtUpArea).add(additionalAmount);
-                } else {
-                    feePrice = squarePrice.multiply(builtUpArea).add(additionalAmount).setScale(2, BigDecimal.ROUND_HALF_EVEN);
-                }
-            } 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);
-            } else if ("4004".equals(computingFormula)) {
-                feePrice = new BigDecimal(Double.parseDouble(feeDto.getAmount()));
-            } else if ("5005".equals(computingFormula)) {
-                if (StringUtil.isEmpty(feeDto.getCurDegrees())) {
-                    //throw new IllegalArgumentException("抄表数据异常");
-                } else {
-                    BigDecimal curDegree = new BigDecimal(Double.parseDouble(feeDto.getCurDegrees()));
-                    BigDecimal preDegree = new BigDecimal(Double.parseDouble(feeDto.getPreDegrees()));
-                    BigDecimal squarePrice = new BigDecimal(Double.parseDouble(feeDto.getSquarePrice()));
-                    BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(feeDto.getAdditionalAmount()));
-                    BigDecimal sub = curDegree.subtract(preDegree);
-                    feePrice = sub.multiply(squarePrice)
-                            .add(additionalAmount)
-                            .setScale(2, BigDecimal.ROUND_HALF_EVEN);
-                }
-            } else if ("6006".equals(computingFormula)) {
-                feePrice = new BigDecimal(Double.parseDouble(feeDto.getAmount()));
-            } else {
-                throw new IllegalArgumentException("暂不支持该类公式");
-            }
-        } else if ("6666".equals(feeDto.getPayerObjType())) {//车位相关
-            String computingFormula = feeDto.getComputingFormula();
-            if ("1001".equals(computingFormula)) { //面积*单价+附加费
-                ParkingSpaceDto parkingSpaceDto = new ParkingSpaceDto();
-                parkingSpaceDto.setCommunityId(feeDto.getCommunityId());
-                parkingSpaceDto.setPsId(feeDto.getPayerObjId());
-                List<ParkingSpaceDto> parkingSpaceDtos = parkingSpaceInnerServiceSMOImpl.queryParkingSpaces(parkingSpaceDto);
-
-                if (parkingSpaceDtos == null || parkingSpaceDtos.size() < 1) { //数据有问题
-                    throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_ERROR, "未查到停车位信息,查询多条数据");
-                }
-                //feePrice = Double.parseDouble(feeDto.getSquarePrice()) * Double.parseDouble(parkingSpaceDtos.get(0).getArea()) + Double.parseDouble(feeDto.getAdditionalAmount());
-                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);
-            } 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);
-            } else if ("5005".equals(computingFormula)) {
-                if (StringUtil.isEmpty(feeDto.getCurDegrees())) {
-                    throw new IllegalArgumentException("抄表数据异常");
-                } else {
-                    BigDecimal curDegree = new BigDecimal(Double.parseDouble(feeDto.getCurDegrees()));
-                    BigDecimal preDegree = new BigDecimal(Double.parseDouble(feeDto.getPreDegrees()));
-                    BigDecimal squarePrice = new BigDecimal(Double.parseDouble(feeDto.getSquarePrice()));
-                    BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(feeDto.getAdditionalAmount()));
-                    BigDecimal sub = curDegree.subtract(preDegree);
-                    feePrice = sub.multiply(squarePrice)
-                            .add(additionalAmount)
-                            .setScale(2, BigDecimal.ROUND_HALF_EVEN);
-                }
-            } else if ("6006".equals(computingFormula)) {
-                feePrice = new BigDecimal(Double.parseDouble(feeDto.getAmount()));
-            } else if ("4004".equals(computingFormula)) {
-                feePrice = new BigDecimal(Double.parseDouble(feeDto.getAmount()));
-            } else {
-                throw new IllegalArgumentException("暂不支持该类公式");
-            }
-        }
-        BigDecimal receivableAmount = feePrice;
+        double feePrice = 0.0;
+
+        feePrice = computeFeeSMOImpl.getFeePrice(feeDto);
+
+        BigDecimal receivableAmount = new BigDecimal(feePrice);
         BigDecimal cycles = new BigDecimal(Double.parseDouble(paramInJson.getString("cycles")));
         double tmpReceivableAmount = cycles.multiply(receivableAmount).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue();
         double discountPrice = paramInJson.getDouble("discountPrice");