java110 лет назад: 3
Родитель
Сommit
4d168e64cc

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

@@ -2198,16 +2198,16 @@ public class ComputeFeeSMOImpl implements IComputeFeeSMO {
         try {
         try {
             for (FeeAttrDto tmpFeeAttrDto : feeAttrDtos) {
             for (FeeAttrDto tmpFeeAttrDto : feeAttrDtos) {
                 if (FeeAttrDto.SPEC_CD_RATE.equals(tmpFeeAttrDto.getSpecCd())) {
                 if (FeeAttrDto.SPEC_CD_RATE.equals(tmpFeeAttrDto.getSpecCd())) {
-                    feeDto.setRate(tmpFeeAttrDto.getValue());
-                    rate = Double.parseDouble(tmpFeeAttrDto.getValue());
+                    feeDto.setRate(tmpFeeAttrDto.getValue().trim());
+                    rate = Double.parseDouble(tmpFeeAttrDto.getValue().trim());
                 }
                 }
                 if (FeeAttrDto.SPEC_CD_RATE_CYCLE.equals(tmpFeeAttrDto.getSpecCd())) {
                 if (FeeAttrDto.SPEC_CD_RATE_CYCLE.equals(tmpFeeAttrDto.getSpecCd())) {
-                    feeDto.setRateCycle(tmpFeeAttrDto.getValue());
-                    rateCycle = Integer.parseInt(tmpFeeAttrDto.getValue());
+                    feeDto.setRateCycle(tmpFeeAttrDto.getValue().trim());
+                    rateCycle = Integer.parseInt(tmpFeeAttrDto.getValue().trim());
                 }
                 }
                 if (FeeAttrDto.SPEC_CD_RATE_START_TIME.equals(tmpFeeAttrDto.getSpecCd())) {
                 if (FeeAttrDto.SPEC_CD_RATE_START_TIME.equals(tmpFeeAttrDto.getSpecCd())) {
-                    feeDto.setRateStartTime(tmpFeeAttrDto.getValue());
-                    rateStartTime = DateUtil.getDateFromString(tmpFeeAttrDto.getValue(), DateUtil.DATE_FORMATE_STRING_B);
+                    feeDto.setRateStartTime(tmpFeeAttrDto.getValue().trim());
+                    rateStartTime = DateUtil.getDateFromString(tmpFeeAttrDto.getValue().trim(), DateUtil.DATE_FORMATE_STRING_B);
                 }
                 }
             }
             }
         } catch (Exception e) {
         } catch (Exception e) {
@@ -2269,7 +2269,7 @@ public class ComputeFeeSMOImpl implements IComputeFeeSMO {
             //本期金额
             //本期金额
             curAmount = rateDec.add(preCycleAmount);// 增长部分 + 上本期费用
             curAmount = rateDec.add(preCycleAmount);// 增长部分 + 上本期费用
             //如果计费起始时间 大于 递增开始时间 那么本轮 不计入
             //如果计费起始时间 大于 递增开始时间 那么本轮 不计入
-            if(feeDto.getEndTime().getTime()< curEndTime.getTime()){
+            if(feeDto.getEndTime().getTime()<= curEndTime.getTime()){
                 addTotalAmount = addTotalAmount.add(curAmount); // 计入总的 费用中
                 addTotalAmount = addTotalAmount.add(curAmount); // 计入总的 费用中
             }
             }
             preCycleAmount = curAmount;
             preCycleAmount = curAmount;

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

@@ -20,7 +20,6 @@ import com.java110.intf.user.IOwnerCarInnerServiceSMO;
 import com.java110.intf.user.IOwnerInnerServiceSMO;
 import com.java110.intf.user.IOwnerInnerServiceSMO;
 import com.java110.utils.cache.MappingCache;
 import com.java110.utils.cache.MappingCache;
 import com.java110.utils.constant.ResponseConstant;
 import com.java110.utils.constant.ResponseConstant;
-import com.java110.utils.exception.CmdException;
 import com.java110.utils.exception.ListenerExecuteException;
 import com.java110.utils.exception.ListenerExecuteException;
 import com.java110.utils.util.Assert;
 import com.java110.utils.util.Assert;
 import com.java110.utils.util.DateUtil;
 import com.java110.utils.util.DateUtil;
@@ -34,9 +33,6 @@ import org.springframework.stereotype.Service;
 
 
 import java.math.BigDecimal;
 import java.math.BigDecimal;
 import java.math.RoundingMode;
 import java.math.RoundingMode;
-import java.text.ParseException;
-import java.time.LocalDate;
-import java.time.format.DateTimeFormatter;
 import java.util.*;
 import java.util.*;
 
 
 @Service
 @Service
@@ -184,13 +180,10 @@ public class QueryOweFeeImpl implements IQueryOweFee {
         feeDto.setFeePrice(Double.parseDouble(feePriceAll.get("feePrice").toString()));
         feeDto.setFeePrice(Double.parseDouble(feePriceAll.get("feePrice").toString()));
         feeDto.setFeeTotalPrice(Double.parseDouble(feePriceAll.get("feeTotalPrice").toString()));
         feeDto.setFeeTotalPrice(Double.parseDouble(feePriceAll.get("feeTotalPrice").toString()));
 
 
-        if(!StringUtil.isEmpty(custEndTime)){
-            try {
-                computeFeeSMOImpl.dealRentRateCustEndTime(feeDto, DateUtil.getDateFromString(custEndTime,DateUtil.DATE_FORMATE_STRING_B));
-            } catch (Exception e) {
-                throw new CmdException("计算费用失败"+e);
-            }
-        }else {
+        if (!StringUtil.isEmpty(custEndTime)) {
+            Date date = DateUtil.getDateFromStringB(custEndTime);
+            computeFeeSMOImpl.dealRentRateCustEndTime(feeDto, date);
+        } else {
             computeFeeSMOImpl.dealRentRateCycle(feeDto, NumberUtil.getDouble(feeDto.getCycle()));
             computeFeeSMOImpl.dealRentRateCycle(feeDto, NumberUtil.getDouble(feeDto.getCycle()));
         }
         }
 
 
@@ -463,7 +456,7 @@ public class QueryOweFeeImpl implements IQueryOweFee {
             feePrice = 0.0;
             feePrice = 0.0;
         } else if ("1101".equals(computingFormula)) { // 租金
         } else if ("1101".equals(computingFormula)) { // 租金
             feePrice = 0.0;
             feePrice = 0.0;
-        }else if ("1102".equals(computingFormula)) { // 租金
+        } else if ("1102".equals(computingFormula)) { // 租金
             feePrice = 0.0;
             feePrice = 0.0;
         } else if ("4004".equals(computingFormula)) {
         } else if ("4004".equals(computingFormula)) {
             feePrice = Double.parseDouble(feeDto.getAmount());
             feePrice = Double.parseDouble(feeDto.getAmount());
@@ -587,7 +580,7 @@ public class QueryOweFeeImpl implements IQueryOweFee {
         } else if ("1102".equals(computingFormula)) { // 租金
         } else if ("1102".equals(computingFormula)) { // 租金
             BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(tmpRoomDto.getRoomRent()));
             BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(tmpRoomDto.getRoomRent()));
             feePrice = additionalAmount.setScale(3, BigDecimal.ROUND_HALF_EVEN).doubleValue();
             feePrice = additionalAmount.setScale(3, BigDecimal.ROUND_HALF_EVEN).doubleValue();
-        }else if ("4004".equals(computingFormula)) {
+        } else if ("4004".equals(computingFormula)) {
             feePrice = Double.parseDouble(feeDto.getAmount());
             feePrice = Double.parseDouble(feeDto.getAmount());
         } else if ("5005".equals(computingFormula)) {
         } else if ("5005".equals(computingFormula)) {