1cfd8e70 by 周伟奇

dda part 2

1 parent 86fd122c
...@@ -1204,6 +1204,7 @@ DDA_IC_ID = 'customer_id' ...@@ -1204,6 +1204,7 @@ DDA_IC_ID = 'customer_id'
1204 DDA_BC_NAME = 'account_name' 1204 DDA_BC_NAME = 'account_name'
1205 DDA_BC_ID = 'account_id' 1205 DDA_BC_ID = 'account_id'
1206 DDA_IMG_PATH = 'img_path' 1206 DDA_IMG_PATH = 'img_path'
1207 DDA_PRO = 'pro'
1207 1208
1208 1209
1209 DDA_MAPPING = [ 1210 DDA_MAPPING = [
......
...@@ -267,3 +267,52 @@ class HILOCRResult(models.Model): ...@@ -267,3 +267,52 @@ class HILOCRResult(models.Model):
267 managed = False 267 managed = False
268 db_table = 'hil_ocr_result' 268 db_table = 'hil_ocr_result'
269 269
270
271 # DDA ID & BC ----> HIL SE 专有
272 class DDARecords(models.Model):
273 id = models.AutoField(primary_key=True, verbose_name="id") # 主键
274 application_id = models.CharField(max_length=64, verbose_name="申请id") # 索引
275
276 is_dda_found = models.BooleanField(default=False, verbose_name="DDA是否找到")
277 is_id_found = models.BooleanField(default=False, verbose_name="身份证是否找到")
278 is_bc_found = models.BooleanField(default=False, verbose_name="银行卡是否找到")
279 all_found = models.BooleanField(default=False, verbose_name="是否全找到")
280
281 dda_path = models.CharField(null=True, max_length=1024, verbose_name="DDA图片路径")
282 id_path = models.CharField(null=True, max_length=1024, verbose_name="身份证图片路径")
283 bc_path = models.CharField(null=True, max_length=1024, verbose_name="银行卡图片路径")
284
285 customer_name = models.CharField(null=True, max_length=1024, verbose_name="DDA身份证姓名")
286 customer_id = models.CharField(null=True, max_length=1024, verbose_name="DDA身份证号码")
287 account_id = models.CharField(null=True, max_length=1024, verbose_name="DDA银行卡号")
288
289 dda_found_time = models.DateTimeField(null=True, verbose_name='DDA时间')
290 id_found_time = models.DateTimeField(null=True, verbose_name='身份证时间')
291 bc_found_time = models.DateTimeField(null=True, verbose_name='银行卡时间')
292
293 update_time = models.DateTimeField(auto_now=True, verbose_name='修改时间') # 索引
294 create_time = models.DateTimeField(auto_now_add=True, verbose_name='创建时间') # 索引
295
296 class Meta:
297 managed = False
298 db_table = 'dda_records'
299
300
301 class IDBCRecords(models.Model):
302 id = models.AutoField(primary_key=True, verbose_name="id") # 主键
303 application_id = models.CharField(max_length=64, verbose_name="申请id") # 索引
304
305 target_name = models.CharField(null=True, max_length=1024, verbose_name="DDA身份证姓名") # 与申请号联合索引
306 target_id = models.CharField(max_length=1024, verbose_name="DDA身份证号码or银行卡号") # 与申请号联合索引
307
308 is_id = models.BooleanField(default=True, verbose_name="身份证or银行卡")
309
310 file_path = models.CharField(max_length=1024, verbose_name="图片路径")
311
312 create_time = models.DateTimeField(auto_now_add=True, verbose_name='创建时间')
313
314 class Meta:
315 managed = False
316 db_table = 'idbc_records'
317
318
......
1 import pyodbc
2
3 hil_sql = """
4 create table dda_records
5 (
6 id bigint identity
7 primary key,
8 application_id nvarchar(64) not null,
9 is_dda_found bit default 0 not null,
10 is_id_found bit default 0 not null,
11 is_bc_found bit default 0 not null,
12 all_found bit default 0 not null,
13 dda_path nvarchar(1024),
14 id_path nvarchar(1024),
15 bc_path nvarchar(1024),
16 customer_name nvarchar(1024),
17 customer_id nvarchar(1024),
18 account_id nvarchar(1024),
19 dda_found_time datetime,
20 id_found_time datetime,
21 bc_found_time datetime,
22 update_time datetime not null,
23 create_time datetime not null,
24 );
25
26 create index dda_records_application_id_index
27 on dda_records (application_id);
28
29 create index dda_records_update_time_index
30 on dda_records (update_time);
31
32 create index dda_records_create_time_index
33 on dda_records (create_time);
34
35 create table idbc_records
36 (
37 id bigint identity
38 primary key,
39 application_id nvarchar(64) not null,
40 target_name nvarchar(1024),
41 target_id nvarchar(1024) not null,
42 is_id bit default 1 not null,
43 file_path nvarchar(1024) not null,
44 create_time datetime not null,
45 );
46
47 create index idbc_records_application_id_index
48 on idbc_records (application_id);
49
50 create index idbc_records_application_id_target_name_index
51 on idbc_records (application_id, target_name);
52
53 create index idbc_records_application_id_target_id_index
54 on idbc_records (application_id, target_id);
55 """
56
57 hil_cnxn = pyodbc.connect('DRIVER={ODBC Driver 17 for SQL Server};', autocommit=True)
58 hil_cursor = hil_cnxn.cursor()
59 hil_cursor.execute(hil_sql)
60 hil_cursor.close()
61 hil_cnxn.close()
62
63 # afc_cnxn = pyodbc.connect('DRIVER={ODBC Driver 17 for SQL Server};', autocommit=True)
64 # afc_cursor = afc_cnxn.cursor()
65 # afc_cursor.execute(afc_sql)
66 # afc_cursor.close()
67 # afc_cnxn.close()
...\ No newline at end of file ...\ No newline at end of file
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!