Merge branch 'feature/fsm-full' into 'feature/uat-tmp'
cms_status_info update See merge request !15
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 |
... | @@ -1411,12 +1412,13 @@ class SECMSView(GenericView): | ... | @@ -1411,12 +1412,13 @@ class SECMSView(GenericView): |
1411 | if fsm_contract: | 1412 | if fsm_contract: |
1412 | # 记录fsm 流程的cms 提交 | 1413 | # 记录fsm 流程的cms 提交 |
1413 | try: | 1414 | try: |
1414 | cms_status_info = CmsStatusInfo.objects.filter(application_id=application_id).first() | 1415 | cms_status_class = HILCmsStatusInfo if business_type in consts.HIL_SET else AFCCmsStatusInfo |
1416 | cms_status_info = cms_status_class.objects.filter(application_id=application_id).first() | ||
1415 | if cms_status_info: | 1417 | if cms_status_info: |
1416 | cms_status_info.is_fsm = 1 | 1418 | cms_status_info.is_fsm = 1 |
1417 | cms_status_info.save() | 1419 | cms_status_info.save() |
1418 | else: | 1420 | else: |
1419 | cms_status_info = CmsStatusInfo() | 1421 | cms_status_info = cms_status_class() |
1420 | cms_status_info.application_id = application_id | 1422 | cms_status_info.application_id = application_id |
1421 | cms_status_info.business_type = business_type | 1423 | cms_status_info.business_type = business_type |
1422 | cms_status_info.is_fsm = 1 | 1424 | cms_status_info.is_fsm = 1 | ... | ... |
-
Please register or sign in to post a comment