Merge branch 'feature/license' into feature/mssql
Showing
7 changed files
with
20 additions
and
5 deletions
This diff is collapsed.
Click to expand it.
src/apps/doc/consts_bak.py
0 → 100644
This diff is collapsed.
Click to expand it.
... | @@ -440,10 +440,23 @@ class Command(BaseCommand, LoggerMixin): | ... | @@ -440,10 +440,23 @@ class Command(BaseCommand, LoggerMixin): |
440 | merged_bs_summary = {} | 440 | merged_bs_summary = {} |
441 | card_num = 1 | 441 | card_num = 1 |
442 | for role_dict in unknown_summary.values(): | 442 | for role_dict in unknown_summary.values(): |
443 | for summary in role_dict.values(): | 443 | if len(role_dict) == 2 and consts.UNKNOWN_ROLE in role_dict: |
444 | summary_dict = role_dict.pop(consts.UNKNOWN_ROLE, {}) | ||
445 | for summary in role_dict.values(): | ||
446 | summary_dict['confidence'].extend(summary['confidence']) | ||
447 | summary_dict['role'] = summary['role'] | ||
448 | summary_dict['code'].extend(summary['code']) | ||
449 | summary_dict['print_time'].extend(summary['print_time']) | ||
450 | summary_dict['start_date'].extend(summary['start_date']) | ||
451 | summary_dict['end_date'].extend(summary['end_date']) | ||
452 | summary_dict['sheet'].extend(summary['sheet']) | ||
444 | card = '{0}_{1}'.format(consts.UNKNOWN_CARD, card_num) | 453 | card = '{0}_{1}'.format(consts.UNKNOWN_CARD, card_num) |
445 | card_num += 1 | 454 | merged_bs_summary[card] = summary_dict |
446 | merged_bs_summary[card] = summary | 455 | else: |
456 | for summary in role_dict.values(): | ||
457 | card = '{0}_{1}'.format(consts.UNKNOWN_CARD, card_num) | ||
458 | card_num += 1 | ||
459 | merged_bs_summary[card] = summary | ||
447 | else: | 460 | else: |
448 | # 1卡号 | 461 | # 1卡号 |
449 | one_card = False | 462 | one_card = False |
... | @@ -460,6 +473,7 @@ class Command(BaseCommand, LoggerMixin): | ... | @@ -460,6 +473,7 @@ class Command(BaseCommand, LoggerMixin): |
460 | for role, summary in classify_summary.items(): | 473 | for role, summary in classify_summary.items(): |
461 | if one_card or role in card_summary['role_set']: | 474 | if one_card or role in card_summary['role_set']: |
462 | merge_role.append(role) | 475 | merge_role.append(role) |
476 | card_summary['confidence'].extend(summary['confidence']) | ||
463 | card_summary['sheet'].extend(summary['sheet']) | 477 | card_summary['sheet'].extend(summary['sheet']) |
464 | card_summary['code'].extend(summary['code']) | 478 | card_summary['code'].extend(summary['code']) |
465 | card_summary['print_time'].extend(summary['print_time']) | 479 | card_summary['print_time'].extend(summary['print_time']) | ... | ... |
... | @@ -18,7 +18,7 @@ class DocHandler: | ... | @@ -18,7 +18,7 @@ class DocHandler: |
18 | 18 | ||
19 | def get_doc_list(self, doc_queryset, business_type): | 19 | def get_doc_list(self, doc_queryset, business_type): |
20 | for doc_dict in doc_queryset: | 20 | for doc_dict in doc_queryset: |
21 | if doc_dict['status'] != DocStatus.COMPLETE.value: | 21 | if doc_dict['status'] not in [DocStatus.COMPLETE.value, DocStatus.UPLOAD_FAILED.value]: |
22 | continue | 22 | continue |
23 | doc_id = doc_dict.get('id') | 23 | doc_id = doc_dict.get('id') |
24 | doc_dict['pdf_link'] = self.get_link(doc_id, business_type) | 24 | doc_dict['pdf_link'] = self.get_link(doc_id, business_type) | ... | ... |
This diff is collapsed.
Click to expand it.
src/apps/doc/ocr/wb_bak.py
0 → 100644
This diff is collapsed.
Click to expand it.
-
Please register or sign in to post a comment