7890be8a by 周伟奇

fix bug

1 parent 22582da8
......@@ -5,7 +5,7 @@ from openpyxl import Workbook
from django.core.management import BaseCommand
from common.mixins import LoggerMixin
from apps.doc.models import DDARecords
from apps.doc import consts
from settings import conf
class Command(BaseCommand, LoggerMixin):
......@@ -42,7 +42,7 @@ class Command(BaseCommand, LoggerMixin):
('application_id', 'is_dda_found', 'is_id_found', 'is_bc_found', 'dda_found_time', 'id_found_time',
'bc_found_time', 'create_time')),
]
self.dda_dir = os.path.join('SF5-CL-S-1', 'DDA')
self.dda_dir = os.path.join(conf.DATA_DIR, 'HIL', 'SF5-CL-S-1', 'DDA')
self.excel_name_base = 'DDA_Data'
# self.complete_dda_dir = os.path.join(self.dda_dir, 'complete')
# self.wanting_dda_dir = os.path.join(self.dda_dir, 'wanting')
......@@ -73,7 +73,7 @@ class Command(BaseCommand, LoggerMixin):
do_month = True if next_date.day == 1 else False
wanting_querysets = None
excel_name = '{0}({1}).xlsx'.format(self.excel_name_base, target_date)
excel_name = '{0}({1}).xlsx'.format(self.excel_name_base, date_str)
excel_path = os.path.join(self.dda_dir, excel_name)
wb = Workbook()
......@@ -109,9 +109,9 @@ class Command(BaseCommand, LoggerMixin):
)
ws.append(col_values)
else:
querysets = DDARecords.objects.filter(all_found=True).values(*query_fields)
querysets = DDARecords.objects.filter(all_found=False).values(*query_fields)
if do_month:
wanting_querysets = queryset
wanting_querysets = querysets
for queryset in querysets:
col_values = (
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!