<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<task id="__oqbUFZuUJTpzN05gRuj">
  <name>理论课程学习完成但未实习通知</name>
  <parentId>__LgZds5MVHW3o08T7UcX</parentId>
  <applicationid>__LgZds5MVHW3o08T7UcX</applicationid>
  <description>理论课程学习完成但未实习通知</description>
  <type>1</type>
  <runningTime>2022-07-23T16:30:00.517+08:00</runningTime>
  <interval>1</interval>
  <period>2</period>
  <runtimes>0</runtimes>
  <terminateScript><![CDATA[]]></terminateScript>
  <taskScript><![CDATA[(function(){
  var subject="您的保安员等级（五级）培训课程理论学习已完成，可开始实习！";
  var appName = "考试管理";
  var appId="__Qlqia54jXSOKQxX0rof"
  //var uid="LPPhHpB62UEotpdIISj"
  var sql=" SELECT d.item_securityId,d.item_senderId,d.item_name FROM tlk_lesson_auth_base_info a" +
      " 	INNER JOIN tlk_grade_registration d ON a.ITEM_AUTHRECORDID = d.id  "+
      " AND a.ITEM_LEARNSTYLE = '2' "+//等级证
      " 	AND a.item_isDelete != '1' "+
      " WHERE"+
      " d.ITEM_APPLYSTATUS = '0'" + //申报中 
      " and a.ITEM_PROGRESS = '100' "+//进度100%
      " and a.ITEM_AUTHUSERID not in (SELECT ITEM_idCardNo from tlk_grade_internship ) "
  println(sql);
  var datasAll = queryByDSName("tms",sql);
  if (datasAll.size() > 0) {
    for (var iterator = datasAll.iterator(); iterator.hasNext();) {
      var map1 = iterator.next();//取值
      var receiver = map1.get("item_securityId");
      var senderId = map1.get("item_senderId");
      var name = map1.get("item_name");
      println("senderId:"+senderId+ ",receiver: "+receiver)
      if(isNotNull(receiver)&&isNotNull(senderId)){
        var content = "";
        var texts ="";
        texts += "您" + name + "，申报的保安员等级（五级）培训理论课程学习已完成，请及时开始岗位实习工作，您可以通过App-【学习】-【实习】开始实习并上报实习记录。" ;
        var appAvatar = "https://bcxin-saas-prod.obs.cn-north-1.myhuaweicloud.com:443/upload%2F2021-11-01%2F1635755240828768236.png";
        var title = "";
        var titleImg = "";
        var actionName = "";
        var actionUrl = "";
        content += "appName=" + appName + "&&;" ; //应用名称
        content += "appId=" + appId + "&&;" ;  //应用id
        content += "appAvatar=" + appAvatar + "&&;" ;  //应用图标
        content += "title=" + title + "&&;" ; //标题
        content += "titleImg=" + titleImg + "&&;" ;  //标题图标
        content += "actionName=" + actionName + "&&;" ;   //操作名称
        content += "actionUrl=" + actionUrl + "&&;" ;   //操作链接
        content += "content=" + texts + ""; 
        sendMessage(senderId,receiver,subject,content);
        println("站内信发送结束")

      }
    }
  }

})()
]]></taskScript>
  <modifyTime>2022-07-23T10:10:18.000+08:00</modifyTime>
  <creator>Admin</creator>
  <creatorid>Ai6hllhNjS2ull9TKGb</creatorid>
  <totalRuntimes>0</totalRuntimes>
  <state>0</state>
  <startupType>1</startupType>
  <dayOfMonth>1</dayOfMonth>
  <repeatTimes>0</repeatTimes>
  <frequency>0</frequency>
  <executedCount>0</executedCount>
  <rDate>2022-01-21</rDate>
  <rTime>16:30:00</rTime>
</task>