配件带分组信息获取

This commit is contained in:
lym
2024-09-02 18:00:12 +08:00
parent 7fba202f59
commit aff4212045
5 changed files with 10 additions and 9 deletions
@@ -96,7 +96,7 @@ public class OrderPartsController {
@GetMapping("getPartsByOrderId")
@Operation(summary = "批量查询有生产单号id、房间id,柜体id的板材")
@PreAuthorize("@ss.hasPermission('executor:plate:getPlatesByOrderId')")
public CommonResult<PageResult<OrderPartsRespVO>> getPPartsByOrderId(@Valid PlateTermsPageReqVO pageVO) {
public CommonResult<PageResult<PartGoodsRespVO>> getPPartsByOrderId(@Valid PlateTermsPageReqVO pageVO) {
return success(orderPartsService.getPartsPageByTerms(pageVO));
}
@@ -47,7 +47,7 @@ public interface OrderPartsMapper extends BaseMapperX<OrderPartsDO> {
}
IPage<OrderPartsRespVO> selectProductList(@Param("page") IPage<OrderPartsRespVO> page , @Param("orderId")Long orderId, @Param("roomId")Long roomId , @Param("bodyId")Long bodyId,@Param("organId")Long organId);
IPage<PartGoodsRespVO> selectProductList(@Param("page") IPage<PartGoodsRespVO> page , @Param("orderId")Long orderId, @Param("roomId")Long roomId , @Param("bodyId")Long bodyId,@Param("organId")Long organId);
List<PartGoodsRespVO> selectPartDetail(@Param("orderId") Long orderId, @Param("organId") Long organId, @Param("deleted") Integer deleted);// 配件明细
@@ -67,7 +67,7 @@ public interface OrderPartsService {
* @param pageReqVO:
* @return PageResult<PlateDO>
*/
PageResult<OrderPartsRespVO> getPartsPageByTerms(PlateTermsPageReqVO pageReqVO);
PageResult<PartGoodsRespVO> getPartsPageByTerms(PlateTermsPageReqVO pageReqVO);
/**
* 分组查询
@@ -108,10 +108,10 @@ public class OrderPartsServiceImpl implements OrderPartsService {
}
@Override
public PageResult<OrderPartsRespVO> getPartsPageByTerms(PlateTermsPageReqVO pageReqVO) {
PageDTO<OrderPartsRespVO> page = new PageDTO<>(pageReqVO.getPageNo(), pageReqVO.getPageSize());
IPage<OrderPartsRespVO> pageRes = orderPartsMapper.selectProductList(page, pageReqVO.getOrderId(), pageReqVO.getRoomId(), pageReqVO.getBodyId(),getUserOrganId());
return new PageResult<OrderPartsRespVO>(pageRes.getRecords(), pageRes.getTotal());
public PageResult<PartGoodsRespVO> getPartsPageByTerms(PlateTermsPageReqVO pageReqVO) {
PageDTO<PartGoodsRespVO> page = new PageDTO<>(pageReqVO.getPageNo(), pageReqVO.getPageSize());
IPage<PartGoodsRespVO> pageRes = orderPartsMapper.selectProductList(page, pageReqVO.getOrderId(), pageReqVO.getRoomId(), pageReqVO.getBodyId(),getUserOrganId());
return new PageResult<PartGoodsRespVO>(pageRes.getRecords(), pageRes.getTotal());
}
@Override
@@ -3,11 +3,12 @@
<mapper namespace="com.cf.imes.module.executor.dal.mysql.orderParts.OrderPartsMapper">
<select id="selectProductList"
resultType="com.cf.imes.module.executor.controller.admin.orderParts.vo.OrderPartsRespVO">
resultType="com.cf.imes.module.executor.controller.admin.orderParts.vo.PartGoodsRespVO">
SELECT distinct a.id, a.goods_id, a.name, a.material, a.type, a.model, a.spec, a.brand, a.factory,
a.unit, a.price, a.is_composite, a.remark, b.num
a.unit, a.price, a.is_composite, a.remark, b.num, c.id as bodyId, c.room_id, c.name as bodyName, c.room_name
FROM order_parts a
LEFT JOIN order_item b ON a.id = b.parts_id and a.organ_id = b.organ_id
LEFT JOIN order_body c on b.body_id = c.id and b.organ_id = c.organ_id and c.order_id = b.order_id
WHERE b.organ_id =#{organId} and b.order_id = #{orderId}
AND (#{roomId} IS NULL OR b.room_id = #{roomId})
AND (#{bodyId} IS NULL OR b.body_id = #{bodyId})