From 05683f2b2bdbdbe21cf17ad523c21ab338bd1c54 Mon Sep 17 00:00:00 2001
From: wuxw <928255095@qq.com>
Date: 星期二, 19 七月 2022 21:49:55 +0800
Subject: [PATCH] 优化添加设备 功能
---
service-report/src/main/java/com/java110/report/smo/impl/GeneratorFeeMonthStatisticsInnerServiceSMOImpl.java | 46 ++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 44 insertions(+), 2 deletions(-)
diff --git a/service-report/src/main/java/com/java110/report/smo/impl/GeneratorFeeMonthStatisticsInnerServiceSMOImpl.java b/service-report/src/main/java/com/java110/report/smo/impl/GeneratorFeeMonthStatisticsInnerServiceSMOImpl.java
index f9cac68..ab4860d 100755
--- a/service-report/src/main/java/com/java110/report/smo/impl/GeneratorFeeMonthStatisticsInnerServiceSMOImpl.java
+++ b/service-report/src/main/java/com/java110/report/smo/impl/GeneratorFeeMonthStatisticsInnerServiceSMOImpl.java
@@ -5,6 +5,7 @@
import com.java110.core.log.LoggerFactory;
import com.java110.core.smo.IComputeFeeSMO;
import com.java110.dto.RoomDto;
+import com.java110.dto.fee.FeeConfigDto;
import com.java110.dto.fee.FeeDto;
import com.java110.dto.owner.OwnerCarDto;
import com.java110.dto.report.ReportCarDto;
@@ -243,7 +244,7 @@
reportFeeMonthStatisticsDto.setCommunityId(tmpReportCarDto.getCommunityId());
reportFeeMonthStatisticsDto.setConfigId(tmpReportFeeDto.getConfigId());
reportFeeMonthStatisticsDto.setObjId(tmpReportFeeDto.getPayerObjId());
- //reportFeeMonthStatisticsDto.setFeeId(tmpReportFeeDto.getFeeId());
+ reportFeeMonthStatisticsDto.setFeeId(tmpReportFeeDto.getFeeId());//杩欓噷涓嶈兘娉ㄩ噴 濡傛灉涓�涓垂鐢ㄥ垱寤哄鏉℃椂浼氭湁bug
reportFeeMonthStatisticsDto.setObjType(tmpReportFeeDto.getPayerObjType());
reportFeeMonthStatisticsDto.setFeeYear(DateUtil.getYear() + "");
reportFeeMonthStatisticsDto.setFeeMonth(DateUtil.getMonth() + "");
@@ -441,7 +442,7 @@
reportFeeMonthStatisticsDto.setCommunityId(reportRoomDto.getCommunityId());
reportFeeMonthStatisticsDto.setConfigId(tmpReportFeeDto.getConfigId());
reportFeeMonthStatisticsDto.setObjId(tmpReportFeeDto.getPayerObjId());
- //reportFeeMonthStatisticsDto.setFeeId(tmpReportFeeDto.getFeeId());
+ reportFeeMonthStatisticsDto.setFeeId(tmpReportFeeDto.getFeeId()); //杩欓噷涓嶈兘娉ㄩ噴锛屽洜涓轰竴涓垂鐢ㄥ娆″垱寤烘椂浼氬瓨鍦ㄨ鐩� 瀛樺湪bug闂
reportFeeMonthStatisticsDto.setObjType(tmpReportFeeDto.getPayerObjType());
reportFeeMonthStatisticsDto.setFeeYear(DateUtil.getYear() + "");
reportFeeMonthStatisticsDto.setFeeMonth(DateUtil.getMonth() + "");
@@ -513,6 +514,8 @@
reportFeeMonthStatisticsPo.setPreReceivedAmount(getReceivedAmount(tmpReportFeeDto, 3) + "");
reportFeeMonthStatisticsPo.setUpdateTime(DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_A));
reportFeeMonthStatisticsServiceDaoImpl.saveReportFeeMonthStatisticsInfo(BeanConvertUtil.beanCovertMap(reportFeeMonthStatisticsPo));
+ //澶勭悊姘寸數璐癸紝姘寸數璐规牴鎹紑濮嬫椂闂磋鍦ㄧ浉搴旀湀琛ュ厖鏁版嵁
+ dealMeteWater(reportFeeMonthStatisticsPo, tmpReportFeeDto);
}
@@ -526,6 +529,45 @@
reportFeeMonthStatisticsServiceDaoImpl.updateReportFeeMonthStatisticsOwe(BeanConvertUtil.beanCovertMap(tmpReportFeeMonthStatisticsPo));
}
+ /**
+ * 澶勭悊姘寸數璐�
+ *
+ * @param reportFeeMonthStatisticsPo
+ * @param tmpReportFeeDto
+ */
+ private void dealMeteWater(ReportFeeMonthStatisticsPo reportFeeMonthStatisticsPo, ReportFeeDto tmpReportFeeDto) {
+
+ //濡傛灉鏄� 姘磋垂 鐢佃垂 鐓ゆ皵璐�
+ if (!FeeConfigDto.FEE_TYPE_CD_METER.equals(tmpReportFeeDto.getFeeTypeCd())
+ && !FeeConfigDto.FEE_TYPE_CD_WATER.equals(tmpReportFeeDto.getFeeTypeCd())
+ && !FeeConfigDto.FEE_TYPE_CD_GAS.equals(tmpReportFeeDto.getFeeTypeCd())
+ ) {
+ return;
+ }
+ //鏍规嵁璐圭敤寮�濮嬫椂闂� 璁$畻鏈堜唤
+ Date endTime = tmpReportFeeDto.getEndTime();
+ //鍘婚櫎 0 鍥犱负琛ㄩ噷鐨勬湀浠芥槸娌℃湁闆�
+ String curMonth = Integer.parseInt(DateUtil.getFormatTimeString(endTime, "MM"))+"";
+ String curYear = DateUtil.getFormatTimeString(endTime, "YYYY");
+ //鏌ヨ鏄惁瀛樺湪 鏁版嵁
+ ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto = new ReportFeeMonthStatisticsDto();
+ reportFeeMonthStatisticsDto.setCommunityId(tmpReportFeeDto.getCommunityId());
+ reportFeeMonthStatisticsDto.setConfigId(tmpReportFeeDto.getConfigId());
+ reportFeeMonthStatisticsDto.setObjId(tmpReportFeeDto.getPayerObjId());
+ //reportFeeMonthStatisticsDto.setFeeId(tmpReportFeeDto.getFeeId());
+ reportFeeMonthStatisticsDto.setObjType(tmpReportFeeDto.getPayerObjType());
+ reportFeeMonthStatisticsDto.setFeeYear(curYear);
+ reportFeeMonthStatisticsDto.setFeeMonth(curMonth);
+ List<ReportFeeMonthStatisticsDto> statistics = BeanConvertUtil.covertBeanList(
+ reportFeeMonthStatisticsServiceDaoImpl.getReportFeeMonthStatisticsInfo(BeanConvertUtil.beanCovertMap(reportFeeMonthStatisticsDto)),
+ ReportFeeMonthStatisticsDto.class);
+ if (!ListUtil.isNull(statistics)) {
+ return;
+ }
+ reportFeeMonthStatisticsPo.setStatisticsId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_statisticsId));
+ reportFeeMonthStatisticsServiceDaoImpl.saveReportFeeMonthStatisticsInfo(BeanConvertUtil.beanCovertMap(reportFeeMonthStatisticsPo));
+ }
+
/**
* @return
--
Gitblit v1.8.0