|
|
@@ -72,18 +72,26 @@ public class GoodsService {
|
|
|
goods.setStatus(ApplyStatus.PENDING);
|
|
|
}
|
|
|
|
|
|
+ MerchantClassification classification = merchantClassificationRepo.findByMerchantIdAndName(goods.getMerchantId(), Constants.CLASSIFICATION_NAME2);
|
|
|
+
|
|
|
//折扣价不参与满减
|
|
|
if (i == 0) {
|
|
|
goods.setIsFullReduction(true);
|
|
|
+
|
|
|
+ //移除折扣商品
|
|
|
+ if (goods.getId() != null)
|
|
|
+ classification.getGoodsIds().remove(goods.getId());
|
|
|
+
|
|
|
} else {
|
|
|
goods.setIsFullReduction(false);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
goods = goodsRepo.save(goods);
|
|
|
|
|
|
if (i > 0) {
|
|
|
//如果有折扣价,自动加入折扣分类
|
|
|
- MerchantClassification classification = merchantClassificationRepo.findByMerchantIdAndName(goods.getMerchantId(), Constants.CLASSIFICATION_NAME2);
|
|
|
+ //MerchantClassification classification = merchantClassificationRepo.findByMerchantIdAndName(goods.getMerchantId(), Constants.CLASSIFICATION_NAME2);
|
|
|
if (!classification.getIsShow() || ObjectUtil.isNull(classification.getIsShow())) {
|
|
|
classification.setIsShow(true);
|
|
|
merchantClassificationRepo.save(classification);
|
|
|
@@ -135,8 +143,9 @@ public class GoodsService {
|
|
|
|
|
|
/**
|
|
|
* 审核
|
|
|
+ *
|
|
|
* @param goodsId 商品ID
|
|
|
- * @param pass 是否通过
|
|
|
+ * @param pass 是否通过
|
|
|
*/
|
|
|
public void audit(Long goodsId, Boolean pass) {
|
|
|
Goods goods = goodsRepo.findById(goodsId).orElseThrow(new BusinessException("无商品"));
|