|
|
@@ -93,10 +93,6 @@ public class CmsGoodsDonController {
|
|
|
if (CollUtil.isEmpty(spu.getRecommendGoodsList())) {
|
|
|
throw BusinessRuntimeException.getInstance("请选择推荐的对应平台");
|
|
|
}
|
|
|
- Set<Long> re_goodsIds = new HashSet<>(spu.getRecommendGoodsList());
|
|
|
- //去除自己
|
|
|
- re_goodsIds.remove(spu.getId());
|
|
|
- goods.setRecommendGoods(Jsons.toJson(re_goodsIds));
|
|
|
}
|
|
|
goodsDonService.save(goods);
|
|
|
Set<String> keys = redisService.keys(RedisService.key.YH_HOME_PAGHE_CACHE.getName() + "*");
|
|
|
@@ -120,6 +116,8 @@ public class CmsGoodsDonController {
|
|
|
if (CollUtil.isEmpty(spu.getRecommendGoodsList())) {
|
|
|
throw BusinessRuntimeException.getInstance("请选择推荐的对应平台");
|
|
|
}
|
|
|
+ }
|
|
|
+ if (CollUtil.isNotEmpty(spu.getRecommendGoodsList())) {
|
|
|
Set<Long> re_goodsIds = new HashSet<>(spu.getRecommendGoodsList());
|
|
|
//去除自己
|
|
|
re_goodsIds.remove(spu.getId());
|
|
|
@@ -127,11 +125,16 @@ public class CmsGoodsDonController {
|
|
|
}
|
|
|
if (StrUtil.isEmpty(goods.getRecommendTitle())) {
|
|
|
goods.setRecommendTitle(null);
|
|
|
- goods.setRecommendGoods(null);
|
|
|
}
|
|
|
if (StrUtil.isEmpty(goods.getVideo())) {
|
|
|
goods.setVideo(null);
|
|
|
}
|
|
|
+ if (CollUtil.isNotEmpty(spu.getRecommendGoodsList())) {
|
|
|
+ Set<Long> re_goodsIds = new HashSet<>(spu.getRecommendGoodsList());
|
|
|
+ //去除自己
|
|
|
+ re_goodsIds.remove(spu.getId());
|
|
|
+ goods.setRecommendGoods(Jsons.toJson(re_goodsIds));
|
|
|
+ }
|
|
|
goodsDonService.updateById(goods);
|
|
|
Set<String> keys = redisService.keys(RedisService.key.YH_HOME_PAGHE_CACHE.getName() + "*");
|
|
|
redisService.del(keys.toArray(String[]::new));
|