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
019c2aa2
Commit
019c2aa2
authored
Jan 16, 2026
by
DESKTOP-VKRD9QF\Administration
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
工序设备字段新增
parent
b5cc8179
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
122 additions
and
95 deletions
+122
-95
R.java
src/main/java/com/aps/common/util/R.java
+1
-1
ProdEquipment.java
src/main/java/com/aps/entity/ProdEquipment.java
+1
-0
Entry.java
src/main/java/com/aps/entity/basic/Entry.java
+2
-0
MachineOption.java
src/main/java/com/aps/entity/basic/MachineOption.java
+1
-0
GeneticDecoder.java
src/main/java/com/aps/service/Algorithm/GeneticDecoder.java
+2
-1
MaterialRequirementService.java
...com/aps/service/Algorithm/MaterialRequirementService.java
+4
-3
RoutingDataService.java
...in/java/com/aps/service/Algorithm/RoutingDataService.java
+1
-0
LanuchService.java
src/main/java/com/aps/service/LanuchService.java
+1
-1
ChromosomeDataService.java
...in/java/com/aps/service/common/ChromosomeDataService.java
+4
-4
DatabaseQueryService.java
...ain/java/com/aps/service/common/DatabaseQueryService.java
+2
-2
LanuchServiceImpl.java
src/main/java/com/aps/service/impl/LanuchServiceImpl.java
+103
-83
No files found.
src/main/java/com/aps/common/util/R.java
View file @
019c2aa2
...
...
@@ -35,7 +35,7 @@ public class R<T> implements Serializable {
@Getter
@Setter
@Schema
(
description
=
"接口返回时间,默认带有毫秒数值,用于数据排查问题"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd
HH:mm:ss SSS
"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd
'T'HH:mm:ss.SSS'Z'
"
)
private
LocalDateTime
timestamp
=
LocalDateTime
.
now
();
public
static
<
T
>
R
<
T
>
ok
()
{
...
...
src/main/java/com/aps/entity/ProdEquipment.java
View file @
019c2aa2
...
...
@@ -13,6 +13,7 @@ public class ProdEquipment implements Serializable {
private
String
sceneId
;
private
Long
equipId
;
private
String
equipCode
;
private
String
equipName
;
private
Long
resourceId
;
private
String
resourceCode
;
private
String
execId
;
...
...
src/main/java/com/aps/entity/basic/Entry.java
View file @
019c2aa2
...
...
@@ -142,5 +142,7 @@ public class Entry {
private
double
changeLineTime
;
//换模时间
private
BigDecimal
setupTime
;
private
int
constTime
;
private
String
equipCode
;
//设备编码
private
String
equipName
;
//设备编码
}
src/main/java/com/aps/entity/basic/MachineOption.java
View file @
019c2aa2
...
...
@@ -19,4 +19,5 @@ public class MachineOption {
private
int
teardownTime
;
// 收尾时间(后处理时间)
private
int
contantTime
;
// 常数时间
private
int
preTime
;
// 前处理时间
private
String
equipName
;
}
\ No newline at end of file
src/main/java/com/aps/service/Algorithm/GeneticDecoder.java
View file @
019c2aa2
...
...
@@ -377,7 +377,8 @@ if(finishedOrder==null||finishedOrder.size()==0)
.
findFirst
().
orElse
(
null
);
operation
.
setSelectMachineID
(
machine
.
getId
());
operation
.
setEquipCode
(
machine
.
getCode
());
operation
.
setEquipName
(
machine
.
getName
());
int
teardownTime
=
machineOption
.
getTeardownTime
();
int
preTime
=
machineOption
.
getPreTime
();
...
...
src/main/java/com/aps/service/Algorithm/MaterialRequirementService.java
View file @
019c2aa2
...
...
@@ -72,7 +72,8 @@ public class MaterialRequirementService {
@Autowired
RoutingDataService
_routingDataService
;
@Autowired
private
EquipinfoService
equipinfoService
;
@Autowired
private
RoutingDiscreteParamService
_routingDiscreteParamService
;
...
...
@@ -328,8 +329,8 @@ if(routingIds.size()==0)
List
<
ProdProcessExec
>
processExecList
=
RoutingDetails
.
stream
()
.
map
(
detail
->
lanuchService
.
createProcessExec
(
prodOrderMain
,
detail
,
sceneId
,
finalRoutingDetailEquips
))
.
collect
(
Collectors
.
toList
());
List
<
ProdEquipment
>
ProdEquipmentList
=
lanuchService
.
batchInsertEquipMent
(
routingDetailEquips
,
sceneId
,
processExecList
,
false
);
List
<
Equipinfo
>
equipinfoList
=
equipinfoService
.
lambdaQuery
().
eq
(
Equipinfo:
:
getIsdeleted
,
0
).
list
();
List
<
ProdEquipment
>
ProdEquipmentList
=
lanuchService
.
batchInsertEquipMent
(
routingDetailEquips
,
sceneId
,
processExecList
,
false
,
equipinfoList
);
...
...
src/main/java/com/aps/service/Algorithm/RoutingDataService.java
View file @
019c2aa2
...
...
@@ -258,6 +258,7 @@ public class RoutingDataService {
mo
.
setRuntime
(
e
.
getRuntime
());
mo
.
setSingleOut
(
e
.
getSingleOut
());
mo
.
setEquipCode
(
e
.
getEquipCode
());
mo
.
setEquipName
(
e
.
getEquipName
());
mo
.
setResourceCode
(
e
.
getResourceCode
());
mo
.
setProcessingTime
(
e
.
getSpeed
());
mo
.
setContantTime
(
op
.
getConstTime
());
...
...
src/main/java/com/aps/service/LanuchService.java
View file @
019c2aa2
...
...
@@ -44,7 +44,7 @@ public interface LanuchService {
List
<
ProdEquipment
>
batchInsertEquipMent
(
List
<
RoutingDetailEquip
>
routingDetailEquips
,
String
sceneId
,
List
<
ProdProcessExec
>
processExecList
,
Boolean
isSave
);
String
sceneId
,
List
<
ProdProcessExec
>
processExecList
,
Boolean
isSave
,
List
<
Equipinfo
>
equipinfo
);
List
<
ProdOrderProcess
>
createProcessRelations
(
ProdLaunchOrder
prodOrderMain
,
String
sceneId
,
Map
<
String
,
String
>
routingDetailIdToExecIdMap
);
...
...
src/main/java/com/aps/service/common/ChromosomeDataService.java
View file @
019c2aa2
...
...
@@ -479,13 +479,13 @@ public class ChromosomeDataService {
List
<?>
pagedData
=
dataList
.
subList
(
fromIndex
,
toIndex
);
result
.
put
(
"records"
,
pagedData
);
result
.
put
(
"total"
,
total
);
result
.
put
(
"
current
"
,
page
);
result
.
put
(
"total
Count
"
,
total
);
result
.
put
(
"
pageIndex
"
,
page
);
result
.
put
(
"size"
,
size
);
}
else
{
result
.
put
(
"records"
,
data
);
result
.
put
(
"total"
,
1
);
result
.
put
(
"
current
"
,
1
);
result
.
put
(
"total
Count
"
,
1
);
result
.
put
(
"
pageIndex
"
,
1
);
result
.
put
(
"size"
,
1
);
}
...
...
src/main/java/com/aps/service/common/DatabaseQueryService.java
View file @
019c2aa2
...
...
@@ -91,8 +91,8 @@ public class DatabaseQueryService {
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
result
.
put
(
"records"
,
records
);
result
.
put
(
"total"
,
total
!=
null
?
total
:
0
);
result
.
put
(
"
current
"
,
page
);
result
.
put
(
"total
Count
"
,
total
!=
null
?
total
:
0
);
result
.
put
(
"
pageIndex
"
,
page
);
result
.
put
(
"size"
,
size
);
return
result
;
...
...
src/main/java/com/aps/service/impl/LanuchServiceImpl.java
View file @
019c2aa2
...
...
@@ -43,52 +43,54 @@ import static org.springframework.beans.BeanUtils.copyProperties;
public
class
LanuchServiceImpl
implements
LanuchService
{
@Autowired
ProdEquipSpecialCalService
prodEquipSpecialCalService
;
private
ProdEquipSpecialCalService
prodEquipSpecialCalService
;
@Autowired
ApsOrderService
apsOrderService
;
private
ApsOrderService
apsOrderService
;
@Autowired
RoutingHeaderService
routingHeaderService
;
private
RoutingHeaderService
routingHeaderService
;
@Autowired
ProdLaunchOrderService
prodLaunchOrderService
;
private
ProdLaunchOrderService
prodLaunchOrderService
;
@Autowired
RoutingDetailMapper
routingDetailMapper
;
private
RoutingDetailMapper
routingDetailMapper
;
@Autowired
ProdProcessExecService
prodProcessExecService
;
private
ProdProcessExecService
prodProcessExecService
;
@Autowired
RoutingDetailConnectService
routingDetailConnectService
;
private
RoutingDetailConnectService
routingDetailConnectService
;
@Autowired
ProdOrderProcessService
prodOrderProcessService
;
private
ProdOrderProcessService
prodOrderProcessService
;
@Autowired
RoutingHeaderMapper
routingHeaderMapper
;
private
RoutingHeaderMapper
routingHeaderMapper
;
@Autowired
ProdSceneConfigService
prodSceneConfigService
;
private
ProdSceneConfigService
prodSceneConfigService
;
@Autowired
ProdEquipmentService
prodEquipmentService
;
private
ProdEquipmentService
prodEquipmentService
;
@Autowired
RoutingDetailEquipService
routingDetailEquipService
;
private
RoutingDetailEquipService
routingDetailEquipService
;
@Autowired
SceneService
sceneService
;
private
SceneService
sceneService
;
@Autowired
MesOrderService
mesOrderService
;
private
MesOrderService
mesOrderService
;
@Autowired
DispatchService
dispatchService
;
private
DispatchService
dispatchService
;
@Autowired
RoutingDiscreteParamService
routingDiscreteParamService
;
private
RoutingDiscreteParamService
routingDiscreteParamService
;
@Autowired
MesScheduleService
mesScheduleService
;
private
MesScheduleService
mesScheduleService
;
@Autowired
Equiptype1Service
equiptype1Service
;
private
Equiptype1Service
equiptype1Service
;
@Autowired
PlanResourceService
planResourceService
;
private
PlanResourceService
planResourceService
;
@Autowired
OrderMaterialRequirementService
orderMaterialRequirementService
;
private
OrderMaterialRequirementService
orderMaterialRequirementService
;
@Autowired
private
EquipinfoService
equipinfoService
;
/**
* 生成场景数据
*
...
...
@@ -660,7 +662,8 @@ public class LanuchServiceImpl implements LanuchService {
.
map
(
detail
->
createProcessExec
(
prodOrderMain
,
detail
,
sceneId
,
routingDetailEquip
))
.
collect
(
Collectors
.
toList
());
batchInsertEquipMent
(
routingDetailEquip
,
sceneId
,
processExecList
,
true
);
List
<
Equipinfo
>
list
=
equipinfoService
.
lambdaQuery
().
eq
(
Equipinfo:
:
getIsdeleted
,
0
).
list
();
batchInsertEquipMent
(
routingDetailEquip
,
sceneId
,
processExecList
,
true
,
list
);
// 批量插入
if
(!
CollectionUtils
.
isEmpty
(
processExecList
))
{
...
...
@@ -700,8 +703,14 @@ public class LanuchServiceImpl implements LanuchService {
.
findFirst
()
.
orElse
(
null
);
prodProcessExec
.
setMachineId
(
routingDetailEquip1
.
getType1
());
if
(
routingDetailEquip1
!=
null
)
{
prodProcessExec
.
setMachineId
(
routingDetailEquip1
.
getType1
());
}
else
{
prodProcessExec
.
setMachineId
(
detail
.
getEquipTypeId
());
}
prodProcessExec
.
setRuntime
(
detail
.
getRuntime
());
...
...
@@ -963,11 +972,11 @@ if (connection.getDestoperationid() !=null && connection.getSourceoperationid()
*/
public
List
<
ProdEquipment
>
batchInsertEquipMent
(
List
<
RoutingDetailEquip
>
routingDetailEquips
,
String
sceneId
,
List
<
ProdProcessExec
>
processExecList
,
Boolean
isSave
)
{
if
(
CollectionUtils
.
isEmpty
(
routingDetailEquips
))
{
log
.
warn
(
"工艺设备列表为空,跳过设备对照表生成"
);
return
null
;
}
String
sceneId
,
List
<
ProdProcessExec
>
processExecList
,
Boolean
isSave
,
List
<
Equipinfo
>
equipinfo
)
{
//
if (CollectionUtils.isEmpty(routingDetailEquips)) {
//
log.warn("工艺设备列表为空,跳过设备对照表生成");
//
return null;
//
}
List
<
Equiptype1
>
equipTypes
=
equiptype1Service
.
lambdaQuery
().
eq
(
Equiptype1:
:
getIsdeleted
,
0
).
list
();
List
<
PlanResource
>
list
=
planResourceService
.
lambdaQuery
()
...
...
@@ -977,67 +986,78 @@ if (connection.getDestoperationid() !=null && connection.getSourceoperationid()
// 创建ProdEquipment列表
List
<
ProdEquipment
>
prodEquipments
=
new
java
.
util
.
ArrayList
<>();
// 遍历RoutingDetailEquip列表,转换为ProdEquipment对象
for
(
RoutingDetailEquip
routingDetailEquip
:
routingDetailEquips
)
{
ProdEquipment
prodEquipment
=
new
ProdEquipment
();
prodEquipment
.
setSceneId
(
sceneId
);
prodEquipment
.
setEquipId
(
routingDetailEquip
.
getEquipId
().
longValue
());
String
code
=
list
.
stream
().
filter
(
equip
->
equip
.
getId
().
equals
(
routingDetailEquip
.
getEquipId
().
intValue
())).
findFirst
().
map
(
PlanResource:
:
getReferenceCode
).
orElse
(
null
);
if
(
routingDetailEquips
!=
null
&&
routingDetailEquips
.
size
()
>
0
)
{
prodEquipment
.
setEquipCode
(
code
);
// 遍历RoutingDetailEquip列表,转换为ProdEquipment对象
for
(
RoutingDetailEquip
routingDetailEquip
:
routingDetailEquips
)
{
ProdEquipment
prodEquipment
=
new
ProdEquipment
();
prodEquipment
.
setSceneId
(
sceneId
);
prodEquipment
.
setEquipId
(
routingDetailEquip
.
getEquipId
().
longValue
());
prodEquipment
.
setResourceId
(
routingDetailEquip
.
getType1
()
);
Integer
i
=
list
.
stream
().
filter
(
equip
->
equip
.
getId
().
equals
(
routingDetailEquip
.
getEquipId
().
intValue
())).
findFirst
().
map
(
PlanResource:
:
getReferenceId
).
orElse
(
null
);
Equiptype1
equiptype1
=
equipTypes
.
stream
().
filter
(
equip
->
equip
.
getId
().
equals
(
routingDetailEquip
.
getType1
()))
.
findFirst
()
.
orElse
(
null
);
Equipinfo
equipinfo1
=
equipinfo
.
stream
().
filter
(
equip
->
equip
.
getId
().
equals
(
i
)).
findFirst
().
orElse
(
null
);
prodEquipment
.
setEquipCode
(
equipinfo1
.
getEquipId
());
prodEquipment
.
setEquipName
(
equipinfo1
.
getEquipName
());
if
(
equiptype1
!=
null
){
prodEquipment
.
setResourceCode
(
equiptype1
.
getEquipTypeId
());
}
prodEquipment
.
setEfficiencyValue
(
routingDetailEquip
.
getEfficiencyValue
());
prodEquipment
.
setSetupTime
(
routingDetailEquip
.
getSetupTime
());
prodEquipment
.
setId
(
String
.
valueOf
(
SnowFlackIdWorker
.
getId
()));
prodEquipment
.
setRuntime
(
routingDetailEquip
.
getDuration
());
prodEquipment
.
setSingleOut
(
routingDetailEquip
.
getOutputQuantity
());
prodEquipment
.
setSpeed
(
Optional
.
ofNullable
(
routingDetailEquip
.
getDuration
())
.
filter
(
out
->
routingDetailEquip
.
getOutputQuantity
()
!=
null
)
.
filter
(
out
->
routingDetailEquip
.
getOutputQuantity
().
compareTo
(
BigDecimal
.
ZERO
)
!=
0
)
.
map
(
out
->
out
.
divide
(
routingDetailEquip
.
getOutputQuantity
(),
6
,
RoundingMode
.
HALF_UP
))
.
map
(
BigDecimal:
:
doubleValue
)
// 关键转换
.
orElse
(
0.0
)
);
String
execId
=
processExecList
.
stream
()
.
filter
(
exec
->
{
Long
execRoutingDetailId
=
exec
.
getRoutingDetailId
();
Long
equipRoutingDetailId
=
routingDetailEquip
.
getRoutingDetailId
();
// 处理null值
if
(
execRoutingDetailId
==
null
||
equipRoutingDetailId
==
null
)
{
return
false
;
}
// 使用equals比较
return
execRoutingDetailId
.
equals
(
equipRoutingDetailId
);
})
.
findFirst
()
.
map
(
ProdProcessExec:
:
getExecId
)
.
orElse
(
null
);
if
(
execId
!=
null
)
{
prodEquipment
.
setExecId
(
execId
);
}
else
{
log
.
warn
(
"未找到routingDetailId={}对应的execId"
,
routingDetailEquip
.
getRoutingDetailId
());
prodEquipment
.
setResourceId
(
routingDetailEquip
.
getType1
());
Equiptype1
equiptype1
=
equipTypes
.
stream
().
filter
(
equip
->
equip
.
getId
().
equals
(
routingDetailEquip
.
getType1
()))
.
findFirst
()
.
orElse
(
null
);
if
(
equiptype1
!=
null
)
{
prodEquipment
.
setResourceCode
(
equiptype1
.
getEquipTypeId
());
}
prodEquipment
.
setEfficiencyValue
(
routingDetailEquip
.
getEfficiencyValue
());
prodEquipment
.
setSetupTime
(
routingDetailEquip
.
getSetupTime
());
prodEquipment
.
setId
(
String
.
valueOf
(
SnowFlackIdWorker
.
getId
()));
prodEquipment
.
setRuntime
(
routingDetailEquip
.
getDuration
());
prodEquipment
.
setSingleOut
(
routingDetailEquip
.
getOutputQuantity
());
prodEquipment
.
setSpeed
(
Optional
.
ofNullable
(
routingDetailEquip
.
getDuration
())
.
filter
(
out
->
routingDetailEquip
.
getOutputQuantity
()
!=
null
)
.
filter
(
out
->
routingDetailEquip
.
getOutputQuantity
().
compareTo
(
BigDecimal
.
ZERO
)
!=
0
)
.
map
(
out
->
out
.
divide
(
routingDetailEquip
.
getOutputQuantity
(),
6
,
RoundingMode
.
HALF_UP
))
.
map
(
BigDecimal:
:
doubleValue
)
// 关键转换
.
orElse
(
0.0
)
);
String
execId
=
processExecList
.
stream
()
.
filter
(
exec
->
{
Long
execRoutingDetailId
=
exec
.
getRoutingDetailId
();
Long
equipRoutingDetailId
=
routingDetailEquip
.
getRoutingDetailId
();
// 处理null值
if
(
execRoutingDetailId
==
null
||
equipRoutingDetailId
==
null
)
{
return
false
;
}
// 使用equals比较
return
execRoutingDetailId
.
equals
(
equipRoutingDetailId
);
})
.
findFirst
()
.
map
(
ProdProcessExec:
:
getExecId
)
.
orElse
(
null
);
if
(
execId
!=
null
)
{
prodEquipment
.
setExecId
(
execId
);
}
else
{
log
.
warn
(
"未找到routingDetailId={}对应的execId"
,
routingDetailEquip
.
getRoutingDetailId
());
}
prodEquipments
.
add
(
prodEquipment
);
}
}
else
{
prodEquipments
.
add
(
prodEquipment
);
}
}
// 批量保存
if
(!
prodEquipments
.
isEmpty
()&&
isSave
)
{
prodEquipmentService
.
saveBatch
(
prodEquipments
);
...
...
@@ -1060,10 +1080,10 @@ if (connection.getDestoperationid() !=null && connection.getSourceoperationid()
.
eq
(
RoutingDetailEquip:
:
getIsdeleted
,
0
)
.
list
();
// 添加 is_deleted=0 过滤条件
if
(
CollectionUtils
.
isEmpty
(
detailEquips
))
{
log
.
error
(
"工艺下无设备信息: {}"
,
routingHeaderId
);
throw
new
RuntimeException
(
"工艺下无设备信息: "
+
routingCode
);
}
//
if (CollectionUtils.isEmpty(detailEquips)) {
//
log.error("工艺下无设备信息: {}", routingHeaderId);
//
throw new RuntimeException("工艺下无设备信息: " + routingCode);
//
}
return
detailEquips
;
}
...
...
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