新增/executor/order/component/view/{id}/list 查询顶级部件下部件列表接口

This commit is contained in:
gaoqr
2026-03-02 16:59:02 +08:00
parent 3c554e6c6b
commit c982d11c6f
3 changed files with 29 additions and 0 deletions
@@ -8,11 +8,13 @@ import com.cf.imes.module.executor.controller.admin.ordercomponent.vo.OrderDetai
import com.cf.imes.module.executor.controller.admin.plate.vo.OrderViewPlatePageRespVO;
import com.cf.imes.module.executor.service.ordercomponent.OrderComponentService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import jakarta.validation.Valid;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
@@ -56,6 +58,13 @@ public class OrderComponentController {
return success(orderComponentService.getComponentListOnTopId(reqVO));
}
@GetMapping("/view/{id}/list")
@Operation(summary = "查询指定顶级部件下部件列表")
@Parameter(name = "id", description = "部件编号", required = true, example = "1024")
public CommonResult<List<OrderComponentRespVO>> getChildViewComponentList(@PathVariable Long id) {
return success(orderComponentService.getChildComponentListOnTopId(id));
}
@PostMapping("/view/plate/page")
@Operation(summary = "获取部件下的板件视图分页列表数据")
public CommonResult<PageResult<OrderViewPlatePageRespVO>> getComponentViewPlatesPage(@Valid @RequestBody OrderDetailComponentPageReqVO pageReqVO) {
@@ -75,4 +75,12 @@ public interface OrderComponentService {
* @return
*/
List<OrderComponentRespVO> getOrderComponentListOnOrders(List<Long> orderIds);
/**
* 查询部件下所有子部件
*
* @param id
* @return
*/
List<OrderComponentRespVO> getChildComponentListOnTopId(Long id);
}
@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.PageDTO;
import com.cf.imes.framework.common.enums.DeletedCodeEnum;
import com.cf.imes.framework.common.exception.ServiceException;
import com.cf.imes.framework.common.pojo.CommonResult;
import com.cf.imes.framework.common.pojo.PageParam;
@@ -585,4 +586,15 @@ public class OrderComponentServiceImpl implements OrderComponentService {
.select(OrderComponentDO::getId, OrderComponentDO::getName, OrderComponentDO::getPid));
return BeanUtil.copyToList(orderComponentDOS, OrderComponentRespVO.class);
}
@Override
public List<OrderComponentRespVO> getChildComponentListOnTopId(Long id) {
List<OrderComponentDO> orderComponentDOS = orderComponentMapper.selectList(new LambdaQueryWrapperX<OrderComponentDO>()
.eq(OrderComponentDO::getOrganId, SecurityFrameworkUtils.getUserOrganId())
.eq(OrderComponentDO::getTopId, id)
.eq(OrderComponentDO::getDeleted, DeletedCodeEnum.NOT_DELETED.getStatus())
.select(OrderComponentDO::getId, OrderComponentDO::getName, OrderComponentDO::getPid)
);
return BeanUtil.copyToList(orderComponentDOS, OrderComponentRespVO.class);
}
}