mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-15 06:02:06 +08:00
1、新增订单顶级部件接口;2、部件板件分页和cadinfo接口部分逻辑调整;
This commit is contained in:
+6
@@ -44,6 +44,12 @@ public class OrderComponentController {
|
||||
return success(orderComponentService.getOrderComponentList(reqVO));
|
||||
}
|
||||
|
||||
@PostMapping("/top/list")
|
||||
@Operation(summary = "查询订单顶级部件列表")
|
||||
public CommonResult<List<OrderComponentRespVO>> getOrderTopComponentList(@Valid @RequestBody OrderDetailComponentListReqVO reqVO) {
|
||||
return success(orderComponentService.getOrderTopComponentList(reqVO));
|
||||
}
|
||||
|
||||
@PostMapping("/view/list")
|
||||
@Operation(summary = "查询订单详情cad视图部件列表")
|
||||
public CommonResult<List<OrderComponentRespVO>> getOrderViewComponentList(@Valid @RequestBody OrderDetailComponentListReqVO reqVO) {
|
||||
|
||||
+6
@@ -1,5 +1,7 @@
|
||||
package com.cf.imes.module.executor.controller.admin.ordercomponent.vo;
|
||||
|
||||
import com.cf.imes.framework.common.validation.InEnum;
|
||||
import com.cf.imes.module.executor.enums.ordercomponent.OrderComponentProcessStatusEnum;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
@@ -45,4 +47,8 @@ public class OrderDetailComponentListReqVO {
|
||||
|
||||
@Schema(description = "是否删除", example = "false")
|
||||
private boolean deleted;
|
||||
|
||||
@Schema(description = "加工状态:0不加工、1已加工、2未加工", example = "1")
|
||||
@InEnum(OrderComponentProcessStatusEnum.class)
|
||||
private Integer processStatus;
|
||||
}
|
||||
|
||||
-4
@@ -33,10 +33,6 @@ public class OrderDetailComponentPageReqVO extends PageParam {
|
||||
@Size(max = 200, message = "{order.detail.component.list.query.componentIds.max}")
|
||||
private Set<Long> componentIds;
|
||||
|
||||
@Schema(description = "部件编号", example = "1")
|
||||
@NotNull(message = "{order.detail.component.plate.page.query.componentId.not.null}")
|
||||
private Long componentId;
|
||||
|
||||
@Schema(description = "是否删除", example = "false")
|
||||
private boolean deleted;
|
||||
}
|
||||
|
||||
+5
@@ -81,4 +81,9 @@ public class OrderBodyViewPlatesPageDO {
|
||||
* cad设计板编号
|
||||
*/
|
||||
private String customNumber;
|
||||
|
||||
/**
|
||||
* 部件id
|
||||
*/
|
||||
private Long compId;
|
||||
}
|
||||
|
||||
+12
-8
@@ -32,7 +32,7 @@ public interface OrderItemMapper extends BaseMapperX<OrderItemDO> {
|
||||
@Param("groupName") String groupName, @Param("organId") Long organId,
|
||||
@Param("deleted") Integer deleted);
|
||||
|
||||
IPage<PlateRespVO> selectPlatesDetailByOrderId(@Param("page") IPage page, @Param("orderId") Long orderId, @Param("roomId") Set<Long> roomId,
|
||||
IPage<PlateRespVO> selectPlatesDetailByOrderId(@Param("page") IPage<PlateRespVO> page, @Param("orderId") Long orderId, @Param("roomId") Set<Long> roomId,
|
||||
@Param("bodyId") Set<Long> bodyId, @Param("groupId") Set<Long> groupId,
|
||||
@Param("groupName") String groupName, @Param("organId") Long organId,
|
||||
@Param("deleted") Integer deleted);
|
||||
@@ -41,7 +41,7 @@ public interface OrderItemMapper extends BaseMapperX<OrderItemDO> {
|
||||
@Param("bodyId") Long bodyId, @Param("name") String name,
|
||||
@Param("organId") Long organId, @Param("deleted") Integer deleted);
|
||||
|
||||
IPage<OrderPartsRespVO> selectPartsDetailByOrderId(@Param("page") IPage page, @Param("orderId") Long orderId, @Param("roomId") Set<Long> roomId,
|
||||
IPage<OrderPartsRespVO> selectPartsDetailByOrderId(@Param("page") IPage<OrderPartsRespVO> page, @Param("orderId") Long orderId, @Param("roomId") Set<Long> roomId,
|
||||
@Param("bodyId") Set<Long> bodyId, @Param("groupId") Set<Long> groupId, @Param("name") String name,
|
||||
@Param("organId") Long organId, @Param("deleted") Integer deleted, @Param("types") Set<String> types);
|
||||
|
||||
@@ -119,7 +119,7 @@ public interface OrderItemMapper extends BaseMapperX<OrderItemDO> {
|
||||
@Param("organId") Long organId,
|
||||
@Param("deleted") Integer deleted);
|
||||
|
||||
IPage<OrderGoodsDetailRespVO> selectGoodsDetailByOrderId(@Param("page") IPage page, @Param("orderId") Long orderId, @Param("roomId") Set<Long> roomId,
|
||||
IPage<OrderGoodsDetailRespVO> selectGoodsDetailByOrderId(@Param("page") IPage<OrderGoodsDetailRespVO> page, @Param("orderId") Long orderId, @Param("roomId") Set<Long> roomId,
|
||||
@Param("bodyId") Set<Long> bodyId, @Param("groupId") Set<Long> groupId, @Param("goodsId") Set<Long> goodsId,
|
||||
@Param("organId") Long organId, @Param("deleted") Integer deleted);
|
||||
|
||||
@@ -190,13 +190,17 @@ public interface OrderItemMapper extends BaseMapperX<OrderItemDO> {
|
||||
/**
|
||||
* 分页查询柜体板件视图数据
|
||||
*
|
||||
* @param page
|
||||
* @param orderId
|
||||
* @param roomId
|
||||
* @param bodyId
|
||||
* @param page 分页参数
|
||||
* @param orderId 订单ID
|
||||
* @param roomId 房间ID
|
||||
* @param bodyId 柜体ID
|
||||
* @param groupId 加工组ID
|
||||
* @param organId 组织ID
|
||||
* @param componentIds 部件ID列表
|
||||
* @param cadView 是否需要cad图纸内信息:cad_view_id、seal_left、seal_down、seal_right、seal_up
|
||||
* @return
|
||||
*/
|
||||
IPage<OrderBodyViewPlatesPageDO> selectBodyViewPlatesPage(@Param("page") IPage page,
|
||||
IPage<OrderBodyViewPlatesPageDO> selectBodyViewPlatesPage(@Param("page") IPage<OrderBodyViewPlatesPageDO> page,
|
||||
@Param("orderId") Long orderId,
|
||||
@Param("roomId") Long roomId,
|
||||
@Param("bodyId") Long bodyId,
|
||||
|
||||
+2
-2
@@ -312,7 +312,7 @@ public class OrderServiceImpl implements OrderService {
|
||||
|
||||
@Override
|
||||
public PageResult<OrderPlatesDetailReqVO> getPlatesDetail(Long orderId, Set<Long> roomIds, Set<Long> bodyIds, Set<Long> groupIds, String groupName, Integer pageNo, Integer pageSize, Integer deleted) {
|
||||
PageDTO<OrderRespVOCopy> page = new PageDTO<>(pageNo, pageSize);
|
||||
PageDTO<PlateRespVO> page = new PageDTO<>(pageNo, pageSize);
|
||||
|
||||
IPage<PlateRespVO> plateRespVOPage = orderItemMapper.selectPlatesDetailByOrderId(page, orderId, roomIds, bodyIds, groupIds,
|
||||
groupName, getUserOrganId(), deleted);
|
||||
@@ -331,7 +331,7 @@ public class OrderServiceImpl implements OrderService {
|
||||
|
||||
@Override
|
||||
public PageResult<OrderPartsRespVO> getPartsDetail(Long orderId, Set<Long> roomId, Set<Long> bodyId, Set<Long> groupId, String name, Integer pageNo, Integer pageSize, Integer deleted, Set<String> types) {
|
||||
PageDTO<OrderRespVOCopy> page = new PageDTO<>(pageNo, pageSize);
|
||||
PageDTO<OrderPartsRespVO> page = new PageDTO<>(pageNo, pageSize);
|
||||
|
||||
IPage<OrderPartsRespVO> orderDetail = orderItemMapper.selectPartsDetailByOrderId(page, orderId, roomId, bodyId, groupId, name, getUserOrganId(), deleted, types);
|
||||
|
||||
|
||||
+8
@@ -23,6 +23,14 @@ public interface OrderComponentService {
|
||||
*/
|
||||
List<OrderComponentRespVO> getOrderComponentList(OrderDetailComponentListReqVO reqVO);
|
||||
|
||||
/**
|
||||
* 查询订单顶级部件列表
|
||||
*
|
||||
* @param reqVO
|
||||
* @return
|
||||
*/
|
||||
List<OrderComponentRespVO> getOrderTopComponentList(OrderDetailComponentListReqVO reqVO);
|
||||
|
||||
/**
|
||||
* 获取节点的顶级节点下所有节点
|
||||
*
|
||||
|
||||
+62
-48
@@ -2,7 +2,6 @@ package com.cf.imes.module.executor.service.ordercomponent;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.PageDTO;
|
||||
@@ -119,6 +118,15 @@ public class OrderComponentServiceImpl implements OrderComponentService {
|
||||
return BeanUtil.copyToList(uniqueList, OrderComponentRespVO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OrderComponentRespVO> getOrderTopComponentList(OrderDetailComponentListReqVO reqVO) {
|
||||
List<OrderComponentDO> orderComponentDOS = orderComponentMapper.selectList(new LambdaQueryWrapperX<OrderComponentDO>()
|
||||
.eq(OrderComponentDO::getOrderId, reqVO.getOrderId())
|
||||
.likeIfPresent(OrderComponentDO::getName, reqVO.getName())
|
||||
.eqIfPresent(OrderComponentDO::getProcessStatus, reqVO.getProcessStatus()));
|
||||
return BeanUtil.copyToList(orderComponentDOS, OrderComponentRespVO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OrderComponentRespVO> getComponentListOnTopId(OrderDetailComponentListReqVO reqVO) {
|
||||
Set<Long> componentIds = reqVO.getComponentIds();
|
||||
@@ -139,6 +147,7 @@ public class OrderComponentServiceImpl implements OrderComponentService {
|
||||
.eq(OrderComponentDO::getOrderId, orderId)
|
||||
.eqIfPresent(OrderComponentDO::getDeleted, reqVO.isDeleted())
|
||||
.likeIfPresent(OrderComponentDO::getName, reqVO.getName())
|
||||
.eqIfPresent(OrderComponentDO::getProcessStatus, reqVO.getProcessStatus())
|
||||
.select(OrderComponentDO::getId, OrderComponentDO::getPid, OrderComponentDO::getName, OrderComponentDO::getCadViewFileId));
|
||||
|
||||
return BeanUtil.copyToList(topComponentList, OrderComponentRespVO.class);
|
||||
@@ -147,86 +156,91 @@ public class OrderComponentServiceImpl implements OrderComponentService {
|
||||
@Override
|
||||
public PageResult<OrderViewPlatePageRespVO> getViewComponentPage(OrderDetailComponentPageReqVO pageReqVO) {
|
||||
Set<Long> componentIds = pageReqVO.getComponentIds();
|
||||
Long componentId = pageReqVO.getComponentId();
|
||||
Long orderId = pageReqVO.getOrderId();
|
||||
|
||||
// 1、查询顶级
|
||||
OrderComponentDO componentDO = orderComponentMapper.selectById(componentId);
|
||||
if (ObjectUtil.isNull(componentDO)) {
|
||||
List<OrderComponentDO> componentDOS = orderComponentMapper.selectByIds(componentIds);
|
||||
if (CollUtil.isEmpty(componentDOS) || componentDOS.size() != componentIds.size()) {
|
||||
throw new ServiceException(ORDER_COMPONENT_NOT_EXIST);
|
||||
}
|
||||
List<Long> topIds = componentDOS.stream()
|
||||
.map(OrderComponentDO::getTopId)
|
||||
.toList();
|
||||
|
||||
if (CollUtil.isEmpty(componentIds)) {
|
||||
// 2、把下级部件id作为查询条件
|
||||
List<OrderComponentDO> orderComponentDOS = orderComponentMapper.selectList(new LambdaQueryWrapperX<OrderComponentDO>()
|
||||
.eq(OrderComponentDO::getTopId, componentDO.getTopId())
|
||||
.eq(OrderComponentDO::getOrganId, componentDO.getOrganId())
|
||||
.eq(OrderComponentDO::getOrderId, orderId)
|
||||
.eqIfPresent(OrderComponentDO::getDeleted, pageReqVO.isDeleted())
|
||||
.select(OrderComponentDO::getId));
|
||||
if (CollUtil.isNotEmpty(orderComponentDOS)) {
|
||||
componentIds = orderComponentDOS.stream().map(OrderComponentDO::getId).collect(Collectors.toSet());
|
||||
} else {
|
||||
return new PageResult<>();
|
||||
// 2、把下级部件id作为查询条件
|
||||
List<OrderComponentDO> orderComponentDOS = orderComponentMapper.selectList(new LambdaQueryWrapperX<OrderComponentDO>()
|
||||
.in(OrderComponentDO::getTopId, topIds)
|
||||
.eq(OrderComponentDO::getOrderId, orderId)
|
||||
.eqIfPresent(OrderComponentDO::getDeleted, pageReqVO.isDeleted())
|
||||
.select(OrderComponentDO::getId, OrderComponentDO::getCadViewFileId, OrderComponentDO::getPid));
|
||||
|
||||
Set<Long> queryComponentIds = new HashSet<>();
|
||||
if (CollUtil.isNotEmpty(orderComponentDOS)) {
|
||||
for (OrderComponentDO co : componentDOS) {
|
||||
queryComponentIds.addAll(getChildrenIds(co, orderComponentDOS));
|
||||
}
|
||||
} else {
|
||||
// 3、使用入参的部件id作为条件
|
||||
componentIds = pageReqVO.getComponentIds();
|
||||
return new PageResult<>();
|
||||
}
|
||||
// 整理出id和cadViewFileId的对应关系
|
||||
Map<Long, Long> cadViewFileIdMap = orderComponentDOS.stream()
|
||||
.collect(Collectors.toMap(OrderComponentDO::getId, OrderComponentDO::getCadViewFileId));
|
||||
|
||||
// 分页查询板件
|
||||
PageDTO<OrderComponentRespVO> page = new PageDTO<>(pageReqVO.getPageNo(), pageReqVO.getPageSize());
|
||||
PageDTO<OrderBodyViewPlatesPageDO> page = new PageDTO<>(pageReqVO.getPageNo(), pageReqVO.getPageSize());
|
||||
IPage<OrderBodyViewPlatesPageDO> pageRes = orderItemMapper.selectBodyViewPlatesPage(page, orderId, null,
|
||||
null, null, getUserOrganId(), componentIds, false);
|
||||
return new PageResult<>(BeanUtil.copyToList(pageRes.getRecords(), OrderViewPlatePageRespVO.class), pageRes.getTotal());
|
||||
null, null, getUserOrganId(), queryComponentIds, false);
|
||||
long total = pageRes.getTotal();
|
||||
List<OrderBodyViewPlatesPageDO> records = pageRes.getRecords();
|
||||
|
||||
List<OrderViewPlatePageRespVO> resultList = new ArrayList<>();
|
||||
if(total > 0) {
|
||||
resultList = records.stream().map(item -> {
|
||||
OrderViewPlatePageRespVO vo = new OrderViewPlatePageRespVO();
|
||||
BeanUtil.copyProperties(item, vo);
|
||||
|
||||
vo.setCadViewFileId(cadViewFileIdMap.get(item.getCompId()));
|
||||
return vo;
|
||||
}).toList();
|
||||
}
|
||||
return new PageResult<>(resultList, total);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OrderViewPlatePageRespVO> getViewComponentPlatesCadInfo(OrderDetailComponentPageReqVO pageReqVO) {
|
||||
Set<Long> componentIds = pageReqVO.getComponentIds();
|
||||
Long componentId = pageReqVO.getComponentId();
|
||||
Long orderId = pageReqVO.getOrderId();
|
||||
|
||||
// 1、查询顶级
|
||||
OrderComponentDO componentDO = orderComponentMapper.selectById(componentId);
|
||||
if (ObjectUtil.isNull(componentDO)) {
|
||||
List<OrderComponentDO> componentDOS = orderComponentMapper.selectByIds(componentIds);
|
||||
if (CollUtil.isEmpty(componentDOS) || componentDOS.size() != componentIds.size()) {
|
||||
throw new ServiceException(ORDER_COMPONENT_NOT_EXIST);
|
||||
}
|
||||
Long cadViewFileId = componentDO.getCadViewFileId();
|
||||
List<Long> topIds = componentDOS.stream()
|
||||
.map(OrderComponentDO::getTopId)
|
||||
.toList();
|
||||
|
||||
if (CollUtil.isEmpty(componentIds)) {
|
||||
// 2、把下级部件id作为查询条件
|
||||
List<OrderComponentDO> orderComponentDOS = orderComponentMapper.selectList(new LambdaQueryWrapperX<OrderComponentDO>()
|
||||
.eq(OrderComponentDO::getTopId, componentDO.getTopId())
|
||||
.eq(OrderComponentDO::getOrganId, componentDO.getOrganId())
|
||||
.eq(OrderComponentDO::getOrderId, orderId)
|
||||
.eqIfPresent(OrderComponentDO::getDeleted, pageReqVO.isDeleted())
|
||||
.select(OrderComponentDO::getId));
|
||||
if (CollUtil.isNotEmpty(orderComponentDOS)) {
|
||||
componentIds = orderComponentDOS.stream().map(OrderComponentDO::getId).collect(Collectors.toSet());
|
||||
} else {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
// 2、把下级部件id作为查询条件
|
||||
List<OrderComponentDO> orderComponentDOS = orderComponentMapper.selectList(new LambdaQueryWrapperX<OrderComponentDO>()
|
||||
.in(OrderComponentDO::getTopId, topIds)
|
||||
.eq(OrderComponentDO::getOrderId, orderId)
|
||||
.eqIfPresent(OrderComponentDO::getDeleted, pageReqVO.isDeleted())
|
||||
.select(OrderComponentDO::getId));
|
||||
if (CollUtil.isNotEmpty(orderComponentDOS)) {
|
||||
componentIds = orderComponentDOS.stream().map(OrderComponentDO::getId).collect(Collectors.toSet());
|
||||
} else {
|
||||
// 3、使用入参的部件id作为条件
|
||||
componentIds = pageReqVO.getComponentIds();
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
// 查询所有板件的视图所需信息
|
||||
PageDTO<OrderViewPlatePageRespVO> page = new PageDTO<>(1, PageParam.PAGE_SIZE_NONE);
|
||||
PageDTO<OrderBodyViewPlatesPageDO> page = new PageDTO<>(1, PageParam.PAGE_SIZE_NONE);
|
||||
IPage<OrderBodyViewPlatesPageDO> viewPlatesPage = orderItemMapper.selectBodyViewPlatesPage(page, orderId, null,
|
||||
null, null, getUserOrganId(), componentIds, true);
|
||||
List<OrderBodyViewPlatesPageDO> records = viewPlatesPage.getRecords();
|
||||
|
||||
List<OrderViewPlatePageRespVO> resultList = new ArrayList<>();
|
||||
if (CollUtil.isNotEmpty(records)) {
|
||||
resultList = records.stream().map(item -> {
|
||||
OrderViewPlatePageRespVO vo = new OrderViewPlatePageRespVO();
|
||||
BeanUtil.copyProperties(item, vo);
|
||||
|
||||
vo.setCadViewFileId(cadViewFileId);
|
||||
return vo;
|
||||
}).toList();
|
||||
resultList = BeanUtil.copyToList(records, OrderViewPlatePageRespVO.class);
|
||||
}
|
||||
return resultList;
|
||||
}
|
||||
|
||||
+2
-2
@@ -811,7 +811,7 @@ public class PlateServiceImpl implements PlateService {
|
||||
|
||||
@Override
|
||||
public PageResult<OrderViewPlatePageRespVO> getBodyViewPlatesPage(OrderCadViewPlatePageReqVO pageReqVO) {
|
||||
PageDTO<OrderViewPlatePageRespVO> page = new PageDTO<>(pageReqVO.getPageNo(), pageReqVO.getPageSize());
|
||||
PageDTO<OrderBodyViewPlatesPageDO> page = new PageDTO<>(pageReqVO.getPageNo(), pageReqVO.getPageSize());
|
||||
IPage<OrderBodyViewPlatesPageDO> pageRes = orderItemMapper.selectBodyViewPlatesPage(page, pageReqVO.getOrderId(), pageReqVO.getRoomId(),
|
||||
pageReqVO.getBodyId(), pageReqVO.getGroupId(), getUserOrganId(), null, false);
|
||||
return new PageResult<>(BeanUtil.copyToList(pageRes.getRecords(), OrderViewPlatePageRespVO.class), pageRes.getTotal());
|
||||
@@ -844,7 +844,7 @@ public class PlateServiceImpl implements PlateService {
|
||||
Long cadViewFileId = orderBodyDO.getCadViewFileId();
|
||||
|
||||
// 查询所有板件的视图所需信息
|
||||
PageDTO<PlateRespVO> page = new PageDTO<>(1, PageParam.PAGE_SIZE_NONE);
|
||||
PageDTO<OrderBodyViewPlatesPageDO> page = new PageDTO<>(1, PageParam.PAGE_SIZE_NONE);
|
||||
IPage<OrderBodyViewPlatesPageDO> viewPlatesPage;
|
||||
|
||||
Integer range = reqVO.getRange();
|
||||
|
||||
+3
@@ -539,6 +539,9 @@
|
||||
<if test="cadView">
|
||||
, p.cad_view_id, p.seal_left, p.seal_down, p.seal_right, p.seal_up
|
||||
</if>
|
||||
<if test="componentIds != null and componentIds.size() > 0">
|
||||
, i.comp_id
|
||||
</if>
|
||||
FROM order_item i
|
||||
LEFT JOIN `order_plate` p ON i.plate_id = p.id
|
||||
LEFT JOIN `order_goods` g ON g.id = p.goods_id
|
||||
|
||||
Reference in New Issue
Block a user