cms_status_info update
Showing
2 changed files
with
21 additions
and
5 deletions
| ... | @@ -1075,7 +1075,7 @@ class NscInvoice(models.Model): | ... | @@ -1075,7 +1075,7 @@ class NscInvoice(models.Model): |
| 1075 | situ_db_label = 'hil' | 1075 | situ_db_label = 'hil' |
| 1076 | 1076 | ||
| 1077 | 1077 | ||
| 1078 | class CmsStatusInfo(models.Model): | 1078 | class AFCCmsStatusInfo(models.Model): |
| 1079 | id = models.AutoField(primary_key=True, verbose_name="id") # 主键 | 1079 | id = models.AutoField(primary_key=True, verbose_name="id") # 主键 |
| 1080 | application_id = models.CharField(max_length=64, verbose_name="订单id") # 索引 | 1080 | application_id = models.CharField(max_length=64, verbose_name="订单id") # 索引 |
| 1081 | business_type = models.CharField(max_length=64, verbose_name="业务类型") | 1081 | business_type = models.CharField(max_length=64, verbose_name="业务类型") |
| ... | @@ -1085,5 +1085,19 @@ class CmsStatusInfo(models.Model): | ... | @@ -1085,5 +1085,19 @@ class CmsStatusInfo(models.Model): |
| 1085 | 1085 | ||
| 1086 | class Meta: | 1086 | class Meta: |
| 1087 | managed = False | 1087 | managed = False |
| 1088 | db_table = 'cms_status_info' | 1088 | db_table = 'afc_cms_status_info' |
| 1089 | situ_db_label = 'afc' | ||
| 1090 | |||
| 1091 | |||
| 1092 | class HILCmsStatusInfo(models.Model): | ||
| 1093 | id = models.AutoField(primary_key=True, verbose_name="id") # 主键 | ||
| 1094 | application_id = models.CharField(max_length=64, verbose_name="订单id") # 索引 | ||
| 1095 | business_type = models.CharField(max_length=64, verbose_name="业务类型") | ||
| 1096 | is_fsm = models.SmallIntegerField(null=False, default=0, verbose_name="是否fsm流程 1:是") | ||
| 1097 | update_time = models.DateTimeField(verbose_name='更新时间') | ||
| 1098 | create_time = models.DateTimeField(verbose_name='创建时间') | ||
| 1099 | |||
| 1100 | class Meta: | ||
| 1101 | managed = False | ||
| 1102 | db_table = 'hil_cms_status_info' | ||
| 1089 | situ_db_label = 'hil' | 1103 | situ_db_label = 'hil' |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -52,7 +52,8 @@ from .models import ( | ... | @@ -52,7 +52,8 @@ from .models import ( |
| 52 | HILSEOCRResult, | 52 | HILSEOCRResult, |
| 53 | AFCOCRResult, | 53 | AFCOCRResult, |
| 54 | AFCSEOCRResult, | 54 | AFCSEOCRResult, |
| 55 | CmsStatusInfo | 55 | HILCmsStatusInfo, |
| 56 | AFCCmsStatusInfo | ||
| 56 | ) | 57 | ) |
| 57 | from .named_enum import ErrorType, AutoResult, WholeResult, RPAResult, SystemName, RequestTeam | 58 | from .named_enum import ErrorType, AutoResult, WholeResult, RPAResult, SystemName, RequestTeam |
| 58 | from .mixins import DocHandler, MPOSHandler, PreSEHandler | 59 | from .mixins import DocHandler, MPOSHandler, PreSEHandler |
| ... | @@ -1402,12 +1403,13 @@ class SECMSView(GenericView): | ... | @@ -1402,12 +1403,13 @@ class SECMSView(GenericView): |
| 1402 | if fsm_contract: | 1403 | if fsm_contract: |
| 1403 | # 记录fsm 流程的cms 提交 | 1404 | # 记录fsm 流程的cms 提交 |
| 1404 | try: | 1405 | try: |
| 1405 | cms_status_info = CmsStatusInfo.objects.filter(application_id=application_id).first() | 1406 | cms_status_class = HILCmsStatusInfo if business_type in consts.HIL_SET else AFCCmsStatusInfo |
| 1407 | cms_status_info = cms_status_class.objects.filter(application_id=application_id).first() | ||
| 1406 | if cms_status_info: | 1408 | if cms_status_info: |
| 1407 | cms_status_info.is_fsm = 1 | 1409 | cms_status_info.is_fsm = 1 |
| 1408 | cms_status_info.save() | 1410 | cms_status_info.save() |
| 1409 | else: | 1411 | else: |
| 1410 | cms_status_info = CmsStatusInfo() | 1412 | cms_status_info = cms_status_class() |
| 1411 | cms_status_info.application_id = application_id | 1413 | cms_status_info.application_id = application_id |
| 1412 | cms_status_info.business_type = business_type | 1414 | cms_status_info.business_type = business_type |
| 1413 | cms_status_info.is_fsm = 1 | 1415 | cms_status_info.is_fsm = 1 | ... | ... |
-
Please register or sign in to post a comment