diff --git a/yudao-module-mall/yudao-module-promotion-api/src/main/java/cn/iocoder/yudao/module/promotion/api/combination/CombinationRecordApi.java b/yudao-module-mall/yudao-module-promotion-api/src/main/java/cn/iocoder/yudao/module/promotion/api/combination/CombinationRecordApi.java index cc3fd443a1..06a24f3059 100644 --- a/yudao-module-mall/yudao-module-promotion-api/src/main/java/cn/iocoder/yudao/module/promotion/api/combination/CombinationRecordApi.java +++ b/yudao-module-mall/yudao-module-promotion-api/src/main/java/cn/iocoder/yudao/module/promotion/api/combination/CombinationRecordApi.java @@ -18,12 +18,13 @@ public interface CombinationRecordApi { /** * 校验是否满足拼团条件 * - * @param activityId 活动编号 * @param userId 用户编号 + * @param activityId 活动编号 + * @param headId 团长编号 * @param skuId sku 编号 * @param count 数量 */ - void validateCombinationRecord(Long activityId, Long userId, Long skuId, Integer count); + void validateCombinationRecord(Long userId, Long activityId, Long headId, Long skuId, Integer count); /** * 创建开团记录 @@ -71,13 +72,13 @@ public interface CombinationRecordApi { * * 如果校验失败,则抛出业务异常 * - * @param activityId 活动编号 * @param userId 用户编号 + * @param activityId 活动编号 + * @param headId 团长编号 * @param skuId sku 编号 * @param count 数量 * @return 拼团信息 */ - // TODO @puhui:userId 放最前面;然后应该还有个 headId 参数; - CombinationValidateJoinRespDTO validateJoinCombination(Long activityId, Long userId, Long skuId, Integer count); + CombinationValidateJoinRespDTO validateJoinCombination(Long userId, Long activityId, Long headId, Long skuId, Integer count); } diff --git a/yudao-module-mall/yudao-module-promotion-api/src/main/java/cn/iocoder/yudao/module/promotion/enums/ErrorCodeConstants.java b/yudao-module-mall/yudao-module-promotion-api/src/main/java/cn/iocoder/yudao/module/promotion/enums/ErrorCodeConstants.java index c1130f2219..dc4f0ee084 100644 --- a/yudao-module-mall/yudao-module-promotion-api/src/main/java/cn/iocoder/yudao/module/promotion/enums/ErrorCodeConstants.java +++ b/yudao-module-mall/yudao-module-promotion-api/src/main/java/cn/iocoder/yudao/module/promotion/enums/ErrorCodeConstants.java @@ -80,7 +80,7 @@ public interface ErrorCodeConstants { ErrorCode COMBINATION_RECORD_EXISTS = new ErrorCode(1_013_011_001, "拼团失败,已参与过该拼团"); ErrorCode COMBINATION_RECORD_HEAD_NOT_EXISTS = new ErrorCode(1_013_011_002, "拼团失败,父拼团不存在"); ErrorCode COMBINATION_RECORD_USER_FULL = new ErrorCode(1_013_011_003, "拼团失败,拼团人数已满"); - ErrorCode COMBINATION_RECORD_FAILED_HAVE_JOINED = new ErrorCode(1_013_011_004, "拼团失败,已参与其它拼团"); + ErrorCode COMBINATION_RECORD_FAILED_HAVE_JOINED = new ErrorCode(1_013_011_004, "拼团失败,原因:存在该活动正在进行的拼团记录"); ErrorCode COMBINATION_RECORD_FAILED_TIME_NOT_START = new ErrorCode(1_013_011_005, "拼团失败,活动未开始"); ErrorCode COMBINATION_RECORD_FAILED_TIME_END = new ErrorCode(1_013_011_006, "拼团失败,活动已经结束"); ErrorCode COMBINATION_RECORD_FAILED_SINGLE_LIMIT_COUNT_EXCEED = new ErrorCode(1_013_011_007, "拼团失败,原因:单次限购超出"); diff --git a/yudao-module-mall/yudao-module-promotion-api/src/main/java/cn/iocoder/yudao/module/promotion/enums/combination/CombinationRecordStatusEnum.java b/yudao-module-mall/yudao-module-promotion-api/src/main/java/cn/iocoder/yudao/module/promotion/enums/combination/CombinationRecordStatusEnum.java index d1e6114a16..2d12b20489 100644 --- a/yudao-module-mall/yudao-module-promotion-api/src/main/java/cn/iocoder/yudao/module/promotion/enums/combination/CombinationRecordStatusEnum.java +++ b/yudao-module-mall/yudao-module-promotion-api/src/main/java/cn/iocoder/yudao/module/promotion/enums/combination/CombinationRecordStatusEnum.java @@ -40,4 +40,8 @@ public enum CombinationRecordStatusEnum implements IntArrayValuable { return ObjectUtil.equal(status, SUCCESS.getStatus()); } + public static boolean isInProgress(Integer status) { + return ObjectUtil.equal(status, IN_PROGRESS.getStatus()); + } + } diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/api/combination/CombinationRecordApiImpl.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/api/combination/CombinationRecordApiImpl.java index a32d35e29d..b30bdab8dc 100644 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/api/combination/CombinationRecordApiImpl.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/api/combination/CombinationRecordApiImpl.java @@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.promotion.api.combination; import cn.iocoder.yudao.module.promotion.api.combination.dto.CombinationRecordCreateReqDTO; import cn.iocoder.yudao.module.promotion.api.combination.dto.CombinationValidateJoinRespDTO; +import cn.iocoder.yudao.module.promotion.dal.dataobject.combination.CombinationRecordDO; import cn.iocoder.yudao.module.promotion.enums.combination.CombinationRecordStatusEnum; import cn.iocoder.yudao.module.promotion.service.combination.CombinationRecordService; import org.springframework.stereotype.Service; @@ -9,6 +10,9 @@ import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.time.LocalDateTime; +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; +import static cn.iocoder.yudao.module.promotion.enums.ErrorCodeConstants.COMBINATION_RECORD_NOT_EXISTS; + /** * 拼团活动 API 实现类 * @@ -21,8 +25,8 @@ public class CombinationRecordApiImpl implements CombinationRecordApi { private CombinationRecordService recordService; @Override - public void validateCombinationRecord(Long activityId, Long userId, Long skuId, Integer count) { - recordService.validateCombinationRecord(activityId, userId, skuId, count); + public void validateCombinationRecord(Long userId, Long activityId, Long headId, Long skuId, Integer count) { + recordService.validateCombinationRecord(userId, activityId, headId, skuId, count); } @Override @@ -32,7 +36,12 @@ public class CombinationRecordApiImpl implements CombinationRecordApi { @Override public boolean isCombinationRecordSuccess(Long userId, Long orderId) { - return CombinationRecordStatusEnum.isSuccess(recordService.getCombinationRecord(userId, orderId).getStatus()); + CombinationRecordDO combinationRecord = recordService.getCombinationRecord(userId, orderId); + if (combinationRecord == null) { + throw exception(COMBINATION_RECORD_NOT_EXISTS); + } + + return CombinationRecordStatusEnum.isSuccess(combinationRecord.getStatus()); } @Override @@ -52,8 +61,8 @@ public class CombinationRecordApiImpl implements CombinationRecordApi { } @Override - public CombinationValidateJoinRespDTO validateJoinCombination(Long activityId, Long userId, Long skuId, Integer count) { - return recordService.validateJoinCombination(activityId, userId, skuId, count); + public CombinationValidateJoinRespDTO validateJoinCombination(Long userId, Long activityId, Long headId, Long skuId, Integer count) { + return recordService.validateJoinCombination(userId, activityId, headId, skuId, count); } } diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/combination/vo/activity/CombinationActivityBaseVO.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/combination/vo/activity/CombinationActivityBaseVO.java index edb85e5e65..4b3abeab43 100644 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/combination/vo/activity/CombinationActivityBaseVO.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/combination/vo/activity/CombinationActivityBaseVO.java @@ -48,8 +48,9 @@ public class CombinationActivityBaseVO { @NotNull(message = "开团人数不能为空") private Integer userSize; - @Schema(description = "虚拟成团", requiredMode = Schema.RequiredMode.REQUIRED, example = "10") - private Boolean virtualGroup = false; // TODO @puhui999:这个字段界面没做呀。 + @Schema(description = "虚拟成团", requiredMode = Schema.RequiredMode.REQUIRED, example = "false") + @NotNull(message = "虚拟成团不能为空") + private Boolean virtualGroup; @Schema(description = "限制时长(小时)", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") @NotNull(message = "限制时长不能为空") diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/mysql/combination/CombinationRecordMapper.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/mysql/combination/CombinationRecordMapper.java index 691044dc9b..163b5eef04 100644 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/mysql/combination/CombinationRecordMapper.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/mysql/combination/CombinationRecordMapper.java @@ -113,7 +113,7 @@ public interface CombinationRecordMapper extends BaseMapperX MapUtil.getLong(record, "activityId"), - record -> MapUtil.getInt(record, "recordCount" )); + record -> MapUtil.getInt(record, "recordCount")); } static LocalDateTime[] builderQueryTime(Integer dateType) { @@ -172,4 +172,20 @@ public interface CombinationRecordMapper extends BaseMapperX selectList(Long activityId, Long headId) { + return selectList(new LambdaQueryWrapperX() + .eq(CombinationRecordDO::getActivityId, activityId) + .eq(CombinationRecordDO::getHeadId, headId) + .or() + .eq(CombinationRecordDO::getId, headId)); + + } + } diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/combination/CombinationRecordService.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/combination/CombinationRecordService.java index 43372f6740..68f218d590 100644 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/combination/CombinationRecordService.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/combination/CombinationRecordService.java @@ -32,16 +32,18 @@ public interface CombinationRecordService { void updateCombinationRecordStatusByUserIdAndOrderId(Integer status, Long userId, Long orderId); /** - * 校验是否满足拼团条件 - * 如果不满足,会抛出异常 + * 【下单前】校验是否满足拼团活动条件 + * + * 如果校验失败,则抛出业务异常 * - * @param activityId 活动编号 * @param userId 用户编号 + * @param activityId 活动编号 + * @param headId 团长编号 * @param skuId sku 编号 * @param count 数量 - * @return 返回拼团活动和拼团活动商品 + * @return 拼团信息 */ - KeyValue validateCombinationRecord(Long activityId, Long userId, Long skuId, Integer count); + KeyValue validateCombinationRecord(Long userId, Long activityId, Long headId, Long skuId, Integer count); /** * 创建拼团记录 @@ -83,13 +85,14 @@ public interface CombinationRecordService { * * 如果校验失败,则抛出业务异常 * - * @param activityId 活动编号 * @param userId 用户编号 + * @param activityId 活动编号 + * @param headId 团长编号 * @param skuId sku 编号 * @param count 数量 * @return 拼团信息 */ - CombinationValidateJoinRespDTO validateJoinCombination(Long activityId, Long userId, Long skuId, Integer count); + CombinationValidateJoinRespDTO validateJoinCombination(Long userId, Long activityId, Long headId, Long skuId, Integer count); /** * 获取所有拼团记录数 diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/combination/CombinationRecordServiceImpl.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/combination/CombinationRecordServiceImpl.java index 9b62125798..25445d4b2a 100644 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/combination/CombinationRecordServiceImpl.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/service/combination/CombinationRecordServiceImpl.java @@ -1,11 +1,11 @@ package cn.iocoder.yudao.module.promotion.service.combination; import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.ObjUtil; import cn.hutool.core.util.ObjectUtil; import cn.iocoder.yudao.framework.common.core.KeyValue; import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; import cn.iocoder.yudao.framework.common.pojo.PageResult; -import cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils; import cn.iocoder.yudao.module.member.api.user.MemberUserApi; import cn.iocoder.yudao.module.member.api.user.dto.MemberUserRespDTO; import cn.iocoder.yudao.module.product.api.sku.ProductSkuApi; @@ -37,6 +37,8 @@ import java.util.Map; import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.*; +import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.afterNow; +import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.beforeNow; import static cn.iocoder.yudao.module.promotion.enums.ErrorCodeConstants.*; // TODO 芋艿:等拼团记录做完,完整 review 下 @@ -114,48 +116,83 @@ public class CombinationRecordServiceImpl implements CombinationRecordService { // TODO @芋艿:在详细预览下; @Override public KeyValue validateCombinationRecord( - Long activityId, Long userId, Long skuId, Integer count) { - // 1.1 校验拼团活动是否存在 + Long userId, Long activityId, Long headId, Long skuId, Integer count) { + // 1 校验拼团活动是否存在 CombinationActivityDO activity = combinationActivityService.validateCombinationActivityExists(activityId); - // 1.2 校验活动是否开启 - if (ObjectUtil.equal(activity.getStatus(), CommonStatusEnum.DISABLE.getStatus())) { + // 1.1 校验活动是否开启 + if (ObjUtil.equal(activity.getStatus(), CommonStatusEnum.DISABLE.getStatus())) { throw exception(COMBINATION_ACTIVITY_STATUS_DISABLE); } - // 2 校验是否超出单次限购数量 + // 1.2、校验活动开始时间 + if (afterNow(activity.getStartTime())) { + throw exception(COMBINATION_RECORD_FAILED_TIME_NOT_START); + } + // 1.3 校验是否超出单次限购数量 if (count > activity.getSingleLimitCount()) { throw exception(COMBINATION_RECORD_FAILED_SINGLE_LIMIT_COUNT_EXCEED); } - // 2.1、校验活动商品是否存在 + + // 2、父拼团是否存在,是否已经满了 + if (headId != null) { + // 2.1、查询进行中的父拼团 + CombinationRecordDO record = recordMapper.selectOneByHeadId(headId, CombinationRecordStatusEnum.IN_PROGRESS.getStatus()); + if (record == null) { + throw exception(COMBINATION_RECORD_HEAD_NOT_EXISTS); + } + // 2.2、校验拼团是否满足要求 + if (ObjUtil.equal(record.getUserCount(), record.getUserSize())) { + throw exception(COMBINATION_RECORD_USER_FULL); + } + // 2.3、校验拼团是否过期 + if (beforeNow(record.getExpireTime())) { + throw exception(COMBINATION_RECORD_FAILED_TIME_END); + } + } + + // 3、校验当前活动是否结束 + if (beforeNow(activity.getEndTime())) { + throw exception(COMBINATION_RECORD_FAILED_TIME_END); + } + + // 4、校验活动商品是否存在 CombinationProductDO product = combinationActivityService.selectByActivityIdAndSkuId(activityId, skuId); if (product == null) { throw exception(COMBINATION_JOIN_ACTIVITY_PRODUCT_NOT_EXISTS); } - // 2.2、校验 sku 是否存在 + + // 5、校验 sku 是否存在 ProductSkuRespDTO sku = productSkuApi.getSku(skuId); if (sku == null) { throw exception(COMBINATION_JOIN_ACTIVITY_PRODUCT_NOT_EXISTS); } - // 2.3、 校验库存是否充足 + // 5.1、校验库存是否充足 if (count > sku.getStock()) { throw exception(COMBINATION_ACTIVITY_UPDATE_STOCK_FAIL); } - // 3、校验是否有拼团记录 + + // 6、校验是否有拼团记录 List recordList = getCombinationRecordListByUserIdAndActivityId(userId, activityId); if (CollUtil.isEmpty(recordList)) { return new KeyValue<>(activity, product); } - // 4、校验是否超出总限购数量 + // 6.1、校验用户是否有该活动正在进行的拼团 + List filtered = filterList(recordList, record -> CombinationRecordStatusEnum.isInProgress(record.getStatus())); + if (CollUtil.isNotEmpty(filtered)) { + throw exception(COMBINATION_RECORD_FAILED_HAVE_JOINED); + } + // 6.2、校验是否超出总限购数量 Integer sumValue = getSumValue(convertList(recordList, CombinationRecordDO::getCount, - item -> ObjectUtil.equals(item.getStatus(), CombinationRecordStatusEnum.SUCCESS.getStatus())), i -> i, Integer::sum); + item -> CombinationRecordStatusEnum.isSuccess(item.getStatus())), i -> i, Integer::sum); if ((sumValue + count) > activity.getTotalLimitCount()) { throw exception(COMBINATION_RECORD_FAILED_TOTAL_LIMIT_COUNT_EXCEED); } - // 5、校验拼团记录是否存在未支付的订单(如果存在未支付的订单则不允许发起新的拼团) + + // 7、校验拼团记录是否存在未支付的订单(如果存在未支付的订单则不允许发起新的拼团) CombinationRecordDO record = findFirst(recordList, item -> ObjectUtil.equals(item.getStatus(), null)); if (record == null) { return new KeyValue<>(activity, product); } - // 5.1、查询关联的订单是否已经支付 + // 7.1、查询关联的订单是否已经支付 // 当前 activityId 已经有未支付的订单,不允许在发起新的;要么支付,要么去掉先; // TODO 芋艿:看看是不是可以删除掉; Integer orderStatus = tradeOrderApi.getOrderStatus(record.getOrderId()); @@ -171,46 +208,19 @@ public class CombinationRecordServiceImpl implements CombinationRecordService { @Transactional(rollbackFor = Exception.class) public void createCombinationRecord(CombinationRecordCreateReqDTO reqDTO) { // 1、校验拼团活动 - KeyValue keyValue = validateCombinationRecord( - reqDTO.getActivityId(), reqDTO.getUserId(), reqDTO.getSkuId(), reqDTO.getCount()); - CombinationActivityDO activity = keyValue.getKey(); - // 2、校验用户是否参加了其它拼团 - List recordDOList = recordMapper.selectListByUserIdAndStatus(reqDTO.getUserId(), CombinationRecordStatusEnum.IN_PROGRESS.getStatus()); - if (CollUtil.isNotEmpty(recordDOList)) { - throw exception(COMBINATION_RECORD_FAILED_HAVE_JOINED); - } - // 3、校验活动是否开启 - if (!LocalDateTimeUtils.beforeNow(activity.getStartTime())) { - throw exception(COMBINATION_RECORD_FAILED_TIME_NOT_START); - } - // 4、校验当前活动是否过期 - if (LocalDateTime.now().isAfter(activity.getEndTime())) { - throw exception(COMBINATION_RECORD_FAILED_TIME_END); - } - // 5、父拼团是否存在,是否已经满了 - if (reqDTO.getHeadId() != null) { - // 5.1、查询进行中的父拼团 - CombinationRecordDO record = recordMapper.selectOneByHeadId(reqDTO.getHeadId(), CombinationRecordStatusEnum.IN_PROGRESS.getStatus()); - if (record == null) { - throw exception(COMBINATION_RECORD_HEAD_NOT_EXISTS); - } - // 5.2、校验拼团是否满足要求 - if (ObjectUtil.equal(record.getUserCount(), record.getUserSize())) { - throw exception(COMBINATION_RECORD_USER_FULL); - } - } + KeyValue keyValue = validateCombinationRecord(reqDTO.getUserId(), + reqDTO.getActivityId(), reqDTO.getHeadId(), reqDTO.getSkuId(), reqDTO.getCount()); - // 6. 创建拼团记录 + // 2. 组合数据创建拼团记录 MemberUserRespDTO user = memberUserApi.getUser(reqDTO.getUserId()); ProductSpuRespDTO spu = productSpuApi.getSpu(reqDTO.getSpuId()); ProductSkuRespDTO sku = productSkuApi.getSku(reqDTO.getSkuId()); - recordMapper.insert(CombinationActivityConvert.INSTANCE.convert(reqDTO, activity, user, spu, sku)); + recordMapper.insert(CombinationActivityConvert.INSTANCE.convert(reqDTO, keyValue.getKey(), user, spu, sku)); } @Override public CombinationRecordDO getCombinationRecord(Long userId, Long orderId) { - // TODO puhui999:这里直接获得,不适合调用校验的接口; - return validateCombinationRecord(userId, orderId); + return recordMapper.selectByUserIdAndOrderId(userId, orderId); } @Override @@ -219,8 +229,8 @@ public class CombinationRecordServiceImpl implements CombinationRecordService { } @Override - public CombinationValidateJoinRespDTO validateJoinCombination(Long activityId, Long userId, Long skuId, Integer count) { - KeyValue keyValue = validateCombinationRecord(activityId, userId, skuId, count); + public CombinationValidateJoinRespDTO validateJoinCombination(Long userId, Long activityId, Long headId, Long skuId, Integer count) { + KeyValue keyValue = validateCombinationRecord(userId, activityId, headId, skuId, count); return new CombinationValidateJoinRespDTO() .setActivityId(keyValue.getKey().getId()) .setName(keyValue.getKey().getName()) diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/order/handler/TradeCombinationHandler.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/order/handler/TradeCombinationHandler.java index d7eeeb1911..95262f95c7 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/order/handler/TradeCombinationHandler.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/order/handler/TradeCombinationHandler.java @@ -34,7 +34,8 @@ public class TradeCombinationHandler implements TradeOrderHandler { // 获取商品信息 TradeOrderItemDO item = orderItems.get(0); // 校验是否满足拼团活动相关限制 - combinationRecordApi.validateCombinationRecord(order.getCombinationActivityId(), order.getUserId(), item.getSkuId(), item.getCount()); + combinationRecordApi.validateCombinationRecord(order.getUserId(), order.getCombinationActivityId(), + order.getCombinationHeadId(), item.getSkuId(), item.getCount()); } @Override diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/price/calculator/TradeCombinationActivityPriceCalculator.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/price/calculator/TradeCombinationActivityPriceCalculator.java index d67ee8748a..4021bbeaec 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/price/calculator/TradeCombinationActivityPriceCalculator.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/price/calculator/TradeCombinationActivityPriceCalculator.java @@ -13,6 +13,7 @@ import org.springframework.stereotype.Component; import javax.annotation.Resource; // TODO @puhui999:单测可以后补下 + /** * 拼团活动的 {@link TradePriceCalculator} 实现类 * @@ -35,7 +36,7 @@ public class TradeCombinationActivityPriceCalculator implements TradePriceCalcul // 2. 校验是否可以参与拼团 TradePriceCalculateRespBO.OrderItem orderItem = result.getItems().get(0); CombinationValidateJoinRespDTO combinationActivity = combinationRecordApi.validateJoinCombination( - param.getCombinationActivityId(), param.getUserId(), + param.getUserId(), param.getCombinationActivityId(), param.getCombinationHeadId(), orderItem.getSkuId(), orderItem.getCount()); // 3.1 记录优惠明细