|
@@ -25,12 +25,9 @@ class Roll_Banqiupipeline(object):
|
|
|
# 使用twisted将mysql插入变成异步执行
|
|
# 使用twisted将mysql插入变成异步执行
|
|
|
logger = logging.getLogger(__name__)
|
|
logger = logging.getLogger(__name__)
|
|
|
# 联赛id
|
|
# 联赛id
|
|
|
- # url = 'http://admin.5gogo.com'
|
|
|
|
|
- # roll_bq = []
|
|
|
|
|
league_id = item['league_id']
|
|
league_id = item['league_id']
|
|
|
# 联赛名
|
|
# 联赛名
|
|
|
league_name = item['league_name']
|
|
league_name = item['league_name']
|
|
|
- # result = item['result']
|
|
|
|
|
# 比赛id
|
|
# 比赛id
|
|
|
match_id = item['game_id']
|
|
match_id = item['game_id']
|
|
|
# 球队1
|
|
# 球队1
|
|
@@ -39,12 +36,7 @@ class Roll_Banqiupipeline(object):
|
|
|
team_guest = item['team_guest']
|
|
team_guest = item['team_guest']
|
|
|
# 数量(97>)
|
|
# 数量(97>)
|
|
|
tag_number = item['number']
|
|
tag_number = item['number']
|
|
|
- # 新增 match_score_dict
|
|
|
|
|
- # match_score_dict = item['match_score_dict']
|
|
|
|
|
- # 比赛状态
|
|
|
|
|
- zhuangtai = item['zhuangtai']
|
|
|
|
|
# 日期
|
|
# 日期
|
|
|
- # data_game = item['data_game']
|
|
|
|
|
data_game = item['data_game'].split("/")
|
|
data_game = item['data_game'].split("/")
|
|
|
month = str(data_game[1].strip())
|
|
month = str(data_game[1].strip())
|
|
|
day = str(data_game[0])
|
|
day = str(data_game[0])
|
|
@@ -52,11 +44,9 @@ class Roll_Banqiupipeline(object):
|
|
|
time_game = str(item['time_game'])
|
|
time_game = str(item['time_game'])
|
|
|
# 比赛时间,时间戳
|
|
# 比赛时间,时间戳
|
|
|
ctime = "2019" + "-" + month + "-" + day + "" + time_game + ":00".strip()
|
|
ctime = "2019" + "-" + month + "-" + day + "" + time_game + ":00".strip()
|
|
|
- r_ctime = "2019" + "-" + month + "-" + day
|
|
|
|
|
# 现在时间,时间戳
|
|
# 现在时间,时间戳
|
|
|
utime = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())
|
|
utime = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())
|
|
|
match_date = datetime.datetime.now().strftime("%Y-%m-%d")
|
|
match_date = datetime.datetime.now().strftime("%Y-%m-%d")
|
|
|
- # expire_time = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(time.time() + 60))
|
|
|
|
|
# 队1分数
|
|
# 队1分数
|
|
|
score_home = item['score_home']
|
|
score_home = item['score_home']
|
|
|
# 队2分数
|
|
# 队2分数
|
|
@@ -77,8 +67,6 @@ class Roll_Banqiupipeline(object):
|
|
|
# 总得分单双
|
|
# 总得分单双
|
|
|
odd_evens_dict = item['odd_evens_dict']
|
|
odd_evens_dict = item['odd_evens_dict']
|
|
|
odd_evens_dict_rule = item['odd_evens_dict_rule']
|
|
odd_evens_dict_rule = item['odd_evens_dict_rule']
|
|
|
- # 赛事失效时间
|
|
|
|
|
- # new_match_score_dict = json.dumps(match_score_dict)
|
|
|
|
|
# 具体比分
|
|
# 具体比分
|
|
|
source_dict = item['source_dict']
|
|
source_dict = item['source_dict']
|
|
|
uuid = Helper.genearte_uuid(league_name + 'hg3535')
|
|
uuid = Helper.genearte_uuid(league_name + 'hg3535')
|
|
@@ -230,7 +218,6 @@ class Roll_Banqiupipeline(object):
|
|
|
"source": "hg3535",
|
|
"source": "hg3535",
|
|
|
"data": da_list,
|
|
"data": da_list,
|
|
|
}
|
|
}
|
|
|
- # print(r_data_dict)
|
|
|
|
|
if da_list:
|
|
if da_list:
|
|
|
try:
|
|
try:
|
|
|
res = Helper.async_post(MATCH_RESULT, r_data_dict)
|
|
res = Helper.async_post(MATCH_RESULT, r_data_dict)
|
|
@@ -246,23 +233,23 @@ class Roll_Banqiupipeline(object):
|
|
|
logging.warning(r_data_dict)
|
|
logging.warning(r_data_dict)
|
|
|
else:
|
|
else:
|
|
|
logger.info('棒球滚球结果记录为空, 不提交')
|
|
logger.info('棒球滚球结果记录为空, 不提交')
|
|
|
- status_dict = {"game_code": 'bq', "title": "match_status", "source": "hg3535"}
|
|
|
|
|
- data_list = []
|
|
|
|
|
- data = {'match_id': match_id, 'status': 1, "is_rollball": 0, "is_today": 0, "is_morningplate": 0,
|
|
|
|
|
- "is_stringscene": 0, "is_horn": 0}
|
|
|
|
|
- data_list.append(data)
|
|
|
|
|
- status_dict['data'] = data_list
|
|
|
|
|
- res = Helper.async_post(MATCH_STATUS, status_dict)
|
|
|
|
|
- if res:
|
|
|
|
|
- if "成功" in res:
|
|
|
|
|
- self.db.match_status35.insert(status_dict)
|
|
|
|
|
- logger.info('{},赛事结果状态交成功, {}'.format('bq', res))
|
|
|
|
|
- logger.info(status_dict)
|
|
|
|
|
- else:
|
|
|
|
|
- logger.warning('{},赛事结果状态交失败, {}'.format('bq', res))
|
|
|
|
|
- logger.warning(status_dict)
|
|
|
|
|
- else:
|
|
|
|
|
- logger.warning('{},赛事结果状态接口异常提交失败, {}'.format('bq', res))
|
|
|
|
|
- logger.warning(status_dict)
|
|
|
|
|
|
|
+ # status_dict = {"game_code": 'bq', "title": "match_status", "source": "hg3535"}
|
|
|
|
|
+ # data_list = []
|
|
|
|
|
+ # data = {'match_id': match_id, 'status': 1, "is_rollball": 0, "is_today": 0, "is_morningplate": 0,
|
|
|
|
|
+ # "is_stringscene": 0, "is_horn": 0}
|
|
|
|
|
+ # data_list.append(data)
|
|
|
|
|
+ # status_dict['data'] = data_list
|
|
|
|
|
+ # res = Helper.async_post(MATCH_STATUS, status_dict)
|
|
|
|
|
+ # if res:
|
|
|
|
|
+ # if "成功" in res:
|
|
|
|
|
+ # self.db.match_status35.insert(status_dict)
|
|
|
|
|
+ # logger.info('{},赛事结果状态交成功, {}'.format('bq', res))
|
|
|
|
|
+ # logger.info(status_dict)
|
|
|
|
|
+ # else:
|
|
|
|
|
+ # logger.warning('{},赛事结果状态交失败, {}'.format('bq', res))
|
|
|
|
|
+ # logger.warning(status_dict)
|
|
|
|
|
+ # else:
|
|
|
|
|
+ # logger.warning('{},赛事结果状态接口异常提交失败, {}'.format('bq', res))
|
|
|
|
|
+ # logger.warning(status_dict)
|
|
|
reactor.callFromThread(out.callback, item)
|
|
reactor.callFromThread(out.callback, item)
|
|
|
|
|
|