java110
2023-07-11 212aa4ae1f54fe4d3e51b9695224f9f86cd1bd22
service-report/src/main/java/com/java110/report/smo/impl/GeneratorFeeYearStatisticsInnerServiceSMOImpl.java
@@ -3,19 +3,19 @@
import com.alibaba.fastjson.JSONObject;
import com.java110.core.factory.GenerateCodeFactory;
import com.java110.core.smo.IComputeFeeSMO;
import com.java110.dto.RoomDto;
import com.java110.dto.room.RoomDto;
import com.java110.dto.fee.FeeDto;
import com.java110.dto.report.ReportCarDto;
import com.java110.dto.report.ReportFeeDetailDto;
import com.java110.dto.report.ReportFeeDto;
import com.java110.dto.report.ReportRoomDto;
import com.java110.dto.reportFeeYearCollection.ReportFeeYearCollectionDto;
import com.java110.dto.reportFeeYearCollectionDetail.ReportFeeYearCollectionDetailDto;
import com.java110.dto.reportFee.ReportFeeYearCollectionDto;
import com.java110.dto.reportFee.ReportFeeYearCollectionDetailDto;
import com.java110.intf.report.IGeneratorFeeYearStatisticsInnerServiceSMO;
import com.java110.intf.user.IOwnerCarInnerServiceSMO;
import com.java110.po.reportFeeMonthStatistics.ReportFeeMonthStatisticsPo;
import com.java110.po.reportFeeYearCollection.ReportFeeYearCollectionPo;
import com.java110.po.reportFeeYearCollectionDetail.ReportFeeYearCollectionDetailPo;
import com.java110.po.reportFee.ReportFeeMonthStatisticsPo;
import com.java110.po.reportFee.ReportFeeYearCollectionPo;
import com.java110.po.reportFee.ReportFeeYearCollectionDetailPo;
import com.java110.report.dao.IReportCommunityServiceDao;
import com.java110.report.dao.IReportFeeServiceDao;
import com.java110.report.dao.IReportFeeYearCollectionDetailServiceDao;
@@ -258,15 +258,17 @@
        configStartTime.setTime(tmpReportFeeDto.getConfigEndTime());
        int endYear = configEndTime.get(Calendar.YEAR);
        int curYear = Calendar.getInstance().get(Calendar.YEAR) + 1;
        double feePrice = computeFeeSMOImpl.getReportFeePrice(tmpReportFeeDto, null, tmpReportCarDto);
        tmpReportFeeDto.setFeePrice(feePrice);
        FeeDto feeDto = BeanConvertUtil.covertBean(tmpReportFeeDto, FeeDto.class);
        //刷入欠费金额
        computeFeeSMOImpl.computeEveryOweFee(feeDto);
        if (endYear > curYear) {
            endYear = curYear;
        }
        for (int year = startYear; year <= endYear; year++) {
            computeYearFee(year, tmpReportFeeDto, reportFeeYearCollectionPo);
            computeYearFee(year, feeDto, reportFeeYearCollectionPo);
        }
    }
@@ -351,15 +353,16 @@
        //当前年
        int curYear = Calendar.getInstance().get(Calendar.YEAR) + 1;
        double feePrice = computeFeeSMOImpl.getReportFeePrice(tmpReportFeeDto, reportRoomDto, null);
        tmpReportFeeDto.setFeePrice(feePrice);
        FeeDto feeDto = BeanConvertUtil.covertBean(tmpReportFeeDto, FeeDto.class);
        //刷入欠费金额
        computeFeeSMOImpl.computeEveryOweFee(feeDto);
        if (endYear > curYear) {
            endYear = curYear;
        }
        for (int year = startYear; year <= endYear; year++) {
            computeYearFee(year, tmpReportFeeDto, reportFeeYearCollectionPo);
            computeYearFee(year, feeDto, reportFeeYearCollectionPo);
        }
    }
@@ -367,10 +370,10 @@
     * 计算指定年的数据
     *
     * @param year
     * @param tmpReportFeeDto
     * @param feeDto
     * @param reportFeeYearCollectionPo
     */
    private void computeYearFee(int year, ReportFeeDto tmpReportFeeDto, ReportFeeYearCollectionPo reportFeeYearCollectionPo) {
    private void computeYearFee(int year, FeeDto feeDto, ReportFeeYearCollectionPo reportFeeYearCollectionPo) {
        int curYear = Calendar.getInstance().get(Calendar.YEAR);
        ReportFeeYearCollectionDetailDto reportFeeYearCollectionDetailDto = new ReportFeeYearCollectionDetailDto();
@@ -382,13 +385,13 @@
                = BeanConvertUtil.covertBeanList(reportFeeYearCollectionDetailServiceDaoImpl.getReportFeeYearCollectionDetailInfo(BeanConvertUtil.beanCovertMap(reportFeeYearCollectionDetailDto)),
                ReportFeeYearCollectionDetailDto.class);
        if (!ListUtil.isNull(reportFeeYearCollectionDetailDtos) && year != curYear) { // 说明已经处理过了 不再处理
            return;
        }
//        if (!ListUtil.isNull(reportFeeYearCollectionDetailDtos) && year != curYear) { // 说明已经处理过了 不再处理
//            return;
//        }
        double receivableAmount = getReceivableAmount(tmpReportFeeDto);
        double receivableAmount = feeDto.getFeePrice();
        double receivedAmount = getReceivedAmount(tmpReportFeeDto, year);
        double receivedAmount = getReceivedAmount(feeDto, year);
        ReportFeeYearCollectionDetailPo reportFeeYearCollectionDetailPo = null;
@@ -453,7 +456,7 @@
     * @param tmpReportFeeDto
     * @return
     */
    private double getReceivedAmount(ReportFeeDto tmpReportFeeDto, int year) {
    private double getReceivedAmount(FeeDto tmpReportFeeDto, int year) {
        ReportFeeDetailDto feeDetailDto = new ReportFeeDetailDto();
        feeDetailDto.setConfigId(tmpReportFeeDto.getConfigId());
        feeDetailDto.setPayerObjId(tmpReportFeeDto.getPayerObjId());