<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<activity id="__j6IZSBsftM4pcBK7KUo">
  <name>提交复审</name>
  <parentId>__XJ17HrS6vaKAoYkSDLi</parentId>
  <applicationid>__LgZds5MVHW3o08T7UcX</applicationid>
  <type>1</type>
  <onActionForm></onActionForm>
  <onActionView>__XJ17HrS6vaKAoYkSDLi</onActionView>
  <colorType>default</colorType>
  <beforeActionScript><![CDATA[(function(){
  var msg='';
  var selectId = getParameterAsText("_selects"); 
  if(!isNotNull(selectId)){
    return "请选择人员";
  }
  var msg2 = "";
  var msg3 = "";
  var process = getDocumentProcess();
  var arro=splitText(selectId,";");
  for (var i=0;i<arro.length;i++){
    var applyId=arro[i];
    println("applyId"+applyId);
    var applyInfoDoc = findDocument(applyId);
    var name = applyInfoDoc.findItem("name").getValue();
    var reviewStatus = applyInfoDoc.findItem("reviewStatus").getValue();
    println("reviewStatus"+reviewStatus);
    var reviewResult = applyInfoDoc.findItem("reviewResult").getValue();
    println("reviewResult"+reviewResult);
    var IDCARDNO = applyInfoDoc.findItem("IDCARDNO").getValue();
     var sql3 = "select item_name,count(1) from tlk_grade_internship where item_internid='"+applyId+"' and ITEM_INTERNSHIPRECORDSTATUS in ('0','1');";
    var datas3 = queryByDSName("tms",sql3);
    if(datas3!=null){
      for(var iterator = datas3.iterator();iterator.hasNext();){
        var map1 = iterator.next();//取值
        var count = map1.get("count(1)");
        var name2 = map1.get("item_name")
        //var progress= map1.get("ITEM_PROGRESS");
        if(count<1){
          msg3+=name2+";";
        }
        //var applyId = map1.get("id");
        // var reviewResult = map1.get("item_reviewResult");

      }
    }
    if(isNotNull(msg3)){
      msg3 = msg3.substring(0,msg3.length-1);
      return msg3+"以上人员的实习记录状态不符合提交复审条件"
    }
    var sql2 = "select item_AUTHUSERNAME,item_progress from tlk_lesson_auth_base_info where ITEM_LEARNSTYLE = '2' and item_authrecordid = '"+applyId+"'";
    var datas2 = queryByDSName("tms",sql2);
    if(datas2!=null){
      for(var iterator = datas2.iterator();iterator.hasNext();){
        var map1 = iterator.next();//取值
        var name1 = map1.get("ITEM_AUTHUSERNAME");
        var progress= map1.get("ITEM_PROGRESS");
        if(progress<100){
          msg2+=name1+";";
        }
        //var applyId = map1.get("id");
        // var reviewResult = map1.get("item_reviewResult");

      }
    }
    if(isNotNull(msg2)){
      msg2 = msg2.substring(0,msg2.length-1);
      return msg2+"以上人员的课程进度不符合提交复审条件"

    }
     var sqll = "update tlk_sectioninfo set item_agree = '0' where ITEM_NEW_IDCARD = '"+IDCARDNO+"' and item_agree = '2'"
    updateByDSName("tms",sqll);
    if(('1'.equals(reviewStatus)&&'2'.equals(reviewResult))||('3'.equals(reviewStatus)&&'4'.equals(reviewResult))){
      applyInfoDoc.findItem("reviewStatus").setValue('2');
      applyInfoDoc.findItem("reviewResult").setValue('0');
      process.doUpdate(applyInfoDoc);
    }else{
      msg+=name+";";
    }   
  }

  if(isNotNull(msg)){
    return msg+"以上人员的抽查状态不是已审查或者抽查结果不是审查不通过"

  }


})()]]></beforeActionScript>
  <afterActionScript><![CDATA[]]></afterActionScript>
  <hiddenScript><![CDATA[]]></hiddenScript>
  <readonlyScript><![CDATA[]]></readonlyScript>
  <editMode>0</editMode>
  <fileNameScript><![CDATA[]]></fileNameScript>
  <orderno>0</orderno>
  <parentView>__XJ17HrS6vaKAoYkSDLi</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>