下发修改

parent 7666d8f3
...@@ -282,7 +282,7 @@ if(finishedOrder==null||finishedOrder.size()==0) ...@@ -282,7 +282,7 @@ if(finishedOrder==null||finishedOrder.size()==0)
public void decode(Chromosome chromosome) { public void decode(Chromosome chromosome) {
List<OrderMaterialRequirement> orderMaterials = materialRequirementService.buildMultiLevelRequirementNetwork(chromosome, sceneId, baseTime,_globalParam); // List<OrderMaterialRequirement> orderMaterials = materialRequirementService.buildMultiLevelRequirementNetwork(chromosome, sceneId, baseTime,_globalParam);
chromosome.setScenarioID(sceneId); chromosome.setScenarioID(sceneId);
if(_globalParam.isIsCheckSf()) { if(_globalParam.isIsCheckSf()) {
int isnew= generateGlobalOpList(chromosome); int isnew= generateGlobalOpList(chromosome);
......
...@@ -115,12 +115,22 @@ public class LanuchServiceImpl implements LanuchService { ...@@ -115,12 +115,22 @@ public class LanuchServiceImpl implements LanuchService {
if (apsOrderIds.isEmpty()) { if (apsOrderIds.isEmpty()) {
apsOrders = new ArrayList<>(); apsOrders = new ArrayList<>();
} else { } else {
apsOrders = apsOrderService.lambdaQuery() // Oracle IN子句限制最多1000个值,需要分批查询
apsOrders = new ArrayList<>();
int batchSize = 1000;
for (int i = 0; i < apsOrderIds.size(); i += batchSize) {
int endIndex = Math.min(i + batchSize, apsOrderIds.size());
List<String> batchIds = apsOrderIds.subList(i, endIndex);
List<ApsOrder> batchOrders = apsOrderService.lambdaQuery()
.eq(ApsOrder::getIsdeleted, 0) .eq(ApsOrder::getIsdeleted, 0)
.eq(ApsOrder::getStatus, 4) .eq(ApsOrder::getStatus, 4)
// .eq(ApsOrder::getCreatoruserid, username) // .eq(ApsOrder::getCreatoruserid, username)
.in(ApsOrder::getId, apsOrderIds) .in(ApsOrder::getId, batchIds)
.list(); .list();
apsOrders.addAll(batchOrders);
}
} }
if (CollectionUtils.isEmpty(apsOrders)) { if (CollectionUtils.isEmpty(apsOrders)) {
throw new SceneGenerationException("工单列表不能为空"); throw new SceneGenerationException("工单列表不能为空");
...@@ -800,19 +810,33 @@ public class LanuchServiceImpl implements LanuchService { ...@@ -800,19 +810,33 @@ public class LanuchServiceImpl implements LanuchService {
} }
public List<RoutingDetail> getRoutingDetails(List<Long> routingHeaderIds) { public List<RoutingDetail> getRoutingDetails(List<Long> routingHeaderIds) {
if (routingHeaderIds.isEmpty()) {
return new ArrayList<>();
}
// Oracle IN子句限制最多1000个值,需要分批查询
List<RoutingDetail> allRoutingDetails = new ArrayList<>();
int batchSize = 1000;
for (int i = 0; i < routingHeaderIds.size(); i += batchSize) {
int endIndex = Math.min(i + batchSize, routingHeaderIds.size());
List<Long> batchIds = routingHeaderIds.subList(i, endIndex);
LambdaQueryWrapper<RoutingDetail> wrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<RoutingDetail> wrapper = new LambdaQueryWrapper<>();
wrapper.in(RoutingDetail::getRoutingHeaderId, routingHeaderIds) wrapper.in(RoutingDetail::getRoutingHeaderId, batchIds)
.eq(RoutingDetail::getIsDeleted, 0) // 添加 is_deleted=0 过滤条件 .eq(RoutingDetail::getIsDeleted, 0) // 添加 is_deleted=0 过滤条件
.orderByAsc(RoutingDetail::getTaskSeq); .orderByAsc(RoutingDetail::getTaskSeq);
List<RoutingDetail> routingDetails = routingDetailMapper.selectList(wrapper); List<RoutingDetail> batchDetails = routingDetailMapper.selectList(wrapper);
allRoutingDetails.addAll(batchDetails);
}
if (CollectionUtils.isEmpty(routingDetails)) { if (CollectionUtils.isEmpty(allRoutingDetails)) {
log.error("工艺下无工序信息: {}", routingHeaderIds); log.error("工艺下无工序信息: {}", routingHeaderIds);
throw new RuntimeException("工艺下无工序信息: " + routingHeaderIds); throw new RuntimeException("工艺下无工序信息: " + routingHeaderIds);
} }
return routingDetails; return allRoutingDetails;
} }
/** /**
......
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