fix gzs input
Showing
3 changed files
with
25 additions
and
12 deletions
... | @@ -251,10 +251,10 @@ applicant_data_args = { | ... | @@ -251,10 +251,10 @@ applicant_data_args = { |
251 | # 'coApplicantName': fields.Str(required=True, validate=validate.Length(max=16)), | 251 | # 'coApplicantName': fields.Str(required=True, validate=validate.Length(max=16)), |
252 | # 'guarantor1Name': fields.Str(required=True, validate=validate.Length(max=16)), | 252 | # 'guarantor1Name': fields.Str(required=True, validate=validate.Length(max=16)), |
253 | # 'guarantor2Name': fields.Str(required=True, validate=validate.Length(max=16)), | 253 | # 'guarantor2Name': fields.Str(required=True, validate=validate.Length(max=16)), |
254 | 'mainApplicantName': fields.Str(required=True), | 254 | 'mainApplicantName': fields.Str(required=False), |
255 | 'coApplicantName': fields.Str(required=True), | 255 | 'coApplicantName': fields.Str(required=False), |
256 | 'guarantor1Name': fields.Str(required=True), | 256 | 'guarantor1Name': fields.Str(required=False), |
257 | 'guarantor2Name': fields.Str(required=True), | 257 | 'guarantor2Name': fields.Str(required=False), |
258 | } | 258 | } |
259 | 259 | ||
260 | document_args = { | 260 | document_args = { |
... | @@ -269,7 +269,7 @@ document_args = { | ... | @@ -269,7 +269,7 @@ document_args = { |
269 | 269 | ||
270 | doc_upload_args = { | 270 | doc_upload_args = { |
271 | 'applicationData': fields.Nested(application_data_args, required=True), | 271 | 'applicationData': fields.Nested(application_data_args, required=True), |
272 | 'applicantData': fields.Nested(applicant_data_args, required=True), | 272 | 'applicantData': fields.Nested(applicant_data_args, required=False), |
273 | 'document': fields.Nested(document_args, required=True), | 273 | 'document': fields.Nested(document_args, required=True), |
274 | } | 274 | } |
275 | 275 | ... | ... |
... | @@ -1198,7 +1198,13 @@ def get_se_cms_compare_info_auto(last_obj, application_entity, auto=True, ignore | ... | @@ -1198,7 +1198,13 @@ def get_se_cms_compare_info_auto(last_obj, application_entity, auto=True, ignore |
1198 | ) | 1198 | ) |
1199 | 1199 | ||
1200 | # CMS Vehicle Price / 1.13 * 10 % | 1200 | # CMS Vehicle Price / 1.13 * 10 % |
1201 | # gzs_list = [float(amount) * 0.1 / 1.13, float(gzs_price)] | 1201 | if isinstance(gzs_price, str): |
1202 | try: | ||
1203 | tmp_gzs_list = [float(amount) * 0.1 / 1.13, float(gzs_price)] | ||
1204 | except Exception as e: | ||
1205 | tmp_gzs_list = [amount, gzs_price] | ||
1206 | else: | ||
1207 | tmp_gzs_list = [amount, ] | ||
1202 | 1208 | ||
1203 | # 保单 ----------------------------------------------------------------------------------------------------------- | 1209 | # 保单 ----------------------------------------------------------------------------------------------------------- |
1204 | # is_insurance = 0 | 1210 | # is_insurance = 0 |
... | @@ -1271,7 +1277,7 @@ def get_se_cms_compare_info_auto(last_obj, application_entity, auto=True, ignore | ... | @@ -1271,7 +1277,7 @@ def get_se_cms_compare_info_auto(last_obj, application_entity, auto=True, ignore |
1271 | # 购置税校验 | 1277 | # 购置税校验 |
1272 | if isinstance(gzs_price, str): | 1278 | if isinstance(gzs_price, str): |
1273 | hil_contract_1_input.append( | 1279 | hil_contract_1_input.append( |
1274 | (consts.SE_HIL_CON_1_FIELD[9], [amount, gzs_price])) | 1280 | (consts.SE_HIL_CON_1_FIELD[9], tmp_gzs_list)) |
1275 | # 非购置税非车辆保险的其他asp | 1281 | # 非购置税非车辆保险的其他asp |
1276 | if have_other_asp: | 1282 | if have_other_asp: |
1277 | hil_contract_1_input.append((consts.SE_HIL_CON_1_FIELD[15], 'N')) | 1283 | 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 | ... | @@ -1380,7 +1386,7 @@ def get_se_cms_compare_info_auto(last_obj, application_entity, auto=True, ignore |
1380 | # 购置税校验 | 1386 | # 购置税校验 |
1381 | if isinstance(gzs_price, str): | 1387 | if isinstance(gzs_price, str): |
1382 | afc_contract_input.append( | 1388 | afc_contract_input.append( |
1383 | (consts.SE_AFC_CON_FIELD[21], [amount, gzs_price])) | 1389 | (consts.SE_AFC_CON_FIELD[21], tmp_gzs_list)) |
1384 | # 非购置税非车辆保险的其他asp | 1390 | # 非购置税非车辆保险的其他asp |
1385 | if have_other_asp: | 1391 | if have_other_asp: |
1386 | afc_contract_input.append((consts.SE_AFC_CON_FIELD[24], 'N')) | 1392 | 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 | ... | @@ -1737,7 +1743,13 @@ def get_se_cms_compare_info(last_obj, application_entity, detect_list, auto=Fals |
1737 | ) | 1743 | ) |
1738 | 1744 | ||
1739 | # CMS Vehicle Price / 1.13 * 10 % | 1745 | # CMS Vehicle Price / 1.13 * 10 % |
1740 | # gzs_list = [float(amount) * 0.1 / 1.13, float(gzs_price)] | 1746 | if isinstance(gzs_price, str): |
1747 | try: | ||
1748 | tmp_gzs_list = [float(amount) * 0.1 / 1.13, float(gzs_price)] | ||
1749 | except Exception as e: | ||
1750 | tmp_gzs_list = [amount, gzs_price] | ||
1751 | else: | ||
1752 | tmp_gzs_list = [amount, ] | ||
1741 | 1753 | ||
1742 | # 保单 ----------------------------------------------------------------------------------------------------------- | 1754 | # 保单 ----------------------------------------------------------------------------------------------------------- |
1743 | is_insurance = 0 | 1755 | is_insurance = 0 |
... | @@ -1808,7 +1820,7 @@ def get_se_cms_compare_info(last_obj, application_entity, detect_list, auto=Fals | ... | @@ -1808,7 +1820,7 @@ def get_se_cms_compare_info(last_obj, application_entity, detect_list, auto=Fals |
1808 | hil_contract_1_input.append((consts.SE_HIL_CON_1_FIELD[8], asp_list)) | 1820 | hil_contract_1_input.append((consts.SE_HIL_CON_1_FIELD[8], asp_list)) |
1809 | # 购置税校验 | 1821 | # 购置税校验 |
1810 | if isinstance(gzs_price, str): | 1822 | if isinstance(gzs_price, str): |
1811 | hil_contract_1_input.append((consts.SE_HIL_CON_1_FIELD[9], [amount, gzs_price])) | 1823 | hil_contract_1_input.append((consts.SE_HIL_CON_1_FIELD[9], tmp_gzs_list)) |
1812 | # 非购置税非车辆保险的其他asp | 1824 | # 非购置税非车辆保险的其他asp |
1813 | if have_other_asp: | 1825 | if have_other_asp: |
1814 | hil_contract_1_input.append((consts.SE_HIL_CON_1_FIELD[15], 'N')) | 1826 | 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 | ... | @@ -1917,7 +1929,7 @@ def get_se_cms_compare_info(last_obj, application_entity, detect_list, auto=Fals |
1917 | # 购置税校验 | 1929 | # 购置税校验 |
1918 | if isinstance(gzs_price, str): | 1930 | if isinstance(gzs_price, str): |
1919 | afc_contract_input.append( | 1931 | afc_contract_input.append( |
1920 | (consts.SE_AFC_CON_FIELD[21], [amount, gzs_price])) | 1932 | (consts.SE_AFC_CON_FIELD[21], tmp_gzs_list)) |
1921 | # 非购置税非车辆保险的其他asp | 1933 | # 非购置税非车辆保险的其他asp |
1922 | if have_other_asp: | 1934 | if have_other_asp: |
1923 | afc_contract_input.append((consts.SE_AFC_CON_FIELD[24], 'N')) | 1935 | afc_contract_input.append((consts.SE_AFC_CON_FIELD[24], 'N')) | ... | ... |
... | @@ -590,7 +590,8 @@ class Comparison: | ... | @@ -590,7 +590,8 @@ class Comparison: |
590 | def se_self_compare_gzs(self, input_list, ocr_str, **kwargs): | 590 | def se_self_compare_gzs(self, input_list, ocr_str, **kwargs): |
591 | if isinstance(input_list, list) and len(input_list) == 2: | 591 | if isinstance(input_list, list) and len(input_list) == 2: |
592 | try: | 592 | try: |
593 | if float(input_list[0]) * 0.1 / 1.13 >= float(input_list[1]): | 593 | if isinstance(input_list[0], float) and isinstance(input_list[1], float) \ |
594 | and input_list[0] >= input_list[1]: | ||
594 | return self.RESULT_Y | 595 | return self.RESULT_Y |
595 | except Exception as e: | 596 | except Exception as e: |
596 | return self.RESULT_N | 597 | return self.RESULT_N | ... | ... |
-
Please register or sign in to post a comment