【调度系统】广东民航医疗快线调度系统源代码
hzj
2025-07-09 4418374d26a16ec759e06059c2b1fedabe1827e6
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
<%
Function delFollower(ServiceOrderID)
    sql = "DELETE FROM ServiceOrderCommissionDetails WHERE ServiceOrderID = " & ServiceOrderID & " AND PersonType = 'Follower'"
    objConn.Execute sql
End Function
 
Function SaveFollower(ServiceOrderID,userId,userName,userRatio)
    if userId<>"" and userName<>"" and userRatio<>"" then
        ' 如果不存在,则插入新记录
        sql = "INSERT INTO ServiceOrderCommissionDetails (ServiceOrderID, PersonID, PersonName, CommissionRatio, PersonType) VALUES (" & ServiceOrderID & ", " & userId & ", '" & userName & "', " & userRatio & ", 'Follower')"    
        objConn.Execute sql
    End if
End Function
 
Function SaveFollowers(ServiceOrderID)
    ' 先删除所有跟单人记录    
    followerCount = SafeRequest(Request.form("FollowersCount"))
    If Trim(followerCount)<>"" and IsNumeric(followerCount) then
        numericFollowerCount = CInt(Trim(followerCount))
            
        if numericFollowerCount>0 then
            delFollower ServiceOrderID
            for i=1 to numericFollowerCount
                userId = SafeRequest(Request.form("FollowerId_" & i ))
                userName = SafeRequest(Request.form("FollowerName_" & i))
                userRatio = SafeRequest(Request.form("FollowerRatio_" & i))
                SaveFollower ServiceOrderID, userId, userName, userRatio
            next
        end if
    end if
End Function
 
 
' 保存开单人及提成比例的函数
Function SaveOpenerCommission(ServiceOrderID)   
    OpenerID            = SafeRequest(Request.form("OpenUserID"))                '开单人ID
    OpenerName            = SafeRequest(Request.form("OpenUserName"))                '开单人名称
    OpenerRatio            = SafeRequest(Request.form("OpenUserRatio"))            '开单人提成比例
    if OpenerID<>"" and OpenerName<>"" and OpenerRatio<>"" then      
    
        ' 先检查是否已经存在该服务单的开单人记录
        sql = "SELECT ID FROM ServiceOrderCommissionDetails WHERE ServiceOrderID = " & ServiceOrderID & " AND PersonType = 'Opener'"
        
        rs.Open sql, objConn, 1, 1
        
        If rs.EOF Then
            ' 如果不存在,则插入新记录
            sql = "INSERT INTO ServiceOrderCommissionDetails (ServiceOrderID, PersonID, PersonName, CommissionRatio, PersonType) VALUES (" & ServiceOrderID & ", " & OpenerID & ", '" & OpenerName & "', " & OpenerRatio & ", 'Opener')"
        Else
            ' 如果存在,则更新记录
            sql = "UPDATE ServiceOrderCommissionDetails SET PersonID = " & OpenerID & ", PersonName = '" & OpenerName & "', " &"CommissionRatio = " & OpenerRatio & " WHERE ID = " & rs("ID")
        End If
        'response.write sql
        rs.Close    
        objConn.Execute sql
    End if
End Function
%>