<% @LANGUAGE="VBSCRIPT" CODEPAGE="65001" %>
|
<% Session.CodePage=65001 %>
|
<% Response.charset = "utf-8" %>
|
<!--#include virtual="/v3/inc/odbc.asp"-->
|
<!--#include virtual="/v3/inc/function.asp"-->
|
<!--#include virtual="/v3/inc/core.asp"-->
|
<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>
|
<%
|
Set rs = Server.CreateObject("ADODB.Recordset")
|
Set rsDt = Server.CreateObject("ADODB.Recordset")
|
method="OrderPrice"
|
V = trim(request("V")) '公式版本
|
If V="" Then V="1.0"
|
|
UserID = trim(request("UserID")) '用户ID
|
ServiceOrdID = trim(request("ServiceOrdID")) '服务单号
|
StartAddress = trim(request("StartAddress")) '出发地地址(支持坐标)
|
Address = trim(request("Address")) '出发地地址简写
|
ViaAddress = trim(request("ViaAddress")) '转出地址(不使用)
|
EndAddress = trim(request("EndAddress")) '目的地址
|
ServiceBranch = trim(request("ServiceBranch")) '所属地区/分公司
|
ServiceOrdApptDate= trim(request("ApptDate")) '预约时间
|
|
TraDistance = trim(request("TraDistance")) '任务单程公里数
|
IsLifting = trim(request("IsLifting")) '是否抬楼机
|
LiftingInt = trim(request("LiftingInt")) '抬楼层数:默认0
|
WaitingInt = trim(request("WaitingInt")) '等待时长:默认0
|
|
Isluxury = trim(request("Isluxury")) '是否使用豪华车:默认0
|
If Isluxury="" Then Isluxury="0"
|
IsRoundtrip = trim(request("IsRoundtrip")) '是否往返:默认0
|
If IsRoundtrip="" Then IsRoundtrip="0"
|
|
IsCoupon = trim(request("IsCoupon")) '是否使用优惠券/次数卡:默认哪个优惠优先使用哪个
|
If IsCoupon="" Then IsCoupon="-1"
|
|
'NursingLevel = trim(request("NursingLevel")) '医护护理级别
|
'IsVentilato = trim(request("IsVentilato")) '是否使用呼吸机
|
'IsWarmBox = trim(request("IsWarmBox")) '是否使用温箱
|
|
|
|
'ICUInt = trim(request("ICUInt")) '居家ICU服务时长:默认0
|
|
IRid = trim(request("IRid")) '方案ID
|
StartProvince = trim(request("StartProvince"))
|
StartCity = trim(request("StartCity"))
|
StartArea = trim(request("StartArea"))
|
U_UnitShort = trim(request("U_UnitShort"))
|
U_TraDistance = trim(request("U_TraDistance"))
|
AgeGroup = trim(request("AgeGroup")) '病人年龄段(1成年人 (12岁以上),2儿童(0-3岁(含3岁)),3儿童(3-6岁(含6岁)),4儿童(6-12岁),5新生儿 (出生至28天以内))
|
If U_TraDistance="" Then U_TraDistance=0
|
|
IRState="IRState" '方案状态
|
|
If V="0.1" Then
|
IRState="IRwxState"
|
ElseIf V="2.0" Then
|
IRState="IRwxState"
|
End If
|
|
If Not IsNumeric(UserID) Then UserID=""
|
If ServiceOrdID="undefined" Then ServiceOrdID=""
|
If TraDistance="" Or Not IsNumeric(TraDistance) Then TraDistance=0
|
If NursingLevel="" Or Not IsNumeric(NursingLevel) Then NursingLevel=0
|
If IsVentilato="" Or Not IsNumeric(IsVentilato) Then IsVentilato=0
|
If IsWarmBox="" Or Not IsNumeric(IsWarmBox) Then IsWarmBox=0
|
If IsFerry="" Or Not IsNumeric(IsFerry) Then IsFerry=0
|
If LiftingInt="" Or Not IsNumeric(LiftingInt) Then LiftingInt=0
|
If WaitingInt="" Or Not IsNumeric(WaitingInt) Then WaitingInt=0
|
If ICUInt="" Or Not IsNumeric(ICUInt) Then ICUInt=0
|
If IRid="" Or Not IsNumeric(IRid) Then IRid=0
|
If IsLifting="" Or Not IsNumeric(IsLifting) Then IsLifting=0
|
TraDistance=CLng(TraDistance)
|
'LiftingInt=CLng(LiftingInt)-1
|
|
If ServiceBranch="" Then ServiceBranch="GZ"
|
errcode=0
|
OrderPrice=0
|
StartAddress_lat=0
|
StartAddress_lng=0
|
EndAddress_lat=0
|
EndAddress_lng=0
|
|
If ServiceOrdID<>"" Then
|
sql="select ServiceOrdUserID,ServiceOrdClass,ServiceOrdTraStreet,ServiceOrdTraVia,ServiceOrdTraEnd,ServiceOrdUnitRemarks,ServiceOrdApptDate,ServiceOrdTraStreetCoo,ServiceOrdTraEndCoo from ServiceOrder where ServiceOrdID="&ServiceOrdID
|
rs.open Sql,objConn,1,1
|
If not rs.Eof Then
|
UserID=rs("ServiceOrdUserID")
|
ServiceBranch = rs("ServiceOrdClass")
|
StartAddress = trim(rs("ServiceOrdTraStreet"))
|
StartAddressTXT=trim(rs("ServiceOrdTraStreet"))
|
If trim(rs("ServiceOrdTraStreetCoo"))<>"" Then StartAddress=ServiceOrdTraStreetCoo
|
EndAddress = trim(rs("ServiceOrdTraEnd"))
|
EndAddressTXT=trim(rs("ServiceOrdTraStreet"))
|
If trim(rs("ServiceOrdTraEndCoo"))<>"" Then EndAddress=ServiceOrdTraEndCoo
|
|
ServiceOrdUnitRemarks = trim(rs("ServiceOrdUnitRemarks"))
|
ServiceOrdApptDate=rs("ServiceOrdApptDate")
|
End If
|
rs.close()
|
Else
|
StartAddressTXT = StartAddress
|
EndAddressTXT = EndAddress
|
End If
|
|
|
|
If StartAddress="" Then
|
errcode=40020
|
errmsg="invalid StartAddress"
|
ElseIf EndAddress="" Then
|
errcode=40021
|
errmsg="invalid EndAddress"
|
End If
|
|
If TraDistance=0 or StartProvince="" Then
|
'出发地坐标
|
If InStr(StartAddress,",")>1 And errcode=0 Then
|
StartAddressSP=SPLIT(StartAddress,",")
|
If UBOUND(StartAddressSP)=1 Then
|
If IsNumeric(StartAddressSP(0)) And IsNumeric(StartAddressSP(1)) Then
|
StartAddress_lat=StartAddressSP(0)
|
StartAddress_lng=StartAddressSP(1)
|
End If
|
End If
|
End If
|
|
If StartAddress_lat=0 And errcode=0 Then
|
appUrl="https://api.map.baidu.com/geocoding/v3/"
|
args1="address="&StartAddress&"&output=json&ak=rGQBbHKGjAtVQy23OckafQkC6nNlaGmi"
|
HTMLCODE= GetBody(appUrl,args1)
|
'Response.Write HTMLCODE
|
'Response.End
|
json = HTMLCODE
|
str=json
|
set obj = getjson(str)
|
status = obj.status
|
If status=0 Then
|
StartAddress_lat = obj.result.location.lat
|
StartAddress_lng = obj.result.location.lng
|
'OrderPriceTXT="出发:"&StartAddress_lng&","&StartAddress_lat
|
OrderPriceTXT=StartAddressTXT
|
End if
|
End If
|
|
'目的地坐标
|
If InStr(EndAddress,",")>1 And errcode=0 Then
|
EndAddressSP=SPLIT(EndAddress,",")
|
If UBOUND(EndAddressSP)=1 Then
|
If IsNumeric(EndAddressSP(0)) And IsNumeric(EndAddressSP(1)) Then
|
EndAddress_lat=EndAddressSP(0)
|
EndAddress_lng=EndAddressSP(1)
|
End If
|
End If
|
End If
|
If EndAddress_lat=0 And errcode=0 Then
|
appUrl="https://api.map.baidu.com/geocoding/v3/"
|
args1="address="&EndAddress&"&output=json&ak=rGQBbHKGjAtVQy23OckafQkC6nNlaGmi"
|
HTMLCODE= GetBody(appUrl,args1)
|
'Response.Write HTMLCODE
|
'Response.End
|
json = HTMLCODE
|
str=json
|
set obj = getjson(str)
|
status = obj.status
|
If status=0 Then
|
EndAddress_lat = obj.result.location.lat
|
EndAddress_lng = obj.result.location.lng
|
End If
|
End If
|
'OrderPriceTXT=OrderPriceTXT&" 目的:"&EndAddress_lng&","&EndAddress_lat
|
OrderPriceTXT=OrderPriceTXT&"至"&EndAddressTXT
|
End If
|
|
If (StartAddress_lat<>0 And EndAddress_lat<>0) And errcode=0 Then
|
'实时距离
|
|
'计算所属地区(按出发地计算)
|
Region_lat=StartAddress_lat
|
Region_lng=StartAddress_lng
|
|
|
'地区报价方案
|
appUrl="https://api.map.baidu.com/reverse_geocoding/v3/"
|
args1="location="&Region_lat&","&Region_lng&"&output=json&latest_admin=1&ak=rGQBbHKGjAtVQy23OckafQkC6nNlaGmi"
|
HTMLCODE= GetBody(appUrl,args1)
|
json = HTMLCODE
|
'Response.Write HTMLCODE
|
str=json
|
set obj = getjson(str)
|
status = obj.status
|
If status=0 Then
|
StartProvince = obj.result.addressComponent.province
|
StartCity = obj.result.addressComponent.city
|
StartArea = obj.result.addressComponent.district
|
End If
|
|
If TraDistance=0 Then
|
'路线规划距离(公里)
|
appUrl="https://api.map.baidu.com/directionlite/v1/driving"
|
args1="origin="&StartAddress_lat&","&StartAddress_lng&"&destination="&EndAddress_lat&","&EndAddress_lng&"&coord_type=wgs84&ak=rGQBbHKGjAtVQy23OckafQkC6nNlaGmi"
|
HTMLCODE= GetBody(appUrl,args1)
|
json = HTMLCODE
|
|
str=json
|
set obj = getjson(str)
|
status = obj.status
|
If status=0 Then
|
str=json
|
str=right(str,len(str)-instr(str,"[")+1)
|
str=left(str,InstrRev(str,"]"))
|
set obj = getjson(str)
|
for i=0 to obj.length-1
|
TraDistance = obj.get(i).distance '行程距离(米)
|
Next
|
End If
|
If TraDistance>1000 And IsNumeric(TraDistance) Then
|
TraDistance=CInt(TraDistance/1000)
|
ElseIf TraDistance>0 And IsNumeric(TraDistance) Then
|
TraDistance=1
|
End If
|
If IsRoundtrip="1" Then
|
TraDistance=TraDistance*2
|
End If
|
OrderPriceTXT=OrderPriceTXT&" 预计距离:"&TraDistance&"公里 "
|
End If
|
Else
|
'缓存距离
|
OrderPriceTXT=OrderPriceTXT&" 预计距离:"&TraDistance&"公里 "
|
If U_TraDistance<>"" And U_TraDistance<>"0" Then OrderPriceTXT="出发机构:"&U_UnitShort&" "&U_TraDistance&"公里 "&OrderPriceTXT
|
End If
|
|
|
If TraDistance>0 Then
|
'费用计算
|
IRPrice=0
|
OrderPrice=0
|
IsOrdinary="0" '是否有普通车可选 0没有,1有
|
If errcode=0 Then
|
'地址屏蔽黑名单
|
|
If StartProvince<>"" And StartCity<>"" And StartArea<>"" And IRid=0 And 1=2 Then
|
sql="select IRid,IRNursingLevel from IntroducerRegion where "&IRState&"=1 and (IRProvince='"&StartProvince&"' and IRCity='"&StartCity&"' and IRArea='"&StartArea&"' and IRkeyword='') and IRPrice>0 order by IRUnitID desc,IRNursingLevel desc"
|
rs.open sql,objConn,1,1
|
do while not rs.Eof
|
IRid = rs("IRid") '报价方案ID
|
IRNursingLevel = rs("IRNursingLevel") '医护护理级别
|
If CLng(IRNursingLevel)=CLng(NursingLevel) Then exit do
|
rs.movenext
|
loop
|
rs.close()
|
End If
|
If IRid=0 Then '默认方案1
|
IRid=1
|
End If
|
If IRid<>0 Then
|
'手动报价
|
If InStr(Address,"白云机场")>0 Or InStr(Address,"白云国际机场")>0 Then
|
IRPrice=489
|
IRlimit1=5
|
IRDtPrice=6
|
ElseIf InStr(Address,"广州南站")>0 Then
|
IRPrice=389
|
IRlimit1=5
|
IRDtPrice=6
|
ElseIf InStr(Address,"广州白云站")>0 Then
|
IRPrice=389
|
IRlimit1=5
|
IRDtPrice=6
|
ElseIf InStr(Address,"广州东站")>0 Then
|
IRPrice=359
|
IRlimit1=5
|
IRDtPrice=6
|
'ElseIf StartArea="白云区" Then
|
' IRPrice=99
|
' IRlimit1=5
|
' IRDtPrice=6
|
elseIf StartArea="越秀区" Or StartArea="荔湾区" Or StartArea="海珠区" Or StartArea="天河区" Or StartArea="黄埔区" Or StartArea="白云区" Then
|
IRPrice=169
|
IRlimit1=5
|
IRDtPrice=6
|
elseif StartArea="番禺区" Then
|
IRPrice=219
|
IRlimit1=5
|
IRDtPrice=6
|
ElseIf StartArea="花都区" Then
|
IRPrice=169
|
IRlimit1=5
|
IRDtPrice=6
|
ElseIf StartArea="增城区" And Isluxury="0" Then
|
IRPrice=99
|
IRlimit1=5
|
IRDtPrice=6
|
IsOrdinary="1"
|
Elseif StartArea="增城区" And Isluxury="1" Then
|
IRPrice=99
|
IRlimit1=5
|
IRDtPrice=6
|
IsOrdinary="1"
|
ElseIf StartArea="从化区" Then
|
IRPrice=359
|
IRlimit1=5
|
IRDtPrice=6
|
ElseIf StartArea="南沙区" And Isluxury="0" Then
|
IRPrice=99
|
IRlimit1=5
|
IRDtPrice=6
|
IsOrdinary="1"
|
ElseIf StartArea="南沙区" And Isluxury="1" Then
|
IRPrice=359
|
IRlimit1=5
|
IRDtPrice=6
|
IsOrdinary="1"
|
Else
|
IRPrice=359
|
IRlimit1=5
|
IRDtPrice=6
|
End If
|
End If
|
addressComponent=StartProvince
|
If StartCity<>"" Then addressComponent=addressComponent&"-"&StartCity
|
If StartArea<>"" Then addressComponent=addressComponent&"-"&StartArea
|
If IsRoundtrip="1" Then
|
IRlimit1=IRlimit1*2
|
End If
|
|
'计算报价
|
OrderPriceFRM=""
|
'OrderPriceTXT=""
|
If IRPrice>0 And TraDistance>0 Then
|
'基础报价
|
'If IsCoupon="2" Then IRPrice=0 '使用次数卡减免起步费
|
OrderPrice=OrderPrice+IRPrice '起步价
|
OrderPriceFRM = OrderPriceFRM & IRPrice
|
OrderPriceTXT = OrderPriceTXT&"起步价("&IRlimit1&"公里内):"&IRPrice&"元\n"
|
|
If TraDistance>IRlimit1 then
|
IRDtDistance=TraDistance-IRlimit1
|
'If IRDtDistance<IRDtlimit2 Then IRDtDistance=IRDtlimit2
|
OrderPrice=OrderPrice+IRDtDistance*IRDtPrice
|
OrderPriceFRM = OrderPriceFRM & "+"&IRDtDistance&"*"&IRDtPrice
|
OrderPriceTXT = OrderPriceTXT&IRlimit1&"公里以上:"&IRDtPrice&"元/公里\n"
|
End If
|
|
'服务报价
|
If CLng(IsLifting)=1 Then '是否要电动爬楼机
|
IRIsLiftingCost=69 '爬楼机基本费用
|
IRLiftingIntCost=10 '3楼以上每层费用
|
If CLng(LiftingInt)>=3 Then
|
IRIsLiftingCost=IRIsLiftingCost+(CLng(LiftingInt)-2)*IRLiftingIntCost
|
End If
|
OrderPrice=OrderPrice+IRIsLiftingCost
|
OrderPriceFRM = OrderPriceFRM & "+"&IRIsLiftingCost
|
OrderPriceTXT = OrderPriceTXT&"电动爬楼机费用:"&IRIsLiftingCost&"元\n"
|
End If
|
If round(WaitingInt,1)>0 Then '等待费用(10分钟)
|
IRWaitingCost=10
|
OrderPrice=OrderPrice+WaitingIn*IRWaitingCost
|
OrderPriceFRM = OrderPriceFRM & "+"&WaitingInt&"*"&IRWaitingCost
|
OrderPriceTXT = OrderPriceTXT&"等待费用:"&WaitingInt*IRWaitingCost&"元\n"
|
End If
|
If ServiceOrdApptDate<>"" Then '非工作时间服务费用,周一~五的0800-2000 1.3倍
|
sql="select SpecialRatio from SpecialDates where SpecialDates='"&formatdatetime(ServiceOrdApptDate,2)&"'"
|
rs.open sql,objConn,1,1
|
if not rs.Eof Then
|
SpecialRatio=rs("SpecialRatio")
|
OrderPriceFRM = OrderPriceFRM & OrderPrice*(SpecialRatio-1)
|
OrderPriceTXT = OrderPriceTXT&"节假日时间服务费用:"&OrderPrice*(SpecialRatio-1)&"元\n"
|
OrderPrice=OrderPrice*SpecialRatio
|
ElseIf (hour(ServiceOrdApptDate)<=8 Or hour(ServiceOrdApptDate)>=20) Then
|
OrderPriceFRM = OrderPriceFRM & OrderPrice*0.3
|
OrderPriceTXT = OrderPriceTXT&"非工作时间服务费用:"&OrderPrice*0.3&"元\n"
|
OrderPrice=OrderPrice*1.3
|
End If
|
rs.close()
|
End If
|
|
'次数卡查询
|
UserCard=0
|
UserCardNO=""
|
UserCardName=""
|
If UserID<>"" And TraDistance>0 Then
|
sql="select top 1 * from (select ProjectName,ServiceOrdIDDt,sum(CardInt) CardInt,CardPrice,OriginalPrice,CardStartDate,CardEndDate,Instructions from UserCard,CouponCardData where CardId=ToCid and ToUserID="&UserID&" and CardEndDate>=getdate() GROUP BY ProjectName,ServiceOrdIDDt,CardPrice,OriginalPrice,CardStartDate,CardEndDate,Instructions) as a1 where CardInt>0 order by CardEndDate"
|
rs.open sql,objConn,1,1
|
if not rs.Eof Then
|
UserCard=rs("CardInt")
|
UserCardNO=Right(rs("ServiceOrdIDDt"),8) '卡号
|
UserCardName="次数卡"
|
End If
|
rs.close()
|
|
'使用次数卡减免起步费
|
If (IsCoupon="2" Or IsCoupon="-1") And UserCard>0 And OrderPrice>=IRPrice Then
|
IsCoupon="2"
|
OrderPrice=OrderPrice-IRPrice
|
OrderPriceFRM = OrderPriceFRM & "-"&IRPrice
|
OrderPriceTXT = OrderPriceTXT&"次数卡:-"&IRPrice&"元 "&UserCardNO&"\n"
|
OrderPriceTips="共计减免:"&IRPrice&"元"
|
ServiceOrdTraPriceReason="次数卡:"&UserCardNO&" "&IRPrice&"元"
|
End If
|
End If
|
|
'优惠券查询
|
UserCouponNO=""
|
UserCoupon=0
|
If UserID<>"" And TraDistance>0 Then
|
sql="select CouponNO,CouponMoney from Coupon where CouponDate_Ent>=getdate() and ToUserID="&UserID&" and CouponState=0 order by CouponMoney desc"
|
rs.open sql,objConn,1,1
|
do while not rs.Eof
|
CouponNO=rs("CouponNO")
|
CouponMoney=rs("CouponMoney")
|
If CouponMoney=150 And TraDistance>=100 Then
|
UserCouponNO = CouponNO
|
UserCoupon = CouponMoney
|
Exit Do
|
ElseIf CouponMoney=20 Then
|
UserCouponNO = CouponNO
|
UserCoupon = CouponMoney
|
Exit Do
|
End If
|
rs.movenext
|
loop
|
rs.close()
|
|
If (IsCoupon="1" Or IsCoupon="-1") And CouponMoney>0 And OrderPrice>=CouponMoney Then
|
IsCoupon="1"
|
OrderPrice=OrderPrice-CouponMoney
|
OrderPriceFRM = OrderPriceFRM & "-"&CouponMoney
|
OrderPriceTXT = OrderPriceTXT&"活动优惠券:-"&CouponMoney&"元 "&CouponNO&"\n"
|
OrderPriceTips="共计优惠:"&CouponMoney&"元"
|
ServiceOrdTraPriceReason="优惠券:"&CouponNO&" "&CouponMoney&"元"
|
End If
|
End If
|
|
|
|
OrderPriceFRM = OrderPriceFRM&"="&OrderPrice
|
OrderPriceTXT = OrderPriceTXT&"总费用:"&OrderPrice&"元\n"
|
Else
|
OrderPrice=0
|
OrderPriceFRM="暂不报价"
|
OrderPriceTXT="客服报价"
|
|
'次数卡查询
|
OrdCard=0
|
If UserID<>"" And TraDistance>0 Then
|
sql="select top 1 * from (select ProjectName,ServiceOrdIDDt,sum(CardInt) CardInt,CardPrice,OriginalPrice,CardStartDate,CardEndDate,Instructions from UserCard,CouponCardData where CardId=ToCid and ToUserID="&UserID&" and CardEndDate>=getdate() GROUP BY ProjectName,ServiceOrdIDDt,CardPrice,OriginalPrice,CardStartDate,CardEndDate,Instructions) as a1 where CardInt>0 order by CardEndDate"
|
rs.open sql,objConn,1,1
|
if not rs.Eof Then
|
UserCard=rs("CardInt")
|
UserCardNO=Right(rs("ServiceOrdIDDt"),8) '卡号
|
UserCardName="次数卡"
|
End If
|
rs.close()
|
If (IsCoupon="2" Or IsCoupon="-1") And OrdCard>0 Then
|
IsCoupon="2"
|
OrderPriceTXT = OrderPriceTXT&",客户希望使用次数卡:"&UserCardNO&"\n"
|
End If
|
End If
|
|
'优惠券查询
|
OrdCoupon=0
|
If UserID<>"" And TraDistance>0 Then
|
sql="select CouponNO,CouponMoney from Coupon where CouponDate_Ent>=getdate() and ToUserID="&UserID&" and CouponState=0 order by CouponMoney desc"
|
rs.open sql,objConn,1,1
|
do while not rs.Eof
|
CouponNO=rs("CouponNO")
|
CouponMoney=rs("CouponMoney")
|
If CouponMoney=150 And TraDistance>=100 And StartProvince="广东省" Then
|
UserCouponNO = CouponNO
|
UserCoupon = CouponMoney
|
Exit Do
|
ElseIf CouponMoney=20 And StartCity="广州市" Then
|
UserCouponNO = CouponNO
|
UserCoupon = CouponMoney
|
Exit Do
|
End If
|
rs.movenext
|
loop
|
rs.close()
|
If (IsCoupon="1" Or IsCoupon="-1") And OrdCoupon>0 Then
|
IsCoupon="1"
|
OrderPriceTXT = OrderPriceTXT&",客户希望使用优惠券:-"&CouponMoney&"元\n"
|
End If
|
End If
|
|
End If
|
|
End If
|
If ServiceTXT<>"" Then ServiceTXT="您的转运距离约"&TraDistance&"公里。"&ServiceTXT
|
If ServiceOrdID<>"" And ServiceOrdID<>"0" Then
|
sql="delete from ServiceOrder_Options where ServiceOptionsID in (-1,1000,1001) and ServiceOrdSoID="&ServiceOrdID
|
objConn.Execute sql
|
ServiceOptionsValue="转运距离约"&TraDistance&"公里"
|
sql="Insert into ServiceOrder_Options (ServiceOrdSoID,ServiceOptionsID,ServiceOptionsValue) values ("&ServiceOrdID&",-1,'"&ServiceOptionsValue&"')"
|
objConn.Execute sql
|
sql="Insert into ServiceOrder_Options (ServiceOrdSoID,ServiceOptionsID,ServiceOptionsValue) values ("&ServiceOrdID&",1000,'报价说明:"&OrderPriceTXT&"')"
|
objConn.Execute sql
|
sql="Insert into ServiceOrder_Options (ServiceOrdSoID,ServiceOptionsID,ServiceOptionsValue) values ("&ServiceOrdID&",1001,'报价公式:"&OrderPriceFRM&"')"
|
objConn.Execute sql
|
End If
|
'OrderPriceTXT=""
|
'OrderPriceTXT=OrderPriceTips
|
'OrderPrice=0.01
|
If IsCoupon="-1" Then IsCoupon="0"
|
webJson="{""APPID"":"""&APPID&""",""method"":"""&method&""",""result"":1,""OrderPrice"":"""&OrderPrice&""",""TraDistance"":"""&TraDistance&""",""addressComponent"":"""&addressComponent&""",""StartAddress"":"""&StartAddress&""",""EndAddress"":"""&EndAddress&""",""origin"":"""&StartAddress_lat&","&StartAddress_lng&""",""destination"":"""&EndAddress_lat&","&EndAddress_lng&""",""OrderPriceFRM"":"""&OrderPriceFRM&""",""OrderPriceTXT"":"""&OrderPriceTXT&""",""IRid"":"""&IRid&""",""ServiceTXT"":"""&ServiceTXT&""",""StartProvince"":"""&StartProvince&""",""StartCity"":"""&StartCity&""",""StartArea"":"""&StartArea&""",""U_UnitShort"":"""&U_UnitShort&""",""U_TraDistance"":"""&U_TraDistance&""",""IsCoupon"":"""&IsCoupon&""",""UserCouponNO"":"""&UserCouponNO&""",""UserCoupon"":"""&UserCoupon&""",""UserCardNO"":"""&UserCardNO&""",""UserCard"":"""&UserCard&""",""OrderPriceTips"":"""&OrderPriceTips&""",""IsOrdinary"":"""&IsOrdinary&"""}"
|
|
Else
|
errcode=40022
|
errmsg="invalid Address"
|
End If
|
|
|
If Left(errcode,1)="4" Or webJson="" Then
|
If errcode="" Then
|
errcode=-1
|
errmsg="error"
|
End If
|
webJson="{""APPID"":"""&APPID&""",""method"":"""&method&""",""result"":2,""errcode"":"&errcode&",""errmsg"":"""&errmsg&"""}"
|
'Call OA_Running(UnitID,webJson)
|
Else
|
OkJson="{""APPID"":"""&APPID&""",""method"":"""&method&""",""result"":1,""Running"":"""&sParaRunning&"""}"
|
'Call OA_Running(UnitID,OkJson)
|
End If
|
|
Response.Write webJson
|
Response.End
|
%>
|