Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
mes
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ximai
mes
Commits
779bbc8d
Commit
779bbc8d
authored
Jan 14, 2025
by
温志超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新生产排产BUG
parent
f5e76a8f
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
131 additions
and
2 deletions
+131
-2
ProTaskWorkunitController.java
...ai/mes/pro/controller/task/ProTaskWorkunitController.java
+8
-0
ProTaskMapper.java
...ain/java/com/ximai/mes/pro/mapper/task/ProTaskMapper.java
+1
-0
ProTaskWorkunitMapper.java
.../com/ximai/mes/pro/mapper/task/ProTaskWorkunitMapper.java
+1
-1
ProTaskWorkunitServiceImpl.java
...mes/pro/service/impl/task/ProTaskWorkunitServiceImpl.java
+55
-0
IProTaskWorkunitService.java
...m/ximai/mes/pro/service/task/IProTaskWorkunitService.java
+2
-0
ProTaskMapper.xml
mes/src/main/resources/mapper/pro/task/ProTaskMapper.xml
+64
-1
No files found.
mes/src/main/java/com/ximai/mes/pro/controller/task/ProTaskWorkunitController.java
View file @
779bbc8d
...
@@ -159,4 +159,12 @@ public class ProTaskWorkunitController extends BaseController {
...
@@ -159,4 +159,12 @@ public class ProTaskWorkunitController extends BaseController {
return
AjaxResult
.
success
(
"获取成功"
,
printData
);
return
AjaxResult
.
success
(
"获取成功"
,
printData
);
}
}
@ApiOperation
(
"获取工序打印日记"
)
@Log
(
title
=
"获取工序打印日记"
,
businessType
=
BusinessType
.
UPDATE
)
@PostMapping
(
value
=
"/printDataBySpil"
)
public
AjaxResult
printDataBySpil
(
@RequestBody
Long
taskWorkunitId
)
{
Map
<
String
,
Object
>
printData
=
proTaskWorkunitService
.
printDataBySpil
(
taskWorkunitId
);
return
AjaxResult
.
success
(
"获取成功"
,
printData
);
}
}
}
mes/src/main/java/com/ximai/mes/pro/mapper/task/ProTaskMapper.java
View file @
779bbc8d
...
@@ -196,6 +196,7 @@ public interface ProTaskMapper extends BaseMapper<ProTask> {
...
@@ -196,6 +196,7 @@ public interface ProTaskMapper extends BaseMapper<ProTask> {
List
<
ProTask
>
selectByTaskIds
(
@Param
(
"taskIds"
)
List
<
Long
>
taskIds
);
List
<
ProTask
>
selectByTaskIds
(
@Param
(
"taskIds"
)
List
<
Long
>
taskIds
);
List
<
ProTask
>
selectByTaskBatch
(
@Param
(
"taskBatch"
)
String
taskBatch
);
List
<
ProTask
>
selectByTaskBatch
(
@Param
(
"taskBatch"
)
String
taskBatch
);
List
<
ProTask
>
selectByTaskWorkunitId
(
@Param
(
"taskWorkunitId"
)
Long
taskWorkunitId
);
void
deleteByTaskBatch
(
@Param
(
"taskBatch"
)
String
taskBatch
);
void
deleteByTaskBatch
(
@Param
(
"taskBatch"
)
String
taskBatch
);
...
...
mes/src/main/java/com/ximai/mes/pro/mapper/task/ProTaskWorkunitMapper.java
View file @
779bbc8d
...
@@ -153,7 +153,7 @@ public interface ProTaskWorkunitMapper extends BaseMapper<ProTaskWorkunit> {
...
@@ -153,7 +153,7 @@ public interface ProTaskWorkunitMapper extends BaseMapper<ProTaskWorkunit> {
"\t, t.duration, ptw.schedule_end_date, t.color_code, t.request_date\n"
+
"\t, t.duration, ptw.schedule_end_date, t.color_code, t.request_date\n"
+
"\t, t.attr1, t.attr2, t.attr3, t.attr4\n"
+
"\t, t.attr1, t.attr2, t.attr3, t.attr4\n"
+
"\t, t.create_time, t.update_by, t.update_time, ptw.STATUS, ptw.quantity_qualify, ptw.remark\n"
+
"\t, t.create_time, t.update_by, t.update_time, ptw.STATUS, ptw.quantity_qualify, ptw.remark\n"
+
"\t, ptw.quantity_unqualify, ptw.outsource_unit_price,ptw.outsourced, ptw.vendor_id,ptw.vendor_name, mw.workunit_id, mw.workunit_code, mw.workunit_name, ptw.std_working_time,ptw.std_working_time_uom, wo.workorder_code\n"
+
"\t,
ptw.source_task_workunit_id,
ptw.quantity_unqualify, ptw.outsource_unit_price,ptw.outsourced, ptw.vendor_id,ptw.vendor_name, mw.workunit_id, mw.workunit_code, mw.workunit_name, ptw.std_working_time,ptw.std_working_time_uom, wo.workorder_code\n"
+
"\t, (case ptw.STATUS when 'BEGINNING' then 1 when 'PREPARE' then 2 when 'PAUSE' then 3 when 'ERROR_STOP' then 4 end) statusIndex\n"
+
"\t, (case ptw.STATUS when 'BEGINNING' then 1 when 'PREPARE' then 2 when 'PAUSE' then 3 when 'ERROR_STOP' then 4 end) statusIndex\n"
+
"from pro_task_workunit ptw\n"
+
"from pro_task_workunit ptw\n"
+
"\tleft join pro_task t on ptw.task_id = t.task_id\n"
+
"\tleft join pro_task t on ptw.task_id = t.task_id\n"
+
...
...
mes/src/main/java/com/ximai/mes/pro/service/impl/task/ProTaskWorkunitServiceImpl.java
View file @
779bbc8d
...
@@ -637,4 +637,59 @@ public class ProTaskWorkunitServiceImpl implements IProTaskWorkunitService {
...
@@ -637,4 +637,59 @@ public class ProTaskWorkunitServiceImpl implements IProTaskWorkunitService {
return
null
;
return
null
;
}
}
}
}
@Override
public
Map
<
String
,
Object
>
printDataBySpil
(
Long
taskWorkunitId
)
{
Map
<
String
,
Object
>
printData
=
new
HashMap
<>();
ArrayList
valueList
=
new
ArrayList
();
printData
.
put
(
"reportName"
,
"process.xml"
);
List
<
MdFactory
>
mdFactorys
=
mdFactoryMapper
.
selectLikeByName
(
"上海希迈机电"
);
if
(
mdFactorys
.
size
()
>
0
){
printData
.
put
(
"reportName"
,
"process-cn.xml"
);
}
printData
.
put
(
"valueList"
,
valueList
);
int
i
=
1
;
SimpleDateFormat
simpleDateFormat1
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
//for (String taskBatch : taskBatchs){
List
<
ProTask
>
taskBatchTasks
=
proTaskMapper
.
selectByTaskWorkunitId
(
taskWorkunitId
);
String
[]
sp
=
taskBatchTasks
.
get
(
0
).
getTaskBatch
().
split
(
"-"
);
if
(
taskBatchTasks
.
size
()
>
0
){
List
<
TaskProPrintData
>
taskProPrintDatas
=
new
ArrayList
<>();
Map
<
String
,
Object
>
value
=
new
HashMap
<>();
valueList
.
add
(
value
);
ProWorkorder
proWorkorder
=
proWorkorderMapper
.
selectProWorkorderWorderCode
(
taskBatchTasks
.
get
(
0
).
getArrangeCode
());
TaskProWorkorderPrintData
taskProWorkorderPrintData
=
new
TaskProWorkorderPrintData
();
BeanUtil
.
copyProperties
(
proWorkorder
,
taskProWorkorderPrintData
);
taskProWorkorderPrintData
.
setWorkorderType
(
dictDataService
.
getDictLabel
(
"mes_workorder_type"
,
taskProWorkorderPrintData
.
getWorkorderType
()));
taskProWorkorderPrintData
.
setTaskBatch
(
sp
[
sp
.
length
-
1
]);
value
.
put
(
"header"
,
taskProWorkorderPrintData
);
value
.
put
(
"detail"
,
taskProPrintDatas
);
Date
over
=
null
;
if
(
taskProWorkorderPrintData
.
getExpectStartDate
()
!=
null
||
taskProWorkorderPrintData
.
getRequestDate
()
!=
null
){
for
(
ProTask
proTask
:
taskBatchTasks
){
TaskProPrintData
taskProPrintData
=
new
TaskProPrintData
();
BeanUtil
.
copyProperties
(
proTask
,
taskProPrintData
);
String
begin
=
taskProWorkorderPrintData
.
getExpectStartDate
()
!=
null
?
simpleDateFormat1
.
format
(
taskProWorkorderPrintData
.
getExpectStartDate
())
:
"空"
;
String
end
=
taskProWorkorderPrintData
.
getRequestDate
()
!=
null
?
simpleDateFormat1
.
format
(
taskProWorkorderPrintData
.
getRequestDate
())
:
"空"
;
taskProPrintData
.
setExpectStartDateString
(
begin
);
taskProPrintData
.
setRequestDateString
(
end
);
taskProPrintDatas
.
add
(
taskProPrintData
);
if
(
proTask
.
getScheduleEndDate
()
!=
null
){
if
(
over
==
null
||
over
.
getTime
()
<
proTask
.
getScheduleEndDate
().
getTime
())
{
over
=
proTask
.
getScheduleEndDate
();
}
}
}
}
if
(
over
!=
null
){
taskProWorkorderPrintData
.
setRequestDate
(
over
);
}
taskProWorkorderPrintData
.
setSize
(
i
++);
taskProWorkorderPrintData
.
setDate
(
simpleDateFormat1
.
format
(
new
Date
()));
taskProWorkorderPrintData
.
setQuantity
(
taskBatchTasks
.
get
(
0
).
getQuantity
());
//}
}
return
printData
;
}
}
}
mes/src/main/java/com/ximai/mes/pro/service/task/IProTaskWorkunitService.java
View file @
779bbc8d
...
@@ -181,4 +181,6 @@ public interface IProTaskWorkunitService {
...
@@ -181,4 +181,6 @@ public interface IProTaskWorkunitService {
void
outsourceConfirm
(
ProTaskWorkunit
taskWorkunit
);
void
outsourceConfirm
(
ProTaskWorkunit
taskWorkunit
);
Map
<
String
,
Object
>
printData
(
List
<
Long
>
taskIds
);
Map
<
String
,
Object
>
printData
(
List
<
Long
>
taskIds
);
Map
<
String
,
Object
>
printDataBySpil
(
Long
taskWorkunitId
);
}
}
mes/src/main/resources/mapper/pro/task/ProTaskMapper.xml
View file @
779bbc8d
...
@@ -345,6 +345,68 @@
...
@@ -345,6 +345,68 @@
</foreach>
</foreach>
</where>
</where>
</select>
</select>
<select
id=
"selectByTaskWorkunitId"
resultType=
"com.ximai.mes.pro.domain.task.ProTask"
>
SELECT ptw.task_workunit_id,
t.task_id,
t.task_code,
t.task_name,
t.workstation_id,
ws.workstation_code,
ws.workstation_name,
t.process_id,
t.arrange_code,
p.process_code,
p.process_name,
p.remark as processRemark,
t.item_id,
i.item_code,
i.item_name,
t.specification,
t.client_id,
t.client_code,
t.client_name,
t.client_nick,
t.start_time,
t.duration,
t.end_time,
t.color_code,
t.request_date,
t.remark,
t.attr1,
t.attr2,
t.attr3,
t.attr4,
t.create_by,
t.create_time,
t.update_by,
t.update_time,
t.idx,
t.task_batch,
ptw.task_workunit_id,
ptw.quantity,
ptw.quantity_produced,
ptw.quantity_changed,
ptw.quantity_qualify,
ptw.unit_of_measure,
ptw.STATUS,
mw.workunit_name workunit_name,
mw.workunit_id workunit_id,
mw.workunit_code workunit_code,
ptw.quantity_unqualify,
ptw.schedule_end_date,
ptw.schedule_start_date
FROM pro_task_workunit ptw
LEFT JOIN pro_task t ON t.task_id = ptw.task_id
LEFT JOIN pro_process p ON t.process_id = p.process_id
LEFT JOIN md_item i ON t.item_id = i.item_id
LEFT JOIN md_workunit mw ON ptw.workunit_id = mw.workunit_id
LEFT JOIN md_workstation ws ON t.workstation_id = ws.workstation_id
<where>
ptw.task_workunit_id = #{taskWorkunitId}
</where>
order by t.idx
</select>
<select
id=
"selectByTaskBatch"
resultType=
"com.ximai.mes.pro.domain.task.ProTask"
>
<select
id=
"selectByTaskBatch"
resultType=
"com.ximai.mes.pro.domain.task.ProTask"
>
SELECT ptw.task_workunit_id,
SELECT ptw.task_workunit_id,
t.task_id,
t.task_id,
...
@@ -403,8 +465,9 @@
...
@@ -403,8 +465,9 @@
<where>
<where>
t.task_batch = #{taskBatch}
t.task_batch = #{taskBatch}
</where>
</where>
order by t.idx
order by t.idx
</select>
</select>
<select
id=
"getProcessList"
<select
id=
"getProcessList"
resultType=
"com.ximai.mes.report.response.WorkOrderProgressProcessListResponse"
>
resultType=
"com.ximai.mes.report.response.WorkOrderProgressProcessListResponse"
>
select * from pro_task where arrange_code = #{workorderCode} order by task_id
select * from pro_task where arrange_code = #{workorderCode} order by task_id
...
...
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