提交 748d2c04 authored 作者: liupengfei's avatar liupengfei

--no commit message

上级 d554fb6a
......@@ -69,16 +69,6 @@ public class ArticleLibrarySerivceImpl extends BaseServiceImpl<ArticleLibrary,St
entity.setUploadTime(new Date());
entity.setResourceType(ResourceTypeEnum.ARTICLE_LIBRARY.getCode());
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.ARTICLE_LIBRARY.getCode());
resourceRelation.setIsTop(form.getIsTop());
resourceRelation.setSort(form.getSort());
resourceRelationMapper.insert(resourceRelation);
}
}else {
//修改
entity.setEditor(redis.getUser().getUserName());
......@@ -88,6 +78,22 @@ 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());
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.ARTICLE_LIBRARY.getCode());
resourceRelation.setIsTop(form.getIsTop());
resourceRelation.setSort(form.getSort());
resourceRelationMapper.insert(resourceRelation);
}
//添加当前对象与自定义关系
if(form.getDiyType() != null && form.getDiyType().size() > 0){
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论