| | |
| | | elif url.path == "/get_deal_list": |
| | | # 获取成交列表 |
| | | results = DealRecordManager.list_by_day(tool.get_now_date_str("%Y%m%d")) |
| | | if results: |
| | | for d in results: |
| | | d["securityName"] = data_cache.DataCache().code_name_dict.get(tool.get_symbol(d["securityID"])) |
| | | |
| | | response_data = json.dumps({"code": 0, "data": results}) |
| | | elif url.path == "/get_delegate_list": |
| | | # 获取委托列表 |
| | | # 是否可撤单,如果不传默认拉取所有 |
| | | print("参数", params_dict) |
| | | can_cancel = params_dict.get("can_cancel") |
| | | order_status = [] |
| | | if can_cancel is not None: |
| | | if can_cancel: |
| | | print("获取未结委托") |
| | | order_status = [huaxin_util.TORA_TSTP_OST_Cached, huaxin_util.TORA_TSTP_OST_Unknown, |
| | | huaxin_util.TORA_TSTP_OST_Accepted, huaxin_util.TORA_TSTP_OST_PartTraded] |
| | | else: |
| | | print("获取已结委托") |
| | | order_status = [huaxin_util.TORA_TSTP_OST_AllTraded, huaxin_util.TORA_TSTP_OST_PartTradeCanceled, |
| | | huaxin_util.TORA_TSTP_OST_AllCanceled, huaxin_util.TORA_TSTP_OST_Rejected] |
| | | results = DelegateRecordManager.list_by_day(tool.get_now_date_str("%Y%m%d"), None, orderStatus=order_status) |
| | |
| | | httpd.serve_forever() |
| | | except Exception as e: |
| | | pass |
| | | |