|
|
@@ -2465,11 +2465,18 @@ public class ProductServiceImpl implements ProductService {
|
|
|
// 设置库存信息
|
|
|
assignmentGoods(goods, productInfo);
|
|
|
// 保存到商城私有库
|
|
|
- Integer count = productPrivateDao.countByPrId(productInfo.getId());
|
|
|
- if (count == 0) {
|
|
|
+ List<ProductPrivate> productPrivates = productPrivateDao.findByPrId(productInfo.getId());
|
|
|
+ if (CollectionUtils.isEmpty(productPrivates)) {
|
|
|
ProductPrivate productPrivate = new ProductPrivate(productInfo.getId());
|
|
|
productPrivate.setAttach(product.getAttachment());
|
|
|
+ productPrivate.setB2cEnabled(IntegerConstant.YES_SHORT);
|
|
|
productPrivateDao.save(productPrivate);
|
|
|
+ } else {
|
|
|
+ ProductPrivate productPrivate = productPrivates.get(0);
|
|
|
+ if (null == productPrivate.getB2cEnabled() || Objects.equals(IntegerConstant.NO_SHORT, productPrivate.getB2cEnabled())) {
|
|
|
+ productPrivate.setB2cEnabled(IntegerConstant.YES_SHORT);
|
|
|
+ productPrivateDao.save(productPrivate);
|
|
|
+ }
|
|
|
}
|
|
|
// 保存出入库信息
|
|
|
if (null != inOutbound) {
|