master:进货车列表返回storeProdColorSizeId;
parent
4bbb28bbbd
commit
3c5ba099bc
|
|
@ -22,7 +22,7 @@ import java.util.List;
|
|||
public class ShopCartPageVO extends BasePageVO {
|
||||
|
||||
@NotNull(message = "商品状态不可为空!")
|
||||
@ApiModelProperty(value = "商品状态,在售传:2, 已失效传:4,5", required = true)
|
||||
@ApiModelProperty(value = "商品状态,在售传:2,3, 已失效传:4,5", required = true)
|
||||
private List<Integer> statusList;
|
||||
@ApiModelProperty(value = "商品货号")
|
||||
private String prodArtNum;
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.ruoyi.xkt.dto.userShoppingCart;
|
|||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
|
|
@ -12,13 +13,15 @@ import java.math.BigDecimal;
|
|||
* @date 2025/3/27 15:12
|
||||
*/
|
||||
@Data
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@Accessors(chain = true)
|
||||
public class ShopCartPageDetailResDTO {
|
||||
|
||||
@ApiModelProperty(value = "进货车明细ID")
|
||||
private Long shoppingCartDetailId;
|
||||
@ApiModelProperty(value = "进货单ID")
|
||||
private Long shoppingCartId;
|
||||
@ApiModelProperty(value = "档口商品颜色尺寸ID")
|
||||
private Long storeProdColorSizeId;
|
||||
@ApiModelProperty(value = "档口商品颜色ID")
|
||||
private Long storeProdColorId;
|
||||
@ApiModelProperty(value = "尺码")
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
package com.ruoyi.xkt.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
|
|
@ -10,7 +9,6 @@ import com.ruoyi.common.constant.HttpStatus;
|
|||
import com.ruoyi.common.core.domain.model.LoginUser;
|
||||
import com.ruoyi.common.core.page.Page;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.xkt.domain.*;
|
||||
import com.ruoyi.xkt.dto.storeProductFile.StoreProdMainPicDTO;
|
||||
|
|
@ -114,6 +112,14 @@ public class ShoppingCartServiceImpl implements IShoppingCartService {
|
|||
.map(ShopCartPageResDTO::getStoreProdId).collect(Collectors.toList()), FileType.MAIN_PIC.getValue(), ORDER_NUM_1);
|
||||
Map<Long, String> mainPicMap = CollectionUtils.isEmpty(mainPicList) ? new HashMap<>() : mainPicList.stream()
|
||||
.collect(Collectors.toMap(StoreProdMainPicDTO::getStoreProdId, StoreProdMainPicDTO::getFileUrl));
|
||||
// 获取商品价格尺码
|
||||
List<StoreProductColorSize> priceSizeList = this.prodColorSizeMapper.selectList(new LambdaQueryWrapper<StoreProductColorSize>()
|
||||
.in(StoreProductColorSize::getStoreProdId, shoppingCartList.stream().map(ShopCartPageResDTO::getStoreProdId).collect(Collectors.toList()))
|
||||
.in(StoreProductColorSize::getStoreColorId, detailList.stream().map(ShopCartPageDetailResDTO::getStoreColorId).collect(Collectors.toList()))
|
||||
.eq(StoreProductColorSize::getDelFlag, Constants.UNDELETED));
|
||||
// 商品价格尺码map
|
||||
Map<String, Long> priceSizeMap = priceSizeList.stream().collect(Collectors
|
||||
.toMap(x -> x.getStoreProdId().toString() + x.getStoreColorId().toString() + x.getSize(), StoreProductColorSize::getId));
|
||||
// 获取所有标准尺码
|
||||
List<StoreProductColorSize> standardSizeList = this.prodColorSizeMapper.selectList(new LambdaQueryWrapper<StoreProductColorSize>()
|
||||
.in(StoreProductColorSize::getStoreProdId, shoppingCartList.stream().map(ShopCartPageResDTO::getStoreProdId).collect(Collectors.toList()))
|
||||
|
|
@ -138,7 +144,8 @@ public class ShoppingCartServiceImpl implements IShoppingCartService {
|
|||
shoppingCartList.forEach(x -> {
|
||||
x.setMainPicUrl(mainPicMap.getOrDefault(x.getStoreProdId(), null));
|
||||
x.getDetailList()
|
||||
.forEach(detail -> detail.setStandardSize(minAndMaxSizeMap.getOrDefault(x.getStoreProdId(), "")));
|
||||
.forEach(detail -> detail.setStandardSize(minAndMaxSizeMap.getOrDefault(x.getStoreProdId(), ""))
|
||||
.setStoreProdColorSizeId(priceSizeMap.get(x.getStoreProdId().toString() + detail.getStoreColorId().toString() + detail.getSize())));
|
||||
});
|
||||
return Page.convert(new PageInfo<>(shoppingCartList));
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue