From 2926d12eb0cc5f4490325fded6d35a91d8d76e77 Mon Sep 17 00:00:00 2001
From: java110 <928255095@qq.com>
Date: 星期五, 12 十一月 2021 11:15:34 +0800
Subject: [PATCH] 优化代码
---
service-report/src/main/java/com/java110/report/smo/impl/GeneratorFeeYearStatisticsInnerServiceSMOImpl.java | 38 ++++++++++++++++++++++++--------------
1 files changed, 24 insertions(+), 14 deletions(-)
diff --git a/service-report/src/main/java/com/java110/report/smo/impl/GeneratorFeeYearStatisticsInnerServiceSMOImpl.java b/service-report/src/main/java/com/java110/report/smo/impl/GeneratorFeeYearStatisticsInnerServiceSMOImpl.java
old mode 100644
new mode 100755
index 1c4aad7..7b95171
--- a/service-report/src/main/java/com/java110/report/smo/impl/GeneratorFeeYearStatisticsInnerServiceSMOImpl.java
+++ b/service-report/src/main/java/com/java110/report/smo/impl/GeneratorFeeYearStatisticsInnerServiceSMOImpl.java
@@ -173,7 +173,7 @@
reportFeeDto.setPayerObjId(tmpReportCarDto.getCarId());
reportFeeDto.setPayerObjType(FeeDto.PAYER_OBJ_TYPE_CAR);
//reportFeeDto.setState(FeeDto.STATE_DOING);
- reportFeeDto.setFeeFlag(FeeDto.FEE_FLAG_CYCLE);
+ //reportFeeDto.setFeeFlag(FeeDto.FEE_FLAG_CYCLE);
List<ReportFeeDto> feeDtos = reportFeeServiceDaoImpl.getFees(reportFeeDto);
if (feeDtos == null || feeDtos.size() < 1) {
@@ -195,7 +195,7 @@
reportFeeYearCollectionDto.setCommunityId(tmpReportCarDto.getCommunityId());
reportFeeYearCollectionDto.setConfigId(tmpReportFeeDto.getConfigId());
reportFeeYearCollectionDto.setObjId(tmpReportFeeDto.getPayerObjId());
- reportFeeYearCollectionDto.setFeeId(tmpReportFeeDto.getFeeId());
+ //reportFeeYearCollectionDto.setFeeId(tmpReportFeeDto.getFeeId());
reportFeeYearCollectionDto.setObjType(tmpReportFeeDto.getPayerObjType());
List<ReportFeeYearCollectionDto> statistics = BeanConvertUtil.covertBeanList(
reportFeeYearCollectionServiceDaoImpl.getReportFeeYearCollectionInfo(BeanConvertUtil.beanCovertMap(reportFeeYearCollectionDto)),
@@ -211,9 +211,9 @@
reportFeeYearCollectionPo.setObjId(tmpReportCarDto.getCarId());
reportFeeYearCollectionPo.setObjType(FeeDto.PAYER_OBJ_TYPE_CAR);
reportFeeYearCollectionPo.setFeeName(StringUtil.isEmpty(tmpReportFeeDto.getImportFeeName()) ? tmpReportFeeDto.getFeeName() : tmpReportFeeDto.getImportFeeName());
- reportFeeYearCollectionPo.setObjName(tmpReportCarDto.getCarNum() + "(" + tmpReportCarDto.getAreaNum() + "鍋滆溅鍦�" + tmpReportCarDto.getNum() + "杞︿綅)");
+ reportFeeYearCollectionPo.setObjName(tmpReportCarDto.getCarNum());
reportFeeYearCollectionPo.setOwnerId(tmpReportCarDto.getOwnerId());
- reportFeeYearCollectionPo.setObjName(tmpReportCarDto.getOwnerName());
+ reportFeeYearCollectionPo.setOwnerName(tmpReportCarDto.getOwnerName());
reportFeeYearCollectionPo.setOwnerLink(tmpReportCarDto.getLink());
//reportFeeYearCollectionPo.setUpdateTime(DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_A));
@@ -230,7 +230,7 @@
Calendar configEndTime = Calendar.getInstance();
configStartTime.setTime(tmpReportFeeDto.getConfigEndTime());
int endYear = configEndTime.get(Calendar.YEAR);
- int curYear = Calendar.getInstance().get(Calendar.YEAR);
+ int curYear = Calendar.getInstance().get(Calendar.YEAR) + 1;
double feePrice = computeFeeSMOImpl.getReportFeePrice(tmpReportFeeDto, null, tmpReportCarDto);
tmpReportFeeDto.setFeePrice(feePrice);
@@ -255,7 +255,8 @@
reportFeeDto.setPayerObjId(reportRoomDto.getRoomId());
reportFeeDto.setPayerObjType(FeeDto.PAYER_OBJ_TYPE_ROOM);
//reportFeeDto.setState(FeeDto.STATE_DOING);
- reportFeeDto.setFeeFlag(FeeDto.FEE_FLAG_CYCLE);
+ //reportFeeDto.setFeeFlag(FeeDto.FEE_FLAG_CYCLE);
+
List<ReportFeeDto> feeDtos = reportFeeServiceDaoImpl.getFees(reportFeeDto);
if (feeDtos == null || feeDtos.size() < 1) {
@@ -280,7 +281,7 @@
reportFeeYearCollectionDto.setCommunityId(reportRoomDto.getCommunityId());
reportFeeYearCollectionDto.setConfigId(tmpReportFeeDto.getConfigId());
reportFeeYearCollectionDto.setObjId(tmpReportFeeDto.getPayerObjId());
- reportFeeYearCollectionDto.setFeeId(tmpReportFeeDto.getFeeId());
+ //reportFeeYearCollectionDto.setFeeId(tmpReportFeeDto.getFeeId());
reportFeeYearCollectionDto.setObjType(tmpReportFeeDto.getPayerObjType());
List<ReportFeeYearCollectionDto> statistics = BeanConvertUtil.covertBeanList(
reportFeeYearCollectionServiceDaoImpl.getReportFeeYearCollectionInfo(BeanConvertUtil.beanCovertMap(reportFeeYearCollectionDto)),
@@ -297,12 +298,12 @@
reportFeeYearCollectionPo.setObjType(FeeDto.PAYER_OBJ_TYPE_ROOM);
reportFeeYearCollectionPo.setFeeName(StringUtil.isEmpty(tmpReportFeeDto.getImportFeeName()) ? tmpReportFeeDto.getFeeName() : tmpReportFeeDto.getImportFeeName());
if (RoomDto.ROOM_TYPE_ROOM.equals(reportRoomDto.getRoomType())) {
- reportFeeYearCollectionPo.setObjName(reportRoomDto.getFloorNum() + "鏍�" + reportRoomDto.getUnitNum() + "鍗曞厓" + reportRoomDto.getRoomNum() + "瀹�");
+ reportFeeYearCollectionPo.setObjName(reportRoomDto.getFloorNum() + "-" + reportRoomDto.getUnitNum() + "-" + reportRoomDto.getRoomNum());
} else {
- reportFeeYearCollectionPo.setObjName(reportRoomDto.getFloorNum() + "鏍�" + reportRoomDto.getRoomNum() + "瀹�");
+ reportFeeYearCollectionPo.setObjName(reportRoomDto.getFloorNum() + "-" + reportRoomDto.getRoomNum());
}
reportFeeYearCollectionPo.setOwnerId(reportRoomDto.getOwnerId());
- reportFeeYearCollectionPo.setObjName(reportRoomDto.getOwnerName());
+ reportFeeYearCollectionPo.setOwnerName(reportRoomDto.getOwnerName());
reportFeeYearCollectionPo.setOwnerLink(reportRoomDto.getLink());
//reportFeeYearCollectionPo.setUpdateTime(DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_A));
@@ -321,7 +322,7 @@
int endYear = configEndTime.get(Calendar.YEAR);
//褰撳墠骞�
- int curYear = Calendar.getInstance().get(Calendar.YEAR);
+ int curYear = Calendar.getInstance().get(Calendar.YEAR) + 1;
double feePrice = computeFeeSMOImpl.getReportFeePrice(tmpReportFeeDto, reportRoomDto, null);
tmpReportFeeDto.setFeePrice(feePrice);
@@ -398,6 +399,14 @@
int curYear = Calendar.getInstance().get(Calendar.YEAR);
double cycleMonth = 12;
+ if (FeeDto.FEE_FLAG_ONCE.equals(tmpReportFeeDto.getFeeFlag()) && FeeDto.STATE_DOING.equals(tmpReportFeeDto.getState())) { // 涓�娆℃�ц垂鐢� 璐圭敤娌℃湁缁撴潫
+ return StringUtil.isEmpty(tmpReportFeeDto.getAmount()) ? 0 : Double.parseDouble(tmpReportFeeDto.getAmount());
+ }
+
+ if (FeeDto.FEE_FLAG_ONCE.equals(tmpReportFeeDto.getFeeFlag())) { // 涓�娆℃�ц垂鐢ㄦ病鏈夊簲鏀� 鎵�浠ュ啓鎴�0
+ return 0;
+ }
+
if (endYear == curYear) {
try {
cycleMonth = computeFeeSMOImpl.dayCompare(DateUtil.getDateFromString(curYear + "-01-01", DateUtil.DATE_FORMATE_STRING_B), tmpReportFeeDto.getConfigEndTime());
@@ -419,12 +428,13 @@
*/
private double getReceivedAmount(ReportFeeDto tmpReportFeeDto, int year) {
ReportFeeDetailDto feeDetailDto = new ReportFeeDetailDto();
- feeDetailDto.setFeeId(tmpReportFeeDto.getFeeId());
+ feeDetailDto.setConfigId(tmpReportFeeDto.getConfigId());
+ feeDetailDto.setPayerObjId(tmpReportFeeDto.getPayerObjId());
String flag = CommonCache.getValue(RECEIVED_TIME);
if (RECEIVED_TIME_START.equals(flag)) {
- feeDetailDto.setStartTime(year + "");
+ feeDetailDto.setCurStartYear(year + "");
} else {
- feeDetailDto.setEndTime(year + "");
+ feeDetailDto.setCurEndYear(year + "");
}
double receivedAmount = reportFeeServiceDaoImpl.getFeeReceivedAmount(feeDetailDto);
--
Gitblit v1.8.0