package com.engine.salary.wrapper;

import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service;
import com.engine.salary.entity.extemp.param.ExtEmpImportParam;
import com.engine.salary.entity.extemp.param.ExtEmpQueryParam;
import com.engine.salary.entity.extemp.param.ExtEmpSaveParam;
import com.engine.salary.entity.extemp.po.ExtEmpPO;
import com.engine.salary.service.ExtEmpService;
import com.engine.salary.service.impl.ExtEmpServiceImpl;
import com.engine.salary.util.page.PageInfo;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import weaver.hrm.User;

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

/**
 * 累计专项
 * <p>Copyright: Copyright (c) 2022</p>
 * <p>Company: 泛微软件</p>
 *
 * @author qiantao
 * @version 1.0
 **/
public class ExtEmpWrapper extends Service {

    private ExtEmpService getExtEmpService(User user) {
        return ServiceUtil.getService(ExtEmpServiceImpl.class, user);
    }


    public PageInfo<ExtEmpPO> listPage(ExtEmpQueryParam param) {
        return getExtEmpService(user).listPage(param);
    }

    public void save(ExtEmpSaveParam param) {
        getExtEmpService(user).save(param);
    }

    public void update(ExtEmpSaveParam param) {
        getExtEmpService(user).update(param);
    }

    public void delete(Collection<Long> ids) {
        getExtEmpService(user).delete(ids);
    }

    public ExtEmpPO detail(Long id) {
        return getExtEmpService(user).getById(id);
    }

    public XSSFWorkbook exportImportTemplate() {
        return getExtEmpService(user).exportImportTemplate();
    }

    public Map<String, Object> previewImportExtEmp(ExtEmpImportParam param) {
        return getExtEmpService(user).previewImportExtEmp(param);
    }

    public Map<String, Object>  importExtEmp(ExtEmpImportParam param) {
        return getExtEmpService(user).importExtEmp(param);
    }

}
