Commit 34d7e700 authored by Tong Li's avatar Tong Li

优化速度

parent 993afbe6
package com.aps.entity.Algorithm; package com.aps.entity.Algorithm;
import com.aps.entity.basic.TimeSegment;
import lombok.Data; import lombok.Data;
import java.util.List;
/** /**
* 作者:佟礼 * 作者:佟礼
* 时间:2025-11-21 * 时间:2025-11-21
...@@ -14,6 +17,9 @@ public class ScheduleResultDetail { ...@@ -14,6 +17,9 @@ public class ScheduleResultDetail {
private double OneTime; // 单件工时 private double OneTime; // 单件工时
private double Quantity; // 时间段 private double Quantity; // 时间段
private List<TimeSegment> usedSegment;
// Key 的 getter/setter // Key 的 getter/setter
public String getKey() { public String getKey() {
return Key; return Key;
......
...@@ -374,6 +374,7 @@ if(finishedOrder==null||finishedOrder.size()==0) ...@@ -374,6 +374,7 @@ if(finishedOrder==null||finishedOrder.size()==0)
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);
......
...@@ -97,7 +97,8 @@ public class PlanResultService { ...@@ -97,7 +97,8 @@ public class PlanResultService {
@Autowired @Autowired
private MaterialInfoMapper materialInfoMapper; private MaterialInfoMapper materialInfoMapper;
@Autowired
private MaterialPurchaseMapper materialPurchaseMapper;
@Autowired @Autowired
private StockMapper stockMapper; private StockMapper stockMapper;
...@@ -1137,14 +1138,19 @@ private GlobalParam InitGlobalParam() ...@@ -1137,14 +1138,19 @@ private GlobalParam InitGlobalParam()
public List<Material> getMaterials(){ public List<Material> getMaterials(){
List<Material> materials=new ArrayList<>(); List<Material> materials=new ArrayList<>();
System.out.println("开始初始化物料数据");
LambdaQueryWrapper<MaterialInfo> MaterialInfoWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<MaterialInfo> MaterialInfoWrapper = new LambdaQueryWrapper<>();
MaterialInfoWrapper.eq(MaterialInfo::getIsdeleted,0); MaterialInfoWrapper.eq(MaterialInfo::getIsdeleted,0);
List<MaterialInfo> materiallist=materialInfoMapper.selectList(MaterialInfoWrapper); List<MaterialInfo> materiallist=materialInfoMapper.selectList(MaterialInfoWrapper);
LambdaQueryWrapper<MaterialPurchase> materialPurchaseWrapper= new LambdaQueryWrapper<>();
materialPurchaseWrapper.eq(MaterialPurchase::getIsdeleted,0);
List<MaterialPurchase> MaterialPurchaselist=materialPurchaseMapper.selectList(materialPurchaseWrapper);
System.out.println("开始初始化物料数据");
LambdaQueryWrapper<Stock> StockWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<Stock> StockWrapper = new LambdaQueryWrapper<>();
StockWrapper.eq(Stock::getIsdeleted,0); StockWrapper.eq(Stock::getIsdeleted,0);
......
...@@ -38,13 +38,13 @@ public class PlanResultServiceTest { ...@@ -38,13 +38,13 @@ public class PlanResultServiceTest {
// nsgaiiUtils.Test(); // nsgaiiUtils.Test();
//planResultService.execute2("C5FB5EF2A7334A0A92F826F4937E1008"); //planResultService.execute2("C5FB5EF2A7334A0A92F826F4937E1008");
// planResultService.execute2("726D4C1A712B4B1393175BD44B775B66"); planResultService.execute2("726D4C1A712B4B1393175BD44B775B66");
planResultService.execute2("BCA6FA43FFA444D3952CF8F6E1EA291B"); // planResultService.execute2("BCA6FA43FFA444D3952CF8F6E1EA291B");
// 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<>();
// opids.add(1); // opids.add(1);
// planResultService.Move("B571EF6682DB463AB2977B1055A74112",opids,t,3403L); // planResultService.Move("B571EF6682DB463AB2977B1055A74112",opids,t,3403L);
// planResultService.Redecode("12345679"); planResultService.Redecode("12345679");
// MaintenanceWindow maintenanceWindow=new MaintenanceWindow(); // MaintenanceWindow maintenanceWindow=new MaintenanceWindow();
// maintenanceWindow.setStartTime(LocalDateTime.of(2025, 10, 21, 0, 0, 0)); // maintenanceWindow.setStartTime(LocalDateTime.of(2025, 10, 21, 0, 0, 0));
// maintenanceWindow.setEndTime(LocalDateTime.of(2025, 10, 31, 0, 0, 0)); // maintenanceWindow.setEndTime(LocalDateTime.of(2025, 10, 31, 0, 0, 0));
......
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