Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Z
zgzx
Project
Project
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
Graph
比较
统计图
议题
0
议题
0
列表
看板
标记
Milestones
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
注册表
注册表
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
svn
zgzx
Commits
f577cc38
提交
f577cc38
authored
12月 04, 2020
作者:
renjiancai
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
--no commit message
上级
96befbe0
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
39 行增加
和
12 行删除
+39
-12
EbookController.java
...om/zrqx/resource/bg/controller/ebook/EbookController.java
+39
-12
没有找到文件。
com.zrqx.resource/src/main/java/com/zrqx/resource/bg/controller/ebook/EbookController.java
浏览文件 @
f577cc38
...
...
@@ -215,7 +215,7 @@ public class EbookController {
aldtservice
.
delete
(
articleDiyType
);
//删除推荐关联的文章
ResourceRelation
relation
=
new
ResourceRelation
();
relation
.
set
Object
Id
(
articleLibrary
.
getId
());
relation
.
set
Resource
Id
(
articleLibrary
.
getId
());
resourceRelationService
.
delete
(
relation
);
}
//删除关联文章
...
...
@@ -549,7 +549,7 @@ public class EbookController {
article
.
setSalesNum
(
0
);
try
{
alservice
.
insert
(
article
);
//关联关系建立
/
*/
/关联关系建立
ResourceRelation relation =new ResourceRelation();
relation.setObjectId(book.getId());
relation.setResourceId(article.getId());
...
...
@@ -557,7 +557,7 @@ public class EbookController {
relation.setSort(maxSort);
relation.setGoodsType(2);
relation.setUploadTime(new Date());
resourceRelationService
.
insert
(
relation
);
resourceRelationService.insert(relation);
*/
}
catch
(
Exception
e
)
{
throw
new
BaseException
(
ev
.
getBook
().
getIsbn
());
}
...
...
@@ -620,7 +620,20 @@ public class EbookController {
ev
.
getChapterSet
().
forEach
(
chapter
->
{
chapter
.
setBookid
(
book
.
getId
());
chapter
.
setBookName
(
book
.
getName
());
// clservice.insert(chapter);
//关联关系建立
Example
example1
=
alservice
.
createExample
();
example1
.
createCriteria
().
andEqualTo
(
"bookId"
,
book
.
getId
()).
andEqualTo
(
"markid"
,
chapter
.
getMarkid
());
List
<
ArticleLibrary
>
list
=
alservice
.
selectByExample
(
example1
);
if
(
list
.
size
()>
0
)
{
ResourceRelation
relation1
=
new
ResourceRelation
();
relation1
.
setObjectId
(
book
.
getId
());
relation1
.
setResourceId
(
list
.
get
(
0
).
getId
());
relation1
.
setSort
(
chapter
.
getOrderNum
());
relation1
.
setGoodsType
(
2
);
relation1
.
setUploadTime
(
new
Date
());
resourceRelationService
.
insert
(
relation1
);
}
});
clservice
.
insertList
(
new
ArrayList
(
ev
.
getChapterSet
()));
try
{
...
...
@@ -665,12 +678,7 @@ public class EbookController {
edt
.
setCode
(
ev
.
getCode
());
edt
.
setDiyTypeId
(
ev
.
getDtId
());
dtservice
.
insert
(
edt
);
ev
.
getChapterSet
().
forEach
(
chapter
->
{
chapter
.
setBookid
(
ev
.
getBook
().
getId
());
chapter
.
setBookName
(
ev
.
getBook
().
getName
());
// clservice.insert(chapter);
});
clservice
.
insertList
(
new
ArrayList
(
ev
.
getChapterSet
()));
// 文章分类关联表
ev
.
getArticleSet
().
forEach
(
article
->
{
article
.
setAuthor
(
ev
.
getBook
().
getAuthor
());
...
...
@@ -686,7 +694,7 @@ public class EbookController {
article
.
setSalesNum
(
0
);
try
{
alservice
.
insert
(
article
);
//关联关系建立
/
*/
/关联关系建立
ResourceRelation relation =new ResourceRelation();
relation.setObjectId(ev.getEbook().getId());
relation.setResourceId(article.getId());
...
...
@@ -694,7 +702,7 @@ public class EbookController {
relation.setSort(maxSort);
relation.setGoodsType(2);
relation.setUploadTime(new Date());
resourceRelationService
.
insert
(
relation
);
resourceRelationService.insert(relation);
*/
}
catch
(
Exception
e
)
{
throw
new
BaseException
(
ev
.
getBook
().
getIsbn
());
}
...
...
@@ -704,6 +712,25 @@ public class EbookController {
aldt
.
setDtId
(
ev
.
getDtId
());
aldtservice
.
insertSelective
(
aldt
);
});
ev
.
getChapterSet
().
forEach
(
chapter
->
{
chapter
.
setBookid
(
ev
.
getBook
().
getId
());
chapter
.
setBookName
(
ev
.
getBook
().
getName
());
// clservice.insert(chapter);
//关联关系建立
Example
example2
=
alservice
.
createExample
();
example2
.
createCriteria
().
andEqualTo
(
"bookId"
,
ev
.
getBook
().
getId
()).
andEqualTo
(
"markid"
,
chapter
.
getMarkid
());
List
<
ArticleLibrary
>
list
=
alservice
.
selectByExample
(
example2
);
if
(
list
.
size
()>
0
)
{
ResourceRelation
relation
=
new
ResourceRelation
();
relation
.
setObjectId
(
ev
.
getBook
().
getId
());
relation
.
setResourceId
(
list
.
get
(
0
).
getId
());
relation
.
setSort
(
chapter
.
getOrderNum
());
relation
.
setGoodsType
(
2
);
relation
.
setUploadTime
(
new
Date
());
resourceRelationService
.
insert
(
relation
);
}
});
clservice
.
insertList
(
new
ArrayList
(
ev
.
getChapterSet
()));
// 删除当前对象与年份的关系
EbookMainBodyRelation
relation
=
new
EbookMainBodyRelation
();
relation
.
setObjectId
(
ev
.
getEbook
().
getId
());
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论