package com.customization.htsc.cus;

import com.alibaba.fastjson.JSONObject;
import com.engine.core.cfg.annotation.CommandDynamicProxy;
import com.engine.core.interceptor.AbstractCommandProxy;
import com.engine.core.interceptor.Command;
import com.engine.htsc.workflow.util.WorkflowUtil;
import com.engine.workflow.cmd.requestForm.ForwardSubmitCmd;
import com.engine.workflow.cmd.requestForm.RemarkSubmitCmd;
import weaver.conn.ConnStatement;
import weaver.general.Util;

import javax.servlet.http.HttpServletRequest;
import java.util.Enumeration;
import java.util.Map;
import java.util.Set;

/**
 * Author:wanxq
 * Date:2021年6月18日21:10:12
 * Description: 意见征询处理多人力资源字段
 * Copyright:上海泛微网络科技股份有限公司
 */
@CommandDynamicProxy(target = RemarkSubmitCmd.class, desc = "流程提交后处理多人力资源字段的分组情况")
public class RemarkMultiUserHandleCmd extends AbstractCommandProxy<Map<String, Object>> {
    @Override
    public Map<String, Object> execute(Command<Map<String, Object>> targetCommand) {
        RemarkSubmitCmd remarkSubmitCmd = (RemarkSubmitCmd) targetCommand;
        HttpServletRequest request = remarkSubmitCmd.getRequest();//从request中可以取到参数，不用以前的方法了
        int requestid = Util.getIntValue(request.getParameter("requestid"));

        Map<String, Object> result = nextExecute(targetCommand);

        //保存多人力资源字段的数据结构
        WorkflowUtil.saveMultiUserTypeData(requestid,request);
        return result;
    }


    public static void main(String[] args) {

    }
}
