Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
dj
/
dealaccountdata
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 528a2026
authored
May 12, 2026
by
林冲
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
step11_2_process_expense_category_rule_reconciliation保存category保存tmp
1 parent
4ae3397d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
scene_refactor_data/scene_split_processor.py
scene_refactor_data/scene_split_processor.py
View file @
528a202
...
...
@@ -837,7 +837,7 @@ class SceneSplitProcessor:
})
# 批量更新
batch_size
=
10000
batch_size
=
10000
0
total_count
=
len
(
update_batch
)
total_batches
=
(
total_count
+
batch_size
-
1
)
//
batch_size
self
.
logger
.
info
(
f
" 开始批量更新表2,共 {total_batches} 个批次,每批 {batch_size} 条"
)
...
...
@@ -1862,8 +1862,15 @@ class SceneSplitProcessor:
"""
if
self
.
db
.
execute_update
(
insert_sql
):
# 注意:这里不需要建立映射,因为这些记录不会被其他表引用
copy_count
+=
len
(
batch
)
# 获取起始ID
first_new_id
=
self
.
db
.
execute_query_one
(
"SELECT LAST_INSERT_ID();"
)[
0
]
# 建立映射关系并保存到 tmp_rule_id_mapping
for
i
,
item
in
enumerate
(
batch
):
new_id
=
first_new_id
+
i
self
.
id_mapper
.
add_mapping
(
table_name
,
item
[
'old_id'
],
new_id
,
item
[
'base_scene_code'
])
copy_count
+=
1
self
.
logger
.
info
(
f
" 批次 {batch_num}/{total_batches} 插入完成,本批 {len(batch)} 条,累计 {copy_count} 条"
)
self
.
logger
.
info
(
f
"第11步-2完成,共复制 {copy_count} 条记录"
)
...
...
Write
Preview
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