package weaver.interfaces.htxc.contract.modeaction;

import com.engine.common.util.ServiceUtil;
import com.engine.htxc.commonutil.log.CustomizeLog;
import com.engine.htxc.contract.service.impl.ContractUpdateWfServiceImpl;
import com.engine.integration.util.StringUtils;
import weaver.formmode.customjavacode.AbstractModeExpandJavaCodeNew;
import weaver.general.Util;
import weaver.hrm.User;
import weaver.soa.workflow.request.RequestInfo;

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

/**
 * <p>修改建模表数据同步到流程表单上</p>
 * @author K1810015
 * @version 1.0.0
 * @ClassName ContractUpdateWf.java
 * @createTime 2022年08月12日 11:05:00
 */
public class ContractUpdateWfAction  extends AbstractModeExpandJavaCodeNew {

    @Override
    public Map<String, String> doModeExpand(Map<String, Object> param) {
        CustomizeLog.printLog("修改建模数据同步到流程表单上面去");
        Map<String, String> result = new HashMap<String, String>();
        try {
            User user = (User)param.get("user");
            int billid = -1;//数据id
            int modeid = -1;//模块id
            String tablename="uf_htqc";
            RequestInfo requestInfo = (RequestInfo)param.get("RequestInfo");
            if(requestInfo!=null){
                billid = Util.getIntValue(requestInfo.getRequestid());
                modeid = Util.getIntValue(requestInfo.getWorkflowid());
                CustomizeLog.printLog("查看参数"+billid+tablename+modeid);
                if(billid>0&&modeid>0){
                    Map<String,Object> updatemap=new HashMap<>();
                    updatemap.put("tablename",tablename);
                    updatemap.put("billid",billid);

                   ServiceUtil.getService(ContractUpdateWfServiceImpl.class).updateworkflow(updatemap,user);
                }
            }
        } catch (Exception e) {

        }
        return result;
    }
}
