package com.engine.salary.cmd.sischeme;

import com.engine.common.biz.AbstractCommonCommand;
import com.engine.common.entity.BizLogContext;
import com.engine.core.interceptor.CommandContext;
import com.engine.salary.biz.SISchemeBiz;
import com.engine.salary.entity.sischeme.vo.InsuranceSchemeFormVO;
import com.engine.salary.enums.sicategory.WelfareTypeEnum;
import weaver.general.Util;
import weaver.hrm.User;

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

/**
 * @Author weaver_cl
 * 
 * @Date 2022/3/7
 * @Version V1.0
 **/
@Deprecated
public class SISchemeGetFormCmd extends AbstractCommonCommand<Map<String, Object>> {

    public SISchemeGetFormCmd(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);
        SISchemeBiz siSchemeBiz = new SISchemeBiz();
        Long id = null;
        if (Objects.nonNull(params.get("id"))) {
            id =Long.valueOf(Util.null2String(params.get("id")));
        }
        WelfareTypeEnum welfareTypeEnum = (WelfareTypeEnum)params.get("welfareTypeEnum");
        InsuranceSchemeFormVO form = siSchemeBiz.getForm(id, welfareTypeEnum);
        apidatas.put("form",form);
        return apidatas;
    }
}
