package weaver.interfaces.htxc.contract.number;

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

import com.engine.common.util.ServiceUtil;
import com.engine.htxc.contract.number.service.impl.ContractNumberServiceImpl;
import weaver.formmode.customjavacode.AbstractModeExpandJavaCodeNew;
import weaver.general.Util;
import weaver.hrm.User;
import weaver.soa.workflow.request.RequestInfo;

/**
 * @author K1810015
 * @version 1.0.0
 * @ClassName ContractNumbberMode.java
 * @createTime 2022年06月11日 09:42:00
 */
public class ContractNumberMode extends AbstractModeExpandJavaCodeNew {

    @Override
    public Map<String, String> doModeExpand(Map<String, Object> param) {
        Map<String, String> result = new HashMap<String, String>();
        try {
            User user = (User)param.get("user");
            int billid = -1;//数据id
            int modeid = -1;//模块id
            RequestInfo requestInfo = (RequestInfo)param.get("RequestInfo");
            if(requestInfo!=null){
                billid = Util.getIntValue(requestInfo.getRequestid());
                modeid = Util.getIntValue(requestInfo.getWorkflowid());
                if(billid>0&&modeid>0){
                    Map<String,Object> map=new HashMap<>();
                    map.put("billid",billid);
                    map.put("modeid",modeid);
                    ServiceUtil.getService(ContractNumberServiceImpl.class).createNumber(map,user);

                    //------请在下面编写业务逻辑代码------
                }
            }
        } catch (Exception e) {
            result.put("errmsg","自定义出错信息");
            result.put("flag", "false");
        }
        return result;
    }
}
