From e46395d507a9eb1d4534c61184b4d60dbd75f888 Mon Sep 17 00:00:00 2001
From: java110 <928255095@qq.com>
Date: 星期四, 18 五月 2023 18:28:27 +0800
Subject: [PATCH] optimize

---
 service-fee/src/main/java/com/java110/fee/cmd/fee/ListFeeCmd.java |  301 ++++++++++++++++++++++++++++---------------------
 1 files changed, 173 insertions(+), 128 deletions(-)

diff --git a/service-fee/src/main/java/com/java110/fee/cmd/fee/ListFeeCmd.java b/service-fee/src/main/java/com/java110/fee/cmd/fee/ListFeeCmd.java
index e62f401..e203489 100644
--- a/service-fee/src/main/java/com/java110/fee/cmd/fee/ListFeeCmd.java
+++ b/service-fee/src/main/java/com/java110/fee/cmd/fee/ListFeeCmd.java
@@ -8,22 +8,28 @@
 import com.java110.core.factory.CommunitySettingFactory;
 import com.java110.core.log.LoggerFactory;
 import com.java110.core.smo.IComputeFeeSMO;
+import com.java110.dto.FloorDto;
+import com.java110.dto.RoomDto;
+import com.java110.dto.UnitDto;
 import com.java110.dto.fee.FeeAttrDto;
-import com.java110.dto.fee.FeeConfigDto;
 import com.java110.dto.fee.FeeDto;
 import com.java110.dto.owner.OwnerCarDto;
+import com.java110.dto.owner.OwnerDto;
+import com.java110.dto.owner.OwnerRoomRelDto;
 import com.java110.dto.parking.ParkingSpaceDto;
+import com.java110.intf.community.IFloorInnerServiceSMO;
 import com.java110.intf.community.IParkingSpaceInnerServiceSMO;
+import com.java110.intf.community.IRoomInnerServiceSMO;
+import com.java110.intf.community.IUnitInnerServiceSMO;
 import com.java110.intf.fee.IFeeAttrInnerServiceSMO;
-import com.java110.intf.fee.IFeeConfigInnerServiceSMO;
 import com.java110.intf.fee.IFeeInnerServiceSMO;
 import com.java110.intf.user.IOwnerCarInnerServiceSMO;
+import com.java110.intf.user.IOwnerInnerServiceSMO;
+import com.java110.intf.user.IOwnerRoomRelV1InnerServiceSMO;
+import com.java110.po.fee.FeeAttrPo;
 import com.java110.utils.cache.MappingCache;
 import com.java110.utils.exception.CmdException;
-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 com.java110.utils.util.*;
 import com.java110.vo.api.fee.ApiFeeDataVo;
 import com.java110.vo.api.fee.ApiFeeVo;
 import org.slf4j.Logger;
@@ -38,12 +44,13 @@
 import java.util.List;
 import java.util.Map;
 
