fix gzs input

1 parent 7bb25c16 master ... CHINARPA-4562 OCR-recognition-for-FSM-related-documents feature/202506-monixiadan feature/4058 feature/CHINAPRA-4447 feature/CHINARPA-3290-FSM-AUTO feature/CHINARPA-3443 feature/CHINARPA-3523 feature/CHINARPA-3528 feature/CHINARPA-3529 feature/CHINARPA-3577 feature/CHINARPA-3786 feature/CHINARPA-3964 feature/CHINARPA-4137 feature/CHINARPA-4277 feature/CHINARPA-4302/all-pass feature/CHINARPA-4341 feature/CHINARPA-4357 feature/CHINARPA-4358 feature/CHINARPA-4395 feature/CHINARPA-4495 feature/CHINARPA-4546 feature/CHINARPA-4623 feature/CHINARPA-4659 feature/CHINARPA-4660 feature/CHINARPA-4731 feature/CHINARPA-4846 feature/CHINARPA-4941 feature/CHINARPA-4942 feature/CHINARPA-4944 feature/CHINARPA-4962 feature/CHINARPA-5015 feature/CHINARPA-5075 feature/CHINARPA-5092 feature/CHINARPA-5117 feature/CHINARPA-5118 feature/CHINARPA-5131-5234 feature/CHINARPA-5153 feature/CHINARPA-5155 feature/CHINARPA-5296 feature/CHINARPA-5504 feature/CHINARPA-5619 feature/CHINARPA-5620-dzfp feature/CHINARPA_5015_SQL feature/KWOM_July feature/SE3 feature/add_log_20240924 feature/add_try_except feature/enhancement-file-name-change feature/filter-file feature/fix_label_40_dydjhmh feature/fsm-contract feature/fsm-full feature/hotfix_insurance feature/mssql-encrypt feature/new-pwd feature/pdftoimg feature/pres feature/pres-3034 feature/qrs feature/report feature/report2 feature/sc feature/seOct feature/uat-new feature/uat-tmp feature/uat-tmp-cms-yace feature/uat-tmp-cy feature/uat-tmp-wblog feature/upgrade_cut_img feature/weixin-bs feature/weixin-bs-2 feature/zfb feature/zip feature_add_down_payment feature_add_income_keywords_cy feature_add_insurance_sec_page fix/1118上线问题反馈 fix/2024-05-pen-test fix/20240424 fix/hil_excel_sql fix/new_hil_contract fix/report_ca hotfix/2025-02 hotfix/2025-04 hotfix/2025-06 master-0117 ocr-Pre-Settlement
......@@ -251,10 +251,10 @@ applicant_data_args = {
# 'coApplicantName': fields.Str(required=True, validate=validate.Length(max=16)),
# 'guarantor1Name': fields.Str(required=True, validate=validate.Length(max=16)),
# 'guarantor2Name': fields.Str(required=True, validate=validate.Length(max=16)),
'mainApplicantName': fields.Str(required=True),
'coApplicantName': fields.Str(required=True),
'guarantor1Name': fields.Str(required=True),
'guarantor2Name': fields.Str(required=True),
'mainApplicantName': fields.Str(required=False),
'coApplicantName': fields.Str(required=False),
'guarantor1Name': fields.Str(required=False),
'guarantor2Name': fields.Str(required=False),
}
document_args = {
......@@ -269,7 +269,7 @@ document_args = {
doc_upload_args = {
'applicationData': fields.Nested(application_data_args, required=True),
'applicantData': fields.Nested(applicant_data_args, required=True),
'applicantData': fields.Nested(applicant_data_args, required=False),
'document': fields.Nested(document_args, required=True),
}
......
......@@ -1198,7 +1198,13 @@ def get_se_cms_compare_info_auto(last_obj, application_entity, auto=True, ignore
)
# CMS Vehicle Price / 1.13 * 10 %
# gzs_list = [float(amount) * 0.1 / 1.13, float(gzs_price)]
if isinstance(gzs_price, str):
try:
tmp_gzs_list = [float(amount) * 0.1 / 1.13, float(gzs_price)]
except Exception as e:
tmp_gzs_list = [amount, gzs_price]
else:
tmp_gzs_list = [amount, ]
# 保单 -----------------------------------------------------------------------------------------------------------
# is_insurance = 0
......@@ -1271,7 +1277,7 @@ def get_se_cms_compare_info_auto(last_obj, application_entity, auto=True, ignore
# 购置税校验
if isinstance(gzs_price, str):
hil_contract_1_input.append(
(consts.SE_HIL_CON_1_FIELD[9], [amount, gzs_price]))
(consts.SE_HIL_CON_1_FIELD[9], tmp_gzs_list))
# 非购置税非车辆保险的其他asp
if have_other_asp:
hil_contract_1_input.append((consts.SE_HIL_CON_1_FIELD[15], 'N'))
......@@ -1380,7 +1386,7 @@ def get_se_cms_compare_info_auto(last_obj, application_entity, auto=True, ignore
# 购置税校验
if isinstance(gzs_price, str):
afc_contract_input.append(
(consts.SE_AFC_CON_FIELD[21], [amount, gzs_price]))
(consts.SE_AFC_CON_FIELD[21], tmp_gzs_list))
# 非购置税非车辆保险的其他asp
if have_other_asp:
afc_contract_input.append((consts.SE_AFC_CON_FIELD[24], 'N'))
......@@ -1737,7 +1743,13 @@ def get_se_cms_compare_info(last_obj, application_entity, detect_list, auto=Fals
)
# CMS Vehicle Price / 1.13 * 10 %
# gzs_list = [float(amount) * 0.1 / 1.13, float(gzs_price)]
if isinstance(gzs_price, str):
try:
tmp_gzs_list = [float(amount) * 0.1 / 1.13, float(gzs_price)]
except Exception as e:
tmp_gzs_list = [amount, gzs_price]
else:
tmp_gzs_list = [amount, ]
# 保单 -----------------------------------------------------------------------------------------------------------
is_insurance = 0
......@@ -1808,7 +1820,7 @@ def get_se_cms_compare_info(last_obj, application_entity, detect_list, auto=Fals
hil_contract_1_input.append((consts.SE_HIL_CON_1_FIELD[8], asp_list))
# 购置税校验
if isinstance(gzs_price, str):
hil_contract_1_input.append((consts.SE_HIL_CON_1_FIELD[9], [amount, gzs_price]))
hil_contract_1_input.append((consts.SE_HIL_CON_1_FIELD[9], tmp_gzs_list))
# 非购置税非车辆保险的其他asp
if have_other_asp:
hil_contract_1_input.append((consts.SE_HIL_CON_1_FIELD[15], 'N'))
......@@ -1917,7 +1929,7 @@ def get_se_cms_compare_info(last_obj, application_entity, detect_list, auto=Fals
# 购置税校验
if isinstance(gzs_price, str):
afc_contract_input.append(
(consts.SE_AFC_CON_FIELD[21], [amount, gzs_price]))
(consts.SE_AFC_CON_FIELD[21], tmp_gzs_list))
# 非购置税非车辆保险的其他asp
if have_other_asp:
afc_contract_input.append((consts.SE_AFC_CON_FIELD[24], 'N'))
......
......@@ -590,7 +590,8 @@ class Comparison:
def se_self_compare_gzs(self, input_list, ocr_str, **kwargs):
if isinstance(input_list, list) and len(input_list) == 2:
try:
if float(input_list[0]) * 0.1 / 1.13 >= float(input_list[1]):
if isinstance(input_list[0], float) and isinstance(input_list[1], float) \
and input_list[0] >= input_list[1]:
return self.RESULT_Y
except Exception as e:
return self.RESULT_N
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!