package com.engine.salary.service;

import com.engine.salary.entity.datacollection.AddUpDeduction;
import com.engine.salary.entity.datacollection.dto.AddUpDeductionDTO;
import com.engine.salary.entity.datacollection.dto.AddUpDeductionRecordDTO;
import com.engine.salary.entity.datacollection.param.AddUpDeductionImportParam;
import com.engine.salary.entity.datacollection.param.AddUpDeductionQueryParam;
import com.engine.salary.entity.datacollection.param.AddUpDeductionRecordDeleteParam;
import com.engine.salary.entity.datacollection.param.AddUpDeductionRecordParam;
import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO;
import com.engine.salary.util.page.PageInfo;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;

import java.time.YearMonth;
import java.util.Date;
import java.util.List;
import java.util.Map;

public interface AddUpDeductionService {


    /**
     * 查询条件
     * @param params
     * @return
     */
    Map<String, Object> getSearchCondition(Map<String, Object> params);

    /**
     * 导入
     * @param importParam
     * @return
     */
    Map<String, Object> importAddUpDeduction(AddUpDeductionImportParam importParam);


    /**
     * 预览
     * @param importParam
     * @return
     */
    Map<String, Object> preview(AddUpDeductionImportParam importParam );


    /**
     * 下载模板
     * @param isChief
     * @param queryParam
     * @return
     */
    XSSFWorkbook downloadTemplate(boolean isChief,AddUpDeductionQueryParam queryParam);


    /**
     * 通过id获取单条累计专项附加扣除记录
     *
     * @param id
     * @return
     */
    AddUpDeduction getById(Long id);

    /**
     * 数据采集-累计专项附加扣除列表(分页)
     *
     * @param queryParam
     * @return
     */
    PageInfo<AddUpDeductionDTO> listPage(AddUpDeductionQueryParam queryParam);

    /**
     * 获取数据采集-累计专项附加扣除详情列表（分页）
     *
     * @param queryParam
     * @return
     */
    PageInfo<AddUpDeductionRecordDTO> recordListPage(AddUpDeductionQueryParam queryParam);

    /**
     * 导出
     *
     * @param queryParam
     */
    XSSFWorkbook export( AddUpDeductionQueryParam queryParam);

    /**
     * 导出详情
     *
     * @param beLongEmployeeId
     * @param isChief
     * @param queryParam
     */
    XSSFWorkbook exportDetail(Long beLongEmployeeId, boolean isChief, AddUpDeductionQueryParam queryParam);

    /**
     * 获取累计专项附加扣除数据
     *
     * @param declareMonth
     * @param employeeIds
     * @return
     */
    List<AddUpDeduction> getAddUpDeductionList(YearMonth declareMonth, List<Long> employeeIds, Long taxAgentId);

    /**
     * 根据年月获取已核算数据
     *
     * @param yearMonth
     * @return
     */
    List<SalaryAcctEmployeePO> getAccountedEmployeeData(String yearMonth);

    List<SalaryAcctEmployeePO> getAccountedEmployeeDataByTaxYearMonth(String yearMonth);

    /**
     * @description 编辑累计专项附加扣除
     * @return void
     * @author Harryxzy
     * @date 2022/10/25 14:09
     */
    void editAddUpDeduction(AddUpDeductionRecordParam addUpDeduction);

    /**
     * @description 累计专项附加扣除
     * @return void
     * @author Harryxzy
     * @date 2022/10/26 14:24
     */
    void createAddUpDeduction(AddUpDeductionRecordParam addUpDeductionRecordParam);

    /**
     * @description 删除所选
     * @return void
     * @author Harryxzy
     * @date 2022/10/26 16:34
     */
    void deleteSelectAddUpDeduction(AddUpDeductionRecordDeleteParam deleteParam);

    /**
     * @description 一键清空
     * @return void
     * @author Harryxzy
     * @date 2022/10/26 16:35
     */
    void deleteAllAddUpDeduction(AddUpDeductionRecordDeleteParam deleteParam);

    /**
     * @description 获取累计专项附加扣除详情
     * @return void
     * @author Harryxzy
     * @date 2022/10/31 11:33
     */
    AddUpDeductionRecordDTO getAddUpDeduction(AddUpDeductionQueryParam id);

    /**
     * 自动累计专项附加扣除
     * @return void
     * @author lfc
     */
    String autoAddAll(Date yearMonth, Boolean isAdmin, List<Long> taxAgentIds);
}
