package com.engine.salary.report.service;

import com.engine.salary.common.BaseQueryParam;
import com.engine.salary.report.entity.dto.SalaryStatisticsPushDetail;
import com.engine.salary.report.entity.dto.SalaryStatisticsPushTableDTO;
import com.engine.salary.report.entity.param.SalaryStatisticsPushDetailParam;
import com.engine.salary.report.entity.param.SalaryStatisticsPushParam;
import com.engine.salary.report.entity.po.SalaryStatisticsPushPO;
import com.engine.salary.util.page.PageInfo;

import java.util.List;
import java.util.Map;

/**
 * @author Harryxzy
 * @ClassName SalaryStatisticsPushService
 * @date 2023/09/11 10:15
 * @description 薪酬统计报表消息推送
 */
public interface SalaryStatisticsPushService {
    Map<String, Object> getPushForm();

    /**
     * 获取分享记录列表
     * @param baseQueryParam
     */
    PageInfo<SalaryStatisticsPushTableDTO> getPushTable(BaseQueryParam baseQueryParam);

    /**
     * 获取发送消息记录详情
     * @param param
     * @return
     */
    SalaryStatisticsPushDetail getPushDetail(SalaryStatisticsPushDetailParam param);

    /**
     * 分享报表
     * @param param
     */
    void push(SalaryStatisticsPushParam param);

    void addSharedPush(SalaryStatisticsPushParam param);

    // void rePush(Long id, Long employeeId, String tenantKey);

    /**
     * 撤回分享
     * @param id 分享明细id
     */
    void cancel(Long id);

    /**
     * 撤回该批次所有分享
     * @param id 分享批次id
     */
    void cancelAll(Long id);

//    SalaryStatisticsPushPO getById(Long id, String tenantKey);

//    List<SalaryStatisticsPushDetailPO> getPushDetailsById(Long batchId, String tenantKey);

    void updateReportViewStatus(List<Long> batchId, Long uid);

//    void sendViewedMsg(Long batchId, Long reportId, Long employeeId, String tenantKey);

    /**
     * 根据用户获取有效（没有过期、撤回）的分享记录
     * @param uid
     * @return
     */
    List<SalaryStatisticsPushPO> getSuccessPushListByReceiver(Long uid);

    /**
     * 根据报表id、分享批次id获取有效的分享记录
     * @param reportId
     * @return
     */
    List<SalaryStatisticsPushPO> getPushListByReportIdAndIds(Long reportId, List<Long> ids);

    /**
     * 校验当前登录人员是否有权查看被分享的报表
     * @param reportId
     * @return
     */
    List<SalaryStatisticsPushPO> shareReportValid(Long reportId, Long uid);
}
