add asp
Showing
5 changed files
with
52 additions
and
3 deletions
... | @@ -1438,12 +1438,15 @@ SE_AFC_CON_MAP = { | ... | @@ -1438,12 +1438,15 @@ SE_AFC_CON_MAP = { |
1438 | '见证人日期': (7, 8, '见证人签字', '日期'), | 1438 | '见证人日期': (7, 8, '见证人签字', '日期'), |
1439 | 1439 | ||
1440 | '还款计划表': (3, 3, '还款计划表', None), | 1440 | '还款计划表': (3, 3, '还款计划表', None), |
1441 | |||
1442 | 'ASP项目详情-重要条款': (None, 1, '附加产品融资贷款本金总金额明细', None), | ||
1443 | 'ASP项目详情': (None, 4, '附加产品融资贷款本金总金额明细', None), | ||
1441 | } | 1444 | } |
1442 | 1445 | ||
1443 | SE_AFC_CON_FIELD = ['合同编号-每页', '所购车辆价格-小写-重要条款', '车架号-重要条款', '贷款本金金额-重要条款', '贷款期限-重要条款', | 1446 | SE_AFC_CON_FIELD = ['合同编号-每页', '所购车辆价格-小写-重要条款', '车架号-重要条款', '贷款本金金额-重要条款', '贷款期限-重要条款', |
1444 | '车辆贷款本金金额-重要条款', '附加产品融资贷款本金总额-重要条款', '所购车辆价格', '车架号', '经销商', | 1447 | '车辆贷款本金金额-重要条款', '附加产品融资贷款本金总额-重要条款', '所购车辆价格', '车架号', '经销商', |
1445 | '贷款本金金额', '车辆贷款本金金额', '附加产品融资贷款本金总额', '贷款期限', '还款账号', '户名', '开户行', | 1448 | '贷款本金金额', '车辆贷款本金金额', '附加产品融资贷款本金总额', '贷款期限', '还款账号', '户名', '开户行', |
1446 | '还款计划表', '见证人签字', '见证人日期'] | 1449 | '还款计划表', '见证人签字', '见证人日期', 'ASP项目详情-重要条款', '购置税校验', 'ASP项目详情'] |
1447 | 1450 | ||
1448 | # '项目1', '用途总金额', '贷款本金', '附加产品融资贷款本金总金额', '购置税校验' | 1451 | # '项目1', '用途总金额', '贷款本金', '附加产品融资贷款本金总金额', '购置税校验' |
1449 | 1452 | ||
... | @@ -1470,7 +1473,10 @@ ROLE_LIST = [ | ... | @@ -1470,7 +1473,10 @@ ROLE_LIST = [ |
1470 | ('保证人日期2', 'Guarantor', 1, '有', False, False), | 1473 | ('保证人日期2', 'Guarantor', 1, '有', False, False), |
1471 | ] | 1474 | ] |
1472 | 1475 | ||
1476 | GZS_REASON_1 = '此申请有ASP产品,需人工核查' | ||
1477 | GZS_REASON_2 = 'ASP购置税金额小于系统金额' | ||
1473 | GZS_NAME = '车辆购置税' | 1478 | GZS_NAME = '车辆购置税' |
1479 | ASP_SUM_NAME = '附加产品融资贷款本金总金额' | ||
1474 | GZS_STATUS = ['Y', 'N', 'O'] | 1480 | GZS_STATUS = ['Y', 'N', 'O'] |
1475 | SCHEDULE_SPLIT_STR = '、' | 1481 | SCHEDULE_SPLIT_STR = '、' |
1476 | 1482 | ||
... | @@ -1668,6 +1674,9 @@ HT_COMPARE_LOGIC = { | ... | @@ -1668,6 +1674,9 @@ HT_COMPARE_LOGIC = { |
1668 | '见证人日期': ('见证人日期', 'se_date_contain_compare', {}, '合同见证人签字日期不符合逻辑'), | 1674 | '见证人日期': ('见证人日期', 'se_date_contain_compare', {}, '合同见证人签字日期不符合逻辑'), |
1669 | 1675 | ||
1670 | '还款计划表': ('还款计划表', 'se_schedule_compare', {}, '还款计划表与系统不一致'), | 1676 | '还款计划表': ('还款计划表', 'se_schedule_compare', {}, '还款计划表与系统不一致'), |
1677 | |||
1678 | 'ASP项目详情-重要条款': ('ASP项目详情-重要条款', 'se_asp_compare', {}, '(重要条款)ASP名称或者金额与系统不一致'), | ||
1679 | 'ASP项目详情': ('ASP项目详情', 'se_asp_compare', {}, 'ASP名称或者金额与系统不一致'), | ||
1671 | } | 1680 | } |
1672 | 1681 | ||
1673 | 1682 | ... | ... |
... | @@ -548,7 +548,7 @@ class Command(BaseCommand, LoggerMixin): | ... | @@ -548,7 +548,7 @@ class Command(BaseCommand, LoggerMixin): |
548 | head_fields.append(a) | 548 | head_fields.append(a) |
549 | else: | 549 | else: |
550 | head_fields = [] | 550 | head_fields = [] |
551 | for a, b in side_field_order: | 551 | for a, b in field_order: |
552 | if isinstance(b, str): | 552 | if isinstance(b, str): |
553 | head_fields.append(a) | 553 | head_fields.append(a) |
554 | row = [] | 554 | row = [] | ... | ... |
... | @@ -863,6 +863,8 @@ class Command(BaseCommand, LoggerMixin): | ... | @@ -863,6 +863,8 @@ class Command(BaseCommand, LoggerMixin): |
863 | for key, (pno_not_asp, pno_asp, key1, key2) in consts.SE_AFC_CON_MAP.items(): | 863 | for key, (pno_not_asp, pno_asp, key1, key2) in consts.SE_AFC_CON_MAP.items(): |
864 | pno = pno_asp if is_asp else pno_not_asp | 864 | pno = pno_asp if is_asp else pno_not_asp |
865 | if pno is None: | 865 | if pno is None: |
866 | if isinstance(pno_asp, int): | ||
867 | continue | ||
866 | end_idx = 9 if is_asp else 8 | 868 | end_idx = 9 if is_asp else 8 |
867 | for i in range(1, end_idx): | 869 | for i in range(1, end_idx): |
868 | res.setdefault(key, list()).append(page_info_dict.get(str(i), {}).get(key1, '')) | 870 | res.setdefault(key, list()).append(page_info_dict.get(str(i), {}).get(key1, '')) | ... | ... |
This diff is collapsed.
Click to expand it.
... | @@ -185,6 +185,34 @@ class Comparison: | ... | @@ -185,6 +185,34 @@ class Comparison: |
185 | else: | 185 | else: |
186 | return self.RESULT_N | 186 | return self.RESULT_N |
187 | 187 | ||
188 | def se_asp_compare(self, input_list, ocr_str_or_list, **kwargs): | ||
189 | if isinstance(ocr_str_or_list, list): | ||
190 | try: | ||
191 | for asp_name, asp_price, asp_fin in input_list[:-1]: | ||
192 | for row_list in ocr_str_or_list: | ||
193 | if len(row_list) != 3: | ||
194 | continue | ||
195 | if row_list[0].find(asp_name) == -1: | ||
196 | continue | ||
197 | if float(row_list[1].replace(',', '')) == float(asp_price) and \ | ||
198 | float(row_list[2].replace(',', '')) == float(asp_fin): | ||
199 | break | ||
200 | else: | ||
201 | return self.RESULT_N | ||
202 | |||
203 | _, _, sum_fin = input_list[-1] | ||
204 | if float(ocr_str_or_list[-1][-1].replace(',', '')) == float(sum_fin): | ||
205 | return self.RESULT_Y | ||
206 | else: | ||
207 | return self.RESULT_N | ||
208 | except Exception as e: | ||
209 | return self.RESULT_N | ||
210 | else: | ||
211 | return self.RESULT_N | ||
212 | |||
213 | def se_gzs_compare(self, input_str, ocr_str_or_list, **kwargs): | ||
214 | pass | ||
215 | |||
188 | def se_name_compare(self, input_str, ocr_str, **kwargs): | 216 | def se_name_compare(self, input_str, ocr_str, **kwargs): |
189 | if kwargs.get('is_passport'): | 217 | if kwargs.get('is_passport'): |
190 | input_tmp = input_str.upper().replace(' ', '') | 218 | input_tmp = input_str.upper().replace(' ', '') |
... | @@ -265,7 +293,17 @@ class Comparison: | ... | @@ -265,7 +293,17 @@ class Comparison: |
265 | if kwargs.get('today', False): | 293 | if kwargs.get('today', False): |
266 | return self.build_res(self.is_after_today(ocr_str)) | 294 | return self.build_res(self.is_after_today(ocr_str)) |
267 | else: | 295 | else: |
268 | return self.build_res(input_str == ocr_str) | 296 | res = self.build_res(input_str == ocr_str) |
297 | if res == self.RESULT_Y: | ||
298 | return res | ||
299 | else: | ||
300 | try: | ||
301 | ocr_date = datetime.strptime(ocr_str, "%Y-%m-%d") | ||
302 | input_date = datetime.strptime(input_str, "%Y-%m-%d") | ||
303 | return self.build_res(input_date == ocr_date) | ||
304 | except Exception as e: | ||
305 | return self.RESULT_N | ||
306 | |||
269 | 307 | ||
270 | def ca_date_compare(self, input_str, ocr_str, **kwargs): | 308 | def ca_date_compare(self, input_str, ocr_str, **kwargs): |
271 | if kwargs.get('long', False): | 309 | if kwargs.get('long', False): | ... | ... |
-
Please register or sign in to post a comment