mirror of https://github.com/testerSunshine/12306
Merge remote-tracking branch 'origin/master'
# Conflicts: # init/select_ticket_info.pypull/2/head
commit
66a9965afd
|
@ -63,3 +63,8 @@
|
|||
- 修改无座和硬座的座位号提交是个字符串的问题
|
||||
- 增加校验下单需要验证码功能
|
||||
- 增强下单成功判断接口校验
|
||||
|
||||
- 2018.1.10 更新
|
||||
- 优化查票流程
|
||||
- 修改二等座的余票数返回为字符串的问题
|
||||
- 优化订单查询bug
|
||||
|
|
|
@ -80,6 +80,9 @@ class select:
|
|||
def get_set_type(self):
|
||||
return self.set_type
|
||||
|
||||
def conversion_int(self, str):
|
||||
return int(str)
|
||||
|
||||
def station_seat(self, index):
|
||||
"""
|
||||
获取车票对应坐席
|
||||
|
@ -423,23 +426,22 @@ class select:
|
|||
if "status" in getQueueCountResult and getQueueCountResult["status"] is True:
|
||||
if "countT" in getQueueCountResult["data"]:
|
||||
ticket = getQueueCountResult["data"]["ticket"]
|
||||
ticketCount=0
|
||||
for tic in ticket.split(','):
|
||||
ticketCount+=int(tic)
|
||||
ticket_split = sum(map(self.conversion_int, ticket.split(","))) if ticket.find(",") != -1 else ticket
|
||||
# ticket_sum = sum([int(ticket_split[0]),int(ticket_split[1])])
|
||||
# if set_type == "无座": # 修改无座和硬座的座位号提交是个字符串的问题
|
||||
# ticket = ticket_split[1]
|
||||
# elif set_type == "硬座":
|
||||
# ticket = ticket_split[0]
|
||||
countT = getQueueCountResult["data"]["countT"]
|
||||
if int(countT) is 0:
|
||||
if ticketCount < len(self.user_info):
|
||||
if int(ticket_split) < len(self.user_info):
|
||||
print("当前余票数小于乘车人数,放弃订票")
|
||||
else:
|
||||
print("排队成功, 当前余票还剩余:" + str(ticketCount) + "张")
|
||||
print("排队成功, 当前余票还剩余: {0} 张".format(ticket_split))
|
||||
if self.checkQueueOrder():
|
||||
return True
|
||||
else:
|
||||
print("当前排队人数:" + str(countT) + "当前余票还剩余:" + str(ticketCount) + "张,继续排队中")
|
||||
print("当前排队人数:" + str(countT) + "当前余票还剩余:{} 张,继续排队中".format(ticket_split))
|
||||
else:
|
||||
print("排队发现未知错误{0},将此列车 {1}加入小黑屋".format(getQueueCountResult, train_no))
|
||||
self.ticket_black_list[train_no] = datetime.datetime.now()
|
||||
|
|
Loading…
Reference in New Issue