Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
N
nrgl
Project
Project
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
Graph
比较
统计图
议题
0
议题
0
列表
看板
标记
Milestones
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
注册表
注册表
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
svn
nrgl
Commits
a5749124
提交
a5749124
authored
2月 26, 2019
作者:
renjiancai
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
--no commit message
上级
cf3a8725
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
12 行增加
和
14 行删除
+12
-14
EbookLibraryController.java
...ce/bg/controller/ebooklibrary/EbookLibraryController.java
+12
-14
没有找到文件。
com.zrqx.resource/src/main/java/com/zrqx/resource/bg/controller/ebooklibrary/EbookLibraryController.java
浏览文件 @
a5749124
...
...
@@ -64,6 +64,7 @@ import com.zrqx.core.util.excelutil.ExcelUtil;
import
com.zrqx.core.validate.SaveGroup
;
import
com.zrqx.core.vo.book.EpubVo
;
import
com.zrqx.core.vo.excel.ExcelBookVO
;
import
com.zrqx.core.vo.excel.ImportExcelBookVO
;
import
com.zrqx.core.vo.resource.ResourceRelationListVo
;
import
com.zrqx.core.vo.resource.ResourceRelationVo
;
import
com.zrqx.core.vo.resource.ebook.EbookListVO
;
...
...
@@ -174,7 +175,7 @@ public class EbookLibraryController {
List
<
BookDiyType
>
dtList
=
bookTypeService
.
selectByCriteria
();
// 自定义标签
bookLableService
.
createCriteria
().
andEqualTo
(
"objectId"
,
oid
);
List
<
BookLabelDiyType
>
listLab
le
=
bookLableService
.
selectByCriteria
();
List
<
BookLabelDiyType
>
listLab
el
=
bookLableService
.
selectByCriteria
();
// 商品相册
bookAlbumService
.
createCriteria
().
andEqualTo
(
"bookId"
,
oid
);
List
<
BookGoodsAlbum
>
album
=
bookAlbumService
.
selectByCriteria
();
...
...
@@ -189,23 +190,23 @@ public class EbookLibraryController {
BeanUtils
.
copyProperties
(
issued
,
vo
);
}
// 自定义标签
if
(
listLab
le
!=
null
&&
listLable
.
size
()>
0
){
if
(
listLab
el
!=
null
&&
listLabel
.
size
()>
0
){
vo
.
setLabelId
(
new
ArrayList
<
String
>());
vo
.
setLabelContentId
(
new
ArrayList
<
String
>());
vo
.
setLabelContentCode
(
new
ArrayList
<
String
>());
listLab
le
.
forEach
(
obj
->
vo
.
getLabelId
().
add
(
obj
.
getLabelId
()));
listLab
le
.
forEach
(
obj
->
vo
.
getLabelContentId
().
add
(
obj
.
getLabelContentId
()));
listLab
le
.
forEach
(
obj
->
vo
.
getLabelContentCode
().
add
(
obj
.
getLabelContentCode
()));
listLab
el
.
forEach
(
obj
->
vo
.
getLabelId
().
add
(
obj
.
getLabelId
()));
listLab
el
.
forEach
(
obj
->
vo
.
getLabelContentId
().
add
(
obj
.
getLabelContentId
()));
listLab
el
.
forEach
(
obj
->
vo
.
getLabelContentCode
().
add
(
obj
.
getLabelContentCode
()));
}
// 自定义分类
vo
.
setDiyTypeId
(
new
ArrayList
<
String
>());
vo
.
setDiyTypeCode
(
new
ArrayList
<
String
>());
dtList
.
forEach
(
obj
->
vo
.
getDiyTypeId
().
add
(
obj
.
getDtId
()));
dtList
.
forEach
(
obj
->
vo
.
getDiyTypeCode
().
add
(
obj
.
getCode
()));
// 商品相册
vo
.
setGoodsCover
(
new
ArrayList
<
String
>());
album
.
forEach
(
obj
->
vo
.
getGoodsCover
().
add
(
obj
.
getGoodsCover
()));
//图书资源
BeanUtils
.
copyProperties
(
book
,
vo
);
return
CallBack
.
success
(
vo
);
}
...
...
@@ -382,8 +383,6 @@ public class EbookLibraryController {
return
CallBack
.
success
(
new
PageInfo
<
ResourceRelationVo
>(
resourceRelationService
.
queryRelationList
(
list
)));
}
@ApiOperation
(
value
=
"保存相关资源"
,
notes
=
"保存相关资源"
)
@PostMapping
(
value
=
ResourceRequestPath
.
RELATION_RESOURCE
+
ResourceRequestPath
.
SAVE
)
public
CallBack
<
Boolean
>
saveRelation
(
@RequestBody
SaveResourceRelationForm
entity
)
{
...
...
@@ -414,17 +413,16 @@ public class EbookLibraryController {
return
CallBack
.
success
(
resourceService
.
batchDeleteResource
(
ids
));
}
@ApiOperation
(
value
=
"导入图书Excel"
)
@PostMapping
(
value
=
SysUserRequestPath
.
IMPORT
,
produces
=
"
text/plain;
charset=UTF-8"
)
public
String
importCard
(
@RequestParam
(
"file"
)
MultipartFile
file
)
throws
Exception
{
@PostMapping
(
value
=
SysUserRequestPath
.
IMPORT
,
produces
=
"
application/json;
charset=UTF-8"
)
public
CallBack
<
String
>
importBook
(
@RequestParam
(
"file"
)
MultipartFile
file
)
throws
Exception
{
Book
book
=
new
Book
();
Ebook
ebook
=
new
Ebook
();
BookIssued
issued
=
new
BookIssued
();
List
<
ExcelBookVO
>
list
=
ExcelUtil
.
importExcel
(
file
.
getInputStream
(),
ExcelBookVO
.
class
,
file
.
getOriginalFilename
());
List
<
ImportExcelBookVO
>
list
=
ExcelUtil
.
importExcel
(
file
.
getInputStream
(),
Import
ExcelBookVO
.
class
,
file
.
getOriginalFilename
());
list
.
forEach
(
ec
->{
System
.
out
.
println
(
ec
.
toString
());
BeanUtils
.
copyProperties
(
ec
,
book
);
BeanUtils
.
copyProperties
(
ec
,
ebook
);
BeanUtils
.
copyProperties
(
ec
,
issued
);
BeanUtils
.
copyProperties
(
ec
,
book
);
book
.
setUploadTime
(
new
Date
());
bookservice
.
insert
(
book
);
// 图书信息
ebook
.
setBookId
(
book
.
getId
());
...
...
@@ -434,7 +432,7 @@ public class EbookLibraryController {
issued
.
setObjectId
(
book
.
getId
());
bookIssuedService
.
insert
(
issued
);
// 图书行业信息
});
return
null
;
return
CallBack
.
success
()
;
}
@ApiOperation
(
value
=
"添加附件"
,
notes
=
"添加附件"
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论