Commit de2c130a authored by wulixian's avatar wulixian

Merge branch 'test' into 'master'

商品价格同步到规格表 See merge request !17
parents 9b1fd7e4 6fba3e2f
......@@ -28,7 +28,7 @@ public interface ISkuService extends IService<Sku> {
* @param merchantId 商户id
* @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
private ChainUtil chainUtil;
@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<>();
int total = kDTOs.size();
int subCount = 0;
......@@ -86,9 +86,12 @@ public class SkuServiceImpl extends ServiceImpl<SkuMapper, Sku> implements ISkuS
}
if (salesType.equals(SalesTypeEnum.ORDINARY.getType())) {
sku.setCirculation(kDTO.getStock());
sku.setOriginalPrice(price);
sku.setPrice(price);
}
if (salesType.equals(SalesTypeEnum.BLIND_BOX.getType())) {
sku.setOriginalPrice(blindBoxPrice);
sku.setPrice(blindBoxPrice);
}
sku.setSkuId(skuId);
sku.setGoodsId(goodsId);
......
......@@ -126,7 +126,7 @@ public class SpuServiceImpl extends ServiceImpl<SpuMapper, Spu> implements ISpuS
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);
......
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