|
@@ -125,8 +125,6 @@ class OrderServer():
|
|
|
seg.cabin = kfsa['cabin'] #舱位等级 EC.特惠 EP.低航费 VF.超值套餐 HF.常飞客 PM.豪华平躺
|
|
|
if 'E' == seg.cabin:
|
|
|
seg.cabin = 'EC'
|
|
|
- if 'EC' != seg.cabin:
|
|
|
- self.isContinue = False
|
|
|
if 'EC' == seg.cabin or 'EP' == seg.cabin:
|
|
|
self.luggage = 'PBNO'
|
|
|
elif 'VF' == seg.cabin or 'HF' == seg.cabin:
|
|
@@ -234,7 +232,7 @@ class OrderServer():
|
|
|
# if self.oinfo.bigIsOk == False:
|
|
|
# self._big_value_lock.release() #web结果锁 开始
|
|
|
def checkQuery(self):
|
|
|
- if self.oinfo.bigIsOk and self.oinfo.webIsOk:
|
|
|
+ if self.oinfo.webIsOk:
|
|
|
return True
|
|
|
else:
|
|
|
return False
|
|
@@ -475,7 +473,8 @@ class OrderServer():
|
|
|
agretVal = '' #代理人返程提交字符串
|
|
|
agfromPrice = self.oinfo.agentFromJson
|
|
|
agretPrice = self.oinfo.agentRetJson
|
|
|
- if 'EC' in self.cabin:
|
|
|
+ #代理人是没有超值套餐 套餐的 我就选择个低价 然后选择 20Kg行李+1份餐食
|
|
|
+ if self.cabin in ('EC','VF'):
|
|
|
if 'EC' in agfromPrice.keys():
|
|
|
agfPrice = agfromPrice['EC']['priceTotal']
|
|
|
agfromVal = agfromPrice['EC']['radioValue']
|
|
@@ -515,14 +514,25 @@ class OrderServer():
|
|
|
webretVal = '' #Web官网返程提交字符串
|
|
|
webfromPrice = self.oinfo.webFromJson
|
|
|
webretPrice = self.oinfo.webRetJson
|
|
|
- if self.cabin in webfromPrice.keys():
|
|
|
- webfPrice = webfromPrice[self.cabin]['priceTotal']
|
|
|
- webfromVal = webfromPrice[self.cabin]['radioValue']
|
|
|
- if webretPrice != None:
|
|
|
- if self.cabin in webretPrice.keys():
|
|
|
- webrPrice = webretPrice[self.cabin]['priceTotal']
|
|
|
- webretVal = webretPrice[self.cabin]['radioValue']
|
|
|
-
|
|
|
+ print(webfromPrice)
|
|
|
+ if self.cabin in 'VF':
|
|
|
+ if self.cabin in webfromPrice.keys():
|
|
|
+ webfPrice = webfromPrice['EC']['priceTotal']
|
|
|
+ webfromVal = webfromPrice['EC']['radioValue']
|
|
|
+ if webretPrice != None:
|
|
|
+ if self.cabin in webretPrice.keys():
|
|
|
+ webrPrice = webretPrice['EC']['priceTotal']
|
|
|
+ webretVal = webretPrice['EC']['radioValue']
|
|
|
+ else:
|
|
|
+ if self.cabin in webfromPrice.keys():
|
|
|
+ webfPrice = webfromPrice[self.cabin]['priceTotal']
|
|
|
+ webfromVal = webfromPrice[self.cabin]['radioValue']
|
|
|
+ if webretPrice != None:
|
|
|
+ if self.cabin in webretPrice.keys():
|
|
|
+ webrPrice = webretPrice[self.cabin]['priceTotal']
|
|
|
+ webretVal = webretPrice[self.cabin]['radioValue']
|
|
|
+
|
|
|
+
|
|
|
logging.info(self.salt+'Web官网去程:'+str(webfPrice) +' __'+webfromVal)
|
|
|
logging.info(self.salt+'Web官网回程:'+str(webrPrice) +' __'+webretVal)
|
|
|
|
|
@@ -713,17 +723,37 @@ class OrderServer():
|
|
|
for row in page.xpath("//div[starts-with(@class,'uccomfortkitpanel-item-selection-form')]/input/@name"):
|
|
|
passengerData[row] = '0'
|
|
|
|
|
|
+ passengerDataABC = []
|
|
|
#餐食选择
|
|
|
- passListarts = []
|
|
|
- for row in page.xpath("//div[starts-with(@class,'ucmealpanel-item-selection-form')]/input/@name"):
|
|
|
- if '_group_AAXmealCat' in row:
|
|
|
+ if self.ismeals != True:
|
|
|
+ for row in page.xpath("//div[starts-with(@class,'ucmealpanel-item-selection-form')]/input/@name"):
|
|
|
+ passengerData[row] = '0'
|
|
|
+ else:
|
|
|
+ #print(passengerData)
|
|
|
+ passListarts = []
|
|
|
+ passengerDataABC = []
|
|
|
+ passMeals = []
|
|
|
+ for row in page.xpath("//div[starts-with(@class,'ucmealpanel-item-selection-form')]/input/@name"):
|
|
|
AAXmealCa = row[105:107]+row[136:158]
|
|
|
- if AAXmealCa not in passListarts:
|
|
|
+ if AAXmealCa not in passListarts and 'mealCat1' in row:
|
|
|
passListarts.append(AAXmealCa)
|
|
|
- passengerData[row] = '1'
|
|
|
+ passengerDataABC.append(('drinkcountname','1'))
|
|
|
+ passengerDataABC.append((row[:158]+'_'+row[136:159]+'1','1'))
|
|
|
+ passengerDataABC.append((row,'1'))
|
|
|
+ passMeals.append(row[115:119])
|
|
|
else:
|
|
|
- passengerData[row] = '0'
|
|
|
-
|
|
|
+ passengerDataABC.append((row,'0'))
|
|
|
+
|
|
|
+ indexsss = 0;
|
|
|
+ for row in page.xpath("//div[starts-with(@class,'ucmealpanel-divSelectedMealsContainer')]/input/@name"):
|
|
|
+ if 'SelectedMeal_0' in row:
|
|
|
+ print(row+'='+passMeals[indexsss])
|
|
|
+ passengerDataABC.append((row,passMeals[indexsss]))
|
|
|
+ indexsss = indexsss +1
|
|
|
+ else:
|
|
|
+ print(row+'=')
|
|
|
+ passengerDataABC.append((row,''))
|
|
|
+ print(passengerDataABC)
|
|
|
#行李 PBAB:20Kg PBAC:25Kg PBAD:30Kg PBAF:40Kg
|
|
|
#self.luggageDict = {20:'PBAB',25:'PBAC',30:'PBAD',40:'PBAF'}
|
|
|
#行李选择
|
|
@@ -781,7 +811,11 @@ class OrderServer():
|
|
|
passengerData["CONTROLGROUP_OUTERTRAVELER$CONTROLGROUPTRAVELER$PassengerInputTravelerView$DropDownListBirthDateMonth_%d_%d" % (idx, idx)] = passenger.birthday[5:7]
|
|
|
passengerData["CONTROLGROUP_OUTERTRAVELER$CONTROLGROUPTRAVELER$PassengerInputTravelerView$DropDownListBirthDateMonth_ONTROLGROUPTRAVELER$PassengerInputTravelerView$DropDownListBirthDateYear_%d_%d" % (idx, idx)] = passenger.birthday[:4]
|
|
|
logging.info(self.salt+'------------------------------------------提交乘机人---:')
|
|
|
- res = self.session.post('https://booking2.airasia.com/Traveler.aspx', data=passengerData, verify=False,timeout = 60)
|
|
|
+ print(passengerData.items())
|
|
|
+ for row in passengerData:
|
|
|
+ passengerDataABC.append((row,passengerData[row]))
|
|
|
+ print(passengerDataABC)
|
|
|
+ res = self.session.post('https://booking2.airasia.com/Traveler.aspx', data=passengerDataABC, verify=False,timeout = 60)
|
|
|
logging.info(self.salt+'乘机人提交成功,进入下一步!')
|
|
|
logging.info(self.salt+str(res.status_code))
|
|
|
logging.info(self.salt+res.url)
|