<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<activity id="__2yNicMfPyQr7TmoBfxw">
  <name>添加</name>
  <parentId>__4OmOocgSJDtNQu7hz7F</parentId>
  <applicationid>__LgZds5MVHW3o08T7UcX</applicationid>
  <type>43</type>
  <onActionForm></onActionForm>
  <onActionView></onActionView>
  <colorType>default</colorType>
  <beforeActionScript><![CDATA[(function(){
  var examId=decodeURI(getParameter("examId")); 
  println("examId------------11111111111111--->"+examId)
  var applyInfo = findDocument(examId);
  var examState = applyInfo.findItem("examState").getValue();
  if("1".equals(examState)){
    return "本场考试已取消，不可再添加人员！";
  }
  var endtime = applyInfo.findItem("computerEndDate").getValue();
  var starttime = applyInfo.findItem("computerStartDate").getValue();
  println("endtime--------------->"+endtime)
  println("starttime--------------->"+starttime)
  var today = format(getToday(),"yyyy-MM-dd HH:mm:ss");
  println("today--------------->"+today)
  if(today>=starttime){
    return "考试已开始，不允许添加人员！";
  }
  if(today>=endtime){
     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) && !"qzQXxmKA".equals(domainid)){
      return true
    }
  }



  return false


})()]]></hiddenScript>
  <readonlyScript><![CDATA[(function() {

  
  //除了北京地区的需要审核其他地区的不需要审核直接通过
  var domainid = getDomainid();
  println("domainid-----------"+domainid)
  var sql="select place_of_register_district_name,place_of_register_province_name from baibaodunflow.vw_organization where id='"+domainid+"'";
  println("LYMQQQQQQQQQQQQQQQQQQQQQQQQQQQsql---------------->"+sql);
  var datas = queryByDSName("tms",sql);
  if(datas!=null){//一家公司只有一条数据
    for(var iterator = datas.iterator();iterator.hasNext();){
      var map1 = iterator.next();//取值
      var place_of_register_province_name= map1.get("place_of_register_province_name");
      var place_of_register_district_name= map1.get("place_of_register_district_name");


      println("sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss"+place_of_register_province_name)
      println("sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss"+place_of_register_district_name)
      if("北京市".equals(place_of_register_province_name)){
       // return true;
        println("北京欢迎你")
        var examState=decodeURI(getParameter("examState")); //examine
        var examine=decodeURI(getParameter("examine"));
        println(examState+" 这个状态是可以进行添加操作的")
        println(examine+" 这个状态是可以进行添加操作的")
        println("sssssssssssssssssssssssssssssssssssssssssssssss12.28"+examine)//考试审核状态
        /**
          待提交 0 ：可删除、添加、导出，可返回， 不可确认成绩 不可导入成绩 不可提醒考试通知，不可录入成绩
          待审核 3：返回、导出
          审核通过 1 ：
          审核不通过 2：返回、导出
          **/
        println("examState考试状态-->"+examState)//0是正常 1是取消
        if(("0".equals(examState) || "1".equals(examState))&&("待提交".equals(examine)||"审核通过".equals(examine))){
          println(examine+" 这个状态是可以进行添加操作的")
        }else{
          println("我进考试校验");
          return true;
        }
        //这里开始做操作，首先看到是北京市的
        var examState=decodeURI(getParameter("examState")); 
        println("examState人数-->"+examState)
        var examId=decodeURI(getParameter("examId")); 
        println("examId人数-->"+examId)
        var personNumber=decodeURI(getParameter("personNumber"));  
        println("personNumber--->"+personNumber);
        var sql="select COUNT(id) as num from tlk_system_exam_person where ITEM_examid='"+examId+"'";
        println(sql);
        var datas = queryByDSName("tms",sql);
        if(datas.size()>0){
          for(var iterator = datas.iterator();iterator.hasNext();){
            var map1 = iterator.next();//取值
            var num= map1.get("num");  
            println("num--->"+num);           
          } 
        }
        if(isNotNull(personNumber)){
          if(parseInt(num)<parseInt(personNumber)){
            return false;
          }else{
            println("我进人数校验"+num+"的"+personNumber);
            return true;
          }
        }
      }else if("广西壮族自治区".equals(place_of_register_province_name)){
        if("南宁市".equals(place_of_register_district_name)){
          println("南宁市欢迎你")
          var examState=decodeURI(getParameter("examState")); //examine
          var examine=decodeURI(getParameter("examine"));
          println(examState+" 这个状态是可以进行添加操作的")
          println(examine+" 这个状态是可以进行添加操作的")
          println("sssssssssssssssssssssssssssssssssssssssssssssss12.28"+examine)//考试审核状态
          /**
            待提交 0 ：可删除、添加、导出，可返回， 不可确认成绩 不可导入成绩 不可提醒考试通知，不可录入成绩
            待审核 3：返回、导出
            审核通过 1 ：
            审核不通过 2：返回、导出
            **/
         println("examState考试状态-->"+examState)//0是正常 1是取消
          if("0".equals(examState)&&("待提交".equals(examine)||"审核通过".equals(examine))){
            println(examine+" 这个状态是可以进行添加操作的")
          }else{
            println("我进考试校验");
            return true;
          }
          //这里开始做操作，首先看到是北京市的
          var examState=decodeURI(getParameter("examState")); 
          println("examState人数-->"+examState)
          var examId=decodeURI(getParameter("examId")); 
          println("examId人数-->"+examId)
          var personNumber=decodeURI(getParameter("personNumber"));  
          println("personNumber--->"+personNumber);
          var sql="select COUNT(id) as num from tlk_system_exam_person where ITEM_examid='"+examId+"'";
          println(sql);
          var datas = queryByDSName("tms",sql);
          if(datas.size()>0){
            for(var iterator = datas.iterator();iterator.hasNext();){
              var map1 = iterator.next();//取值
              var num= map1.get("num");  
              println("num--->"+num);           
            } 
          }
          if(isNotNull(personNumber)){
            if(parseInt(num)<parseInt(personNumber)){
              return false;
            }else{
              println("我进人数校验"+num+"的"+personNumber);
              return true;
            }
          }

        }else{
          println("广西下的其他市")

        }
      }else if(place_of_register_province_name.indexOf("陕西省")>= 0){
        // var str='<script> $(".shanxi").hide()</script>'
      }else if("宁夏回族自治区".equals(place_of_register_province_name)){
        // var str='<script> $(".shanxi").hide()</script>'
      }else if("湖南省".equals(place_of_register_province_name)){
        // var str='<script> $(".shanxi").hide()</script>'
      }else{

      }
    }
  }
})();]]></readonlyScript>
  <editMode>0</editMode>
  <fileNameScript><![CDATA[]]></fileNameScript>
  <orderno>1</orderno>
  <parentView>__4OmOocgSJDtNQu7hz7F</parentView>
  <impmappingconfigid>__7tkXQ8UWGSqrTJkHtCB</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[#include "setUrl";//引入函数库          
(function() {  
  println("添加脚本！！！！！！！！！！！！！！！！！");
  var doc=getCurrentDocument();    
  var personNumber=decodeURI(getParameter("personNumber"));  
  println("~~~~~~~~~~~~~~~~~~~"+personNumber)
  var examId=decodeURI(getParameter("examId"));  
  println("examId------------22222222222--->"+examId)
  var exparams = "&examId="+examId+"&personNumber="+personNumber+"";  //拼接参数                           
  var formid="__pLqUgEuQ9xbehc5ESIH"; 
  var url="/static/portal/vue/index.html#/open?appId="+getApplication()+"&actionContent="+formid+"&opentarget=detail&linkType=00"
  //var url = geturl.form( getApplication(), formid );
  url=url+exparams
  println("urlllllllllllll"+url)
  return url;                                               
})();]]></dispatcherUrl>
  <dispatcherParams><![CDATA[[]]]></dispatcherParams>
  <jumpMode>0</jumpMode>
  <jumpActOpenType>1</jumpActOpenType>
  <withOld>false</withOld>
  <actionType>0</actionType>
  <actionSelection>0</actionSelection>
  <workFlowType>0</workFlowType>
  <contextMenu>true</contextMenu>
  <showInToolbar>true</showInToolbar>
  <targetList>__4OmOocgSJDtNQu7hz7F|</targetList>
  <label><![CDATA[]]></label>
</activity>