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
6b6faf72
Commit
6b6faf72
authored
Jan 23, 2025
by
夏超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[fix] 上推员工数据修改
parent
fd109ef3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
7 deletions
+16
-7
sdddl_project/controllers/inherit_picking.py
+7
-3
sdddl_project/wizard/inherit_result_put_warehose_wizard.py
+5
-2
sdddl_project/wizard/inherit_roke_bom_create_picking_wizard.py
+4
-2
No files found.
sdddl_project/controllers/inherit_picking.py
View file @
6b6faf72
...
@@ -96,10 +96,13 @@ class InheritRokeWorkstationPicking(RokeWorkstationPicking):
...
@@ -96,10 +96,13 @@ class InheritRokeWorkstationPicking(RokeWorkstationPicking):
task_id_list
=
[]
task_id_list
=
[]
task_id_dict
=
{}
task_id_dict
=
{}
# 用户id
user_id
=
http
.
request
.
uid
or
http
.
request
.
session
.
uid
# 人员id
emp
=
http
.
request
.
env
[
'roke.employee'
]
.
search
([(
'user_id'
,
'='
,
user_id
)],
limit
=
1
)
for
v
in
line_data
:
for
v
in
line_data
:
product
=
http
.
request
.
env
[
"roke.product"
]
.
sudo
()
.
search
([(
"id"
,
"="
,
v
.
get
(
"material_id"
,
0
))])
product
=
http
.
request
.
env
[
"roke.product"
]
.
sudo
()
.
search
([(
"id"
,
"="
,
v
.
get
(
"material_id"
,
0
))])
task_id
=
http
.
request
.
env
[
"roke.production.task"
]
.
sudo
()
.
search
([(
"id"
,
"="
,
v
.
get
(
"task_id"
,
0
))])
task_id
=
http
.
request
.
env
[
"roke.production.task"
]
.
sudo
()
.
search
([(
"id"
,
"="
,
v
.
get
(
"task_id"
,
0
))])
_logger
.
info
(
f
"aaaa____________{v.get('demand_qty', 0)}"
)
task_id_list
.
append
({
task_id_list
.
append
({
"material_code"
:
product
.
code
or
""
,
"material_code"
:
product
.
code
or
""
,
"code"
:
task_id
.
code
or
""
,
"code"
:
task_id
.
code
or
""
,
...
@@ -167,13 +170,14 @@ class InheritRokeWorkstationPicking(RokeWorkstationPicking):
...
@@ -167,13 +170,14 @@ class InheritRokeWorkstationPicking(RokeWorkstationPicking):
except
Exception
as
e
:
except
Exception
as
e
:
return
{
"code"
:
1
,
"message"
:
"数据库链接失败,请检查数据库链接参数"
,
"data"
:
None
}
return
{
"code"
:
1
,
"message"
:
"数据库链接失败,请检查数据库链接参数"
,
"data"
:
None
}
sql
=
"""
sql
=
"""
INSERT INTO WBLLD (WBLLD_RWBH, WBLLD_CPBH, WBLLD_XQSL, WBLLD_LLSL, WBLLD_datetime)
INSERT INTO WBLLD (WBLLD_RWBH, WBLLD_CPBH, WBLLD_XQSL, WBLLD_LLSL, WBLLD_datetime
, WBLLD_YGBH, WBLLD_YGMC
)
VALUES
VALUES
"""
"""
sql_list
=
[]
sql_list
=
[]
for
v
in
task_id_list
:
for
v
in
task_id_list
:
sql_list
.
append
(
f
"""
sql_list
.
append
(
f
"""
('{v.get("code", "")}', '{v.get("material_code", "")}', {v.get("demand_qty", 0)}, {v.get("qty", 0)}, '{datetime.datetime.now().strftime("
%
Y-
%
m-
%
d
%
H:
%
M:
%
S")}')
('{v.get("code", "")}', '{v.get("material_code", "")}', {v.get("demand_qty", 0)}, {v.get("qty", 0)},
'{datetime.datetime.now().strftime("
%
Y-
%
m-
%
d
%
H:
%
M:
%
S")}', '{emp.code or ""}', '{emp.name or ""}')
"""
)
"""
)
if
not
sql_list
:
if
not
sql_list
:
return
{
"code"
:
1
,
"message"
:
"数据错误,请检查数据结构"
,
"data"
:
None
}
return
{
"code"
:
1
,
"message"
:
"数据错误,请检查数据结构"
,
"data"
:
None
}
...
...
sdddl_project/wizard/inherit_result_put_warehose_wizard.py
View file @
6b6faf72
...
@@ -51,15 +51,18 @@ class InheritRokeResultPutWarehouseWizard(models.TransientModel):
...
@@ -51,15 +51,18 @@ class InheritRokeResultPutWarehouseWizard(models.TransientModel):
insert_id
=
[]
insert_id
=
[]
for
v
in
rows_data
:
for
v
in
rows_data
:
insert_id
.
append
(
v
.
get
(
"WBCCB_CCID"
,
0
))
insert_id
.
append
(
v
.
get
(
"WBCCB_CCID"
,
0
))
em
=
self
.
env
[
"roke.employee"
]
.
search
([(
"user_id"
,
"="
,
self
.
env
.
uid
)],
limit
=
1
)
insert_sql_data
=
[]
insert_sql_data
=
[]
for
v
in
results
:
for
v
in
results
:
if
v
.
id
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}', '{datetime.datetime.now().strftime("
%
Y-
%
m-
%
d
%
H:
%
M:
%
S")}')
('{v.product_id.code}', '{v.wo_id.code}', {v.qty or 0}, {v.id}, '{v.pt_id.code}', '{v.pt_id.task_type}',
'{datetime.datetime.now().strftime("
%
Y-
%
m-
%
d
%
H:
%
M:
%
S")}', '{em.code or ""}', '{em.name or ""}')
"""
)
"""
)
sql
=
"""
sql
=
"""
INSERT INTO WBCCB (WBCCB_CPBH, WBCCB_GDBH, WBCCB_CCSL, WBCCB_CCID, WBCCB_RWBH, WBCCB_RWLX, WBCCB_datetime)
INSERT INTO WBCCB (WBCCB_CPBH, WBCCB_GDBH, WBCCB_CCSL, WBCCB_CCID, WBCCB_RWBH, WBCCB_RWLX, WBCCB_datetime
, WBCCB_YGBH, WBCCB_YGMC
)
VALUES
VALUES
"""
"""
if
not
insert_sql_data
:
if
not
insert_sql_data
:
...
...
sdddl_project/wizard/inherit_roke_bom_create_picking_wizard.py
View file @
6b6faf72
...
@@ -24,14 +24,16 @@ class InheritRokeBomCreatePickingWizard(models.TransientModel):
...
@@ -24,14 +24,16 @@ class InheritRokeBomCreatePickingWizard(models.TransientModel):
cur
=
conn
.
cursor
()
cur
=
conn
.
cursor
()
except
Exception
as
e
:
except
Exception
as
e
:
raise
ValidationError
(
"数据库链接失败,请检查数据库链接参数"
)
raise
ValidationError
(
"数据库链接失败,请检查数据库链接参数"
)
em
=
self
.
env
[
"roke.employee"
]
.
search
([(
"user_id"
,
"="
,
self
.
env
.
uid
)],
limit
=
1
)
sql
=
"""
sql
=
"""
INSERT INTO WBLLD (WBLLD_RWBH, WBLLD_CPBH, WBLLD_XQSL, WBLLD_LLSL, WBLLD_datetime)
INSERT INTO WBLLD (WBLLD_RWBH, WBLLD_CPBH, WBLLD_XQSL, WBLLD_LLSL, WBLLD_datetime
, WBLLD_YGBH, WBLLD_YGMC
)
VALUES
VALUES
"""
"""
sql_list
=
[]
sql_list
=
[]
for
v
in
self
.
line_ids
:
for
v
in
self
.
line_ids
:
sql_list
.
append
(
f
"""
sql_list
.
append
(
f
"""
('{task_id.code}', '{v.material_id.code}', {v.demand_qty or 0}, {v.qty or 0}, '{datetime.datetime.now().strftime("
%
Y-
%
m-
%
d
%
H:
%
M:
%
S")}')
('{task_id.code}', '{v.material_id.code}', {v.demand_qty or 0}, {v.qty or 0},
'{datetime.datetime.now().strftime("
%
Y-
%
m-
%
d
%
H:
%
M:
%
S")}', '{em.code or ""}', '{em.name or ""}')
"""
)
"""
)
if
not
sql_list
:
if
not
sql_list
:
raise
ValidationError
(
"数据错误"
)
raise
ValidationError
(
"数据错误"
)
...
...
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