|
|
@@ -2481,7 +2481,7 @@ public class ProductServiceImpl implements ProductService {
|
|
|
// 保存到商城私有库
|
|
|
addToPrivate(productInfo, product);
|
|
|
if (needAddInventory) {
|
|
|
- inOutbound = initCommodityInOut(productInfo);
|
|
|
+ inOutbound = initCommodityInOut(productInfo, goods);
|
|
|
}
|
|
|
// 保存出入库信息
|
|
|
if (null != inOutbound) {
|
|
|
@@ -2502,13 +2502,14 @@ public class ProductServiceImpl implements ProductService {
|
|
|
* @param productInfo 物料信息
|
|
|
* @return CommodityInOutbound
|
|
|
*/
|
|
|
- private CommodityInOutbound initCommodityInOut(Product productInfo) {
|
|
|
+ private CommodityInOutbound initCommodityInOut(Product productInfo, Goods goods) {
|
|
|
CommodityInOutbound inOutbound = new CommodityInOutbound(InOutBoundType.OTHER_INBOUND);
|
|
|
- Goods goods = new Goods();
|
|
|
- goods = Goods.productConvertGoods(goods, productInfo);
|
|
|
- goods.setReserve(productInfo.getErpReserve());
|
|
|
- goods = goodsDao.save(goods);
|
|
|
- logger.info("上架商品库存操作", "卖家中心单个物料上传进行入库操作", "增加库存: " + productInfo.getErpReserve(), goods.getCode(), goods.getId());
|
|
|
+ if (!StringUtils.isEmpty(goods.getQtyPrice())) {
|
|
|
+ goods = Goods.productConvertGoods(goods, productInfo);
|
|
|
+ goods.setReserve(productInfo.getErpReserve());
|
|
|
+ goods = goodsDao.save(goods);
|
|
|
+ logger.info("上架商品库存操作", "卖家中心单个物料上传进行入库操作", "增加库存: " + productInfo.getErpReserve(), goods.getCode(), goods.getId());
|
|
|
+ }
|
|
|
InOutboundDetail inOutboundDetail = new InOutboundDetail(productInfo);
|
|
|
Set<InOutboundDetail> detailSet = new HashSet<>();
|
|
|
detailSet.add(inOutboundDetail);
|
|
|
@@ -2776,16 +2777,11 @@ public class ProductServiceImpl implements ProductService {
|
|
|
qtyPrices.get(0).setStart(startQty);
|
|
|
}
|
|
|
goods.setQtyPrice(JSON.toJSONString(qtyPrices));
|
|
|
+ goodsService.setGoodsDefault(goods);
|
|
|
+ boolean autoPublish = goods.getAutoPublish() == null ? true : goods.getAutoPublish();
|
|
|
+ goods.setAutoPublish(autoPublish);
|
|
|
+ goods = goodsDao.save(goods);
|
|
|
+ logger.info("上架商品", "新增上架商品", "通过卖家中心单个物料上传新增上架商品", goods.getCode(), goods.getId());
|
|
|
}
|
|
|
- goodsService.setGoodsDefault(goods);
|
|
|
- boolean autoPublish = goods.getAutoPublish() == null ? true : goods.getAutoPublish();
|
|
|
- goods.setAutoPublish(autoPublish);
|
|
|
- StoreIn storeIn = storeInService.findByEnUU(SystemSession.getUser().getEnterprise().getUu());
|
|
|
- if (storeIn != null && storeIn.getStatus() == StoreStatus.OPENED) {
|
|
|
- goods.setStoreid(storeIn.getUuid());
|
|
|
- goods.setStoreName(storeIn.getStoreName());
|
|
|
- }
|
|
|
- goods = goodsDao.save(goods);
|
|
|
- logger.info("上架商品", "新增上架商品", "通过卖家中心单个物料上传新增上架商品", goods.getCode(), goods.getId());
|
|
|
}
|
|
|
}
|