Commit c11b1563 authored by Tong Li's avatar Tong Li

遗传算法-物料需求

parent 4d1991b5
...@@ -261,17 +261,10 @@ if(routingIds.size()==0) ...@@ -261,17 +261,10 @@ if(routingIds.size()==0)
} }
} }
else { else {
Long routingIds1=headers1.getId().longValue();
routingIds=headers1.getId().longValue(); routingIds=headers1.getId().longValue();
routingsupportings1= routingsupportings.stream()
.filter(t->t.getRoutingHeaderId().equals(routingIds1))
.collect(Collectors.toList());
List<String> routingsupportingids = routingsupportings.stream()
.map(Routingsupporting::getStrId)
.distinct()
.collect(Collectors.toList());
routingsupportingreplaces1 =routingsupportingreplaces.stream()
.filter(t->routingsupportingids.contains(t.getStrsupid())).collect(Collectors.toList());
} }
if(headers1==null) if(headers1==null)
{ {
......
...@@ -246,10 +246,13 @@ public class RoutingDataService { ...@@ -246,10 +246,13 @@ public class RoutingDataService {
.collect(Collectors.toList()); .collect(Collectors.toList());
List<Machine> machines=new ArrayList<>(); List<Machine> machines=new ArrayList<>();
List<PlanResource> PlanResources= _PlanResourceService.lambdaQuery()
.eq(PlanResource::getIsdeleted,0)
.list();
for (Long id : MachineIds) { for (Long id : MachineIds) {
Machine machine=new Machine(); Machine machine=new Machine();
machine.setId(id); machine.setId(id);
machines.add(machine); machines.add(machine);
} }
//节假日 //节假日
...@@ -258,9 +261,7 @@ public class RoutingDataService { ...@@ -258,9 +261,7 @@ public class RoutingDataService {
LambdaQueryWrapper<ProdEquipSpecialCal> ProdEquipSpecialCalWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<ProdEquipSpecialCal> ProdEquipSpecialCalWrapper = new LambdaQueryWrapper<>();
ProdEquipSpecialCalWrapper.eq(ProdEquipSpecialCal::getSceneId, SceneId); ProdEquipSpecialCalWrapper.eq(ProdEquipSpecialCal::getSceneId, SceneId);
List<PlanResource> PlanResources= _PlanResourceService.lambdaQuery()
.eq(PlanResource::getIsdeleted,0)
.list();
...@@ -297,13 +298,13 @@ public class RoutingDataService { ...@@ -297,13 +298,13 @@ public class RoutingDataService {
shifts1.add(shift); shifts1.add(shift);
} }
} }
List<PlanResource> PlanResources1 = PlanResources.stream() PlanResource PlanResource = PlanResources.stream()
.filter(t -> t.getReferenceId() == machine.getId()) .filter(t -> t.getId() == machine.getId())
.collect(Collectors.toList()); .findFirst().orElse(null);
if(PlanResources1!=null&&PlanResources1.size()>0) if(PlanResource!=null)
{ {
for (PlanResource PlanResource : PlanResources1) { machine.setCode(PlanResource.getCode());
machine.setName(PlanResource.getTitle());
List<MesShiftWorkSched> ShiftWorkScheds = MesShiftWorkScheds.stream() List<MesShiftWorkSched> ShiftWorkScheds = MesShiftWorkScheds.stream()
.filter(t -> (long) t.getWeekWorkSchedId() == PlanResource.getWorkSchedId()) .filter(t -> (long) t.getWeekWorkSchedId() == PlanResource.getWorkSchedId())
.collect(Collectors.toList()); .collect(Collectors.toList());
...@@ -315,10 +316,13 @@ public class RoutingDataService { ...@@ -315,10 +316,13 @@ public class RoutingDataService {
shift.setEndDate(LocalDateTime.of(2000, 1, 1, 0, 0, 0)); shift.setEndDate(LocalDateTime.of(2000, 1, 1, 0, 0, 0));
shifts1.add(shift); shifts1.add(shift);
} }
}
}
}
if(shifts1==null)
{
throw new RuntimeException(String.format("设备%s没有工作日历",machine.getCode().concat("_").concat(machine.getName())) );
}
machine.setShifts(shifts1); machine.setShifts(shifts1);
List<ProdEquipSpecialCal> Holidays = ProdEquipSpecialCals.stream() List<ProdEquipSpecialCal> Holidays = ProdEquipSpecialCals.stream()
......
...@@ -26,7 +26,7 @@ public class PlanResultServiceTest { ...@@ -26,7 +26,7 @@ public class PlanResultServiceTest {
@Test @Test
public void testExecute() { public void testExecute() {
planResultService.execute2("6AF8001449FC4D20A3C9992EC24CBF05"); planResultService.execute2("1D233450774C420B9165A6AE6E616F67");
// 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