master:进货车明细返回storeProductColorSizeId添加;

pull/1121/head
liujiang 2025-05-14 22:26:43 +08:00
parent b9ac177a64
commit dad848dd98
6 changed files with 37 additions and 22 deletions

View File

@ -34,6 +34,8 @@ public class ShopCartResVO {
@Data
@ApiModel(value = "档口优惠列表")
public static class SCDetailVO {
@ApiModelProperty(value = "档口商品颜色尺寸ID")
private Long storeProdColorSizeId;
@ApiModelProperty(value = "档口商品颜色ID")
private Long storeProdColorId;
@ApiModelProperty(value = "尺码")

View File

@ -31,6 +31,10 @@ public class AdvertRoundRecord extends XktBaseEntity {
* 广
*/
private Integer showType;
/**
* 广广
*/
private Integer displayType;
/**
*
*/
@ -87,6 +91,10 @@ public class AdvertRoundRecord extends XktBaseEntity {
*
*/
private Integer biddingStatus;
/**
* advert_round_record
*/
private Integer biddingTempStatus;
/**
*
*/
@ -94,7 +102,7 @@ public class AdvertRoundRecord extends XktBaseEntity {
/**
* 0 1
*/
private Integer picSet;
private Integer picSetType;
/**
* 广ID sysFile.id
*/

View File

@ -35,6 +35,8 @@ public class ShoppingCartDTO {
@ApiModel(value = "档口优惠列表")
@Accessors(chain = true)
public static class SCDetailDTO {
@ApiModelProperty(value = "档口商品颜色尺寸ID")
private Long storeProdColorSizeId;
@ApiModelProperty(value = "档口商品颜色ID")
private Long storeProdColorId;
@ApiModelProperty(value = "尺码")

View File

@ -192,23 +192,17 @@ public class AdminAdvertRoundServiceImpl implements IAdminAdvertRoundService {
if (Objects.equals(advertRound.getSysIntercept(), AdSysInterceptType.INTERCEPT.getValue())) {
throw new ServiceException("该推广位已被拦截,不可再次拦截!", HttpStatus.ERROR);
}
// 若是 时间范围,则判断该推广位、该轮次是否有相同档口已出价或竞价成功,若是,则不可购买。若是位置枚举,则判断该位置 是否是相同档口已出价,若是,则不可购买。
if (Objects.equals(advertRound.getShowType(), AdShowType.TIME_RANGE.getValue())) {
List<AdvertRound> timeRangeExistList = this.advertRoundMapper.selectList(new LambdaQueryWrapper<AdvertRound>()
.eq(AdvertRound::getAdvertId, advertRound.getAdvertId()).eq(AdvertRound::getRoundId, advertRound.getRoundId())
.eq(AdvertRound::getStoreId, interceptDTO.getStoreId()).eq(AdvertRound::getDelFlag, Constants.UNDELETED));
if (CollectionUtils.isNotEmpty(timeRangeExistList)) {
throw new ServiceException("档口" + interceptDTO.getStoreName() + "已出价该推广位,不可重复购买!", HttpStatus.ERROR);
}
} else {
List<AdvertRound> positionEnumExistList = this.advertRoundMapper.selectList(new LambdaQueryWrapper<AdvertRound>()
.eq(AdvertRound::getAdvertId, advertRound.getAdvertId()).eq(AdvertRound::getRoundId, advertRound.getRoundId())
.eq(AdvertRound::getPosition, advertRound.getPosition()).eq(AdvertRound::getDelFlag, Constants.UNDELETED)
.eq(AdvertRound::getStoreId, interceptDTO.getStoreId()));
// 判断要给档口购买的推广位,该档口是否自己已购买
LambdaQueryWrapper<AdvertRound> queryWrapper = new LambdaQueryWrapper<AdvertRound>()
.eq(AdvertRound::getAdvertId, advertRound.getAdvertId()).eq(AdvertRound::getRoundId, advertRound.getRoundId())
.eq(AdvertRound::getStoreId, interceptDTO.getStoreId()).eq(AdvertRound::getDelFlag, Constants.UNDELETED);
if (Objects.equals(advertRound.getShowType(), AdShowType.POSITION_ENUM.getValue())) {
queryWrapper.eq(AdvertRound::getPosition, advertRound.getPosition());
}
List<AdvertRound> existList = this.advertRoundMapper.selectList(queryWrapper);
if (CollectionUtils.isNotEmpty(existList)) {
throw new ServiceException("档口" + interceptDTO.getStoreName() + "已出价该推广位,不可重复购买!", HttpStatus.ERROR);
}
// 若该推广位已投放
if (Objects.equals(advertRound.getLaunchStatus(), AdLaunchStatus.LAUNCHING.getValue())) {
// 若该广告位 为时间范围 且 为档口正常购买(也有可能为系统拦截),则均不可拦截该推广位

View File

@ -724,10 +724,9 @@ public class AdvertRoundServiceImpl implements IAdvertRoundService {
private void record(AdvertRound failAdvert) {
// 新增推广营销历史记录 将旧档口推广营销 置为竞价失败
AdvertRoundRecord record = BeanUtil.toBean(failAdvert, AdvertRoundRecord.class);
record.setId(null);
record.setAdvertRoundId(failAdvert.getId());
// 置为竞价失败
record.setBiddingStatus(AdBiddingStatus.BIDDING_FAIL.getValue());
record.setId(null).setAdvertRoundId(failAdvert.getId()).setDisplayType(failAdvert.getDisplayType())
// 置为竞价失败
.setBiddingStatus(AdBiddingStatus.BIDDING_FAIL.getValue());
this.advertRoundRecordMapper.insert(record);
}

View File

@ -295,12 +295,22 @@ public class ShoppingCartServiceImpl implements IShoppingCartService {
// 商品价格map
Map<String, BigDecimal> priceMap = priceList.stream().collect(Collectors
.toMap(x -> x.getStoreProdId().toString() + x.getStoreColorId().toString(), x -> ObjectUtils.defaultIfNull(x.getPrice(), BigDecimal.ZERO)));
// 获取商品价格尺码
List<StoreProductColorSize> priceSizeList = this.prodColorSizeMapper.selectList(new LambdaQueryWrapper<StoreProductColorSize>()
.in(StoreProductColorSize::getStoreProdId, shoppingCartList.stream().map(ShoppingCart::getStoreProdId).collect(Collectors.toList()))
.in(StoreProductColorSize::getStoreColorId, detailList.stream().map(ShoppingCartDetail::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));
return shoppingCartList.stream().map(x -> {
ShoppingCartDTO shopCartDTO = BeanUtil.toBean(x, ShoppingCartDTO.class)
.setStoreName(ObjectUtils.isNotEmpty(storeMap.get(x.getStoreId())) ? storeMap.get(x.getStoreId()).getStoreName() : "");
List<ShoppingCartDTO.SCDetailDTO> shopCartDetailList = detailMap.get(x.getId()).stream().map(detail -> {
final BigDecimal price = ObjectUtils.defaultIfNull(priceMap.get(x.getStoreProdId().toString() + detail.getStoreColorId().toString()), BigDecimal.ZERO);
return BeanUtil.toBean(detail, ShoppingCartDTO.SCDetailDTO.class).setPrice(price).setAmount(price.multiply(BigDecimal.valueOf(detail.getQuantity())));
return BeanUtil.toBean(detail, ShoppingCartDTO.SCDetailDTO.class).setPrice(price)
.setStoreProdColorSizeId(priceSizeMap.get(x.getStoreProdId().toString() + detail.getStoreColorId().toString() + detail.getSize()))
.setAmount(price.multiply(BigDecimal.valueOf(detail.getQuantity())));
}).collect(Collectors.toList());
return shopCartDTO.setDetailList(shopCartDetailList);
}).collect(Collectors.toList());