<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<activity id="__2BAgl4Jid8Yp1L7XqdN">
  <name>提交审核</name>
  <parentId>__0oVqiyXqJYRtmnJ7tg4</parentId>
  <applicationid>__LgZds5MVHW3o08T7UcX</applicationid>
  <type>1</type>
  <onActionForm></onActionForm>
  <onActionView>__0oVqiyXqJYRtmnJ7tg4</onActionView>
  <colorType>default</colorType>
  <beforeActionScript><![CDATA[#include "sysfunction";
#include "saasSendMessage";
(function(){
  var selectId = getParameterAsText("_selects");//获取所选中数据的id结果集
  var rtn = "";
  var arrto = splitText(selectId, ";"); //对这个结果集进行处理，以;进行切割，放到数组arrto
  if(isNotNull(selectId)){
    for (var i = 0; i < arrto.length; i++) { 
      var sql1 = "select ITEM_EXAMINE,ITEM_examState,ID,ITEM_EXAMNAME from tlk_system_exam_info where ID ='" + arrto[i] + "'";
      var datas = queryByDSName("tms", sql1)
      if (datas != null) {
        for (var iterator = datas.iterator(); iterator.hasNext();){
          var map1 = iterator.next();//取值
          var examId=map1.get("ID");
          var EXAMINE=map1.get("ITEM_EXAMINE");
          var EXAMNAME=map1.get("ITEM_EXAMNAME");
          var examState=map1.get("ITEM_examState");

          if("1".equals(examState)){  
            return createAlert(EXAMNAME+ "该考试已经取消！")
          }

          if(!"0".equals(EXAMINE) ){  
            return createAlert(EXAMNAME+"已经提交申请了！")
          } else{
            println("1：");
            //var examId = getId();       
            println("+++examId++："+examId);
            var process = getDocumentProcess();            
            var examInfoDoc=findDocument(examId); 
            println("++++++++："+examInfoDoc);
            println("2：");
            examInfoDoc.findItem("examine").setValue("1");
            println("3：");

            process.doUpdate(examInfoDoc);
            println("5："); 
          }
        }

      }
    }
  }else{
    return "请勾选考试！"
  }


  


})()]]></beforeActionScript>
  <afterActionScript><![CDATA[]]></afterActionScript>
  <hiddenScript><![CDATA[(function(){
  var domainid = getDomainid();
  var areacode = "";
  var sqlp = "SELECT tk.domainid,dl.ITEM_REGIONId FROM organizationauth.tlk_DepartmentLevel dl JOIN baibaodunflow.tlk_SetSupervise tk ON dl.id = tk.item_registerPoliceAddressID WHERE tk.domainid IN ('"+domainid+"')"
  println("sqlp---------------"+sqlp)
  var datasp = queryByDSName("tms",sqlp);
  if(datasp!=null){
    for(var iterator = datasp.iterator();iterator.hasNext();){
      var map1 = iterator.next();//取值
      areacode= map1.get("ITEM_REGIONId");
      println("areacode----------------"+areacode)
    }
  }
  if(isNotNull(areacode)){
    areacode = areacode.substr(0,2);
    println("areacode2------------------"+areacode)
  }
  if("64".equals(areacode)){
    if(!"505303218683641856--__AOkTvsah9VLicJhQ1FO".equals(domainid) && !"bdjaI4oc".equals(domainid)){
      return true
    }
  }



  return false


})()
/*(function(){
  //除了北京地区的需要审核其他地区的不需要审核直接通过
  var domainid = getDomainid();
  var sql="select  place_of_register_district_name,place_of_register_province_name from baibaodunflow.vw_organization where id='"+domainid+"'";
  println("sql---------------->"+sql);
  var datas = queryByDSName("tms",sql);
  if(datas!=null){//一家公司只有一条数据
    for(var iterator = datas.iterator();iterator.hasNext();){
      var map1 = iterator.next();//取值
      var registerprovinces= map1.get("place_of_register_province_name");
      var place_of_register_district_name= map1.get("place_of_register_district_name");
      println("sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss"+registerprovinces)
      if("北京市".equals(registerprovinces) || "国外".equals(registerprovinces)){
        println("北京欢迎你")
        return false
      }else if("广西壮族自治区".equals(registerprovinces)){
        if("南宁市".equals(place_of_register_district_name)){
          println("南宁市欢迎你")
          return false
        }else{
          println("广西下的其他市")
          return true
        }
      }else{
        return true
      }
    }
  }

})()*/]]></hiddenScript>
  <readonlyScript><![CDATA[]]></readonlyScript>
  <editMode>0</editMode>
  <fileNameScript><![CDATA[]]></fileNameScript>
  <orderno>7</orderno>
  <parentView>__0oVqiyXqJYRtmnJ7tg4</parentView>
  <impmappingconfigid></impmappingconfigid>
  <jumpType>0</jumpType>
  <expSub>false</expSub>
  <icon></icon>
  <disableFlowNode>false</disableFlowNode>
  <changeFlowOperator>false</changeFlowOperator>
  <changeFlowCc>false</changeFlowCc>
  <multiLanguageLabel></multiLanguageLabel>
  <dispatcherMode>0</dispatcherMode>
  <dispatcherUrl><![CDATA[]]></dispatcherUrl>
  <dispatcherParams><![CDATA[[{"paramKey":"","paramValue":""}]]]></dispatcherParams>
  <jumpMode>0</jumpMode>
  <jumpActOpenType>0</jumpActOpenType>
  <withOld>false</withOld>
  <actionType>0</actionType>
  <actionSelection>0</actionSelection>
  <workFlowType>0</workFlowType>
  <contextMenu>true</contextMenu>
  <showInToolbar>true</showInToolbar>
  <label><![CDATA[]]></label>
</activity>