package com.engine.htsc.jgzxzysx.util;

import com.engine.integration.util.StringUtils;
import weaver.general.Util;
import weaver.hrm.User;
import weaver.interfaces.htsc.GlobatTools.JAVATools;
import weaver.interfaces.htsc.comInfo.PropBean;

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

/**
 * @author K1810015
 * @version 1.0.0
 * @ClassName JgzxzysxUtil.java
 * @createTime 2022年05月11日 13:47:00
 */
public class JgzxzysxUtil {

    private static PropBean pb=new PropBean();

   public static  boolean getworkflowflag(Map<String,Object> map){
       String requestid= Util.null2String(map.get("requestid"));
       String nodeid=pb.getActionNodeIdByUnNumber(pb.getPropName("jgzxzysx.node.jgzxzysx_jgzxfzrsh"));
       if(StringUtils.isBlank(requestid) ||StringUtils.isBlank(nodeid) ){
           return false;
       }
       String sql=" select count(*) as sunum  from workflow_requestlog where 1=1 ";
       Map<String,String> wheremap=new HashMap<>();
       wheremap.put("requestid",requestid);
       wheremap.put("nodeid",nodeid);
       Map<String,Object> retmap=JAVATools.GetTableToMap(sql,wheremap);
       if(retmap==null || retmap.size()<=0){
           return false;
       }
       int sunnum=Util.getIntValue(Util.null2String(retmap.get("sunum")),0);

       if(sunnum>0){
           return true;
       }else{
           return  false;
       }

   }

}
