# HotelKpiManagerFlashPostProcessor.java

    package cloud.wconnect.workperformance.businesstask.hotelkpi;

    import cloud.wconnect.commonlib.businesstask.postprocessor.IReportMissedPostProcessor;
    import cloud.wconnect.commonlib.cons.ReportImportResultCons;
    import cloud.wconnect.commonlib.pojo.dto.PropertyDTO;
    import cloud.wconnect.commonlib.pojo.dto.ReportMissedDTO;
    import cloud.wconnect.workperformance.cons.BusinessEnum;
    import cloud.wconnect.workperformance.cons.EventSubjectEnum;
    import cloud.wconnect.workperformance.cons.hotelkpi.HotelKpiReportCategoryEnum;
    import cloud.wconnect.workperformance.service.hotelkpi.IHotelKpiImportLogService;
    import cloud.wconnect.workperformance.service.hotelkpi.IHotelKpiReportService;
    import jakarta.annotation.Resource;
    import org.springframework.stereotype.Service;

    import java.util.List;

    /**
     * Service: manager-flash/service-mtd--1d 报告缺失后置处理类
     *
     * @author zc
     * @date 2024/7/11
     */
    @Service
    public class HotelKpiManagerFlashPostProcessor implements IReportMissedPostProcessor {

        @Resource
        private IHotelKpiImportLogService importLogService;
        @Resource
        private IHotelKpiReportService reportService;

        /**
         * 是否支持
         *
         * @param reportMissedDTO 报告缺失后置处理程序 DTO
         * @return boolean
         * @author zc
         * @date 2024/7/11
         */
        @Override
        public boolean supports(ReportMissedDTO reportMissedDTO) {
            return reportMissedDTO.getBusiness().equals(BusinessEnum.HOTEL_KPI.getBusiness())
                    && reportMissedDTO.getSubject().equals(EventSubjectEnum.MANAGER_FLASH_SERVICE_MTD_YESTERDAY.getSubject());
        }

        /**
         * 后置处理
         *
         * @param reportMissedDTO 报告缺失后置处理程序 DTO
         * @author zc
         * @date 2024/7/11
         */
        @Override
        public void afterPostProcess(ReportMissedDTO reportMissedDTO) {
            PropertyDTO propertyDTO = reportMissedDTO.getPropertyDTO();
            // 报告数据日期
            List<Long> dateRange = reportService.getDateRange(propertyDTO.getTimezone(),
                    HotelKpiReportCategoryEnum.MANAGER_FLASH.getCategory());
            // 保存异常记录
            importLogService.save(propertyDTO, dateRange, "", ReportImportResultCons.IMPORT_RESULT_MISSED,
                    HotelKpiReportCategoryEnum.MANAGER_FLASH.getCategory(), 0);
        }

    }