From 4dbf61c9189796ec46d39ac4b839cfc064e70411 Mon Sep 17 00:00:00 2001
From: java110 <928255095@qq.com>
Date: 星期四, 12 八月 2021 16:11:16 +0800
Subject: [PATCH] Merge branch 'master' of http://git.homecommunity.cn/supervip/MicroCommunity
---
service-report/src/main/java/com/java110/report/bmo/reportFeeMonthStatistics/impl/GetReportFeeMonthStatisticsBMOImpl.java | 156 +++++++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 148 insertions(+), 8 deletions(-)
diff --git a/service-report/src/main/java/com/java110/report/bmo/reportFeeMonthStatistics/impl/GetReportFeeMonthStatisticsBMOImpl.java b/service-report/src/main/java/com/java110/report/bmo/reportFeeMonthStatistics/impl/GetReportFeeMonthStatisticsBMOImpl.java
index e4866c6..4bcd365 100755
--- a/service-report/src/main/java/com/java110/report/bmo/reportFeeMonthStatistics/impl/GetReportFeeMonthStatisticsBMOImpl.java
+++ b/service-report/src/main/java/com/java110/report/bmo/reportFeeMonthStatistics/impl/GetReportFeeMonthStatisticsBMOImpl.java
@@ -1,14 +1,18 @@
package com.java110.report.bmo.reportFeeMonthStatistics.impl;
import com.alibaba.fastjson.JSONObject;
+import com.java110.dto.PageDto;
import com.java110.dto.RoomDto;
import com.java110.dto.fee.FeeConfigDto;
import com.java110.dto.fee.FeeDto;
import com.java110.dto.repair.RepairUserDto;
+import com.java110.dto.report.ReportDeposit;
import com.java110.dto.reportFeeMonthStatistics.ReportFeeMonthStatisticsDto;
import com.java110.dto.reportFeeMonthStatistics.ReportFeeMonthStatisticsTotalDto;
+import com.java110.intf.fee.IFeeConfigInnerServiceSMO;
import com.java110.intf.report.IReportFeeMonthStatisticsInnerServiceSMO;
import com.java110.report.bmo.reportFeeMonthStatistics.IGetReportFeeMonthStatisticsBMO;
+import com.java110.utils.util.BeanConvertUtil;
import com.java110.utils.util.DateUtil;
import com.java110.utils.util.StringUtil;
import com.java110.vo.ResultVo;
@@ -19,9 +23,11 @@
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
+import java.math.BigDecimal;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.Date;
+import java.util.HashMap;
import java.util.List;
@Service("getReportFeeMonthStatisticsBMOImpl")
@@ -31,6 +37,9 @@
@Autowired
private IReportFeeMonthStatisticsInnerServiceSMO reportFeeMonthStatisticsInnerServiceSMOImpl;
+
+ @Autowired
+ private IFeeConfigInnerServiceSMO feeConfigInnerServiceSMOImpl;
/**
* @param reportFeeMonthStatisticsDto
@@ -59,9 +68,18 @@
public ResponseEntity<String> queryReportFeeSummary(ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto) {
int count = reportFeeMonthStatisticsInnerServiceSMOImpl.queryReportFeeSummaryCount(reportFeeMonthStatisticsDto);
- List<ReportFeeMonthStatisticsDto> reportFeeMonthStatisticsDtos = null;
+ List<ReportFeeMonthStatisticsDto> reportFeeMonthStatisticsDtos = new ArrayList<>();
if (count > 0) {
- reportFeeMonthStatisticsDtos = reportFeeMonthStatisticsInnerServiceSMOImpl.queryReportFeeSummary(reportFeeMonthStatisticsDto);
+ List<ReportFeeMonthStatisticsDto> reportFeeMonthStatisticsList = reportFeeMonthStatisticsInnerServiceSMOImpl.queryReportFeeSummary(reportFeeMonthStatisticsDto);
+ for (ReportFeeMonthStatisticsDto reportFeeMonthStatistics : reportFeeMonthStatisticsList) {
+ //鑾峰彇搴旀敹閲戦
+ double receivableAmount = Double.parseDouble(reportFeeMonthStatistics.getReceivableAmount());
+ //鑾峰彇瀹炴敹閲戦
+ double receivedAmount = Double.parseDouble(reportFeeMonthStatistics.getReceivedAmount());
+ double chargeRate = (receivedAmount / receivableAmount) * 100.0;
+ reportFeeMonthStatistics.setChargeRate(String.format("%.2f", chargeRate) + "%");
+ reportFeeMonthStatisticsDtos.add(reportFeeMonthStatistics);
+ }
} else {
reportFeeMonthStatisticsDtos = new ArrayList<>();
}
@@ -195,6 +213,7 @@
@Override
public ResponseEntity<String> queryPayFeeDetail(ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto) {
+
JSONObject countInfo = reportFeeMonthStatisticsInnerServiceSMOImpl.queryPayFeeDetailCount(reportFeeMonthStatisticsDto);
int count = Integer.parseInt(countInfo.get("count").toString());
@@ -220,9 +239,17 @@
Double allVacantHousingDiscount = 0.0;
//绌虹疆鎴垮噺鍏�(澶ц)
Double allVacantHousingReduction = 0.0;
+ int size = 0;
if (count > 0) {
//鏌ヨ缂磋垂鏄庣粏
reportFeeMonthStatisticsDtos = reportFeeMonthStatisticsInnerServiceSMOImpl.queryPayFeeDetail(reportFeeMonthStatisticsDto);
+ if (reportFeeMonthStatisticsDtos != null && reportFeeMonthStatisticsDtos.size() > 0) {
+ //鏌ヨ鎵�鏈夌即璐规槑缁嗚褰�
+ ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto1 = BeanConvertUtil.covertBean(reportFeeMonthStatisticsDto, ReportFeeMonthStatisticsDto.class);
+ reportFeeMonthStatisticsDto1.setPage(PageDto.DEFAULT_PAGE);
+ List<ReportFeeMonthStatisticsDto> reportFeeMonthStatisticsDtos1 = reportFeeMonthStatisticsInnerServiceSMOImpl.queryPayFeeDetail(reportFeeMonthStatisticsDto1);
+ size = reportFeeMonthStatisticsDtos1.size();
+ }
//鏌ヨ搴旀敹銆佸疄鏀舵�婚噾棰�(澶ц)
List<ReportFeeMonthStatisticsDto> reportFeeMonthStatisticsList = reportFeeMonthStatisticsInnerServiceSMOImpl.queryAllPayFeeDetail(reportFeeMonthStatisticsDto);
//鏌ヨ(浼樻儬銆佸噺鍏嶃�佹粸绾抽噾銆佺┖缃埧鎵撴姌銆佺┖缃埧鍑忓厤閲戦绛�)澶ц鎬婚噾棰�
@@ -283,7 +310,6 @@
reportFeeMonthStatistics.setPreferentialAmount(reportFeeMonthStatistics.getDiscountPrice());
} else {
reportFeeMonthStatistics.setPreferentialAmount("0");
-
}
//鍑忓厤閲戦
if (!StringUtil.isEmpty(reportFeeMonthStatistics.getDiscountSmallType()) && reportFeeMonthStatistics.getDiscountSmallType().equals("2")) {
@@ -325,22 +351,19 @@
} else {
reportFeeMonthStatistics.setVacantHousingReduction("0");
}
-
if (FeeDto.PAYER_OBJ_TYPE_ROOM.equals(reportFeeMonthStatistics.getPayerObjType())) {
reportFeeMonthStatistics.setObjName(reportFeeMonthStatistics.getFloorNum()
+ "鏍�" + reportFeeMonthStatistics.getUnitNum()
+ "鍗曞厓" + reportFeeMonthStatistics.getRoomNum() + "瀹�");
} else if (FeeDto.PAYER_OBJ_TYPE_CAR.equals(reportFeeMonthStatistics.getPayerObjType())) {
reportFeeMonthStatistics.setObjName(reportFeeMonthStatistics.getCarNum());
- }else{
+ } else {
reportFeeMonthStatistics.setObjName(reportFeeMonthStatistics.getContractCode());
}
-
if (!StringUtil.isEmpty(reportFeeMonthStatistics.getImportFeeName())) {
reportFeeMonthStatistics.setFeeName(reportFeeMonthStatistics.getImportFeeName());
}
-
//璐圭敤椤圭洰
reportFeeMonthStatistics.setFeeConfigDtos(feeConfigDtos);
reportList.add(reportFeeMonthStatistics);
@@ -379,7 +402,7 @@
reportFeeMonthStatisticsTotalDto = new ReportFeeMonthStatisticsTotalDto();
}
- ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) reportFeeMonthStatisticsDto.getRow()), count, reportList, reportFeeMonthStatisticsTotalDto);
+ ResultVo resultVo = new ResultVo((int) Math.ceil((double) size / (double) reportFeeMonthStatisticsDto.getRow()), size, reportList, reportFeeMonthStatisticsTotalDto);
ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK);
@@ -465,6 +488,7 @@
/**
* 鏌ヨ鎶ヨ〃涓撳 缁熻淇℃伅
+ *
* @param reportFeeMonthStatisticsDto
* @return
*/
@@ -508,6 +532,8 @@
int transferOrderNumber = 0;
//娲惧崟鎬绘暟閲�
int dispatchNumber = 0;
+ //宸插洖璁挎�绘暟閲�
+ int returnNumber = 0;
if (count > 0) {
for (RepairUserDto repairUser : repairUsers) {
RepairUserDto repairUserInfo = new RepairUserDto();
@@ -525,6 +551,10 @@
int transferOrderAmount = 0;
//娲惧崟鏁伴噺
int dispatchAmount = 0;
+ //鍥炶鏁伴噺
+ int returnAmount = 0;
+ //璇勫垎
+ String score = "";
for (RepairUserDto repair : repairUserDtoList) {
//澶勭悊涓姸鎬�
if (repair.getState().equals("10001")) {
@@ -546,6 +576,12 @@
} else if (repair.getState().equals("10006")) { //娲惧崟鐘舵��
int amount = Integer.parseInt(repair.getAmount());
dispatchAmount = dispatchAmount + amount;
+ } else if (repair.getState().equals("10008")) { //宸插洖璁跨姸鎬�
+ int amount = Integer.parseInt(repair.getAmount());
+ returnAmount = returnAmount + amount;
+ }
+ if (!StringUtil.isEmpty(repair.getScore())) {
+ score = repair.getScore();
}
}
//鍛樺伐id
@@ -572,8 +608,14 @@
repairUserInfo.setDispatchAmount(Integer.toString(dispatchAmount));
//娲惧崟鎶ヤ慨鎬绘暟閲�
repairUserInfo.setDispatchNumber(Integer.toString(dispatchNumber));
+ //鍥炶鏁伴噺
+ repairUserInfo.setReturnAmount(Integer.toString(returnAmount));
+ //鍥炶鎬绘暟閲�
+ repairUserInfo.setReturnNumber(Integer.toString(returnNumber));
//鍛樺伐id鍜屽鍚嶄俊鎭泦鍚�
repairUserInfo.setRepairList(staffs);
+ //鍛樺伐璇勫垎
+ repairUserInfo.setScore(score);
repairUserList.add(repairUserInfo);
} else {
continue;
@@ -583,6 +625,7 @@
chargebackNumber = Integer.parseInt(repairUserInfo.getChargebackAmount()) + chargebackNumber;
transferOrderNumber = Integer.parseInt(repairUserInfo.getTransferOrderAmount()) + transferOrderNumber;
dispatchNumber = Integer.parseInt(repairUserInfo.getDispatchAmount()) + dispatchNumber;
+ returnNumber = Integer.parseInt(repairUserInfo.getReturnAmount()) + returnNumber;
}
} else {
repairUserList = new ArrayList<>();
@@ -594,6 +637,7 @@
repairUser.setChargebackNumber(Integer.toString(chargebackNumber));
repairUser.setTransferOrderNumber(Integer.toString(transferOrderNumber));
repairUser.setDispatchNumber(Integer.toString(dispatchNumber));
+ repairUser.setReturnNumber(Integer.toString(returnNumber));
//鑾峰彇鎬绘潯鏁�
int size = staffs.size();
@@ -624,6 +668,102 @@
}
@Override
+ public ResponseEntity<String> queryPayFeeDeposit(ReportDeposit reportDeposit) {
+ //鏌ヨ鎶奸噾
+ List<ReportDeposit> reportDeposits = reportFeeMonthStatisticsInnerServiceSMOImpl.queryPayFeeDeposit(reportDeposit);
+ //鏌ヨ鎶奸噾閫�璐规�婚噾棰�
+ List<ReportDeposit> reportDepositAmounts = reportFeeMonthStatisticsInnerServiceSMOImpl.queryFeeDepositAmount(reportDeposit);
+
+ //鏌ヨ鎶奸噾璐圭敤椤�
+ FeeConfigDto feeConfigDto = new FeeConfigDto();
+ feeConfigDto.setCommunityId(reportDeposit.getCommunityId());
+ feeConfigDto.setFeeTypeCd("888800010006");
+ List<FeeConfigDto> feeConfigDtos = feeConfigInnerServiceSMOImpl.queryFeeConfigs(feeConfigDto);
+
+ List<ReportDeposit> newReportDeposits = new ArrayList<>();
+ BigDecimal unpaidfeeAmount = new BigDecimal(0);//鏈氦璐�
+ BigDecimal unpaidfeeAmounts = new BigDecimal(0);//鏈即璐规�婚噾棰�
+ BigDecimal paidfeeAmount = new BigDecimal(0);//宸茬即璐�
+ BigDecimal paidfeeAmounts = new BigDecimal(0);//宸茬即璐规�婚噾棰�
+ BigDecimal refundedAmount = new BigDecimal(0);//宸查��璐�
+ BigDecimal refundedAmounts = new BigDecimal(0);//宸查��璐规�婚噾棰�
+ BigDecimal refundInProgressAmount = new BigDecimal(0); //閫�璐逛腑
+ BigDecimal refundInProgressAmounts = new BigDecimal(0);//閫�璐逛腑鎬婚噾棰�
+ BigDecimal refundFailedAmount = new BigDecimal(0); //閫�璐瑰け璐�
+ BigDecimal refundFailedAmounts = new BigDecimal(0);//閫�璐瑰け璐ユ�婚噾棰�
+ for (ReportDeposit deposit : reportDeposits) {
+ deposit.setFeeConfigDtos(feeConfigDtos);
+ newReportDeposits.add(deposit);
+ if (FeeDto.PAYER_OBJ_TYPE_ROOM.equals(deposit.getPayerObjType())) {
+ deposit.setObjName(deposit.getFloorNum()
+ + "鏍�" + deposit.getUnitNum()
+ + "鍗曞厓" + deposit.getRoomNum() + "瀹�");
+ } else if (FeeDto.PAYER_OBJ_TYPE_CAR.equals(deposit.getPayerObjType())) {
+ deposit.setObjName(deposit.getCarNum());
+ }
+ //鏀惰垂涓紙鏈氦璐癸級
+ if ("2008001".equals(deposit.getState())) {
+ unpaidfeeAmount = unpaidfeeAmount.add(new BigDecimal(deposit.getAdditionalAmount()));
+ }
+ //鏀惰垂缁撴潫锛堝凡鏀惰垂锛�
+ if ("2009001".equals(deposit.getState()) && !StringUtil.isEmpty(deposit.getDetailState()) && "1400".equals(deposit.getDetailState())) {
+ paidfeeAmount = paidfeeAmount.add(new BigDecimal(deposit.getAdditionalAmount()));
+ }
+ if (!StringUtil.isEmpty(deposit.getDetailState()) && "1100".equals(deposit.getDetailState())) {//宸查��璐�
+ refundedAmount = refundedAmount.add(new BigDecimal(deposit.getAdditionalAmount()));
+ }
+ if (!StringUtil.isEmpty(deposit.getDetailState()) && "1000".equals(deposit.getDetailState())) {//閫�璐逛腑
+ refundInProgressAmount = refundInProgressAmount.add(new BigDecimal(deposit.getAdditionalAmount()));
+ }
+ if (!StringUtil.isEmpty(deposit.getDetailState()) && "1200".equals(deposit.getDetailState())) {//閫�璐瑰け璐�
+ refundFailedAmount = refundFailedAmount.add(new BigDecimal(deposit.getAdditionalAmount()));
+ }
+ }
+ for (ReportDeposit reportDeposit1 : reportDepositAmounts) {
+ if (StringUtil.isEmpty(reportDeposit1.getAllAmount())) {
+ throw new IllegalArgumentException("鏌ヨ鎬婚噾棰濋敊璇紒");
+ }
+ //鑾峰彇鎬婚噾棰�
+ BigDecimal bd = new BigDecimal(reportDeposit1.getAllAmount());
+ if (StringUtil.isEmpty(reportDeposit1.getDetailState())) { //鑾峰彇鏈即璐规�婚噾棰�
+ unpaidfeeAmounts = bd;
+ } else if (reportDeposit1.getDetailState().equals("1000")) { //鑾峰彇閫�璐逛腑鎬婚噾棰�
+ refundInProgressAmounts = bd;
+ } else if (reportDeposit1.getDetailState().equals("1100")) { //鑾峰彇宸查��璐规�婚噾棰�
+ refundedAmounts = bd;
+ } else if (reportDeposit1.getDetailState().equals("1200")) { //鑾峰彇閫�璐瑰け璐ユ�婚噾棰�
+ refundFailedAmounts = bd;
+ } else if (reportDeposit1.getDetailState().equals("1400")) { //鑾峰彇宸茬即璐规�婚噾棰�
+ paidfeeAmounts = bd;
+ }
+ }
+ HashMap<String, String> mp = new HashMap<>();
+ mp.put("unpaidfeeAmount", unpaidfeeAmount.toString());
+ mp.put("paidfeeAmount", paidfeeAmount.toString());
+ mp.put("refundedAmount", refundedAmount.toString());
+ mp.put("refundInProgressAmount", refundInProgressAmount.toString());
+ mp.put("refundFailedAmount", refundFailedAmount.toString());
+ mp.put("unpaidfeeAmounts", unpaidfeeAmounts.toString());
+ mp.put("paidfeeAmounts", paidfeeAmounts.toString());
+ mp.put("refundedAmounts", refundedAmounts.toString());
+ mp.put("refundInProgressAmounts", refundInProgressAmounts.toString());
+ mp.put("refundFailedAmounts", refundFailedAmounts.toString());
+ int size = 0;
+ if (newReportDeposits != null && newReportDeposits.size() > 0) {
+ //鏌ヨ鎵�鏈夋潯鏁�
+ reportDeposit.setPage(PageDto.DEFAULT_PAGE);
+ List<ReportDeposit> reportDeposits1 = reportFeeMonthStatisticsInnerServiceSMOImpl.queryPayFeeDeposit(reportDeposit);
+ size = reportDeposits1.size();
+ }
+
+ ResultVo resultVo = new ResultVo((int) Math.ceil((double) size / (double) reportDeposit.getRow()), size, newReportDeposits, mp);
+
+ ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK);
+
+ return responseEntity;
+ }
+
+ @Override
public ResponseEntity<String> queryPrePayment(ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto) {
int count = reportFeeMonthStatisticsInnerServiceSMOImpl.queryPrePaymentNewCount(reportFeeMonthStatisticsDto);
--
Gitblit v1.8.0