5e463cbd by 周伟奇

fix bs and license script

1 parent 7fc3f80e
......@@ -40,7 +40,8 @@ class Command(BaseCommand, LoggerMixin):
print('excel dir not exists')
return
excel_path = os.path.join(excel_dir, 'bs_{0}.xlsx'.format(date_str))
log_path = os.path.join(conf.LOG_DIR, 'bs.log.{0}'.format(date_str))
# log_path = os.path.join(conf.LOG_DIR, 'bs.log.{0}'.format(date_str))
log_path = os.path.join(conf.LOG_DIR, 'bs_statistics.log.{0}'.format(date_str))
if not os.path.exists(log_path):
print('log_path not exists')
return
......@@ -48,7 +49,8 @@ class Command(BaseCommand, LoggerMixin):
summary_dict = {}
with open(log_path, 'r', encoding='utf-8') as fp:
for line in fp:
search_obj = re.search(r'task=(.*) merged_bs_summary=(.*)', line)
# search_obj = re.search(r'task=(.*) merged_bs_summary=(.*)', line)
search_obj = re.search(r'\[task=(.*)] \[bs_summary=(.*)]', line)
task_str = search_obj.group(1)
business_type, doc_id_str = task_str.split(consts.SPLIT_STR)
doc_id = int(doc_id_str)
......
......@@ -14,7 +14,6 @@ class Command(BaseCommand, LoggerMixin):
def __init__(self):
super().__init__()
self.log_base = '[license statistics]'
self.header_map = {
consts.MVI_CLASSIFY: [('申请ID', '发票代码', '发票号码', '开票日期', '不含税价', '发票联', '购买方名称',
'购买方证件号码', '纳税人识别号', '车架号', '价税合计小写', '销货单位名称', '增值税税额',
......@@ -75,7 +74,8 @@ class Command(BaseCommand, LoggerMixin):
print('excel dir not exists')
return
excel_path = os.path.join(excel_dir, 'license_{0}.xlsx'.format(date_str))
log_path = os.path.join(conf.LOG_DIR, 'license.log.{0}'.format(date_str))
# log_path = os.path.join(conf.LOG_DIR, 'license.log.{0}'.format(date_str))
log_path = os.path.join(conf.LOG_DIR, 'license_statistics.log.{0}'.format(date_str))
if not os.path.exists(log_path):
print('log_path not exists')
return
......@@ -92,7 +92,8 @@ class Command(BaseCommand, LoggerMixin):
with open(log_path, 'r', encoding='utf-8') as fp:
for line in fp:
search_obj = re.search(r'task=(.*) license_summary=(.*)', line)
# search_obj = re.search(r'task=(.*) license_summary=(.*)', line)
search_obj = re.search(r'\[task=(.*)] \[license_summary=(.*)]', line)
task_str = search_obj.group(1)
license_summary = ast.literal_eval(search_obj.group(2))
business_type, doc_id_str = task_str.split(consts.SPLIT_STR)
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!