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
fa5b9c03
Commit
fa5b9c03
authored
Jan 23, 2026
by
DESKTOP-VKRD9QF\Administration
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
离散参数修改,公共分页和list查询修改
parent
d98a5bf6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
977 additions
and
411 deletions
+977
-411
ChromosomeDataController.java
...a/com/aps/controller/common/ChromosomeDataController.java
+21
-0
Entry.java
src/main/java/com/aps/entity/basic/Entry.java
+2
-2
Order.java
src/main/java/com/aps/entity/basic/Order.java
+134
-12
Paged.java
src/main/java/com/aps/entity/common/Paged.java
+22
-5
GeneticDecoder.java
src/main/java/com/aps/service/Algorithm/GeneticDecoder.java
+6
-3
DiscreteParameterDurationService.java
...ava/com/aps/service/DiscreteParameterDurationService.java
+3
-3
ChromosomeDataService.java
...in/java/com/aps/service/common/ChromosomeDataService.java
+496
-197
DatabaseQueryService.java
...ain/java/com/aps/service/common/DatabaseQueryService.java
+62
-5
DiscreteParameterDurationServiceImpl.java
...ps/service/impl/DiscreteParameterDurationServiceImpl.java
+17
-26
DiscreteParameterMatrixServiceImpl.java
.../aps/service/impl/DiscreteParameterMatrixServiceImpl.java
+2
-0
LanuchServiceImpl.java
src/main/java/com/aps/service/impl/LanuchServiceImpl.java
+211
-157
PlanResultService.java
src/main/java/com/aps/service/plan/PlanResultService.java
+1
-1
No files found.
src/main/java/com/aps/controller/common/ChromosomeDataController.java
View file @
fa5b9c03
...
@@ -4,6 +4,7 @@ import com.aps.common.util.R;
...
@@ -4,6 +4,7 @@ import com.aps.common.util.R;
import
com.aps.entity.Algorithm.Chromosome
;
import
com.aps.entity.Algorithm.Chromosome
;
import
com.aps.entity.basic.Entry
;
import
com.aps.entity.basic.Entry
;
import
com.aps.entity.basic.MachineOption
;
import
com.aps.entity.basic.MachineOption
;
import
com.aps.entity.common.FieldInfo
;
import
com.aps.entity.common.Paged
;
import
com.aps.entity.common.Paged
;
import
com.aps.service.common.ChromosomeDataService
;
import
com.aps.service.common.ChromosomeDataService
;
import
com.aps.service.plan.PlanResultService
;
import
com.aps.service.plan.PlanResultService
;
...
@@ -179,6 +180,26 @@ public class ChromosomeDataController {
...
@@ -179,6 +180,26 @@ public class ChromosomeDataController {
}
}
/**
* 获取实体的字段信息
* 示例:
* - 文件实体: GET /queryChromosome/order/info?sceneId=xxx
* - 数据库实体: GET /queryChromosome/user/info
*
* @param sceneId 场景ID (文件实体可选,数据库实体不需要)
* @param entityName 实体名称 (如: order, entry, machine, user, department等)
* @return 字段信息列表
*/
@GetMapping
(
"/{entityName}/info"
)
@Operation
(
summary
=
"获取实体字段信息"
,
description
=
"根据实体名称获取字段名称、类型等信息,支持文件实体和数据库实体"
)
public
R
<
List
<
FieldInfo
>>
getEntityInfo
(
@Parameter
(
description
=
"实体名称"
,
required
=
true
)
@PathVariable
String
entityName
)
{
List
<
FieldInfo
>
fieldInfos
=
chromosomeDataService
.
getEntityInfo
(
entityName
);
return
R
.
ok
(
fieldInfos
);
}
...
...
src/main/java/com/aps/entity/basic/Entry.java
View file @
fa5b9c03
...
@@ -143,8 +143,8 @@ public class Entry {
...
@@ -143,8 +143,8 @@ public class Entry {
private
BigDecimal
singleOut
;
//单件产出
private
BigDecimal
singleOut
;
//单件产出
private
double
changeLineTime
;
//换模时间
private
double
changeLineTime
;
//换模时间
private
BigDecimal
setupTime
;
//准备时间
private
BigDecimal
setupTime
;
//准备时间
private
int
teardownTime
;
//
收尾时间
(后处理时间)
private
int
teardownTime
;
// (后处理时间)
private
int
preTime
;
//
收尾时间(后
处理时间)
private
int
preTime
;
//
(前
处理时间)
//常数时间
//常数时间
private
int
constTime
;
private
int
constTime
;
private
String
equipCode
;
//设备编码
private
String
equipCode
;
//设备编码
...
...
src/main/java/com/aps/entity/basic/Order.java
View file @
fa5b9c03
...
@@ -12,46 +12,168 @@ import java.util.List;
...
@@ -12,46 +12,168 @@ import java.util.List;
*/
*/
@Data
@Data
public
class
Order
{
public
class
Order
{
/**
* 自增主键
*/
private
int
id
;
private
int
id
;
/**
* 订单ID
*/
private
String
orderId
;
private
String
orderId
;
/**
* 订单编码
*/
private
String
orderCode
;
private
String
orderCode
;
/**
* 产品ID
*/
private
int
productId
;
private
int
productId
;
/**
* 物料ID
*/
private
String
materialId
;
private
String
materialId
;
/**
* 物料编码
*/
private
String
materialCode
;
private
String
materialCode
;
/**
* 物料名称
*/
private
String
materialName
;
private
String
materialName
;
/**
* 系列
*/
private
String
serie
;
private
String
serie
;
/**
* 工艺路线ID
*/
private
Integer
routingId
;
private
Integer
routingId
;
/**
* 工艺路线编码
*/
private
String
routingCode
;
private
String
routingCode
;
private
double
quantity
=
100
;
// 100个
/**
* 订单数量,默认值:100
*/
private
double
quantity
=
100
;
/**
* 生产数量
*/
private
double
sYQuantity
;
private
double
sYQuantity
;
/**
* 开始日期
*/
private
LocalDateTime
startDate
;
private
LocalDateTime
startDate
;
/**
* 到期日期
*/
private
LocalDateTime
dueDate
;
private
LocalDateTime
dueDate
;
/**
* 组开始日期
*/
private
LocalDateTime
groupStartDate
;
private
LocalDateTime
groupStartDate
;
/**
* 组到期日期
*/
private
LocalDateTime
groupDueDate
;
private
LocalDateTime
groupDueDate
;
/**
* 订单完成时间
*/
private
LocalDateTime
orderCompletion
;
private
LocalDateTime
orderCompletion
;
/**
* 订单开始时间
*/
private
LocalDateTime
orderStart
;
private
LocalDateTime
orderStart
;
/**
* 机器加工时间
*/
private
double
machineProcessingTime
;
private
double
machineProcessingTime
;
/**
* 订单流程
*/
private
double
orderFlow
;
private
double
orderFlow
;
/**
* 订单生产时间
*/
private
double
orderProductTime
;
private
double
orderProductTime
;
/**
* 延误时间
*/
private
double
tardiness
;
private
double
tardiness
;
/**
* 优先级
*/
private
int
priority
;
private
int
priority
;
/**
* 是否可拆分,默认值:false
*/
private
boolean
canSplit
=
false
;
private
boolean
canSplit
=
false
;
/**
* 是否可中断,默认值:false
*/
private
boolean
canInterrupt
=
false
;
private
boolean
canInterrupt
=
false
;
/**
* 实际优先级
*/
private
double
actualPriority
;
private
double
actualPriority
;
/**
* 主ID
*/
private
String
mainId
;
private
String
mainId
;
/*使用这个半成品的成品工单*/
private
List
<
Integer
>
FinishOrderId
;
/**
* 使用这个半成品的成品工单
*/
private
List
<
Integer
>
FinishOrderId
;
/**
* 是否新创建,默认值:false
*/
private
boolean
newCreate
=
false
;
private
boolean
newCreate
=
false
;
/**
* 是否创建BOM,默认值:false
*/
private
boolean
createBom
=
false
;
private
boolean
createBom
=
false
;
/
// <summary>
/
**
///
关联的成品工序ID(核心:明确该半成品服务于哪个成品工序)
*
关联的成品工序ID(核心:明确该半成品服务于哪个成品工序)
/// </summary>
*/
private
List
<
Integer
>
TargetFinishedOperationId
;
private
List
<
Integer
>
TargetFinishedOperationId
;
private
double
delayHours
;
//延迟时间
/**
//物料需求
* 延迟时间
*/
private
double
delayHours
;
/**
* 物料需求
*/
private
List
<
OrderMaterialRequirement
>
materialRequirementList
;
private
List
<
OrderMaterialRequirement
>
materialRequirementList
;
}
}
\ No newline at end of file
src/main/java/com/aps/entity/common/Paged.java
View file @
fa5b9c03
...
@@ -7,22 +7,23 @@ import java.util.List;
...
@@ -7,22 +7,23 @@ import java.util.List;
import
java.util.Optional
;
import
java.util.Optional
;
/**
/**
*
*
* @Title: PagedGridResult.java
* @Title: PagedGridResult.java
* @Package com.lei.utils
* @Package com.lei.utils
* @Description: 用来返回分页Grid的数据格式
* @Description: 用来返回分页Grid的数据格式
*/
*/
public
class
Paged
{
public
class
Paged
{
private
Integer
pageIndex
=
1
;
//当前页
private
Integer
pageIndex
=
1
;
//当前页
private
Integer
pageSize
=
1000
;
//每页多少条
private
Integer
pageSize
=
1000
;
//每页多少条
private
Integer
total
=
0
;
// 特殊设置,总记录数,如果前台带有此值,则分页查询时不查询总数。
private
Integer
total
=
0
;
// 特殊设置,总记录数,如果前台带有此值,则分页查询时不查询总数。
private
List
<
String
>
sortByList
=
new
ArrayList
<>();
// 多字段排序列表,格式如["type asc", "id desc"]
private
String
sortBy
=
""
;
//排序字段
private
String
sortBy
=
""
;
//排序字段
private
Boolean
desc
=
true
;
//是否倒序
private
Boolean
desc
=
true
;
//是否倒序
private
String
fields
=
""
;
// 返回的字段
private
String
fields
=
""
;
// 返回的字段
private
String
table
;
// 返回的表
private
String
table
=
""
;
// 返回的表
//分组字段名称
private
String
groupName
;
private
String
groupName
;
private
Boolean
and
=
true
;
// 条件逻辑关系,true为与关系,false为或关系
private
List
<
ConditionEntity
>
conditions
=
new
ArrayList
<>();
//条件集合
private
List
<
ConditionEntity
>
conditions
=
new
ArrayList
<>();
//条件集合
...
@@ -125,4 +126,20 @@ public class Paged {
...
@@ -125,4 +126,20 @@ public class Paged {
public
void
setTotal
(
Integer
total
)
{
public
void
setTotal
(
Integer
total
)
{
this
.
total
=
total
;
this
.
total
=
total
;
}
}
public
List
<
String
>
getSortByList
()
{
return
sortByList
;
}
public
void
setSortByList
(
List
<
String
>
sortByList
)
{
this
.
sortByList
=
sortByList
;
}
public
Boolean
getAnd
()
{
return
and
;
}
public
void
setAnd
(
Boolean
and
)
{
this
.
and
=
and
;
}
}
}
src/main/java/com/aps/service/Algorithm/GeneticDecoder.java
View file @
fa5b9c03
...
@@ -914,11 +914,14 @@ if(finishedOrder==null||finishedOrder.size()==0)
...
@@ -914,11 +914,14 @@ if(finishedOrder==null||finishedOrder.size()==0)
// setupTime = (prev.getProductId() != operation.getProductId())
// setupTime = (prev.getProductId() != operation.getProductId())
// ? (int) discreteParameterMatrixService.getDiscreteParameterMatrixValue(prev, operation)
// ? (int) discreteParameterMatrixService.getDiscreteParameterMatrixValue(prev, operation)
// : 0;
// : 0;
DiscreteParameterMatrixService
service
=
SpringContextUtil
.
getBean
(
DiscreteParameterMatrixService
.
class
);
DiscreteParameterMatrixService
discreteParameterMatrixService
=
SpringContextUtil
.
getBean
(
DiscreteParameterMatrixService
.
class
);
DiscreteParameterDurationService
discreteParameterDurationService
=
SpringContextUtil
.
getBean
(
DiscreteParameterDurationService
.
class
);
double
discreteParameterMatrixValue
=
service
.
getDiscreteParameterMatrixValue
(
operation
,
prev
);
double
discreteParameterDurationValue
=
discreteParameterDurationService
.
calculateChangeoverTime
(
prev
,
operation
,
machine
,
_allOperations
,
earliestStartTime
,
machineTasks
);
setupTime
=
(
int
)
discreteParameterMatrixValue
;
double
discreteParameterMatrixValue
=
discreteParameterMatrixService
.
getDiscreteParameterMatrixValue
(
operation
,
prev
);
setupTime
=
(
int
)
Math
.
max
(
discreteParameterDurationValue
,
discreteParameterMatrixValue
);
// setupTime = (int) discreteParameterMatrixValue;
...
...
src/main/java/com/aps/service/DiscreteParameterDurationService.java
View file @
fa5b9c03
...
@@ -19,8 +19,8 @@ import java.util.List;
...
@@ -19,8 +19,8 @@ import java.util.List;
public
interface
DiscreteParameterDurationService
extends
IService
<
DiscreteParameterDuration
>
{
public
interface
DiscreteParameterDurationService
extends
IService
<
DiscreteParameterDuration
>
{
double
calculateChangeoverTime
(
List
<
GAScheduleResult
>
existingGenes
,
double
calculateChangeoverTime
(
Entry
lastEntry
,
Entry
operation
,
Entry
entry
,
Machine
machine
,
Machine
machine
,
List
<
Entry
>
allOperations
,
int
startTime
);
List
<
Entry
>
allOperations
,
int
startTime
,
List
<
GAScheduleResult
>
machineTasks
);
}
}
src/main/java/com/aps/service/common/ChromosomeDataService.java
View file @
fa5b9c03
This diff is collapsed.
Click to expand it.
src/main/java/com/aps/service/common/DatabaseQueryService.java
View file @
fa5b9c03
...
@@ -35,13 +35,23 @@ public class DatabaseQueryService {
...
@@ -35,13 +35,23 @@ public class DatabaseQueryService {
// 处理条件
// 处理条件
int
paramIndex
=
1
;
int
paramIndex
=
1
;
if
(
paged
.
getConditions
()
!=
null
&&
!
paged
.
getConditions
().
isEmpty
())
{
if
(
paged
.
getConditions
()
!=
null
&&
!
paged
.
getConditions
().
isEmpty
())
{
boolean
isAnd
=
paged
.
getAnd
()
!=
null
&&
paged
.
getAnd
();
String
logicalOperator
=
isAnd
?
" AND "
:
" OR "
;
// 构建条件列表
List
<
String
>
conditionSqlList
=
new
ArrayList
<>();
for
(
ConditionEntity
condition
:
paged
.
getConditions
())
{
for
(
ConditionEntity
condition
:
paged
.
getConditions
())
{
String
conditionSql
=
buildConditionSql
(
condition
,
params
,
paramIndex
);
String
conditionSql
=
buildConditionSql
(
condition
,
params
,
paramIndex
);
if
(
conditionSql
!=
null
)
{
if
(
conditionSql
!=
null
)
{
whereClause
.
append
(
" AND "
).
appen
d
(
conditionSql
);
conditionSqlList
.
ad
d
(
conditionSql
);
paramIndex
++;
paramIndex
++;
}
}
}
}
// 如果有条件,使用指定的逻辑运算符连接
if
(!
conditionSqlList
.
isEmpty
())
{
whereClause
.
append
(
" AND ("
).
append
(
String
.
join
(
logicalOperator
,
conditionSqlList
)).
append
(
")"
);
}
}
}
// 构建排序
// 构建排序
...
@@ -110,13 +120,23 @@ public class DatabaseQueryService {
...
@@ -110,13 +120,23 @@ public class DatabaseQueryService {
// 处理条件
// 处理条件
int
paramIndex
=
1
;
int
paramIndex
=
1
;
if
(
paged
.
getConditions
()
!=
null
&&
!
paged
.
getConditions
().
isEmpty
())
{
if
(
paged
.
getConditions
()
!=
null
&&
!
paged
.
getConditions
().
isEmpty
())
{
boolean
isAnd
=
paged
.
getAnd
()
!=
null
&&
paged
.
getAnd
();
String
logicalOperator
=
isAnd
?
" AND "
:
" OR "
;
// 构建条件列表
List
<
String
>
conditionSqlList
=
new
ArrayList
<>();
for
(
ConditionEntity
condition
:
paged
.
getConditions
())
{
for
(
ConditionEntity
condition
:
paged
.
getConditions
())
{
String
conditionSql
=
buildConditionSql
(
condition
,
params
,
paramIndex
);
String
conditionSql
=
buildConditionSql
(
condition
,
params
,
paramIndex
);
if
(
conditionSql
!=
null
)
{
if
(
conditionSql
!=
null
)
{
whereClause
.
append
(
" AND "
).
appen
d
(
conditionSql
);
conditionSqlList
.
ad
d
(
conditionSql
);
paramIndex
++;
paramIndex
++;
}
}
}
}
// 如果有条件,使用指定的逻辑运算符连接
if
(!
conditionSqlList
.
isEmpty
())
{
whereClause
.
append
(
" AND ("
).
append
(
String
.
join
(
logicalOperator
,
conditionSqlList
)).
append
(
")"
);
}
}
}
// 构建排序
// 构建排序
...
@@ -188,11 +208,48 @@ public class DatabaseQueryService {
...
@@ -188,11 +208,48 @@ public class DatabaseQueryService {
* 构建排序子句
* 构建排序子句
*/
*/
private
String
buildOrderBy
(
Paged
paged
)
{
private
String
buildOrderBy
(
Paged
paged
)
{
// 优先使用sortByList进行多字段排序
if
(
paged
.
getSortByList
()
!=
null
&&
!
paged
.
getSortByList
().
isEmpty
())
{
StringBuilder
orderBy
=
new
StringBuilder
(
" ORDER BY "
);
boolean
first
=
true
;
for
(
String
sortBy
:
paged
.
getSortByList
())
{
if
(!
first
)
{
orderBy
.
append
(
", "
);
}
first
=
false
;
// 解析排序规则,格式如"field asc"或"field desc"
String
[]
parts
=
sortBy
.
trim
().
split
(
"\\s+"
);
if
(
parts
.
length
<
2
)
{
continue
;
// 跳过格式不正确的排序规则
}
String
fieldName
=
parts
[
0
];
String
direction
=
"DESC"
.
equalsIgnoreCase
(
parts
[
1
])
?
"DESC"
:
"ASC"
;
// 处理字段名大小写问题:将驼峰命名转换为下划线大写(数据库字段格式)
fieldName
=
camelCaseToUnderScoreUpperCase
(
fieldName
).
toUpperCase
();
orderBy
.
append
(
fieldName
).
append
(
" "
).
append
(
direction
);
}
// 如果有有效的排序规则,返回构建的ORDER BY子句
if
(!
first
)
{
return
orderBy
.
toString
();
}
}
// 使用原有sortBy和desc字段进行单字段排序
if
(
paged
.
getSortBy
()
!=
null
&&
!
paged
.
getSortBy
().
isEmpty
())
{
if
(
paged
.
getSortBy
()
!=
null
&&
!
paged
.
getSortBy
().
isEmpty
())
{
String
direction
=
Boolean
.
TRUE
.
equals
(
paged
.
getDesc
())
?
"DESC"
:
"ASC"
;
String
direction
=
Boolean
.
TRUE
.
equals
(
paged
.
getDesc
())
?
"DESC"
:
"ASC"
;
return
" ORDER BY "
+
paged
.
getSortBy
()
+
" "
+
direction
;
// 处理字段名大小写问题:将驼峰命名转换为下划线大写(数据库字段格式)
String
fieldName
=
camelCaseToUnderScoreUpperCase
(
paged
.
getSortBy
()).
toUpperCase
();
return
" ORDER BY "
+
fieldName
+
" "
+
direction
;
}
}
return
" ORDER BY ID DESC"
;
// 默认按ID降序
// 默认按ID降序
return
" ORDER BY ID DESC"
;
}
}
/**
/**
...
@@ -262,7 +319,7 @@ public class DatabaseQueryService {
...
@@ -262,7 +319,7 @@ public class DatabaseQueryService {
return
fieldName
+
" = :"
+
paramName
;
return
fieldName
+
" = :"
+
paramName
;
}
}
}
}
/**
/**
* 驼峰命名转下划线大写:prodProduct -> PROD_PRODUCT
* 驼峰命名转下划线大写:prodProduct -> PROD_PRODUCT
*/
*/
...
...
src/main/java/com/aps/service/impl/DiscreteParameterDurationServiceImpl.java
View file @
fa5b9c03
package
com
.
aps
.
service
.
impl
;
package
com
.
aps
.
service
.
impl
;
import
com.aps.entity.Algorithm.GAScheduleResult
;
import
com.aps.entity.Algorithm.GAScheduleResult
;
import
com.aps.entity.DiscreteParameterConfigType
;
import
com.aps.entity.DiscreteParameterDuration
;
import
com.aps.entity.DiscreteParameterDuration
;
import
com.aps.entity.basic.Entry
;
import
com.aps.entity.basic.Entry
;
import
com.aps.entity.basic.Machine
;
import
com.aps.entity.basic.Machine
;
...
@@ -22,24 +23,23 @@ public class DiscreteParameterDurationServiceImpl extends ServiceImpl<DiscretePa
...
@@ -22,24 +23,23 @@ public class DiscreteParameterDurationServiceImpl extends ServiceImpl<DiscretePa
* 计算当前工序需要的换型时间
* 计算当前工序需要的换型时间
*/
*/
@Override
@Override
public
double
calculateChangeoverTime
(
List
<
GAScheduleResult
>
existingGenes
,
public
double
calculateChangeoverTime
(
Entry
lastEntry
,
Entry
operation
,
Entry
entry
,
Machine
machine
,
Machine
machine
,
List
<
Entry
>
allOperations
,
List
<
Entry
>
allOperations
,
int
startTime
,
List
<
GAScheduleResult
>
machineTasks
)
{
int
startTime
)
{
if
(
existingGene
s
.
isEmpty
())
{
if
(
machineTask
s
.
isEmpty
())
{
return
0.0
;
return
0.0
;
}
}
// 获取当前工序的所有参数
// 获取当前工序的所有参数
List
<
ParameterPair
>
currentParams
=
getOperationParameters
(
operation
);
List
<
ParameterPair
>
currentParams
=
getOperationParameters
(
entry
);
if
(
currentParams
.
isEmpty
())
{
if
(
currentParams
.
isEmpty
())
{
return
0.0
;
return
0.0
;
}
}
// 获取设备上最后一个任务
// 获取设备上最后一个任务
GAScheduleResult
lastGene
=
existingGene
s
.
stream
()
GAScheduleResult
lastGene
=
machineTask
s
.
stream
()
.
filter
(
g
->
g
.
getMachineId
()
==
machine
.
getId
())
.
filter
(
g
->
g
.
getMachineId
()
==
machine
.
getId
())
.
max
(
Comparator
.
comparingInt
(
GAScheduleResult:
:
getEndTime
))
.
max
(
Comparator
.
comparingInt
(
GAScheduleResult:
:
getEndTime
))
.
orElse
(
null
);
.
orElse
(
null
);
...
@@ -48,27 +48,18 @@ public class DiscreteParameterDurationServiceImpl extends ServiceImpl<DiscretePa
...
@@ -48,27 +48,18 @@ public class DiscreteParameterDurationServiceImpl extends ServiceImpl<DiscretePa
return
0.0
;
return
0.0
;
}
}
if
(
operation
.
getOrderId
()==
"a0e61488-0647-4f8e-a27c-cfed9cbbba52"
){
System
.
out
.
println
(
"lastGene"
+
lastGene
.
getExecId
());
}
// 找到最后一个任务对应的Entry
Entry
prev
=
allOperations
.
stream
()
.
filter
(
t
->
t
.
getExecId
().
equals
(
lastGene
.
getExecId
()))
.
findFirst
().
orElse
(
null
);
if
(
prev
==
null
)
{
if
(
lastEntry
==
null
)
{
return
0.0
;
return
0.0
;
}
}
List
<
ParameterPair
>
lastParams
=
getOperationParameters
(
prev
);
List
<
ParameterPair
>
lastParams
=
getOperationParameters
(
lastEntry
);
List
<
DiscreteParameterDuration
>
parameterDurations
=
this
.
lambdaQuery
().
list
();
List
<
DiscreteParameterDuration
>
parameterDurations
=
this
.
lambdaQuery
().
list
();
// 获取该设备上的所有任务(按开始时间排序)
// 获取该设备上的所有任务(按开始时间排序)
List
<
GAScheduleResult
>
machineGenes
=
existingGene
s
.
stream
()
List
<
GAScheduleResult
>
machineGenes
=
machineTask
s
.
stream
()
.
filter
(
g
->
g
.
getMachineId
()
==
machine
.
getId
())
.
filter
(
g
->
g
.
getMachineId
()
==
machine
.
getId
())
.
sorted
(
Comparator
.
comparingInt
(
GAScheduleResult:
:
getStartTime
))
.
sorted
(
Comparator
.
comparingInt
(
GAScheduleResult:
:
getStartTime
))
.
collect
(
Collectors
.
toList
());
.
collect
(
Collectors
.
toList
());
...
@@ -122,7 +113,7 @@ public class DiscreteParameterDurationServiceImpl extends ServiceImpl<DiscretePa
...
@@ -122,7 +113,7 @@ public class DiscreteParameterDurationServiceImpl extends ServiceImpl<DiscretePa
List
<
DiscreteParameterDuration
>
parameterDurations
,
List
<
DiscreteParameterDuration
>
parameterDurations
,
List
<
Entry
>
allOperations
)
{
List
<
Entry
>
allOperations
)
{
DiscreteParameterDuration
config
=
findParameterConfig
(
currentParam
,
"WorkingDuration"
,
parameterDurations
);
DiscreteParameterDuration
config
=
findParameterConfig
(
currentParam
,
DiscreteParameterConfigType
.
WORKING_DURATION
,
parameterDurations
);
if
(
config
==
null
)
{
if
(
config
==
null
)
{
return
0.0
;
return
0.0
;
}
}
...
@@ -161,7 +152,7 @@ public class DiscreteParameterDurationServiceImpl extends ServiceImpl<DiscretePa
...
@@ -161,7 +152,7 @@ public class DiscreteParameterDurationServiceImpl extends ServiceImpl<DiscretePa
List
<
DiscreteParameterDuration
>
parameterDurations
,
List
<
DiscreteParameterDuration
>
parameterDurations
,
int
startTime
,
List
<
Entry
>
allOperations
)
{
int
startTime
,
List
<
Entry
>
allOperations
)
{
DiscreteParameterDuration
config
=
findParameterConfig
(
currentParam
,
"AbsoluteDuration"
,
parameterDurations
);
DiscreteParameterDuration
config
=
findParameterConfig
(
currentParam
,
DiscreteParameterConfigType
.
ABSOLUTE_DURATION
,
parameterDurations
);
if
(
config
==
null
)
{
if
(
config
==
null
)
{
return
0.0
;
return
0.0
;
}
}
...
@@ -197,7 +188,7 @@ public class DiscreteParameterDurationServiceImpl extends ServiceImpl<DiscretePa
...
@@ -197,7 +188,7 @@ public class DiscreteParameterDurationServiceImpl extends ServiceImpl<DiscretePa
List
<
DiscreteParameterDuration
>
parameterDurations
,
List
<
DiscreteParameterDuration
>
parameterDurations
,
int
startTime
,
List
<
Entry
>
allOperations
)
{
int
startTime
,
List
<
Entry
>
allOperations
)
{
DiscreteParameterDuration
config
=
findParameterConfig
(
currentParam
,
"MaxInterval"
,
parameterDurations
);
DiscreteParameterDuration
config
=
findParameterConfig
(
currentParam
,
DiscreteParameterConfigType
.
MAX_INTERVAL
,
parameterDurations
);
if
(
config
==
null
)
{
if
(
config
==
null
)
{
return
0.0
;
return
0.0
;
}
}
...
@@ -231,7 +222,7 @@ public class DiscreteParameterDurationServiceImpl extends ServiceImpl<DiscretePa
...
@@ -231,7 +222,7 @@ public class DiscreteParameterDurationServiceImpl extends ServiceImpl<DiscretePa
List
<
DiscreteParameterDuration
>
parameterDurations
,
List
<
DiscreteParameterDuration
>
parameterDurations
,
List
<
Entry
>
allOperations
)
{
List
<
Entry
>
allOperations
)
{
DiscreteParameterDuration
config
=
findParameterConfig
(
currentParam
,
"OrderCount"
,
parameterDurations
);
DiscreteParameterDuration
config
=
findParameterConfig
(
currentParam
,
DiscreteParameterConfigType
.
ORDER_COUNT
,
parameterDurations
);
if
(
config
==
null
)
{
if
(
config
==
null
)
{
return
0.0
;
return
0.0
;
}
}
...
@@ -409,12 +400,12 @@ public class DiscreteParameterDurationServiceImpl extends ServiceImpl<DiscretePa
...
@@ -409,12 +400,12 @@ public class DiscreteParameterDurationServiceImpl extends ServiceImpl<DiscretePa
.
collect
(
Collectors
.
toList
());
.
collect
(
Collectors
.
toList
());
}
}
private
DiscreteParameterDuration
findParameterConfig
(
ParameterPair
param
,
String
configType
,
private
DiscreteParameterDuration
findParameterConfig
(
ParameterPair
param
,
DiscreteParameterConfigType
configType
,
List
<
DiscreteParameterDuration
>
parameterDurations
)
{
List
<
DiscreteParameterDuration
>
parameterDurations
)
{
return
parameterDurations
.
stream
()
return
parameterDurations
.
stream
()
.
filter
(
pd
->
param
.
getGroupId
().
equals
(
pd
.
getGroupid
())
&&
.
filter
(
pd
->
param
.
getGroupId
().
equals
(
pd
.
getGroupid
())
&&
param
.
getParameterId
().
equals
(
pd
.
getParameterid
())
&&
param
.
getParameterId
().
equals
(
pd
.
getParameterid
())
&&
configType
.
equals
(
pd
.
getExp1
()
))
configType
.
getValue
()==
pd
.
getMeasureparameterid
(
))
.
findFirst
()
.
findFirst
()
.
orElse
(
null
);
.
orElse
(
null
);
}
}
...
@@ -443,7 +434,7 @@ public class DiscreteParameterDurationServiceImpl extends ServiceImpl<DiscretePa
...
@@ -443,7 +434,7 @@ public class DiscreteParameterDurationServiceImpl extends ServiceImpl<DiscretePa
List
<
DiscreteParameterDuration
>
parameterDurations
,
List
<
DiscreteParameterDuration
>
parameterDurations
,
List
<
Entry
>
allOperations
)
{
List
<
Entry
>
allOperations
)
{
DiscreteParameterDuration
config
=
findParameterConfig
(
currentParam
,
"AccumulatedQuantity"
,
parameterDurations
);
DiscreteParameterDuration
config
=
findParameterConfig
(
currentParam
,
DiscreteParameterConfigType
.
WORKING_QUANTITY
,
parameterDurations
);
if
(
config
==
null
)
{
if
(
config
==
null
)
{
return
0.0
;
return
0.0
;
}
}
...
...
src/main/java/com/aps/service/impl/DiscreteParameterMatrixServiceImpl.java
View file @
fa5b9c03
...
@@ -35,6 +35,8 @@ public class DiscreteParameterMatrixServiceImpl extends ServiceImpl<DiscretePara
...
@@ -35,6 +35,8 @@ public class DiscreteParameterMatrixServiceImpl extends ServiceImpl<DiscretePara
@Override
@Override
public
double
getDiscreteParameterMatrixValue
(
Entry
entry
,
Entry
lastEntry
)
{
public
double
getDiscreteParameterMatrixValue
(
Entry
entry
,
Entry
lastEntry
)
{
// 参数校验
// 参数校验
cleanCache
(
resultCache
,
MAX_RESULT_CACHE_SIZE
);
if
(
entry
==
null
||
lastEntry
==
null
)
{
if
(
entry
==
null
||
lastEntry
==
null
)
{
return
0.0
;
return
0.0
;
...
...
src/main/java/com/aps/service/impl/LanuchServiceImpl.java
View file @
fa5b9c03
This diff is collapsed.
Click to expand it.
src/main/java/com/aps/service/plan/PlanResultService.java
View file @
fa5b9c03
...
@@ -1095,7 +1095,7 @@ private GlobalParam InitGlobalParam()
...
@@ -1095,7 +1095,7 @@ private GlobalParam InitGlobalParam()
{
{
globalParam
.
setIsUseCalendar
(
c
.
isValue
());
globalParam
.
setIsUseCalendar
(
c
.
isValue
());
}
}
else
if
(
c
.
getTitle
().
contain
s
(
"设置时间"
))
else
if
(
c
.
getTitle
().
equal
s
(
"设置时间"
))
{
{
//是否考虑换型时间
//是否考虑换型时间
globalParam
.
set_smoothChangeOver
(
c
.
isValue
());
globalParam
.
set_smoothChangeOver
(
c
.
isValue
());
...
...
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