Commit ba8c978a authored by Tong Li's avatar Tong Li

设备维修

parent 9ed1158d
......@@ -169,6 +169,8 @@ Integer newMachineId1=newMachineId.intValue();
MachineSchedulerService machineScheduler = new MachineSchedulerService(
chromosome.getBaseTime());
machineScheduler.ClearMachineCache(machineId);
MachineTimeline machineTimeline = machineScheduler.getOrCreateTimeline(machine);
machine.setAvailability(machineTimeline.getSegments());
}else {
......@@ -244,6 +246,7 @@ Integer newMachineId1=newMachineId.intValue();
machine.getMaintenanceWindows().remove(index.getAsInt());
MachineSchedulerService machineScheduler = new MachineSchedulerService(
chromosome.getBaseTime());
machineScheduler.ClearMachineCache(machineId);
MachineTimeline machineTimeline = machineScheduler.getOrCreateTimeline(machine);
machine.setAvailability(machineTimeline.getSegments());
} else {
......
......@@ -32,7 +32,9 @@ public class MachineSchedulerService {
this.holidays = holidays != null ? holidays : new ArrayList<>();
this.currentTime = currentTime;
}
public void ClearMachineCache(long machineId) {
timelineCache.remove(machineId);
}
public MachineTimeline getOrCreateTimeline(Machine machine) {
long machineId = machine.getId();
......
......@@ -6,6 +6,7 @@ import com.aps.entity.Algorithm.Chromosome;
import com.aps.entity.Algorithm.ObjectiveWeights;
import com.aps.entity.Gantt.ProductGanttVO;
import com.aps.entity.basic.Machine;
import com.aps.entity.basic.MaintenanceWindow;
import com.aps.service.Algorithm.NSGAIIUtils;
import com.aps.service.plan.PlanResultService;
import com.aps.service.plan.SceneService;
......@@ -37,13 +38,17 @@ public class PlanResultServiceTest {
// nsgaiiUtils.Test();
//planResultService.execute2("C5FB5EF2A7334A0A92F826F4937E1008");
planResultService.execute2("B6AE363FF5044DDF8DECE32D5FE0F7EA");
// planResultService.execute2("F79370487E4C455B8C4CF9BA41541CA9");
// LocalDateTime t= LocalDateTime.of(2025, 11, 15, 6, 51, 11);
// List<Integer> opids=new ArrayList<>();
// opids.add(1);
// planResultService.Move("B571EF6682DB463AB2977B1055A74112",opids,t,3403L);
// planResultService.Redecode("B6AE363FF5044DDF8DECE32D5FE0F7EA");
// planResultService.Redecode("B6AE363FF5044DDF8DECE32D5FE0F7EA");
// MaintenanceWindow maintenanceWindow=new MaintenanceWindow();
// maintenanceWindow.setStartTime(LocalDateTime.of(2025, 10, 21, 0, 0, 0));
// maintenanceWindow.setEndTime(LocalDateTime.of(2025, 10, 31, 0, 0, 0));
// planResultService.AddMaintenanceWindow("B6AE363FF5044DDF8DECE32D5FE0F7EA",1245l,maintenanceWindow);
// planResultService.SpiltOrder("A41D662EE0764D008173C5A0E42B15F6","5f9d5383-b89a-4a4f-8805-2f617c711968",new Double[]{500d, 500d});
}
......
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