mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-14 13:42:07 +08:00
微信小程序基于短编号获取订单下板件和配件详情接口数据字段修正
This commit is contained in:
+9
@@ -75,4 +75,13 @@ public class OrderViewPartPageRespVO {
|
|||||||
|
|
||||||
@Schema(description = "CAD图纸文件ID")
|
@Schema(description = "CAD图纸文件ID")
|
||||||
private Long cadViewFileId;
|
private Long cadViewFileId;
|
||||||
|
|
||||||
|
@Schema(description = "房间名称")
|
||||||
|
private String roomName;
|
||||||
|
|
||||||
|
@Schema(description = "柜体名称")
|
||||||
|
private String bodyName;
|
||||||
|
|
||||||
|
@Schema(description = "柜体id")
|
||||||
|
private Long bodyId;
|
||||||
}
|
}
|
||||||
|
|||||||
+9
@@ -87,4 +87,13 @@ public class OrderViewPlatePageRespVO {
|
|||||||
|
|
||||||
@Schema(description = "备注")
|
@Schema(description = "备注")
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
|
@Schema(description = "房间名称")
|
||||||
|
private String roomName;
|
||||||
|
|
||||||
|
@Schema(description = "柜体名称")
|
||||||
|
private String bodyName;
|
||||||
|
|
||||||
|
@Schema(description = "柜体id")
|
||||||
|
private Long bodyId;
|
||||||
}
|
}
|
||||||
|
|||||||
+10
@@ -106,4 +106,14 @@ public class OrdersViewPartsPageDO {
|
|||||||
* cad视图文件id
|
* cad视图文件id
|
||||||
*/
|
*/
|
||||||
private Long cadViewFileId;
|
private Long cadViewFileId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 房间名称
|
||||||
|
*/
|
||||||
|
private String roomName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 柜体名称
|
||||||
|
*/
|
||||||
|
private String bodyName;
|
||||||
}
|
}
|
||||||
|
|||||||
+10
@@ -131,4 +131,14 @@ public class OrdersViewPlatesPageDO {
|
|||||||
* 自定义板编号
|
* 自定义板编号
|
||||||
*/
|
*/
|
||||||
private String customPlateNo;
|
private String customPlateNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 房间名称
|
||||||
|
*/
|
||||||
|
private String roomName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 柜体名称
|
||||||
|
*/
|
||||||
|
private String bodyName;
|
||||||
}
|
}
|
||||||
|
|||||||
+25
@@ -277,4 +277,29 @@ public interface OrderItemMapper extends BaseMapperX<OrderItemDO> {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<Long> selectComponentCorrelationPartsIds(@Param("orderIds") List<Long> orderIds, @Param("componentIds") List<Long> componentIds, @Param("groupIds") List<Long> groupIds);
|
List<Long> selectComponentCorrelationPartsIds(@Param("orderIds") List<Long> orderIds, @Param("componentIds") List<Long> componentIds, @Param("groupIds") List<Long> groupIds);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询订单下板件视图信息列表
|
||||||
|
*
|
||||||
|
* @param orderId
|
||||||
|
* @param bodyIds
|
||||||
|
* @param componentIds
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<OrdersViewPlatesPageDO> selectOrderViewPlates(@Param("orderId") Long orderId,
|
||||||
|
@Param("bodyIds") Set<Long> bodyIds,
|
||||||
|
@Param("componentIds") Set<Long> componentIds);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询订单下板件视图信息列表
|
||||||
|
*
|
||||||
|
* @param orderId
|
||||||
|
* @param bodyIds
|
||||||
|
* @param componentIds
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<OrdersViewPartsPageDO> selectOrderViewParts(@Param("orderId") Long orderId,
|
||||||
|
@Param("bodyIds") Set<Long> bodyIds,
|
||||||
|
@Param("componentIds") Set<Long> componentIds);
|
||||||
}
|
}
|
||||||
+2
-8
@@ -778,10 +778,7 @@ public class OrderComponentServiceImpl implements OrderComponentService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 查询所有板件的视图所需信息
|
// 查询所有板件的视图所需信息
|
||||||
PageDTO<OrdersViewPlatesPageDO> page1 = new PageDTO<>(1, PageParam.PAGE_SIZE_NONE);
|
List<OrdersViewPlatesPageDO> plateRecords = orderItemMapper.selectOrderViewPlates(orderId, bodyIds, queryComponentIds);
|
||||||
IPage<OrdersViewPlatesPageDO> viewPlatesPage = orderItemMapper.selectOrdersViewPlatesPage(page1, List.of(orderId), bodyIds,
|
|
||||||
null, queryComponentIds, true);
|
|
||||||
List<OrdersViewPlatesPageDO> plateRecords = viewPlatesPage.getRecords();
|
|
||||||
|
|
||||||
List<OrderViewPlatePageRespVO> plateResult = new ArrayList<>();
|
List<OrderViewPlatePageRespVO> plateResult = new ArrayList<>();
|
||||||
if (CollUtil.isNotEmpty(plateRecords)) {
|
if (CollUtil.isNotEmpty(plateRecords)) {
|
||||||
@@ -794,10 +791,7 @@ public class OrderComponentServiceImpl implements OrderComponentService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 查询所有配件的视图所需信息
|
// 查询所有配件的视图所需信息
|
||||||
PageDTO<OrdersViewPartsPageDO> page2 = new PageDTO<>(1, PageParam.PAGE_SIZE_NONE);
|
List<OrdersViewPartsPageDO> partRecords = orderItemMapper.selectOrderViewParts(orderId, bodyIds, queryComponentIds);
|
||||||
IPage<OrdersViewPartsPageDO> viewPartsPage = orderItemMapper.selectOrdersViewPartsPage(page2, List.of(orderId), bodyIds,
|
|
||||||
null, queryComponentIds, null, true);
|
|
||||||
List<OrdersViewPartsPageDO> partRecords = viewPartsPage.getRecords();
|
|
||||||
|
|
||||||
List<OrderViewPartPageRespVO> partResult = new ArrayList<>();
|
List<OrderViewPartPageRespVO> partResult = new ArrayList<>();
|
||||||
if (CollUtil.isNotEmpty(partRecords)) {
|
if (CollUtil.isNotEmpty(partRecords)) {
|
||||||
|
|||||||
+2
-2
@@ -25,7 +25,7 @@ public class OrderItemServiceImpl implements OrderItemService {
|
|||||||
public List<OrderItemDO> getPlateItemCompId(Long id) {
|
public List<OrderItemDO> getPlateItemCompId(Long id) {
|
||||||
List<OrderItemDO> plateItemDOS = orderItemMapper.selectList(new LambdaQueryWrapper<OrderItemDO>()
|
List<OrderItemDO> plateItemDOS = orderItemMapper.selectList(new LambdaQueryWrapper<OrderItemDO>()
|
||||||
.eq(OrderItemDO::getPlateId, id)
|
.eq(OrderItemDO::getPlateId, id)
|
||||||
.select(OrderItemDO::getCompId, OrderItemDO::getGroupId));
|
.select(OrderItemDO::getCompId, OrderItemDO::getGroupId, OrderItemDO::getBodyId));
|
||||||
if (CollUtil.isNotEmpty(plateItemDOS)) {
|
if (CollUtil.isNotEmpty(plateItemDOS)) {
|
||||||
return plateItemDOS;
|
return plateItemDOS;
|
||||||
}
|
}
|
||||||
@@ -36,7 +36,7 @@ public class OrderItemServiceImpl implements OrderItemService {
|
|||||||
public List<OrderItemDO> getPartItemCompId(Long partId) {
|
public List<OrderItemDO> getPartItemCompId(Long partId) {
|
||||||
List<OrderItemDO> partItemDOS = orderItemMapper.selectList(new LambdaQueryWrapper<OrderItemDO>()
|
List<OrderItemDO> partItemDOS = orderItemMapper.selectList(new LambdaQueryWrapper<OrderItemDO>()
|
||||||
.eq(OrderItemDO::getPartsId, partId)
|
.eq(OrderItemDO::getPartsId, partId)
|
||||||
.select(OrderItemDO::getCompId, OrderItemDO::getGroupId));
|
.select(OrderItemDO::getCompId, OrderItemDO::getGroupId, OrderItemDO::getBodyId));
|
||||||
if (CollUtil.isNotEmpty(partItemDOS)) {
|
if (CollUtil.isNotEmpty(partItemDOS)) {
|
||||||
return partItemDOS;
|
return partItemDOS;
|
||||||
}
|
}
|
||||||
|
|||||||
+17
-1
@@ -56,6 +56,7 @@ import com.cf.imes.module.executor.service.order.OrderInputProcessor;
|
|||||||
import com.cf.imes.module.executor.service.order.OrderService;
|
import com.cf.imes.module.executor.service.order.OrderService;
|
||||||
import com.cf.imes.module.executor.service.orderbody.OrderBodyService;
|
import com.cf.imes.module.executor.service.orderbody.OrderBodyService;
|
||||||
import com.cf.imes.module.executor.service.ordercomponent.OrderComponentService;
|
import com.cf.imes.module.executor.service.ordercomponent.OrderComponentService;
|
||||||
|
import com.cf.imes.module.executor.service.orderitem.OrderItemService;
|
||||||
import com.cf.imes.module.system.api.organ.OrganApi;
|
import com.cf.imes.module.system.api.organ.OrganApi;
|
||||||
import lombok.SneakyThrows;
|
import lombok.SneakyThrows;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@@ -131,6 +132,9 @@ public class PlateServiceImpl implements PlateService {
|
|||||||
@Resource
|
@Resource
|
||||||
private OrderComponentService orderComponentService;
|
private OrderComponentService orderComponentService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private OrderItemService orderItemService;
|
||||||
|
|
||||||
private static final String FIELD_PLATE_ID = "plateId";
|
private static final String FIELD_PLATE_ID = "plateId";
|
||||||
private static final String FIELD_OG_MATERIAL = "og.material";
|
private static final String FIELD_OG_MATERIAL = "og.material";
|
||||||
private static final String FIELD_OG_BRAND = "og.brand";
|
private static final String FIELD_OG_BRAND = "og.brand";
|
||||||
@@ -1105,7 +1109,19 @@ public class PlateServiceImpl implements PlateService {
|
|||||||
OrderDetailComponentPageReqVO detailReqVO = new OrderDetailComponentPageReqVO();
|
OrderDetailComponentPageReqVO detailReqVO = new OrderDetailComponentPageReqVO();
|
||||||
detailReqVO.setOrderId(plateDO.getOrderId());
|
detailReqVO.setOrderId(plateDO.getOrderId());
|
||||||
detailReqVO.setComponentIds(reqVO.getComponentIds());
|
detailReqVO.setComponentIds(reqVO.getComponentIds());
|
||||||
detailReqVO.setBodyIds(reqVO.getBodyIds());
|
|
||||||
|
// 入参的柜体缺省用板件本身的柜体id
|
||||||
|
Set<Long> bodyIds = reqVO.getBodyIds();
|
||||||
|
if (CollUtil.isNotEmpty(bodyIds)) {
|
||||||
|
detailReqVO.setBodyIds(bodyIds);
|
||||||
|
} else {
|
||||||
|
List<OrderItemDO> plateItems = orderItemService.getPlateItemCompId(plateDO.getId());
|
||||||
|
if (CollUtil.isEmpty(plateItems)) {
|
||||||
|
throw new ServiceException(PLATE_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
detailReqVO.setBodyIds(Set.of(plateItems.get(0).getBodyId()));
|
||||||
|
}
|
||||||
|
|
||||||
return orderComponentService.getOrderViewCadInfo(detailReqVO);
|
return orderComponentService.getOrderViewCadInfo(detailReqVO);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+95
@@ -769,4 +769,99 @@
|
|||||||
)
|
)
|
||||||
GROUP BY oi.parts_id
|
GROUP BY oi.parts_id
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectOrderViewPlates" resultType="com.cf.imes.module.executor.dal.dataobject.orderItem.OrdersViewPlatesPageDO">
|
||||||
|
SELECT
|
||||||
|
op.plate_no,
|
||||||
|
op.cad_plate_no,
|
||||||
|
op.name,
|
||||||
|
op.height,
|
||||||
|
op.width,
|
||||||
|
op.thickness,
|
||||||
|
ob.name AS bodyName,
|
||||||
|
ob.room_name AS roomName,
|
||||||
|
ob.id AS bodyId,
|
||||||
|
t.cad_view_id
|
||||||
|
<if test="componentIds != null and componentIds.size() > 0">
|
||||||
|
, t.comp_id
|
||||||
|
</if>
|
||||||
|
FROM order_plate op
|
||||||
|
JOIN (
|
||||||
|
SELECT plate_id,
|
||||||
|
MIN(cad_view_id) AS cad_view_id
|
||||||
|
<if test="componentIds != null and componentIds.size() > 0">
|
||||||
|
, MIN(comp_id) AS comp_id
|
||||||
|
</if>
|
||||||
|
FROM order_item
|
||||||
|
WHERE order_id = #{orderId} and plate_id != 0
|
||||||
|
<if test="bodyIds != null and bodyIds.size() > 0">
|
||||||
|
AND body_id IN
|
||||||
|
<foreach item="bodyId" collection="bodyIds" open="(" separator="," close=")">
|
||||||
|
#{bodyId}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
<if test="componentIds != null and componentIds.size() > 0">
|
||||||
|
AND comp_id IN
|
||||||
|
<foreach item="componentId" collection="componentIds" open="(" separator="," close=")">
|
||||||
|
#{componentId}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
GROUP BY plate_id
|
||||||
|
) t ON t.plate_id = op.id
|
||||||
|
JOIN order_body ob ON ob.order_id = op.order_id
|
||||||
|
<if test="bodyIds != null and bodyIds.size() > 0">
|
||||||
|
AND ob.id IN
|
||||||
|
<foreach item="bodyId" collection="bodyIds" open="(" separator="," close=")">
|
||||||
|
#{bodyId}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectOrderViewParts" resultType="com.cf.imes.module.executor.dal.dataobject.orderItem.OrdersViewPartsPageDO">
|
||||||
|
SELECT
|
||||||
|
op.id,
|
||||||
|
op.name,
|
||||||
|
op.model,
|
||||||
|
op.spec,
|
||||||
|
ob.name AS bodyName,
|
||||||
|
ob.room_name AS roomName,
|
||||||
|
ob.id AS bodyId,
|
||||||
|
t.num,
|
||||||
|
t.cad_view_id
|
||||||
|
<if test="componentIds != null and componentIds.size() > 0">
|
||||||
|
, t.comp_id
|
||||||
|
</if>
|
||||||
|
FROM order_parts op
|
||||||
|
JOIN (
|
||||||
|
SELECT parts_id,
|
||||||
|
body_id,
|
||||||
|
cad_view_id,
|
||||||
|
SUM(num) AS num
|
||||||
|
<if test="componentIds != null and componentIds.size() > 0">
|
||||||
|
, MIN(comp_id) AS comp_id
|
||||||
|
</if>
|
||||||
|
FROM order_item
|
||||||
|
WHERE order_id = #{orderId} and parts_id != 0
|
||||||
|
<if test="bodyIds != null and bodyIds.size() > 0">
|
||||||
|
AND body_id IN
|
||||||
|
<foreach item="bodyId" collection="bodyIds" open="(" separator="," close=")">
|
||||||
|
#{bodyId}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
<if test="componentIds != null and componentIds.size() > 0">
|
||||||
|
AND comp_id IN
|
||||||
|
<foreach item="componentId" collection="componentIds" open="(" separator="," close=")">
|
||||||
|
#{componentId}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
GROUP BY body_id, parts_id, cad_view_id
|
||||||
|
) t ON t.parts_id = op.id
|
||||||
|
JOIN order_body ob ON ob.order_id = op.order_id
|
||||||
|
<if test="bodyIds != null and bodyIds.size() > 0">
|
||||||
|
AND ob.id IN
|
||||||
|
<foreach item="bodyId" collection="bodyIds" open="(" separator="," close=")">
|
||||||
|
#{bodyId}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
Reference in New Issue
Block a user