package com.engine.salary.cmd.TaxRate;

import com.engine.common.biz.AbstractCommonCommand;
import com.engine.common.entity.BizLogContext;
import com.engine.core.interceptor.CommandContext;
import com.engine.salary.biz.TaxRateBiz;
import com.engine.salary.entity.taxrate.param.TaxRateSaveParam;
import weaver.hrm.User;

import java.util.HashMap;
import java.util.Map;

public class TaxRateUpdateCmd extends AbstractCommonCommand<Map<String, Object>> {

    public TaxRateUpdateCmd(Map<String, Object> params, User user) {
        this.user = user;
        this.params = params;
    }

    @Override
    public BizLogContext getLogContext() {
        return null;
    }

    @Override
    public Map<String, Object> execute(CommandContext commandContext) {
        Map<String, Object> apidatas = new HashMap<String, Object>(16);
        TaxRateBiz taxRateBiz = new TaxRateBiz();
        TaxRateSaveParam taxRateSaveParam = (TaxRateSaveParam) params.get("taxRateSaveParam");
        taxRateBiz.update(taxRateSaveParam, (long) user.getUID());
        return apidatas;
    }
}
