Commit 5cd21818 authored by Tong Li's avatar Tong Li

遗传算法-物料需求

parent 5d00b320
...@@ -103,7 +103,10 @@ public class MaterialRequirementService { ...@@ -103,7 +103,10 @@ public class MaterialRequirementService {
.map(Entry::getRoutingId) .map(Entry::getRoutingId)
.distinct() .distinct()
.collect(Collectors.toList()); .collect(Collectors.toList());
if(routingIds.size()==0)
{
return null;
}
LambdaQueryWrapper<RoutingHeader> wrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<RoutingHeader> wrapper = new LambdaQueryWrapper<>();
wrapper.in(RoutingHeader::getId, routingIds) wrapper.in(RoutingHeader::getId, routingIds)
.eq(RoutingHeader::getIsDeleted, 0) .eq(RoutingHeader::getIsDeleted, 0)
...@@ -232,7 +235,7 @@ public class MaterialRequirementService { ...@@ -232,7 +235,7 @@ public class MaterialRequirementService {
.eq(RoutingHeader::getIsDeleted, 0) .eq(RoutingHeader::getIsDeleted, 0)
.eq(RoutingHeader::getApprovalStatus, 1); // 添加 is_deleted=0 过滤条件 .eq(RoutingHeader::getApprovalStatus, 1); // 添加 is_deleted=0 过滤条件
headers1 = routingHeaderMapper.selectOne(wrapper); headers1 = routingHeaderMapper.selectOne(wrapper);
if(headers!=null) { if(headers1!=null) {
headers.add(headers1); headers.add(headers1);
routingIds=headers1.getId().longValue(); routingIds=headers1.getId().longValue();
...@@ -270,7 +273,7 @@ public class MaterialRequirementService { ...@@ -270,7 +273,7 @@ public class MaterialRequirementService {
routingsupportingreplaces1 =routingsupportingreplaces.stream() routingsupportingreplaces1 =routingsupportingreplaces.stream()
.filter(t->routingsupportingids.contains(t.getStrsupid())).collect(Collectors.toList()); .filter(t->routingsupportingids.contains(t.getStrsupid())).collect(Collectors.toList());
} }
if(headers==null) if(headers1==null)
{ {
return null; return null;
} }
...@@ -540,9 +543,14 @@ public class MaterialRequirementService { ...@@ -540,9 +543,14 @@ public class MaterialRequirementService {
childorder.setDueDate(forder.getDueDate()); childorder.setDueDate(forder.getDueDate());
childorder.setPriority(forder.getPriority()); childorder.setPriority(forder.getPriority());
childorder.setActualPriority(forder.getActualPriority()); childorder.setActualPriority(forder.getActualPriority());
_childorders.add(childorder);
Map<Integer, Object> list= CreateChild(childorder,material.getId()); Map<Integer, Object> list= CreateChild(childorder,material.getId());
if(list==null)
{
continue;
}
_childorders.add(childorder);
List<Entry> newentrys=(List<Entry>)list.get(1); List<Entry> newentrys=(List<Entry>)list.get(1);
_newEntrys.addAll(newentrys); _newEntrys.addAll(newentrys);
_newMachines.addAll((List<Machine>)list.get(2)); _newMachines.addAll((List<Machine>)list.get(2));
......
...@@ -26,7 +26,7 @@ public class PlanResultServiceTest { ...@@ -26,7 +26,7 @@ public class PlanResultServiceTest {
@Test @Test
public void testExecute() { public void testExecute() {
planResultService.execute2("B571EF6682DB463AB2977B1055A74112"); planResultService.execute2("6AF8001449FC4D20A3C9992EC24CBF05");
// 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