| | |
| | | results = [output_util.money_desc(d) for d in fdatas] |
| | | self.send_response({"code": 0, "data": results}, client_id, request_id) |
| | | elif ctype == "refresh_zylt_volume": |
| | | |
| | | def update_zylt_volume(codes): |
| | | # 获取最近的价格 |
| | | price_datas = history_k_data_util.JueJinApi.get_gp_current_info(codes, "symbol, price") |
| | | price_dict = {x['symbol'].split(".")[1]: x['price'] for x in price_datas} |
| | | for code in price_dict: |
| | | try: |
| | | zylt = kpl_api.getZYLTAmount(code) |
| | | ZYLTGBUtil.save_volume(code, int(zylt / price_dict[code])) |
| | | except: |
| | | pass |
| | | |
| | | |
| | | # 刷新目标代码的自由流通量 |
| | | codes_sh, codes_sz = l1_subscript_codes_manager.get_codes() |
| | | codes = set() |
| | |
| | | |
| | | updated_codes = ZYLTGBUtil.get_today_updated_volume_codes() |
| | | codes = codes - set(updated_codes) |
| | | # 获取最近的价格 |
| | | price_datas = history_k_data_util.JueJinApi.get_gp_current_info(codes, "symbol, price") |
| | | price_dict = {x['symbol'].split(".")[1]: x['price'] for x in price_datas} |
| | | for code in price_dict: |
| | | try: |
| | | zylt = kpl_api.getZYLTAmount(code) |
| | | ZYLTGBUtil.save_volume(code, int(zylt / price_dict[code])) |
| | | except: |
| | | pass |
| | | threading.Thread(target=lambda: update_zylt_volume(codes), daemon=True).start() |
| | | self.send_response({"code": 0, "data": {}, "msg": f"更新代码数量:{len(codes)}"}, client_id, request_id) |
| | | elif ctype == "get_today_updated_zylt_volume_count": |
| | | # 获取今日已经更新的自由流通量的代码数量 |