From 57a5852abc270a4d24a5e8655d4caa8ce9d016b3 Mon Sep 17 00:00:00 2001
From: java110 <928255095@qq.com>
Date: 星期五, 03 九月 2021 01:19:45 +0800
Subject: [PATCH] 优化代码
---
java110-core/src/main/java/com/java110/core/smo/impl/ComputeFeeSMOImpl.java | 171 ++++++++++++++++++++++++++++++++++++++++++++++++++------
1 files changed, 152 insertions(+), 19 deletions(-)
diff --git a/java110-core/src/main/java/com/java110/core/smo/impl/ComputeFeeSMOImpl.java b/java110-core/src/main/java/com/java110/core/smo/impl/ComputeFeeSMOImpl.java
index b413d37..27cece5 100755
--- a/java110-core/src/main/java/com/java110/core/smo/impl/ComputeFeeSMOImpl.java
+++ b/java110-core/src/main/java/com/java110/core/smo/impl/ComputeFeeSMOImpl.java
@@ -158,9 +158,9 @@
}
String computingFormula = feeDto.getComputingFormula();
- double feePrice = getFeePrice(feeDto);
+ Map feePriceAll = getFeePrice(feeDto);
- feeDto.setFeePrice(feePrice);
+ feeDto.setFeePrice(Double.parseDouble(feePriceAll.get("feePrice").toString()));
BigDecimal price = new BigDecimal(feeDto.getFeePrice());
price = price.multiply(new BigDecimal(oweMonth));
feeDto.setFeePrice(price.setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
@@ -187,8 +187,8 @@
double oweMonth = (double) targetEndDateAndOweMonth.get("oweMonth");
String computingFormula = feeDto.getComputingFormula();
- double feePrice = getFeePrice(feeDto, roomDto);
- feeDto.setFeePrice(feePrice);
+ Map feePriceAll = getFeePrice(feeDto, roomDto);
+ feeDto.setFeePrice(Double.parseDouble(feePriceAll.get("feePrice").toString()));
//double month = dayCompare(feeDto.getEndTime(), DateUtil.getCurrentDate());
BigDecimal price = new BigDecimal(feeDto.getFeePrice());
price = price.multiply(new BigDecimal(oweMonth));
@@ -215,8 +215,8 @@
double oweMonth = (double) targetEndDateAndOweMonth.get("oweMonth");
String computingFormula = feeDto.getComputingFormula();
- double feePrice = getFeePrice(feeDto, roomDto);
- feeDto.setFeePrice(feePrice);
+ Map feePriceAll = getFeePrice(feeDto, roomDto);
+ feeDto.setFeePrice(Double.parseDouble(feePriceAll.get("feePrice").toString()));
//double month = dayCompare(feeDto.getEndTime(), DateUtil.getCurrentDate());
BigDecimal price = new BigDecimal(feeDto.getFeePrice());
price = price.multiply(new BigDecimal(oweMonth));
@@ -262,7 +262,7 @@
} else if ("1101".equals(computingFormula)) { // 绉熼噾
feeReceiptDetailPo.setArea("");
feeReceiptDetailPo.setSquarePrice(roomDto.getRoomRent());
- }else if ("4004".equals(computingFormula)) {
+ } else if ("4004".equals(computingFormula)) {
} else if ("5005".equals(computingFormula)) {
if (StringUtil.isEmpty(feeDto.getCurDegrees())) {
} else {
@@ -322,7 +322,7 @@
} else if ("1101".equals(computingFormula)) { // 绉熼噾
feeReceiptDetailPo.setArea("");
feeReceiptDetailPo.setSquarePrice("0");
- }else if ("4004".equals(computingFormula)) {
+ } else if ("4004".equals(computingFormula)) {
} else if ("5005".equals(computingFormula)) {
if (StringUtil.isEmpty(feeDto.getCurDegrees())) {
} else {
@@ -399,7 +399,7 @@
}
feeReceiptDetailPo.setArea(builtUpArea.doubleValue() + "");
feeReceiptDetailPo.setSquarePrice(feeDto.getSquarePrice() + "/" + feeDto.getAdditionalAmount());
- }else if ("4004".equals(computingFormula)) {
+ } else if ("4004".equals(computingFormula)) {
} else if ("5005".equals(computingFormula)) {
if (StringUtil.isEmpty(feeDto.getCurDegrees())) {
} else {
@@ -789,7 +789,7 @@
} else if ("1101".equals(computingFormula)) { // 绉熼噾
BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(tmpReportFeeDto.getRoomRent()));
feePrice = additionalAmount.setScale(3, BigDecimal.ROUND_HALF_EVEN);
- }else if ("4004".equals(computingFormula)) {
+ } else if ("4004".equals(computingFormula)) {
feePrice = new BigDecimal(Double.parseDouble(tmpReportFeeDto.getAmount()));
} else if ("5005".equals(computingFormula)) {
if (StringUtil.isEmpty(tmpReportFeeDto.getCurDegrees())) {
@@ -841,7 +841,7 @@
feePrice = new BigDecimal(0);
} else if ("1101".equals(computingFormula)) { // 绉熼噾
feePrice = new BigDecimal(0);
- }else if ("4004".equals(computingFormula)) {
+ } else if ("4004".equals(computingFormula)) {
feePrice = new BigDecimal(Double.parseDouble(tmpReportFeeDto.getAmount()));
} else if ("5005".equals(computingFormula)) {
if (StringUtil.isEmpty(tmpReportFeeDto.getCurDegrees())) {
@@ -881,13 +881,15 @@
}
@Override
- public double getFeePrice(FeeDto feeDto) {
+ public Map getFeePrice(FeeDto feeDto) {
return getFeePrice(feeDto, null);
}
@Override
- public double getFeePrice(FeeDto feeDto, RoomDto roomDto) {
- BigDecimal feePrice = new BigDecimal(0.0);
+ public Map getFeePrice(FeeDto feeDto, RoomDto roomDto) {
+ BigDecimal feePrice = new BigDecimal("0.0");
+ BigDecimal feeTotalPrice = new BigDecimal(0.0);
+ Map<String, Object> feeAmount = new HashMap<>();
if (FeeDto.PAYER_OBJ_TYPE_ROOM.equals(feeDto.getPayerObjType())) { //鎴垮眿鐩稿叧
String computingFormula = feeDto.getComputingFormula();
if (roomDto == null) {
@@ -896,7 +898,7 @@
roomDto.setCommunityId(feeDto.getCommunityId());
List<RoomDto> roomDtos = roomInnerServiceSMOImpl.queryRooms(roomDto);
if (roomDtos == null || roomDtos.size() != 1) {
- throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_ERROR, "鏈煡鍒版埧灞嬩俊鎭紝鏌ヨ澶氭潯鏁版嵁");
+ throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_ERROR, "鏈煡鍒版埧灞嬩俊鎭紝鏌ヨ澶氭潯鏁版嵁 roomId=" + feeDto.getPayerObjId());
}
roomDto = roomDtos.get(0);
}
@@ -906,20 +908,41 @@
BigDecimal builtUpArea = new BigDecimal(Double.parseDouble(roomDto.getBuiltUpArea()));
BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(feeDto.getAdditionalAmount()));
feePrice = squarePrice.multiply(builtUpArea).add(additionalAmount).setScale(3, BigDecimal.ROUND_HALF_EVEN);
+ if (!StringUtil.isEmpty(feeDto.getCycle())) {
+ BigDecimal cycle = new BigDecimal(feeDto.getCycle());
+ feeTotalPrice = (squarePrice.multiply(builtUpArea).add(additionalAmount)).multiply(cycle).setScale(3, BigDecimal.ROUND_DOWN);
+ }
} else if ("2002".equals(computingFormula)) { // 鍥哄畾璐圭敤
//feePrice = Double.parseDouble(feeDto.getAdditionalAmount());
BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(feeDto.getAdditionalAmount()));
feePrice = additionalAmount.setScale(3, BigDecimal.ROUND_HALF_EVEN);
+ if (!StringUtil.isEmpty(feeDto.getCycle())) {
+ BigDecimal cycle1 = new BigDecimal(feeDto.getCycle());
+ feeTotalPrice = additionalAmount.multiply(cycle1).setScale(3, BigDecimal.ROUND_DOWN);
+ }
} else if ("3003".equals(computingFormula)) { // 鍥哄畾璐圭敤
BigDecimal squarePrice = new BigDecimal(Double.parseDouble(feeDto.getSquarePrice()));
BigDecimal builtUpArea = new BigDecimal(Double.parseDouble(roomDto.getRoomArea()));
BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(feeDto.getAdditionalAmount()));
feePrice = squarePrice.multiply(builtUpArea).add(additionalAmount).setScale(3, BigDecimal.ROUND_HALF_EVEN);
+ if (!StringUtil.isEmpty(feeDto.getCycle())) {
+ BigDecimal cycle1 = new BigDecimal(feeDto.getCycle());
+ feeTotalPrice = (squarePrice.multiply(builtUpArea).add(additionalAmount)).multiply(cycle1).setScale(3, BigDecimal.ROUND_DOWN);
+ }
} else if ("1101".equals(computingFormula)) { // 绉熼噾
BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(roomDto.getRoomRent()));
feePrice = additionalAmount.setScale(3, BigDecimal.ROUND_HALF_EVEN);
+ if (!StringUtil.isEmpty(feeDto.getCycle())) {
+ BigDecimal cycle1 = new BigDecimal(feeDto.getCycle());
+ feeTotalPrice = additionalAmount.multiply(cycle1).setScale(3, BigDecimal.ROUND_DOWN);
+ }
} else if ("4004".equals(computingFormula)) { //鍔ㄦ�佽垂鐢�
feePrice = new BigDecimal(Double.parseDouble(feeDto.getAmount()));
+ if (!StringUtil.isEmpty(feeDto.getCycle())) {
+ BigDecimal cycle1 = new BigDecimal(feeDto.getCycle());
+ BigDecimal amount = new BigDecimal(feeDto.getAmount());
+ feeTotalPrice = amount.multiply(cycle1).setScale(3, BigDecimal.ROUND_DOWN);
+ }
} else if ("5005".equals(computingFormula)) { //(鏈湡搴︽暟-涓婃湡搴︽暟)*鍗曚环+闄勫姞璐�
if (StringUtil.isEmpty(feeDto.getCurDegrees())) {
//throw new IllegalArgumentException("鎶勮〃鏁版嵁寮傚父");
@@ -932,13 +955,32 @@
feePrice = sub.multiply(squarePrice)
.add(additionalAmount)
.setScale(2, BigDecimal.ROUND_HALF_EVEN);
+
+ if (!StringUtil.isEmpty(feeDto.getCycle())) {
+ BigDecimal cycle1 = new BigDecimal(feeDto.getCycle());
+ feeTotalPrice = (sub.multiply(squarePrice).add(additionalAmount)).multiply(cycle1).setScale(3, BigDecimal.ROUND_DOWN);
+ }
}
} else if ("6006".equals(computingFormula)) {
feePrice = new BigDecimal(Double.parseDouble(feeDto.getAmount()));
+ if (!StringUtil.isEmpty(feeDto.getCycle())) {
+ BigDecimal cycle1 = new BigDecimal(feeDto.getCycle());
+ BigDecimal amount = new BigDecimal(feeDto.getAmount());
+ feeTotalPrice = amount.multiply(cycle1).setScale(3, BigDecimal.ROUND_DOWN);
+ }
} else if ("7007".equals(computingFormula)) { //鑷畾涔夊叕寮�
feePrice = computeRoomCustomizeFormula(feeDto, roomDto);
+ if (!StringUtil.isEmpty(feeDto.getCycle())) {
+ BigDecimal cycle1 = new BigDecimal(feeDto.getCycle());
+ feeTotalPrice = feePrice.multiply(cycle1).setScale(3, BigDecimal.ROUND_DOWN);
+ }
} else if ("8008".equals(computingFormula)) { //鎵嬪姩鍔ㄦ�佽垂鐢�
feePrice = new BigDecimal(Double.parseDouble(feeDto.getAmount()));
+ if (!StringUtil.isEmpty(feeDto.getCycle())) {
+ BigDecimal cycle1 = new BigDecimal(feeDto.getCycle());
+ BigDecimal amount = new BigDecimal(feeDto.getAmount());
+ feeTotalPrice = amount.multiply(cycle1).setScale(3, BigDecimal.ROUND_DOWN);
+ }
} else if ("9009".equals(computingFormula)) { //(鏈湡搴︽暟-涓婃湡搴︽暟)*鍔ㄦ�佸崟浠�+闄勫姞璐�
if (StringUtil.isEmpty(feeDto.getCurDegrees())) {
//throw new IllegalArgumentException("鎶勮〃鏁版嵁寮傚父");
@@ -951,6 +993,10 @@
feePrice = sub.multiply(squarePrice)
.add(additionalAmount)
.setScale(2, BigDecimal.ROUND_HALF_EVEN);
+ if (!StringUtil.isEmpty(feeDto.getCycle())) {
+ BigDecimal cycle1 = new BigDecimal(feeDto.getCycle());
+ feeTotalPrice = (sub.multiply(squarePrice).add(additionalAmount)).multiply(cycle1).setScale(3, BigDecimal.ROUND_DOWN);
+ }
}
} else {
throw new IllegalArgumentException("鏆備笉鏀寔璇ョ被鍏紡");
@@ -959,6 +1005,7 @@
String computingFormula = feeDto.getComputingFormula();
OwnerCarDto ownerCarDto = new OwnerCarDto();
+ ownerCarDto.setCarTypeCd("1001"); //涓氫富杞﹁締
ownerCarDto.setCommunityId(feeDto.getCommunityId());
ownerCarDto.setCarId(feeDto.getPayerObjId());
List<OwnerCarDto> ownerCarDtos = ownerCarInnerServiceSMOImpl.queryOwnerCars(ownerCarDto);
@@ -975,20 +1022,41 @@
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);
+ if (!StringUtil.isEmpty(feeDto.getCycle())) {
+ BigDecimal cycle1 = new BigDecimal(feeDto.getCycle());
+ feeTotalPrice = (squarePrice.multiply(builtUpArea).add(additionalAmount)).multiply(cycle1).setScale(3, BigDecimal.ROUND_DOWN);
+ }
} 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);
+ if (!StringUtil.isEmpty(feeDto.getCycle())) {
+ BigDecimal cycle1 = new BigDecimal(feeDto.getCycle());
+ feeTotalPrice = additionalAmount.multiply(cycle1).setScale(3, BigDecimal.ROUND_DOWN);
+ }
} else if ("3003".equals(computingFormula)) { // 鍥哄畾璐圭敤
BigDecimal squarePrice = new BigDecimal(Double.parseDouble(feeDto.getSquarePrice()));
BigDecimal builtUpArea = new BigDecimal(Double.parseDouble(roomDto.getRoomArea()));
BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(feeDto.getAdditionalAmount()));
feePrice = squarePrice.multiply(builtUpArea).add(additionalAmount).setScale(3, BigDecimal.ROUND_HALF_EVEN);
+ if (!StringUtil.isEmpty(feeDto.getCycle())) {
+ BigDecimal cycle1 = new BigDecimal(feeDto.getCycle());
+ feeTotalPrice = (squarePrice.multiply(builtUpArea).add(additionalAmount)).multiply(cycle1).setScale(3, BigDecimal.ROUND_DOWN);
+ }
} else if ("1101".equals(computingFormula)) { // 绉熼噾
BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(roomDto.getRoomRent()));
feePrice = additionalAmount.setScale(3, BigDecimal.ROUND_HALF_EVEN);
- }else if ("4004".equals(computingFormula)) {
+ if (!StringUtil.isEmpty(feeDto.getCycle())) {
+ BigDecimal cycle1 = new BigDecimal(feeDto.getCycle());
+ feeTotalPrice = additionalAmount.multiply(cycle1).setScale(3, BigDecimal.ROUND_DOWN);
+ }
+ } else if ("4004".equals(computingFormula)) {
feePrice = new BigDecimal(Double.parseDouble(feeDto.getAmount()));
+ if (!StringUtil.isEmpty(feeDto.getCycle())) {
+ BigDecimal cycle1 = new BigDecimal(feeDto.getCycle());
+ BigDecimal amount = new BigDecimal(feeDto.getAmount());
+ feeTotalPrice = amount.multiply(cycle1).setScale(3, BigDecimal.ROUND_DOWN);
+ }
} else if ("5005".equals(computingFormula)) {
if (StringUtil.isEmpty(feeDto.getCurDegrees())) {
throw new IllegalArgumentException("鎶勮〃鏁版嵁寮傚父");
@@ -1001,11 +1069,24 @@
feePrice = sub.multiply(squarePrice)
.add(additionalAmount)
.setScale(2, BigDecimal.ROUND_HALF_EVEN);
+ if (!StringUtil.isEmpty(feeDto.getCycle())) {
+ BigDecimal cycle1 = new BigDecimal(feeDto.getCycle());
+ feeTotalPrice = (sub.multiply(squarePrice).add(additionalAmount)).multiply(cycle1).setScale(3, BigDecimal.ROUND_DOWN);
+ }
}
} else if ("6006".equals(computingFormula)) {
feePrice = new BigDecimal(Double.parseDouble(feeDto.getAmount()));
+ if (!StringUtil.isEmpty(feeDto.getCycle())) {
+ BigDecimal cycle1 = new BigDecimal(feeDto.getCycle());
+ BigDecimal amount = new BigDecimal(feeDto.getAmount());
+ feeTotalPrice = amount.multiply(cycle1).setScale(3, BigDecimal.ROUND_DOWN);
+ }
} else if ("7007".equals(computingFormula)) { //鑷畾涔夊叕寮�
feePrice = computeCarCustomizeFormula(feeDto, ownerCarDtos.get(0));
+ if (!StringUtil.isEmpty(feeDto.getCycle())) {
+ BigDecimal cycle1 = new BigDecimal(feeDto.getCycle());
+ feeTotalPrice = feePrice.multiply(cycle1).setScale(3, BigDecimal.ROUND_DOWN);
+ }
} else if ("9009".equals(computingFormula)) { //(鏈湡搴︽暟-涓婃湡搴︽暟)*鍔ㄦ�佸崟浠�+闄勫姞璐�
if (StringUtil.isEmpty(feeDto.getCurDegrees())) {
//throw new IllegalArgumentException("鎶勮〃鏁版嵁寮傚父");
@@ -1018,6 +1099,10 @@
feePrice = sub.multiply(squarePrice)
.add(additionalAmount)
.setScale(2, BigDecimal.ROUND_HALF_EVEN);
+ if (!StringUtil.isEmpty(feeDto.getCycle())) {
+ BigDecimal cycle1 = new BigDecimal(feeDto.getCycle());
+ feeTotalPrice = (sub.multiply(squarePrice).add(additionalAmount)).multiply(cycle1).setScale(3, BigDecimal.ROUND_DOWN);
+ }
}
} else {
throw new IllegalArgumentException("鏆備笉鏀寔璇ョ被鍏紡");
@@ -1041,22 +1126,43 @@
feeDto.setBuiltUpArea(builtUpArea.doubleValue() + "");
BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(feeDto.getAdditionalAmount()));
feePrice = squarePrice.multiply(builtUpArea).add(additionalAmount).setScale(3, BigDecimal.ROUND_HALF_EVEN);
+ if (!StringUtil.isEmpty(feeDto.getCycle())) {
+ BigDecimal cycle1 = new BigDecimal(feeDto.getCycle());
+ feeTotalPrice = (squarePrice.multiply(builtUpArea).add(additionalAmount)).multiply(cycle1).setScale(3, BigDecimal.ROUND_DOWN);
+ }
} else if ("2002".equals(computingFormula)) { // 鍥哄畾璐圭敤
//feePrice = Double.parseDouble(feeDto.getAdditionalAmount());
BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(feeDto.getAdditionalAmount()));
// BigDecimal roomDount = new BigDecimal(contractRoomDtos.size());
// additionalAmount = additionalAmount.multiply(roomDount);
feePrice = additionalAmount.setScale(3, BigDecimal.ROUND_HALF_EVEN);
+ if (!StringUtil.isEmpty(feeDto.getCycle())) {
+ BigDecimal cycle1 = new BigDecimal(feeDto.getCycle());
+ feeTotalPrice = additionalAmount.multiply(cycle1).setScale(3, BigDecimal.ROUND_DOWN);
+ }
} else if ("3003".equals(computingFormula)) { // 鍥哄畾璐圭敤
BigDecimal squarePrice = new BigDecimal(Double.parseDouble(feeDto.getSquarePrice()));
BigDecimal builtUpArea = new BigDecimal(Double.parseDouble(roomDto.getRoomArea()));
BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(feeDto.getAdditionalAmount()));
feePrice = squarePrice.multiply(builtUpArea).add(additionalAmount).setScale(3, BigDecimal.ROUND_HALF_EVEN);
+ if (!StringUtil.isEmpty(feeDto.getCycle())) {
+ BigDecimal cycle1 = new BigDecimal(feeDto.getCycle());
+ feeTotalPrice = (squarePrice.multiply(builtUpArea).add(additionalAmount)).multiply(cycle1).setScale(3, BigDecimal.ROUND_DOWN);
+ }
} else if ("1101".equals(computingFormula)) { // 绉熼噾
BigDecimal additionalAmount = new BigDecimal(Double.parseDouble(roomDto.getRoomRent()));
feePrice = additionalAmount.setScale(3, BigDecimal.ROUND_HALF_EVEN);
- }else if ("4004".equals(computingFormula)) { //鍔ㄦ�佽垂鐢�
+ if (!StringUtil.isEmpty(feeDto.getCycle())) {
+ BigDecimal cycle1 = new BigDecimal(feeDto.getCycle());
+ feeTotalPrice = additionalAmount.multiply(cycle1).setScale(3, BigDecimal.ROUND_DOWN);
+ }
+ } else if ("4004".equals(computingFormula)) { //鍔ㄦ�佽垂鐢�
feePrice = new BigDecimal(Double.parseDouble(feeDto.getAmount()));
+ if (!StringUtil.isEmpty(feeDto.getCycle())) {
+ BigDecimal cycle1 = new BigDecimal(feeDto.getCycle());
+ BigDecimal amount = new BigDecimal(feeDto.getAmount());
+ feeTotalPrice = amount.multiply(cycle1).setScale(3, BigDecimal.ROUND_DOWN);
+ }
} else if ("5005".equals(computingFormula)) { //(鏈湡搴︽暟-涓婃湡搴︽暟)*鍗曚环+闄勫姞璐�
if (StringUtil.isEmpty(feeDto.getCurDegrees())) {
//throw new IllegalArgumentException("鎶勮〃鏁版嵁寮傚父");
@@ -1069,13 +1175,31 @@
feePrice = sub.multiply(squarePrice)
.add(additionalAmount)
.setScale(2, BigDecimal.ROUND_HALF_EVEN);
+ if (!StringUtil.isEmpty(feeDto.getCycle())) {
+ BigDecimal cycle1 = new BigDecimal(feeDto.getCycle());
+ feeTotalPrice = (sub.multiply(squarePrice).add(additionalAmount)).multiply(cycle1).setScale(3, BigDecimal.ROUND_DOWN);
+ }
}
} else if ("6006".equals(computingFormula)) {
feePrice = new BigDecimal(Double.parseDouble(feeDto.getAmount()));
+ if (!StringUtil.isEmpty(feeDto.getCycle())) {
+ BigDecimal cycle1 = new BigDecimal(feeDto.getCycle());
+ BigDecimal amount = new BigDecimal(feeDto.getAmount());
+ feeTotalPrice = amount.multiply(cycle1).setScale(3, BigDecimal.ROUND_DOWN);
+ }
} else if ("7007".equals(computingFormula)) { //鑷畾涔夊叕寮�
feePrice = computeContractCustomizeFormula(feeDto, contractRoomDtos);
+ if (!StringUtil.isEmpty(feeDto.getCycle())) {
+ BigDecimal cycle1 = new BigDecimal(feeDto.getCycle());
+ feeTotalPrice = feePrice.multiply(cycle1).setScale(3, BigDecimal.ROUND_DOWN);
+ }
} else if ("8008".equals(computingFormula)) { //鎵嬪姩鍔ㄦ�佽垂鐢�
feePrice = new BigDecimal(Double.parseDouble(feeDto.getAmount()));
+ if (!StringUtil.isEmpty(feeDto.getCycle())) {
+ BigDecimal cycle1 = new BigDecimal(feeDto.getCycle());
+ BigDecimal amount = new BigDecimal(feeDto.getAmount());
+ feeTotalPrice = amount.multiply(cycle1).setScale(3, BigDecimal.ROUND_DOWN);
+ }
} else if ("9009".equals(computingFormula)) { //(鏈湡搴︽暟-涓婃湡搴︽暟)*鍔ㄦ�佸崟浠�+闄勫姞璐�
if (StringUtil.isEmpty(feeDto.getCurDegrees())) {
//throw new IllegalArgumentException("鎶勮〃鏁版嵁寮傚父");
@@ -1088,12 +1212,19 @@
feePrice = sub.multiply(squarePrice)
.add(additionalAmount)
.setScale(2, BigDecimal.ROUND_HALF_EVEN);
+ if (!StringUtil.isEmpty(feeDto.getCycle())) {
+ BigDecimal cycle1 = new BigDecimal(feeDto.getCycle());
+ feeTotalPrice = sub.multiply(squarePrice).add(additionalAmount).multiply(cycle1).setScale(3, BigDecimal.ROUND_DOWN);
+ }
}
} else {
throw new IllegalArgumentException("鏆備笉鏀寔璇ョ被鍏紡");
}
}
- return feePrice.setScale(3, BigDecimal.ROUND_HALF_EVEN).doubleValue();
+ feePrice.setScale(3, BigDecimal.ROUND_HALF_EVEN).doubleValue();
+ feeAmount.put("feePrice", feePrice);
+ feeAmount.put("feeTotalPrice", feeTotalPrice);
+ return feeAmount;
}
/**
@@ -1232,6 +1363,7 @@
/**
* 璁$畻 璁¤垂缁撴潫鏃堕棿鍜� 娆犺垂鏈堜唤锛堝彲鑳藉瓨鍦ㄥ皬鏁扮偣锛�
+ *
* @param feeDto
* @param ownerCarDto
* @return
@@ -1318,7 +1450,8 @@
/**
* 璁$畻 涓や釜鏃堕棿鐐规湀浠�
- * @param fromDate 寮�濮嬫椂闂�
+ *
+ * @param fromDate 寮�濮嬫椂闂�
* @param toDate 缁撴潫鏃堕棿
* @return
*/
--
Gitblit v1.8.0