package com.engine.salary.service;

import com.engine.salary.entity.datacollection.DataCollectionEmployee;
import com.engine.salary.entity.salaryacct.param.SalaryAcctCheckParam;
import com.engine.salary.entity.salaryacct.param.SalaryCheckResultQueryParam;
import com.engine.salary.entity.salaryacct.po.SalaryCheckResultPO;
import com.engine.salary.util.page.PageInfo;

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

/**
 * 校验异常
 * <p>Copyright: Copyright (c) 2022</p>
 * <p>Company: 泛微软件</p>
 *
 * @author qiantao
 * @version 1.0
 **/
public interface SalaryCheckResultService {

    /**
     * 按照薪资核算记录id统计薪资核算结果的校验异常数量
     *
     * @param salaryAcctRecordId 薪资核算记录id
     * @return
     */
    Integer countBySalaryAcctRecordId(Long salaryAcctRecordId);

    /**
     * 根据主键id获取单个校验异常
     *
     * @param id        主键id
     * @return
     */
    SalaryCheckResultPO getById(Long id);

    /**
     * 根据薪资核算记录id查询校验异常
     *
     * @param salaryAcctRecordId 薪资核算记录id
     * @return
     */
    List<SalaryCheckResultPO> listBySalaryAcctRecordId(Long salaryAcctRecordId);

    /**
     * 根据薪资核算记录id、是否忽略查询校验异常
     *
     * @param salaryAcctRecordId 薪资核算记录id
     * @param ignoreType         是否忽略
     * @return
     */
    List<SalaryCheckResultPO> listBySalaryAcctRecordIdAndIgnoreType(Long salaryAcctRecordId, Integer ignoreType);

    /**
     * 根据列表查询条件查询校验异常
     *
     * @param queryParam 列表查询条件
     * @return
     */
    PageInfo<SalaryCheckResultPO> listPageByParam(SalaryCheckResultQueryParam queryParam);

    /**
     * 批量保存
     *
     * @param salaryCheckResultPOS
     */
    void batchSave(Collection<SalaryCheckResultPO> salaryCheckResultPOS);

    /**
     * 更新是否忽略
     *
     * @param id        校验异常的主键id
     */
    void updateIgnoreTypeById(Long id);

    /**
     * 更新是否忽略
     *
     * @param salaryAcctRecordId 薪资核算记录id
     */
    void updateIgnoreTypeBySalaryAcctRecordId(Long salaryAcctRecordId);

    /**
     * 根据主键id删除校验异常
     *
     * @param ids       主键id
     */
    void deleteByIds(Collection<Long> ids);

    /**
     * 根据薪资核算记录id删除校验异常
     *
     * @param salaryAcctRecordIds 薪资核算记录id
     */
    void deleteBySalaryAcctRecordIds(Collection<Long> salaryAcctRecordIds);

    /**
     * 薪资核算-校验
     *
     * @param checkParam
     * @param fromCalculate
     * @param simpleEmployee
     */
    void check(SalaryAcctCheckParam checkParam, boolean fromCalculate, DataCollectionEmployee simpleEmployee);
}
