package com.engine.salary.cmd.sicategory;

import com.engine.common.biz.AbstractCommonCommand;
import com.engine.common.entity.BizLogContext;
import com.engine.core.interceptor.CommandContext;
import com.engine.salary.biz.SICategoryBiz;
import com.engine.salary.entity.sicategory.dto.ICategoryFormDTO;
import weaver.hrm.User;

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

/**
 * @Author weaver_cl
 * @Description:
 * @Date 2022/3/9
 * @Version V1.0
 **/
public class SICategoryInsertCmd extends AbstractCommonCommand<Map<String, Object>> {

    public SICategoryInsertCmd(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<>(16);
        SICategoryBiz siCategoryBiz = new SICategoryBiz();
        ICategoryFormDTO iCategoryFormDTO = (ICategoryFormDTO)params.get("iCategoryFormDTO");
        siCategoryBiz.save(iCategoryFormDTO,(long) user.getUID());
        return apidatas;
    }
}
