java110 před 3 roky
rodič
revize
b8941e102a

+ 22 - 0
java110-utils/src/main/java/com/java110/utils/util/NumberUtil.java

@@ -0,0 +1,22 @@
+package com.java110.utils.util;
+
+public class NumberUtil {
+
+    public static boolean isDouble(String var) {
+        try {
+            Double.parseDouble(var);
+        } catch (Exception e) {
+            return false;
+        }
+
+        return true;
+    }
+
+    public static double getDouble(String var) {
+        try {
+            return Double.parseDouble(var);
+        } catch (Exception e) {
+            return 0;
+        }
+    }
+}

+ 2 - 1
service-fee/src/main/java/com/java110/fee/bmo/impl/QueryOweFeeImpl.java

@@ -23,6 +23,7 @@ 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.vo.ResultVo;
 import org.slf4j.Logger;
@@ -181,7 +182,7 @@ public class QueryOweFeeImpl implements IQueryOweFee {
         feeDto.setFeePrice(Double.parseDouble(feePriceAll.get("feePrice").toString()));
         feeDto.setFeeTotalPrice(Double.parseDouble(feePriceAll.get("feeTotalPrice").toString()));
 
-        computeFeeSMOImpl.dealRentRateCycle(feeDto,Double.parseDouble(feeDto.getCycle()));
+        computeFeeSMOImpl.dealRentRateCycle(feeDto, NumberUtil.getDouble(feeDto.getCycle()));
         //应收款取值
         //先取单小区的如果没有配置 取 全局的
         String val = CommunitySettingFactory.getValue(feeDto.getCommunityId(), TOTAL_FEE_PRICE);