提交 293a883f authored 作者: liupengfei's avatar liupengfei

--no commit message

上级 748d2c04
......@@ -78,9 +78,11 @@ public class ArticleLibrarySerivceImpl extends BaseServiceImpl<ArticleLibrary,St
ArticleLibraryDiyType diyType = new ArticleLibraryDiyType();
diyType.setArticleId(entity.getId());
diyTypeMapper.delete(diyType);
//删除相关资源
if(StringUtils.isNotBlank(form.getObjectId())) {
ResourceRelation resourceRelation = new ResourceRelation();
resourceRelation.setObjectId(form.getObjectId());
resourceRelation.setResourceId(entity.getId());
resourceRelationMapper.delete(resourceRelation);
}
}
......
......@@ -74,16 +74,6 @@ public class VideoLibrarySerivceImpl extends BaseServiceImpl<VideoLibrary,String
entity.setClickNum(50);
entity.setSalesNum(0);
mapper.insert(entity);
if(StringUtils.isNotBlank(form.getObjectId())) {
ResourceRelation resourceRelation = new ResourceRelation();
resourceRelation.setCreateTime(new Date());
resourceRelation.setObjectId(form.getObjectId());
resourceRelation.setResourceId(entity.getId());
resourceRelation.setResourceType(ResourceTypeEnum.VIDEO_LIBRARY.getCode());
resourceRelation.setIsTop(form.getIsTop());
resourceRelation.setSort(form.getSort());
resourceRelationMapper.insert(resourceRelation);
}
}else{
//修改
entity.setUpdateTime(new Date());
......@@ -97,6 +87,24 @@ public class VideoLibrarySerivceImpl extends BaseServiceImpl<VideoLibrary,String
VideoLibraryDiyType old = new VideoLibraryDiyType();
old.setVlId(entity.getId());
vdrMapper.delete(old);
//删除相关资源
if(StringUtils.isNotBlank(form.getObjectId())) {
ResourceRelation resourceRelation = new ResourceRelation();
resourceRelation.setObjectId(form.getObjectId());
resourceRelation.setResourceId(entity.getId());
resourceRelationMapper.delete(resourceRelation);
}
}
//添加相关资源
if(StringUtils.isNotBlank(form.getObjectId())) {
ResourceRelation resourceRelation = new ResourceRelation();
resourceRelation.setCreateTime(new Date());
resourceRelation.setObjectId(form.getObjectId());
resourceRelation.setResourceId(entity.getId());
resourceRelation.setResourceType(ResourceTypeEnum.VIDEO_LIBRARY.getCode());
resourceRelation.setIsTop(form.getIsTop());
resourceRelation.setSort(form.getSort());
resourceRelationMapper.insert(resourceRelation);
}
//添加当前对象与自定义分类的关系
if(form.getDiyType() != null && form.getDiyType().size() > 0){
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论