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
b8d68039
Commit
b8d68039
authored
Nov 16, 2024
by
夏超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[fix] 修改问题
parent
d7daf909
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
6 deletions
+9
-6
jzjx_project/controllers/roke_work_order.py
+5
-2
jzjx_project/models/inherit_roke_work_order.py
+4
-4
No files found.
jzjx_project/controllers/roke_work_order.py
View file @
b8d68039
...
@@ -53,6 +53,7 @@ class RokeWorkstationWorkOrderModel(http.Controller):
...
@@ -53,6 +53,7 @@ class RokeWorkstationWorkOrderModel(http.Controller):
if
not
work_order_id
:
if
not
work_order_id
:
return
{
"code"
:
1
,
"message"
:
f
"校验错误! 没找到对应的工单。"
,
"data"
:
[]}
return
{
"code"
:
1
,
"message"
:
f
"校验错误! 没找到对应的工单。"
,
"data"
:
[]}
data
=
[]
data
=
[]
work_order_ids
=
work_order
.
task_id
.
work_order_ids
or
work_order
.
task_id
.
work_order_ids
for
v
in
work_order
.
task_id
.
work_order_ids
:
for
v
in
work_order
.
task_id
.
work_order_ids
:
data
.
append
({
data
.
append
({
"id"
:
v
.
process_id
.
id
or
0
,
"id"
:
v
.
process_id
.
id
or
0
,
...
@@ -78,8 +79,10 @@ class RokeWorkstationWorkOrderModel(http.Controller):
...
@@ -78,8 +79,10 @@ class RokeWorkstationWorkOrderModel(http.Controller):
return
{
"code"
:
1
,
"message"
:
f
"校验错误! 没找到对应的报工记录。"
}
return
{
"code"
:
1
,
"message"
:
f
"校验错误! 没找到对应的报工记录。"
}
work_order_ids
=
[]
work_order_ids
=
[]
index
=
1
index
=
1
# qty = 0
for
v
in
process_list
:
for
v
in
process_list
:
plan_qty
=
v
.
get
(
"qty"
,
0
)
plan_qty
=
v
.
get
(
"qty"
,
0
)
# qty = plan_qty if qty == 0 or qty > plan_qty else qty
process_id
=
v
.
get
(
"process_id"
,
0
)
process_id
=
v
.
get
(
"process_id"
,
0
)
work_order_ids
.
append
((
0
,
0
,
{
work_order_ids
.
append
((
0
,
0
,
{
"process_id"
:
process_id
,
"process_id"
:
process_id
,
...
@@ -88,14 +91,14 @@ class RokeWorkstationWorkOrderModel(http.Controller):
...
@@ -88,14 +91,14 @@ class RokeWorkstationWorkOrderModel(http.Controller):
"sequence"
:
index
,
"sequence"
:
index
,
"planned_start_time"
:
work_record
.
work_order_id
.
planned_start_time
,
"planned_start_time"
:
work_record
.
work_order_id
.
planned_start_time
,
"plan_date"
:
work_record
.
work_order_id
.
plan_date
,
"plan_date"
:
work_record
.
work_order_id
.
plan_date
,
"repair_task_id"
:
work_record
.
pt_id
.
id
,
"repair_task_id"
:
work_record
.
pt_id
.
id
or
work_record
.
work_order_id
.
repair_task_id
.
id
,
"replenish_qty"
:
plan_qty
,
"type"
:
"补件"
"type"
:
"补件"
}))
}))
index
+=
1
index
+=
1
for
v
in
work_record
.
scrap_line_ids
:
for
v
in
work_record
.
scrap_line_ids
:
v
.
write
({
v
.
write
({
"scrap_work_order_ids"
:
work_order_ids
,
"scrap_work_order_ids"
:
work_order_ids
,
# "replenish_qty": v.replenish_qty + qty, # 零部件问题: 导致已补数量没法计算
"is_rfe"
:
True
"is_rfe"
:
True
})
})
break
break
...
...
jzjx_project/models/inherit_roke_work_order.py
View file @
b8d68039
...
@@ -6,7 +6,7 @@ class InheritWorkOrder(models.Model):
...
@@ -6,7 +6,7 @@ class InheritWorkOrder(models.Model):
document_ids
=
fields
.
Many2many
(
related
=
"task_id.document_ids"
,
string
=
"作业指导"
)
document_ids
=
fields
.
Many2many
(
related
=
"task_id.document_ids"
,
string
=
"作业指导"
)
task_file_ids
=
fields
.
Many2many
(
related
=
"task_id.file_ids"
)
task_file_ids
=
fields
.
Many2many
(
related
=
"task_id.file_ids"
)
repair_task_id
=
fields
.
Many2one
(
'roke.production.task'
,
string
=
"
返修
上级任务"
)
repair_task_id
=
fields
.
Many2one
(
'roke.production.task'
,
string
=
"上级任务"
)
def
write
(
self
,
vals
):
def
write
(
self
,
vals
):
id_dict
=
{}
id_dict
=
{}
...
@@ -42,11 +42,11 @@ class InheritWorkOrder(models.Model):
...
@@ -42,11 +42,11 @@ class InheritWorkOrder(models.Model):
if
not
self
.
routing_line_id
and
not
judge
:
if
not
self
.
routing_line_id
and
not
judge
:
# 无工艺明细直接返回
# 无工艺明细直接返回
return
1
return
1
if
"切割"
in
self
.
process_id
.
name
:
if
"切割"
in
self
.
process_id
.
name
and
self
.
task_id
:
multiple
=
self
.
task_id
.
spare_parts_qty
/
self
.
task_id
.
plan_qty
multiple
=
self
.
task_id
.
spare_parts_qty
/
self
.
task_id
.
plan_qty
elif
"压铆"
in
self
.
process_id
.
name
:
elif
"压铆"
in
self
.
process_id
.
name
and
self
.
task_id
:
multiple
=
self
.
task_id
.
press_riveting_qty
/
self
.
task_id
.
plan_qty
multiple
=
self
.
task_id
.
press_riveting_qty
/
self
.
task_id
.
plan_qty
elif
"折弯"
in
self
.
process_id
.
name
:
elif
"折弯"
in
self
.
process_id
.
name
and
self
.
task_id
:
multiple
=
self
.
task_id
.
bending_qty
/
self
.
task_id
.
plan_qty
multiple
=
self
.
task_id
.
bending_qty
/
self
.
task_id
.
plan_qty
else
:
else
:
multiple
=
self
.
routing_line_id
.
multiple
multiple
=
self
.
routing_line_id
.
multiple
...
...
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