【调度系统】广东民航医疗快线调度系统源代码
wzp
2025-01-23 c1281b987b197d76d7d26e776aacd25560297658
perf:服务单列表和调度单列表,增加访问日志和权限控制
2个文件已修改
187 ■■■■■ 已修改文件
DispatchOrder_List.gds 90 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServiceOrder_List.gds 97 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DispatchOrder_List.gds
@@ -80,6 +80,96 @@
page_URL="&OrdState="&OrdState&"&OrdClassList="&OrdClassList&"&OrdDateType="&OrdDateType&"&OrdDateStart="&OrdDateStart&"&OrdDateEnd="&OrdDateEnd&"&UnitNameID="&UnitNameID&"&searchTXT="&searchTXT&"&h_menu1_1=1"
If CoopUnitID<>"" Then page_URL=page_URL&"&CoopUnitID="&CoopUnitID
%>
<%
' 记录管理员操作日志,谁访问了这个页面,写在了logs/目录下面
Dim adminName
adminName = Session("adminName")
' 检查 adminName 是否为空
If adminName = "" Then
    Response.Write("管理员名称未设置!")
    Response.End()
End If
' 获取当前日期并格式化为 YYYY-MM-DD
Dim currentDate
currentDate = Year(Now()) & "-" & Right("0" & Month(Now()), 2) & "-" & Right("0" & Day(Now()), 2)
' 定义文件路径和文件名
Dim fileName, filePath
fileName = "log_" & currentDate & ".txt" ' 例如:log_2023-10-05.txt
filePath = Server.MapPath("logs/" & fileName)
' 创建文件系统对象
Dim fs, f
Set fs = Server.CreateObject("Scripting.FileSystemObject")
' 检查 logs 目录是否存在,如果不存在则创建
Dim logsFolderPath
logsFolderPath = Server.MapPath("logs")
If Not fs.FolderExists(logsFolderPath) Then
    fs.CreateFolder(logsFolderPath)
End If
' 检查文件是否存在,如果不存在则创建
If Not fs.FileExists(filePath) Then
    Set f = fs.CreateTextFile(filePath, True)
    f.Close
End If
Dim isDepartmentStr
if isDepartment("030103")=1 Then
    isDepartmentStr="查看全部订单权限"
Else
    isDepartmentStr="无权限"
End If
' 打开文件并写入内容
On Error Resume Next ' 启用错误处理
Set f = fs.OpenTextFile(filePath, 8, True) ' 8 表示追加模式
If Err.Number = 0 Then ' 如果未发生错误
    f.WriteLine(Now() & " - " & adminName & " - 访问了[DispatchOrder_List 页面] - 用户权限:" & isDepartmentStr) ' 写入当前时间和管理员名称
    f.Close
Else
    ' 如果打开文件失败,忽略错误
End If
' 释放对象
Set f = Nothing
Set fs = Nothing
On Error GoTo 0 ' 关闭错误处理
'如果isDepartmentStr="无权限"
If isDepartmentStr = "无权限" Then
    ' 打开文件并写入内容
    On Error Resume Next ' 启用错误处理
    Set f = fs.OpenTextFile(filePath, 8, True) ' 8 表示追加模式
    If Err.Number = 0 Then ' 如果未发生错误
        f.WriteLine(Now() & " - " & adminName & " - 尝试访问[DispatchOrder_List 页面] - " & isDepartmentStr) ' 写入当前时间和管理员名称
        f.Close
    Else
        ' 如果打开文件失败,忽略错误
    End If
    ' 释放对象
    Set f = Nothing
    Set fs = Nothing
    On Error GoTo 0 ' 关闭错误处理
    Response.Write("Access not allowed, no permission!")
    Response.End()
End If
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
ServiceOrder_List.gds
@@ -3,6 +3,7 @@
<!--#include virtual="/inc/chkadmin.gds"-->
<!--#include virtual="/inc/function.gds"-->
<%
searchTXT=SafeRequest(trim(Request("searchTXT")))
searchTXTMore=SafeRequest(Request("searchTXTMore"))
If InStr(searchTXT,",")>0 Then
@@ -268,6 +269,102 @@
If CoopUnitID<>"" Then page_URL=page_URL&"&CoopUnitID="&CoopUnitID
%>
<%
' 记录管理员操作日志,谁访问了这个页面,写在了logs/目录下面
Dim adminName
adminName = Session("adminName")
' 检查 adminName 是否为空
If adminName = "" Then
    Response.Write("管理员名称未设置!")
    Response.End()
End If
' 获取当前日期并格式化为 YYYY-MM-DD
Dim currentDate
currentDate = Year(Now()) & "-" & Right("0" & Month(Now()), 2) & "-" & Right("0" & Day(Now()), 2)
' 定义文件路径和文件名
Dim fileName, filePath
fileName = "log_" & currentDate & ".txt" ' 例如:log_2023-10-05.txt
filePath = Server.MapPath("logs/" & fileName)
' 创建文件系统对象
Dim fs, f
Set fs = Server.CreateObject("Scripting.FileSystemObject")
' 检查 logs 目录是否存在,如果不存在则创建
Dim logsFolderPath
logsFolderPath = Server.MapPath("logs")
If Not fs.FolderExists(logsFolderPath) Then
    fs.CreateFolder(logsFolderPath)
End If
' 检查文件是否存在,如果不存在则创建
If Not fs.FileExists(filePath) Then
    Set f = fs.CreateTextFile(filePath, True)
    f.Close
End If
Dim isDepartmentStr
if isDepartment("020114")=1 Then
    isDepartmentStr="查看全部订单权限"
ElseIf isDepartment("020103")=1 Or isDepartment("020115")=1 Then
    isDepartmentStr="服务单查询权限"
Else
    isDepartmentStr="无权限"
End If
' 打开文件并写入内容
On Error Resume Next ' 启用错误处理
Set f = fs.OpenTextFile(filePath, 8, True) ' 8 表示追加模式
If Err.Number = 0 Then ' 如果未发生错误
    f.WriteLine(Now() & " - " & adminName & " - 访问了[ServiceOrder_List 页面] - 用户权限:" & isDepartmentStr) ' 写入当前时间和管理员名称
    f.Close
Else
    ' 如果打开文件失败,忽略错误
End If
' 释放对象
Set f = Nothing
Set fs = Nothing
On Error GoTo 0 ' 关闭错误处理
'如果isDepartmentStr="无权限"
If isDepartmentStr = "无权限" Then
    ' 打开文件并写入内容
    On Error Resume Next ' 启用错误处理
    Set f = fs.OpenTextFile(filePath, 8, True) ' 8 表示追加模式
    If Err.Number = 0 Then ' 如果未发生错误
        f.WriteLine(Now() & " - " & adminName & " - 尝试访问[ServiceOrder_List 页面] - " & isDepartmentStr) ' 写入当前时间和管理员名称
        f.Close
    Else
        ' 如果打开文件失败,忽略错误
    End If
    ' 释放对象
    Set f = Nothing
    Set fs = Nothing
    On Error GoTo 0 ' 关闭错误处理
    Response.Write("Access not allowed, no permission!")
    Response.End()
End If
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>