| | |
| | | elif ctype == 'add_black_list': |
| | | code = data.get("code") |
| | | gpcode_manager.BlackListCodeManager().add_code(code) |
| | | place_order_record_manager = PlaceOrderRecordManager(tool.get_now_date_str()) |
| | | # (ID,代码,板块信息, 大单信息, 时间, 价格, 涨幅) |
| | | records = place_order_record_manager.get_not_process_records_by_code(code) |
| | | if records: |
| | | for r in records: |
| | | place_order_record_manager.set_not_buy(r[0], "代码拉黑") |
| | | result_json = {"code": 0, "msg": '添加成功'} |
| | | |
| | | self.send_response(result_json, client_id, request_id) |
| | |
| | | f"select * from low_suction_place_order_records where day ='{self.day}' and state = {STATE_NOT_PROCESS} order by time_str") |
| | | self.not_process_records.clear() |
| | | if results: |
| | | self.not_process_records = [(r[0], r[2], json.loads(r[3]), r[6],r[7], float(r[8]), float(r[9])) for r in results] |
| | | self.not_process_records = [(r[0], r[2], json.loads(r[3]), r[6], r[7], float(r[8]), float(r[9])) for r in |
| | | results] |
| | | |
| | | def set_buy(self, id): |
| | | record = None |
| | |
| | | ids = [r[0] for r in self.not_process_records if r[1] == record[1]] |
| | | for id_ in ids: |
| | | self.set_not_buy(id_, "已买入") |
| | | |
| | | |
| | | def set_not_buy(self, id, desc): |
| | | for r in self.not_process_records: |
| | |
| | | return r |
| | | return None |
| | | |
| | | def get_not_process_records_by_code(self, code): |
| | | return [r for r in self.not_process_records if r[1] == code] |
| | | |
| | | |
| | | if __name__ == "__main__": |
| | | manager = PlaceOrderRecordManager("2025-07-07") |
| | | print(manager.not_process_records) |