编辑商品导致库存为0的bug
This commit is contained in:
@@ -237,6 +237,7 @@ public class TbProductServiceImpl implements TbProductService {
|
|||||||
Threads.call(tbProductSkus, tbProductSpec);
|
Threads.call(tbProductSkus, tbProductSpec);
|
||||||
//组装
|
//组装
|
||||||
TbProductVo tbProductVo = new TbProductVo();
|
TbProductVo tbProductVo = new TbProductVo();
|
||||||
|
tbProductVo.setStockNumber(tbProduct.getStockNumber() == null ? 0.00 : tbProduct.getStockNumber());
|
||||||
tbProductVo.setCategoryId(StringUtils.isNotBlank(tbProduct.getCategoryId())?Integer.valueOf(tbProduct.getCategoryId()):null);
|
tbProductVo.setCategoryId(StringUtils.isNotBlank(tbProduct.getCategoryId())?Integer.valueOf(tbProduct.getCategoryId()):null);
|
||||||
//单位
|
//单位
|
||||||
// if (tbProduct.getUnitId() == null) {
|
// if (tbProduct.getUnitId() == null) {
|
||||||
@@ -426,6 +427,7 @@ public class TbProductServiceImpl implements TbProductService {
|
|||||||
product.setStatus(1);
|
product.setStatus(1);
|
||||||
product.setUpdatedAt(Instant.now().toEpochMilli());
|
product.setUpdatedAt(Instant.now().toEpochMilli());
|
||||||
product.setImages(resources.getImages().toString());
|
product.setImages(resources.getImages().toString());
|
||||||
|
product.setStockNumber(resources.getStockNumber().intValue());
|
||||||
if ("sku".equals(resources.getTypeEnum())) {
|
if ("sku".equals(resources.getTypeEnum())) {
|
||||||
List<BigDecimal> collect = resources.getSkuList().stream().map(TbProductSku::getSalePrice).sorted().collect(Collectors.toList());
|
List<BigDecimal> collect = resources.getSkuList().stream().map(TbProductSku::getSalePrice).sorted().collect(Collectors.toList());
|
||||||
product.setLowPrice(collect.get(0));
|
product.setLowPrice(collect.get(0));
|
||||||
|
|||||||
Reference in New Issue
Block a user