package com.customization.salary;

import com.engine.common.util.ServiceUtil;
import com.engine.core.cfg.annotation.ServiceDynamicProxy;
import com.engine.core.cfg.annotation.ServiceMethodDynamicProxy;
import com.engine.core.impl.aop.AbstractServiceProxy;
import com.engine.salary.entity.salaryBill.param.SalarySendGrantParam;
import com.engine.salary.entity.salaryBill.param.SalarySendWithdrawParam;
import com.engine.salary.enums.salarysend.SalarySendGrantTypeEnum;
import com.engine.salary.exception.SalaryRunTimeException;
import com.engine.salary.service.SalaryBillService;
import com.engine.salary.service.SalarySendRangeService;
import com.engine.salary.service.impl.SalaryBillServiceImpl;
import com.engine.salary.service.impl.SalarySendRangeServiceImpl;
import com.engine.salary.wrapper.SalarySendWrapper;
import com.engine.salary.wrapper.proxy.SalarySendWrapperProxy;
import weaver.hrm.User;

import java.util.List;
import java.util.Map;

@ServiceDynamicProxy(target = SalarySendWrapper.class, desc = "工资单发送")
public class CustomSalarySendWrapper extends AbstractServiceProxy implements SalarySendWrapperProxy {

    private SalaryBillService getSalaryBillService(User user) {
        return ServiceUtil.getService(SalaryBillServiceImpl.class, user);
    }


    private SalarySendRangeService getSalarySendRangeService(User user) {
        return ServiceUtil.getService(SalarySendRangeServiceImpl.class, user);
    }

    @Override
    @ServiceMethodDynamicProxy(desc = "拦截工资单发送方法")
    public Map<String, Object> grant(SalarySendGrantParam queryParam) {
        //todo do some thing

        Map<String, Object> result = (Map<String, Object>) executeMethod(queryParam);

        //todo do some thing

        return result;
    }

    @Override
    public Map<String, Object> withdraw(SalarySendWithdrawParam queryParam) {
        return null;
    }
}
