Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
周伟奇
/
bmw-ocr
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
c8eea704
authored
2025-04-01 17:15:53 +0800
by
冯轩
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
FIX
1 parent
e570a364
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
67 additions
and
3 deletions
src/apps/doc/models.py
src/apps/doc/ocr/ecm.py
src/common/tools/mssql_script30.py
src/apps/doc/models.py
View file @
c8eea70
...
...
@@ -1144,7 +1144,7 @@ class HILGreenBookHistoryFile(models.Model):
input_date
=
models
.
DateTimeField
(
verbose_name
=
"上传时间"
)
modify_date
=
models
.
DateTimeField
(
verbose_name
=
"修改时间"
)
location
=
models
.
CharField
(
max_length
=
255
,
verbose_name
=
"文件位置"
)
download_finish
=
models
.
BooleanField
(
default
=
True
,
verbose_name
=
"是否下载完成"
)
download_finish
=
models
.
SmallIntegerField
(
null
=
False
,
default
=
0
,
verbose_name
=
"是否下载完成"
)
update_time
=
models
.
DateTimeField
(
auto_now
=
True
,
verbose_name
=
'修改时间'
)
create_time
=
models
.
DateTimeField
(
auto_now_add
=
True
,
verbose_name
=
'创建时间'
)
...
...
src/apps/doc/ocr/ecm.py
View file @
c8eea70
...
...
@@ -166,11 +166,12 @@ class ECM(GenericView):
def
search_doc_info_list
(
self
,
filePath
,
business_type
):
args
=
{
"username"
:
self
.
username
,
#userName n大写,和其他接口不一样,是因为apigateway没有做统一
"userName"
:
self
.
username
,
"password"
:
self
.
pwd
,
"docbase"
:
self
.
doc_base_map
.
get
(
business_type
),
"documentType"
:
"green_book"
,
"dql"
:
"select r_object_id, object_name,b_application_no, r_object_type,b_customer_name,r_content_size, owner_name, b_input_date, r_modify_date, b_location from green_book where b_location = '
"
+
filePath
+
"'"
"dql"
:
"select r_object_id, object_name,b_application_no, r_object_type,b_customer_name,r_content_size, owner_name, b_input_date, r_modify_date, b_location from green_book where b_location = '
{}'"
.
format
(
filePath
),
}
header_info
=
self
.
get_headers
()
self
.
running_log
.
info
(
"{0} search header_info:{1}"
.
format
(
self
.
log_base
,
header_info
))
...
...
src/common/tools/mssql_script30.py
0 → 100644
View file @
c8eea70
import
pyodbc
hil_sql
=
"""
CREATE TABLE [dbo].[hil_gb_history_file] (
[id] int IDENTITY(1,1) NOT NULL,
[object_id] varchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[object_name] varchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[application_no] varchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[object_type] varchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[customer_name] varchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[content_size] varchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[owner_name] varchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[input_date] datetime NULL,
[modify_date] datetime NULL,
[location] varchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[download_finish] int NOT NULL,
[update_time] datetime NULL,
[create_time] datetime NULL
)
GO;
alter table hil_gb_history_file ADD CONSTRAINT unique_object_id unique(object_id)
"""
afc_sql
=
"""
CREATE TABLE [dbo].[afc_gb_history_file] (
[id] int IDENTITY(1,1) NOT NULL,
[object_id] varchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[object_name] varchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[application_no] varchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[object_type] varchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[customer_name] varchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[content_size] varchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[owner_name] varchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[input_date] datetime NULL,
[modify_date] datetime NULL,
[location] varchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[download_finish] int NOT NULL,
[update_time] datetime NULL,
[create_time] datetime NULL
)
GO;
alter table afc_gb_history_file ADD CONSTRAINT unique_object_id unique(object_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
()
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment