# CompRoomReportLogServiceImpl.java

    package cloud.wconnect.frontoffice.service.comproom.impl;

    import cloud.wconnect.commonlib.pojo.dto.PropertyDTO;
    import cloud.wconnect.commonlib.util.DateTimeUtils;
    import cloud.wconnect.frontoffice.entity.comproom.CompRoomReportLog;
    import cloud.wconnect.frontoffice.mapper.comproom.CompRoomReportLogMapper;
    import cloud.wconnect.frontoffice.service.comproom.ICompRoomReportLogService;
    import com.baomidou.dynamic.datasource.annotation.DS;
    import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
    import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
    import org.springframework.stereotype.Service;

    import java.util.List;

    /**
     * <p>
     * 免费房报告导入记录表 服务实现类
     * </p>
     *
     * @author lichen
     * @since 2024-03-13
     */
    @DS("logbook")
    @Service
    public class CompRoomReportLogServiceImpl extends ServiceImpl<CompRoomReportLogMapper, CompRoomReportLog> implements ICompRoomReportLogService {

        /**
         * 查询报告处理记录
         *
         * @param propertyId 资产Id
         * @return java.util.List<cloud.wconnect.frontoffice.entity.comproom.CompRoomReportLog>
         * @author lichen
         * @date 2024/3/13
         */
        @Override
        public List<CompRoomReportLog> listByPropertyId(Integer propertyId) {
            return list(new LambdaQueryWrapper<CompRoomReportLog>()
                    .eq(CompRoomReportLog::getPropertyId, propertyId));
        }

        /**
         * 保存报告处理时刻
         *
         * @param propertyDTO 资产
         * @param reportType  报告类型
         * @param userId      用户Id
         * @return void
         * @author lichen
         * @date 2024/3/14
         */
        @Override
        public void save(PropertyDTO propertyDTO, Integer reportType, Integer userId) {
            CompRoomReportLog compRoomReportLog = new CompRoomReportLog();
            compRoomReportLog.setTenantId(propertyDTO.getTenantId());
            compRoomReportLog.setPropertyId(propertyDTO.getId());
            compRoomReportLog.setReportType(reportType);
            compRoomReportLog.setProcessTime(DateTimeUtils.dateTimeNowOfSecond(propertyDTO.getTimezone()));
            compRoomReportLog.setProcessBy(userId);
            baseMapper.saveOrUpdateByUnique(compRoomReportLog);
        }
    }