Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
J
jfjxhly
Project
Project
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
Graph
比较
统计图
议题
0
议题
0
列表
看板
标记
Milestones
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
注册表
注册表
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
svn
jfjxhly
Commits
96663c41
提交
96663c41
authored
2月 20, 2021
作者:
renjianyu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
--no commit message
上级
2bdff811
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
27 行增加
和
8 行删除
+27
-8
ArticleLibrarySerivceImpl.java
.../bg/service/articlelibrary/ArticleLibrarySerivceImpl.java
+24
-7
SaveUpdateArticleLibraryForm.java
.../form/bg/articlelibrary/SaveUpdateArticleLibraryForm.java
+3
-1
没有找到文件。
app/resource/src/main/java/com/zrqx/resource/bg/service/articlelibrary/ArticleLibrarySerivceImpl.java
浏览文件 @
96663c41
...
...
@@ -18,8 +18,10 @@ import com.zrqx.core.enums.resource.LibraryStatusEnum;
import
com.zrqx.core.enums.resource.PriceOptionEnum
;
import
com.zrqx.core.mapper.BaseMapper
;
import
com.zrqx.core.service.BaseServiceImpl
;
import
com.zrqx.core.util.datatype.ArrayUtils
;
import
com.zrqx.core.util.page.PageInfo
;
import
com.zrqx.core.util.page.PageParam
;
import
com.zrqx.resource.bg.mapper.RelationAuthorMapper
;
import
com.zrqx.resource.bg.mapper.ResourceRelationMapper
;
import
com.zrqx.resource.bg.mapper.articlelibrary.ArticleLibraryDiyTypeMapper
;
import
com.zrqx.resource.bg.mapper.articlelibrary.ArticleLibraryLabelContentDiyTypeMapper
;
...
...
@@ -38,6 +40,7 @@ import com.zrqx.resource.commons.model.articlelibrary.ArticleLibraryDiyType;
import
com.zrqx.resource.commons.model.articlelibrary.ArticleLibraryLabelContentDiyType
;
import
com.zrqx.resource.commons.model.membercollection.MemberCollection
;
import
com.zrqx.resource.commons.model.record.Record
;
import
com.zrqx.resource.commons.model.resourcerelation.RelationAuthor
;
import
com.zrqx.resource.commons.model.resourcerelation.ResourceRelation
;
import
com.zrqx.resource.commons.model.shoppingcart.ShoppingCart
;
import
com.zrqx.resource.commons.vo.bg.articlelibrary.ArticleLibraryListVO
;
...
...
@@ -72,6 +75,8 @@ public class ArticleLibrarySerivceImpl extends BaseServiceImpl<ArticleLibrary,St
private
ArticleResourceMapper
articleResourceMapper
;
@Autowired
private
ResourceRelationMapper
resourceRelationMapper
;
@Autowired
private
RelationAuthorMapper
bookAuthorMapper
;
@Override
public
BaseMapper
<
ArticleLibrary
>
getMapper
()
{
return
mapper
;
...
...
@@ -82,13 +87,13 @@ public class ArticleLibrarySerivceImpl extends BaseServiceImpl<ArticleLibrary,St
if
(
StringUtils
.
isNotBlank
(
form
.
getId
())){
entity
=
mapper
.
selectByPrimaryKey
(
form
.
getId
());
}
if
(
StringUtils
.
isNotBlank
(
form
.
getAuthorNameAndId
())){
String
[]
authorNameAndId
=
form
.
getAuthorNameAndId
().
split
(
","
);
form
.
setAuthor
(
authorNameAndId
[
0
]);
if
(
authorNameAndId
.
length
>
1
){
form
.
setAuthorId
(
authorNameAndId
[
1
]);
}
}
//
if(StringUtils.isNotBlank(form.getAuthorNameAndId())){
//
String[] authorNameAndId = form.getAuthorNameAndId().split(",");
//
form.setAuthor(authorNameAndId[0]);
//
if(authorNameAndId.length > 1){
//
form.setAuthorId(authorNameAndId[1]);
//
}
//
}
BeanUtils
.
copyProperties
(
form
,
entity
);
if
(
PriceOptionEnum
.
STATUS_0
.
getCode
()
==
form
.
getPriceOption
()){
entity
.
setRealPrice
(
new
BigDecimal
(
0
));
...
...
@@ -120,6 +125,10 @@ public class ArticleLibrarySerivceImpl extends BaseServiceImpl<ArticleLibrary,St
ArticleLibraryLabelContentDiyType
alcdy
=
new
ArticleLibraryLabelContentDiyType
();
alcdy
.
setAlId
(
entity
.
getId
());
alcdMapper
.
delete
(
alcdy
);
// 删除作者关联表
RelationAuthor
ba
=
new
RelationAuthor
();
ba
.
setResourceId
(
entity
.
getId
());
bookAuthorMapper
.
delete
(
ba
);
}
//添加当前对象与自定义分类的关系
if
(
form
.
getDiyTypeCode
()
!=
null
&&
form
.
getDiyTypeCode
().
size
()
>
0
)
{
...
...
@@ -143,6 +152,14 @@ public class ArticleLibrarySerivceImpl extends BaseServiceImpl<ArticleLibrary,St
alcdMapper
.
insertList
(
aldcdList
);
}
}
// 添加作者关系
if
(
ArrayUtils
.
isNotEmpty
(
form
.
getAuthorList
()))
{
List
<
RelationAuthor
>
baList
=
form
.
getAuthorList
().
stream
().
filter
(
a
->
StringUtils
.
isNotBlank
(
a
.
getAuthor
())).
collect
(
Collectors
.
toList
());
for
(
RelationAuthor
li
:
baList
)
{
li
.
setResourceId
(
entity
.
getId
());
}
bookAuthorMapper
.
insertList
(
baList
);
}
return
true
;
}
@Override
...
...
app/resource/src/main/java/com/zrqx/resource/commons/form/bg/articlelibrary/SaveUpdateArticleLibraryForm.java
浏览文件 @
96663c41
...
...
@@ -4,6 +4,7 @@ import java.math.BigDecimal;
import
java.util.List
;
import
com.zrqx.resource.commons.model.articlelibrary.ArticleLibraryLabelContentDiyType
;
import
com.zrqx.resource.commons.model.resourcerelation.RelationAuthor
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
...
...
@@ -51,7 +52,8 @@ public class SaveUpdateArticleLibraryForm {
private
Integer
priceOption
;
@ApiModelProperty
(
"pdf名称"
)
private
String
pdfName
;
@ApiModelProperty
(
value
=
"作者集合"
)
private
List
<
RelationAuthor
>
authorList
;
@ApiModelProperty
(
value
=
"作者名称和id(用,隔开)"
)
private
String
authorNameAndId
;
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论