找回密码
 注册成为天翎用户
查看: 449|回复: 1

[已解决] 站内通知可以在定时任务里写自己发给自己吗?

[复制链接]
问题汇总专家 发表于 2021-4-21 18:31:55 | 显示全部楼层 |阅读模式
【myApps/OBPM版本号】:v4.4- sp XX
【浏览器类型】:Chrome/其他
【联系方式-QQ】:
【联系电话】:
【问题描述】:站内通知可以在定时任务里写自己发给自己吗?手机APP也能收到通知?
1.png
 楼主| 问题汇总专家 发表于 2021-4-21 18:33:17 | 显示全部楼层
只能发送企业微信通知的,
发送企业微信通知的示例代码:
(function(){   
           var work = getItemValueAsString("work");//工作内容  
          var UserProcessBean = new Packages.cn.myapps.authtime.user.service.UserProcessBean();   
          var username = getItemValueAsString("username");//创建人
        var title = getItemValueAsString("title");//标题
        var type = getItemValueAsString("type");//任务类型
           var Completion = getItemValueAsString("execution");//完成时间  
          var User = UserProcessBean.doView(username);   
          var username1 = User.getName();   
           var docid = getId();  
          var userId = getItemValueAsString("assign");//指派给  
           var formid ="__hI4swEBAVEfEIohTFRZ";  
           var domainid = getDomainid();   
           var applicationId = getApplication();   
     var UserVO = UserProcessBean.doView(userId);   
           var email = UserVO.getEmail();   
           var LOGINNO = UserVO.getLoginno();   
           var Url ="";   
           var emailHtml="";   
           var subject ="任务分配提醒【"+format(getToday(),"yyyy-MM-dd HH:mm:ss")+"】"   
      emailHtml+='<style class="fox_global_style">div.fox_html_content { line-height: 1.5; }div.fox_html_content { font-size: 14px; font-family: "Microsoft YaHei UI"; color: rgb(0, 0, 0); line-height: 1.5; }</style>'+      
      '<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1">'+   
      '<table width="100%" cellpadding="0" cellspacing="0" border="0" align="center" style="background: #FFF;">'+            
      '<tbody>'+              
      '<tr>'+            
      '<td style="padding: 0 15px;">'+            
      '<table cellpadding="0" cellspacing="0" border="0" width="100%" style="padding-top: 5px;">'+            
      '<tbody><tr height="35">'+           
            '<td style="font-weight: 700; color: #666; font-size: 12px;">任务分配明细<span style="font-weight: normal; font-family: Arial, Helvetica, sans-serif;">    Task assignment details</span>'+            
            '</td>'+            
            '</tr>'+            
      '</tbody>'+            
      '</table>'+           
      '</td>'+            
      '</tr>'+            
      '<tr>'+         
      '<td width="100%" style="padding: 0 15px;">'+            
      '<table cellpadding="0" cellspacing="0" border="0" width="100%" align="center" style="text-align: center; border-collapse: collapse;">'+'<tbody><tr height="56" style="background: #f2f2f2;">'+            
            '<td width="87" align="center" style="border-top: 2px solid #CFCFCF; border-right: 1px solid #CFCFCF; border-bottom: 1px solid #CFCFCF; border-left: 1px solid #CFCFCF; font-size: 12px; color: #666;">标题/链接<br>Title Link</td>'+  
            '<td width="87" align="center" style="border-top: 2px solid #CFCFCF; border-right: 1px solid #CFCFCF; border-bottom: 1px solid #CFCFCF; font-size: 12px; color: #666;">任务类型<br>Task Type</td>'+
            '<td width="87" align="center" style="border-top: 2px solid #CFCFCF; border-right: 1px solid #CFCFCF; border-bottom: 1px solid #CFCFCF; font-size: 12px; color: #666;">指派人<br>Designator</td>'+
        '<td width="87" align="center" style="border-top: 2px solid #CFCFCF; border-right: 1px solid #CFCFCF; border-bottom: 1px solid #CFCFCF; font-size: 12px; color: #666;">执行时间<br>Execution Date</td>'+         
     '<tr height="36"><td style="border-bottom: solid 1px #cfcfcf;border-left: solid 1px #cfcfcf; border-right: solid 1px #cfcfcf; font-size: 12px; color: #666; font-family: Arial, Helvetica, sans-serif;">'+title+'</td>'+           
      '<td style="border-bottom: solid 1px #cfcfcf;border-left: solid 1px #cfcfcf; border-right: solid 1px #cfcfcf; font-size: 12px; color: #666; font-family: Arial, Helvetica, sans-serif;">'+type+'</td>'+        
      '<td style="border-bottom: solid 1px #cfcfcf;border-left: solid 1px #cfcfcf; border-right: solid 1px #cfcfcf; font-size: 12px; color: #666; font-family: Arial, Helvetica, sans-serif;">'+username1+'</td>'+           
      '<td style="border-bottom: solid 1px #cfcfcf;border-left: solid 1px #cfcfcf; border-right: solid 1px #cfcfcf; font-size: 12px; color: #666; font-family: Arial, Helvetica, sans-serif;">'+Completion+'</td></tr></tbody></table></tbody></table></meta">';                        
         
      sendEmailBySystemUser(email,subject,emailHtml);   
      var url1="actionContent="+formid+"&docId="+docid+"&openType=from_weixin_message";                           
     url1 = "http://office.teemlink.com:9090/Z0Y3B/mobile/index.html?application="+applicationId+"#/open?linkType=00&" + url1;                           
     url1 = encodeURIComponent(url1);                           
     var url = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxb11b73237f69f7ea&redirect_uri="+url1+"&response_type=code&scope=snsapi_base&agentid=1000022&state="+domainid+"#wechat_redirect";   
     var text1 = "任务类型:"+type+"\n指派人:"+username1+"\n执行时间:"+Completion+"\n<a href='"+url+"'>更多内容详情</a>";   
      Packages.cn.myapps.support.weixin.WeixinServiceProxy.sendTextMessage(LOGINNO,text1,domainid,applicationId);   
         
   })()
回复

使用道具 举报

本版积分规则

手机版|天翎MyApps技术社区 ( 粤ICP备11093750号 )

GMT+8, 2026-8-14 11:06

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表