Commit 20177850 authored by DESKTOP-VKRD9QF\Administration's avatar DESKTOP-VKRD9QF\Administration
parents 2f57eaff 92c13010
...@@ -41,6 +41,8 @@ public class Order { ...@@ -41,6 +41,8 @@ public class Order {
/*使用这个半成品的成品工单*/ /*使用这个半成品的成品工单*/
private List<Integer> FinishOrderId ; private List<Integer> FinishOrderId ;
private boolean newCreate = false; private boolean newCreate = false;
private boolean createBom = false;
/// <summary> /// <summary>
/// 关联的成品工序ID(核心:明确该半成品服务于哪个成品工序) /// 关联的成品工序ID(核心:明确该半成品服务于哪个成品工序)
/// </summary> /// </summary>
......
...@@ -281,10 +281,10 @@ if(finishedOrder==null||finishedOrder.size()==0) ...@@ -281,10 +281,10 @@ if(finishedOrder==null||finishedOrder.size()==0)
.keySet().stream() .keySet().stream()
.collect(Collectors.toMap(k -> k, k -> 0)); .collect(Collectors.toMap(k -> k, k -> 0));
Map<Long, String> machineState = chromosome.getMachines().stream() // Map<Long, String> machineState = chromosome.getMachines().stream()
.collect(Collectors.toMap(Machine::getId, m -> "")); // .collect(Collectors.toMap(Machine::getId, m -> ""));
List<Entry> allScheduledOps = new ArrayList<>(); // List<Entry> allScheduledOps = new ArrayList<>();
for (int groupId : chromosome.getOperationSequencing()) { for (int groupId : chromosome.getOperationSequencing()) {
int scheduledCount = orderProcessCounter.get(groupId); int scheduledCount = orderProcessCounter.get(groupId);
......
...@@ -188,7 +188,7 @@ if(routingIds.size()==0) ...@@ -188,7 +188,7 @@ if(routingIds.size()==0)
*/ */
public BOMBuildResult buildOrderBOM(int parent, String materialID, String mainorderId, public BOMBuildResult buildOrderBOM(int parent, String materialID, String mainorderId,
String childorderId, double parentQuantity, int level,Order forder,int finishOpertionID) { String childorderId, double parentQuantity, int level,Order forder,int finishOpertionID) {
forder.setCreateBom(true);
RoutingHeader routingHeaders= headers.stream() RoutingHeader routingHeaders= headers.stream()
.filter(t->t.getId()==parent|| t.getMaterialId().equals(materialID)) .filter(t->t.getId()==parent|| t.getMaterialId().equals(materialID))
.findFirst() .findFirst()
...@@ -571,7 +571,8 @@ if(routingIds.size()==0) ...@@ -571,7 +571,8 @@ if(routingIds.size()==0)
needed -= useq; needed -= useq;
order.setSYQuantity(order.getSYQuantity() - useq); order.setSYQuantity(order.getSYQuantity() - useq);
if (order.getFinishOrderId().size() == 1) { //防止已经生成过一次
if (!order.isCreateBom()) {
// 递归构建BOM // 递归构建BOM
int l = level + 1; int l = level + 1;
......
...@@ -684,6 +684,9 @@ order.setDueDate(LocalDateTime.of(2025, 12, 1,0,0,0)); ...@@ -684,6 +684,9 @@ order.setDueDate(LocalDateTime.of(2025, 12, 1,0,0,0));
public void WriteScheduleSummary(Chromosome schedule) { public void WriteScheduleSummary(Chromosome schedule) {
// 写入日志 // 写入日志
FileHelper.writeLogFile("\n=== Schedule Summary === "); FileHelper.writeLogFile("\n=== Schedule Summary === ");
FileHelper.writeLogFile(String.format("ID: %s", schedule.getID()));
FileHelper.writeLogFile(String.format("ID: %s", schedule.getGeneStr()));
FileHelper.writeLogFile(String.format("Operation: %s", schedule.getOperationStr())); FileHelper.writeLogFile(String.format("Operation: %s", schedule.getOperationStr()));
FileHelper.writeLogFile(String.format("Makespan: %f minutes", schedule.getMakespan())); FileHelper.writeLogFile(String.format("Makespan: %f minutes", schedule.getMakespan()));
FileHelper.writeLogFile(String.format("Total Tardiness: %f hours", schedule.getDelayTime())); FileHelper.writeLogFile(String.format("Total Tardiness: %f hours", schedule.getDelayTime()));
...@@ -704,13 +707,13 @@ order.setDueDate(LocalDateTime.of(2025, 12, 1,0,0,0)); ...@@ -704,13 +707,13 @@ order.setDueDate(LocalDateTime.of(2025, 12, 1,0,0,0));
for (GAScheduleResult job : sortedJobs) { for (GAScheduleResult job : sortedJobs) {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.append(String.format( sb.append(String.format(
"[%d-%d]:[%s-%s] Order %d, Machine %d, Operation %d, Batch %.1f, processingTime %.1f, 后处理 %d, 后处理 %d, 离散参数 %d", "[%d-%d]:[%s-%s] Order %d,OrderID %s, Machine %d, Operation %d, Batch %.1f, processingTime %.1f, 前处理 %d, 后处理 %d, 离散参数 %d",
job.getStartTime(), job.getStartTime(),
job.getEndTime(), job.getEndTime(),
ConvertTime(job.getStartTime()), ConvertTime(job.getStartTime()),
ConvertTime(job.getEndTime()), ConvertTime(job.getEndTime()),
job.getGroupId(), job.getGroupId(),
job.getOrderId(),
job.getMachineId(), job.getMachineId(),
job.getOperationId(), job.getOperationId(),
job.getQuantity(), job.getQuantity(),
...@@ -739,7 +742,7 @@ order.setDueDate(LocalDateTime.of(2025, 12, 1,0,0,0)); ...@@ -739,7 +742,7 @@ order.setDueDate(LocalDateTime.of(2025, 12, 1,0,0,0));
} }
} }
private String ConvertTime(int minute) { private String ConvertTime(int minute) {
return baseTime.plusSeconds(minute).format(java.time.format.DateTimeFormatter.ofPattern("MM-dd HH:mm")); return baseTime.plusSeconds(minute).format(java.time.format.DateTimeFormatter.ofPattern("YYYY-MM-dd HH:mm:ss"));
} }
/** /**
...@@ -900,6 +903,10 @@ private GlobalParam InitGlobalParam() ...@@ -900,6 +903,10 @@ private GlobalParam InitGlobalParam()
{ {
globalParam.set_smoothSetup(c.isValue()); globalParam.set_smoothSetup(c.isValue());
} }
else if(c.getTitle().contains("自制件"))
{
globalParam.setIsCheckSf(c.isValue());
}
} }
...@@ -923,6 +930,7 @@ private GlobalParam InitGlobalParam() ...@@ -923,6 +930,7 @@ private GlobalParam InitGlobalParam()
order.setPriority(lo.getOrderPriority()); order.setPriority(lo.getOrderPriority());
order.setActualPriority(lo.getOrderPriority()); order.setActualPriority(lo.getOrderPriority());
order.setQuantity(lo.getQuantity()); order.setQuantity(lo.getQuantity());
order.setSYQuantity(lo.getQuantity());
orders.add(order); orders.add(order);
} }
OrderSortRule rule = createMultiConditionRule(orders); OrderSortRule rule = createMultiConditionRule(orders);
......
...@@ -37,7 +37,7 @@ public class PlanResultServiceTest { ...@@ -37,7 +37,7 @@ public class PlanResultServiceTest {
// nsgaiiUtils.Test(); // nsgaiiUtils.Test();
// planResultService.execute2("31EC5BAF7F6B41DFB79AB031D81C53C0"); // planResultService.execute2("31EC5BAF7F6B41DFB79AB031D81C53C0");
planResultService.execute2("4072BCD6A43B468F96489211AD041A26"); planResultService.execute2("8B13052B347B4FC4B21D59E685B06642");
// LocalDateTime t= LocalDateTime.of(2025, 11, 15, 6, 51, 11); // LocalDateTime t= LocalDateTime.of(2025, 11, 15, 6, 51, 11);
// List<Integer> opids=new ArrayList<>(); // List<Integer> opids=new ArrayList<>();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment