614fdf38 by 周伟奇

fix bug

1 parent 7c50d819
......@@ -79,7 +79,7 @@ TRANS_MAP = {
TRANS = str.maketrans(TRANS_MAP)
ERROR_CHARS = {'.', '。', ':', ':', '•', '·', ',', ','}
RES_SHEET_NAME = '结果统计'
RES_SHEET_HEADER = ('页码', '序号', '结果')
RES_SHEET_HEADER = ('页码', '图片序号', '检测图片序号', '结果')
RES_SUCCESS = '识别成功'
RES_SUCCESS_OTHER = '识别成功(其他类)'
RES_SUCCESS_EMPTY = '识别成功(空数据)'
......
......@@ -108,7 +108,7 @@ class Command(BaseCommand, LoggerMixin):
res_list.append((pno, ino, part_idx, consts.RES_SUCCESS_EMPTY))
return
# confidence = ocr_data.get('confidence', 1)
img_name = 'page_{0}_img_{1}'.format(pno, ino)
img_name = 'page_{0}_img_{1}_{2}'.format(pno, ino, part_idx)
cells_exists = False
for i, sheet in enumerate(sheets):
cells = sheet.get('cells')
......
......@@ -391,13 +391,14 @@ class BSWorkbook(Workbook):
amount_fill_row = set()
for rows in new_ws.iter_rows(min_row=2):
summary_cell = None if summary_cell_idx is None else rows[summary_cell_idx]
date_cell = None if date_cell_idx is None else rows[date_cell_idx]
amount_cell = None if amount_cell_idx is None else rows[amount_cell_idx]
over_cell = None if over_cell_idx is None else rows[over_cell_idx]
income_cell = None if income_cell_idx is None else rows[income_cell_idx]
outlay_cell = None if outlay_cell_idx is None else rows[outlay_cell_idx]
borrow_cell = None if borrow_cell_idx is None else rows[borrow_cell_idx]
length = len(rows)
summary_cell = None if summary_cell_idx is None or summary_cell_idx >= length else rows[summary_cell_idx]
date_cell = None if date_cell_idx is None or date_cell_idx >= length else rows[date_cell_idx]
amount_cell = None if amount_cell_idx is None or amount_cell_idx >= length else rows[amount_cell_idx]
over_cell = None if over_cell_idx is None or over_cell_idx >= length else rows[over_cell_idx]
income_cell = None if income_cell_idx is None or income_cell_idx >= length else rows[income_cell_idx]
outlay_cell = None if outlay_cell_idx is None or outlay_cell_idx >= length else rows[outlay_cell_idx]
borrow_cell = None if borrow_cell_idx is None or borrow_cell_idx >= length else rows[borrow_cell_idx]
summary_cell_value = None if summary_cell is None else summary_cell.value
date_cell_value = None if date_cell is None else date_cell.value
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!