1、装配清单部件列表增加orderIds的过滤影响;2、cad拆单部件层级异常累加修复;

This commit is contained in:
gaoqr
2026-03-10 15:17:13 +08:00
parent e73e976d68
commit ff0c5e1f33
3 changed files with 9 additions and 4 deletions
@@ -79,7 +79,9 @@ public class AssemblyListServiceImpl implements AssemblyListService {
}
// 查询入参部件
List<OrderComponentDO> componentDOS = orderComponentMapper.selectByIds(componentIds);
List<OrderComponentDO> componentDOS = orderComponentMapper.selectList(new LambdaUpdateWrapper<OrderComponentDO>()
.in(OrderComponentDO::getId, componentIds)
.in(OrderComponentDO::getOrderId, reqVO.getOrderIds()));
if (CollUtil.isEmpty(componentDOS) || componentDOS.size() != componentIds.size()) {
throw new ServiceException(ORDER_COMPONENT_NOT_EXIST);
}
@@ -117,6 +119,9 @@ public class AssemblyListServiceImpl implements AssemblyListService {
List<String> topComponentNames = orderComponentTreeRespVOS.stream().map(OrderComponentTreeCompareVO::getName).distinct().toList();
// 根据名称查询组织装配设置
if (CollUtil.isEmpty(topComponentNames)) {
return orderComponentTreeRespVOS;
}
CommonResult<List<AssemblyConfigRespDTO>> assemblyConfigByComponentNameListResult = assemblyConfigApi.getAssemblyConfigByPartNameList(topComponentNames);
if(assemblyConfigByComponentNameListResult.isError()) {
throw new ServiceException(ORDER_COMPONENT_ASSEMBLY_CONFIG_QUERY_ERROR);
@@ -1824,7 +1824,7 @@ public class WebCadOrderImportAsyncFactory {
reader.startArray();
while (reader.hasNext()) {
// 递归子节点
processComponent(reader, componentId, topId, level); // 子节点在递归中生成组件DO
processComponent(reader, componentId, topId, level + 1); // 子节点在递归中生成组件DO
}
reader.endArray();
break;
@@ -579,9 +579,9 @@ public class WebCadOrderImportFactory {
orderComponentDOS.add(componentDO);
orderComponentBatchInsertWithinThreshold(orderComponentDOS, false);
// 继续处理下级
if (!componentGroupReqVO.getChildren().isEmpty()) {
if (CollUtil.isNotEmpty(componentGroupReqVO.getChildren())) {
for (WebCadDataComponentGroupReqVO children : componentGroupReqVO.getChildren()) {
createAndCacheComponent(children, componentId, topId, ++level);
createAndCacheComponent(children, componentId, topId, level + 1);
}
}
}