+/**
+ * 鏌ヨ 璐圭敤淇℃伅
+ */
 @Java110Cmd(serviceCode = "fee.listFee")
 public class ListFeeCmd extends Cmd {
-    private static Logger logger = LoggerFactory.getLogger(ListFeeCmd.class);
 
-    @Autowired
-    private IFeeConfigInnerServiceSMO feeConfigInnerServiceSMOImpl;
+    private static Logger logger = LoggerFactory.getLogger(ListFeeCmd.class);
 
     @Autowired
     private IParkingSpaceInnerServiceSMO parkingSpaceInnerServiceSMOImpl;
@@ -59,6 +66,21 @@
 
     @Autowired
     private IComputeFeeSMO computeFeeSMOImpl;
+
+    @Autowired
+    private IFloorInnerServiceSMO floorInnerServiceSMOImpl;
+
+    @Autowired
+    private IUnitInnerServiceSMO unitInnerServiceSMOImpl;
+
+    @Autowired
+    private IRoomInnerServiceSMO roomInnerServiceSMOImpl;
+
+    @Autowired
+    private IOwnerRoomRelV1InnerServiceSMO ownerRoomRelV1InnerServiceSMOImpl;
+
+    @Autowired
+    private IOwnerInnerServiceSMO ownerInnerServiceSMOImpl;
 
     //鍩�
     public static final String DOMAIN_COMMON = "DOMAIN.COMMON";
@@ -80,13 +102,30 @@
 
     @Override
     public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
+        // todo 鎴垮眿鍚嶇О 鍒峰叆 鎴垮眿ID
+        freshPayerObjIdByRoomNum(reqJson);
 
         FeeDto feeDto = BeanConvertUtil.covertBean(reqJson, FeeDto.class);
 
-        int count = feeInnerServiceSMOImpl.queryFeesCount(feeDto);
+        // todo 澶勭悊 澶氫釜鎴垮眿
+        morePayerObjIds(reqJson, feeDto);
 
         List<ApiFeeDataVo> fees = new ArrayList<>();
-
+        if (reqJson.containsKey("ownerId") && !StringUtil.isEmpty(reqJson.getString("ownerId"))) {
+            OwnerRoomRelDto ownerRoomRelDto = new OwnerRoomRelDto();
+            ownerRoomRelDto.setRoomId(reqJson.getString("payerObjId"));
+            ownerRoomRelDto.setOwnerId(reqJson.getString("ownerId"));
+            List<OwnerRoomRelDto> ownerRoomRelDtos = ownerRoomRelV1InnerServiceSMOImpl.queryOwnerRoomRels(ownerRoomRelDto);
+            if (ownerRoomRelDtos == null || ownerRoomRelDtos.size() < 1) {
+                ApiFeeVo apiFeeVo = new ApiFeeVo();
+                apiFeeVo.setTotal(0);
+                apiFeeVo.setRecords((int) Math.ceil((double) 0 / (double) reqJson.getInteger("row")));
+                apiFeeVo.setFees(fees);
+                ResponseEntity<String> responseEntity = new ResponseEntity<String>(JSONObject.toJSONString(apiFeeVo), HttpStatus.OK);
+                cmdDataFlowContext.setResponseEntity(responseEntity);
+            }
+        }
+        int count = feeInnerServiceSMOImpl.queryFeesCount(feeDto);
         if (count > 0) {
             List<FeeDto> feeDtos = feeInnerServiceSMOImpl.queryFees(feeDto);//鏌ヨ璐圭敤椤圭洰
             computeFeePrice(feeDtos);//璁$畻璐圭敤
@@ -111,9 +150,112 @@
         cmdDataFlowContext.setResponseEntity(responseEntity);
     }
 
+    /**
+     * 澶勭悊 澶氬璞� 璐圭敤
+     *
+     * @param reqJson
+     * @param feeDto
+     */
+    private void morePayerObjIds(JSONObject reqJson, FeeDto feeDto) {
+        if (!reqJson.containsKey("payerObjIds") || StringUtil.isEmpty(reqJson.getString("payerObjIds"))) {
+            return;
+        }
+
+        String payerObjIds = reqJson.getString("payerObjIds");
+        feeDto.setPayerObjIds(payerObjIds.split(","));
+    }
+
+    /**
+     * 鏍规嵁鎴垮眿鍚嶇О 鍒峰叆 payerObjId
+     *
+     * @param reqJson
+     */
+    private void freshPayerObjIdByRoomNum(JSONObject reqJson) {
+        if (!reqJson.containsKey("roomNum") || StringUtil.isEmpty(reqJson.getString("roomNum"))) {
+            return;
+        }
+
+        String[] roomNums = reqJson.getString("roomNum").split("-", 3);
+        if (roomNums == null || roomNums.length != 3) {
+            throw new IllegalArgumentException("鎴垮眿缂栧彿鏍煎紡閿欒锛�");
+        }
+
+        String floorNum = roomNums[0];
+        String unitNum = roomNums[1];
+        String roomNum = roomNums[2];
+        FloorDto floorDto = new FloorDto();
+        floorDto.setFloorNum(floorNum);
+        floorDto.setCommunityId(reqJson.getString("communityId"));
+        List<FloorDto> floorDtos = floorInnerServiceSMOImpl.queryFloors(floorDto);
+        if (floorDtos == null || floorDtos.size() < 1) {
+            return;
+        }
+        for (FloorDto floor : floorDtos) {
+            UnitDto unitDto = new UnitDto();
+            unitDto.setFloorId(floor.getFloorId());
+            unitDto.setUnitNum(unitNum);
+            List<UnitDto> unitDtos = unitInnerServiceSMOImpl.queryUnits(unitDto);
+            if (unitDtos == null || unitDtos.size() < 1) {
+                continue;
+            }
+            for (UnitDto unit : unitDtos) {
+                RoomDto roomDto = new RoomDto();
+                roomDto.setUnitId(unit.getUnitId());
+                roomDto.setRoomNum(roomNum);
+                roomDto.setCommunityId(reqJson.getString("communityId"));
+                List<RoomDto> roomDtos = roomInnerServiceSMOImpl.queryRooms(roomDto);
+                Assert.listOnlyOne(roomDtos, "鏌ヨ涓嶅埌鎴垮眿锛�");
+                reqJson.put("payerObjId", roomDtos.get(0).getRoomId());
+            }
+        }
+    }
+
     private void freshFeeAttrs(List<ApiFeeDataVo> fees, List<FeeDto> feeDtos) {
+        String link = "";
         for (ApiFeeDataVo apiFeeDataVo : fees) {
             for (FeeDto feeDto : feeDtos) {
+                if (!StringUtil.isEmpty(feeDto.getPayerObjType()) && feeDto.getPayerObjType().equals("3333")) { //鎴垮眿
+                    OwnerRoomRelDto ownerRoomRelDto = new OwnerRoomRelDto();
+                    ownerRoomRelDto.setRoomId(feeDto.getPayerObjId());
+                    List<OwnerRoomRelDto> ownerRoomRelDtos = ownerRoomRelV1InnerServiceSMOImpl.queryOwnerRoomRels(ownerRoomRelDto);
+                    if (ownerRoomRelDtos != null && ownerRoomRelDtos.size() == 1) {
+                        OwnerDto ownerDto = new OwnerDto();
+                        ownerDto.setMemberId(ownerRoomRelDtos.get(0).getOwnerId());
+                        List<OwnerDto> ownerDtos = ownerInnerServiceSMOImpl.queryOwners(ownerDto);
+                        Assert.listOnlyOne(ownerDtos, "鏌ヨ涓氫富閿欒锛�");
+                        link = ownerDtos.get(0).getLink();
+                    } else {
+                        continue;
+                    }
+                } else if (!StringUtil.isEmpty(feeDto.getPayerObjType()) && feeDto.getPayerObjType().equals("6666")) {
+                    OwnerCarDto ownerCarDto = new OwnerCarDto();
+                    ownerCarDto.setCarId(feeDto.getPayerObjId());
+                    List<OwnerCarDto> ownerCarDtos = ownerCarInnerServiceSMOImpl.queryOwnerCars(ownerCarDto);
+                    Assert.listOnlyOne(ownerCarDtos, "鏌ヨ涓氫富杞﹁締琛ㄩ敊璇紒");
+                    OwnerDto ownerDto = new OwnerDto();
+                    ownerDto.setMemberId(ownerCarDtos.get(0).getOwnerId());
+                    List<OwnerDto> ownerDtos = ownerInnerServiceSMOImpl.queryOwners(ownerDto);
+                    Assert.listOnlyOne(ownerDtos, "鏌ヨ涓氫富閿欒锛�");
+                    link = ownerDtos.get(0).getLink();
+                }
+                FeeAttrDto feeAttrDto = new FeeAttrDto();
+                feeAttrDto.setFeeId(feeDto.getFeeId());
+                List<FeeAttrDto> feeAttrDtos = feeAttrInnerServiceSMOImpl.queryFeeAttrs(feeAttrDto);
+                if (feeAttrDtos != null || feeAttrDtos.size() > 0) {
+                    for (FeeAttrDto feeAttr : feeAttrDtos) {
+                        if (!StringUtil.isEmpty(feeAttr.getSpecCd()) && feeAttr.getSpecCd().equals("390009")) { //鑱旂郴鏂瑰紡
+                            if (!feeAttr.getValue().equals(link)) {
+                                FeeAttrPo feeAttrPo = new FeeAttrPo();
+                                feeAttrPo.setAttrId(feeAttr.getAttrId());
+                                feeAttrPo.setValue(link);
+                                int flag = feeAttrInnerServiceSMOImpl.updateFeeAttr(feeAttrPo);
+                                if (flag < 1) {
+                                    throw new CmdException("鏇存柊涓氫富鑱旂郴鏂瑰紡澶辫触");
+                                }
+                            }
+                        }
+                    }
+                }
                 if (apiFeeDataVo.getFeeId().equals(feeDto.getFeeId())) {
                     apiFeeDataVo.setFeeAttrs(feeDto.getFeeAttrDtos());
                 }
@@ -122,7 +264,6 @@
     }
 
     private void computeFeePrice(List<FeeDto> feeDtos) {
-
         if (feeDtos == null || feeDtos.size() < 1) {
             return;
         }
@@ -130,19 +271,16 @@
         if (StringUtil.isEmpty(val)) {
             val = MappingCache.getValue(DOMAIN_COMMON, TOTAL_FEE_PRICE);
         }
-
         //鍏堝彇鍗曞皬鍖虹殑濡傛灉娌℃湁閰嶇疆 鍙� 鍏ㄥ眬鐨�
         String received_amount_switch = CommunitySettingFactory.getValue(feeDtos.get(0).getCommunityId(), RECEIVED_AMOUNT_SWITCH);
         if (StringUtil.isEmpty(received_amount_switch)) {
             received_amount_switch = MappingCache.getValue(DOMAIN_COMMON, RECEIVED_AMOUNT_SWITCH);
         }
-
         //鍏堝彇鍗曞皬鍖虹殑濡傛灉娌℃湁閰嶇疆 鍙� 鍏ㄥ眬鐨�
         String offlinePayFeeSwitch = CommunitySettingFactory.getValue(feeDtos.get(0).getCommunityId(), OFFLINE_PAY_FEE_SWITCH);
         if (StringUtil.isEmpty(offlinePayFeeSwitch)) {
             offlinePayFeeSwitch = MappingCache.getValue(DOMAIN_COMMON, OFFLINE_PAY_FEE_SWITCH);
         }
-
         for (FeeDto feeDto : feeDtos) {
             try {
                 // 杞暟 * 鍛ㄦ湡 * 30 + 寮�濮嬫椂闂� = 鐩爣 鍒版湡鏃堕棿
@@ -158,7 +296,6 @@
                 } else if (FeeDto.PAYER_OBJ_TYPE_CONTRACT.equals(feeDto.getPayerObjType())) {//杞︿綅鐩稿叧
                     computeFeePriceByContract(feeDto, oweMonth);
                 }
-
                 feeDto.setVal(val);
                 //鍏抽棴 绾夸笅鏀堕摱鍔熻兘
                 if (StringUtil.isEmpty(received_amount_switch)) {
@@ -167,10 +304,12 @@
                     feeDto.setReceivedAmountSwitch(received_amount_switch);
                 }
                 feeDto.setOfflinePayFeeSwitch(offlinePayFeeSwitch);
-
             } catch (Exception e) {
                 logger.error("鏌ヨ璐圭敤淇℃伅 锛岃垂鐢ㄤ俊鎭敊璇�", e);
             }
+            //鍘绘帀澶氫綑0
+            feeDto.setSquarePrice(Double.parseDouble(feeDto.getSquarePrice()) + "");
+            feeDto.setAdditionalAmount(Double.parseDouble(feeDto.getAdditionalAmount()) + "");
         }
     }
 
@@ -195,7 +334,6 @@
         Map feePriceAll = computeFeeSMOImpl.getFeePrice(feeDto);
         feeDto.setFeePrice(Double.parseDouble(feePriceAll.get("feePrice").toString()));
         feeDto.setFeeTotalPrice(Double.parseDouble(feePriceAll.get("feeTotalPrice").toString()));
-
         BigDecimal curFeePrice = new BigDecimal(feeDto.getFeePrice());
         curFeePrice = curFeePrice.multiply(new BigDecimal(oweMonth));
         feeDto.setAmountOwed(df.format(curFeePrice));
@@ -206,6 +344,8 @@
             feeDto.setAmountOwed(df.format(curFeePrice));
             feeDto.setDeadlineTime(DateUtil.getCurrentDate());
         }
+        //鑰冭檻绉熼噾閫掑
+        computeFeeSMOImpl.dealRentRate(feeDto);
     }
 
     /**
@@ -215,122 +355,24 @@
      */
     private void computeFeePriceByRoom(FeeDto feeDto, double oweMonth) {
         String computingFormula = feeDto.getComputingFormula();
-        DecimalFormat df = new DecimalFormat("0.00");
         Map feePriceAll = computeFeeSMOImpl.getFeePrice(feeDto);
         feeDto.setFeePrice(Double.parseDouble(feePriceAll.get("feePrice").toString()));
-        feeDto.setFeeTotalPrice(Double.parseDouble(feePriceAll.get("feeTotalPrice").toString()));
+        //BigDecimal feeTotalPrice = new BigDecimal(Double.parseDouble(feePriceAll.get("feeTotalPrice").toString()));
+        feeDto.setFeeTotalPrice(MoneyUtil.computePriceScale(Double.parseDouble(feePriceAll.get("feeTotalPrice").toString()),
+                feeDto.getScale(),
+                Integer.parseInt(feeDto.getDecimalPlace())));
         BigDecimal curFeePrice = new BigDecimal(feeDto.getFeePrice());
         curFeePrice = curFeePrice.multiply(new BigDecimal(oweMonth));
-        feeDto.setAmountOwed((df.format(curFeePrice)));
+        feeDto.setAmountOwed(MoneyUtil.computePriceScale(curFeePrice.doubleValue(), feeDto.getScale(), Integer.parseInt(feeDto.getDecimalPlace())) + "");
         //鍔ㄦ�佽垂鐢�
         if ("4004".equals(computingFormula)
                 && FeeDto.FEE_FLAG_ONCE.equals(feeDto.getFeeFlag())
-                && !FeeDto.STATE_FINISH.equals(feeDto.getState())) {
-            feeDto.setAmountOwed(df.format(curFeePrice) + "");
+                && !FeeDto.STATE_FINISH.equals(feeDto.getState())
+                && feeDto.getDeadlineTime() == null) {
             feeDto.setDeadlineTime(DateUtil.getCurrentDate());
         }
-
         //鑰冭檻绉熼噾閫掑
-        dealRentRate(feeDto, oweMonth);
-
-    }
-
-    /**
-     * 绉熼噾澶勭悊
-     *
-     * @param feeDto
-     * @param oweMonth
-     */
-    private void dealRentRate(FeeDto feeDto, double oweMonth) {
-        if (!FeeConfigDto.COMPUTING_FORMULA_RANT_RATE.equals(feeDto.getComputingFormula())) {
-            return;
-        }
-
-        if (!FeeDto.STATE_DOING.equals(feeDto.getState())) {
-            return;
-        }
-
-        //鏌ヨ閫掑淇℃伅
-        FeeAttrDto feeAttrDto = new FeeAttrDto();
-        feeAttrDto.setFeeId(feeDto.getFeeId());
-        feeAttrDto.setCommunityId(feeDto.getCommunityId());
-        List<FeeAttrDto> feeAttrDtos = feeAttrInnerServiceSMOImpl.queryFeeAttrs(feeAttrDto);
-
-        if (feeAttrDtos == null || feeAttrDtos.size() < 1) {
-            return;
-        }
-        int rateCycle = 0;
-        double rate = 0.0;
-        Date rateStartTime = null;
-        try {
-            for (FeeAttrDto tmpFeeAttrDto : feeAttrDtos) {
-                if (FeeAttrDto.SPEC_CD_RATE.equals(tmpFeeAttrDto.getSpecCd())) {
-                    feeDto.setRate(tmpFeeAttrDto.getValue());
-                    rate = Double.parseDouble(tmpFeeAttrDto.getValue());
-                }
-                if (FeeAttrDto.SPEC_CD_RATE_CYCLE.equals(tmpFeeAttrDto.getSpecCd())) {
-                    feeDto.setRateCycle(tmpFeeAttrDto.getValue());
-                    rateCycle = Integer.parseInt(tmpFeeAttrDto.getValue());
-                }
-                if (FeeAttrDto.SPEC_CD_RATE_START_TIME.equals(tmpFeeAttrDto.getSpecCd())) {
-                    rateStartTime = DateUtil.getDateFromString(tmpFeeAttrDto.getValue(), DateUtil.DATE_FORMATE_STRING_B);
-                }
-            }
-        } catch (Exception e) {
-            logger.error("绉熼噾閫掑寮傚父", e);
-            return;
-        }
-
-        if (rateCycle == 0 || rate == 0) {
-            return;
-        }
-
-        if (feeDto.getDeadlineTime().getTime() <= rateStartTime.getTime()) {
-            return;
-        }
-
-        BigDecimal oweAmountDec = new BigDecimal(0);
-        //璁$畻 璁¤垂璧峰鏃堕棿 鍒� rateStartTime 鏃剁殑璐圭敤
-        double curOweMonth = 0;
-        BigDecimal curFeePrice = new BigDecimal(feeDto.getFeePrice());
-        if(feeDto.getEndTime().getTime() < rateStartTime.getTime()){
-            curOweMonth = computeFeeSMOImpl.dayCompare(feeDto.getEndTime(),rateStartTime);
-            oweAmountDec = curFeePrice.multiply(new BigDecimal(curOweMonth));
-        }
-
-         curOweMonth = computeFeeSMOImpl.dayCompare(rateStartTime,feeDto.getDeadlineTime());
-
-        double maxCycle = Math.floor(curOweMonth/rateCycle);
-
-        //鍩哄噯
-        BigDecimal firstAmount = curFeePrice.multiply(new BigDecimal(rateCycle));
-        BigDecimal preCycleAmount = firstAmount;
-        BigDecimal rateDec = null;
-        BigDecimal lastRateAmountDec = null;
-        double curCycle = 0;
-        for(int cycleIndex = 0; cycleIndex < maxCycle; maxCycle ++){
-            rateDec = preCycleAmount.multiply(new BigDecimal(rate));
-            //澧為暱鍛ㄦ湡鐨勫�嶆暟
-            curCycle = (cycleIndex +1) * rateCycle;
-            if(curCycle > curOweMonth){
-                rateDec = new BigDecimal(curOweMonth/rateCycle -Math.ceil(curOweMonth/rateCycle)).multiply(rateDec);
-                lastRateAmountDec = new BigDecimal(curOweMonth/rateCycle -Math.ceil(curOweMonth/rateCycle)).multiply(rateDec);
-                firstAmount = firstAmount.add(rateDec).add(preCycleAmount);
-                continue;
-            }
-            firstAmount = firstAmount.add(rateDec).add(preCycleAmount);
-            preCycleAmount = preCycleAmount.add(rateDec);
-        }
-        // 1.0 杩樻病鏈夊埌 閫掑寮�濮嬫椂闂�
-        //2.0 5.3 涓湀 24涓湀 涓�涓�掑鍛ㄦ湡
-        // 200 * 5.3 + 0.03 * (24 * 200) * (5.3/24)
-
-        // 200* 24
-
-
-
-
-
+        computeFeeSMOImpl.dealRentRate(feeDto);
 
     }
 
