Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dwsproject
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dws
dwsproject
Commits
ef07807d
Commit
ef07807d
authored
Jan 22, 2025
by
夏超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[fix] 上推数据修改
parent
df6acd27
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
4 deletions
+2
-4
sdddl_project/wizard/inherit_result_put_warehose_wizard.py
+2
-4
No files found.
sdddl_project/wizard/inherit_result_put_warehose_wizard.py
View file @
ef07807d
...
@@ -29,18 +29,16 @@ class InheritRokeResultPutWarehouseWizard(models.TransientModel):
...
@@ -29,18 +29,16 @@ class InheritRokeResultPutWarehouseWizard(models.TransientModel):
ids_str
=
[
f
"'{v.id}'"
for
v
in
results
]
ids_str
=
[
f
"'{v.id}'"
for
v
in
results
]
if
not
ids_str
:
if
not
ids_str
:
return
super
(
InheritRokeResultPutWarehouseWizard
,
self
)
.
default_get
()
return
super
(
InheritRokeResultPutWarehouseWizard
,
self
)
.
default_get
()
_logger
.
info
(
f
"SQL____________{' , '.join(ids_str)}"
)
sql
=
f
"""
sql
=
f
"""
select WBCCB_CCID
select WBCCB_CCID
from WBCCB
from WBCCB
where WBCCB_CCID
not
in ({' , '.join(ids_str)})
where WBCCB_CCID in ({' , '.join(ids_str)})
"""
"""
try
:
try
:
cur
.
execute
(
sql
)
cur
.
execute
(
sql
)
rows
=
cur
.
fetchall
()
rows
=
cur
.
fetchall
()
rowdesc
=
cur
.
description
rowdesc
=
cur
.
description
except
Exception
as
e
:
except
Exception
as
e
:
_logger
.
info
(
f
"SQL____________{sql}"
)
raise
ValidationError
(
"数据库查询失败"
)
raise
ValidationError
(
"数据库查询失败"
)
finally
:
finally
:
cur
.
close
()
cur
.
close
()
...
@@ -54,7 +52,7 @@ class InheritRokeResultPutWarehouseWizard(models.TransientModel):
...
@@ -54,7 +52,7 @@ class InheritRokeResultPutWarehouseWizard(models.TransientModel):
insert_id
.
append
(
v
.
get
(
"WBCCB_CCID"
,
0
))
insert_id
.
append
(
v
.
get
(
"WBCCB_CCID"
,
0
))
insert_sql_data
=
[]
insert_sql_data
=
[]
for
v
in
results
:
for
v
in
results
:
if
v
.
id
not
in
insert_id
:
if
v
.
id
in
insert_id
:
continue
continue
insert_sql_data
.
append
(
f
"""
insert_sql_data
.
append
(
f
"""
('{v.product_id.code}', '{v.wo_id.code}', {v.qty or 0}, {v.id}, '{v.pt_id.code}', '{v.pt_id.task_type}')
('{v.product_id.code}', '{v.wo_id.code}', {v.qty or 0}, {v.id}, '{v.pt_id.code}', '{v.pt_id.task_type}')
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment