Commit 4aa9efc0dccafa69f80296a809a775235f0058fa
1 parent
f5f7061e
!1358 fix(mall):拼团记录创建时,需要设置拼团商品的图片
Showing
2 changed files
with
3 additions
and
10 deletions
yudao-module-mall/yudao-module-promotion/src/main/java/cn/iocoder/yudao/module/promotion/convert/combination/CombinationActivityConvert.java
| ... | ... | @@ -122,10 +122,8 @@ public interface CombinationActivityConvert { |
| 122 | 122 | return convert(reqDTO).setVirtualGroup(false) |
| 123 | 123 | .setStatus(CombinationRecordStatusEnum.IN_PROGRESS.getStatus()) // 创建后默认状态为进行中 |
| 124 | 124 | .setUserSize(activity.getUserSize()).setUserCount(1) // 默认就是 1 插入后会接着更新一次所有的拼团记录 |
| 125 | - // 用户信息 | |
| 126 | - .setNickname(user.getNickname()).setAvatar(user.getAvatar()) | |
| 127 | - // 商品信息 | |
| 128 | - .setSpuName(spu.getName()).setPicUrl(sku.getPicUrl()); | |
| 125 | + .setNickname(user.getNickname()).setAvatar(user.getAvatar()) // 用户信息 | |
| 126 | + .setSpuName(spu.getName()).setPicUrl(ObjectUtil.defaultIfBlank(sku.getPicUrl(), spu.getPicUrl())); // 商品信息 | |
| 129 | 127 | } |
| 130 | 128 | |
| 131 | 129 | default List<CombinationActivityRespVO> convertList(List<CombinationActivityDO> list, | ... | ... |
yudao-module-mall/yudao-module-promotion/src/main/java/cn/iocoder/yudao/module/promotion/service/combination/CombinationRecordServiceImpl.java
| ... | ... | @@ -50,8 +50,6 @@ import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.bef |
| 50 | 50 | import static cn.iocoder.yudao.module.promotion.enums.ErrorCodeConstants.*; |
| 51 | 51 | import static cn.iocoder.yudao.module.promotion.enums.MessageTemplateConstants.COMBINATION_SUCCESS; |
| 52 | 52 | |
| 53 | -// TODO 芋艿:等拼团记录做完,完整 review 下 | |
| 54 | - | |
| 55 | 53 | /** |
| 56 | 54 | * 拼团记录 Service 实现类 |
| 57 | 55 | * |
| ... | ... | @@ -167,7 +165,6 @@ public class CombinationRecordServiceImpl implements CombinationRecordService { |
| 167 | 165 | ProductSpuRespDTO spu = productSpuApi.getSpu(reqDTO.getSpuId()); |
| 168 | 166 | ProductSkuRespDTO sku = productSkuApi.getSku(reqDTO.getSkuId()); |
| 169 | 167 | CombinationRecordDO record = CombinationActivityConvert.INSTANCE.convert(reqDTO, keyValue.getKey(), user, spu, sku); |
| 170 | - record.setPicUrl(spu.getPicUrl()); // fix:拼团记录创建时,需要设置拼团商品的图片 | |
| 171 | 168 | // 2.1. 如果是团长需要设置 headId 为 CombinationRecordDO#HEAD_ID_GROUP |
| 172 | 169 | if (record.getHeadId() == null) { |
| 173 | 170 | record.setStartTime(LocalDateTime.now()) |
| ... | ... | @@ -220,9 +217,7 @@ public class CombinationRecordServiceImpl implements CombinationRecordService { |
| 220 | 217 | |
| 221 | 218 | // 3. 拼团成功发送订阅消息 |
| 222 | 219 | if (updateSuccess && isFull) { |
| 223 | - records.forEach(item -> { | |
| 224 | - getSelf().sendCombinationResultMessage(item); | |
| 225 | - }); | |
| 220 | + records.forEach(item -> getSelf().sendCombinationResultMessage(item)); | |
| 226 | 221 | } |
| 227 | 222 | } |
| 228 | 223 | ... | ... |