a8c68474 by 周伟奇

fix bug

1 parent 793920a0
...@@ -373,7 +373,7 @@ class Command(BaseCommand, LoggerMixin): ...@@ -373,7 +373,7 @@ class Command(BaseCommand, LoggerMixin):
373 # 4.获取OCR结果并且构建excel文件 373 # 4.获取OCR结果并且构建excel文件
374 bs_summary = {} 374 bs_summary = {}
375 license_summary = {} 375 license_summary = {}
376 unknown_summary = [] 376 unknown_summary = {}
377 interest_keyword = Keywords.objects.filter( 377 interest_keyword = Keywords.objects.filter(
378 type=KeywordsType.INTEREST.value).values_list('keyword', flat=True) 378 type=KeywordsType.INTEREST.value).values_list('keyword', flat=True)
379 salary_keyword = Keywords.objects.filter( 379 salary_keyword = Keywords.objects.filter(
......
...@@ -169,6 +169,10 @@ class BSWorkbook(Workbook): ...@@ -169,6 +169,10 @@ class BSWorkbook(Workbook):
169 0, (ws.title, idx_list[-1] + min_row, ws.max_row, 0)) 169 0, (ws.title, idx_list[-1] + min_row, ws.max_row, 0))
170 170
171 def build_metadata_rows(self, classify, confidence, role, code, print_time, start_date, end_date): 171 def build_metadata_rows(self, classify, confidence, role, code, print_time, start_date, end_date):
172 if start_date is None or end_date is None:
173 timedelta = None
174 else:
175 timedelta = (end_date - start_date).days
172 metadata_rows = [ 176 metadata_rows = [
173 ('流水识别置信度', confidence), 177 ('流水识别置信度', confidence),
174 self.blank_row, 178 self.blank_row,
...@@ -182,7 +186,7 @@ class BSWorkbook(Workbook): ...@@ -182,7 +186,7 @@ class BSWorkbook(Workbook):
182 metadata_rows.extend( 186 metadata_rows.extend(
183 [self.blank_row, 187 [self.blank_row,
184 self.date_header, 188 self.date_header,
185 (print_time, start_date, end_date, (end_date - start_date).days), 189 (print_time, start_date, end_date, timedelta),
186 self.blank_row, 190 self.blank_row,
187 self.keyword_header] 191 self.keyword_header]
188 ) 192 )
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!