@@ -341,19 +383,22 @@
      */
     private void computeFeePriceByContract(FeeDto feeDto, double oweMonth) {
         String computingFormula = feeDto.getComputingFormula();
-        DecimalFormat df = new DecimalFormat("0.00");
         Map feePriceAll = computeFeeSMOImpl.getFeePrice(feeDto);
         feeDto.setFeePrice(Double.parseDouble(feePriceAll.get("feePrice").toString()));
-        feeDto.setFeeTotalPrice(Double.parseDouble(feePriceAll.get("feeTotalPrice").toString()));
+        feeDto.setFeeTotalPrice(MoneyUtil.computePriceScale(Double.parseDouble(feePriceAll.get("feeTotalPrice").toString()),
+                feeDto.getScale(),
+                Integer.parseInt(feeDto.getDecimalPlace())));
         BigDecimal curFeePrice = new BigDecimal(feeDto.getFeePrice());
         curFeePrice = curFeePrice.multiply(new BigDecimal(oweMonth));
-        feeDto.setAmountOwed(df.format(curFeePrice));
+        feeDto.setAmountOwed(MoneyUtil.computePriceScale(curFeePrice.doubleValue(), feeDto.getScale(), Integer.parseInt(feeDto.getDecimalPlace())) + "");
         //鍔ㄦ�佽垂鐢�
         if ("4004".equals(computingFormula)
                 && FeeDto.FEE_FLAG_ONCE.equals(feeDto.getFeeFlag())
                 && !FeeDto.STATE_FINISH.equals(feeDto.getState())) {
-            feeDto.setAmountOwed(df.format(curFeePrice) + "");
+            feeDto.setAmountOwed(MoneyUtil.computePriceScale(curFeePrice.doubleValue(), feeDto.getScale(), Integer.parseInt(feeDto.getDecimalPlace())) + "");
             feeDto.setDeadlineTime(DateUtil.getCurrentDate());
         }
+        //鑰冭檻绉熼噾閫掑
+        computeFeeSMOImpl.dealRentRate(feeDto);
     }
 }

--
Gitblit v1.8.0