| | |
| | | |
| | | # 代码对应的价格是否正确 |
| | | def is_same_code_with_price(code, price): |
| | | if code == '600066': |
| | | print('进入调试') |
| | | # 昨日收盘价 |
| | | price_close = gpcode_manager.get_price_pre(code) |
| | | max_price = tool.to_price(decimal.Decimal(str(price_close)) * decimal.Decimal("1.1")) |
| | |
| | | return True |
| | | return False |
| | | |
| | | |
| | | # 自由流通股本工具类 |
| | | class ZYLTGBUtil: |
| | | @classmethod |
| | | def save(cls, code, val, unit): |
| | | redis = _redisManager.getRedis() |
| | | redis.setex("zyltgb-{}".format(code), 60 * 60 * 24 * 10, |
| | | redis.setex("zyltgb-{}".format(code), tool.get_expire(), |
| | | round(float(val) * 100000000) if int(unit) == 0 else round( |
| | | float(val) * 10000)) |
| | | |
| | |
| | | mysqldb.execute( |
| | | "update ths_zylt set zyltgb='{}',zyltgb_unit={},update_time={} where _id='{}'".format( |
| | | data["zyltgb"], data["zyltgb_unit"], round(time.time() * 1000), data["code"])) |
| | | |
| | | |
| | | if __name__ == "__main__": |
| | | redis = _redisManager.getRedis() |
| | | keys = redis.keys("zyltgb-*") |
| | | for key in keys: |
| | | redis.delete(key) |