diff --git a/scripts/reconcile_qmt_closed_sells.py b/scripts/reconcile_qmt_closed_sells.py index 5843d9b..214dbf0 100644 --- a/scripts/reconcile_qmt_closed_sells.py +++ b/scripts/reconcile_qmt_closed_sells.py @@ -76,9 +76,11 @@ def plan(): quantity = int(first['before']['qty']) - int(last['after']['qty']) if late: for correction, amendment_seq, terminal_seq in zip(corrections, (1965761,1965781), (1965764,1965783), strict=True): - amendment = data(amendment_seq, 'order_update', code) - terminal = data(terminal_seq, 'order_update', code) - require(amendment['payload']['correction_id'] == correction['payload']['correction_id'], '对应更正配对序号变化') + amendment = trade_correction_repo.get_inbox(amendment_seq) + terminal = trade_correction_repo.get_inbox(terminal_seq) + require(amendment and terminal and amendment['msg_type'] == 'order_update' + and amendment['payload'].get('correction_id') == correction['payload']['correction_id'], + '对应更正配对序号变化') trade_correction._closed_recovery_terminal(amendment, terminal, order, qmt_repo.get_state()['last_seq']) closed_terminals[correction['seq']] = terminal late_trade = late['payload']