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
d7642513
Commit
d7642513
authored
Dec 26, 2025
by
DESKTOP-VKRD9QF\Administration
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
报错修改和日志调整
parent
f882d258
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
60 additions
and
23 deletions
+60
-23
LanuchController.java
src/main/java/com/aps/controller/LanuchController.java
+2
-2
ProdProcessExec.java
src/main/java/com/aps/entity/ProdProcessExec.java
+4
-0
Entry.java
src/main/java/com/aps/entity/basic/Entry.java
+7
-0
ProdProcessExecMapper.java
src/main/java/com/aps/mapper/ProdProcessExecMapper.java
+2
-0
GeneticDecoder.java
src/main/java/com/aps/service/Algorithm/GeneticDecoder.java
+10
-10
RoutingDataService.java
...in/java/com/aps/service/Algorithm/RoutingDataService.java
+7
-1
DiscreteParameterMatrixServiceImpl.java
.../aps/service/impl/DiscreteParameterMatrixServiceImpl.java
+7
-4
LanuchServiceImpl.java
src/main/java/com/aps/service/impl/LanuchServiceImpl.java
+10
-1
PlanResultService.java
src/main/java/com/aps/service/plan/PlanResultService.java
+4
-4
ProdProcessExecMapper.xml
src/main/resources/mapper/ProdProcessExecMapper.xml
+7
-1
No files found.
src/main/java/com/aps/controller/LanuchController.java
View file @
d7642513
...
...
@@ -45,7 +45,7 @@ public class LanuchController {
*/
@PostMapping
(
"/schedule"
)
@Operation
(
summary
=
"运算"
)
public
R
<
Chromosome
>
schedule
(
@RequestBody
Map
<
String
,
String
>
params
)
{
public
R
<
String
>
schedule
(
@RequestBody
Map
<
String
,
String
>
params
)
{
String
sceneId
=
params
.
get
(
"sceneId"
);
// 如果需要处理时间字段,可以从params中获取并转换
...
...
@@ -57,7 +57,7 @@ public class LanuchController {
// 根据不同格式解析时间字符串
Chromosome
scheduleChromosomes
=
planResultService
.
schedule
(
sceneId
);
return
R
.
ok
(
scheduleChromosomes
);
return
R
.
ok
(
"运算完成"
);
}
/**
...
...
src/main/java/com/aps/entity/ProdProcessExec.java
View file @
d7642513
...
...
@@ -18,6 +18,10 @@ public class ProdProcessExec {
private
Long
taskSeq
;
private
String
routingDetailName
;
private
Long
machineId
;
private
String
equipTypeName
;
//资源组名称
private
String
equipTypeCode
;
//资源组编码
private
BigDecimal
runtime
;
//持续时间
private
BigDecimal
singleOut
;
//单件产出
private
String
resourceGroup
;
private
Double
planQty
;
private
Double
actualQty
;
...
...
src/main/java/com/aps/entity/basic/Entry.java
View file @
d7642513
...
...
@@ -4,6 +4,7 @@ import com.aps.entity.Algorithm.OperationDependency;
import
com.aps.entity.RoutingDiscreteParam
;
import
lombok.Data
;
import
java.math.BigDecimal
;
import
java.time.LocalDateTime
;
import
java.util.ArrayList
;
import
java.util.List
;
...
...
@@ -122,4 +123,10 @@ public class Entry {
/// 半成品最晚完工时间(即成品工序开始时间-1天)
/// </summary>
public
LocalDateTime
LatestCompletionTime
;
private
String
equipTypeName
;
//资源组名称
private
String
equipTypeCode
;
//资源组编码
private
BigDecimal
runtime
;
//持续时间
private
BigDecimal
singleOut
;
//单件产出
}
src/main/java/com/aps/mapper/ProdProcessExecMapper.java
View file @
d7642513
...
...
@@ -2,6 +2,7 @@ package com.aps.mapper;
import
com.aps.entity.ProdProcessExec
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.apache.ibatis.annotations.Mapper
;
/**
* <p>
...
...
@@ -11,6 +12,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* @author MyBatis-Plus
* @since 2025-11-14
*/
@Mapper
public
interface
ProdProcessExecMapper
extends
BaseMapper
<
ProdProcessExec
>
{
}
src/main/java/com/aps/service/Algorithm/GeneticDecoder.java
View file @
d7642513
...
...
@@ -374,8 +374,8 @@ if(finishedOrder==null||finishedOrder.size()==0)
int
preTime
=
machineOption
.
getPreTime
();
int
setupTime
=
calculateSetupTime
(
chromosome
.
getResult
(),
operation
,
machine
,
machineOption
);
FileHelper
.
writeLogFile
(
" 处理时间: "
+
processingTime
+
", 后处理: "
+
teardownTime
+
", 前处理: "
+
preTime
+
", 换型: "
+
setupTime
+
", 数量: "
+
operation
.
getQuantity
());
//
FileHelper.writeLogFile (" 处理时间: " + processingTime + ", 后处理: " + teardownTime +
//
", 前处理: " + preTime + ", 换型: " + setupTime+ ", 数量: " + operation.getQuantity());
// 确定任务的最早开始时间(基于前一道工序的完整结束时间,包含后处理)
...
...
@@ -404,11 +404,11 @@ if(finishedOrder==null||finishedOrder.size()==0)
machineAvailableTime
+=
setupTime
;
// 平滑模式:换型在非工作时间进行,不额外占用设备时间
System
.
out
.
println
(
" 平滑模式换型:在非工作时间进行,设备可用时间不变"
);
//
System.out.println(" 平滑模式换型:在非工作时间进行,设备可用时间不变");
}
else
{
// 标准模式:换型需要额外占用设备时间
machineAvailableTime
+=
setupTime
;
System
.
out
.
println
(
" 标准模式换型:需要额外占用设备 "
+
setupTime
+
" 分钟"
);
//
System.out.println(" 标准模式换型:需要额外占用设备 " + setupTime + " 分钟");
}
}
...
...
@@ -425,7 +425,7 @@ if(finishedOrder==null||finishedOrder.size()==0)
if
(
_globalParam
.
is_smoothSetup
())
{
// 平滑模式:只需要安排主处理时间
// processingTimeForScheduling = processingTimeTotal;
System
.
out
.
println
(
" 平滑模式:安排主处理时间 "
+
processingTime
+
" 分钟"
);
//
System.out.println(" 平滑模式:安排主处理时间 " + processingTime + " 分钟");
}
else
{
// 标准模式:需要安排主处理时间+换型时间
processingTimeTotal
=
processingTimeTotal
+
setupTime
;
...
...
@@ -466,7 +466,7 @@ if(finishedOrder==null||finishedOrder.size()==0)
.
orElse
(
null
);
if
(
conflictingGene
!=
null
)
{
System
.
out
.
println
(
" ⚠️ 检测到时间冲突,重新调度"
);
//
System.out.println(" ⚠️ 检测到时间冲突,重新调度");
int
conflictSetupStartTime
=
conflictingGene
.
getEndTime
();
int
conflictSetupTime
=
calculateSetupTimeForConflict
(
chromosome
.
getResult
(),
operation
,
machine
,
machineOption
,
conflictingGene
);
int
conflictEarliestStartTime
=
conflictSetupStartTime
+
conflictSetupTime
;
...
...
@@ -485,7 +485,7 @@ if(finishedOrder==null||finishedOrder.size()==0)
.
mapToInt
(
ScheduleResultDetail:
:
getEndTime
)
.
max
()
.
orElse
(
0
);
System
.
out
.
println
(
" 重新安排时间: "
+
ConvertTime
(
startTime
)
+
" - "
+
ConvertTime
(
endTime
));
//
System.out.println(" 重新安排时间: " + ConvertTime(startTime) + " - " + ConvertTime(endTime));
}
}
...
...
@@ -825,7 +825,7 @@ if(finishedOrder==null||finishedOrder.size()==0)
.
orElse
(
null
);
if
(
lastGeneOnMachine
==
null
)
{
System
.
out
.
println
(
"设备 "
+
machine
.
getId
()
+
" 上无历史任务,换型时间为0"
);
//
System.out.println("设备 " + machine.getId() + " 上无历史任务,换型时间为0");
return
0
;
}
Entry
prev
=
_allOperations
.
stream
().
...
...
@@ -845,7 +845,7 @@ if(finishedOrder==null||finishedOrder.size()==0)
double
discreteParameterMatrixValue
=
service
.
getDiscreteParameterMatrixValue
(
prev
,
operation
);
setupTime
=
(
int
)
discreteParameterMatrixValue
;
System
.
out
.
println
(
setupTime
+
"换型时间"
+
"huanxingshijian "
);
//
System.out.println(setupTime+"换型时间"+"huanxingshijian ");
}
}
...
...
@@ -868,7 +868,7 @@ if(finishedOrder==null||finishedOrder.size()==0)
}
if
(
setupTime
>
0
)
{
System
.
out
.
println
(
"设备 "
+
machine
.
getId
()
+
" 需要换型,因为产品从 "
+
conflictingGene
.
getProductId
()
+
" 变更为 "
+
operation
.
getProductId
());
//
System.out.println("设备 " + machine.getId() + " 需要换型,因为产品从 " + conflictingGene.getProductId() + " 变更为 " + operation.getProductId());
}
return
setupTime
;
...
...
src/main/java/com/aps/service/Algorithm/RoutingDataService.java
View file @
d7642513
...
...
@@ -190,6 +190,10 @@ public class RoutingDataService {
{
entry
.
setDiscreteParameter
(
routingDiscreteParams
.
stream
().
filter
(
t
->
t
.
getRoutingDetailId
().
equals
(
op
.
getRoutingDetailId
())).
collect
(
Collectors
.
toList
()));
entry
.
setEquipTypeID
(
op
.
getMachineId
());
entry
.
setEquipTypeName
(
op
.
getEquipTypeName
());
entry
.
setEquipTypeCode
(
op
.
getEquipTypeCode
());
entry
.
setRuntime
(
op
.
getRuntime
());
entry
.
setSingleOut
(
op
.
getSingleOut
());
entry
.
setOrderId
(
op
.
getOrderId
());
entry
.
setQuantity
(
op
.
getPlanQty
());
entry
.
setRoutingId
(
op
.
getRoutingId
());
...
...
@@ -254,8 +258,10 @@ public class RoutingDataService {
for
(
Long
id
:
MachineIds
)
{
Machine
machine
=
new
Machine
();
machine
.
setId
(
id
);
machine
.
setCode
(
""
);
machine
.
setName
(
""
);
machines
.
add
(
machine
);
}
//节假日
// List<MesHoliday> holidays= _MesHolidayService.list();
...
...
src/main/java/com/aps/service/impl/DiscreteParameterMatrixServiceImpl.java
View file @
d7642513
...
...
@@ -53,13 +53,16 @@ public class DiscreteParameterMatrixServiceImpl extends ServiceImpl<DiscretePara
if
(
matchingParams
.
isEmpty
())
{
return
0.0
;
}
long
firstEquipId
=
lastEntry
.
getSelectMachineID
();
long
secondEquipId
=
entry
.
getSelectMachineID
();
long
firstEquipTypeId
=
lastEntry
.
getEquipTypeID
();
long
secondEquipTypeId
=
entry
.
getSelectMachineID
();
long
firstEquipId
=
lastEntry
.
getSelectMachineID
()
!=
null
?
lastEntry
.
getSelectMachineID
()
:
0L
;
long
secondEquipId
=
entry
.
getSelectMachineID
()
!=
null
?
entry
.
getSelectMachineID
()
:
0L
;
long
firstEquipTypeId
=
lastEntry
.
getEquipTypeID
()
!=
null
?
lastEntry
.
getEquipTypeID
()
:
0L
;
long
secondEquipTypeId
=
entry
.
getSelectMachineID
()
!=
null
?
entry
.
getSelectMachineID
()
:
0L
;
if
(
firstEquipId
==
0
||
secondEquipId
==
0
||
firstEquipTypeId
==
0
||
secondEquipTypeId
==
0
)
{
return
0.0
;
}
...
...
src/main/java/com/aps/service/impl/LanuchServiceImpl.java
View file @
d7642513
...
...
@@ -79,6 +79,9 @@ public class LanuchServiceImpl implements LanuchService {
@Autowired
MesScheduleService
mesScheduleService
;
@Autowired
Equiptype1Service
equiptype1Service
;
/**
* 生成场景数据
*
...
...
@@ -643,7 +646,7 @@ public class LanuchServiceImpl implements LanuchService {
public
ProdProcessExec
createProcessExec
(
ProdLaunchOrder
prodOrderMain
,
RoutingDetail
detail
,
String
sceneId
)
{
Equiptype1
equipType
=
equiptype1Service
.
lambdaQuery
().
eq
(
Equiptype1:
:
getId
,
detail
.
getEquipTypeId
()).
one
();
ProdProcessExec
prodProcessExec
=
new
ProdProcessExec
();
prodProcessExec
.
setExecId
(
UUID
.
randomUUID
().
toString
().
replace
(
"-"
,
""
));
...
...
@@ -652,6 +655,12 @@ public class LanuchServiceImpl implements LanuchService {
prodProcessExec
.
setTaskSeq
(
detail
.
getTaskSeq
());
prodProcessExec
.
setRoutingDetailName
(
detail
.
getName
());
prodProcessExec
.
setMachineId
(
detail
.
getEquipTypeId
());
prodProcessExec
.
setRuntime
(
detail
.
getRuntime
());
prodProcessExec
.
setSingleOut
(
detail
.
getSingleOut
());
if
(
equipType
!=
null
)
{
prodProcessExec
.
setEquipTypeName
(
equipType
.
getEquipTypeName
());
prodProcessExec
.
setEquipTypeCode
(
equipType
.
getEquipTypeId
());
}
prodProcessExec
.
setPlanQty
(
prodOrderMain
.
getQuantity
());
prodProcessExec
.
setTargetStartDate
(
prodOrderMain
.
getStartDate
());
prodProcessExec
.
setTargetEndDate
(
prodOrderMain
.
getEndDate
());
...
...
src/main/java/com/aps/service/plan/PlanResultService.java
View file @
d7642513
...
...
@@ -753,10 +753,10 @@ private GlobalParam InitGlobalParam()
{
globalParam
.
setIsUseCalendar
(
c
.
isValue
());
}
else
if
(
c
.
getTitle
().
contains
(
"设置时间"
))
{
globalParam
.
setIsUseCalendar
(
c
.
isValue
());
}
//
else if(c.getTitle().contains("设置时间"))
//
{
//
globalParam.setIsUseCalendar(c.isValue());
//
}
else
if
(
c
.
getTitle
().
contains
(
"原材料"
))
{
...
...
src/main/resources/mapper/ProdProcessExecMapper.xml
View file @
d7642513
...
...
@@ -26,11 +26,17 @@
<result
column=
"LOGICAL_ORDER"
property=
"logicalOrder"
/>
<result
column=
"TARGET_START_DATE"
property=
"targetStartDate"
/>
<result
column=
"TARGET_END_DATE"
property=
"targetEndDate"
/>
<result
column=
"SINGLE_OUT"
property=
"singleOut"
/>
<result
column=
"RUNTIME"
property=
"runtime"
/>
<result
column=
"EQUIP_TYPE_CODE"
property=
"equipTypeCode"
/>
<result
column=
"EQUIP_TYPE_NAME"
property=
"equipTypeName"
/>
</resultMap>
<!-- 通用查询结果列 -->
<sql
id=
"Base_Column_List"
>
EXEC_ID, SCENE_ID, ORDER_ID, PROCESS_ID, PROCESS_NO, PROCESS_NAME, MACHINE_ID, RESOURCE_GROUP, PLAN_QTY, ACTUAL_QTY, PLAN_DURATION, USED_DURATION, REMAIN_DURATION, PROCESS_STATUS, STANDARD_CAPACITY, MIN_CAPACITY, MAX_CAPACITY, PREP_DURATION, CHANGE_DURATION, LOGICAL_ORDER, TARGET_START_DATE, TARGET_END_DATE
EXEC_ID, SCENE_ID, ORDER_ID, PROCESS_ID, PROCESS_NO, PROCESS_NAME, MACHINE_ID, RESOURCE_GROUP, PLAN_QTY, ACTUAL_QTY, PLAN_DURATION, USED_DURATION, REMAIN_DURATION, PROCESS_STATUS, STANDARD_CAPACITY, MIN_CAPACITY, MAX_CAPACITY, PREP_DURATION, CHANGE_DURATION, LOGICAL_ORDER, TARGET_START_DATE, TARGET_END_DATE
, SINGLE_OUT, RUNTIME, EQUIP_TYPE_CODE, EQUIP_TYPE_NAME
</sql>
</mapper>
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