wuxw 3 år sedan
förälder
incheckning
50ab08df95

+ 13 - 6
service-fee/src/main/java/com/java110/fee/bmo/impl/QueryOweFeeImpl.java

@@ -21,10 +21,7 @@ import com.java110.intf.user.IOwnerInnerServiceSMO;
 import com.java110.utils.cache.MappingCache;
 import com.java110.utils.constant.ResponseConstant;
 import com.java110.utils.exception.ListenerExecuteException;
-import com.java110.utils.util.Assert;
-import com.java110.utils.util.DateUtil;
-import com.java110.utils.util.NumberUtil;
-import com.java110.utils.util.StringUtil;
+import com.java110.utils.util.*;
 import com.java110.vo.ResultVo;
 import org.slf4j.Logger;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -183,7 +180,14 @@ public class QueryOweFeeImpl implements IQueryOweFee {
         }
         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())
+                )
+        );
 
         if (!StringUtil.isEmpty(custEndTime)) {
             Date date = DateUtil.getDateFromStringB(custEndTime);
@@ -217,6 +221,9 @@ public class QueryOweFeeImpl implements IQueryOweFee {
             offlinePayFeeSwitch = MappingCache.getValue(DOMAIN_COMMON, OFFLINE_PAY_FEE_SWITCH);
         }
         feeDto.setOfflinePayFeeSwitch(offlinePayFeeSwitch);
+        //去掉多余0
+        feeDto.setSquarePrice(Double.parseDouble(feeDto.getSquarePrice()) + "");
+        feeDto.setAdditionalAmount(Double.parseDouble(feeDto.getAdditionalAmount()) + "");
         return ResultVo.createResponseEntity(feeDto);
     }
 
@@ -504,7 +511,7 @@ public class QueryOweFeeImpl implements IQueryOweFee {
         //动态费用
         if ("4004".equals(computingFormula)
                 && FeeDto.FEE_FLAG_ONCE.equals(feeDto.getFeeFlag())
-        ) {
+                ) {
             feeDto.setAmountOwed(feeDto.getFeePrice() + "");
             feeDto.setDeadlineTime(DateUtil.getCurrentDate());
         }

+ 4 - 0
service-fee/src/main/java/com/java110/fee/cmd/fee/ListFeeCmd.java

@@ -230,6 +230,10 @@ public class ListFeeCmd extends Cmd {
             } catch (Exception e) {
                 logger.error("查询费用信息 ,费用信息错误", e);
             }
+
+            //去掉多余0
+            feeDto.setSquarePrice(Double.parseDouble(feeDto.getSquarePrice()) + "");
+            feeDto.setAdditionalAmount(Double.parseDouble(feeDto.getAdditionalAmount())+"");
         }
     }