【调度系统】广东民航医疗快线调度系统源代码
wanglizhong
2025-06-16 ae5b0a8c63979351028215b8fe8cdf4b0766c272
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
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%Session.CodePage=65001%>  
<!--#include file="JsonPost_3010011.gds"-->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<%
'补打卡 Https请求方式: POST
Set rs = Server.CreateObject("ADODB.Recordset")
 
DispatchOrdID    = trim(Request("DispatchOrdID"))
 
userid                = trim(Request("userid"))
checkin_time    = trim(Request("checkin_time"))
remark                = trim(Request("remark"))
work_type        = trim(Request("work_type"))
 
If DispatchOrdID<>"" Then
    sql="select DispatchOrdID,CONVERT(varchar(100),DATEADD(day,1,DispatchOrdActualDate),23) SaDate,CONVERT(varchar(100),DATEADD(day,-1,DispatchOrdReturnDate),23) BeDate,OA_User_ID,OA_Name,OA_weixinUserID from DispatchOrd,DispatchOrd_Entourage,OA_User where OA_User_ID=EntourageOAid and DispatchOrdID=DispatchOrdIDDt and EntourageState<>4 and DATEDIFF(day,DispatchOrdActualDate,DispatchOrdReturnDate)>=2 and OA_EmployeeGroup not in (4) and DispatchOrdClass in ('SA') and DispatchOrdID in ("&DispatchOrdID&")"
    rs.open sql,objConn,1,1
    if not rs.eof then
        '未完成 3016090978
 
    end If
Else
    If userid<>"" And checkin_time<>"" And remark<>"" Then
        schedule_date_time    = ToUnixTime(year(checkin_time)&"-"&month(checkin_time)&"-"&day(checkin_time)&" 00:00:00",+8)
        checkin_time                = ToUnixTime(checkin_time,+8)
        If work_type="" Then work_type="1"
        args1="{"
        args1=args1&"""datetime"": "&schedule_date_time
        args1=args1&",""useridlist"": ["""&userid&"""]"
        args1=args1&"}"
    End If
End If
 
 
If args1<>"" Then
    appUrl="https://qyapi.weixin.qq.com/cgi-bin/checkin/getcheckinoption?access_token="&access_token
    'Response.Write args1&"<br>"
    HTMLCODE= PostBody(appUrl,args1)
 
    If HTMLCODE<>"" Then
    %>
    <script language="JScript" runat="Server"> 
        function toObject(json) { 
            eval("var o=" + json); 
            return o; 
        } 
        function toArray(s){
            var dic = Server.CreateObject("Scripting.Dictionary")
            eval("var a=" + json);
            for(var i=0;i<a.length;i++){
                var obj = Server.CreateObject("Scripting.Dictionary")
                for(x in a[i]) obj.Add(x,a[i][x])
                dic.Add(i, obj);
            }
            return dic
        }
        </script> 
    <script language="jscript" runat="server">
    Array.prototype.get = function(i)
    {
     return this[i]; 
    };
    function getjson(str){
     try{
      eval("var jsonStr = (" + str + ")");
     }catch(ex){
      var jsonStr = null;
     }
     return jsonStr;
    }
    </script>
        <%
        str=HTMLCODE
        dim obj
        set obj = getjson(str)
            errmsg    = obj.errmsg
            If errmsg="ok" Then
                work_sec=0
                off_work_sec=0
                for v=0 to obj.info.length-1
                    for q=0 to obj.info.get(v).group.checkindate.length-1
                        for w=0 to obj.info.get(v).group.checkindate.get(q).checkintime.length-1
                            work_sec            = obj.info.get(v).group.checkindate.get(q).checkintime.get(q).work_sec            '上班时间
                            off_work_sec    = obj.info.get(v).group.checkindate.get(q).checkintime.get(q).off_work_sec        '下班时间
                        Next
                    Next
                Next
            End If
End If
If work_sec<>0 Or off_work_sec<>0 Then
    If work_type="1" Then
        args_schedule_checkin_time=",""schedule_checkin_time"": "&work_sec
    Else
        args_schedule_checkin_time=",""schedule_checkin_time"": "&off_work_sec
    End If
End If
 
    appUrl="https://qyapi.weixin.qq.com/cgi-bin/checkin/punch_correction?access_token="&access_token
    args1="{"
    args1=args1&"""userid"": """&userid&""""
    args1=args1&",""schedule_date_time"": "&schedule_date_time
    args1=args1&args_schedule_checkin_time
    args1=args1&",""checkin_time"": "&checkin_time
    args1=args1&",""remark"": """&remark&""""
    args1=args1&"}"
    'Response.Write args1&"<br>"
    'Response.End
    HTMLCODE= PostBody(appUrl,args1)
End If
'Response.Write HTMLCODE&"<br><br>"
'Response.End
If HTMLCODE<>"" Then
    
End If
'Response.End
Response.Write HTMLCODE
 
'把标准时间转换为UNIX时间戳
Function ToUnixTime(strTime, intTimeZone)
    If IsEmpty(strTime) or Not IsDate(strTime) Then strTime = Now
    If IsEmpty(intTimeZone) or Not isNumeric(intTimeZone) Then intTimeZone = 0
    ToUnixTime = DateAdd("h",-intTimeZone,strTime)
    ToUnixTime = DateDiff("s","1970-01-01 00:00:00", ToUnixTime)
End Function
'把UNIX时间戳转换为标准时间
Function FromUnixTime(intTime, intTimeZone)
    If IsEmpty(intTime) or Not IsNumeric(intTime) Then
        FromUnixTime = Now()
        Exit Function
    End If         
    If IsEmpty(intTime) or Not IsNumeric(intTimeZone) Then intTimeZone = 0
    FromUnixTime = DateAdd("s", intTime, "1970-01-01 00:00:00")
    FromUnixTime = DateAdd("h", intTimeZone, FromUnixTime)
End Function
%>