fix bug: 通达信lc5导入mysql时候文件数据解析的时间计算错误导致导入不了数据

This commit is contained in:
Jet 2024-03-12 14:05:36 +08:00
parent 6d8f7d65fc
commit e92ed832d2

View File

@ -258,7 +258,7 @@ def tdx_import_min_data_from_file(connect, filename, ktype, market, stock_record
def get_date(pos):
src_file.seek(pos * 32, SEEK_SET)
data = src_file.read(4)
a = struct.unpack('hh', data)
a = struct.unpack('HH', data)
return trans_date(a[0], a[1])
def find_pos():
@ -297,7 +297,7 @@ def tdx_import_min_data_from_file(connect, filename, ktype, market, stock_record
data = src_file.read(32)
while data:
record = struct.unpack('hhfffffii', data)
record = struct.unpack('HHfffffii', data)
if record[3] >= record[2] >= record[4] > 0\
and record[3] >= record[5] >= record[4] >0\
and record[5] >=0 \