|
@@ -155,15 +155,17 @@ public class CdKeyGroupServiceImpl extends ServiceImpl<CdKeyGroupMapper, CdKeyGr
|
|
QueryWrapper<CdKeyGroupGoods> queryWrapper = new QueryWrapper<>();
|
|
QueryWrapper<CdKeyGroupGoods> queryWrapper = new QueryWrapper<>();
|
|
queryWrapper.eq("group_id", groupId);
|
|
queryWrapper.eq("group_id", groupId);
|
|
List<CdKeyGroupGoods> list = cdKeyGroupGoodsService.list(queryWrapper);
|
|
List<CdKeyGroupGoods> list = cdKeyGroupGoodsService.list(queryWrapper);
|
|
- List<CdKey> cdKeyList = new ArrayList<>();
|
|
|
|
if (CollectionUtils.isNotEmpty(list)) {
|
|
if (CollectionUtils.isNotEmpty(list)) {
|
|
for (CdKeyGroupGoods cdKeyGroupGoods : list) {
|
|
for (CdKeyGroupGoods cdKeyGroupGoods : list) {
|
|
|
|
+ List<CdKey> cdKeyList = new ArrayList<>();
|
|
for (int i = 0; i < cdKeyGroupGoods.getQuantity(); i++) {
|
|
for (int i = 0; i < cdKeyGroupGoods.getQuantity(); i++) {
|
|
// 为每一个商品生成兑换码
|
|
// 为每一个商品生成兑换码
|
|
CdKey cdKey = new CdKey();
|
|
CdKey cdKey = new CdKey();
|
|
cdKey.setGroupId(groupId);
|
|
cdKey.setGroupId(groupId);
|
|
cdKey.setRefId(cdKeyGroupGoods.getRefId());
|
|
cdKey.setRefId(cdKeyGroupGoods.getRefId());
|
|
cdKey.setType(cdKeyGroupGoods.getType());
|
|
cdKey.setType(cdKeyGroupGoods.getType());
|
|
|
|
+ cdKey.setGoodsName(cdKeyGroupGoods.getTitle());
|
|
|
|
+ cdKey.setValue(cdKeyGroupGoods.getValue());
|
|
cdKey.setPicUrl(cdKeyGroupGoods.getPicUrl());
|
|
cdKey.setPicUrl(cdKeyGroupGoods.getPicUrl());
|
|
cdKey.setStatus(CdKeyStatusEnum.UNCASHED.getValue());
|
|
cdKey.setStatus(CdKeyStatusEnum.UNCASHED.getValue());
|
|
cdKey.setCdKey(cdKeyGenerate());
|
|
cdKey.setCdKey(cdKeyGenerate());
|