Administrator
2023-12-29 4830097670d72c56053e22f487202f0af16464eb
bug修复
2个文件已修改
17 ■■■■■ 已修改文件
third_data/data_server.py 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
third_data/kpl_util.py 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
third_data/data_server.py
@@ -448,8 +448,7 @@
        elif url.path == "/kpl/get_plate_codes":
            # 获取涨停原因下面的代码
            ps_dict = dict([(k, v[0]) for k, v in parse_qs(url.query).items()])
            plate = ps_dict["plate"]
            plate = plate.replace("概念","")
            plate = kpl_util.filter_block(ps_dict["plate"])
            # 获取板块下的代码
            # 统计目前为止的代码涨停数量(分涨停原因)
            now_limit_up_codes_info = self.__kplDataManager.get_data(KPLDataType.LIMIT_UP)
@@ -462,7 +461,7 @@
            codes_info = []
            for d in record_limit_up_datas:
                if d[2].replace("概念","") != plate:
                if kpl_util.filter_block(d[2]) != plate:
                    continue
                # 代码,名称,涨停时间,是否炸板,是否想买,是否已经下过单
                codes_info.append(
@@ -470,9 +469,9 @@
                     output_util.money_desc(d[13]), 1])
            for d in record_limit_up_datas:
                if d[2] == plate:
                if kpl_util.filter_block(d[2]) == plate:
                    continue
                if plate not in [k.replace("概念","") for k in  d[6].split("、")]:
                if plate not in [kpl_util.filter_block(k) for k in d[6].split("、")]:
                    continue
                # 代码,名称,涨停时间,是否炸板,是否想买,是否已经下过单
                codes_info.append(
@@ -542,7 +541,7 @@
                        for c in codes:
                            if c not in self.__code_limit_rate_dict:
                                need_request_codes.add(c)
                            elif now_time - self.__code_limit_rate_dict[c][1] >  60:
                            elif now_time - self.__code_limit_rate_dict[c][1] > 60:
                                need_request_codes.add(c)
                    if need_request_codes:
                        _limit_rate_list = HistoryKDatasUtils.get_codes_limit_rate(list(need_request_codes))
third_data/kpl_util.py
@@ -288,6 +288,12 @@
    return b
def filter_block(block):
    if not block:
        return block
    return block.replace("概念", "")
if __name__ == "__main__":
    print(get_high_level_count("首板"))
    print(get_high_level_count("5天4板"))