【调度系统】广东民航医疗快线调度系统源代码
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
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%Session.CodePage=65001%>
<!--#include virtual="/inc/chkadmin.gds"-->
<!--#include virtual="/inc/function.gds"-->
<%
Set rs = Server.CreateObject("ADODB.Recordset")
'定时任务相关
sql="update ServiceOrder set ServiceOrdOperationRemarks=replace(ServiceOrdOperationRemarks,'[客户未正式提交需求,可不联系]',''),ServiceOrdState=4,ServiceOrd_AP_ID=0,ServiceOrd_AP_Time=getdate(),ServiceOrdCancelReason=9,ServiceOrdCancelReasonTXT='自动取消' where  ServiceOrdState not in (4) and ServiceOrdOperationRemarks like '%客户未正式提交需求,可不联系%' and ServiceOrdUserUpdateTime<DATEADD(Minute,-20,GETDATE())"
objConn.Execute sql
 
NC_OAID=session("adminID")
NC_ID=Request("NC_ID")
If NC_ID<>"" Then
    sql="update Notification set NC_Read=1,NC_ReadTime=getdate(),NC_ReadOAID="&NC_OAID&" where (NC_Read=0 or NC_ReadOAID=0) and NC_ID="&NC_ID
    objConn.Execute sql
    Response.Write "1"
Else
    'If OAUser(NC_OAID,"DepartmentID")="9" Then
    '    NC_OAID=NC_OAID&",78"
    'End If
    If InStr(admin_OrderClass,"BF")>0 Or InStr(admin_OrderClass,"SA")>0 Then    '广州总部人员只通知广州本地相关订单
        OAClass="BF,SA"
    Else
        OAClass=admin_OrderClass
    End If
    sql="select id from dbo.OA_Competency where OA_CompetencyID=1 and OA_CompetencyUserID="&session("adminID")
    rs.open sql,objConn,1,1
    If not rs.Eof And OAClass<>"" Then
        NCOA_SQL=" (NC_OAID in ("&NC_OAID&")"
        OAClassSP=SPLIT(OAClass,",")
        for n = 0 to UBOUND(OAClassSP)
            If OAClassSP(n)<>"" Then NCOA_SQL=NCOA_SQL&" or NC_OAClass='"&OAClassSP(n)&"'"
        next
        NCOA_SQL=NCOA_SQL&") and "
    Else
        NCOA_SQL=" NC_OAID in ("&NC_OAID&") and "
    End If
    rs.close()
 
 
    sql="select count(NC_ID) from Notification where "&NCOA_SQL&" NC_Read=0 and NC_Time<=GETDATE() and NC_Name Not like '%已返回%' and NC_Name Not like '%成功支付%' and NC_Name Not like '%上传%'"
    'Response.Write sql
    rs.open sql,objConn,1,1
    UnitOrdInt=rs(0)
    rs.close()
    If CInt(UnitOrdInt)=0 Then
        sql="select count(NC_ID) from Notification where "&NCOA_SQL&" NC_Read=0 and NC_Time<=GETDATE() and (NC_Name like '%已返回%' or NC_Name like '%成功支付%' or NC_Name like '%上传%')"
        rs.open sql,objConn,1,1
        UnitOrdInt=rs(0)
        rs.close()
        If CInt(UnitOrdInt)>0 Then UnitOrdInt=-UnitOrdInt
    End If
    If UnitOrdInt<>0 Then
        If CInt(UnitOrdInt)>0 Then 
            sql="select top 1 NC_ID,NC_Name,NC_Content,NC_PageUrl from Notification where "&NCOA_SQL&" NC_Read=0 and NC_Time<=GETDATE() and NC_Name Not like '%已返回%' and NC_Name Not like '%成功支付%' and NC_Name Not like '%上传%' order by NC_Time desc"
        Else
            sql="select top 1 NC_ID,NC_Name,NC_Content,NC_PageUrl from Notification where "&NCOA_SQL&" NC_Read=0 and NC_Time<=GETDATE() and (NC_Name like '%已返回%' or NC_Name like '%成功支付%' or NC_Name like '%上传%') order by NC_Time desc"
        End If
        rs.open sql,objConn,1,1
        If not rs.Eof then
            NC_ID        = rs("NC_ID")
            NC_Name        = rs("NC_Name")
            NC_Content    = rs("NC_Content")
            NC_PageUrl    = rs("NC_PageUrl")&"&NC_ID="&NC_ID
            If InStr(NC_Name,"新订单")>0 Then
                NC_Content=Replace(NC_Content,"服务单号:",NC_Name)
            End If
            If InStr(NC_Content,"成功支付")>0 Then
                NC_Content=Replace(NC_Content,"[1]","[现金]")
                NC_Content=Replace(NC_Content,"[5]","[POS收款]")
                NC_Content=Replace(NC_Content,"[2]","[银行转账]")
                NC_Content=Replace(NC_Content,"[3]","[微信支付]")
                NC_Content=Replace(NC_Content,"[4]","[支付宝]")
                NC_Content=Replace(NC_Content,"[6]","[挂账]")
                NC_Content=Replace(NC_Content,"[7]","[易医通挂账]")
                NC_Content=Mid(NC_Content,1,InStr(NC_Content,"元")+1)
            End If
        End If
        rs.close()
        If Abs(UnitOrdInt)>1 Then NC_PageUrl="/Notification.gds"
    End If
    If UnitOrdInt="0" Then UnitOrdInt=""
 
    Response.Write UnitOrdInt&"|"&NC_ID&"|"&NC_Name&"|"&NC_Content&"|"&NC_PageUrl
End If
%>