<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<activity id="__kZjLgaWB2FTunV3Eg9L">
  <name>添加</name>
  <parentId>__ApOFiTWdSoVEmTPouiH</parentId>
  <applicationid>__LgZds5MVHW3o08T7UcX</applicationid>
  <type>13</type>
  <onActionFlow></onActionFlow>
  <onActionPrint></onActionPrint>
  <colorType>default</colorType>
  <beforeActionScript><![CDATA[]]></beforeActionScript>
  <afterActionScript><![CDATA[]]></afterActionScript>
  <retractBeforeActionScript><![CDATA[]]></retractBeforeActionScript>
  <retractAfterActionScript><![CDATA[]]></retractAfterActionScript>
  <hiddenScript><![CDATA[]]></hiddenScript>
  <readonlyScript><![CDATA[]]></readonlyScript>
  <startFlowScript><![CDATA[							]]></startFlowScript>
  <editMode>0</editMode>
  <fileNameScript><![CDATA[]]></fileNameScript>
  <iconurl></iconurl>
  <orderno>1</orderno>
  <stateToShow></stateToShow>
  <parentForm>__ApOFiTWdSoVEmTPouiH</parentForm>
  <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>1</actionType>
  <actionDispatcherUrlScript><![CDATA[]]></actionDispatcherUrlScript>
  <actionSelection>0</actionSelection>
  <relatedFormId>选择</relatedFormId>
  <actionScript><![CDATA[(function(){
 var domainId = getDomainid();
var classId= getItemValueAsString("classId"); 
//println("classId==>" + classId);
var classPersonId = getItemValueAsString("classPersonId"); 
var arrto = splitText(classPersonId,";"); 
var process = getDocumentProcess();            
var formProcess = getFormProcess();            
var subform = formProcess.doView("__TTLL6anXeEmwkn6UvAO");//表单id    
for(var i=0;i<arrto.length;i++){
  var applyId = arrto[i];
  var applyInfoDoc = findDocument(applyId);
  
var sql= "select '"+domainId+"' as domainid,"+
"COUNT( a.ITEM_IDCARDNO ) AS ITEM_INTERNSHIPDAYS,"+
"SUM( a.ITEM_INTERNSHIPDURATION ) AS ITEM_INTERNSHIPTIME"+
" FROM "+
	"tlk_grade_card_internship_record a"+
" GROUP BY a.ITEM_IDCARDNO";
var query = queryBySQL(sql);
if(query!=null){
          var iter  =query.iterator();
          if(iter != null && iter.hasNext()){
               doc = iter.next();
            var day = doc.getItemValueAsString("INTERNSHIPDAYS");   
            var time = doc.getItemValueAsString("INTERNSHIPTIME");
            
            var doc = process.doNew(subform,getWebUser(),createParamsTable()); 
  			doc.addStringItem("classId",classId); 
  doc.addStringItem("scoreState","0");
  doc.addIntItem("sumScore",0); 
 doc.addStringItem("securityId",applyInfoDoc.findItem("securityId").getValue()); 
  			doc.addStringItem("idCardNo",applyInfoDoc.findItem("idCardNo").getValue());     
  			doc.addStringItem("name",applyInfoDoc.findItem("name").getValue()); 
  			println("day------------------------"+day)
 			doc.addStringItem("company",applyInfoDoc.findItem("internshipCompany").getValue()); 
 			doc.addStringItem("phone",applyInfoDoc.findItem("phone").getValue()); 
            doc.addStringItem("INTERNSHIPDAYS",day); 
            doc.addStringItem("INTERNSHIPTIME",time); 
  			process.doCreate(doc);   
          } 
}
      

}
     
    

})()]]></actionScript>
  <workFlowType>0</workFlowType>
  <contextMenu>false</contextMenu>
  <showInToolbar>true</showInToolbar>
  <transpond>选择</transpond>
  <targetList>ism1EiHqAkpLpSd2Zr7|</targetList>
  <label><![CDATA[]]></label>
</activity>