【调度系统】广东民航医疗快线调度系统源代码
wanglizhong
2025-06-24 a51d070d364b0da8e5f8ea9203a6e50c8b4c0af3
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
 <%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%Session.CodePage=65001%>  
<!--#include file="JsonPost_user.gds"-->
<!--#include virtual="/inc/function.gds"-->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<%
'更新成员
Set rs = Server.CreateObject("ADODB.Recordset")
access_token=GetAccess_token_contactsApi()
 
appUrl="https://qyapi.weixin.qq.com/cgi-bin/user/update?access_token="&access_token
 
OA_UserID        = trim(Request("OA_UserID"))
 
If OA_UserID="" Then Response.Redirect "/"
sql="select * from OA_User where OA_User_ID="&OA_UserID
rs.open sql,objConn,1,1
if not rs.Eof then
    OA_weixinUserID    = rs("OA_weixinUserID")
    OA_Name            = rs("OA_Name")
    OA_DepartmentID    = rs("OA_DepartmentID")
    OA_DepartmentIDs= rs("OA_DepartmentIDs")
    OA_Position        = rs("OA_Position")
    OA_mobile        = rs("OA_mobile")
    OA_gender        = rs("OA_gender")
    OA_email        = rs("OA_email")
    OA_IdentityCard    = rs("OA_IdentityCard")
    OA_weixinID        = rs("OA_weixinID")
    OA_execLevel    = rs("OA_execLevel")
    OA_weixinStatus    = rs("OA_weixinStatus")
    If OA_DepartmentIDs<>"" Then OA_DepartmentID=OA_DepartmentIDs
    If OA_execLevel=-1 Then
      enable=0
    Else
      enable=1
    End if
end if
rs.close()
 
If OA_weixinUserID="" Then Response.Redirect "/AdminUser.gds?userID="&OA_UserID&"&h_menu1_1="&session("h_menu1_1")&"&SystemMessageType=4&SMT=2"
 
