pull/1121/head
梁宇奇 2025-05-06 00:03:50 +08:00
parent cdca613b03
commit 73015745f1
7 changed files with 55 additions and 21 deletions

View File

@ -398,6 +398,15 @@ public class StoreOrderInfoVO {
@ApiModelProperty(value = "商品尺码")
private Integer size;
@ApiModelProperty(value = "退货订单明细ID")
private Long refundOrderDetailId;
@ApiModelProperty(value = "退货订单明细状态[10:已取消 11:待付款 12:待发货 13:已发货 14:已完成 21:售后中 22:售后拒绝 23:平台介入 24:售后完成]")
private Integer refundOrderDetailStatus;
@ApiModelProperty(value = "退货商品数量")
private Integer refundGoodsQuantity;
}
}

View File

@ -400,5 +400,14 @@ public class StoreOrderPageItemVO extends StoreOrderDTO {
@ApiModelProperty(value = "商品尺码")
private Integer size;
@ApiModelProperty(value = "退货订单明细ID")
private Long refundOrderDetailId;
@ApiModelProperty(value = "退货订单明细状态[10:已取消 11:待付款 12:待发货 13:已发货 14:已完成 21:售后中 22:售后拒绝 23:平台介入 24:售后完成]")
private Integer refundOrderDetailStatus;
@ApiModelProperty(value = "退货商品数量")
private Integer refundGoodsQuantity;
}
}

View File

@ -14,4 +14,10 @@ import lombok.ToString;
public class StoreOrderDetailInfoDTO extends StoreOrderDetailDTO {
private String firstMainPicUrl;
private Long refundOrderDetailId;
private Integer refundOrderDetailStatus;
private Integer refundGoodsQuantity;
}

View File

@ -33,14 +33,6 @@ public class StoreOrderPageItemDTO extends StoreOrderDTO {
private String destinationCountyName;
private List<Detail> orderDetails;
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public static class Detail extends StoreOrderDetailDTO {
private String firstMainPicUrl;
}
private List<StoreOrderDetailInfoDTO> orderDetails;
}

View File

@ -2,12 +2,19 @@ package com.ruoyi.xkt.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.xkt.domain.StoreOrderDetail;
import com.ruoyi.xkt.dto.order.StoreOrderDetailInfoDTO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.Collection;
import java.util.List;
/**
* @author liangyq
* @date 2025-04-02 12:48
*/
@Repository
public interface StoreOrderDetailMapper extends BaseMapper<StoreOrderDetail> {
List<StoreOrderDetailInfoDTO> listInfoByStoreOrderIds(@Param("storeOrderIds") Collection<Long> storeOrderIds);
}

View File

@ -85,6 +85,7 @@ public class StoreOrderServiceImpl implements IStoreOrderService {
Long storeId = storeOrderAddDTO.getStoreId();
Long expressId = storeOrderAddDTO.getExpressId();
//校验
Assert.notNull(orderUserId);
Assert.notNull(payChannel);
expressService.checkExpress(expressId);
checkDelivery(storeOrderAddDTO.getDeliveryType(), storeOrderAddDTO.getDeliveryEndTime());
@ -354,12 +355,9 @@ public class StoreOrderServiceImpl implements IStoreOrderService {
if (order == null) {
return null;
}
List<StoreOrderDetail> details = storeOrderDetailMapper.selectList(Wrappers.lambdaQuery(StoreOrderDetail.class)
.eq(StoreOrderDetail::getStoreOrderId, storeOrderId)
.eq(SimpleEntity::getDelFlag, Constants.UNDELETED));
List<StoreOrderDetailInfoDTO> detailInfos = storeOrderDetailMapper.listInfoByStoreOrderIds(
Collections.singletonList(storeOrderId));
StoreOrderInfoDTO orderInfo = BeanUtil.toBean(order, StoreOrderInfoDTO.class);
List<StoreOrderDetailInfoDTO> detailInfos = BeanUtil.copyToList(details,
StoreOrderDetailInfoDTO.class);
orderInfo.setOrderDetails(detailInfos);
//档口信息
Store store = storeMapper.selectById(order.getStoreId());
@ -403,17 +401,14 @@ public class StoreOrderServiceImpl implements IStoreOrderService {
if (CollUtil.isNotEmpty(page.getResult())) {
List<StoreOrderPageItemDTO> list = page.getResult();
Set<Long> soIds = list.stream().map(StoreOrderPageItemDTO::getId).collect(Collectors.toSet());
List<StoreOrderDetail> orderDetailList = storeOrderDetailMapper.selectList(Wrappers
.lambdaQuery(StoreOrderDetail.class).eq(SimpleEntity::getDelFlag, Constants.UNDELETED)
.in(StoreOrderDetail::getStoreOrderId, soIds));
List<Long> spIds = orderDetailList.stream().map(StoreOrderDetail::getStoreProdId).distinct()
List<StoreOrderDetailInfoDTO> orderDetailList = storeOrderDetailMapper.listInfoByStoreOrderIds(soIds);
List<Long> spIds = orderDetailList.stream().map(StoreOrderDetailInfoDTO::getStoreProdId).distinct()
.collect(Collectors.toList());
Map<Long, String> mainPicMap = storeProductFileMapper.selectMainPicByStoreProdIdList(spIds,
FileType.MAIN_PIC.getValue(), ORDER_NUM_1).stream()
.collect(Collectors.toMap(StoreProdMainPicDTO::getStoreProdId, StoreProdMainPicDTO::getFileUrl,
(o, n) -> n));
Map<Long, List<StoreOrderPageItemDTO.Detail>> orderDetailGroup = BeanUtil.copyToList(orderDetailList,
StoreOrderPageItemDTO.Detail.class)
Map<Long, List<StoreOrderDetailInfoDTO>> orderDetailGroup = orderDetailList
.stream()
.collect(Collectors.groupingBy(StoreOrderDetailDTO::getStoreOrderId));
Map<String, ExpressRegionDTO> regionMap = expressService.getRegionMapCache();
@ -432,7 +427,7 @@ public class StoreOrderServiceImpl implements IStoreOrderService {
order.setOriginCountyName(Optional.ofNullable(regionMap.get(order.getOriginCountyCode()))
.map(ExpressRegionDTO::getParentRegionName).orElse(null));
order.setOrderDetails(orderDetailGroup.get(order.getId()));
for (StoreOrderPageItemDTO.Detail detail : order.getOrderDetails()) {
for (StoreOrderDetailInfoDTO detail : order.getOrderDetails()) {
//首图
detail.setFirstMainPicUrl(mainPicMap.get(detail.getStoreProdId()));
}

View File

@ -2,4 +2,20 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.xkt.mapper.StoreOrderDetailMapper">
<select id="listInfoByStoreOrderIds" resultType="com.ruoyi.xkt.dto.order.StoreOrderDetailInfoDTO">
SELECT
sod1.*,
sod2.id AS refund_order_detail_id,
sod2.detail_status AS refund_order_detail_status,
sod2.goods_quantity AS refund_goods_quantity
FROM
store_order_detail sod1
LEFT JOIN store_order_detail sod2 ON sod1.id = sod2.origin_order_detail_id AND sod2.del_flag = '0'
WHERE
sod1.del_flag = '0'
AND sod1.store_order_id IN
<foreach collection="storeOrderIds" item="storeOrderId" open="(" separator="," close=")">
#{storeOrderId}
</foreach>
</select>
</mapper>