wanglizhong
2025-05-05 41332c9a8b1164dba70930f93f6a67abad4fc7fd
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
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%Session.CodePage=65001%>
<%Response.Buffer = True
Server.ScriptTimeOut=240000
'On Error Resume Next
%>
<!--#include virtual="/inc/odbc.asp"-->
<!--#include virtual="/inc/function.asp"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1, maximum-scale=1, user-scalable=no">  
<title>记录中..</title>
</head>
<%
'-------------------------------------------------------------记录客户评价
ServiceOrdID    = SafeRequest(trim(request.form("ServiceOrdID")))
DispatchOrdID    = SafeRequest(trim(request.form("DispatchOrdID")))
Guest_openid    = SafeRequest(trim(request.form("openid")))
if ServiceOrdID="" or DispatchOrdID="" or Guest_openid="" then
  'Response.Redirect "/OrdEvaluateError.asp"
  'Response.End()
end If
Guest_PointE    = SafeRequest(trim(request.form("Guest_PointE")))
Guest_Reward    = SafeRequest(trim(request.form("amount")))
If Guest_Reward="-1" Then Guest_Reward=SafeRequest(trim(request.form("other_amount")))
Guest_Point        = SafeRequest(trim(request.form("point")))
Guest_Evaluate    = SafeRequest(trim(request.form("contents")))
Guest_Impression= ""
If Guest_Reward="" Then Guest_Reward=0
If Guest_Point="" Then Guest_Point=1
 
Set rs = Server.CreateObject("ADODB.Recordset")
sql="select ServiceOrdID from ServiceOrder where Guest_Point=0 and ServiceOrdID="&ServiceOrdID
rs.open sql,objConn,1,1
if rs.Eof then
  Response.Redirect "/OrdEvaluateError.asp?ErrorID=2"
  Response.End()
end if
rs.close()
 
'重复评价检查
If Guest_openid<>"" then
    sql="select count(ServiceOrdID) from ServiceOrder where Guest_openid='"&Guest_openid&"' and Guest_Time>=dateadd(Month,-1,GETDATE())"
    rs.open sql,objConn,1,1
    OldInt=rs(0)
    rs.close()
    If CInt(OldInt)>=3 Then
      Response.Redirect "/OrdEvaluateError.asp?ErrorID=1"
      Response.End()
    End If
    sql="select id from dictionary where vtitle='966120_OA_openid' and vType>=1 and vtext='"&Guest_openid&"'"
    rs.open sql,objConn,1,1
    If Not rs.eof Then
      Response.Redirect "/OrdEvaluateError.asp?ErrorID=1"
      Response.End()
    End If
    rs.close()
End If
 
If Guest_PointE="1" Then
    sql="update DispatchOrd_Entourage set Guest_PointE=',9' from DispatchOrd_Entourage where EntourageState<>4 and DispatchOrdIDDt="&DispatchOrdID
    objConn.Execute sql
else
    EId    = SafeRequest(trim(request.form("EId")))
    EIdSP    = SPLIT(EId,", ")
    for i = 0 to UBOUND(EIdSP)
        EId = EIdSP(i)
        If EId<>"" Then
            EntourageName    = SafeRequest(trim(request.form("EntourageName_"&EId)))
            Guest_PointE    = SafeRequest(trim(request.form("Guest_PointE_"&EId)))
            If Guest_PointE="1" Then 
                Guest_PointE=",9"
            ElseIf Guest_PointE="2" Then
                Guest_PointE=",1"
            ElseIf Guest_PointE="3" Then
                Guest_PointE=",2"
            Else
                Guest_PointE=",8"
            End If
            If EntourageName="司机" And DispatchOrdID<>"" Then
                sql="update DispatchOrd_Entourage set Guest_PointE='"&Guest_PointE&"' from DispatchOrd_Entourage,dictionary where vtitle='DispatchOrdEntourage' and  EntourageID=vID and EntourageState<>4 and DispatchOrdIDDt="&DispatchOrdID&" and vtext='司机'"
                objConn.Execute sql
            Else
                sql="update DispatchOrd_Entourage set Guest_PointE='"&Guest_PointE&"' where id="&EId
                objConn.Execute sql
            End If
        End if
    Next
End If
 
sql="update ServiceOrder set Guest_openid='"&Guest_openid&"',Guest_Point=1,Guest_Impression='"&Guest_Impression&"',Guest_Evaluate='"&Guest_Evaluate&"',Guest_Time=getdate() where ServiceOrdID="&ServiceOrdID
objConn.Execute sql
 
'生成100元优惠券
'CouponNO=DDateID()&DTimeID()
'CouponMoney=100
'CouponRemarks=""
'sql="Insert into Coupon (CouponNO,CouponMoney,CouponDate_Ent,CouponRemarks,ServiceOrdIDPK) values ('"&CouponNO&"',"&CouponMoney&",getdate()+365,'"&CouponRemarks&"',"&ServiceOrdID&")"
'objConn.Execute sql
 
    'Response.Redirect "/OrdEvaluateOK.asp"
If Guest_Reward>0 Then
    Response.Redirect "/pay/weixin_pay.asp?attach=打赏&DispatchOrdID="&DispatchOrdID&"&ServiceOrdID="&ServiceOrdID&"&openid="&Guest_openid&"&Total_fee="&Guest_Reward&"&CouponNO="&CouponNO
Else
    Response.Redirect "/OrdEvaluateOK.asp?ServiceOrdID="&ServiceOrdID&"&DispatchOrdID="&DispatchOrdID&"&CouponNO="&CouponNO
End If
Response.End%>