From 11d081f8d6029ba6e62788deb7723a5b410e6e02 Mon Sep 17 00:00:00 2001
From: java110 <928255095@qq.com>
Date: 星期五, 21 一月 2022 12:40:53 +0800
Subject: [PATCH] 优化代码
---
service-fee/src/main/java/com/java110/fee/bmo/impl/QueryOweFeeImpl.java | 45 +++++++++++++++++++++++++++++++++++++--------
1 files changed, 37 insertions(+), 8 deletions(-)
diff --git a/service-fee/src/main/java/com/java110/fee/bmo/impl/QueryOweFeeImpl.java b/service-fee/src/main/java/com/java110/fee/bmo/impl/QueryOweFeeImpl.java
index 5c01580..4d7383c 100755
--- a/service-fee/src/main/java/com/java110/fee/bmo/impl/QueryOweFeeImpl.java
+++ b/service-fee/src/main/java/com/java110/fee/bmo/impl/QueryOweFeeImpl.java
@@ -1,6 +1,7 @@
package com.java110.fee.bmo.impl;
import com.alibaba.fastjson.JSONArray;
+import com.java110.core.factory.CommunitySettingFactory;
import com.java110.core.factory.Java110ThreadPoolFactory;
import com.java110.core.smo.IComputeFeeSMO;
import com.java110.dto.RoomDto;
@@ -24,7 +25,7 @@
import com.java110.utils.util.StringUtil;
import com.java110.vo.ResultVo;
import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import com.java110.core.log.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
@@ -70,6 +71,9 @@
//閿�
public static final String RECEIVED_AMOUNT_SWITCH = "RECEIVED_AMOUNT_SWITCH";
+ //绂佺敤鐢佃剳绔彁浜ゆ敹璐规寜閽�
+ public static final String OFFLINE_PAY_FEE_SWITCH = "OFFLINE_PAY_FEE_SWITCH";
+
@Override
public ResponseEntity<String> query(FeeDto feeDto) {
@@ -86,7 +90,8 @@
for (FeeDto tmpFeeDto : feeDtos) {
computeFeeSMOImpl.computeEveryOweFee(tmpFeeDto);//璁$畻娆犺垂閲戦
//濡傛灉閲戦涓�0 灏辨帓闄�
- if (tmpFeeDto.getFeePrice() > 0 && tmpFeeDto.getEndTime().getTime() <= DateUtil.getCurrentDate().getTime()) {
+ //if (tmpFeeDto.getFeePrice() > 0 && tmpFeeDto.getEndTime().getTime() <= DateUtil.getCurrentDate().getTime()) {
+ if (tmpFeeDto.getFeePrice() > 0) {
tmpFeeDtos.add(tmpFeeDto);
}
}
@@ -119,8 +124,14 @@
if (feeDtos == null || feeDtos.size() < 1) {
return ResultVo.success();
}
-
+ String cycel = null;
+ if (!StringUtil.isEmpty(feeDto.getCycle())) {
+ cycel = feeDto.getCycle();
+ }
feeDto = feeDtos.get(0);
+ if (!StringUtil.isEmpty(cycel)) {
+ feeDto.setCycle(cycel);
+ }
if (FeeDto.PAYER_OBJ_TYPE_ROOM.equals(feeDto.getPayerObjType())) { //鎴垮眿鐩稿叧
RoomDto roomDto = new RoomDto();
@@ -136,6 +147,7 @@
} else if (FeeDto.PAYER_OBJ_TYPE_CAR.equals(feeDto.getPayerObjType())) {//杞︿綅鐩稿叧
OwnerCarDto ownerCarDto = new OwnerCarDto();
+ ownerCarDto.setCarTypeCd("1001"); //涓氫富杞﹁締
ownerCarDto.setCommunityId(feeDto.getCommunityId());
ownerCarDto.setCarId(feeDto.getPayerObjId());
List<OwnerCarDto> ownerCarDtos = ownerCarInnerServiceSMOImpl.queryOwnerCars(ownerCarDto);
@@ -152,17 +164,33 @@
feeDto.setPayerObjName(ownerCarDto.getCarNum() + "(" + parkingSpaceDto.getAreaNum() + "鍋滆溅鍦�" + parkingSpaceDto.getNum() + "杞︿綅)");
feeDto.setBuiltUpArea(parkingSpaceDto.getArea());
}
- double feePrice = computeFeeSMOImpl.getFeePrice(feeDto);
- feeDto.setFeePrice(feePrice);
+ Map feePriceAll = computeFeeSMOImpl.getFeePrice(feeDto);
+ feeDto.setFeePrice(Double.parseDouble(feePriceAll.get("feePrice").toString()));
+ feeDto.setFeeTotalPrice(Double.parseDouble(feePriceAll.get("feeTotalPrice").toString()));
//搴旀敹娆惧彇鍊�
- String val = MappingCache.getValue(DOMAIN_COMMON, TOTAL_FEE_PRICE);
+ //鍏堝彇鍗曞皬鍖虹殑濡傛灉娌℃湁閰嶇疆 鍙� 鍏ㄥ眬鐨�
+ String val = CommunitySettingFactory.getValue(feeDto.getCommunityId(),TOTAL_FEE_PRICE);
+ if(StringUtil.isEmpty(val)){
+ val = MappingCache.getValue(DOMAIN_COMMON, TOTAL_FEE_PRICE);
+ }
feeDto.setVal(val);
- String received_amount_switch = MappingCache.getValue(DOMAIN_COMMON, RECEIVED_AMOUNT_SWITCH);
+ //鍏堝彇鍗曞皬鍖虹殑濡傛灉娌℃湁閰嶇疆 鍙� 鍏ㄥ眬鐨�
+ String received_amount_switch = CommunitySettingFactory.getValue(feeDto.getCommunityId(),RECEIVED_AMOUNT_SWITCH);
+ if(StringUtil.isEmpty(received_amount_switch)){
+ received_amount_switch = MappingCache.getValue(DOMAIN_COMMON, RECEIVED_AMOUNT_SWITCH);
+ }
+ //鍏抽棴 绾夸笅鏀堕摱鍔熻兘
if (StringUtil.isEmpty(received_amount_switch)) {
feeDto.setReceivedAmountSwitch("1");//榛樿鍚敤瀹炴敹娆捐緭鍏ユ
} else {
feeDto.setReceivedAmountSwitch(received_amount_switch);
}
+ //鍏堝彇鍗曞皬鍖虹殑濡傛灉娌℃湁閰嶇疆 鍙� 鍏ㄥ眬鐨�
+ String offlinePayFeeSwitch = CommunitySettingFactory.getValue(feeDto.getCommunityId(),OFFLINE_PAY_FEE_SWITCH);
+ if(StringUtil.isEmpty(offlinePayFeeSwitch)){
+ offlinePayFeeSwitch = MappingCache.getValue(DOMAIN_COMMON, OFFLINE_PAY_FEE_SWITCH);
+ }
+ feeDto.setOfflinePayFeeSwitch(offlinePayFeeSwitch);
return ResultVo.createResponseEntity(feeDto);
}
@@ -227,7 +255,8 @@
computeFeeSMOImpl.computeEveryOweFee(tempFeeDto, tmpRoomDto);//璁$畻娆犺垂閲戦
//濡傛灉閲戦涓�0 灏辨帓闄�
- if (tempFeeDto.getFeePrice() > 0 && tempFeeDto.getEndTime().getTime() <= DateUtil.getCurrentDate().getTime()) {
+ //if (tempFeeDto.getFeePrice() > 0 && tempFeeDto.getEndTime().getTime() <= DateUtil.getCurrentDate().getTime()) {
+ if (tempFeeDto.getFeePrice() > 0) {
tmpFeeDtos.add(tempFeeDto);
}
}
--
Gitblit v1.8.0