优化错误类型的判断
This commit is contained in:
@@ -31,11 +31,13 @@ def auto_check_error(error_ocr):
|
||||
if error_ocr.cfjaddress2:
|
||||
return error_ocr.cfjaddress2
|
||||
|
||||
if error_ocr.cfjaddress[17] == '1':
|
||||
cfjaddress = error_ocr.cfjaddress
|
||||
if cfjaddress[17] == "1":
|
||||
return "图片类型错误"
|
||||
|
||||
session = MysqlSession()
|
||||
query = select(exists().where(ZxPhrec.cfjaddress == error_ocr.cfjaddress))
|
||||
cfjaddress = cfjaddress.rsplit(".", 1)[0] + ".%"
|
||||
query = select(exists().where(ZxPhrec.cfjaddress.like(cfjaddress)))
|
||||
record_exists = session.execute(query).scalar()
|
||||
session.close()
|
||||
if not record_exists:
|
||||
@@ -58,9 +60,11 @@ if __name__ == '__main__':
|
||||
# ocr_error.cXm = ""
|
||||
# ocr_error.cSfzh = ""
|
||||
# ocr_error.cfjaddress = ""
|
||||
# ocr_error.cfjaddress2 = ""
|
||||
# 手动选择pk
|
||||
# session = MysqlSession()
|
||||
# ocr_error = (session.query(ZxIeOcrerror.pk_phrec, ZxIeOcrerror.cXm, ZxIeOcrerror.cSfzh, ZxIeOcrerror.cfjaddress)
|
||||
# ocr_error = (session.query(ZxIeOcrerror.pk_phrec, ZxIeOcrerror.cXm, ZxIeOcrerror.cSfzh, ZxIeOcrerror.cfjaddress,
|
||||
# ZxIeOcrerror.cfjaddress2)
|
||||
# .filter(ZxIeOcrerror.pk_phrec == 0).one())
|
||||
# session.close()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user