m=1
If m=1 Then    '离职删除企微账号
    If enable=0 And OA_weixinStatus<>2 Then    '删除
        appUrl="https://qyapi.weixin.qq.com/cgi-bin/user/delete"
        If OA_weixinUserID="" Then Response.Redirect "/"
        Origin="access_token="&access_token&"&userid="&OA_weixinUserID
        HTMLCODE= GetBody(appUrl,Origin)
        sql="update OA_User set OA_weixinStatus=2 where OA_User_ID="&OA_UserID
        objConn.Execute sql
 
    ElseIf enable=1 And OA_weixinStatus=2 Then    '新建
        appUrl="https://qyapi.weixin.qq.com/cgi-bin/user/create?access_token="&access_token
        args1="{"
        args1=args1&"""userid"": """&OA_weixinUserID&""""
        If OA_Name<>"" Then args1=args1&",""name"": """&OA_Name&""""
        If OA_DepartmentID<>"" Then args1=args1&",""department"": ["&OA_DepartmentID&"]"
        If OA_Position<>"" Then args1=args1&",""position"": """&OA_Position&""""
        If OA_mobile<>"" Then args1=args1&",""mobile"": """&OA_mobile&""""
        If OA_gender<>"" Then args1=args1&",""gender"": """&OA_gender&""""
        If OA_email<>"" Then args1=args1&",""email"": """&OA_email&""""
        If OA_IdentityCard<>"" Then args1=args1&",""extattr"":{""attrs"":[{""type"":0,""name"":""身份证"",""text"": {""value"": """&OA_IdentityCard&"""}}]}"
        If OA_weixinID<>"" Then args1=args1&",""weixinid"": """&OA_weixinID&""""
        args1=args1&"}"
        HTMLCODE= PostBody(appUrl,args1)
        sql="update OA_User set OA_weixinStatus=4 where OA_User_ID="&OA_UserID
        objConn.Execute sql
 
    ElseIf enable=1 Then    '修改
        appUrl="https://qyapi.weixin.qq.com/cgi-bin/user/update?access_token="&access_token
        args1="{"
        args1=args1&"""userid"": """&OA_weixinUserID&""""
        If OA_Name<>"" Then args1=args1&",""name"": """&OA_Name&""""
        If OA_DepartmentID<>"" Then args1=args1&",""department"": ["&OA_DepartmentID&"]"
        If OA_Position<>"" Then args1=args1&",""position"": """&OA_Position&""""
        If OA_mobile<>"" Then args1=args1&",""mobile"": """&OA_mobile&""""
        If OA_gender<>"" Then args1=args1&",""gender"": """&OA_gender&""""
        If OA_email<>"" Then args1=args1&",""email"": """&OA_email&""""
        If OA_IdentityCard<>"" Then args1=args1&",""extattr"":{""attrs"":[{""type"":0,""name"":""身份证"",""text"": {""value"": """&OA_IdentityCard&"""}}]}"
        If OA_weixinID<>"" Then args1=args1&",""weixinid"": """&OA_weixinID&""""
        args1=args1&",""enable"": "&enable&""
        args1=args1&"}"
        HTMLCODE= PostBody(appUrl,args1)
    End If
Else
    '离职停用企微账号
    If enable=0 And OA_weixinStatus<>2 And OA_weixinUserID<>"" Then    '离职停用
        appUrl="https://qyapi.weixin.qq.com/cgi-bin/tag/addtagusers?access_token="&access_token
        args1="{"
        args1=args1&"""tagid"": 5"
        args1=args1&",""userlist"": ["""&OA_weixinUserID&"""]"
        args1=args1&"}"
        HTMLCODE= PostBody(appUrl,args1)
    ElseIf enable=1 And OA_weixinUserID<>"" Then    '修改
        appUrl="https://qyapi.weixin.qq.com/cgi-bin/tag/deltagusers?access_token="&access_token
        args1="{"
        args1=args1&"""tagid"": 5"
        args1=args1&",""userlist"": [ """&OA_weixinUserID&"""]"
        args1=args1&"}"
        HTMLCODE= PostBody(appUrl,args1)
    End If
    access_token=GetAccess_token_contactsApi()
 
        appUrl="https://qyapi.weixin.qq.com/cgi-bin/user/update?access_token="&access_token
        args1="{"
        args1=args1&"""userid"": """&OA_weixinUserID&""""
        If OA_Name<>"" Then args1=args1&",""name"": """&OA_Name&""""
        If OA_DepartmentID<>"" Then args1=args1&",""department"": ["&OA_DepartmentID&"]"
        If OA_Position<>"" Then args1=args1&",""position"": """&OA_Position&""""
        If OA_mobile<>"" Then args1=args1&",""mobile"": """&OA_mobile&""""
        If OA_gender<>"" Then args1=args1&",""gender"": """&OA_gender&""""
        If OA_email<>"" Then args1=args1&",""email"": """&OA_email&""""
        If OA_IdentityCard<>"" Then args1=args1&",""extattr"":{""attrs"":[{""type"":0,""name"":""身份证"",""text"": {""value"": """&OA_IdentityCard&"""}}]}"
        If OA_weixinID<>"" Then args1=args1&",""weixinid"": """&OA_weixinID&""""
        args1=args1&",""enable"": "&enable&""
        args1=args1&"}"
 
        'Response.Write args1&"<br><br>"
        HTMLCODE= PostBody(appUrl,args1)
        'Response.Write HTMLCODE&"<br><br>"
        'Response.End
End If
 
 
 
if PositionURLID="1" then PositionURLID=11
ReturnURL=session("PositionURL"&PositionURLID-1)
if InStr(ReturnURL,"?")<1 then
  ReturnURL=ReturnURL&"?ReturnURLID="&(PositionURLID-1)
else
  ReturnURL=ReturnURL&"&ReturnURLID="&(PositionURLID-1)
end If
 
If Mid(HTMLCODE,12,1)="0" Then
    Response.Redirect ReturnURL&"&SystemMessageType=3&SMT=4"
Else
    Response.Write HTMLCODE&"<br><br>"
    'Response.Redirect ReturnURL&"&SystemMessageType=4&SMT="&HTMLCODE
End If
%>