java110
2021-02-25 f1627e52fa6e9fea7b34731beaa55dc0222344da
service-report/src/main/java/com/java110/report/smo/impl/GeneratorFeeMonthStatisticsInnerServiceSMOImpl.java
@@ -238,10 +238,10 @@
        Date targetEndDate = (Date) targetEndDateAndOweMonth.get("targetEndDate");
        tmpReportFeeDto.setDeadlineTime(targetEndDate);
        double receivableAmount = getReceivableAmountByCar(tmpReportFeeDto, null, tmpReportCarDto); //应收
        double oweAmount = getOweAmountByCar(tmpReportFeeDto, null, tmpReportCarDto); //应收
        dealBeforeUploadCarFee(tmpReportFeeDto, tmpReportCarDto);
        double oweAmount = getOweAmount(tmpReportFeeDto, receivableAmount, receivedAmount); //欠费
        double receivableAmount = getReceivableAmount(tmpReportFeeDto,receivedAmount); //欠费
        ReportFeeMonthStatisticsPo reportFeeMonthStatisticsPo = new ReportFeeMonthStatisticsPo();
@@ -268,7 +268,7 @@
            reportFeeMonthStatisticsPo.setObjId(tmpReportCarDto.getCarId());
            reportFeeMonthStatisticsPo.setObjType(FeeDto.PAYER_OBJ_TYPE_CAR);
            reportFeeMonthStatisticsPo.setFeeName(tmpReportFeeDto.getFeeName());
            reportFeeMonthStatisticsPo.setObjName(tmpReportCarDto.getCarNum() + "(" + tmpReportCarDto.getAreaNum() + "停车场" + tmpReportCarDto.getNum() + "车位");
            reportFeeMonthStatisticsPo.setObjName(tmpReportCarDto.getCarNum() + "(" + tmpReportCarDto.getAreaNum() + "停车场" + tmpReportCarDto.getNum() + "车位)");
            reportFeeMonthStatisticsPo.setUpdateTime(DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_A));
            reportFeeMonthStatisticsServiceDaoImpl.saveReportFeeMonthStatisticsInfo(BeanConvertUtil.beanCovertMap(reportFeeMonthStatisticsPo));
        }
@@ -327,6 +327,11 @@
        if (statistics != null && statistics.size() > 0) {
            return;
        }
        if (tmpReportFeeDto.getDeadlineTime().getTime() < curMonthDate.getTime().getTime()) {
            curMonthDate.setTime(tmpReportFeeDto.getDeadlineTime());
        }
        double receivableAmount = 0.0;
        if (FeeDto.FEE_FLAG_ONCE.equals(tmpReportFeeDto.getFeeFlag())) {
            receivableAmount = tmpReportFeeDto.getFeePrice();
@@ -353,7 +358,7 @@
        reportFeeMonthStatisticsPo.setObjId(tmpReportCarDto.getCarId());
        reportFeeMonthStatisticsPo.setObjType(FeeDto.PAYER_OBJ_TYPE_CAR);
        reportFeeMonthStatisticsPo.setFeeName(tmpReportFeeDto.getFeeName());
        reportFeeMonthStatisticsPo.setObjName(tmpReportCarDto.getCarNum() + "(" + tmpReportCarDto.getAreaNum() + "停车场" + tmpReportCarDto.getNum() + "车位");
        reportFeeMonthStatisticsPo.setObjName(tmpReportCarDto.getCarNum() + "(" + tmpReportCarDto.getAreaNum() + "停车场" + tmpReportCarDto.getNum() + "车位)");
        reportFeeMonthStatisticsPo.setUpdateTime(DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_A));
        reportFeeMonthStatisticsServiceDaoImpl.saveReportFeeMonthStatisticsInfo(BeanConvertUtil.beanCovertMap(reportFeeMonthStatisticsPo));
