6be9056c by 周伟奇

fix license report

1 parent bde11ee9
......@@ -82,6 +82,8 @@ class Command(BaseCommand, LoggerMixin):
wb = Workbook()
for classify, (_, name, _, _, _, _) in consts.LICENSE_ORDER:
if classify == consts.DL_CLASSIFY or classify == consts.VAT_CLASSIFY:
continue
ws = wb.create_sheet(name)
headers = self.header_map.get(classify, [])
for header in headers:
......@@ -96,9 +98,16 @@ class Command(BaseCommand, LoggerMixin):
business_type, doc_id_str = task_str.split(consts.SPLIT_STR)
doc_id = int(doc_id_str)
doc_class = HILDoc if business_type == consts.HIL_PREFIX else AFCDoc
application_id = doc_class.objects.filter(id=doc_id).values_list('application_id', flat=True)
doc_queryset = doc_class.objects.filter(id=doc_id).values_list('application_id', 'document_scheme')
if len(doc_queryset) == 0:
continue
application_id, document_scheme = doc_queryset[0]
if document_scheme != consts.DOC_SCHEME_LIST[1]:
continue
for classify, (_, name, field_order, side_diff, _, _) in consts.LICENSE_ORDER:
if classify == consts.DL_CLASSIFY or classify == consts.VAT_CLASSIFY:
continue
license_list = license_summary.get(classify)
if not license_list:
continue
......@@ -119,5 +128,5 @@ class Command(BaseCommand, LoggerMixin):
all_value.append('\n'.join(field_value))
else:
all_value.append(field_value)
ws.append((application_id[0], *all_value))
ws.append((application_id, *all_value))
wb.save(excel_path)
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!