mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-13 05:12:07 +08:00
1、webcad拆单部件状态设置修正;2、装配设置详情页状态过滤修改;
This commit is contained in:
+10
@@ -44,6 +44,16 @@ public interface OrderComponentMapper extends BaseMapperX<OrderComponentDO> {
|
||||
*/
|
||||
List<OrderComponentDO> getOrderTopComponentList(@Param("orderIds")List<Long> orderIds, @Param("name") String name);
|
||||
|
||||
/**
|
||||
* 查询订单顶级部件,关联order_item,如果被移除了就不展示了
|
||||
*
|
||||
* @param orderIds
|
||||
* @param processStatus
|
||||
* @param name
|
||||
* @return
|
||||
*/
|
||||
List<OrderComponentDO> getOrderTopComponentListByAssemblyStatus(@Param("orderIds") List<Long> orderIds, @Param("assemblyStatusList") List<Integer> processStatus, @Param("name") String name);
|
||||
|
||||
/**
|
||||
* 查询订单topid下的所有大于level层级的部件列表
|
||||
* @param orderId
|
||||
|
||||
+17
-34
@@ -98,21 +98,20 @@ public class AssemblyListServiceImpl implements AssemblyListService {
|
||||
.map(OrderComponentDO::getTopId)
|
||||
.toList();
|
||||
|
||||
// 根据部件的topid查询树上所有已加工节点
|
||||
List<OrderComponentDO> topUnProcessedComponentList = orderComponentMapper.selectList(new LambdaQueryWrapperX<OrderComponentDO>()
|
||||
// 查询所有top节点下的子节点
|
||||
List<OrderComponentDO> allNodesOnTopIds = orderComponentMapper.selectList(new LambdaQueryWrapperX<OrderComponentDO>()
|
||||
.in(OrderComponentDO::getTopId, topIds)
|
||||
.in(OrderComponentDO::getOrderId, orderIds)
|
||||
.select(OrderComponentDO::getId, OrderComponentDO::getPid, OrderComponentDO::getName, OrderComponentDO::getProcessStatus));
|
||||
.select(OrderComponentDO::getId, OrderComponentDO::getPid, OrderComponentDO::getName, OrderComponentDO::getProcessStatus, OrderComponentDO::getExtraProcessStatus));
|
||||
|
||||
// 计算部件状态
|
||||
List<OrderComponentTreeCompareVO> treeCompareVOS = calculateProcessingStatusAccordingToAssemblyConfig(topUnProcessedComponentList);
|
||||
|
||||
List<OrderComponentRespVO> result = new ArrayList<>();
|
||||
// 树形扁平化
|
||||
for (OrderComponentTreeCompareVO vo : treeCompareVOS) {
|
||||
flatTree(vo, result);
|
||||
// 遍历处理状态
|
||||
for (OrderComponentDO orderComponent : allNodesOnTopIds) {
|
||||
// extraProcessStatus不为空时替代processStatus
|
||||
if (ObjectUtil.isNotEmpty(orderComponent.getExtraProcessStatus())) {
|
||||
orderComponent.setProcessStatus(orderComponent.getExtraProcessStatus());
|
||||
}
|
||||
}
|
||||
return result;
|
||||
return BeanUtil.copyToList(allNodesOnTopIds, OrderComponentRespVO.class);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -386,8 +385,8 @@ public class AssemblyListServiceImpl implements AssemblyListService {
|
||||
);
|
||||
|
||||
// 不加工不可操作
|
||||
AssertUtils.notEquals(
|
||||
componentDO.getProcessStatus(),
|
||||
AssertUtils.equals(
|
||||
componentDO.getExtraProcessStatus(),
|
||||
OrderComponentProcessStatusEnum.NOT_PROCESS.getStatus(),
|
||||
ORDER_COMPONENT_NOT_PROCESS
|
||||
);
|
||||
@@ -415,7 +414,7 @@ public class AssemblyListServiceImpl implements AssemblyListService {
|
||||
|
||||
AssertUtils.equals(
|
||||
componentDO.getProcessStatus(),
|
||||
OrderComponentProcessStatusEnum.UNPROCESSED.getStatus(),
|
||||
OrderComponentProcessStatusEnum.PROCESSED.getStatus(),
|
||||
ORDER_COMPONENT_PROCESSED_REPEAT
|
||||
);
|
||||
}
|
||||
@@ -425,7 +424,7 @@ public class AssemblyListServiceImpl implements AssemblyListService {
|
||||
|
||||
AssertUtils.equals(
|
||||
componentDO.getProcessStatus(),
|
||||
OrderComponentProcessStatusEnum.PROCESSED.getStatus(),
|
||||
OrderComponentProcessStatusEnum.UNPROCESSED.getStatus(),
|
||||
ORDER_COMPONENT_RESTORE_REPEAT
|
||||
);
|
||||
}
|
||||
@@ -783,24 +782,8 @@ public class AssemblyListServiceImpl implements AssemblyListService {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
List<TopComponentState> states = buildTopComponentStates(reqVO);
|
||||
|
||||
if (CollUtil.isEmpty(states)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
Set<OrderComponentProcessStatusEnum> statusSet =
|
||||
Optional.ofNullable(reqVO.getProcessStatus())
|
||||
.orElse(Collections.emptyList())
|
||||
.stream()
|
||||
.map(OrderComponentProcessStatusEnum::fromValue)
|
||||
.collect(Collectors.toSet());
|
||||
|
||||
List<OrderComponentTreeCompareVO> result = states.stream()
|
||||
.filter(state -> matchAnyStatus(state, statusSet))
|
||||
.map(state -> state.node)
|
||||
.toList();
|
||||
|
||||
// 查询顶级部件
|
||||
List<OrderComponentDO> result = orderComponentMapper.getOrderTopComponentListByAssemblyStatus(reqVO.getOrderIds(), reqVO.getProcessStatus(), reqVO.getName());
|
||||
return BeanUtil.copyToList(result, OrderComponentRespVO.class);
|
||||
}
|
||||
|
||||
@@ -812,7 +795,7 @@ public class AssemblyListServiceImpl implements AssemblyListService {
|
||||
*/
|
||||
private List<TopComponentState> buildTopComponentStates(OrdersTopComponentListReqVO reqVO) {
|
||||
// 查询顶级部件
|
||||
List<OrderComponentDO> topComponents = orderComponentMapper.getOrderTopComponentList(reqVO.getOrderIds(), reqVO.getName());
|
||||
List<OrderComponentDO> topComponents = orderComponentMapper.getOrderTopComponentListByAssemblyStatus(reqVO.getOrderIds(), reqVO.getProcessStatus(), reqVO.getName());
|
||||
|
||||
if (CollUtil.isEmpty(topComponents)) {
|
||||
return Collections.emptyList();
|
||||
|
||||
+52
@@ -57,6 +57,58 @@
|
||||
);
|
||||
</select>
|
||||
|
||||
<select id="getOrderTopComponentListByAssemblyStatus"
|
||||
resultType="com.cf.imes.module.executor.dal.dataobject.ordercomponent.OrderComponentDO">
|
||||
SELECT * FROM (
|
||||
SELECT
|
||||
top.id,
|
||||
top.name,
|
||||
top.pid,
|
||||
top.cad_view_file_id,
|
||||
CASE
|
||||
<!-- 1. 不加工:extra_process_status = 0 -->
|
||||
WHEN top.pid = 0 AND top.extra_process_status = 0 THEN 0
|
||||
|
||||
<!-- 2. 部分加工:extra_process_status = 3 -->
|
||||
WHEN top.pid = 0 AND top.extra_process_status = 3 THEN 3
|
||||
|
||||
<!-- 3. 已加工:process_status = 2 -->
|
||||
WHEN top.pid = 0 AND top.process_status = 2 THEN 2
|
||||
|
||||
<!-- 4. 未加工:process_status = 1 且 extra_process_status IS NULL -->
|
||||
WHEN top.pid = 0 AND top.process_status = 1 AND (top.extra_process_status IS NULL OR top.extra_process_status != 0) THEN 1
|
||||
|
||||
ELSE -1
|
||||
END AS processStatus
|
||||
FROM order_component top
|
||||
WHERE top.pid = 0
|
||||
<if test="name != null and name != ''">
|
||||
AND top.name LIKE CONCAT('%', #{name}, '%')
|
||||
</if>
|
||||
AND top.order_id IN
|
||||
<foreach item="orderId" collection="orderIds" open="(" separator="," close=")">
|
||||
#{orderId}
|
||||
</foreach>
|
||||
AND EXISTS (
|
||||
SELECT 1
|
||||
FROM order_component oc
|
||||
JOIN order_item oi
|
||||
ON oi.comp_id = oc.id
|
||||
AND oi.order_id = oc.order_id
|
||||
AND oi.organ_id = oc.organ_id
|
||||
WHERE oc.top_id = top.id
|
||||
AND oc.order_id = top.order_id
|
||||
AND oc.organ_id = top.organ_id
|
||||
)
|
||||
) t
|
||||
<if test="assemblyStatusList != null and assemblyStatusList.size() > 0">
|
||||
WHERE t.processStatus IN
|
||||
<foreach item="status" collection="assemblyStatusList" open="(" separator="," close=")">
|
||||
#{status}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getComponentListOnTopLevel"
|
||||
resultType="com.cf.imes.module.executor.dal.dataobject.ordercomponent.OrderComponentDO">
|
||||
select * from order_component oc
|
||||
|
||||
Reference in New Issue
Block a user