package com.engine.salary.report.service;

import com.engine.salary.report.entity.param.SalaryStatisticsDataPerspectiveQueryParam;
import com.engine.salary.report.entity.param.SalaryStatisticsReportDataQueryParam;
import com.engine.salary.report.entity.param.SalaryStatisticsReportSaveParam;
import com.engine.salary.report.entity.param.SalaryStatisticsSearchConditionSaveParam;
import com.engine.salary.report.entity.po.SalaryStatisticsDimensionPO;
import com.engine.salary.report.entity.po.SalaryStatisticsItemPO;
import com.engine.salary.report.entity.po.SalaryStatisticsReportPO;
import com.engine.salary.util.page.PageInfo;

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

/**
 * 薪酬报表自定义统计项目
 * <p>Copyright: Copyright (c) 2022</p>
 * <p>Company: 泛微软件</p>
 *
 * @author qiantao
 * @version 1.0
 **/
public interface SalaryStatisticsReportService  {

    /**
     * 获取所有薪酬报表
     *
     * @return
     */
    List<SalaryStatisticsReportPO> listAll();

    /**
     * 获取薪酬报表列表
     *
     * @return
     */
    List<SalaryStatisticsReportPO> list();

    /**
     * 根据创建人获取薪酬报表列表
     *
     * @return
     */
    List<SalaryStatisticsReportPO> listByCreator(Long uid);

    /**
     * 获取单个薪酬统计报表
     *
     * @param id
     * @return
     */
    SalaryStatisticsReportPO getById(Long id);

    List<SalaryStatisticsReportPO> getByIds(List<Long> ids);

    /**
     * 保存薪酬统计报表
     *
     * @param saveParam
     * @return
     */
    String save(SalaryStatisticsReportSaveParam saveParam );

    /**
     * 删除薪酬统计报表
     *
     * @param ids
     * @return
     */
    Map<String, Object> delete(Collection<Long> ids );

    /**
     * 复制
     * @param id
     */
    void duplicate(Long id);


    /**
     * 保存统计范围
     *
     * @param param
     * @return
     */
    String saveSearchCondition(SalaryStatisticsSearchConditionSaveParam param);

    /**
     * 构建报表分页统计记录
     *
     *
     * @param dimension
     * @param param
     * @param salaryStatisticsItemList
     * @return
     */
    PageInfo<Map<String, Object>> buildReportRecords(SalaryStatisticsDimensionPO dimension, SalaryStatisticsReportDataQueryParam param,  List<SalaryStatisticsItemPO> salaryStatisticsItemList);

    /**
     * 构建数据透视记录
     *
     * @param param
     * @param reportPO 报表po
     * @param dimension 维度po
     * @param salaryStatisticsItemPOS 自定义统计项目List
     * @return
     */
    PageInfo<Map<String, Object>>  buildDataPerspectiveRecords(SalaryStatisticsDataPerspectiveQueryParam param, SalaryStatisticsReportPO reportPO, SalaryStatisticsDimensionPO dimension, List<SalaryStatisticsItemPO> salaryStatisticsItemPOS);


    /**
     * 清除报表缓存
     */
    void removeReportCache();

}
