From 2703710ab562eca0b94fbfda76a196cc30e64483 Mon Sep 17 00:00:00 2001
From: Your Name <you@example.com>
Date: 星期二, 18 四月 2023 00:06:07 +0800
Subject: [PATCH] 优化 导入费用时,模板上能体现一下房屋状态,这样未销售房就不会依然被填入
---
service-fee/src/main/java/com/java110/fee/cmd/fee/ListFeeCmd.java | 70 ++++++++++++++++++++++++++---------
1 files changed, 52 insertions(+), 18 deletions(-)
diff --git a/service-fee/src/main/java/com/java110/fee/cmd/fee/ListFeeCmd.java b/service-fee/src/main/java/com/java110/fee/cmd/fee/ListFeeCmd.java
index 216beae..3e82feb 100644
--- a/service-fee/src/main/java/com/java110/fee/cmd/fee/ListFeeCmd.java
+++ b/service-fee/src/main/java/com/java110/fee/cmd/fee/ListFeeCmd.java
@@ -11,8 +11,10 @@
import com.java110.dto.FloorDto;
import com.java110.dto.RoomDto;
import com.java110.dto.UnitDto;
+import com.java110.dto.fee.FeeAttrDto;
import com.java110.dto.fee.FeeDto;
import com.java110.dto.owner.OwnerCarDto;
+import com.java110.dto.owner.OwnerDto;
import com.java110.dto.owner.OwnerRoomRelDto;
import com.java110.dto.parking.ParkingSpaceDto;
import com.java110.intf.community.IFloorInnerServiceSMO;
@@ -20,10 +22,11 @@
import com.java110.intf.community.IRoomInnerServiceSMO;
import com.java110.intf.community.IUnitInnerServiceSMO;
import com.java110.intf.fee.IFeeAttrInnerServiceSMO;
-import com.java110.intf.fee.IFeeConfigInnerServiceSMO;
import com.java110.intf.fee.IFeeInnerServiceSMO;
import com.java110.intf.user.IOwnerCarInnerServiceSMO;
+import com.java110.intf.user.IOwnerInnerServiceSMO;
import com.java110.intf.user.IOwnerRoomRelV1InnerServiceSMO;
+import com.java110.po.fee.FeeAttrPo;
import com.java110.utils.cache.MappingCache;
import com.java110.utils.exception.CmdException;
import com.java110.utils.util.*;
@@ -45,9 +48,6 @@
public class ListFeeCmd extends Cmd {
private static Logger logger = LoggerFactory.getLogger(ListFeeCmd.class);
-
- @Autowired
- private IFeeConfigInnerServiceSMO feeConfigInnerServiceSMOImpl;
@Autowired
private IParkingSpaceInnerServiceSMO parkingSpaceInnerServiceSMOImpl;
@@ -75,6 +75,9 @@
@Autowired
private IOwnerRoomRelV1InnerServiceSMO ownerRoomRelV1InnerServiceSMOImpl;
+
+ @Autowired
+ private IOwnerInnerServiceSMO ownerInnerServiceSMOImpl;
//鍩�
public static final String DOMAIN_COMMON = "DOMAIN.COMMON";
@@ -121,14 +124,13 @@
roomDto.setRoomNum(roomNum);
roomDto.setCommunityId(reqJson.getString("communityId"));
List<RoomDto> roomDtos = roomInnerServiceSMOImpl.queryRooms(roomDto);
- Assert.listOnlyOne(roomDtos, "鏌ヨ鎴垮眿閿欒锛�");
+ Assert.listOnlyOne(roomDtos, "鏌ヨ涓嶅埌鎴垮眿锛�");
reqJson.put("payerObjId", roomDtos.get(0).getRoomId());
}
}
}
}
}
-
FeeDto feeDto = BeanConvertUtil.covertBean(reqJson, FeeDto.class);
List<ApiFeeDataVo> fees = new ArrayList<>();
if (reqJson.containsKey("ownerId") && !StringUtil.isEmpty(reqJson.getString("ownerId"))) {
@@ -171,8 +173,51 @@
}
private void freshFeeAttrs(List<ApiFeeDataVo> fees, List<FeeDto> feeDtos) {
+ String link = "";
for (ApiFeeDataVo apiFeeDataVo : fees) {
for (FeeDto feeDto : feeDtos) {
+ if (!StringUtil.isEmpty(feeDto.getPayerObjType()) && feeDto.getPayerObjType().equals("3333")) { //鎴垮眿
+ OwnerRoomRelDto ownerRoomRelDto = new OwnerRoomRelDto();
+ ownerRoomRelDto.setRoomId(feeDto.getPayerObjId());
+ List<OwnerRoomRelDto> ownerRoomRelDtos = ownerRoomRelV1InnerServiceSMOImpl.queryOwnerRoomRels(ownerRoomRelDto);
+ if (ownerRoomRelDtos != null && ownerRoomRelDtos.size() == 1) {
+ OwnerDto ownerDto = new OwnerDto();
+ ownerDto.setMemberId(ownerRoomRelDtos.get(0).getOwnerId());
+ List<OwnerDto> ownerDtos = ownerInnerServiceSMOImpl.queryOwners(ownerDto);
+ Assert.listOnlyOne(ownerDtos, "鏌ヨ涓氫富閿欒锛�");
+ link = ownerDtos.get(0).getLink();
+ } else {
+ continue;
+ }
+ } else if (!StringUtil.isEmpty(feeDto.getPayerObjType()) && feeDto.getPayerObjType().equals("6666")) {
+ OwnerCarDto ownerCarDto = new OwnerCarDto();
+ ownerCarDto.setCarId(feeDto.getPayerObjId());
+ List<OwnerCarDto> ownerCarDtos = ownerCarInnerServiceSMOImpl.queryOwnerCars(ownerCarDto);
+ Assert.listOnlyOne(ownerCarDtos, "鏌ヨ涓氫富杞﹁締琛ㄩ敊璇紒");
+ OwnerDto ownerDto = new OwnerDto();
+ ownerDto.setMemberId(ownerCarDtos.get(0).getOwnerId());
+ List<OwnerDto> ownerDtos = ownerInnerServiceSMOImpl.queryOwners(ownerDto);
+ Assert.listOnlyOne(ownerDtos, "鏌ヨ涓氫富閿欒锛�");
+ link = ownerDtos.get(0).getLink();
+ }
+ FeeAttrDto feeAttrDto = new FeeAttrDto();
+ feeAttrDto.setFeeId(feeDto.getFeeId());
+ List<FeeAttrDto> feeAttrDtos = feeAttrInnerServiceSMOImpl.queryFeeAttrs(feeAttrDto);
+ if (feeAttrDtos != null || feeAttrDtos.size() > 0) {
+ for (FeeAttrDto feeAttr : feeAttrDtos) {
+ if (!StringUtil.isEmpty(feeAttr.getSpecCd()) && feeAttr.getSpecCd().equals("390009")) { //鑱旂郴鏂瑰紡
+ if (!feeAttr.getValue().equals(link)) {
+ FeeAttrPo feeAttrPo = new FeeAttrPo();
+ feeAttrPo.setAttrId(feeAttr.getAttrId());
+ feeAttrPo.setValue(link);
+ int flag = feeAttrInnerServiceSMOImpl.updateFeeAttr(feeAttrPo);
+ if (flag < 1) {
+ throw new CmdException("鏇存柊涓氫富鑱旂郴鏂瑰紡澶辫触");
+ }
+ }
+ }
+ }
+ }
if (apiFeeDataVo.getFeeId().equals(feeDto.getFeeId())) {
apiFeeDataVo.setFeeAttrs(feeDto.getFeeAttrDtos());
}
@@ -181,7 +226,6 @@
}
private void computeFeePrice(List<FeeDto> feeDtos) {
-
if (feeDtos == null || feeDtos.size() < 1) {
return;
}
@@ -189,19 +233,16 @@
if (StringUtil.isEmpty(val)) {
val = MappingCache.getValue(DOMAIN_COMMON, TOTAL_FEE_PRICE);
}
-
//鍏堝彇鍗曞皬鍖虹殑濡傛灉娌℃湁閰嶇疆 鍙� 鍏ㄥ眬鐨�
String received_amount_switch = CommunitySettingFactory.getValue(feeDtos.get(0).getCommunityId(), RECEIVED_AMOUNT_SWITCH);
if (StringUtil.isEmpty(received_amount_switch)) {
received_amount_switch = MappingCache.getValue(DOMAIN_COMMON, RECEIVED_AMOUNT_SWITCH);
}
-
//鍏堝彇鍗曞皬鍖虹殑濡傛灉娌℃湁閰嶇疆 鍙� 鍏ㄥ眬鐨�
String offlinePayFeeSwitch = CommunitySettingFactory.getValue(feeDtos.get(0).getCommunityId(), OFFLINE_PAY_FEE_SWITCH);
if (StringUtil.isEmpty(offlinePayFeeSwitch)) {
offlinePayFeeSwitch = MappingCache.getValue(DOMAIN_COMMON, OFFLINE_PAY_FEE_SWITCH);
}
-
for (FeeDto feeDto : feeDtos) {
try {
// 杞暟 * 鍛ㄦ湡 * 30 + 寮�濮嬫椂闂� = 鐩爣 鍒版湡鏃堕棿
@@ -217,7 +258,6 @@
} else if (FeeDto.PAYER_OBJ_TYPE_CONTRACT.equals(feeDto.getPayerObjType())) {//杞︿綅鐩稿叧
computeFeePriceByContract(feeDto, oweMonth);
}
-
feeDto.setVal(val);
//鍏抽棴 绾夸笅鏀堕摱鍔熻兘
if (StringUtil.isEmpty(received_amount_switch)) {
@@ -226,14 +266,12 @@
feeDto.setReceivedAmountSwitch(received_amount_switch);
}
feeDto.setOfflinePayFeeSwitch(offlinePayFeeSwitch);
-
} catch (Exception e) {
logger.error("鏌ヨ璐圭敤淇℃伅 锛岃垂鐢ㄤ俊鎭敊璇�", e);
}
-
//鍘绘帀澶氫綑0
feeDto.setSquarePrice(Double.parseDouble(feeDto.getSquarePrice()) + "");
- feeDto.setAdditionalAmount(Double.parseDouble(feeDto.getAdditionalAmount())+"");
+ feeDto.setAdditionalAmount(Double.parseDouble(feeDto.getAdditionalAmount()) + "");
}
}
@@ -258,7 +296,6 @@
Map feePriceAll = computeFeeSMOImpl.getFeePrice(feeDto);
feeDto.setFeePrice(Double.parseDouble(feePriceAll.get("feePrice").toString()));
feeDto.setFeeTotalPrice(Double.parseDouble(feePriceAll.get("feeTotalPrice").toString()));
-
BigDecimal curFeePrice = new BigDecimal(feeDto.getFeePrice());
curFeePrice = curFeePrice.multiply(new BigDecimal(oweMonth));
feeDto.setAmountOwed(df.format(curFeePrice));
@@ -269,7 +306,6 @@
feeDto.setAmountOwed(df.format(curFeePrice));
feeDto.setDeadlineTime(DateUtil.getCurrentDate());
}
-
//鑰冭檻绉熼噾閫掑
computeFeeSMOImpl.dealRentRate(feeDto);
}
@@ -297,12 +333,10 @@
&& feeDto.getDeadlineTime() == null) {
feeDto.setDeadlineTime(DateUtil.getCurrentDate());
}
-
//鑰冭檻绉熼噾閫掑
computeFeeSMOImpl.dealRentRate(feeDto);
}
-
/**
* 鏍规嵁鍚堝悓鏉ョ畻鍗曚环
--
Gitblit v1.8.0