<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
|
<%Session.CodePage=65001%>
|
<!--#include file="JsonPost_1000006.gds"-->
|
<!--#include virtual="/inc/function.gds"-->
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
<head>
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1, maximum-scale=1, user-scalable=no">
|
<title>记录中..</title>
|
</head>
|
<%
|
wx_OAID = trim(request("wx_OAID"))
|
Send_Text = trim(request("Send_Text"))
|
R_URL = trim(request("R_URL"))
|
WX_URL = trim(request("WX_URL"))
|
|
If wx_OAID="" Or Send_Text="" Or R_URL="" Then%>
|
<script lnguage=javascript>
|
alert("参数不足!!");
|
window.history.go(-1)
|
</script>
|
<%Response.End
|
End If
|
|
Set rs = Server.CreateObject("ADODB.Recordset")
|
|
|
isOA=""
|
sql="select OA_User_ID,OA_weixinUserID from OA_User where OA_execLevel>-1 and OA_weixinStatus=1 and OA_User_ID="&wx_OAID
|
rs.open sql,objConn,1,1
|
do while not rs.Eof
|
OAid = rs("OA_User_ID")
|
OA_weixinUserID = rs("OA_weixinUserID")
|
If CInt(OAid)=CInt(rs("OA_User_ID")) Then isOA=OA_weixinUserID
|
touser=touser&OA_weixinUserID&"|"
|
rs.movenext
|
loop
|
rs.close()
|
If isOA<>"" Then touser=isOA&"|"
|
If touser="" Then%>
|
<script lnguage=javascript>
|
alert("员工未关注企业微信!!");
|
window.history.go(-1)
|
</script>
|
<%Response.End
|
End If
|
touser=Mid(touser,1,Len(touser)-1)
|
'touser="ylkx_vicgame"
|
|
'微信OA信息下发接口
|
appUrl="https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token="&access_token
|
|
'微信验证码下发
|
args1="{"
|
args1=args1&"""touser"": """&touser&"""," '成员ID列表(消息接收者,多个接收者用‘|’分隔,最多支持1000个)。特殊情况:指定为@all,则向关注该企业应用的全部成员发送 |liaojunliang
|
args1=args1&"""toparty"": """"," '部门ID列表,多个接收者用‘|’分隔,最多支持100个。当touser为@all时忽略本参数
|
args1=args1&"""totag"": """"," '标签ID列表,多个接收者用‘|’分隔。当touser为@all时忽略本参数
|
args1=args1&"""agentid"": 1000006," '企业应用的id,整型。可在应用的设置页面查看
|
|
If WX_URL<>"" Then
|
args1=args1&"""msgtype"": ""textcard"","
|
args1=args1&"""textcard"": {"
|
args1=args1&"""title"":""系统通知"","
|
args1=args1&"""description"":"""&Send_Text&""","
|
args1=args1&"""url"":"""&WEBURL&WX_URL&""""
|
args1=args1&"}"
|
|
Else
|
args1=args1&"""msgtype"": ""text"","
|
args1=args1&"""text"": {"
|
args1=args1&"""content"":"""&Send_Text&""""
|
args1=args1&"}"
|
End If
|
|
args1=args1&"}"
|
|
HTMLCODE= PostBody(appUrl,args1)
|
'Response.Write HTMLCODE &"<br>"
|
'Response.End
|
If Mid(HTMLCODE,12,1)<>"0" Then
|
Call OA_Running("weixin_message_send|1000006|"&touser&"|"&HTMLCODE)
|
%>
|
<script lnguage=javascript>
|
alert("发送失败");
|
window.history.go(-1)
|
</script>
|
<%Response.End
|
Else%>
|
<script lnguage=javascript>
|
alert("发送成功");
|
window.location.href="<%=R_URL%>"
|
</script>
|
<%
|
Response.End
|
End If
|
%>
|