<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<activity id="__Y1EEhiX8S504X97IeiM">
  <name>通知班级人员</name>
  <parentId>__tiSuP45o59Dj5rhUzyf</parentId>
  <applicationid>__LgZds5MVHW3o08T7UcX</applicationid>
  <type>1</type>
  <onActionForm></onActionForm>
  <onActionView>__tiSuP45o59Dj5rhUzyf</onActionView>
  <colorType>default</colorType>
  <beforeActionScript><![CDATA[(function(){
  var selectId = getParameterAsText("_selects");
  var arrto = splitText(selectId, ";"); 
  var userid = getWebUser().getId()
  if(arrto.length>0){
    for (var i=0;i<arrto.length;i++){
      var classid=arrto[i]
      var classdoc=findDocument(classid);
      var class_name = classdoc.findItem("class_name").getValue()//班级名称
      var classroom_type = classdoc.findItem("classroom_type").getValue()//班级类型
      var train_address = classdoc.findItem("train_address").getValue()//培训地点
      var plan_id = classdoc.findItem("plan_id").getValue()//培训计划id
      var plandoc=findDocument(plan_id);
      var domain_name = plandoc.findItem("domain_name").getValue()//培训点
      var train_start_time = format(plandoc.findItem("train_start_time").getValue(),"yyyy-MM-dd HH:mm:ss")//培训开始时间
      var train_end_time = format(plandoc.findItem("train_end_time").getValue(),"yyyy-MM-dd HH:mm:ss")//培训结束时间
      var personsql="select item_employee_id,item_person_name from tlk_train_person where item_class_id='"+classid+"' "
      var datas = queryByDSName("tms",personsql);
      if(datas.size()>0){
        for(var iterator = datas.iterator();iterator.hasNext();){
          var map1 = iterator.next();//取值
          var employee_id= map1.get("item_employee_id");
          var person_name = map1.get("item_person_name");
          var sender=userid;
          var receiver=employee_id;
          var subject="您参加的培训已安排，请及时参加";
          var content=person_name+","+domain_name+"安排您"+train_start_time+"~"+train_end_time+"于"+train_address+"进行培训，请在参加培训前及时更新APP到最新版本，并至少提前30分钟到学校开始扫码签到。";
          println(content)
          sendMessage(sender,receiver,subject,content);
          return "通知成功！"
        }
      }
    }
  }else {
    return "请勾选需要通知的班级"
  }
})()]]></beforeActionScript>
  <afterActionScript><![CDATA[]]></afterActionScript>
  <hiddenScript><![CDATA[]]></hiddenScript>
  <readonlyScript><![CDATA[]]></readonlyScript>
  <editMode>0</editMode>
  <fileNameScript><![CDATA[]]></fileNameScript>
  <orderno>2</orderno>
  <parentView>__tiSuP45o59Dj5rhUzyf</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>