Merge branch 'feature/CHINARPA-3523' into feature/uat-tmp
Showing
4 changed files
with
47 additions
and
6 deletions
... | @@ -2455,10 +2455,12 @@ RE_RPA_RESULT_MAP = {v: k for k, v in RPA_RESULT_MAP.items()} | ... | @@ -2455,10 +2455,12 @@ RE_RPA_RESULT_MAP = {v: k for k, v in RPA_RESULT_MAP.items()} |
2455 | AUTO_WB_FIELD = ( | 2455 | AUTO_WB_FIELD = ( |
2456 | ('application_id', 'aa_type', 'ocr_latest_comparison_time', 'ocr_auto_result_pass', 'ocr_whole_result_pass', | 2456 | ('application_id', 'aa_type', 'ocr_latest_comparison_time', 'ocr_auto_result_pass', 'ocr_whole_result_pass', |
2457 | 'rpa_result', 'rpa_1st_eye_tat', 'rpa_2nd_eye_tat', 'rpa_3rd_eye_tat', 'rpa_total_tat', 'rpa_activated_time', | 2457 | 'rpa_result', 'rpa_1st_eye_tat', 'rpa_2nd_eye_tat', 'rpa_3rd_eye_tat', 'rpa_total_tat', 'rpa_activated_time', |
2458 | 'rpa_get_case_from_ocr_time', 'rpa_get_case_from_oc_time', 'rpa_payment_authorize_time', 'rpa_second_eye_time'), | 2458 | 'rpa_get_case_from_ocr_time', 'rpa_get_case_from_oc_time', 'rpa_payment_authorize_time', 'rpa_second_eye_time', |
2459 | 'is_fsm'), | ||
2459 | ('application_id', 'aa_type', 'latest_comparison_time', 'auto_result', 'whole_result', 'rpa_result', | 2460 | ('application_id', 'aa_type', 'latest_comparison_time', 'auto_result', 'whole_result', 'rpa_result', |
2460 | 'rpa_1st_eye_tat', 'rpa_2nd_eye_tat', 'rpa_3rd_eye_tat', 'rpa_total_tat', 'rpa_activated_time', | 2461 | 'rpa_1st_eye_tat', 'rpa_2nd_eye_tat', 'rpa_3rd_eye_tat', 'rpa_total_tat', 'rpa_activated_time', |
2461 | 'rpa_get_case_from_ocr_time', 'rpa_get_case_from_oc_time', 'rpa_payment_authorize_time', 'rpa_second_eye_time') | 2462 | 'rpa_get_case_from_ocr_time', 'rpa_get_case_from_oc_time', 'rpa_payment_authorize_time', 'rpa_second_eye_time', |
2463 | 'is_fsm') | ||
2462 | ) | 2464 | ) |
2463 | 2465 | ||
2464 | MPOS_MAP = { | 2466 | MPOS_MAP = { | ... | ... |
... | @@ -880,6 +880,8 @@ class HILAutoSettlement(models.Model): | ... | @@ -880,6 +880,8 @@ class HILAutoSettlement(models.Model): |
880 | update_time = models.DateTimeField(auto_now=True, verbose_name='修改时间') | 880 | update_time = models.DateTimeField(auto_now=True, verbose_name='修改时间') |
881 | create_time = models.DateTimeField(auto_now_add=True, verbose_name='创建时间') | 881 | create_time = models.DateTimeField(auto_now_add=True, verbose_name='创建时间') |
882 | 882 | ||
883 | is_fsm = models.SmallIntegerField(null=False, default=0, verbose_name="是否fsm流程 1:是") | ||
884 | |||
883 | class Meta: | 885 | class Meta: |
884 | managed = False | 886 | managed = False |
885 | db_table = 'hil_auto_settlement' | 887 | db_table = 'hil_auto_settlement' |
... | @@ -910,6 +912,8 @@ class AFCAutoSettlement(models.Model): | ... | @@ -910,6 +912,8 @@ class AFCAutoSettlement(models.Model): |
910 | update_time = models.DateTimeField(auto_now=True, verbose_name='修改时间') | 912 | update_time = models.DateTimeField(auto_now=True, verbose_name='修改时间') |
911 | create_time = models.DateTimeField(auto_now_add=True, verbose_name='创建时间') | 913 | create_time = models.DateTimeField(auto_now_add=True, verbose_name='创建时间') |
912 | 914 | ||
915 | is_fsm = models.SmallIntegerField(null=False, default=0, verbose_name="是否fsm流程 1:是") | ||
916 | |||
913 | class Meta: | 917 | class Meta: |
914 | managed = False | 918 | managed = False |
915 | db_table = 'afc_auto_settlement' | 919 | db_table = 'afc_auto_settlement' | ... | ... |
... | @@ -348,6 +348,7 @@ auto_list_args = { | ... | @@ -348,6 +348,7 @@ auto_list_args = { |
348 | 'activated_time_end': fields.Date(required=False), | 348 | 'activated_time_end': fields.Date(required=False), |
349 | 'comparison_time_start': fields.Date(required=False), | 349 | 'comparison_time_start': fields.Date(required=False), |
350 | 'comparison_time_end': fields.Date(required=False), | 350 | 'comparison_time_end': fields.Date(required=False), |
351 | 'is_fsm': fields.Int(required=False), | ||
351 | } | 352 | } |
352 | 353 | ||
353 | compare_result_args = { | 354 | compare_result_args = { |
... | @@ -1463,6 +1464,9 @@ class SECMSView(GenericView): | ... | @@ -1463,6 +1464,9 @@ class SECMSView(GenericView): |
1463 | 1464 | ||
1464 | # auto flag | 1465 | # auto flag |
1465 | is_auto = cms_info.get('AutoSettlement', False) | 1466 | is_auto = cms_info.get('AutoSettlement', False) |
1467 | # fsm flag | ||
1468 | fsm_contract = cms_info.get('FSMContract', False) | ||
1469 | is_fsm=1 if fsm_contract else 0, | ||
1466 | 1470 | ||
1467 | auto_class = HILAutoSettlement if business_type in consts.HIL_SET else AFCAutoSettlement | 1471 | auto_class = HILAutoSettlement if business_type in consts.HIL_SET else AFCAutoSettlement |
1468 | auto_obj = auto_class.objects.filter(application_id=application_id).first() | 1472 | auto_obj = auto_class.objects.filter(application_id=application_id).first() |
... | @@ -1474,6 +1478,7 @@ class SECMSView(GenericView): | ... | @@ -1474,6 +1478,7 @@ class SECMSView(GenericView): |
1474 | if auto_obj is None: | 1478 | if auto_obj is None: |
1475 | auto_class.objects.create( | 1479 | auto_class.objects.create( |
1476 | application_id=application_id, | 1480 | application_id=application_id, |
1481 | is_fsm=is_fsm, | ||
1477 | ) | 1482 | ) |
1478 | elif auto_obj.on_off is False: | 1483 | elif auto_obj.on_off is False: |
1479 | auto_obj.on_off = True | 1484 | auto_obj.on_off = True |
... | @@ -1493,7 +1498,6 @@ class SECMSView(GenericView): | ... | @@ -1493,7 +1498,6 @@ class SECMSView(GenericView): |
1493 | ) | 1498 | ) |
1494 | 1499 | ||
1495 | # 检查是否fsm流程(SE) | 1500 | # 检查是否fsm流程(SE) |
1496 | fsm_contract = cms_info.get('FSMContract', False) | ||
1497 | fsm_best_price = cms_info.get('FSMBestPrice', False) | 1501 | fsm_best_price = cms_info.get('FSMBestPrice', False) |
1498 | if fsm_contract: | 1502 | if fsm_contract: |
1499 | # 记录fsm 流程的cms 提交 | 1503 | # 记录fsm 流程的cms 提交 |
... | @@ -1601,6 +1605,8 @@ class AutoSettlementView(GenericView): | ... | @@ -1601,6 +1605,8 @@ class AutoSettlementView(GenericView): |
1601 | whole_result = args.get('whole_result', '') | 1605 | whole_result = args.get('whole_result', '') |
1602 | rpa_result = args.get('rpa_result', '') | 1606 | rpa_result = args.get('rpa_result', '') |
1603 | 1607 | ||
1608 | is_fsm = args.get('is_fsm') | ||
1609 | |||
1604 | if isinstance(auto_result, int): | 1610 | if isinstance(auto_result, int): |
1605 | auto_result = consts.RESULT_MAP.get(auto_result) | 1611 | auto_result = consts.RESULT_MAP.get(auto_result) |
1606 | if isinstance(whole_result, int): | 1612 | if isinstance(whole_result, int): |
... | @@ -1621,9 +1627,10 @@ class AutoSettlementView(GenericView): | ... | @@ -1621,9 +1627,10 @@ class AutoSettlementView(GenericView): |
1621 | time3_query = Q(ocr_latest_comparison_time__gte=comparison_time_start, | 1627 | time3_query = Q(ocr_latest_comparison_time__gte=comparison_time_start, |
1622 | ocr_latest_comparison_time__lt=comparison_time_end + datetime.timedelta(days=1)) \ | 1628 | ocr_latest_comparison_time__lt=comparison_time_end + datetime.timedelta(days=1)) \ |
1623 | if comparison_time_start is not None and comparison_time_end is not None else Q() | 1629 | if comparison_time_start is not None and comparison_time_end is not None else Q() |
1630 | is_fsm_query = Q(is_fsm=is_fsm) if is_fsm is not None else Q() | ||
1624 | 1631 | ||
1625 | query = application_id_query & auto_result_query & whole_result_query & rpa_result_query \ | 1632 | query = application_id_query & auto_result_query & whole_result_query & rpa_result_query \ |
1626 | & time1_query & time2_query & time3_query | 1633 | & time1_query & time2_query & time3_query & is_fsm_query |
1627 | 1634 | ||
1628 | auto_class = HILAutoSettlement if business_type in consts.HIL_SET else AFCAutoSettlement | 1635 | auto_class = HILAutoSettlement if business_type in consts.HIL_SET else AFCAutoSettlement |
1629 | 1636 | ||
... | @@ -1634,7 +1641,7 @@ class AutoSettlementView(GenericView): | ... | @@ -1634,7 +1641,7 @@ class AutoSettlementView(GenericView): |
1634 | raise self.invalid_params('页数不存在') | 1641 | raise self.invalid_params('页数不存在') |
1635 | 1642 | ||
1636 | val_tuple = ('application_id', 'ocr_latest_comparison_time', 'ocr_auto_result_pass', 'ocr_whole_result_pass', | 1643 | val_tuple = ('application_id', 'ocr_latest_comparison_time', 'ocr_auto_result_pass', 'ocr_whole_result_pass', |
1637 | 'rpa_result', 'rpa_activated_time', 'rpa_get_case_from_ocr_time') | 1644 | 'rpa_result', 'rpa_activated_time', 'rpa_get_case_from_ocr_time','is_fsm') |
1638 | auto_queryset = auto_class.objects.filter(query).values(*val_tuple).order_by( | 1645 | auto_queryset = auto_class.objects.filter(query).values(*val_tuple).order_by( |
1639 | '-ocr_latest_comparison_time')[start_index: end_index] | 1646 | '-ocr_latest_comparison_time')[start_index: end_index] |
1640 | 1647 | ||
... | @@ -1682,6 +1689,8 @@ class AutoSettlementExcelView(GenericView): | ... | @@ -1682,6 +1689,8 @@ class AutoSettlementExcelView(GenericView): |
1682 | whole_result = args.get('whole_result', '') | 1689 | whole_result = args.get('whole_result', '') |
1683 | rpa_result = args.get('rpa_result', '') | 1690 | rpa_result = args.get('rpa_result', '') |
1684 | 1691 | ||
1692 | is_fsm = args.get('is_fsm') | ||
1693 | |||
1685 | if isinstance(auto_result, int): | 1694 | if isinstance(auto_result, int): |
1686 | auto_result = consts.RESULT_MAP.get(auto_result) | 1695 | auto_result = consts.RESULT_MAP.get(auto_result) |
1687 | if isinstance(whole_result, int): | 1696 | if isinstance(whole_result, int): |
... | @@ -1702,9 +1711,10 @@ class AutoSettlementExcelView(GenericView): | ... | @@ -1702,9 +1711,10 @@ class AutoSettlementExcelView(GenericView): |
1702 | time3_query = Q(ocr_latest_comparison_time__gte=comparison_time_start, | 1711 | time3_query = Q(ocr_latest_comparison_time__gte=comparison_time_start, |
1703 | ocr_latest_comparison_time__lt=comparison_time_end + datetime.timedelta(days=1)) \ | 1712 | ocr_latest_comparison_time__lt=comparison_time_end + datetime.timedelta(days=1)) \ |
1704 | if comparison_time_start is not None and comparison_time_end is not None else Q() | 1713 | if comparison_time_start is not None and comparison_time_end is not None else Q() |
1714 | is_fsm_query = Q(is_fsm=is_fsm) if is_fsm is not None else Q() | ||
1705 | 1715 | ||
1706 | query = application_id_query & auto_result_query & whole_result_query & rpa_result_query \ | 1716 | query = application_id_query & auto_result_query & whole_result_query & rpa_result_query \ |
1707 | & time1_query & time2_query & time3_query | 1717 | & time1_query & time2_query & time3_query & is_fsm_query |
1708 | 1718 | ||
1709 | auto_class = HILAutoSettlement if business_type in consts.HIL_SET else AFCAutoSettlement | 1719 | auto_class = HILAutoSettlement if business_type in consts.HIL_SET else AFCAutoSettlement |
1710 | 1720 | ... | ... |
src/common/tools/mssql_script25.py
0 → 100644
1 | import pyodbc | ||
2 | |||
3 | hil_sql = """ | ||
4 | ALTER TABLE hil_auto_settlement ADD is_fsm tinyint not null default 0; | ||
5 | """ | ||
6 | |||
7 | afc_sql = """ | ||
8 | ALTER TABLE afc_auto_settlement ADD is_fsm tinyint not null default 0; | ||
9 | """ | ||
10 | |||
11 | hil_cnxn = pyodbc.connect('DRIVER={ODBC Driver 17 for SQL Server};', autocommit=True) | ||
12 | |||
13 | hil_cursor = hil_cnxn.cursor() | ||
14 | hil_cursor.execute(hil_sql) | ||
15 | |||
16 | hil_cursor.close() | ||
17 | hil_cnxn.close() | ||
18 | |||
19 | afc_cnxn = pyodbc.connect('DRIVER={ODBC Driver 17 for SQL Server};', autocommit=True) | ||
20 | |||
21 | afc_cursor = afc_cnxn.cursor() | ||
22 | afc_cursor.execute(afc_sql) | ||
23 | |||
24 | afc_cursor.close() | ||
25 | afc_cnxn.close() |
-
Please register or sign in to post a comment