package jnpf.personnels.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import jnpf.model.personnels.dto.rewardspunishments.*;
import jnpf.model.personnels.dto.salary.FtbSalaryMetaDataQueryDto;
import jnpf.model.personnels.po.FtbPersonnelsRewardsPunishments;
import jnpf.model.personnels.vo.rewardspunishments.*;
import jnpf.model.personnels.vo.rewardspunishments.FtbEmployeeRewardRecordsVO;
import jnpf.model.personnels.vo.rewardspunishments.FtbPersonnelSalaryRewardVO;
import jnpf.model.personnels.vo.rewardspunishments.FtbPersonnelsRewardsPunishmentApprovalVO;
import jnpf.model.personnels.vo.rewardspunishments.FtbPersonnelsRewardsPunishmentQueryVO;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import jnpf.model.personnels.vo.rewardspunishments.*;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.InputStream;
import java.math.BigDecimal;
import java.util.Date;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.InputStream;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 人事奖惩表 服务类
 * </p>
 *
 * @author wcx
 * @since 2024-05-08
 */
public interface FtbPersonnelsRewardsPunishmentsService extends IService<FtbPersonnelsRewardsPunishments> {

    /**
     * 添加奖惩记录
     *
     * @param ftbPersonnelsRewardsPunishmentsAddDTO 奖惩记录添加数据传输对象
     */
    void add(FtbPersonnelsRewardsPunishmentsAddDTO ftbPersonnelsRewardsPunishmentsAddDTO);

    /**
     * 删除奖惩记录
     *
     * @param id 奖惩记录的唯一标识
     */
    void delete(String id);

    /**
     * 更新奖惩记录数据
     *
     * @param ftbPersonnelsRewardsPunishmentsUpdateDTO 奖惩记录更新数据传输对象
     */
    void updateData(FtbPersonnelsRewardsPunishmentsUpdateDTO ftbPersonnelsRewardsPunishmentsUpdateDTO);

    /**
     * 启用或停用奖惩记录
     *
     * @param ftbPersonnelsRewardsPunishmentStartDTO 启用或停用奖惩记录的数据传输对象
     */
    void startAndStop(FtbPersonnelsRewardsPunishmentStartDTO ftbPersonnelsRewardsPunishmentStartDTO);

    /**
     * 调整奖惩记录的顺序
     *
     * @param ftbPersonnelsRewardsPunishmentExchangeOrderDTO 调整顺序的数据传输对象
     */
    void exchangeOrder(FtbPersonnelsRewardsPunishmentExchangeOrderDTO ftbPersonnelsRewardsPunishmentExchangeOrderDTO);

    /**
     * 查询奖惩记录列表
     *
     * @param rewardsPunishmentQueryDTO 奖惩记录查询数据传输对象
     * @return 奖惩记录查询结果列表
     */
    List<FtbPersonnelsRewardsPunishmentQueryVO> listQuery(FtbPersonnelsRewardsPunishmentQueryDTO rewardsPunishmentQueryDTO);

    /**
     * 查询待审批的奖惩记录列表
     *
     * @param type 奖惩类型（奖励或惩罚）
     * @return 待审批的奖惩记录列表
     */
    List<FtbPersonnelsRewardsPunishmentApprovalVO> listApproval(Integer type);

    /**
     * 查询工资奖励记录列表
     *
     * @param ftbPersonnelSalaryRewardDTO 工资奖励记录查询数据传输对象
     * @return 工资奖励记录列表
     */
    List<FtbPersonnelSalaryRewardVO> salaryReward(FtbPersonnelSalaryRewardDTO ftbPersonnelSalaryRewardDTO);

    /**
     * 查询总工资惩罚记录列表
     *
     * @param ftbPersonnelSalaryRewardDTO 工资惩罚记录查询数据传输对象
     * @return 工资惩罚记录列表
     */
    List<FtbPersonnelSalaryRewardVO> totalSalaryPenalty(FtbPersonnelSalaryRewardDTO ftbPersonnelSalaryRewardDTO);

    /**
     * 根据ID查询审批金额
     *
     * @param id 奖惩记录的唯一标识
     * @return 审批金额信息
     */
    FtbPersonnelsRewardsPunishmentApprovalVO listApprovalMoney(String id);

    /**
     * @param type     奖惩类型
     * @param typeName 类型名称
     * @return :java.math.BigDecimal 金额
     * @decription 薪酬获取人事奖惩金额
     * @date 2024/11/5 17:27
     * @author AoTeMan
     */
    BigDecimal salaryMetaDataQuery(FtbSalaryMetaDataQueryDto dto);

    /**
     * 批量查询奖惩
     */
    List<FtbXcEmployeeRewardRecordsVO> salaryBatchMetaDataQuery(FtbSalaryMetaDataQueryDto dto);

    /**
     * 查询员工奖惩记录
     *
     * @param page     分页对象
     * @param queryDTO 奖惩记录查询数据传输对象
     * @return 员工奖惩记录分页结果
     */
    Page<FtbEmployeeRewardRecordsVO> employeeRewardAndPunishmentRecords(Page<FtbEmployeeRewardRecordsVO> page, FtbEmployeeRewardRecordsQueryDTO queryDTO);

    Map<String, Object> importData(InputStream inputStream) throws IOException;

    void importDataClick(Integer type, String orgId);

    void saveDataToRedis(List<FtbEmploymentRewardExcelVO> nomarlData, List<FtbEmploymentRecordsExcelERRVO> errorData);

    void deleteUserInfo(String id, Integer type);

    void exportErrData(HttpServletResponse response) throws IOException;

    FtbEmployeeRewardRecordsVO queryDetail(String id);
}
