<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<activity id="__iJP0OGuBdMH0T12ey61">
  <name>提交复审</name>
  <parentId>__5vqsoS4qrW92ndrhsYp</parentId>
  <applicationid>__LgZds5MVHW3o08T7UcX</applicationid>
  <type>1</type>
  <onActionForm></onActionForm>
  <onActionView>__5vqsoS4qrW92ndrhsYp</onActionView>
  <colorType>default</colorType>
  <beforeActionScript><![CDATA[(function(){
  var msg2 = '';
  var msg='';
  
var selectId = getParameterAsText("_selects"); 
  if(!isNotNull(selectId)){
  return "请选择人员";
  }
  var process = getDocumentProcess();
  var arro=splitText(selectId,";");
  for (var i=0;i<arro.length;i++){
    var checkId=arro[i];
    println("checkId"+checkId);
    var checkIdInfoDoc = findDocument(checkId);
    var IDCARDNO = checkIdInfoDoc.findItem("IDCARDNO").getValue();
    var name = checkIdInfoDoc.findItem("name").getValue();
    //var progress = checkIdInfoDoc.findItem("progress").getValue();
    var sql2 = "select item_AUTHUSERNAME,item_progress from tlk_lesson_auth_base_info where item_isdelete != '1' and ITEM_LEARNSTYLE = '1' and ITEM_AUTHRECORDID = '"+checkId+"'";
    println("sql2222222222"+sql2);
    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");
     println("name11111111111"+name1);
       var progress= map1.get("ITEM_PROGRESS");
     println("progressssssssss"+progress);
     if(progress<100){
       msg2+=name1+";";
     }
       //var applyId = map1.get("id");
    // var reviewResult = map1.get("item_reviewResult");
     
    }
}
    if(isNotNull(msg2)){
      println("msg2222222222222222"+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);
   // println("PPPPPPPPPPPPPPPPPPPROGRESS"+progress);
    var sql = "select item_reviewStatus,item_reviewResult,id from tlk_qualify_person_apply where id='"+checkId+"' and ITEM_APPLYSTATUS='0' and ITEM_MATERIALAPPROVESTATUS='1' "
    var datas = queryByDSName("tms",sql);
if(datas!=null){
   for(var iterator = datas.iterator();iterator.hasNext();){
       var map1 = iterator.next();//取值
       var reviewStatus= map1.get("item_reviewStatus");
       //var checkId = map1.get("id");
     var reviewResult = map1.get("item_reviewResult");
    }
}
     var applyInfoDoc = findDocument(checkId);
  // var reviewStatus = applyInfoDoc.findItem("reviewStatus").getValue();
    println("reviewStatus"+reviewStatus);
  //  var reviewResult = applyInfoDoc.findItem("reviewResult").getValue();
    println("reviewResult"+reviewResult);
    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)){
    msg2 = msg2.substring(0,msg2.length-1);
  return msg+"以上人员的抽查状态不符合提交复审条件"
  
  }


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