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
bddca3a7
Commit
bddca3a7
authored
Dec 31, 2025
by
DESKTOP-VKRD9QF\Administration
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
设备维修新字段
parent
016c5717
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
120 additions
and
17 deletions
+120
-17
ChromosomeDataController.java
...a/com/aps/controller/common/ChromosomeDataController.java
+1
-1
ProdEquipment.java
src/main/java/com/aps/entity/ProdEquipment.java
+5
-1
MachineOption.java
src/main/java/com/aps/entity/basic/MachineOption.java
+4
-0
RoutingDataService.java
...in/java/com/aps/service/Algorithm/RoutingDataService.java
+5
-0
ChromosomeDataService.java
...in/java/com/aps/service/common/ChromosomeDataService.java
+81
-12
LanuchServiceImpl.java
src/main/java/com/aps/service/impl/LanuchServiceImpl.java
+24
-3
No files found.
src/main/java/com/aps/controller/common/ChromosomeDataController.java
View file @
bddca3a7
...
@@ -135,7 +135,7 @@ public class ChromosomeDataController {
...
@@ -135,7 +135,7 @@ public class ChromosomeDataController {
*/
*/
private
boolean
isFileEntity
(
String
entityName
)
{
private
boolean
isFileEntity
(
String
entityName
)
{
// 这里列出所有文件实体的名称
// 这里列出所有文件实体的名称
String
[]
fileEntities
=
{
"order"
,
"entry"
,
"machine"
,
"globaloperationinfo"
,
"groupresult"
,
"prodprocessexec"
};
String
[]
fileEntities
=
{
"order"
,
"entry"
,
"machine"
,
"globaloperationinfo"
,
"groupresult"
,
"prodprocessexec"
,
"machineoption"
};
for
(
String
fileEntity
:
fileEntities
)
{
for
(
String
fileEntity
:
fileEntities
)
{
if
(
fileEntity
.
equalsIgnoreCase
(
entityName
))
{
if
(
fileEntity
.
equalsIgnoreCase
(
entityName
))
{
return
true
;
return
true
;
...
...
src/main/java/com/aps/entity/ProdEquipment.java
View file @
bddca3a7
...
@@ -4,6 +4,7 @@ import lombok.Data;
...
@@ -4,6 +4,7 @@ import lombok.Data;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
@Data
@Data
@TableName
(
"prod_equipment"
)
@TableName
(
"prod_equipment"
)
...
@@ -12,11 +13,14 @@ public class ProdEquipment implements Serializable {
...
@@ -12,11 +13,14 @@ public class ProdEquipment implements Serializable {
private
String
sceneId
;
private
String
sceneId
;
private
Long
equipId
;
private
Long
equipId
;
private
String
equipCode
;
private
String
equipCode
;
private
String
equipName
;
private
Long
resourceId
;
private
Long
resourceId
;
private
String
resourceCode
;
private
String
execId
;
private
String
execId
;
private
Double
speed
;
private
Double
speed
;
private
String
id
;
private
String
id
;
private
BigDecimal
runtime
;
//持续时间
private
BigDecimal
singleOut
;
//单件产出
/**
/**
* 效率系数
* 效率系数
*/
*/
...
...
src/main/java/com/aps/entity/basic/MachineOption.java
View file @
bddca3a7
...
@@ -10,6 +10,10 @@ import java.math.BigDecimal;
...
@@ -10,6 +10,10 @@ import java.math.BigDecimal;
@Data
@Data
public
class
MachineOption
{
public
class
MachineOption
{
private
Long
machineId
;
private
Long
machineId
;
private
BigDecimal
runtime
;
//持续时间
private
BigDecimal
singleOut
;
//单件产出
private
String
equipCode
;
private
String
resourceCode
;
private
double
processingTime
;
// 加工时间 (秒)
private
double
processingTime
;
// 加工时间 (秒)
private
int
setupTime
;
// 换型时间(如果与前一个产品不同)
private
int
setupTime
;
// 换型时间(如果与前一个产品不同)
private
int
teardownTime
;
// 收尾时间(后处理时间)
private
int
teardownTime
;
// 收尾时间(后处理时间)
...
...
src/main/java/com/aps/service/Algorithm/RoutingDataService.java
View file @
bddca3a7
...
@@ -231,12 +231,17 @@ public class RoutingDataService {
...
@@ -231,12 +231,17 @@ public class RoutingDataService {
for
(
ProdEquipment
e
:
Equipments
)
{
for
(
ProdEquipment
e
:
Equipments
)
{
MachineOption
mo
=
new
MachineOption
();
MachineOption
mo
=
new
MachineOption
();
mo
.
setMachineId
(
e
.
getEquipId
());
mo
.
setMachineId
(
e
.
getEquipId
());
mo
.
setRuntime
(
e
.
getRuntime
());
mo
.
setSingleOut
(
e
.
getSingleOut
());
mo
.
setEquipCode
(
e
.
getEquipCode
());
mo
.
setResourceCode
(
e
.
getResourceCode
());
mo
.
setProcessingTime
(
e
.
getSpeed
());
mo
.
setProcessingTime
(
e
.
getSpeed
());
mo
.
setContantTime
(
op
.
getConstTime
());
mo
.
setContantTime
(
op
.
getConstTime
());
mo
.
setSetupTime
(
op
.
getChangeLineTime
());
mo
.
setSetupTime
(
op
.
getChangeLineTime
());
mo
.
setTeardownTime
(
op
.
getPostprocessingTime
());
mo
.
setTeardownTime
(
op
.
getPostprocessingTime
());
mo
.
setPreTime
(
e
.
getSetupTime
());
mo
.
setPreTime
(
e
.
getSetupTime
());
mos
.
add
(
mo
);
mos
.
add
(
mo
);
}
}
entry
.
setMachineOptions
(
mos
);
entry
.
setMachineOptions
(
mos
);
...
...
src/main/java/com/aps/service/common/ChromosomeDataService.java
View file @
bddca3a7
...
@@ -128,6 +128,13 @@ public class ChromosomeDataService {
...
@@ -128,6 +128,13 @@ public class ChromosomeDataService {
config
.
setEntityName
(
entityName
);
config
.
setEntityName
(
entityName
);
config
.
setDataSource
(
DataSourceType
.
FILE
);
config
.
setDataSource
(
DataSourceType
.
FILE
);
config
.
setFieldName
(
"allOperations"
);
config
.
setFieldName
(
"allOperations"
);
}
// 特殊处理:当实体是MachineOption时,映射到allOperations字段
else
if
(
"machineoption"
.
equalsIgnoreCase
(
key
))
{
config
=
new
EntityConfig
();
config
.
setEntityName
(
entityName
);
config
.
setDataSource
(
DataSourceType
.
FILE
);
config
.
setFieldName
(
"allOperations"
);
}
else
{
}
else
{
// 自动创建数据库配置(默认行为)
// 自动创建数据库配置(默认行为)
config
=
createDefaultDbConfig
(
entityName
);
config
=
createDefaultDbConfig
(
entityName
);
...
@@ -254,6 +261,11 @@ public class ChromosomeDataService {
...
@@ -254,6 +261,11 @@ public class ChromosomeDataService {
fieldName
=
"allOperations"
;
fieldName
=
"allOperations"
;
}
}
// 特殊处理:当实体是MachineOption时,使用allOperations字段
if
(
"machineoption"
.
equalsIgnoreCase
(
config
.
getEntityName
()))
{
fieldName
=
"allOperations"
;
}
Field
field
=
Chromosome
.
class
.
getDeclaredField
(
fieldName
);
Field
field
=
Chromosome
.
class
.
getDeclaredField
(
fieldName
);
field
.
setAccessible
(
true
);
field
.
setAccessible
(
true
);
Object
result
=
field
.
get
(
chromosome
);
Object
result
=
field
.
get
(
chromosome
);
...
@@ -263,6 +275,11 @@ public class ChromosomeDataService {
...
@@ -263,6 +275,11 @@ public class ChromosomeDataService {
return
convertEntryToProdProcessExec
(
result
);
return
convertEntryToProdProcessExec
(
result
);
}
}
// 如果实体是MachineOption,提取Entry中的MachineOption列表
if
(
"machineoption"
.
equalsIgnoreCase
(
config
.
getEntityName
()))
{
return
extractMachineOptionsFromEntries
(
result
);
}
return
result
;
return
result
;
}
catch
(
NoSuchFieldException
e
)
{
}
catch
(
NoSuchFieldException
e
)
{
throw
new
RuntimeException
(
"Chromosome类中未找到字段: "
+
config
.
getFieldName
(),
e
);
throw
new
RuntimeException
(
"Chromosome类中未找到字段: "
+
config
.
getFieldName
(),
e
);
...
@@ -314,6 +331,33 @@ public class ChromosomeDataService {
...
@@ -314,6 +331,33 @@ public class ChromosomeDataService {
* 根据ID查询文件数据
* 根据ID查询文件数据
*/
*/
private
Object
queryFileDataById
(
String
sceneId
,
EntityConfig
config
,
String
id
)
{
private
Object
queryFileDataById
(
String
sceneId
,
EntityConfig
config
,
String
id
)
{
// 特殊处理:当实体是MachineOption时,需要先获取Entry列表,再提取特定Entry的MachineOption
if
(
"machineoption"
.
equalsIgnoreCase
(
config
.
getEntityName
()))
{
// 先获取Entry列表(而不是MachineOption列表)
EntityConfig
entryConfig
=
new
EntityConfig
();
entryConfig
.
setEntityName
(
"entry"
);
entryConfig
.
setDataSource
(
DataSourceType
.
FILE
);
entryConfig
.
setFieldName
(
"allOperations"
);
Object
result
=
queryFileData
(
sceneId
,
entryConfig
);
if
(
result
instanceof
List
)
{
List
<?>
entryList
=
(
List
<?>)
result
;
// 查找ID匹配的Entry
for
(
Object
obj
:
entryList
)
{
if
(
obj
instanceof
Entry
)
{
Entry
entry
=
(
Entry
)
obj
;
// 检查Entry的ID是否匹配
if
(
String
.
valueOf
(
entry
.
getId
()).
equals
(
id
))
{
// 如果ID匹配,返回该Entry的MachineOptions
return
entry
.
getMachineOptions
()
!=
null
?
entry
.
getMachineOptions
()
:
new
ArrayList
<>();
}
}
}
}
throw
new
RuntimeException
(
"未找到ID为 "
+
id
+
" 的数据"
);
}
Object
result
=
queryFileData
(
sceneId
,
config
);
Object
result
=
queryFileData
(
sceneId
,
config
);
// 如果结果是List类型,则根据ID查找特定项
// 如果结果是List类型,则根据ID查找特定项
...
@@ -861,7 +905,7 @@ public class ChromosomeDataService {
...
@@ -861,7 +905,7 @@ public class ChromosomeDataService {
prodProcessExec
.
setMachineId
(
entry
.
getSelectMachineID
());
prodProcessExec
.
setMachineId
(
entry
.
getSelectMachineID
());
prodProcessExec
.
setEquipTypeName
(
entry
.
getEquipTypeName
());
prodProcessExec
.
setEquipTypeName
(
entry
.
getEquipTypeName
());
prodProcessExec
.
setEquipTypeCode
(
entry
.
getEquipTypeCode
());
prodProcessExec
.
setEquipTypeCode
(
entry
.
getEquipTypeCode
());
// prodProcessExec.set
MachineId
(entry.getEquipTypeID());
// prodProcessExec.set
EquipTypeID
(entry.getEquipTypeID());
prodProcessExec
.
setRuntime
(
entry
.
getRuntime
());
prodProcessExec
.
setRuntime
(
entry
.
getRuntime
());
prodProcessExec
.
setSingleOut
(
entry
.
getSingleOut
());
prodProcessExec
.
setSingleOut
(
entry
.
getSingleOut
());
prodProcessExec
.
setPlanQty
(
entry
.
getQuantity
());
prodProcessExec
.
setPlanQty
(
entry
.
getQuantity
());
...
@@ -873,17 +917,42 @@ public class ChromosomeDataService {
...
@@ -873,17 +917,42 @@ public class ChromosomeDataService {
// 其他字段根据需要进行映射
// 其他字段根据需要进行映射
prodProcessExec
.
setCanInterrupt
(
entry
.
getIsInterrupt
());
prodProcessExec
.
setCanInterrupt
(
entry
.
getIsInterrupt
());
prodProcessExec
.
setRoutingId
(
entry
.
getRoutingId
());
prodProcessExec
.
setRoutingId
(
entry
.
getRoutingId
());
List
<
MachineOption
>
machineOptions
=
entry
.
getMachineOptions
();
MachineOption
machineOption1
=
machineOptions
.
stream
()
.
filter
(
machineOption
->
machineOption
.
getMachineId
().
equals
(
entry
.
getSelectMachineID
())
)
.
findFirst
()
.
orElse
(
null
);
prodProcessExec
.
setChangeLineTime
(
machineOption1
.
getSetupTime
());
prodProcessExec
.
setChangeLineTime
(
machineOption1
.
getSetupTime
());
prodProcessExec
.
setPreprocessingTime
(
machineOption1
.
getPreTime
());
prodProcessExec
.
setPostprocessingTime
(
machineOption1
.
getTeardownTime
());
return
prodProcessExec
;
return
prodProcessExec
;
}
}
/**
* 从Entry列表中提取MachineOption列表
*/
private
Object
extractMachineOptionsFromEntries
(
Object
data
)
{
if
(
data
instanceof
List
)
{
List
<?>
entryList
=
(
List
<?>)
data
;
List
<
MachineOption
>
result
=
new
ArrayList
<>();
System
.
out
.
println
(
"提取MachineOption: Entry列表大小 = "
+
entryList
.
size
());
for
(
Object
obj
:
entryList
)
{
if
(
obj
instanceof
Entry
)
{
Entry
entry
=
(
Entry
)
obj
;
if
(
entry
.
getMachineOptions
()
!=
null
)
{
System
.
out
.
println
(
"Entry ID: "
+
entry
.
getId
()
+
", MachineOptions大小: "
+
entry
.
getMachineOptions
().
size
());
// 返回所有Entry中的MachineOption
result
.
addAll
(
entry
.
getMachineOptions
());
}
else
{
System
.
out
.
println
(
"Entry ID: "
+
entry
.
getId
()
+
", MachineOptions为null"
);
}
}
}
System
.
out
.
println
(
"总共提取到MachineOption数量: "
+
result
.
size
());
return
result
;
}
else
if
(
data
instanceof
Entry
)
{
Entry
entry
=
(
Entry
)
data
;
System
.
out
.
println
(
"单个Entry的MachineOptions大小: "
+
(
entry
.
getMachineOptions
()
!=
null
?
entry
.
getMachineOptions
().
size
()
:
0
));
return
entry
.
getMachineOptions
()
!=
null
?
entry
.
getMachineOptions
()
:
new
ArrayList
<>();
}
System
.
out
.
println
(
"数据类型不是Entry或Entry列表,返回空列表"
);
return
new
ArrayList
<>();
// 如果不是Entry类型,返回空列表
}
}
}
\ No newline at end of file
src/main/java/com/aps/service/impl/LanuchServiceImpl.java
View file @
bddca3a7
...
@@ -83,6 +83,8 @@ public class LanuchServiceImpl implements LanuchService {
...
@@ -83,6 +83,8 @@ public class LanuchServiceImpl implements LanuchService {
@Autowired
@Autowired
Equiptype1Service
equiptype1Service
;
Equiptype1Service
equiptype1Service
;
@Autowired
PlanResourceService
planResourceService
;
/**
/**
* 生成场景数据
* 生成场景数据
*
*
...
@@ -930,6 +932,11 @@ if (connection.getDestoperationid() !=null && connection.getSourceoperationid()
...
@@ -930,6 +932,11 @@ if (connection.getDestoperationid() !=null && connection.getSourceoperationid()
log
.
warn
(
"工艺设备列表为空,跳过设备对照表生成"
);
log
.
warn
(
"工艺设备列表为空,跳过设备对照表生成"
);
return
null
;
return
null
;
}
}
List
<
Equiptype1
>
equipTypes
=
equiptype1Service
.
lambdaQuery
().
eq
(
Equiptype1:
:
getIsdeleted
,
0
).
list
();
List
<
PlanResource
>
list
=
planResourceService
.
lambdaQuery
()
.
eq
(
PlanResource:
:
getIsdeleted
,
0
)
.
list
();
// 创建ProdEquipment列表
// 创建ProdEquipment列表
List
<
ProdEquipment
>
prodEquipments
=
new
java
.
util
.
ArrayList
<>();
List
<
ProdEquipment
>
prodEquipments
=
new
java
.
util
.
ArrayList
<>();
...
@@ -939,12 +946,27 @@ if (connection.getDestoperationid() !=null && connection.getSourceoperationid()
...
@@ -939,12 +946,27 @@ if (connection.getDestoperationid() !=null && connection.getSourceoperationid()
ProdEquipment
prodEquipment
=
new
ProdEquipment
();
ProdEquipment
prodEquipment
=
new
ProdEquipment
();
prodEquipment
.
setSceneId
(
sceneId
);
prodEquipment
.
setSceneId
(
sceneId
);
prodEquipment
.
setEquipId
(
routingDetailEquip
.
getEquipId
().
longValue
());
prodEquipment
.
setEquipId
(
routingDetailEquip
.
getEquipId
().
longValue
());
// prodEquipment.setEquipCode(routingDetailEquip.getName());
prodEquipment
.
setEquipName
(
routingDetailEquip
.
getName
());
String
code
=
list
.
stream
().
filter
(
equip
->
equip
.
getId
().
equals
(
routingDetailEquip
.
getEquipId
().
intValue
())).
findFirst
().
map
(
PlanResource:
:
getReferenceCode
).
orElse
(
null
);
prodEquipment
.
setEquipCode
(
code
);
prodEquipment
.
setResourceId
(
routingDetailEquip
.
getType1
());
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
.
setEfficiencyValue
(
routingDetailEquip
.
getEfficiencyValue
());
prodEquipment
.
setSetupTime
(
routingDetailEquip
.
getSetupTime
());
prodEquipment
.
setSetupTime
(
routingDetailEquip
.
getSetupTime
());
prodEquipment
.
setId
(
String
.
valueOf
(
SnowFlackIdWorker
.
getId
()));
prodEquipment
.
setId
(
String
.
valueOf
(
SnowFlackIdWorker
.
getId
()));
prodEquipment
.
setRuntime
(
routingDetailEquip
.
getDuration
());
prodEquipment
.
setSingleOut
(
routingDetailEquip
.
getOutputQuantity
());
prodEquipment
.
setSpeed
(
prodEquipment
.
setSpeed
(
Optional
.
ofNullable
(
routingDetailEquip
.
getDuration
())
Optional
.
ofNullable
(
routingDetailEquip
.
getDuration
())
...
@@ -987,7 +1009,6 @@ if (connection.getDestoperationid() !=null && connection.getSourceoperationid()
...
@@ -987,7 +1009,6 @@ if (connection.getDestoperationid() !=null && connection.getSourceoperationid()
return
prodEquipments
;
return
prodEquipments
;
}
}
/**
/**
◦ 获取工艺工序列表
◦ 获取工艺工序列表
...
...
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