【调度系统】广东民航医疗快线调度系统源代码
克樊道人
2024-12-02 61ce8cc6883e5f94e6470141df3484167caf31ed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%Session.CodePage=65001%>  
<!--#include file="JsonPost_1000006.gds"-->
<!--#include virtual="/inc/function.gds"-->
<%
 
Set rs = Server.CreateObject("ADODB.Recordset")
sql="select MID,ServiceOrdIDDt,MessageDate,MessageContents,DATEDIFF(MINUTE,MessageDate,getdate()) MessageInt,OA_weixinUserID,ServiceOrdClass,ServiceOrd_CC_Time,ServiceOrdNo,ServiceOrdCoName,OutHospName=(select HospName from HospData where HospID=ServiceOrdPtOutHospID),InHospName=(select HospName from HospData where HospID=ServiceOrdPtInHospID),ServiceOrdSource,is_RecommendUser=(select COUNT(RecommendUserID)  from UserData where RecommendUserID is Not null and RecommendUserID<>0 and UserID=ServiceOrdUserID),a_ServiceOrdID from ServiceOrder,OA_User,ServiceOrd_Message left join (select ServiceOrdIDDt a_ServiceOrdID,MessageDate a_MessageDate from ServiceOrd_Message where MessageState>0 and MessageToState=1 and MessageToOAid<>0 and DATEDIFF(MINUTE,MessageDate,getdate())<=10) as a on  a_ServiceOrdID=ServiceOrdIDDt and DATEDIFF(MINUTE,MessageDate,a_MessageDate)=0 where ServiceOrdID=ServiceOrdIDDt and OA_execLevel>-1 and OA_weixinStatus=1 and OA_User_ID=MessageToOAid And MessageState>0 and MessageToState=0 and MessageToOAid<>0 and DATEDIFF(MINUTE,MessageDate,getdate())<=10 and DATEDIFF(MINUTE,MessageDate,getdate())>1 and a_ServiceOrdID is null order by MID desc"
rs.open sql,objConn,1,1
do while not rs.Eof
    MessageInt            = rs("MessageInt")
    ServiceOrdID        = rs("ServiceOrdIDDt")
    MessageDate        = rs("MessageDate")
    ToOA_weixinUserID    = rs("OA_weixinUserID")
    ServiceOrdCoName=rs("ServiceOrdCoName")
    OutHospName        = rs("OutHospName")
    InHospName            = rs("InHospName")
    OrdSendOARemarks=rs("MessageContents")
    ServiceOrdSource= rs("ServiceOrdSource")
    is_RecommendUser= rs("is_RecommendUser")
    ServiceOrdNo        = rs("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)
    touser                    = ToOA_weixinUserID
    '微信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,整型。可在应用的设置页面查看
 
    args1=args1&"""msgtype"": ""textcard"","
    args1=args1&"""textcard"": {"
        args1=args1&"""title"": ""有一个服务单需要你即时处理 第"&MessageInt&"次"","
        args1=args1&"""description"": """&now()&"\n\n"
            args1=args1&"单号:"&ServiceOrdNo&"\n"
            If ServiceOrdCoName<>"" Then args1=args1&"联系人:"&ServiceOrdCoName&"\n"
            If ServiceOrdCoPhone<>"" Then args1=args1&"联系电话:点击查看\n"
            If OutHospName<>"" Then args1=args1&"转出:"&OutHospName&"\n"
            If InHospName<>"" Then args1=args1&"转入:"&InHospName&"\n"
            If OrdSendOARemarks<>"" Then args1=args1&"\n"&OrdSendOARemarks&"\n"
            If ServiceOrdSource="2" And is_RecommendUser="1" Then args1=args1&"\n请注意,本单完成后会产生积分成本!\n"
        args1=args1&""","
            
        args1=args1&"""url"" : ""https://sys.966120.com.cn/m_ServiceOrder.gds?ServiceOrdID="&ServiceOrdID&""","
        args1=args1&"""btntxt"":""点击查看"""
    args1=args1&"}"
 
    args1=args1&"}"
    'Response.Write args1 &"<br>"
    HTMLCODE= PostBody(appUrl,args1)
    'Response.Write HTMLCODE &"<br>"
rs.movenext
loop
rs.close()
%>