Merge branch 'feature/contract' into feature/0918
Showing
2 changed files
with
6 additions
and
2 deletions
... | @@ -209,7 +209,7 @@ class Command(BaseCommand, LoggerMixin): | ... | @@ -209,7 +209,7 @@ class Command(BaseCommand, LoggerMixin): |
209 | 209 | ||
210 | def contract_process(self, ocr_data, contract_result, res_list, pno, ino, part_idx, img_path): | 210 | def contract_process(self, ocr_data, contract_result, res_list, pno, ino, part_idx, img_path): |
211 | contract_dict = ocr_data.get('data') | 211 | contract_dict = ocr_data.get('data') |
212 | if not contract_dict or 'page_num' not in contract_dict or 'page_info' not in contract_dict: | 212 | if not contract_dict or contract_dict.get('page_num') is None or contract_dict.get('page_info') is None: |
213 | res_list.append((pno, ino, part_idx, consts.RES_SUCCESS_EMPTY)) | 213 | res_list.append((pno, ino, part_idx, consts.RES_SUCCESS_EMPTY)) |
214 | return | 214 | return |
215 | res_list.append((pno, ino, part_idx, consts.RES_SUCCESS)) | 215 | res_list.append((pno, ino, part_idx, consts.RES_SUCCESS)) | ... | ... |
... | @@ -706,7 +706,11 @@ class BSWorkbook(Workbook): | ... | @@ -706,7 +706,11 @@ class BSWorkbook(Workbook): |
706 | if len(contract_result) == 0: | 706 | if len(contract_result) == 0: |
707 | return | 707 | return |
708 | ws = self.create_sheet(consts.CONTRACT_SHEET_NAME) | 708 | ws = self.create_sheet(consts.CONTRACT_SHEET_NAME) |
709 | for page_num, info_list in contract_result.items(): | 709 | for i in range(15): |
710 | if str(i) in contract_result: | ||
711 | page_num = str(i) | ||
712 | info_list = contract_result.get(page_num) | ||
713 | # for page_num, info_list in contract_result.items(): | ||
710 | ws.append(('page {0}'.format(page_num), )) | 714 | ws.append(('page {0}'.format(page_num), )) |
711 | for info in info_list: | 715 | for info in info_list: |
712 | for row in info: | 716 | for row in info: | ... | ... |
-
Please register or sign in to post a comment