fsm update
Showing
2 changed files
with
11 additions
and
39 deletions
... | @@ -1063,48 +1063,12 @@ class AFCCompareReportNew(models.Model): | ... | @@ -1063,48 +1063,12 @@ class AFCCompareReportNew(models.Model): |
1063 | situ_db_label = 'afc' | 1063 | situ_db_label = 'afc' |
1064 | 1064 | ||
1065 | 1065 | ||
1066 | invoice_code = content.get('invoiceCode', '') | ||
1067 | invoice_number = content.get('invoiceNumber', '') | ||
1068 | issue_date = content.get('issueDate', None) | ||
1069 | buyer_name = content.get('buyerName', '') | ||
1070 | buyer_id = content.get('buyerId', 0) | ||
1071 | vin = content.get('vin', '') | ||
1072 | dealer = content.get('dealer', '') | ||
1073 | price_with_vat = content.get('priceWithVat', 0.0) | ||
1074 | price_no_vat = content.get('priceNoVat', 0.0) | ||
1075 | price_in_capitals = content.get('priceInCapitals', '') | ||
1076 | vat = content.get('vat', 0.0) | ||
1077 | vat_rate = content.get('vatRate', 0.0) | ||
1078 | class AFCNscInvoice(models.Model): | 1066 | class AFCNscInvoice(models.Model): |
1079 | id = models.AutoField(primary_key=True, verbose_name="id") # 主键 | 1067 | id = models.AutoField(primary_key=True, verbose_name="id") # 主键 |
1080 | application_id = models.CharField(max_length=64, verbose_name="申请id") # 索引 | 1068 | vin = models.CharField(max_length=64, verbose_name="车架号") # 索引 |
1081 | content = models.TextField(null=True, verbose_name="nsc发票信息") | 1069 | content = models.TextField(null=True, verbose_name="nsc发票信息") |
1082 | create_time = models.DateTimeField(verbose_name='创建时间') # 索引 | 1070 | create_time = models.DateTimeField(verbose_name='创建时间') |
1083 | |||
1084 | |||
1085 | invoice_code = models.CharField(max_length=64, verbose_name="发票码") | ||
1086 | issue_date = models.CharField(max_length=64, verbose_name="开票日期") | ||
1087 | buyer_name = models.CharField(max_length=64, verbose_name="开票日期") | ||
1088 | buyer_id = models.CharField(max_length=64, verbose_name="开票日期") | ||
1089 | vin = models.CharField(max_length=64, verbose_name="开票日期") | ||
1090 | dealer = models.CharField(max_length=64, verbose_name="开票日期") | ||
1091 | price_with_vat = models.CharField(max_length=64, verbose_name="开票日期") | ||
1092 | price_no_vat = models.CharField(max_length=64, verbose_name="开票日期") | ||
1093 | price_in_capitals = models.CharField(max_length=64, verbose_name="开票日期") | ||
1094 | vat = models.CharField(max_length=64, verbose_name="开票日期") | ||
1095 | vat_rate = models.CharField(max_length=64, verbose_name="开票日期") | ||
1096 | |||
1097 | |||
1098 | |||
1099 | is_se = models.BooleanField(default=True, verbose_name="是否Settlement") | ||
1100 | is_auto = models.BooleanField(default=False, verbose_name="是否Settlement Auto") | ||
1101 | is_pass = models.BooleanField(default=False, verbose_name="是否全对") | ||
1102 | 1071 | ||
1103 | full_result = models.TextField(null=True, verbose_name="完整比对结果") | ||
1104 | field_result = models.TextField(null=True, verbose_name="各证件字段统计") | ||
1105 | |||
1106 | start_time = models.DateTimeField(verbose_name='开始时间') # 索引 | ||
1107 | end_time = models.DateTimeField(verbose_name='结束时间') | ||
1108 | class Meta: | 1072 | class Meta: |
1109 | managed = False | 1073 | managed = False |
1110 | db_table = 'afc_nsc_invoice' | 1074 | db_table = 'afc_nsc_invoice' |
... | @@ -1112,6 +1076,10 @@ class AFCNscInvoice(models.Model): | ... | @@ -1112,6 +1076,10 @@ class AFCNscInvoice(models.Model): |
1112 | 1076 | ||
1113 | 1077 | ||
1114 | class HILNscInvoice(models.Model): | 1078 | class HILNscInvoice(models.Model): |
1079 | id = models.AutoField(primary_key=True, verbose_name="id") # 主键 | ||
1080 | vin = models.CharField(max_length=64, verbose_name="车架号") # 索引 | ||
1081 | content = models.TextField(null=True, verbose_name="nsc发票信息") | ||
1082 | create_time = models.DateTimeField(verbose_name='创建时间') # 索引 | ||
1115 | 1083 | ||
1116 | class Meta: | 1084 | class Meta: |
1117 | managed = False | 1085 | managed = False | ... | ... |
... | @@ -8,6 +8,9 @@ from common.tools.comparison import cp | ... | @@ -8,6 +8,9 @@ from common.tools.comparison import cp |
8 | from common.mixins import LoggerMixin | 8 | from common.mixins import LoggerMixin |
9 | from rest_framework.permissions import IsAuthenticated | 9 | from rest_framework.permissions import IsAuthenticated |
10 | from apps.account.authentication import OAuth2AuthenticationWithUser | 10 | from apps.account.authentication import OAuth2AuthenticationWithUser |
11 | from apps.doc.models import HILNscInvoice, AFCNscInvoice | ||
12 | import json | ||
13 | from datetime import datetime | ||
11 | 14 | ||
12 | params = { | 15 | params = { |
13 | 'invoiceCode': fields.Str(required=True, validate=validate.Length(max=128)), | 16 | 'invoiceCode': fields.Str(required=True, validate=validate.Length(max=128)), |
... | @@ -29,7 +32,7 @@ input_args = { | ... | @@ -29,7 +32,7 @@ input_args = { |
29 | } | 32 | } |
30 | 33 | ||
31 | 34 | ||
32 | # poss 接口接收NSC 发票信息 | 35 | # pos 接口接收NSC 发票信息 |
33 | class NSCInvoiceView(GenericView): | 36 | class NSCInvoiceView(GenericView): |
34 | permission_classes = [IsAuthenticated] | 37 | permission_classes = [IsAuthenticated] |
35 | authentication_classes = [OAuth2AuthenticationWithUser] | 38 | authentication_classes = [OAuth2AuthenticationWithUser] |
... | @@ -50,6 +53,7 @@ class NSCInvoiceView(GenericView): | ... | @@ -50,6 +53,7 @@ class NSCInvoiceView(GenericView): |
50 | vat = content.get('vat', 0.0) | 53 | vat = content.get('vat', 0.0) |
51 | vat_rate = content.get('vatRate', 0.0) | 54 | vat_rate = content.get('vatRate', 0.0) |
52 | 55 | ||
56 | HILNscInvoice.objects.create(vin=vin, content=json.dumps(content), create_time=datetime.now()) | ||
53 | return response.ok() | 57 | return response.ok() |
54 | 58 | ||
55 | 59 | ... | ... |
-
Please register or sign in to post a comment