|
|
@@ -130,6 +130,15 @@ public class CmsGoodsDonController {
|
|
|
throw BusinessRuntimeException.getInstance("请选择推荐的对应平台");
|
|
|
}
|
|
|
}
|
|
|
+ String detailRoute = spu.getDetailRoute();
|
|
|
+ if (StrUtil.isNotEmpty(detailRoute)) {
|
|
|
+ detailRoute = detailRoute.trim();
|
|
|
+ goods.setDetailRoute(detailRoute);
|
|
|
+ int count = goodsDonService.count(Wrappers.lambdaQuery(GoodsDon.class).eq(GoodsDon::getDetailRoute, detailRoute));
|
|
|
+ if (count > 0) {
|
|
|
+ throw BusinessRuntimeException.getInstance("重复商品路径:{}", detailRoute);
|
|
|
+ }
|
|
|
+ }
|
|
|
goodsDonService.save(goods);
|
|
|
//保存平台 分类的 关联
|
|
|
List<Long> categoryList = spu.getCategoryList();
|
|
|
@@ -160,6 +169,15 @@ public class CmsGoodsDonController {
|
|
|
throw BusinessRuntimeException.getInstance("请选择推荐的对应平台");
|
|
|
}
|
|
|
}
|
|
|
+ String detailRoute = goods.getDetailRoute();
|
|
|
+ if (StrUtil.isNotEmpty(detailRoute)) {
|
|
|
+ detailRoute = detailRoute.trim();
|
|
|
+ goods.setDetailRoute(detailRoute);
|
|
|
+ int count = goodsDonService.count(Wrappers.lambdaQuery(GoodsDon.class).eq(GoodsDon::getDetailRoute, detailRoute).ne(GoodsDon::getId, goods.getId()));
|
|
|
+ if (count > 0) {
|
|
|
+ throw BusinessRuntimeException.getInstance("重复商品路径:{}", detailRoute);
|
|
|
+ }
|
|
|
+ }
|
|
|
if (CollUtil.isNotEmpty(spu.getRecommendGoodsList())) {
|
|
|
Set<Long> re_goodsIds = new HashSet<>(spu.getRecommendGoodsList());
|
|
|
//去除自己
|