package com.engine.salary.wrapper;

import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service;
import com.engine.salary.entity.salaryacct.dto.SalaryComparisonResultListDTO;
import com.engine.salary.entity.salaryacct.param.SalaryComparisonResultQueryParam;
import com.engine.salary.entity.siaccount.dto.InsuranceComparisonResultListDTO;
import com.engine.salary.entity.siaccount.param.InsuranceComparisonResultQueryParam;
import com.engine.salary.service.SIAComparisonResultService;
import com.engine.salary.service.SalaryComparisonResultService;
import com.engine.salary.service.impl.SIAComparisonResultServiceImpl;
import com.engine.salary.service.impl.SalaryComparisonResultServiceImpl;
import com.engine.salary.util.page.PageInfo;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import weaver.hrm.User;

import java.util.Map;

/**
 * @Author: sy
 * @Description: 福利核算线下对比结果
 * @Date: 2022/9/28
 **/
public class SIAComparisonResultWrapper extends Service {


    private SIAComparisonResultService getSIAComparisonResultService(User user) {
        return (SIAComparisonResultService) ServiceUtil.getService(SIAComparisonResultServiceImpl.class, user);
    }
    /**
     * 福利核算线下对比列表
     *
     * @param queryParam 列表查询条件
     * @return
     */
    public PageInfo<Map<String, Object>> listPage(InsuranceComparisonResultQueryParam queryParam) {
        // 查询薪资核算线下对比列表
        InsuranceComparisonResultListDTO salaryComparisonResultListDTO = getSIAComparisonResultService(user).listPageByParam(queryParam);

        PageInfo<Map<String, Object>> pageInfo = salaryComparisonResultListDTO.getData();
        pageInfo.setColumns(salaryComparisonResultListDTO.getWeaTableColumns());

        return pageInfo;
    }

    /**
     * 导出福利核算线下对比结果
     *
     * @param queryParam 列表查询条件
     * @return
     */
    public XSSFWorkbook exportComparisonResult(InsuranceComparisonResultQueryParam queryParam) {
        return  getSIAComparisonResultService(user).exportComparisonResult( queryParam);
    }
}
