fix bug
Showing
1 changed file
with
5 additions
and
5 deletions
... | @@ -5,7 +5,7 @@ from openpyxl import Workbook | ... | @@ -5,7 +5,7 @@ from openpyxl import Workbook |
5 | from django.core.management import BaseCommand | 5 | from django.core.management import BaseCommand |
6 | from common.mixins import LoggerMixin | 6 | from common.mixins import LoggerMixin |
7 | from apps.doc.models import DDARecords | 7 | from apps.doc.models import DDARecords |
8 | from apps.doc import consts | 8 | from settings import conf |
9 | 9 | ||
10 | 10 | ||
11 | class Command(BaseCommand, LoggerMixin): | 11 | class Command(BaseCommand, LoggerMixin): |
... | @@ -42,7 +42,7 @@ class Command(BaseCommand, LoggerMixin): | ... | @@ -42,7 +42,7 @@ class Command(BaseCommand, LoggerMixin): |
42 | ('application_id', 'is_dda_found', 'is_id_found', 'is_bc_found', 'dda_found_time', 'id_found_time', | 42 | ('application_id', 'is_dda_found', 'is_id_found', 'is_bc_found', 'dda_found_time', 'id_found_time', |
43 | 'bc_found_time', 'create_time')), | 43 | 'bc_found_time', 'create_time')), |
44 | ] | 44 | ] |
45 | self.dda_dir = os.path.join('SF5-CL-S-1', 'DDA') | 45 | self.dda_dir = os.path.join(conf.DATA_DIR, 'HIL', 'SF5-CL-S-1', 'DDA') |
46 | self.excel_name_base = 'DDA_Data' | 46 | self.excel_name_base = 'DDA_Data' |
47 | # self.complete_dda_dir = os.path.join(self.dda_dir, 'complete') | 47 | # self.complete_dda_dir = os.path.join(self.dda_dir, 'complete') |
48 | # self.wanting_dda_dir = os.path.join(self.dda_dir, 'wanting') | 48 | # self.wanting_dda_dir = os.path.join(self.dda_dir, 'wanting') |
... | @@ -73,7 +73,7 @@ class Command(BaseCommand, LoggerMixin): | ... | @@ -73,7 +73,7 @@ class Command(BaseCommand, LoggerMixin): |
73 | do_month = True if next_date.day == 1 else False | 73 | do_month = True if next_date.day == 1 else False |
74 | wanting_querysets = None | 74 | wanting_querysets = None |
75 | 75 | ||
76 | excel_name = '{0}({1}).xlsx'.format(self.excel_name_base, target_date) | 76 | excel_name = '{0}({1}).xlsx'.format(self.excel_name_base, date_str) |
77 | excel_path = os.path.join(self.dda_dir, excel_name) | 77 | excel_path = os.path.join(self.dda_dir, excel_name) |
78 | 78 | ||
79 | wb = Workbook() | 79 | wb = Workbook() |
... | @@ -109,9 +109,9 @@ class Command(BaseCommand, LoggerMixin): | ... | @@ -109,9 +109,9 @@ class Command(BaseCommand, LoggerMixin): |
109 | ) | 109 | ) |
110 | ws.append(col_values) | 110 | ws.append(col_values) |
111 | else: | 111 | else: |
112 | querysets = DDARecords.objects.filter(all_found=True).values(*query_fields) | 112 | querysets = DDARecords.objects.filter(all_found=False).values(*query_fields) |
113 | if do_month: | 113 | if do_month: |
114 | wanting_querysets = queryset | 114 | wanting_querysets = querysets |
115 | 115 | ||
116 | for queryset in querysets: | 116 | for queryset in querysets: |
117 | col_values = ( | 117 | col_values = ( | ... | ... |
-
Please register or sign in to post a comment