From c0f5ca2eb4cc05eefc17dc1f7abd636793d98b49 Mon Sep 17 00:00:00 2001 From: liuyebo <1515783401@qq.com> Date: Tue, 19 Aug 2025 19:07:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=B4=E6=97=B6=E8=B0=83=E6=95=B4=E8=AF=86?= =?UTF-8?q?=E5=88=AB=E6=A1=88=E5=AD=90=E8=8C=83=E5=9B=B4=EF=BC=8C=E5=B0=9D?= =?UTF-8?q?=E8=AF=95=E4=BF=AE=E6=AD=A3=E6=A8=A1=E5=9E=8B=E6=9B=BF=E6=8D=A2?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E7=9A=84=E8=AF=86=E5=88=AB=E7=8E=87=E4=B8=8B?= =?UTF-8?q?=E9=99=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- photo_review/auto_photo_review.py | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/photo_review/auto_photo_review.py b/photo_review/auto_photo_review.py index 579fd25..155cb08 100644 --- a/photo_review/auto_photo_review.py +++ b/photo_review/auto_photo_review.py @@ -541,20 +541,23 @@ def photo_review(pk_phhd): def main(): while 1: session = MysqlSession() - # phhds = (session.query(ZxPhhd.pk_phhd) - # .join(ZxPhrec, ZxPhhd.pk_phhd == ZxPhrec.pk_phhd, isouter=True) - # .filter(ZxPhhd.exsuccess_flag == "1") - # .filter(ZxPhrec.pk_phrec.isnot(None)) - # .order_by(ZxPhhd.priority_num.desc()) - # .distinct().limit(PHHD_BATCH_SIZE).all()) phhds = (session.query(ZxPhhd.pk_phhd) .join(ZxPhrec, ZxPhhd.pk_phhd == ZxPhrec.pk_phhd, isouter=True) - .filter(ZxPhhd.exsuccess_flag == "9") - .filter(ZxPhhd.paint_flag == "0") - .filter(ZxPhhd.checktime > "2025-08-19 8:30") + .filter(ZxPhhd.exsuccess_flag == "1") .filter(ZxPhrec.pk_phrec.isnot(None)) .order_by(ZxPhhd.priority_num.desc()) .distinct().limit(PHHD_BATCH_SIZE).all()) + if not phhds: + # 临时调整修复,修复完成后可删除 + phhds = (session.query(ZxPhhd.pk_phhd) + .join(ZxPhrec, ZxPhhd.pk_phhd == ZxPhrec.pk_phhd, isouter=True) + .filter(ZxPhhd.exsuccess_flag == "9") + .filter(ZxPhhd.paint_flag == "0") + .filter(ZxPhhd.checktime > "2025-08-19 8:30") + .filter(ZxPhhd.checktime < "2025-08-19 18:48") + .filter(ZxPhrec.pk_phrec.isnot(None)) + .order_by(ZxPhhd.priority_num.desc()) + .distinct().limit(PHHD_BATCH_SIZE).all()) # 将状态改为正在识别中 pk_phhd_values = [phhd.pk_phhd for phhd in phhds] update_flag = (update(ZxPhhd).where(ZxPhhd.pk_phhd.in_(pk_phhd_values)).values(exsuccess_flag="2"))