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
d1fc4c7e
Commit
d1fc4c7e
authored
Feb 20, 2025
by
夏超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[fix] 东联推送添加UUID
parent
bea2ea5c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
5 deletions
+8
-5
sdddl_project/controllers/inherit_picking.py
+4
-3
sdddl_project/wizard/inherit_result_put_warehose_wizard.py
+4
-2
No files found.
sdddl_project/controllers/inherit_picking.py
View file @
d1fc4c7e
import
datetime
import
datetime
import
json
import
json
import
logging
import
logging
import
uuid
from
collections
import
defaultdict
from
collections
import
defaultdict
import
pymssql
import
pymssql
...
@@ -171,13 +171,14 @@ class InheritRokeWorkstationPicking(RokeWorkstationPicking):
...
@@ -171,13 +171,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, WBLLLD_RWLX, WBLLD_CPBH, WBLLD_XQSL, WBLLD_LLSL, WBLLD_datetime, WBLLD_YGBH, WBLLD_YGMC)
INSERT INTO WBLLD (
F_UUID,
WBLLD_RWBH, WBLLLD_RWLX, WBLLD_CPBH, WBLLD_XQSL, WBLLD_LLSL, WBLLD_datetime, WBLLD_YGBH, WBLLD_YGMC)
VALUES
VALUES
"""
"""
sql_list
=
[]
sql_list
=
[]
_uuid
=
uuid
.
uuid1
()
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("task_type", "")}', '{v.get("material_code", "")}', {v.get("demand_qty", 0)}, {v.get("qty", 0)},
('{
_uuid}', '{
v.get("code", "")}', '{v.get("task_type", "")}', '{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 ""}')
'{datetime.datetime.now().strftime("
%
Y-
%
m-
%
d
%
H:
%
M:
%
S")}', '{emp.code or ""}', '{emp.name or ""}')
"""
)
"""
)
if
not
sql_list
:
if
not
sql_list
:
...
...
sdddl_project/wizard/inherit_result_put_warehose_wizard.py
View file @
d1fc4c7e
import
datetime
import
datetime
import
uuid
import
pymssql
import
pymssql
import
logging
import
logging
...
@@ -54,15 +55,16 @@ class InheritRokeResultPutWarehouseWizard(models.TransientModel):
...
@@ -54,15 +55,16 @@ class InheritRokeResultPutWarehouseWizard(models.TransientModel):
em
=
self
.
env
[
"roke.employee"
]
.
search
([(
"user_id"
,
"="
,
self
.
env
.
uid
)],
limit
=
1
)
em
=
self
.
env
[
"roke.employee"
]
.
search
([(
"user_id"
,
"="
,
self
.
env
.
uid
)],
limit
=
1
)
insert_sql_data
=
[]
insert_sql_data
=
[]
_uuid
=
uuid
.
uuid1
()
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}',
(
{_uuid},
'{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 ""}')
'{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, WBCCB_YGBH, WBCCB_YGMC)
INSERT INTO WBCCB (
F_UUID,
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
:
...
...
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