Merge branch 'feature/auto-flag'
Showing
1 changed file
with
48 additions
and
23 deletions
... | @@ -743,29 +743,29 @@ class SECompareView(GenericView): | ... | @@ -743,29 +743,29 @@ class SECompareView(GenericView): |
743 | @use_args(se_compare_args, location='data') | 743 | @use_args(se_compare_args, location='data') |
744 | def post(self, request, args): | 744 | def post(self, request, args): |
745 | # 存库 | 745 | # 存库 |
746 | content = args.get('content', {}) | 746 | # content = args.get('content', {}) |
747 | business_type = content.get('applicationEntity') | 747 | # business_type = content.get('applicationEntity') |
748 | application_id = content.get('applicationId') | 748 | # application_id = content.get('applicationId') |
749 | is_auto = content.get('isAutoSettlement', False) | 749 | # is_auto = content.get('isAutoSettlement', False) |
750 | 750 | # | |
751 | auto_class = HILAutoSettlement if business_type in consts.HIL_SET else AFCAutoSettlement | 751 | # auto_class = HILAutoSettlement if business_type in consts.HIL_SET else AFCAutoSettlement |
752 | auto_obj = auto_class.objects.filter(application_id=application_id).first() | 752 | # auto_obj = auto_class.objects.filter(application_id=application_id).first() |
753 | if is_auto: | 753 | # if is_auto: |
754 | # 加入优先级队列 | 754 | # # 加入优先级队列 |
755 | PriorityApplication.objects.update_or_create( | 755 | # PriorityApplication.objects.update_or_create( |
756 | application_id=application_id, defaults={'on_off': True}) | 756 | # application_id=application_id, defaults={'on_off': True}) |
757 | # 加入auto表 | 757 | # # 加入auto表 |
758 | if auto_obj is None: | 758 | # if auto_obj is None: |
759 | auto_class.objects.create( | 759 | # auto_class.objects.create( |
760 | application_id=application_id, | 760 | # application_id=application_id, |
761 | ) | 761 | # ) |
762 | elif auto_obj.on_off is False: | 762 | # elif auto_obj.on_off is False: |
763 | auto_obj.on_off = True | 763 | # auto_obj.on_off = True |
764 | auto_obj.save() | 764 | # auto_obj.save() |
765 | else: | 765 | # else: |
766 | if auto_obj is not None and auto_obj.on_off is True: | 766 | # if auto_obj is not None and auto_obj.on_off is True: |
767 | auto_obj.on_off = False | 767 | # auto_obj.on_off = False |
768 | auto_obj.save() | 768 | # auto_obj.save() |
769 | return response.ok() | 769 | return response.ok() |
770 | 770 | ||
771 | # uniq_seq = content.get('uniqSeq') | 771 | # uniq_seq = content.get('uniqSeq') |
... | @@ -1256,6 +1256,30 @@ class SECMSView(GenericView): | ... | @@ -1256,6 +1256,30 @@ class SECMSView(GenericView): |
1256 | business_type = consts.AFC_PREFIX if cms_info.get('financeCompany', '').startswith('宝马') else consts.HIL_PREFIX | 1256 | business_type = consts.AFC_PREFIX if cms_info.get('financeCompany', '').startswith('宝马') else consts.HIL_PREFIX |
1257 | src_application_id = cms_info.get('settlemnetVerification', {}).get('applicationNo', '') | 1257 | src_application_id = cms_info.get('settlemnetVerification', {}).get('applicationNo', '') |
1258 | application_id = src_application_id[:src_application_id.rfind('-')] | 1258 | application_id = src_application_id[:src_application_id.rfind('-')] |
1259 | |||
1260 | # auto flag | ||
1261 | is_auto = cms_info.get('AutoSettlement', False) | ||
1262 | |||
1263 | auto_class = HILAutoSettlement if business_type in consts.HIL_SET else AFCAutoSettlement | ||
1264 | auto_obj = auto_class.objects.filter(application_id=application_id).first() | ||
1265 | if is_auto: | ||
1266 | # 加入优先级队列 | ||
1267 | PriorityApplication.objects.update_or_create( | ||
1268 | application_id=application_id, defaults={'on_off': True}) | ||
1269 | # 加入auto表 | ||
1270 | if auto_obj is None: | ||
1271 | auto_class.objects.create( | ||
1272 | application_id=application_id, | ||
1273 | ) | ||
1274 | elif auto_obj.on_off is False: | ||
1275 | auto_obj.on_off = True | ||
1276 | auto_obj.save() | ||
1277 | else: | ||
1278 | if auto_obj is not None and auto_obj.on_off is True: | ||
1279 | auto_obj.on_off = False | ||
1280 | auto_obj.save() | ||
1281 | |||
1282 | # 比对信息存储 | ||
1259 | content_str = json.dumps(cms_info) | 1283 | content_str = json.dumps(cms_info) |
1260 | 1284 | ||
1261 | comparison_class = HILSECMSInfo if business_type in consts.HIL_SET else AFCSECMSInfo | 1285 | comparison_class = HILSECMSInfo if business_type in consts.HIL_SET else AFCSECMSInfo |
... | @@ -1267,6 +1291,7 @@ class SECMSView(GenericView): | ... | @@ -1267,6 +1291,7 @@ class SECMSView(GenericView): |
1267 | # 触发比对 | 1291 | # 触发比对 |
1268 | compare.apply_async((application_id, business_type, None, None, False, True), | 1292 | compare.apply_async((application_id, business_type, None, None, False, True), |
1269 | queue='queue_compare') | 1293 | queue='queue_compare') |
1294 | |||
1270 | return response.ok() | 1295 | return response.ok() |
1271 | 1296 | ||
1272 | post.openapi_doc = ''' | 1297 | post.openapi_doc = ''' | ... | ... |
-
Please register or sign in to post a comment