# RevenueHistoryAndForecastThisMonthFuturePostProcessor.java

    package cloud.wconnect.rateshop.businesstask.revenue;

    import cloud.wconnect.commonlib.businesstask.postprocessor.IReportMissedPostProcessor;
    import cloud.wconnect.commonlib.cons.BaseConstant;
    import cloud.wconnect.commonlib.cons.ReportImportResultCons;
    import cloud.wconnect.commonlib.pojo.dto.PropertyDTO;
    import cloud.wconnect.commonlib.pojo.dto.ReportMissedDTO;
    import cloud.wconnect.rateshop.cons.BusinessEnum;
    import cloud.wconnect.rateshop.cons.EventSubjectEnum;
    import cloud.wconnect.rateshop.cons.revenue.RevenueImportCons;
    import cloud.wconnect.rateshop.service.revenue.IRevenueImportLogService;
    import cloud.wconnect.rateshop.service.revenue.IRevenueImportService;
    import org.springframework.beans.factory.annotation.Autowired;
    import org.springframework.stereotype.Service;

    import java.util.List;

    /**
     * Service: History And ForecastPost This Month Future 报告缺失后续逻辑处理
     * @author yyt
     * 2024/5/21
     */
    @Service
    public class RevenueHistoryAndForecastThisMonthFuturePostProcessor implements IReportMissedPostProcessor {

        @Autowired
        private IRevenueImportLogService revenueImportLogService;
        @Autowired
        private IRevenueImportService revenueImportService;

        private static final String SUBJECT = EventSubjectEnum.HISTORY_AND_FORECAST_SERVICE_THIS_MONTH_FUTURE.getSubject();

        private static final String BUSINESS = BusinessEnum.REVENUE.getBusiness();

        @Override
        public boolean supports(ReportMissedDTO reportMissedDTO) {
            return reportMissedDTO.getBusiness().equals(BUSINESS) && reportMissedDTO.getSubject().equals(SUBJECT);
        }

        @Override
        public void afterPostProcess(ReportMissedDTO reportMissedDTO) {
            PropertyDTO property = reportMissedDTO.getPropertyDTO();
            List<Long> dates = revenueImportService.listImportHistoryAndForecastThisMonthFutureDateRange(property.getTimezone());
            revenueImportLogService.handleSaveSystemImportRecord(property, RevenueImportCons.HISTORY_FORECAST_THIS_MONTH_FUTURE,
                    BaseConstant.LONG_ZERO, dates.get(0), dates.get(1), ReportImportResultCons.IMPORT_RESULT_MISSED, null);
        }

    }