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
b90cb138
Commit
b90cb138
authored
Nov 21, 2024
by
夏超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[fix] 修改问题
parent
5e618c3c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
81 additions
and
1 deletions
+81
-1
jzjx_project/controllers/inherit_product_task.py
+2
-0
jzjx_project/controllers/roke_work_order.py
+79
-1
No files found.
jzjx_project/controllers/inherit_product_task.py
View file @
b90cb138
...
@@ -33,6 +33,8 @@ class JzjxInheritRokeWorkstationProductionTask(RokeWorkstationProductionTask):
...
@@ -33,6 +33,8 @@ class JzjxInheritRokeWorkstationProductionTask(RokeWorkstationProductionTask):
[(
'workstation_ids'
,
'='
,
workstation_id
)])
[(
'workstation_ids'
,
'='
,
workstation_id
)])
# process_list = list(set(process_ids.ids) & set(user_id.process_ids.ids))
# process_list = list(set(process_ids.ids) & set(user_id.process_ids.ids))
process_list
=
process_ids
.
ids
process_list
=
process_ids
.
ids
if
not
process_ids
:
return
{
"code"
:
0
,
"message"
:
"获取成功!"
,
"data"
:
[],
"process_ids"
:
[],
"count"
:
0
}
domain
=
[
domain
=
[
(
"task_id.workshop_id"
,
"="
,
workstation
.
workshop_id
.
id
),
(
"task_id.workshop_id"
,
"="
,
workstation
.
workshop_id
.
id
),
(
"process_id"
,
"in"
,
process_list
),
(
"process_id"
,
"in"
,
process_list
),
...
...
jzjx_project/controllers/roke_work_order.py
View file @
b90cb138
...
@@ -32,10 +32,88 @@ class RokeWorkstationWorkOrderModel(http.Controller):
...
@@ -32,10 +32,88 @@ class RokeWorkstationWorkOrderModel(http.Controller):
html
=
template
.
render
(
values
)
html
=
template
.
render
(
values
)
return
html
return
html
@http.route
(
'/roke/workstation/craft_design/workstation_bom/get'
,
type
=
'json'
,
auth
=
'user'
,
csrf
=
False
,
cors
=
"*"
)
def
workstation_bom_get
(
self
):
"""
获取工艺明细的关键物料
"""
_self
=
http
.
request
routing_line_id
=
_self
.
jsonrequest
.
get
(
"routing_line_id"
,
0
)
p_bom_line
=
_self
.
env
[
"roke.mes.p_bom.line"
]
.
search
([(
"routing_line_id"
,
"="
,
routing_line_id
)],
order
=
"create_date desc"
)
bom_list
=
[]
for
v
in
p_bom_line
:
bom_list
.
append
({
"id"
:
v
.
id
,
"product_id"
:
v
.
product_id
.
id
,
"product_name"
:
v
.
product_id
.
name
,
"qty"
:
v
.
qty
,
"must"
:
v
.
must
})
return
{
"code"
:
0
,
"message"
:
f
"获取成功!"
,
"data"
:
bom_list
}
@http.route
(
'/roke/workstation/craft_design/workstation_bom/create'
,
type
=
'json'
,
auth
=
'user'
,
csrf
=
False
,
cors
=
"*"
)
def
workstation_bom_create
(
self
):
"""
创建工艺明细的关键物料
"""
_self
=
http
.
request
routing_line_id
=
_self
.
jsonrequest
.
get
(
"routing_line_id"
,
0
)
product_id
=
_self
.
jsonrequest
.
get
(
"product_id"
,
0
)
qty
=
_self
.
jsonrequest
.
get
(
"qty"
,
0
)
must
=
_self
.
jsonrequest
.
get
(
"must"
,
False
)
product
=
_self
.
env
[
"roke.product"
]
.
search
([(
"id"
,
"="
,
product_id
)])
if
not
product
:
return
{
"code"
:
1
,
"message"
:
"没找到对应的产品!"
}
_self
.
env
[
"roke.mes.p_bom.line"
]
.
create
({
"product_id"
:
product
.
id
,
"product_routing_id"
:
product
.
routing_id
.
id
,
"routing_line_id"
:
routing_line_id
,
"qty"
:
qty
,
"must"
:
must
})
return
{
"code"
:
0
,
"message"
:
f
"获取成功!"
}
@http.route
(
"/roke/workstation/craft_design/workstation_bom/update"
,
type
=
'json'
,
auth
=
"user"
,
cors
=
'*'
,
csrf
=
False
)
def
workstation_bom_update
(
self
,
**
kwargs
):
"""
修改工艺明细的关键物料
"""
_self
=
http
.
request
bom_info
=
_self
.
jsonrequest
.
get
(
"bom_info"
,
[])
p_bom_line
=
_self
.
env
[
"roke.mes.p_bom.line"
]
for
item
in
bom_info
:
bom_id
=
item
.
get
(
"id"
,
0
)
product_id
=
item
.
get
(
"product_id"
,
0
)
product
=
_self
.
env
[
"roke.product"
]
.
search
([(
"id"
,
"="
,
product_id
)])
qty
=
item
.
get
(
"qty"
,
0
)
must
=
item
.
get
(
"must"
,
False
)
p_bom_line_id
=
p_bom_line
.
sudo
()
.
search
([(
"id"
,
"="
,
bom_id
)])
p_bom_line_id
.
write
({
"product_id"
:
product
.
id
,
"product_routing_id"
:
product
.
routing_id
.
id
,
"qty"
:
qty
,
"must"
:
must
})
return
{
"code"
:
0
,
"message"
:
"更新成功"
}
@http.route
(
"/roke/workstation/craft_design/workstation_bom/delete"
,
type
=
'json'
,
auth
=
"user"
,
cors
=
'*'
,
csrf
=
False
)
def
workstation_bom_delete
(
self
,
**
kwargs
):
"""
删除工艺明细的关键物料
"""
_self
=
http
.
request
bom_id
=
_self
.
jsonrequest
.
get
(
"id"
,
0
)
_self
.
env
[
"roke.mes.p_bom.line"
]
.
search
([(
"id"
,
"="
,
bom_id
)])
.
unlink
()
return
{
"code"
:
0
,
"message"
:
"删除成功"
}
@http.route
(
'/roke/workstation/craft_design/workstation_product/get'
,
type
=
'json'
,
auth
=
'user'
,
csrf
=
False
,
cors
=
"*"
)
@http.route
(
'/roke/workstation/craft_design/workstation_product/get'
,
type
=
'json'
,
auth
=
'user'
,
csrf
=
False
,
cors
=
"*"
)
def
workstation_product_get
(
self
):
def
workstation_product_get
(
self
):
"""
"""
获取
工单的不良报工记录
获取
产品的数据,格式和工艺设计树一样
"""
"""
_self
=
http
.
request
_self
=
http
.
request
product_id
=
_self
.
jsonrequest
.
get
(
"product_id"
,
0
)
product_id
=
_self
.
jsonrequest
.
get
(
"product_id"
,
0
)
...
...
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