Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
HYH.APSJ
Project
Project
Details
Activity
Releases
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
佟礼
HYH.APSJ
Commits
0b51cb1f
Commit
0b51cb1f
authored
Feb 05, 2026
by
DESKTOP-VKRD9QF\Administration
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
工单增加工艺信息
parent
f0abbd39
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
160 additions
and
16 deletions
+160
-16
ResourceGanttController.java
...ava/com/aps/controller/gantt/ResourceGanttController.java
+130
-0
MaterialInfo.java
src/main/java/com/aps/entity/MaterialInfo.java
+1
-1
ProdProcessExec.java
src/main/java/com/aps/entity/ProdProcessExec.java
+2
-0
MaterialRequirementService.java
...com/aps/service/Algorithm/MaterialRequirementService.java
+2
-1
MaterialRequirementServicebf.java
...m/aps/service/Algorithm/MaterialRequirementServicebf.java
+2
-1
RoutingDataService.java
...in/java/com/aps/service/Algorithm/RoutingDataService.java
+2
-0
LanuchService.java
src/main/java/com/aps/service/LanuchService.java
+1
-1
LanuchServiceImpl.java
src/main/java/com/aps/service/impl/LanuchServiceImpl.java
+20
-12
No files found.
src/main/java/com/aps/controller/gantt/ResourceGanttController.java
View file @
0b51cb1f
...
@@ -11,6 +11,8 @@ import com.aps.entity.Gantt.ResourceGanttVO;
...
@@ -11,6 +11,8 @@ import com.aps.entity.Gantt.ResourceGanttVO;
import
com.aps.entity.Gantt.SupplyRelationResponse
;
import
com.aps.entity.Gantt.SupplyRelationResponse
;
import
com.aps.entity.Gantt.TaskVO
;
import
com.aps.entity.Gantt.TaskVO
;
import
com.aps.entity.basic.*
;
import
com.aps.entity.basic.*
;
import
com.aps.entity.common.Paged
;
import
com.aps.entity.common.ConditionEntity
;
import
com.aps.service.plan.PlanResultService
;
import
com.aps.service.plan.PlanResultService
;
import
com.aps.service.plan.PlanSchedulerService
;
import
com.aps.service.plan.PlanSchedulerService
;
import
com.aps.service.plan.SceneService
;
import
com.aps.service.plan.SceneService
;
...
@@ -24,6 +26,7 @@ import org.springframework.web.bind.annotation.*;
...
@@ -24,6 +26,7 @@ import org.springframework.web.bind.annotation.*;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -699,6 +702,82 @@ public class ResourceGanttController {
...
@@ -699,6 +702,82 @@ public class ResourceGanttController {
return
R
.
ok
(
resourceGanttVOList
);
return
R
.
ok
(
resourceGanttVOList
);
}
}
@PostMapping
(
"/getResourceGantt/page"
)
@Operation
(
summary
=
"获取资源甘特图分页数据"
,
description
=
"获取资源甘特图分页数据,设备全部返回,工单需要分页并按时间顺序排序"
)
public
R
<
Map
<
String
,
Object
>>
getResourceGanttPage
(
@RequestBody
Paged
paged
)
{
// 从Paged对象中获取sceneId
String
sceneId
=
null
;
ConditionEntity
sceneIdCondition
=
paged
.
getCondition
(
"sceneId"
);
if
(
sceneIdCondition
!=
null
)
{
sceneId
=
sceneIdCondition
.
getFieldValue
();
}
// 校验参数
if
(
sceneId
==
null
||
sceneId
.
isEmpty
())
{
throw
new
IllegalArgumentException
(
"场景ID不能为空"
);
}
// 获取分页参数
Integer
pageindex
=
paged
.
getPageIndex
();
Integer
pagesize
=
paged
.
getPageSize
();
// 校验能否获取对应的文件
Chromosome
schedule
=
sceneService
.
loadChromosomeFromFile
(
sceneId
);
if
(
schedule
==
null
)
{
throw
new
RuntimeException
(
"未找到对应的场景文件"
);
}
List
<
Machine
>
machineList
=
planResultService
.
InitCalendarToAllMachines2
(
sceneId
);
// 转换为 ResourceGanttVO 格式
List
<
ResourceGanttVO
>
resourceGanttVOList
=
new
ArrayList
<>();
List
<
ResourceGanttVO
>
resourceGanttVOs
=
planResultService
.
convertToResourceGanttVO1
(
schedule
,
machineList
);
resourceGanttVOList
.
addAll
(
resourceGanttVOs
);
// 分离设备和工单数据
List
<
ResourceGanttVO
>
equipmentList
=
new
ArrayList
<>();
List
<
TaskVO
>
orderList
=
new
ArrayList
<>();
for
(
ResourceGanttVO
resourceGanttVO
:
resourceGanttVOList
)
{
equipmentList
.
add
(
resourceGanttVO
);
// 收集所有工单数据
if
(
resourceGanttVO
.
getList
()
!=
null
&&
!
resourceGanttVO
.
getList
().
isEmpty
())
{
orderList
.
addAll
(
resourceGanttVO
.
getList
());
}
}
// 工单按开始时间排序(时间早的在前)
orderList
.
sort
((
o1
,
o2
)
->
{
if
(
o1
.
getStart
()
==
null
)
return
1
;
if
(
o2
.
getStart
()
==
null
)
return
-
1
;
return
o1
.
getStart
().
compareTo
(
o2
.
getStart
());
});
// 计算工单总数
int
totalOrders
=
orderList
.
size
();
// 执行工单分页
int
startIndex
=
(
pageindex
-
1
)
*
pagesize
;
int
endIndex
=
Math
.
min
(
startIndex
+
pagesize
,
totalOrders
);
List
<
TaskVO
>
pageOrders
;
if
(
startIndex
<
totalOrders
)
{
pageOrders
=
orderList
.
subList
(
startIndex
,
endIndex
);
}
else
{
pageOrders
=
new
ArrayList
<>();
}
// 构建返回结果
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
result
.
put
(
"equipment"
,
equipmentList
);
// 设备全部返回
result
.
put
(
"orders"
,
pageOrders
);
// 工单分页返回
result
.
put
(
"totalOrders"
,
totalOrders
);
// 工单总数
result
.
put
(
"pageindex"
,
pageindex
);
// 当前页码
result
.
put
(
"pagesize"
,
pagesize
);
// 每页大小
System
.
out
.
println
(
"完成资源甘特图分页请求"
);
return
R
.
ok
(
result
);
}
...
@@ -727,6 +806,57 @@ public class ResourceGanttController {
...
@@ -727,6 +806,57 @@ public class ResourceGanttController {
return
R
.
ok
(
productGanttVOList
);
return
R
.
ok
(
productGanttVOList
);
}
}
@PostMapping
(
"/getProductGantt/page"
)
@Operation
(
summary
=
"获取工单分页数据"
,
description
=
"获取工单分页数据,pagesize为每页工单个数,pageindex为当前页码"
)
public
R
<
Map
<
String
,
Object
>>
getProductGanttPage
(
@RequestBody
Paged
paged
)
{
// 从Paged对象中获取sceneId
String
sceneId
=
null
;
ConditionEntity
sceneIdCondition
=
paged
.
getCondition
(
"sceneId"
);
if
(
sceneIdCondition
!=
null
)
{
sceneId
=
sceneIdCondition
.
getFieldValue
();
}
// 校验参数
if
(
sceneId
==
null
||
sceneId
.
isEmpty
())
{
throw
new
IllegalArgumentException
(
"场景ID不能为空"
);
}
// 获取分页参数
Integer
pageindex
=
paged
.
getPageIndex
();
Integer
pagesize
=
paged
.
getPageSize
();
// 校验能否获取对应的文件
Chromosome
schedule
=
sceneService
.
loadChromosomeFromFile
(
sceneId
);
if
(
schedule
==
null
)
{
throw
new
RuntimeException
(
"未找到对应的场景文件"
);
}
// 转换为 ProductGanttVO 格式
List
<
ProductGanttVO
>
productGanttVOs
=
planResultService
.
convertToProductGanttVO1
(
schedule
);
// 计算总记录数
int
total
=
productGanttVOs
.
size
();
// 计算分页参数
int
startIndex
=
(
pageindex
-
1
)
*
pagesize
;
int
endIndex
=
Math
.
min
(
startIndex
+
pagesize
,
total
);
// 执行分页
List
<
ProductGanttVO
>
pageData
=
new
ArrayList
<>();
if
(
startIndex
<
total
)
{
pageData
=
productGanttVOs
.
subList
(
startIndex
,
endIndex
);
}
// 构建返回结果
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
result
.
put
(
"total"
,
total
);
result
.
put
(
"pageindex"
,
pageindex
);
result
.
put
(
"pagesize"
,
pagesize
);
result
.
put
(
"data"
,
pageData
);
return
R
.
ok
(
result
);
}
/**
/**
...
...
src/main/java/com/aps/entity/MaterialInfo.java
View file @
0b51cb1f
...
@@ -86,7 +86,7 @@ public class MaterialInfo implements Serializable {
...
@@ -86,7 +86,7 @@ public class MaterialInfo implements Serializable {
private
Long
inspectDuration
;
private
Long
inspectDuration
;
private
int
purchaseDuration
;
private
Integer
purchaseDuration
;
private
String
firstLot
;
private
String
firstLot
;
...
...
src/main/java/com/aps/entity/ProdProcessExec.java
View file @
0b51cb1f
...
@@ -102,6 +102,8 @@ public class ProdProcessExec {
...
@@ -102,6 +102,8 @@ public class ProdProcessExec {
private
String
routingCode
;
private
String
routingCode
;
private
String
routingName
;
/** 部门ID,来自工艺路线 routing_header.department_id,新增场景时在 createProcessExec 中赋值 */
/** 部门ID,来自工艺路线 routing_header.department_id,新增场景时在 createProcessExec 中赋值 */
private
Integer
departmentId
;
private
Integer
departmentId
;
...
...
src/main/java/com/aps/service/Algorithm/MaterialRequirementService.java
View file @
0b51cb1f
...
@@ -722,8 +722,9 @@ if(headers1==null)
...
@@ -722,8 +722,9 @@ if(headers1==null)
List
<
RoutingDetailEquip
>
finalRoutingDetailEquips
=
routingDetailEquips
;
List
<
RoutingDetailEquip
>
finalRoutingDetailEquips
=
routingDetailEquips
;
Integer
departmentId
=
headers1
.
getDepartmentId
()
!=
null
?
headers1
.
getDepartmentId
()
:
null
;
Integer
departmentId
=
headers1
.
getDepartmentId
()
!=
null
?
headers1
.
getDepartmentId
()
:
null
;
List
<
ProdProcessExec
>
processExecList
=
RoutingDetails
.
stream
()
List
<
ProdProcessExec
>
processExecList
=
RoutingDetails
.
stream
()
.
map
(
detail
->
lanuchService
.
createProcessExec
(
prodOrderMain
,
detail
,
sceneId
,
finalRoutingDetailEquips
,
departmentId
))
.
map
(
detail
->
lanuchService
.
createProcessExec
(
prodOrderMain
,
detail
,
sceneId
,
finalRoutingDetailEquips
,
headers1
))
.
collect
(
Collectors
.
toList
());
.
collect
(
Collectors
.
toList
());
List
<
Equipinfo
>
equipinfoList
=
GetEquipinfos
();
List
<
Equipinfo
>
equipinfoList
=
GetEquipinfos
();
...
...
src/main/java/com/aps/service/Algorithm/MaterialRequirementServicebf.java
View file @
0b51cb1f
...
@@ -609,8 +609,9 @@ public class MaterialRequirementServicebf {
...
@@ -609,8 +609,9 @@ public class MaterialRequirementServicebf {
ProdLaunchOrder
prodOrderMain
=
convertToLaunchOrder
(
order
,
""
);
ProdLaunchOrder
prodOrderMain
=
convertToLaunchOrder
(
order
,
""
);
List
<
RoutingDetailEquip
>
finalRoutingDetailEquips
=
routingDetailEquips
;
List
<
RoutingDetailEquip
>
finalRoutingDetailEquips
=
routingDetailEquips
;
RoutingHeader
finalHeaders
=
headers1
;
List
<
ProdProcessExec
>
processExecList
=
RoutingDetails
.
stream
()
List
<
ProdProcessExec
>
processExecList
=
RoutingDetails
.
stream
()
.
map
(
detail
->
lanuchService
.
createProcessExec
(
prodOrderMain
,
detail
,
sceneId
,
finalRoutingDetailEquips
,
0
))
.
map
(
detail
->
lanuchService
.
createProcessExec
(
prodOrderMain
,
detail
,
sceneId
,
finalRoutingDetailEquips
,
finalHeaders
))
.
collect
(
Collectors
.
toList
());
.
collect
(
Collectors
.
toList
());
List
<
Equipinfo
>
equipinfoList
=
equipinfoService
.
lambdaQuery
().
eq
(
Equipinfo:
:
getIsdeleted
,
0
).
list
();
List
<
Equipinfo
>
equipinfoList
=
equipinfoService
.
lambdaQuery
().
eq
(
Equipinfo:
:
getIsdeleted
,
0
).
list
();
List
<
ProdEquipment
>
ProdEquipmentList
=
lanuchService
.
batchInsertEquipMent
(
routingDetailEquips
,
sceneId
,
processExecList
,
false
,
equipinfoList
);
List
<
ProdEquipment
>
ProdEquipmentList
=
lanuchService
.
batchInsertEquipMent
(
routingDetailEquips
,
sceneId
,
processExecList
,
false
,
equipinfoList
);
...
...
src/main/java/com/aps/service/Algorithm/RoutingDataService.java
View file @
0b51cb1f
...
@@ -214,6 +214,8 @@ public class RoutingDataService {
...
@@ -214,6 +214,8 @@ public class RoutingDataService {
entry
.
setOrderCode
(
op
.
getOrderCode
());
entry
.
setOrderCode
(
op
.
getOrderCode
());
entry
.
setQuantity
(
op
.
getPlanQty
());
entry
.
setQuantity
(
op
.
getPlanQty
());
entry
.
setRoutingId
(
op
.
getRoutingId
());
entry
.
setRoutingId
(
op
.
getRoutingId
());
entry
.
setRoutingCode
(
op
.
getRoutingCode
());
entry
.
setRoutingName
(
op
.
getRoutingName
());
entry
.
setRoutingDetailId
(
op
.
getRoutingDetailId
());
entry
.
setRoutingDetailId
(
op
.
getRoutingDetailId
());
entry
.
setTaskSeq
(
op
.
getTaskSeq
());
entry
.
setTaskSeq
(
op
.
getTaskSeq
());
entry
.
setRoutingDetailName
(
op
.
getRoutingDetailName
());
entry
.
setRoutingDetailName
(
op
.
getRoutingDetailName
());
...
...
src/main/java/com/aps/service/LanuchService.java
View file @
0b51cb1f
...
@@ -47,7 +47,7 @@ public interface LanuchService {
...
@@ -47,7 +47,7 @@ public interface LanuchService {
ProdProcessExec
createProcessExec
(
ProdLaunchOrder
prodOrderMain
,
ProdProcessExec
createProcessExec
(
ProdLaunchOrder
prodOrderMain
,
RoutingDetail
detail
,
RoutingDetail
detail
,
String
sceneId
,
List
<
RoutingDetailEquip
>
routingDetailEquip
,
String
sceneId
,
List
<
RoutingDetailEquip
>
routingDetailEquip
,
Integer
departmentId
);
RoutingHeader
routingHeader
);
List
<
ProdEquipment
>
batchInsertEquipMent
(
List
<
ProdEquipment
>
batchInsertEquipMent
(
List
<
RoutingDetailEquip
>
routingDetailEquips
,
List
<
RoutingDetailEquip
>
routingDetailEquips
,
...
...
src/main/java/com/aps/service/impl/LanuchServiceImpl.java
View file @
0b51cb1f
...
@@ -627,8 +627,8 @@ public class LanuchServiceImpl implements LanuchService {
...
@@ -627,8 +627,8 @@ public class LanuchServiceImpl implements LanuchService {
List
<
RoutingDetailEquip
>
routingDetailEquip
=
getRoutingDetailEquip
(
routingHeader
.
getId
(),
routingHeader
.
getCode
());
List
<
RoutingDetailEquip
>
routingDetailEquip
=
getRoutingDetailEquip
(
routingHeader
.
getId
(),
routingHeader
.
getCode
());
// 批量插入新的工序工单记录(部门ID从工艺头带出)
// 批量插入新的工序工单记录(部门ID从工艺头带出)
Integer
departmentId
=
routingHeader
.
getDepartmentId
()
!=
null
?
routingHeader
.
getDepartmentId
()
:
null
;
//
Integer departmentId = routingHeader.getDepartmentId() != null ? routingHeader.getDepartmentId() : null;
batchInsertProcessExec
(
prodOrderMain
,
routingDetails
,
sceneId
,
routingDetailEquip
,
departmentId
);
batchInsertProcessExec
(
prodOrderMain
,
routingDetails
,
sceneId
,
routingDetailEquip
,
routingHeader
);
return
true
;
return
true
;
}
}
...
@@ -711,9 +711,9 @@ public class LanuchServiceImpl implements LanuchService {
...
@@ -711,9 +711,9 @@ public class LanuchServiceImpl implements LanuchService {
public
void
batchInsertProcessExec
(
ProdLaunchOrder
prodOrderMain
,
public
void
batchInsertProcessExec
(
ProdLaunchOrder
prodOrderMain
,
List
<
RoutingDetail
>
routingDetails
,
List
<
RoutingDetail
>
routingDetails
,
String
sceneId
,
List
<
RoutingDetailEquip
>
routingDetailEquip
,
String
sceneId
,
List
<
RoutingDetailEquip
>
routingDetailEquip
,
Integer
departmentId
)
{
RoutingHeader
routingHeader
)
{
List
<
ProdProcessExec
>
processExecList
=
routingDetails
.
stream
()
List
<
ProdProcessExec
>
processExecList
=
routingDetails
.
stream
()
.
map
(
detail
->
createProcessExec
(
prodOrderMain
,
detail
,
sceneId
,
routingDetailEquip
,
departmentId
))
.
map
(
detail
->
createProcessExec
(
prodOrderMain
,
detail
,
sceneId
,
routingDetailEquip
,
routingHeader
))
.
collect
(
Collectors
.
toList
());
.
collect
(
Collectors
.
toList
());
List
<
Equipinfo
>
list
=
equipinfoService
.
lambdaQuery
().
eq
(
Equipinfo:
:
getIsdeleted
,
0
).
list
();
List
<
Equipinfo
>
list
=
equipinfoService
.
lambdaQuery
().
eq
(
Equipinfo:
:
getIsdeleted
,
0
).
list
();
...
@@ -741,7 +741,7 @@ public class LanuchServiceImpl implements LanuchService {
...
@@ -741,7 +741,7 @@ public class LanuchServiceImpl implements LanuchService {
public
ProdProcessExec
createProcessExec
(
ProdLaunchOrder
prodOrderMain
,
public
ProdProcessExec
createProcessExec
(
ProdLaunchOrder
prodOrderMain
,
RoutingDetail
detail
,
RoutingDetail
detail
,
String
sceneId
,
List
<
RoutingDetailEquip
>
routingDetailEquip
,
String
sceneId
,
List
<
RoutingDetailEquip
>
routingDetailEquip
,
Integer
departmentId
)
{
RoutingHeader
routingHeader
)
{
ProdProcessExec
prodProcessExec
=
new
ProdProcessExec
();
ProdProcessExec
prodProcessExec
=
new
ProdProcessExec
();
prodProcessExec
.
setExecId
(
UUID
.
randomUUID
().
toString
().
replace
(
"-"
,
""
));
prodProcessExec
.
setExecId
(
UUID
.
randomUUID
().
toString
().
replace
(
"-"
,
""
));
...
@@ -794,9 +794,11 @@ public class LanuchServiceImpl implements LanuchService {
...
@@ -794,9 +794,11 @@ public class LanuchServiceImpl implements LanuchService {
prodProcessExec
.
setRoutingCode
(
prodOrderMain
.
getRoutingCode
());
prodProcessExec
.
setRoutingCode
(
prodOrderMain
.
getRoutingCode
());
prodProcessExec
.
setConnectPropertyName
(
detail
.
getConnectPropertyName
());
prodProcessExec
.
setConnectPropertyName
(
detail
.
getConnectPropertyName
());
prodProcessExec
.
setCanInterrupt
(
detail
.
getCanInterrupt
());
prodProcessExec
.
setCanInterrupt
(
detail
.
getCanInterrupt
());
if
(
departmentId
!=
null
)
{
prodProcessExec
.
setDepartmentId
(
departmentId
);
prodProcessExec
.
setDepartmentId
(
routingHeader
.
getDepartmentId
());
}
prodProcessExec
.
setRoutingCode
(
routingHeader
.
getCode
());
prodProcessExec
.
setRoutingName
(
routingHeader
.
getName
());
prodProcessExec
.
setSpeed
(
prodProcessExec
.
setSpeed
(
Optional
.
ofNullable
(
detail
.
getRuntime
())
Optional
.
ofNullable
(
detail
.
getRuntime
())
...
@@ -839,10 +841,16 @@ public class LanuchServiceImpl implements LanuchService {
...
@@ -839,10 +841,16 @@ public class LanuchServiceImpl implements LanuchService {
}
}
}
}
List
<
ProdProcessExec
>
processExecList
=
prodProcessExecService
.
lambdaQuery
()
List
<
ProdProcessExec
>
processExecList
;
if
(
routingDetailIds
.
isEmpty
())
{
// 当routingDetailIds为空时,返回空列表
processExecList
=
new
ArrayList
<>();
}
else
{
processExecList
=
prodProcessExecService
.
lambdaQuery
()
.
eq
(
ProdProcessExec:
:
getSceneId
,
sceneId
)
.
eq
(
ProdProcessExec:
:
getSceneId
,
sceneId
)
.
in
(
ProdProcessExec:
:
getRoutingDetailId
,
new
ArrayList
<>(
routingDetailIds
))
.
in
(
ProdProcessExec:
:
getRoutingDetailId
,
new
ArrayList
<>(
routingDetailIds
))
.
list
();
.
list
();
}
// 构建routingDetailId到execId的映射
// 构建routingDetailId到execId的映射
Map
<
String
,
String
>
routingDetailIdToExecIdMap
=
processExecList
.
stream
()
Map
<
String
,
String
>
routingDetailIdToExecIdMap
=
processExecList
.
stream
()
...
...
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