From b09f16fe23bae0e7a69967520069db8ea98784f0 Mon Sep 17 00:00:00 2001 From: liuyebo <1515783401@qq.com> Date: Tue, 15 Oct 2024 13:45:11 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=9B=BE=E7=89=87=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- photo_review/auto_photo_review.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/photo_review/auto_photo_review.py b/photo_review/auto_photo_review.py index 9c815a4..8e938f9 100644 --- a/photo_review/auto_photo_review.py +++ b/photo_review/auto_photo_review.py @@ -438,12 +438,14 @@ def photo_review(pk_phhd, name): ZxPhrec.pk_phhd == pk_phhd ).all() session.close() + # 同一批图的标识 set_batch_id(uuid.uuid4().hex) + processed_img_dir = common_util.get_processed_img_path('') + os.makedirs(processed_img_dir, exist_ok=True) + discharge_text = '' for phrec in phrecs: - processed_img_dir = common_util.get_processed_img_path('') - os.makedirs(processed_img_dir, exist_ok=True) rec_type, ie_result, ocr_text = information_extraction(phrec, pk_phhd) if rec_type == '基本医保结算单': rec_result = settlement_result @@ -458,9 +460,9 @@ def photo_review(pk_phhd, name): for key, value in ie_result.items(): rec_result[key].append(value) - # 删除多余图片 - if os.path.exists(processed_img_dir) and os.path.isdir(processed_img_dir): - shutil.rmtree(processed_img_dir) + # 删除多余图片 + if os.path.exists(processed_img_dir) and os.path.isdir(processed_img_dir): + shutil.rmtree(processed_img_dir) settlement_data = settlement_task(pk_phhd, settlement_result) discharge_data = discharge_task(pk_phhd, discharge_result)