@@ -413,12 +418,12 @@
        Date targetEndDate = (Date) targetEndDateAndOweMonth.get("targetEndDate");
        tmpReportFeeDto.setDeadlineTime(targetEndDate);
        double receivableAmount = getReceivableAmount(tmpReportFeeDto, reportRoomDto, null); //应收
        double oweAmount = getOweAmount(tmpReportFeeDto, reportRoomDto, null); //欠费
        double receivableAmount = getReceivableAmount(tmpReportFeeDto, receivedAmount); //应收
        //解决上线时 之前欠费没有刷入导致费用金额对不上问题处理
        dealBeforeUploadRoomFee(reportRoomDto, tmpReportFeeDto, receivableAmount);
        double oweAmount = getOweAmount(tmpReportFeeDto, receivableAmount, receivedAmount); //欠费
        ReportFeeMonthStatisticsPo reportFeeMonthStatisticsPo = new ReportFeeMonthStatisticsPo();
@@ -503,6 +508,10 @@
            return;
        }
        if (tmpReportFeeDto.getDeadlineTime().getTime() < curMonthDate.getTime().getTime()) {
            curMonthDate.setTime(tmpReportFeeDto.getDeadlineTime());
        }
        ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto = new ReportFeeMonthStatisticsDto();
        reportFeeMonthStatisticsDto.setCommunityId(reportRoomDto.getCommunityId());
        reportFeeMonthStatisticsDto.setConfigId(tmpReportFeeDto.getConfigId());
@@ -558,14 +567,16 @@
     * 当月欠费
     *
     * @param tmpReportFeeDto
     * @param receivableAmount
     * @param receivedAmount
     * @return
     */
    private double getOweAmount(ReportFeeDto tmpReportFeeDto, double receivableAmount, double receivedAmount) {
    private double getReceivableAmount(ReportFeeDto tmpReportFeeDto, double receivedAmount) {
        return receivableAmount;
        //一次性费用 除以月份 平均
        if (FeeDto.FEE_FLAG_ONCE.equals(tmpReportFeeDto.getFeeFlag())) {
            return computeOnceFee(tmpReportFeeDto);
        }
        return tmpReportFeeDto.getFeePrice();
    }
@@ -591,7 +602,7 @@
     * @param tmpReportFeeDto
     * @return
     */
    private double getReceivableAmountByCar(ReportFeeDto tmpReportFeeDto, ReportRoomDto reportRoomDto, ReportCarDto reportCarDto) {
    private double getOweAmountByCar(ReportFeeDto tmpReportFeeDto, ReportRoomDto reportRoomDto, ReportCarDto reportCarDto) {
        double feePrice = computeFeeSMOImpl.getReportFeePrice(tmpReportFeeDto, reportRoomDto, reportCarDto);
        tmpReportFeeDto.setFeePrice(feePrice);
@@ -659,18 +670,18 @@
     * @param tmpReportFeeDto
     * @return
     */
    private double getReceivableAmount(ReportFeeDto tmpReportFeeDto, ReportRoomDto reportRoomDto, ReportCarDto reportCarDto) {
    private double getOweAmount(ReportFeeDto tmpReportFeeDto, ReportRoomDto reportRoomDto, ReportCarDto reportCarDto) {
        double feePrice = computeFeeSMOImpl.getReportFeePrice(tmpReportFeeDto, reportRoomDto, reportCarDto);
        tmpReportFeeDto.setFeePrice(feePrice);
        BigDecimal feePriceDec = new BigDecimal(feePrice);
        if (DateUtil.getCurrentDate().getTime() < tmpReportFeeDto.getStartTime().getTime()) {
            return computeOnceFee(tmpReportFeeDto);
            return 0.0;
        }
        if (FeeDto.FEE_FLAG_ONCE.equals(tmpReportFeeDto.getFeeFlag())) {
            return feePrice;
            return computeOnceFee(tmpReportFeeDto);
        }
        //1.0 费用到期时间和费用结束时间 都不在当月