Administrator
2024-10-15 e23a2fc711caf409359648572828111981ec3681
third_data/code_plate_key_manager.py
@@ -417,6 +417,14 @@
    # 板块
    __blocks_dict = {}
    __instance = None
    def __new__(cls, *args, **kwargs):
        if not cls.__instance:
            cls.__instance = super(CodesHisReasonAndBlocksManager, cls).__new__(cls, *args, **kwargs)
        return cls.__instance
    def __get_redis(self):
        return self.__redisManager.getRedis()
@@ -499,6 +507,14 @@
        except:
            pass
        return set()
    def get_history_blocks_cache(self, code):
        """
        获取180天的历史涨停原因缓存
        @param code:
        @return:
        """
        return self.__history_blocks_dict_cache.get(code)
# 目标代码板块关键词管理
@@ -1487,7 +1503,10 @@
        if match_blocks_3:
            match_blocks_3 -= constant.KPL_INVALID_BLOCKS
            fblocks |= match_blocks_3
        # 获取开盘啦历史涨停原因
        kpl_history_blocks = CodesHisReasonAndBlocksManager().get_history_blocks_cache(code)
        if kpl_history_blocks:
            fblocks |= BlockMapManager().filter_blocks(kpl_history_blocks)
        return fblocks, match_blocks
    @classmethod