<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
|
<%Session.CodePage=65001%>
|
<!--#include file="JsonPost.gds"-->
|
<!--#include virtual="/inc/function.gds"-->
|
<%
|
ServiceOrdID = trim(request("ServiceOrdID"))
|
OAid = trim(request("OAid"))
|
|
If ServiceOrdID="" Or OAid="" Or OAid="0" Then
|
Response.Write "0"
|
Response.End
|
End If
|
|
Set rs = Server.CreateObject("ADODB.Recordset")
|
sql="select ServiceOrdID,ServiceOrdClass,ServiceOrd_CC_Time,ServiceOrdNo from ServiceOrder where ServiceOrdID="&ServiceOrdID
|
rs.open sql,objConn,1,1
|
If not rs.Eof Then
|
ServiceOrdID = rs("ServiceOrdID")
|
ServiceOrdClass = rs("ServiceOrdClass")
|
ServiceOrdNo = ServiceOrdClass& year(rs("ServiceOrd_CC_Time"))&Right("0"&month(rs("ServiceOrd_CC_Time")),2)&Right("0"&day(rs("ServiceOrd_CC_Time")),2) & "-"&Right("00"&rs("ServiceOrdNo"),3)
|
Call OA_Running("申请客户敏感信息授权:"&ServiceOrdNo&" ID:"&ServiceOrdID)
|
Else
|
Response.Write "0"
|
Response.End
|
End If
|
rs.close()
|
|
isOA=""
|
sql="select OA_User_ID,OA_weixinUserID from OA_User where OA_Power like '%,020110,%' and OA_execLevel>-1 and OA_weixinStatus=1"
|
rs.open sql,objConn,1,1
|
do while not rs.Eof
|
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
|
Response.Write "0"
|
Response.End
|
End If
|
touser=Mid(touser,1,Len(touser)-1)
|
|
Randomize Timer
|
OrdAuthorize = Int(899999 * Rnd + 100000)
|
|
'微信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"": 21," '企业应用的id,整型。可在应用的设置页面查看
|
|
args1=args1&"""msgtype"": ""text"","
|
args1=args1&"""text"": {"
|
args1=args1&"""content"":"""&OAUser(OAid,"UserName")&"申请访问"&ServiceOrdNo&"单,操作验证码为:"&OrdAuthorize&""""
|
args1=args1&"}"
|
|
args1=args1&"}"
|
|
|
HTMLCODE= PostBody(appUrl,args1)
|
'Response.Write HTMLCODE &"<br>"
|
|
If Mid(HTMLCODE,12,1)<>"0" Then
|
Call OA_Running("weixin_message_send|21|"&touser&"|"&HTMLCODE)
|
Response.Write "0"
|
Else
|
sql="update ServiceOrder set OrdAuthorize='"&OrdAuthorize&"',OrdAuthorize_Time=getdate() where ServiceOrdID="&ServiceOrdID
|
objConn.Execute sql
|
Response.Write "1"
|
End If
|
%>
|