diff --git a/init/select_ticket_info.py b/init/select_ticket_info.py index eec9965..3226373 100755 --- a/init/select_ticket_info.py +++ b/init/select_ticket_info.py @@ -47,6 +47,7 @@ class select: self.cdn_list = [] self.passengerTicketStrList = "" self.oldPassengerStr = "" + self.set_type = "" def get_ticket_info(self): """ @@ -189,8 +190,8 @@ class select: train_no = queryResult.get("train_no", "") train_date = queryResult.get("train_date", "") stationTrainCode = queryResult.get("stationTrainCode", "") - set_type = queryResult.get("set_type", "") secretStr = queryResult.get("secretStr", "") + seat = queryResult.get("seat", "") leftTicket = queryResult.get("leftTicket", "") query_from_station_name = queryResult.get("query_from_station_name", "") query_to_station_name = queryResult.get("query_to_station_name", "") @@ -199,12 +200,12 @@ class select: else: # 获取联系人 if not self.passengerTicketStrList and not self.oldPassengerStr: - s = getPassengerDTOs(session=self, ticket_peoples=self.ticke_peoples, set_type=set_type) + s = getPassengerDTOs(session=self, ticket_peoples=self.ticke_peoples, set_type=seat) getPassengerDTOsResult = s.getPassengerTicketStrListAndOldPassengerStr() if getPassengerDTOsResult.get("status", False): self.passengerTicketStrList = getPassengerDTOsResult.get("passengerTicketStrList", "") self.oldPassengerStr = getPassengerDTOsResult.get("oldPassengerStr", "") - set_type = getPassengerDTOsResult.get("set_type", "") + self.set_type = getPassengerDTOsResult.get("set_type", "") # 提交订单 if self.order_type == 1: # 快读下单 a = autoSubmitOrderRequest(session=self, @@ -215,13 +216,13 @@ class select: train_no=train_no, stationTrainCode=stationTrainCode, leftTicket=leftTicket, - set_type=set_type, + set_type=self.set_type, query_from_station_name=query_from_station_name, query_to_station_name=query_to_station_name, ) a.sendAutoSubmitOrderRequest() elif self.order_type == 2: # 普通下单 - sor = submitOrderRequest(self, secretStr, from_station, to_station, train_no, set_type, + sor = submitOrderRequest(self, secretStr, from_station, to_station, train_no, self.set_type, self.passengerTicketStrList, self.oldPassengerStr, train_date, self.ticke_peoples) sor.sendSubmitOrderRequest() diff --git a/inter/Query.py b/inter/Query.py index 50795c5..013b012 100644 --- a/inter/Query.py +++ b/inter/Query.py @@ -66,12 +66,11 @@ class query: train_location = ticket_info[15] stationTrainCode = ticket_info[3] leftTicket = ticket_info[12] - set_type = self._station_seat[j] + seat = self._station_seat[j].encode("utf8") print (u'车次: {0} 始发车站: {1} 终点站: {2} {3}: {4}'.format(ticket_info[3], self.from_station_h, self.to_station_h, - self._station_seat[j].encode( - "utf8"), + self._station_seat[j].encode("utf8"), ticket_info[self.station_seat(self._station_seat[j].encode("utf8"))])) if wrapcache.get(train_no): print(ticket.QUERY_IN_BLACK_LIST.format(train_no)) @@ -85,7 +84,7 @@ class query: "train_date": station_date, "query_from_station_name": query_from_station_name, "query_to_station_name": query_to_station_name, - "set_type": set_type, + "seat": seat, "leftTicket": leftTicket, "train_location": train_location, "code": ticket.SUCCESS_CODE,