1cfd8e70 by 周伟奇

dda part 2

1 parent 86fd122c
......@@ -1204,6 +1204,7 @@ DDA_IC_ID = 'customer_id'
DDA_BC_NAME = 'account_name'
DDA_BC_ID = 'account_id'
DDA_IMG_PATH = 'img_path'
DDA_PRO = 'pro'
DDA_MAPPING = [
......
......@@ -267,3 +267,52 @@ class HILOCRResult(models.Model):
managed = False
db_table = 'hil_ocr_result'
# DDA ID & BC ----> HIL SE 专有
class DDARecords(models.Model):
id = models.AutoField(primary_key=True, verbose_name="id") # 主键
application_id = models.CharField(max_length=64, verbose_name="申请id") # 索引
is_dda_found = models.BooleanField(default=False, verbose_name="DDA是否找到")
is_id_found = models.BooleanField(default=False, verbose_name="身份证是否找到")
is_bc_found = models.BooleanField(default=False, verbose_name="银行卡是否找到")
all_found = models.BooleanField(default=False, verbose_name="是否全找到")
dda_path = models.CharField(null=True, max_length=1024, verbose_name="DDA图片路径")
id_path = models.CharField(null=True, max_length=1024, verbose_name="身份证图片路径")
bc_path = models.CharField(null=True, max_length=1024, verbose_name="银行卡图片路径")
customer_name = models.CharField(null=True, max_length=1024, verbose_name="DDA身份证姓名")
customer_id = models.CharField(null=True, max_length=1024, verbose_name="DDA身份证号码")
account_id = models.CharField(null=True, max_length=1024, verbose_name="DDA银行卡号")
dda_found_time = models.DateTimeField(null=True, verbose_name='DDA时间')
id_found_time = models.DateTimeField(null=True, verbose_name='身份证时间')
bc_found_time = models.DateTimeField(null=True, verbose_name='银行卡时间')
update_time = models.DateTimeField(auto_now=True, verbose_name='修改时间') # 索引
create_time = models.DateTimeField(auto_now_add=True, verbose_name='创建时间') # 索引
class Meta:
managed = False
db_table = 'dda_records'
class IDBCRecords(models.Model):
id = models.AutoField(primary_key=True, verbose_name="id") # 主键
application_id = models.CharField(max_length=64, verbose_name="申请id") # 索引
target_name = models.CharField(null=True, max_length=1024, verbose_name="DDA身份证姓名") # 与申请号联合索引
target_id = models.CharField(max_length=1024, verbose_name="DDA身份证号码or银行卡号") # 与申请号联合索引
is_id = models.BooleanField(default=True, verbose_name="身份证or银行卡")
file_path = models.CharField(max_length=1024, verbose_name="图片路径")
create_time = models.DateTimeField(auto_now_add=True, verbose_name='创建时间')
class Meta:
managed = False
db_table = 'idbc_records'
......
import pyodbc
hil_sql = """
create table dda_records
(
id bigint identity
primary key,
application_id nvarchar(64) not null,
is_dda_found bit default 0 not null,
is_id_found bit default 0 not null,
is_bc_found bit default 0 not null,
all_found bit default 0 not null,
dda_path nvarchar(1024),
id_path nvarchar(1024),
bc_path nvarchar(1024),
customer_name nvarchar(1024),
customer_id nvarchar(1024),
account_id nvarchar(1024),
dda_found_time datetime,
id_found_time datetime,
bc_found_time datetime,
update_time datetime not null,
create_time datetime not null,
);
create index dda_records_application_id_index
on dda_records (application_id);
create index dda_records_update_time_index
on dda_records (update_time);
create index dda_records_create_time_index
on dda_records (create_time);
create table idbc_records
(
id bigint identity
primary key,
application_id nvarchar(64) not null,
target_name nvarchar(1024),
target_id nvarchar(1024) not null,
is_id bit default 1 not null,
file_path nvarchar(1024) not null,
create_time datetime not null,
);
create index idbc_records_application_id_index
on idbc_records (application_id);
create index idbc_records_application_id_target_name_index
on idbc_records (application_id, target_name);
create index idbc_records_application_id_target_id_index
on idbc_records (application_id, target_id);
"""
hil_cnxn = pyodbc.connect('DRIVER={ODBC Driver 17 for SQL Server};', autocommit=True)
hil_cursor = hil_cnxn.cursor()
hil_cursor.execute(hil_sql)
hil_cursor.close()
hil_cnxn.close()
# afc_cnxn = pyodbc.connect('DRIVER={ODBC Driver 17 for SQL Server};', autocommit=True)
# afc_cursor = afc_cnxn.cursor()
# afc_cursor.execute(afc_sql)
# afc_cursor.close()
# afc_cnxn.close()
\ 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!