fix skip img
Showing
2 changed files
with
7 additions
and
7 deletions
... | @@ -147,11 +147,10 @@ class Command(BaseCommand, LoggerMixin): | ... | @@ -147,11 +147,10 @@ class Command(BaseCommand, LoggerMixin): |
147 | if summary[6] is not None: | 147 | if summary[6] is not None: |
148 | ed_list.append(summary[6]) | 148 | ed_list.append(summary[6]) |
149 | 149 | ||
150 | @staticmethod | 150 | def license1_process(self, ocr_data, license_summary, classify, skip_img, img_path): |
151 | def license1_process(ocr_data, license_summary, classify, skip_img, img_path): | ||
152 | license_data = ocr_data.get('data', []) | 151 | license_data = ocr_data.get('data', []) |
153 | if not license_data: | 152 | if not license_data: |
154 | skip_img.append(img_path) | 153 | skip_img.append(self.parse_img_path(img_path)) |
155 | return | 154 | return |
156 | for license_dict in license_data: | 155 | for license_dict in license_data: |
157 | res_list = [] | 156 | res_list = [] |
... | @@ -537,8 +536,9 @@ class Command(BaseCommand, LoggerMixin): | ... | @@ -537,8 +536,9 @@ class Command(BaseCommand, LoggerMixin): |
537 | merged_bs_summary = self.rebuild_bs_summary(bs_summary, unknown_summary) | 536 | merged_bs_summary = self.rebuild_bs_summary(bs_summary, unknown_summary) |
538 | 537 | ||
539 | self.cronjob_log.info('{0} [business_type={1}] [doc_id={2}] [merged_bs_summary={3}] ' | 538 | self.cronjob_log.info('{0} [business_type={1}] [doc_id={2}] [merged_bs_summary={3}] ' |
540 | '[unknown_summary={4}]'.format(self.log_base, business_type, doc.id, | 539 | '[unknown_summary={4}] [skip_img={5}]'.format(self.log_base, business_type, |
541 | merged_bs_summary, unknown_summary)) | 540 | doc.id, merged_bs_summary, |
541 | unknown_summary, skip_img)) | ||
542 | del unknown_summary | 542 | del unknown_summary |
543 | 543 | ||
544 | # 4.2 重构Excel文件 | 544 | # 4.2 重构Excel文件 | ... | ... |
... | @@ -249,7 +249,7 @@ class BSWorkbook(Workbook): | ... | @@ -249,7 +249,7 @@ class BSWorkbook(Workbook): |
249 | except Exception as e: | 249 | except Exception as e: |
250 | continue | 250 | continue |
251 | else: | 251 | else: |
252 | over_cell.number_format = numbers.FORMAT_GENERAL | 252 | over_cell.number_format = numbers.FORMAT_NUMBER_COMMA_SEPARATED1 |
253 | 253 | ||
254 | # 3.4.金额转数值 | 254 | # 3.4.金额转数值 |
255 | try: | 255 | try: |
... | @@ -271,7 +271,7 @@ class BSWorkbook(Workbook): | ... | @@ -271,7 +271,7 @@ class BSWorkbook(Workbook): |
271 | else: | 271 | else: |
272 | if rows[consts.BORROW_IDX].value in consts.BORROW_OUTLAY_SET: | 272 | if rows[consts.BORROW_IDX].value in consts.BORROW_OUTLAY_SET: |
273 | amount_cell.value = -amount_cell.value | 273 | amount_cell.value = -amount_cell.value |
274 | amount_cell.number_format = numbers.FORMAT_GENERAL | 274 | amount_cell.number_format = numbers.FORMAT_NUMBER_COMMA_SEPARATED1 |
275 | same_amount_mapping = amount_mapping.get(date_cell.value, {}) | 275 | same_amount_mapping = amount_mapping.get(date_cell.value, {}) |
276 | fill_rows = same_amount_mapping.get(-amount_cell.value) | 276 | fill_rows = same_amount_mapping.get(-amount_cell.value) |
277 | if fill_rows: | 277 | if fill_rows: | ... | ... |
-
Please register or sign in to post a comment