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):
|
def get_set_type(self):
|
||||||
return self.set_type
|
return self.set_type
|
||||||
|
|
||||||
|
def conversion_int(self, str):
|
||||||
|
return int(str)
|
||||||
|
|
||||||
def station_seat(self, index):
|
def station_seat(self, index):
|
||||||
"""
|
"""
|
||||||
获取车票对应坐席
|
获取车票对应坐席
|
||||||
|
@ -423,23 +426,22 @@ class select:
|
||||||
if "status" in getQueueCountResult and getQueueCountResult["status"] is True:
|
if "status" in getQueueCountResult and getQueueCountResult["status"] is True:
|
||||||
if "countT" in getQueueCountResult["data"]:
|
if "countT" in getQueueCountResult["data"]:
|
||||||
ticket = getQueueCountResult["data"]["ticket"]
|
ticket = getQueueCountResult["data"]["ticket"]
|
||||||
ticketCount=0
|
ticket_split = sum(map(self.conversion_int, ticket.split(","))) if ticket.find(",") != -1 else ticket
|
||||||
for tic in ticket.split(','):
|
# ticket_sum = sum([int(ticket_split[0]),int(ticket_split[1])])
|
||||||
ticketCount+=int(tic)
|
|
||||||
# if set_type == "无座": # 修改无座和硬座的座位号提交是个字符串的问题
|
# if set_type == "无座": # 修改无座和硬座的座位号提交是个字符串的问题
|
||||||
# ticket = ticket_split[1]
|
# ticket = ticket_split[1]
|
||||||
# elif set_type == "硬座":
|
# elif set_type == "硬座":
|
||||||
# ticket = ticket_split[0]
|
# ticket = ticket_split[0]
|
||||||
countT = getQueueCountResult["data"]["countT"]
|
countT = getQueueCountResult["data"]["countT"]
|
||||||
if int(countT) is 0:
|
if int(countT) is 0:
|
||||||
if ticketCount < len(self.user_info):
|
if int(ticket_split) < len(self.user_info):
|
||||||
print("当前余票数小于乘车人数,放弃订票")
|
print("当前余票数小于乘车人数,放弃订票")
|
||||||
else:
|
else:
|
||||||
print("排队成功, 当前余票还剩余:" + str(ticketCount) + "张")
|
print("排队成功, 当前余票还剩余: {0} 张".format(ticket_split))
|
||||||
if self.checkQueueOrder():
|
if self.checkQueueOrder():
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
print("当前排队人数:" + str(countT) + "当前余票还剩余:" + str(ticketCount) + "张,继续排队中")
|
print("当前排队人数:" + str(countT) + "当前余票还剩余:{} 张,继续排队中".format(ticket_split))
|
||||||
else:
|
else:
|
||||||
print("排队发现未知错误{0},将此列车 {1}加入小黑屋".format(getQueueCountResult, train_no))
|
print("排队发现未知错误{0},将此列车 {1}加入小黑屋".format(getQueueCountResult, train_no))
|
||||||
self.ticket_black_list[train_no] = datetime.datetime.now()
|
self.ticket_black_list[train_no] = datetime.datetime.now()
|
||||||
|
|
Loading…
Reference in New Issue