mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 21:02:08 +08:00
1、订单详情部件列表去重和排序完善;2、cad拆单带加工组的orderItem部件id缺失补充;
This commit is contained in:
+20
-8
@@ -24,8 +24,11 @@ import org.springframework.stereotype.Service;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.cf.imes.framework.security.core.util.SecurityFrameworkUtils.getUserOrganId;
|
||||
@@ -66,11 +69,20 @@ public class OrderComponentServiceImpl implements OrderComponentService {
|
||||
}
|
||||
}
|
||||
|
||||
// 结果根据topid
|
||||
resultDOList.sort(Comparator
|
||||
.comparing(OrderComponentDO::getTopId));
|
||||
// 结果根据id去重和排序
|
||||
Map<Long, OrderComponentDO> uniqueMap = resultDOList.stream()
|
||||
.collect(Collectors.toMap(
|
||||
OrderComponentDO::getId,
|
||||
Function.identity(),
|
||||
(a, b) -> a,
|
||||
LinkedHashMap::new
|
||||
));
|
||||
|
||||
return BeanUtil.copyToList(resultDOList, OrderComponentRespVO.class);
|
||||
List<OrderComponentDO> uniqueList = new ArrayList<>(uniqueMap.values());
|
||||
uniqueList.sort(Comparator
|
||||
.comparing(OrderComponentDO::getId));
|
||||
|
||||
return BeanUtil.copyToList(uniqueList, OrderComponentRespVO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -109,7 +121,7 @@ public class OrderComponentServiceImpl implements OrderComponentService {
|
||||
}
|
||||
|
||||
if(CollUtil.isEmpty(componentIds)) {
|
||||
// 2、把下级部门id做成集合
|
||||
// 2、把下级部件id作为查询条件
|
||||
List<OrderComponentDO> orderComponentDOS = orderComponentMapper.selectList(new LambdaQueryWrapperX<OrderComponentDO>()
|
||||
.eq(OrderComponentDO::getTopId, componentDO.getTopId())
|
||||
.eq(OrderComponentDO::getOrganId, componentDO.getOrganId())
|
||||
@@ -122,7 +134,7 @@ public class OrderComponentServiceImpl implements OrderComponentService {
|
||||
return new PageResult<>();
|
||||
}
|
||||
} else {
|
||||
// 3、使用入参的部件id集合
|
||||
// 3、使用入参的部件id作为条件
|
||||
componentIds = pageReqVO.getComponentIds();
|
||||
}
|
||||
|
||||
@@ -147,7 +159,7 @@ public class OrderComponentServiceImpl implements OrderComponentService {
|
||||
Long cadViewFileId = componentDO.getCadViewFileId();
|
||||
|
||||
if(CollUtil.isEmpty(componentIds)) {
|
||||
// 2、把下级部门id做成集合
|
||||
// 2、把下级部件id作为查询条件
|
||||
List<OrderComponentDO> orderComponentDOS = orderComponentMapper.selectList(new LambdaQueryWrapperX<OrderComponentDO>()
|
||||
.eq(OrderComponentDO::getTopId, componentDO.getTopId())
|
||||
.eq(OrderComponentDO::getOrganId, componentDO.getOrganId())
|
||||
@@ -160,7 +172,7 @@ public class OrderComponentServiceImpl implements OrderComponentService {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
} else {
|
||||
// 3、使用入参的部件id集合
|
||||
// 3、使用入参的部件id作为条件
|
||||
componentIds = pageReqVO.getComponentIds();
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@
|
||||
|
||||
<select id="getTopComponentListIn"
|
||||
resultType="com.cf.imes.module.executor.dal.dataobject.ordecomponent.OrderComponentDO">
|
||||
select distinct p.id, p.name, p.level, p.top_id
|
||||
select distinct p.id, p.name
|
||||
from order_component p
|
||||
join order_component c
|
||||
on p.id = c.top_id
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ veneer.defect.save.id.not.null=veneer id cannot be empty
|
||||
veneer.classification.name.save.name.not.null=classification name cannot be empty
|
||||
veneer.classification.name.save.name.length.max=classification name length cannot exceed 64 characters
|
||||
|
||||
order.detail.component.list.query.orderId.not.null=order id cannot be empty
|
||||
order.detail.component.list.query.orderId.not.null=The order id cannot be empty
|
||||
order.detail.component.list.query.roomIds.max=The list of query order numbers cannot exceed 100
|
||||
order.detail.component.list.query.bodyIds.max=The cabinet query range cannot exceed 200
|
||||
order.detail.component.list.query.componentIds.max=The range of component queries cannot exceed 200
|
||||
|
||||
Reference in New Issue
Block a user