Commit dbe646f5 authored by wp's avatar wp

商品价格同步到规格表

parent 5e3fa076
...@@ -28,7 +28,7 @@ public interface ISkuService extends IService<Sku> { ...@@ -28,7 +28,7 @@ public interface ISkuService extends IService<Sku> {
* @param merchantId 商户id * @param merchantId 商户id
* @param commodityPass 商品通证 * @param commodityPass 商品通证
*/ */
void add(List<GoodsSkuDTO> kDTOs, String goodsId, String goodsName, String merchantId, String addr, Integer commodityPass, String thumb, Integer pDTOType, Integer salesType, BigDecimal blindBoxPrice); void add(List<GoodsSkuDTO> kDTOs, String goodsId, String goodsName, String merchantId, String addr, Integer commodityPass, String thumb, Integer pDTOType, Integer salesType, BigDecimal blindBoxPrice, BigDecimal price);
/** /**
* 新增商品规格 * 新增商品规格
......
...@@ -71,7 +71,7 @@ public class SkuServiceImpl extends ServiceImpl<SkuMapper, Sku> implements ISkuS ...@@ -71,7 +71,7 @@ public class SkuServiceImpl extends ServiceImpl<SkuMapper, Sku> implements ISkuS
private ChainUtil chainUtil; private ChainUtil chainUtil;
@Override @Override
public void add(List<GoodsSkuDTO> kDTOs, String goodsId, String goodsName, String merchantId, String addr, Integer commodityPass, String thumb, Integer pDTOType, Integer salesType, BigDecimal blindBoxPrice) { public void add(List<GoodsSkuDTO> kDTOs, String goodsId, String goodsName, String merchantId, String addr, Integer commodityPass, String thumb, Integer pDTOType, Integer salesType, BigDecimal blindBoxPrice, BigDecimal price) {
List<Sku> skus = new ArrayList<>(); List<Sku> skus = new ArrayList<>();
int total = kDTOs.size(); int total = kDTOs.size();
int subCount = 0; int subCount = 0;
...@@ -86,9 +86,12 @@ public class SkuServiceImpl extends ServiceImpl<SkuMapper, Sku> implements ISkuS ...@@ -86,9 +86,12 @@ public class SkuServiceImpl extends ServiceImpl<SkuMapper, Sku> implements ISkuS
} }
if (salesType.equals(SalesTypeEnum.ORDINARY.getType())) { if (salesType.equals(SalesTypeEnum.ORDINARY.getType())) {
sku.setCirculation(kDTO.getStock()); sku.setCirculation(kDTO.getStock());
sku.setOriginalPrice(price);
sku.setPrice(price);
} }
if (salesType.equals(SalesTypeEnum.BLIND_BOX.getType())) { if (salesType.equals(SalesTypeEnum.BLIND_BOX.getType())) {
sku.setOriginalPrice(blindBoxPrice); sku.setOriginalPrice(blindBoxPrice);
sku.setPrice(blindBoxPrice);
} }
sku.setSkuId(skuId); sku.setSkuId(skuId);
sku.setGoodsId(goodsId); sku.setGoodsId(goodsId);
......
...@@ -126,7 +126,7 @@ public class SpuServiceImpl extends ServiceImpl<SpuMapper, Spu> implements ISpuS ...@@ -126,7 +126,7 @@ public class SpuServiceImpl extends ServiceImpl<SpuMapper, Spu> implements ISpuS
categorySpuService.add(ids, goodsId, merchantId); categorySpuService.add(ids, goodsId, merchantId);
//商品规格入库 //商品规格入库
skuService.add(pDTO.getSkuList(), goodsId, pDTO.getName(), merchantId, addr, pDTO.getCommodityPass(), pDTO.getThumb(), pDTOType, pDTO.getSalesType(),pDTO.getBlindBoxPrice()); skuService.add(pDTO.getSkuList(), goodsId, pDTO.getName(), merchantId, addr, pDTO.getCommodityPass(), pDTO.getThumb(), pDTOType, pDTO.getSalesType(), pDTO.getBlindBoxPrice(), pDTO.getNftdto().getPrice());
//初始化商品信息 //初始化商品信息
spu = beanMapper.map(pDTO, Spu.class); spu = beanMapper.map(pDTO, Spu.class);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment