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
3ea2f6bc
Commit
3ea2f6bc
authored
Dec 05, 2025
by
DESKTOP-VKRD9QF\Administration
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
离散参数
parent
1bed79d7
Show whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
734 additions
and
4 deletions
+734
-4
DiscreteParameterDurationController.java
...m/aps/controller/DiscreteParameterDurationController.java
+18
-0
DiscreteParameterMatrixController.java
...com/aps/controller/DiscreteParameterMatrixController.java
+25
-0
DependencyType.java
src/main/java/com/aps/entity/Algorithm/DependencyType.java
+43
-0
DiscreteParameterDuration.java
src/main/java/com/aps/entity/DiscreteParameterDuration.java
+41
-0
DiscreteParameterMatrix.java
src/main/java/com/aps/entity/DiscreteParameterMatrix.java
+40
-0
ProdProcessExec.java
src/main/java/com/aps/entity/ProdProcessExec.java
+9
-0
Entry.java
src/main/java/com/aps/entity/basic/Entry.java
+7
-1
DiscreteParameterDurationMapper.java
.../java/com/aps/mapper/DiscreteParameterDurationMapper.java
+16
-0
DiscreteParameterMatrixMapper.java
...in/java/com/aps/mapper/DiscreteParameterMatrixMapper.java
+16
-0
GeneticDecoder.java
src/main/java/com/aps/service/Algorithm/GeneticDecoder.java
+3
-0
DiscreteParameterDurationService.java
...ava/com/aps/service/DiscreteParameterDurationService.java
+19
-0
DiscreteParameterMatrixService.java
.../java/com/aps/service/DiscreteParameterMatrixService.java
+21
-0
DiscreteParameterDurationServiceImpl.java
...ps/service/impl/DiscreteParameterDurationServiceImpl.java
+103
-0
DiscreteParameterMatrixServiceImpl.java
.../aps/service/impl/DiscreteParameterMatrixServiceImpl.java
+245
-0
LanuchServiceImpl.java
src/main/java/com/aps/service/impl/LanuchServiceImpl.java
+8
-0
PlanResultService.java
src/main/java/com/aps/service/plan/PlanResultService.java
+32
-3
DiscreteParameterDurationMapper.xml
...main/resources/mapper/DiscreteParameterDurationMapper.xml
+44
-0
DiscreteParameterMatrixMapper.xml
src/main/resources/mapper/DiscreteParameterMatrixMapper.xml
+44
-0
No files found.
src/main/java/com/aps/controller/DiscreteParameterDurationController.java
0 → 100644
View file @
3ea2f6bc
package
com
.
aps
.
controller
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* <p>
* 前端控制器
* </p>
*
* @author MyBatis-Plus
* @since 2025-12-05
*/
@RestController
@RequestMapping
(
"/discreteParameterDuration"
)
public
class
DiscreteParameterDurationController
{
}
src/main/java/com/aps/controller/DiscreteParameterMatrixController.java
0 → 100644
View file @
3ea2f6bc
package
com
.
aps
.
controller
;
import
com.aps.service.DiscreteParameterMatrixService
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
@RestController
@RequestMapping
(
"/api/discrete-parameter-matrix"
)
@Tag
(
name
=
"离散参数"
,
description
=
"离散参数"
)
public
class
DiscreteParameterMatrixController
{
@Autowired
private
DiscreteParameterMatrixService
discreteParameterMatrixService
;
// @GetMapping("/value")
// public double getDiscreteParameterMatrixValue(
// @RequestParam Long firstDetailId,
// @RequestParam Long secondDetailId) {
// return discreteParameterMatrixService.getDiscreteParameterMatrixValue(firstDetailId, secondDetailId);
// }
}
\ No newline at end of file
src/main/java/com/aps/entity/Algorithm/DependencyType.java
View file @
3ea2f6bc
...
@@ -19,4 +19,47 @@ public enum DependencyType {
...
@@ -19,4 +19,47 @@ public enum DependencyType {
public
int
getValue
()
{
public
int
getValue
()
{
return
value
;
return
value
;
}
}
public
static
DependencyType
fromValueSafe
(
Integer
value
)
{
if
(
value
==
null
)
{
return
FinishToStart
;
// 默认值
}
for
(
DependencyType
type
:
values
())
{
if
(
type
.
value
==
value
)
{
return
type
;
}
}
return
FinishToStart
;
// 无效值也返回默认值
}
/**
* 转换方法
*/
public
static
DependencyType
fromValue
(
int
value
)
{
for
(
DependencyType
type
:
values
())
{
if
(
type
.
value
==
value
)
{
return
type
;
}
}
throw
new
IllegalArgumentException
(
"无效的DependencyType值: "
+
value
);
}
/**
* 验证方法
*/
public
static
boolean
isValid
(
Integer
value
)
{
if
(
value
==
null
)
return
false
;
for
(
DependencyType
type
:
values
())
{
if
(
type
.
value
==
value
)
return
true
;
}
return
false
;
}
}
}
src/main/java/com/aps/entity/DiscreteParameterDuration.java
0 → 100644
View file @
3ea2f6bc
package
com
.
aps
.
entity
;
import
lombok.Data
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.time.LocalDateTime
;
@Data
public
class
DiscreteParameterDuration
{
private
String
id
;
private
LocalDateTime
creationtime
;
private
Long
creatoruserid
;
private
LocalDateTime
lastmodificationtime
;
private
Long
lastmodifieruserid
;
private
Long
isdeleted
;
private
LocalDateTime
deletiontime
;
private
Long
deleteruserid
;
private
String
exp1
;
private
String
exp2
;
private
BigDecimal
exp3
;
private
BigDecimal
exp4
;
private
LocalDateTime
exp5
;
private
LocalDateTime
exp6
;
private
Long
equiptypeid
;
private
String
equiptypename
;
private
Long
equipid
;
private
String
equipname
;
private
Long
measureparameterid
;
private
String
measureparametername
;
private
BigDecimal
measureduration
;
private
String
measureunit
;
private
Long
measureunitid
;
private
BigDecimal
duration
;
private
String
unit
;
private
Long
unitid
;
private
String
groupid
;
private
String
groupname
;
private
String
parameterid
;
private
String
parametername
;
}
\ No newline at end of file
src/main/java/com/aps/entity/DiscreteParameterMatrix.java
0 → 100644
View file @
3ea2f6bc
package
com
.
aps
.
entity
;
import
lombok.Data
;
import
java.math.BigDecimal
;
import
java.time.LocalDateTime
;
@Data
public
class
DiscreteParameterMatrix
{
private
String
id
;
private
LocalDateTime
creationtime
;
private
Long
creatoruserid
;
private
LocalDateTime
lastmodificationtime
;
private
Long
lastmodifieruserid
;
private
Long
isdeleted
;
private
LocalDateTime
deletiontime
;
private
Long
deleteruserid
;
private
String
exp1
;
private
String
exp2
;
private
BigDecimal
exp3
;
private
BigDecimal
exp4
;
private
LocalDateTime
exp5
;
private
LocalDateTime
exp6
;
private
Long
isglobal
;
private
Long
isequiptype
;
private
Long
isequip
;
private
String
groupid
;
private
String
groupname
;
private
String
firstparameterid
;
private
String
firstparametername
;
private
String
secondparameterid
;
private
String
secondparametername
;
private
double
duration
;
private
String
unit
;
private
Long
unitid
;
private
Long
equipid
;
private
String
equipname
;
private
Long
equiptypeid
;
private
String
equiptypename
;
}
\ No newline at end of file
src/main/java/com/aps/entity/ProdProcessExec.java
View file @
3ea2f6bc
...
@@ -82,4 +82,13 @@ public class ProdProcessExec {
...
@@ -82,4 +82,13 @@ public class ProdProcessExec {
private
String
parameterId
;
private
String
parameterId
;
private
String
parameterName
;
private
String
parameterName
;
/**
* 连接属性
*/
private
Integer
connectProperty
;
/**
* 连接属性名称
*/
private
String
connectPropertyName
;
}
}
\ No newline at end of file
src/main/java/com/aps/entity/basic/Entry.java
View file @
3ea2f6bc
package
com
.
aps
.
entity
.
basic
;
package
com
.
aps
.
entity
.
basic
;
import
com.aps.entity.Algorithm.OperationDependency
;
import
com.aps.entity.Algorithm.OperationDependency
;
import
com.aps.entity.RoutingDiscreteParam
;
import
lombok.Data
;
import
lombok.Data
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
...
@@ -49,7 +50,7 @@ public class Entry {
...
@@ -49,7 +50,7 @@ public class Entry {
/**
/**
* 离散参数
* 离散参数
*/
*/
public
List
<
String
>
DiscreteParameter
;
public
List
<
RoutingDiscreteParam
>
DiscreteParameter
;
/**
/**
* 基因编号
* 基因编号
*/
*/
...
@@ -96,4 +97,9 @@ public class Entry {
...
@@ -96,4 +97,9 @@ public class Entry {
* 所需物料
* 所需物料
*/
*/
public
List
<
MaterialRequirement
>
MaterialRequirements
;
// 所需物料
public
List
<
MaterialRequirement
>
MaterialRequirements
;
// 所需物料
/**
* 设备资源组
*/
public
Long
EquipTypeID
;
}
}
src/main/java/com/aps/mapper/DiscreteParameterDurationMapper.java
0 → 100644
View file @
3ea2f6bc
package
com
.
aps
.
mapper
;
import
com.aps.entity.DiscreteParameterDuration
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
/**
* <p>
* Mapper 接口
* </p>
*
* @author MyBatis-Plus
* @since 2025-12-05
*/
public
interface
DiscreteParameterDurationMapper
extends
BaseMapper
<
DiscreteParameterDuration
>
{
}
src/main/java/com/aps/mapper/DiscreteParameterMatrixMapper.java
0 → 100644
View file @
3ea2f6bc
package
com
.
aps
.
mapper
;
import
com.aps.entity.DiscreteParameterMatrix
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
/**
* <p>
* Mapper 接口
* </p>
*
* @author MyBatis-Plus
* @since 2025-12-03
*/
public
interface
DiscreteParameterMatrixMapper
extends
BaseMapper
<
DiscreteParameterMatrix
>
{
}
src/main/java/com/aps/service/Algorithm/GeneticDecoder.java
View file @
3ea2f6bc
...
@@ -236,6 +236,9 @@ public class GeneticDecoder {
...
@@ -236,6 +236,9 @@ public class GeneticDecoder {
.
filter
(
t
->
t
.
getMachineId
()==
machine
.
getId
())
.
filter
(
t
->
t
.
getMachineId
()==
machine
.
getId
())
.
findFirst
().
orElse
(
null
);
.
findFirst
().
orElse
(
null
);
int
teardownTime
=
machineOption
.
getTeardownTime
();
int
teardownTime
=
machineOption
.
getTeardownTime
();
int
preTime
=
machineOption
.
getPreTime
();
int
preTime
=
machineOption
.
getPreTime
();
int
setupTime
=
calculateSetupTime
(
chromosome
.
getResult
(),
operation
,
machine
,
machineOption
);
int
setupTime
=
calculateSetupTime
(
chromosome
.
getResult
(),
operation
,
machine
,
machineOption
);
...
...
src/main/java/com/aps/service/DiscreteParameterDurationService.java
0 → 100644
View file @
3ea2f6bc
package
com
.
aps
.
service
;
import
com.aps.entity.DiscreteParameterDuration
;
import
com.baomidou.mybatisplus.extension.service.IService
;
/**
* <p>
* 服务类
* </p>
*
* @author MyBatis-Plus
* @since 2025-12-05
*/
public
interface
DiscreteParameterDurationService
extends
IService
<
DiscreteParameterDuration
>
{
double
getDiscreteParameterMatrixValue
(
Long
fistDetail
,
Long
secondDetail
);
}
src/main/java/com/aps/service/DiscreteParameterMatrixService.java
0 → 100644
View file @
3ea2f6bc
package
com
.
aps
.
service
;
import
com.aps.entity.DiscreteParameterMatrix
;
import
com.aps.entity.basic.Entry
;
import
com.baomidou.mybatisplus.extension.service.IService
;
/**
* <p>
* 服务类
* </p>
*
* @author MyBatis-Plus
* @since 2025-12-03
*/
public
interface
DiscreteParameterMatrixService
extends
IService
<
DiscreteParameterMatrix
>
{
double
getDiscreteParameterMatrixValue
(
Entry
entry
,
Entry
lastEntry
);
}
src/main/java/com/aps/service/impl/DiscreteParameterDurationServiceImpl.java
0 → 100644
View file @
3ea2f6bc
package
com
.
aps
.
service
.
impl
;
import
com.aps.entity.DiscreteParameterDuration
;
import
com.aps.entity.DiscreteParameterMatrix
;
import
com.aps.entity.RoutingDiscreteParam
;
import
com.aps.mapper.DiscreteParameterDurationMapper
;
import
com.aps.service.DiscreteParameterDurationService
;
import
com.aps.service.RoutingDiscreteParamService
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
import
java.util.Objects
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
/**
* <p>
* 服务实现类
* </p>
*
* @author MyBatis-Plus
* @since 2025-12-05
*/
@Service
public
class
DiscreteParameterDurationServiceImpl
extends
ServiceImpl
<
DiscreteParameterDurationMapper
,
DiscreteParameterDuration
>
implements
DiscreteParameterDurationService
{
@Autowired
private
RoutingDiscreteParamService
_routingDiscreteParamService
;
@Override
public
double
getDiscreteParameterMatrixValue
(
Long
fistDetail
,
Long
secondDetail
)
{
List
<
RoutingDiscreteParam
>
firstParams
=
getRoutingParams
(
fistDetail
);
List
<
RoutingDiscreteParam
>
secondParams
=
getRoutingParams
(
secondDetail
);
findMatchingParams
(
firstParams
,
secondParams
);
return
0
;
}
private
List
<
RoutingDiscreteParam
>
findMatchingParams
(
List
<
RoutingDiscreteParam
>
firstParams
,
List
<
RoutingDiscreteParam
>
secondParams
)
{
Set
<
String
>
secondGroupIds
=
secondParams
.
stream
()
.
map
(
RoutingDiscreteParam:
:
getGroupId
)
.
filter
(
Objects:
:
nonNull
)
.
collect
(
Collectors
.
toSet
());
return
firstParams
.
stream
()
.
filter
(
param
->
param
.
getGroupId
()
!=
null
&&
secondGroupIds
.
contains
(
param
.
getGroupId
()))
.
collect
(
Collectors
.
toList
());
}
private
List
<
RoutingDiscreteParam
>
getRoutingParams
(
Long
detailId
)
{
return
_routingDiscreteParamService
.
lambdaQuery
()
.
eq
(
RoutingDiscreteParam:
:
getRoutingDetailId
,
detailId
)
.
eq
(
RoutingDiscreteParam:
:
getIsDeleted
,
0
)
.
list
();
}
private
double
findMaxChangeOverTime
(
List
<
RoutingDiscreteParam
>
matchingParams
,
List
<
RoutingDiscreteParam
>
secondParams
)
{
Set
<
String
>
groupIds
=
matchingParams
.
stream
()
.
map
(
RoutingDiscreteParam:
:
getGroupId
)
.
filter
(
Objects:
:
nonNull
)
.
collect
(
Collectors
.
toSet
());
if
(
groupIds
.
isEmpty
())
{
return
0.0
;
}
// 获取矩阵数据
List
<
DiscreteParameterDuration
>
matrixData
=
getMatrixData
(
groupIds
);
// // 按优先级查找匹配的矩阵记录
// List<DiscreteParameterMatrix> matchedMatrix = findMatchedMatrixByPriority(
// matchingParams, secondParams, matrixData);
return
0.0
;
}
private
List
<
DiscreteParameterDuration
>
getMatrixData
(
Set
<
String
>
groupIds
)
{
// 直接使用this调用,避免循环依赖
return
this
.
lambdaQuery
()
.
in
(
DiscreteParameterDuration:
:
getGroupid
,
groupIds
)
.
eq
(
DiscreteParameterDuration:
:
getIsdeleted
,
0
)
.
list
();
}
}
src/main/java/com/aps/service/impl/DiscreteParameterMatrixServiceImpl.java
0 → 100644
View file @
3ea2f6bc
package
com
.
aps
.
service
.
impl
;
import
com.aps.entity.DiscreteParameterMatrix
;
import
com.aps.entity.RoutingDiscreteParam
;
import
com.aps.entity.basic.Entry
;
import
com.aps.mapper.DiscreteParameterMatrixMapper
;
import
com.aps.service.DiscreteParameterMatrixService
;
import
com.aps.service.RoutingDiscreteParamService
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
import
java.util.Objects
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
/**
* <p>
* 服务实现类
* </p>
*
* @author MyBatis-Plus
* @since 2025-12-03
*/
@Service
public
class
DiscreteParameterMatrixServiceImpl
extends
ServiceImpl
<
DiscreteParameterMatrixMapper
,
DiscreteParameterMatrix
>
implements
DiscreteParameterMatrixService
{
@Autowired
private
RoutingDiscreteParamService
_routingDiscreteParamService
;
@Override
public
double
getDiscreteParameterMatrixValue
(
Entry
entry
,
Entry
lastEntry
)
{
// 1. 参数验证
if
(
entry
==
null
||
lastEntry
==
null
)
{
return
0.0
;
}
// 2. 获取基础数据
List
<
RoutingDiscreteParam
>
firstParams
=
lastEntry
.
getDiscreteParameter
();
List
<
RoutingDiscreteParam
>
secondParams
=
entry
.
getDiscreteParameter
();
if
(
firstParams
.
isEmpty
()
||
secondParams
.
isEmpty
())
{
return
0.0
;
}
// 3. 查找匹配的参数
List
<
RoutingDiscreteParam
>
matchingParams
=
findMatchingParams
(
firstParams
,
secondParams
);
if
(
matchingParams
.
isEmpty
())
{
return
0.0
;
}
long
firstEquipId
=
lastEntry
.
getSelectMachineID
();
long
secondEquipId
=
entry
.
getSelectMachineID
();
long
firstEquipTypeId
=
lastEntry
.
getEquipTypeID
();
long
secondEquipTypeId
=
entry
.
getSelectMachineID
();
// 4. 获取矩阵数据并计算最大时长
return
findMaxChangeOverTime
(
matchingParams
,
secondParams
,
firstEquipId
,
secondEquipId
,
firstEquipTypeId
,
secondEquipTypeId
);
}
/**
* 获取路由参数列表
*/
private
List
<
RoutingDiscreteParam
>
getRoutingParams
(
Long
detailId
)
{
return
_routingDiscreteParamService
.
lambdaQuery
()
.
eq
(
RoutingDiscreteParam:
:
getRoutingDetailId
,
detailId
)
.
eq
(
RoutingDiscreteParam:
:
getIsDeleted
,
0
)
.
list
();
}
/**
* 查找匹配的参数(first中groupId在second中也存在的参数)
*/
private
List
<
RoutingDiscreteParam
>
findMatchingParams
(
List
<
RoutingDiscreteParam
>
firstParams
,
List
<
RoutingDiscreteParam
>
secondParams
)
{
Set
<
String
>
secondGroupIds
=
secondParams
.
stream
()
.
map
(
RoutingDiscreteParam:
:
getGroupId
)
.
filter
(
Objects:
:
nonNull
)
.
collect
(
Collectors
.
toSet
());
return
firstParams
.
stream
()
.
filter
(
param
->
param
.
getGroupId
()
!=
null
&&
secondGroupIds
.
contains
(
param
.
getGroupId
()))
.
collect
(
Collectors
.
toList
());
}
/**
* 查找最大换型时间
*/
private
double
findMaxChangeOverTime
(
List
<
RoutingDiscreteParam
>
matchingParams
,
List
<
RoutingDiscreteParam
>
secondParams
,
long
firstEquipId
,
long
secondEquipId
,
long
firstEquipTypeId
,
long
secondEquipTypeId
)
{
Set
<
String
>
groupIds
=
matchingParams
.
stream
()
.
map
(
RoutingDiscreteParam:
:
getGroupId
)
.
filter
(
Objects:
:
nonNull
)
.
collect
(
Collectors
.
toSet
());
if
(
groupIds
.
isEmpty
())
{
return
0.0
;
}
// 获取矩阵数据
List
<
DiscreteParameterMatrix
>
matrixData
=
getMatrixData
(
groupIds
);
// 按优先级查找匹配的矩阵记录
List
<
DiscreteParameterMatrix
>
matchedMatrix
=
findMatchedMatrixByPriority
(
matchingParams
,
secondParams
,
matrixData
,
firstEquipId
,
secondEquipId
,
firstEquipTypeId
,
secondEquipTypeId
);
return
getMaxDuration
(
matchedMatrix
);
}
/**
* 获取矩阵数据
*/
private
List
<
DiscreteParameterMatrix
>
getMatrixData
(
Set
<
String
>
groupIds
)
{
// 直接使用this调用,避免循环依赖
return
this
.
lambdaQuery
()
.
in
(
DiscreteParameterMatrix:
:
getGroupid
,
groupIds
)
.
eq
(
DiscreteParameterMatrix:
:
getIsdeleted
,
0
)
.
list
();
}
/**
* 按优先级查找匹配的矩阵记录
*/
private
List
<
DiscreteParameterMatrix
>
findMatchedMatrixByPriority
(
List
<
RoutingDiscreteParam
>
matchingParams
,
List
<
RoutingDiscreteParam
>
secondParams
,
List
<
DiscreteParameterMatrix
>
matrixData
,
long
firstEquipId
,
long
secondEquipId
,
long
firstEquipTypeId
,
long
secondEquipTypeId
)
{
// 优先级1: 设备级别匹配 (isEquip=1, isEquipType=0, isGlobal=0)
List
<
DiscreteParameterMatrix
>
result
=
findMatrixMatches
(
matchingParams
,
secondParams
,
matrixData
,
1
,
0
,
0
,
firstEquipId
,
secondEquipId
,
firstEquipTypeId
,
secondEquipTypeId
);
if
(!
result
.
isEmpty
())
{
return
result
;
}
// 优先级2: 设备类型级别匹配 (isEquip=0, isEquipType=1, isGlobal=0)
result
=
findMatrixMatches
(
matchingParams
,
secondParams
,
matrixData
,
0
,
1
,
0
,
firstEquipId
,
secondEquipId
,
firstEquipTypeId
,
secondEquipTypeId
);
if
(!
result
.
isEmpty
())
{
return
result
;
}
// 优先级3: 全局级别匹配 (isEquip=0, isEquipType=0, isGlobal=1)
return
findMatrixMatches
(
matchingParams
,
secondParams
,
matrixData
,
0
,
0
,
1
,
firstEquipId
,
secondEquipId
,
firstEquipTypeId
,
secondEquipTypeId
);
}
/**
* 查找矩阵匹配记录
*/
private
List
<
DiscreteParameterMatrix
>
findMatrixMatches
(
List
<
RoutingDiscreteParam
>
matchingParams
,
List
<
RoutingDiscreteParam
>
secondParams
,
List
<
DiscreteParameterMatrix
>
matrixData
,
int
isEquip
,
int
isEquipType
,
int
isGlobal
,
long
firstEquipId
,
long
secondEquipId
,
long
firstEquipTypeId
,
long
secondEquipTypeId
)
{
return
matchingParams
.
stream
()
.
flatMap
(
firstParam
->
secondParams
.
stream
()
.
flatMap
(
secondParam
->
matrixData
.
stream
()
.
filter
(
matrix
->
isMatrixMatch
(
matrix
,
firstParam
,
secondParam
,
isEquip
,
isEquipType
,
isGlobal
,
firstEquipId
,
secondEquipId
,
firstEquipTypeId
,
secondEquipTypeId
))
)
)
.
collect
(
Collectors
.
toList
());
}
/**
* 检查矩阵是否匹配
*/
/**
* 检查矩阵是否匹配(最简修正)
*/
private
boolean
isMatrixMatch
(
DiscreteParameterMatrix
matrix
,
RoutingDiscreteParam
firstParam
,
RoutingDiscreteParam
secondParam
,
int
requiredEquip
,
int
requiredEquipType
,
int
requiredGlobal
,
long
firstEquipId
,
long
secondEquipId
,
long
firstEquipTypeId
,
long
secondEquipTypeId
)
{
// 1. 先检查参数ID匹配
if
(!
Objects
.
equals
(
matrix
.
getFirstparameterid
(),
firstParam
.
getParameterId
())
||
!
Objects
.
equals
(
matrix
.
getSecondparameterid
(),
secondParam
.
getParameterId
()))
{
return
false
;
}
// 2. 按优先级检查:处理null值,null视为0
if
(
requiredEquip
==
1
)
{
return
((
matrix
.
getIsequip
()
!=
null
?
matrix
.
getIsequip
()
:
0
)
==
1
)
&&
Objects
.
equals
(
matrix
.
getEquipid
(),
firstEquipId
)
&&
Objects
.
equals
(
matrix
.
getEquipid
(),
secondEquipId
)
&&
firstEquipId
==
secondEquipId
;
// 确保前后工序使用同一设备
}
if
(
requiredEquipType
==
1
)
{
return
((
matrix
.
getIsequiptype
()
!=
null
?
matrix
.
getIsequiptype
()
:
0
)
==
1
)
&&
Objects
.
equals
(
matrix
.
getEquiptypeid
(),
firstEquipTypeId
)
&&
Objects
.
equals
(
matrix
.
getEquiptypeid
(),
secondEquipTypeId
)
&&
firstEquipTypeId
==
secondEquipTypeId
;
// 确保前后工序使用同类型设备
}
if
(
requiredGlobal
==
1
)
{
return
(
matrix
.
getIsglobal
()
!=
null
?
matrix
.
getIsglobal
()
:
0
)
==
1
;
}
return
false
;
}
/**
* 获取最大时长
*/
private
double
getMaxDuration
(
List
<
DiscreteParameterMatrix
>
matrixList
)
{
return
matrixList
.
stream
()
.
filter
(
matrix
->
matrix
.
getDuration
()
>
0
)
.
map
(
DiscreteParameterMatrix:
:
getDuration
)
// 保持Double类型
.
max
(
Double:
:
compareTo
)
// 使用Double的比较器
.
orElse
(
0.0
);
}
}
\ No newline at end of file
src/main/java/com/aps/service/impl/LanuchServiceImpl.java
View file @
3ea2f6bc
...
@@ -721,6 +721,14 @@ public class LanuchServiceImpl implements LanuchService {
...
@@ -721,6 +721,14 @@ public class LanuchServiceImpl implements LanuchService {
prodProcessExec
.
setPostprocessingTime
(
detail
.
getPostprocessingTime
());
prodProcessExec
.
setPostprocessingTime
(
detail
.
getPostprocessingTime
());
prodProcessExec
.
setId
(
String
.
valueOf
(
SnowFlackIdWorker
.
getId
()));
prodProcessExec
.
setId
(
String
.
valueOf
(
SnowFlackIdWorker
.
getId
()));
prodProcessExec
.
setConnectProperty
(
detail
.
getConnectProperty
());
prodProcessExec
.
setConnectPropertyName
(
detail
.
getConnectPropertyName
());
prodProcessExec
.
setSpeed
(
prodProcessExec
.
setSpeed
(
Optional
.
ofNullable
(
detail
.
getRuntime
())
Optional
.
ofNullable
(
detail
.
getRuntime
())
.
filter
(
out
->
detail
.
getSingleOut
()
!=
null
)
.
filter
(
out
->
detail
.
getSingleOut
()
!=
null
)
...
...
src/main/java/com/aps/service/plan/PlanResultService.java
View file @
3ea2f6bc
...
@@ -757,6 +757,18 @@ order.setDueDate(LocalDateTime.of(2025, 12, 1,0,0,0));
...
@@ -757,6 +757,18 @@ order.setDueDate(LocalDateTime.of(2025, 12, 1,0,0,0));
.
eq
(
ProdProcessExec:
:
getSceneId
,
SceneId
)
.
eq
(
ProdProcessExec:
:
getSceneId
,
SceneId
)
.
list
();
.
list
();
// 获取op列表中所有的routingDetailId
List
<
Long
>
routingDetailIds
=
ProdProcessExecs
.
stream
()
.
map
(
ProdProcessExec:
:
getRoutingDetailId
)
.
filter
(
Objects:
:
nonNull
)
.
distinct
()
.
collect
(
Collectors
.
toList
());
// 查询RoutingDiscreteParam中routingDetailId在上述列表中的所有记录
List
<
RoutingDiscreteParam
>
routingDiscreteParams
=
_routingDiscreteParamService
.
lambdaQuery
()
.
in
(
RoutingDiscreteParam:
:
getRoutingDetailId
,
routingDetailIds
)
.
eq
(
RoutingDiscreteParam:
:
getIsDeleted
,
0
)
.
list
();
List
<
ProdOrderProcess
>
ProdOrderProcesss
=
_prodOrderProcessService
.
lambdaQuery
()
List
<
ProdOrderProcess
>
ProdOrderProcesss
=
_prodOrderProcessService
.
lambdaQuery
()
...
@@ -822,21 +834,38 @@ order.setDueDate(LocalDateTime.of(2025, 12, 1,0,0,0));
...
@@ -822,21 +834,38 @@ order.setDueDate(LocalDateTime.of(2025, 12, 1,0,0,0));
}
}
entry
.
setPrevEntryIds
(
OperationDependency
);
entry
.
setPrevEntryIds
(
OperationDependency
);
}
}
ProdProcessExec
op
=
ProdProcessExecs
.
stream
()
.
filter
(
t
->
t
.
getExecId
().
equals
(
entry
.
getExecId
()))
.
findFirst
().
orElse
(
null
);
if
(
nodeInfo
.
getNewChildIds
()!=
null
)
if
(
nodeInfo
.
getNewChildIds
()!=
null
)
{
{
List
<
OperationDependency
>
OperationDependency
=
new
ArrayList
<>();
List
<
OperationDependency
>
OperationDependency
=
new
ArrayList
<>();
for
(
int
id
:
nodeInfo
.
getNewChildIds
())
{
for
(
int
id
:
nodeInfo
.
getNewChildIds
())
{
OperationDependency
od
=
new
OperationDependency
();
OperationDependency
od
=
new
OperationDependency
();
od
.
setNextOperationId
(
id
);
od
.
setNextOperationId
(
id
);
// 记录属性
if
(
op
!=
null
)
{
od
.
setDependencyType
(
DependencyType
.
fromValueSafe
(
op
.
getConnectProperty
()));
}
else
{
od
.
setDependencyType
(
DependencyType
.
FinishToStart
);
}
OperationDependency
.
add
(
od
);
OperationDependency
.
add
(
od
);
}
}
entry
.
setNextEntryIds
(
OperationDependency
);
entry
.
setNextEntryIds
(
OperationDependency
);
}
}
ProdProcessExec
op
=
ProdProcessExecs
.
stream
()
.
filter
(
t
->
t
.
getExecId
().
equals
(
entry
.
getExecId
()))
.
findFirst
().
orElse
(
null
);
if
(
op
!=
null
)
if
(
op
!=
null
)
{
{
entry
.
setDiscreteParameter
(
routingDiscreteParams
.
stream
().
filter
(
t
->
t
.
getRoutingDetailId
().
equals
(
op
.
getRoutingDetailId
())).
collect
(
Collectors
.
toList
()));
entry
.
setEquipTypeID
(
op
.
getMachineId
());
entry
.
setOrderId
(
op
.
getOrderId
());
entry
.
setOrderId
(
op
.
getOrderId
());
entry
.
setQuantity
(
op
.
getPlanQty
());
entry
.
setQuantity
(
op
.
getPlanQty
());
entry
.
setRoutingDetailId
(
op
.
getRoutingDetailId
());
entry
.
setRoutingDetailId
(
op
.
getRoutingDetailId
());
...
...
src/main/resources/mapper/DiscreteParameterDurationMapper.xml
0 → 100644
View file @
3ea2f6bc
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.aps.mapper.DiscreteParameterDurationMapper"
>
<!-- 通用查询映射结果 -->
<resultMap
id=
"BaseResultMap"
type=
"com.aps.entity.DiscreteParameterDuration"
>
<id
column=
"ID"
property=
"id"
/>
<result
column=
"CREATIONTIME"
property=
"creationtime"
/>
<result
column=
"CREATORUSERID"
property=
"creatoruserid"
/>
<result
column=
"LASTMODIFICATIONTIME"
property=
"lastmodificationtime"
/>
<result
column=
"LASTMODIFIERUSERID"
property=
"lastmodifieruserid"
/>
<result
column=
"ISDELETED"
property=
"isdeleted"
/>
<result
column=
"DELETIONTIME"
property=
"deletiontime"
/>
<result
column=
"DELETERUSERID"
property=
"deleteruserid"
/>
<result
column=
"EXP1"
property=
"exp1"
/>
<result
column=
"EXP2"
property=
"exp2"
/>
<result
column=
"EXP3"
property=
"exp3"
/>
<result
column=
"EXP4"
property=
"exp4"
/>
<result
column=
"EXP5"
property=
"exp5"
/>
<result
column=
"EXP6"
property=
"exp6"
/>
<result
column=
"EQUIPTYPEID"
property=
"equiptypeid"
/>
<result
column=
"EQUIPTYPENAME"
property=
"equiptypename"
/>
<result
column=
"EQUIPID"
property=
"equipid"
/>
<result
column=
"EQUIPNAME"
property=
"equipname"
/>
<result
column=
"MEASUREPARAMETERID"
property=
"measureparameterid"
/>
<result
column=
"MEASUREPARAMETERNAME"
property=
"measureparametername"
/>
<result
column=
"MEASUREDURATION"
property=
"measureduration"
/>
<result
column=
"MEASUREUNIT"
property=
"measureunit"
/>
<result
column=
"MEASUREUNITID"
property=
"measureunitid"
/>
<result
column=
"DURATION"
property=
"duration"
/>
<result
column=
"UNIT"
property=
"unit"
/>
<result
column=
"UNITID"
property=
"unitid"
/>
<result
column=
"GROUPID"
property=
"groupid"
/>
<result
column=
"GROUPNAME"
property=
"groupname"
/>
<result
column=
"PARAMETERID"
property=
"parameterid"
/>
<result
column=
"PARAMETERNAME"
property=
"parametername"
/>
</resultMap>
<!-- 通用查询结果列 -->
<sql
id=
"Base_Column_List"
>
ID, CREATIONTIME, CREATORUSERID, LASTMODIFICATIONTIME, LASTMODIFIERUSERID, ISDELETED, DELETIONTIME, DELETERUSERID, EXP1, EXP2, EXP3, EXP4, EXP5, EXP6, EQUIPTYPEID, EQUIPTYPENAME, EQUIPID, EQUIPNAME, MEASUREPARAMETERID, MEASUREPARAMETERNAME, MEASUREDURATION, MEASUREUNIT, MEASUREUNITID, DURATION, UNIT, UNITID, GROUPID, GROUPNAME, PARAMETERID, PARAMETERNAME
</sql>
</mapper>
src/main/resources/mapper/DiscreteParameterMatrixMapper.xml
0 → 100644
View file @
3ea2f6bc
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.aps.mapper.DiscreteParameterMatrixMapper"
>
<!-- 通用查询映射结果 -->
<resultMap
id=
"BaseResultMap"
type=
"com.aps.entity.DiscreteParameterMatrix"
>
<id
column=
"ID"
property=
"id"
/>
<result
column=
"CREATIONTIME"
property=
"creationtime"
/>
<result
column=
"CREATORUSERID"
property=
"creatoruserid"
/>
<result
column=
"LASTMODIFICATIONTIME"
property=
"lastmodificationtime"
/>
<result
column=
"LASTMODIFIERUSERID"
property=
"lastmodifieruserid"
/>
<result
column=
"ISDELETED"
property=
"isdeleted"
/>
<result
column=
"DELETIONTIME"
property=
"deletiontime"
/>
<result
column=
"DELETERUSERID"
property=
"deleteruserid"
/>
<result
column=
"EXP1"
property=
"exp1"
/>
<result
column=
"EXP2"
property=
"exp2"
/>
<result
column=
"EXP3"
property=
"exp3"
/>
<result
column=
"EXP4"
property=
"exp4"
/>
<result
column=
"EXP5"
property=
"exp5"
/>
<result
column=
"EXP6"
property=
"exp6"
/>
<result
column=
"ISGLOBAL"
property=
"isglobal"
/>
<result
column=
"ISEQUIPTYPE"
property=
"isequiptype"
/>
<result
column=
"ISEQUIP"
property=
"isequip"
/>
<result
column=
"GROUPID"
property=
"groupid"
/>
<result
column=
"GROUPNAME"
property=
"groupname"
/>
<result
column=
"FIRSTPARAMETERID"
property=
"firstparameterid"
/>
<result
column=
"FIRSTPARAMETERNAME"
property=
"firstparametername"
/>
<result
column=
"SECONDPARAMETERID"
property=
"secondparameterid"
/>
<result
column=
"SECONDPARAMETERNAME"
property=
"secondparametername"
/>
<result
column=
"DURATION"
property=
"duration"
/>
<result
column=
"UNIT"
property=
"unit"
/>
<result
column=
"UNITID"
property=
"unitid"
/>
<result
column=
"EQUIPID"
property=
"equipid"
/>
<result
column=
"EQUIPNAME"
property=
"equipname"
/>
<result
column=
"EQUIPTYPEID"
property=
"equiptypeid"
/>
<result
column=
"EQUIPTYPENAME"
property=
"equiptypename"
/>
</resultMap>
<!-- 通用查询结果列 -->
<sql
id=
"Base_Column_List"
>
ID, CREATIONTIME, CREATORUSERID, LASTMODIFICATIONTIME, LASTMODIFIERUSERID, ISDELETED, DELETIONTIME, DELETERUSERID, EXP1, EXP2, EXP3, EXP4, EXP5, EXP6, ISGLOBAL, ISEQUIPTYPE, ISEQUIP, GROUPID, GROUPNAME, FIRSTPARAMETERID, FIRSTPARAMETERNAME, SECONDPARAMETERID, SECONDPARAMETERNAME, DURATION, UNIT, UNITID, EQUIPID, EQUIPNAME, EQUIPTYPEID, EQUIPTYPENAME
</sql>
</mapper>
\ No newline at end of file
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