Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
S
scsm
Project
Project
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
Graph
比较
统计图
议题
0
议题
0
列表
看板
标记
Milestones
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
注册表
注册表
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
svn
scsm
Commits
6b32107d
提交
6b32107d
authored
6月 28, 2020
作者:
renjiancai
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
--no commit message
上级
9cd162ec
显示空白字符变更
内嵌
并排
正在显示
12 个修改的文件
包含
539 行增加
和
4 行删除
+539
-4
AuthorLibraryController.java
.../bg/controller/authorLibrary/AuthorLibraryController.java
+231
-0
EbookController.java
...om/zrqx/resource/bg/controller/ebook/EbookController.java
+4
-0
AuthorLibraryMapper.java
...resource/bg/mapper/authorLibrary/AuthorLibraryMapper.java
+70
-0
AuthorResourceMapper.java
...esource/bg/mapper/authorLibrary/AuthorResourceMapper.java
+27
-0
ResourceRelationMapper.java
...ource/bg/mapper/authorLibrary/ResourceRelationMapper.java
+1
-1
ResourceRelationServiceImpl.java
...zrqx/resource/bg/service/ResourceRelationServiceImpl.java
+1
-1
AnnexLibrarySerivceImpl.java
...urce/bg/service/annexlibrary/AnnexLibrarySerivceImpl.java
+1
-1
AuthorLibraryService.java
...source/bg/service/authorLibrary/AuthorLibraryService.java
+41
-0
AuthorLibraryServiceImpl.java
...ce/bg/service/authorLibrary/AuthorLibraryServiceImpl.java
+82
-0
AuthorResourceService.java
...ource/bg/service/authorLibrary/AuthorResourceService.java
+27
-0
AuthorResourceServiceImpl.java
...e/bg/service/authorLibrary/AuthorResourceServiceImpl.java
+53
-0
ProjectLibrarySerivceImpl.java
.../bg/service/projectlibrary/ProjectLibrarySerivceImpl.java
+1
-1
没有找到文件。
com.zrqx.resource/src/main/java/com/zrqx/resource/bg/controller/authorLibrary/AuthorLibraryController.java
0 → 100644
浏览文件 @
6b32107d
package
com
.
zrqx
.
resource
.
bg
.
controller
.
authorLibrary
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Collections
;
import
java.util.Comparator
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map.Entry
;
import
java.util.stream.Collectors
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.github.pagehelper.PageHelper
;
import
com.zrqx.core.constant.resource.ResourceRequestPath
;
import
com.zrqx.core.enums.AllResourceTypeEnum
;
import
com.zrqx.core.enums.ResponseCodeEnum
;
import
com.zrqx.core.enums.resource.author.DepartmentTypeEnum
;
import
com.zrqx.core.enums.resource.author.EducationTypeEnum
;
import
com.zrqx.core.enums.resource.author.TitleTypeEnum
;
import
com.zrqx.core.exception.BusinessValidateException
;
import
com.zrqx.core.exception.ParameterValidateException
;
import
com.zrqx.core.form.resource.bg.QueryResourceForPoPForm
;
import
com.zrqx.core.form.resource.bg.authorLibrary.QueryAuthorLibraryForm
;
import
com.zrqx.core.form.resource.bg.authorLibrary.SaveUpdateAuthorForm
;
import
com.zrqx.core.form.resource.bg.recommend.UpdateRecommendResourceForm
;
import
com.zrqx.core.form.sysuser.bg.member.StatusForm
;
import
com.zrqx.core.model.resource.authorLibrary.AuthorLibrary
;
import
com.zrqx.core.model.resource.authorLibrary.AuthorLibraryDiytype
;
import
com.zrqx.core.util.page.PageInfo
;
import
com.zrqx.core.util.page.PageParam
;
import
com.zrqx.core.util.response.CallBack
;
import
com.zrqx.core.vo.member.bg.member.EMemberVO
;
import
com.zrqx.core.vo.resource.authorlibrary.AuthorLibraryListVO
;
import
com.zrqx.core.vo.resource.authorlibrary.AuthorLibraryOneVO
;
import
com.zrqx.resource.bg.client.emember.ExpertMemberClient
;
import
com.zrqx.resource.bg.service.ResourceRelationService
;
import
com.zrqx.resource.bg.service.authorLibrary.AuthorLibraryService
;
import
com.zrqx.resource.bg.service.recommend.RecommendResourceService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
import
tk.mybatis.mapper.entity.Example
;
import
tk.mybatis.mapper.entity.Example.Criteria
;
@RestController
@RequestMapping
(
ResourceRequestPath
.
BG
+
ResourceRequestPath
.
AUTHORLIBRARY
)
@Api
(
description
=
"资源管理-作者库"
)
public
class
AuthorLibraryController
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
AuthorLibraryController
.
class
);
@Autowired
private
AuthorLibraryService
authorLibraryService
;
@Autowired
private
ResourceRelationService
resourceRelationService
;
@Autowired
private
ExpertMemberClient
expertMemberClient
;
/** 推荐位内容*/
@Autowired
private
RecommendResourceService
recommendResourceService
;
@ApiOperation
(
value
=
"查询作者库"
,
notes
=
"按条件分页查询作者库"
)
@GetMapping
(
ResourceRequestPath
.
PAGE
)
public
CallBack
<
PageInfo
<
AuthorLibraryListVO
>>
getPageList
(
QueryAuthorLibraryForm
entity
,
PageParam
pageParam
)
{
return
CallBack
.
success
(
authorLibraryService
.
queryAuthorLibraryList
(
entity
,
pageParam
));
}
@ApiOperation
(
value
=
"按照作者名模糊查询"
,
notes
=
"1:作者不能为空"
)
@GetMapping
(
ResourceRequestPath
.
LIST_NAME
)
public
CallBack
<
List
<
AuthorLibrary
>>
getAllList
(
@ApiParam
(
value
=
"作者名"
,
required
=
true
)
@PathVariable
String
name
)
{
if
(
StringUtils
.
isBlank
(
name
)){
throw
new
ParameterValidateException
(
1
,
"作者不能为空"
);
}
Example
example
=
authorLibraryService
.
createExample
();
example
.
createCriteria
().
andLike
(
"name"
,
name
+
"%"
);
PageHelper
.
startPage
(
1
,
20
);
return
CallBack
.
success
(
authorLibraryService
.
selectByExample
(
example
));
}
@ApiOperation
(
value
=
"全部列表作者"
,
notes
=
"全部列表查询作者库"
)
@GetMapping
(
ResourceRequestPath
.
LIST
)
public
CallBack
<
List
<
AuthorLibrary
>>
getList
()
{
PageHelper
.
orderBy
(
"uploadTime desc, id desc"
);
return
CallBack
.
success
(
authorLibraryService
.
selectAll
());
}
@ApiOperation
(
value
=
"按照作者名模糊查询-会员添加"
,
notes
=
"1:作者不能为空"
)
@GetMapping
(
ResourceRequestPath
.
OTHER
+
ResourceRequestPath
.
NAME
)
public
CallBack
<
List
<
AuthorLibrary
>>
getList
(
@ApiParam
(
value
=
"作者名"
,
required
=
true
)
@PathVariable
String
name
)
{
if
(
StringUtils
.
isBlank
(
name
)){
throw
new
ParameterValidateException
(
1
,
"作者不能为空"
);
}
Example
example
=
authorLibraryService
.
createExample
();
Criteria
cr
=
example
.
createCriteria
();
cr
.
andLike
(
"name"
,
name
+
"%"
);
CallBack
<
List
<
EMemberVO
>>
result
=
expertMemberClient
.
queryAll
();
if
(
result
==
null
||
!
result
.
isStatus
()
||
result
.
getData
()
==
null
)
{
logger
.
info
(
"专家会员服务调用失败"
);
}
else
{
List
<
String
>
authorIds
=
result
.
getData
().
stream
().
map
(
li
->
{
return
li
.
getAuthorId
();
}).
collect
(
Collectors
.
toList
());
cr
.
andNotIn
(
"id"
,
authorIds
);
}
PageHelper
.
startPage
(
1
,
20
);
return
CallBack
.
success
(
authorLibraryService
.
selectByExample
(
example
));
}
@ApiOperation
(
value
=
"查询"
,
notes
=
"根据ID查询"
)
@GetMapping
(
value
=
ResourceRequestPath
.
OID
)
public
CallBack
<
AuthorLibraryOneVO
>
getById
(
@ApiParam
(
value
=
"会员ID"
,
required
=
true
)
@PathVariable
String
oid
)
{
AuthorLibrary
authorLibrary
=
authorLibraryService
.
selectByPrimaryKey
(
oid
);
AuthorLibraryOneVO
vo
=
new
AuthorLibraryOneVO
();
BeanUtils
.
copyProperties
(
authorLibrary
,
vo
);
AuthorLibraryDiytype
dt
=
new
AuthorLibraryDiytype
();
dt
.
setAuthorLibraryId
(
vo
.
getId
());
return
CallBack
.
success
(
vo
);
}
@ApiOperation
(
value
=
"新增作者"
,
notes
=
"新增一个作者"
)
@PostMapping
(
ResourceRequestPath
.
SAVE
)
public
CallBack
<
Boolean
>
save
(
@RequestBody
SaveUpdateAuthorForm
entity
)
{
if
(!
authorLibraryService
.
saveOrUpdate
(
entity
))
{
throw
new
BusinessValidateException
(
"操作失败"
);
}
return
CallBack
.
success
();
}
@ApiOperation
(
value
=
"更新作者"
,
notes
=
"根据ID更新一个作者,空值默认不更新"
)
@PostMapping
(
ResourceRequestPath
.
UPDATE
)
public
CallBack
<
Boolean
>
update
(
@RequestBody
SaveUpdateAuthorForm
entity
)
{
if
(
entity
.
getId
()
==
null
)
{
throw
new
ParameterValidateException
(
ResponseCodeEnum
.
MISS_EXCEPTION
.
getCode
(),
"状态参数不正确!"
);
}
if
(!
authorLibraryService
.
saveOrUpdate
(
entity
))
{
throw
new
BusinessValidateException
(
"操作失败"
);
}
//推荐位内容修改
UpdateRecommendResourceForm
res
=
new
UpdateRecommendResourceForm
();
res
.
setResId
(
entity
.
getId
());
res
.
setResType
(
AllResourceTypeEnum
.
AUTHOR
.
getCode
());
res
.
setResImg
(
entity
.
getFaceImg
());
res
.
setResName
(
entity
.
getName
());
recommendResourceService
.
updateResourceContent
(
res
);
return
CallBack
.
success
();
}
@ApiOperation
(
value
=
"批量设置作者状态"
,
notes
=
"批量设置作者状态"
)
@PostMapping
(
value
=
ResourceRequestPath
.
BATCH_UPDATE
+
ResourceRequestPath
.
STATUS
)
public
CallBack
<
Boolean
>
updateStatus
(
@RequestBody
StatusForm
entity
)
{
if
(
entity
.
getStatus
()
==
null
)
{
throw
new
ParameterValidateException
(
"状态参数不正确!"
);
}
Example
example
=
authorLibraryService
.
createExample
();
example
.
createCriteria
().
andIn
(
"id"
,
Arrays
.
asList
(
entity
.
getId
()));
AuthorLibrary
a
=
new
AuthorLibrary
();
a
.
setStatus
(
entity
.
getStatus
());
a
.
setUpdateTime
(
new
Date
());
return
CallBack
.
success
(
authorLibraryService
.
UpdateByExampleSelective
(
a
,
example
));
}
@ApiOperation
(
value
=
"删除作者"
,
notes
=
"批量删除作者"
)
@PostMapping
(
ResourceRequestPath
.
BATCH_DELETE
)
public
CallBack
<
Boolean
>
deletes
(
@RequestBody
String
[]
id
)
{
Example
example
=
authorLibraryService
.
createExample
();
example
=
authorLibraryService
.
createExample
();
example
.
createCriteria
().
andIn
(
"id"
,
Arrays
.
asList
(
id
));
authorLibraryService
.
deleteByExample
(
example
);
//这里需要级联删除其他接口关联资源
//----推荐位内容
recommendResourceService
.
delectByResourceIds
(
Arrays
.
asList
(
id
),
AllResourceTypeEnum
.
AUTHOR
.
getCode
());
//----关联资源
example
=
resourceRelationService
.
createExample
();
example
.
createCriteria
().
andIn
(
"objectId"
,
Arrays
.
asList
(
id
)).
orIn
(
"resourceId"
,
Arrays
.
asList
(
id
));
resourceRelationService
.
deleteByExample
(
example
);
return
CallBack
.
success
();
}
public
CallBack
<
PageInfo
<
AuthorLibraryListVO
>>
page
(
QueryResourceForPoPForm
form
,
PageParam
pageParam
)
{
return
CallBack
.
success
(
authorLibraryService
.
pageByTitleAndDiyType
(
form
,
pageParam
));
}
@ApiOperation
(
value
=
"学历列表"
,
notes
=
"学历列表"
)
@GetMapping
(
value
=
ResourceRequestPath
.
EDUCATION
+
ResourceRequestPath
.
LIST
)
public
CallBack
<
Map
<
String
,
String
>>
getEducationList
()
{
Map
<
String
,
String
>
map
=
EducationTypeEnum
.
getAllEnumMap
();
sortList
(
map
);
return
CallBack
.
success
(
map
);
}
@ApiOperation
(
value
=
"科室列表"
,
notes
=
"科室列表"
)
@GetMapping
(
value
=
ResourceRequestPath
.
DEPARTMENT
+
ResourceRequestPath
.
LIST
)
public
CallBack
<
Map
<
String
,
String
>>
getDepartmentList
()
{
Map
<
String
,
String
>
map
=
DepartmentTypeEnum
.
getAllEnumMap
();
sortList
(
map
);
return
CallBack
.
success
(
map
);
}
@ApiOperation
(
value
=
"职称列表"
,
notes
=
"职称列表"
)
@GetMapping
(
value
=
ResourceRequestPath
.
TITLE
+
ResourceRequestPath
.
LIST
)
public
CallBack
<
Map
<
String
,
String
>>
getTitleList
()
{
Map
<
String
,
String
>
map
=
TitleTypeEnum
.
getAllEnumMap
();
sortList
(
map
);
return
CallBack
.
success
(
map
);
}
public
Map
<
String
,
String
>
sortList
(
Map
<
String
,
String
>
map
){
List
<
Map
.
Entry
<
String
,
String
>>
list
=
new
ArrayList
<
Map
.
Entry
<
String
,
String
>>(
map
.
entrySet
());
Collections
.
sort
(
list
,
new
Comparator
<
Map
.
Entry
<
String
,
String
>>()
{
//升序排序
public
int
compare
(
Entry
<
String
,
String
>
o1
,
Entry
<
String
,
String
>
o2
)
{
return
Integer
.
parseInt
(
o1
.
getKey
())
-
(
Integer
.
parseInt
(
o2
.
getKey
()));
}
});
return
map
;
}
}
com.zrqx.resource/src/main/java/com/zrqx/resource/bg/controller/ebook/EbookController.java
浏览文件 @
6b32107d
...
...
@@ -185,6 +185,10 @@ public class EbookController {
example
=
new
Example
(
EbookDiyType
.
class
);
example
.
createCriteria
().
andIn
(
"ebookId"
,
ids
);
dtservice
.
deleteByExample
(
example
);
// ----图片封面轮播图
example
=
new
Example
(
EbookImage
.
class
);
example
.
createCriteria
().
andIn
(
"ebookId"
,
ids
);
eBookImageService
.
deleteByExample
(
example
);
//删除资源收藏相关信息
example
=
new
Example
(
MemberCollection
.
class
);
example
.
createCriteria
().
andIn
(
"objectId"
,
ids
);
...
...
com.zrqx.resource/src/main/java/com/zrqx/resource/bg/mapper/authorLibrary/AuthorLibraryMapper.java
0 → 100644
浏览文件 @
6b32107d
package
com
.
zrqx
.
resource
.
bg
.
mapper
.
authorLibrary
;
import
java.util.List
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Select
;
import
com.zrqx.core.form.resource.bg.QueryResourceForPoPForm
;
import
com.zrqx.core.form.resource.bg.authorLibrary.QueryAuthorLibraryForm
;
import
com.zrqx.core.mapper.BaseMapper
;
import
com.zrqx.core.model.resource.authorLibrary.AuthorLibrary
;
import
com.zrqx.core.vo.resource.authorlibrary.AuthorLibraryListVO
;
public
interface
AuthorLibraryMapper
extends
BaseMapper
<
AuthorLibrary
>
{
@Select
(
"<script>"
+
"select a.id,a.name,a.institutionName,a.sex,a.education,a.department,a.title,a.post,a.description,a.faceImg,a.status,a.uploadTime "
+
"FROM res_author_library a left join res_author_library_diy_type t "
+
"on a.id = t.authorlibraryid where 1 = 1 "
+
"<if test='form.status != null'> "
+
" AND a.status = #{form.status} "
+
"</if> "
+
"<if test = '"
+
NOTBLANK
+
"(form.name)'> "
+
" AND a.name like concat('%',#{form.name},'%') "
+
"</if> "
+
"<if test = '"
+
NOTBLANK
+
"(form.title)'> "
+
" AND a.title like concat('%',#{form.title},'%') "
+
"</if> "
+
"<if test = '"
+
NOTBLANK
+
"(form.institutionName)'> "
+
" AND a.institutionName like concat('%',#{form.institutionName},'%') "
+
"</if> "
+
"<if test = '"
+
NOTBLANK
+
"(form.diyTypeCode)'> "
+
" AND t.diytypeCode like concat('%',#{form.diyTypeCode},'%') "
+
"</if>"
/*+ "<if test='form.diyTypeId != null and form.diyTypeId.size > 0'>"
+ "and t.diytypeid in "
+ " <foreach collection=\"form.diyTypeId\" index=\"index\" item=\"id\" open=\"(\" separator=\",\" close=\")\">"
+ "#{id}"
+ "</foreach>"
+ "</if>" */
+
"<if test = '"
+
NOTBLANK
+
"(form.beginTime)'> "
+
" AND a.uploadTime >= concat(#{form.beginTime}, ' 00:00:00') "
+
"</if> "
+
"<if test = '"
+
NOTBLANK
+
"(form.endTime)'> "
+
" AND a.uploadTime <= concat(#{form.endTime}, ' 23:59:59')"
+
"</if> "
+
" order by a.uploadTime desc "
+
"</script>"
)
List
<
AuthorLibraryListVO
>
queryAuthorLibraryByConditions
(
@Param
(
"form"
)
QueryAuthorLibraryForm
form
);
@Select
(
"<script>"
+
"select a.id,a.name,a.institutionName,a.faceImg,a.status,a.uploadTime "
+
"FROM res_author_library a left join res_author_library_diy_type t "
+
"on a.id = t.authorlibraryid "
+
" where 1 = 1 and a.status = 1 "
+
"<if test = '"
+
NOTBLANK
+
"(form.title)'> "
+
" AND a.name like concat('%',#{form.title},'%') "
+
"</if> "
+
"<if test = '"
+
NOTBLANK
+
"(form.diyTypeCode)'> "
+
" AND t.diytypeCode like concat('%',#{form.diyTypeCode},'%') "
+
"</if>"
+
"<if test='form.ids != null and form.ids.size > 0'>"
+
"and a.id not in "
+
" <foreach collection=\"form.ids\" index=\"index\" item=\"id\" open=\"(\" separator=\",\" close=\")\">"
+
"#{id}"
+
"</foreach>"
+
"</if>"
+
"</script>"
)
List
<
AuthorLibraryListVO
>
queryByTileAndDiyType
(
@Param
(
"form"
)
QueryResourceForPoPForm
form
);
}
com.zrqx.resource/src/main/java/com/zrqx/resource/bg/mapper/authorLibrary/AuthorResourceMapper.java
0 → 100644
浏览文件 @
6b32107d
package
com
.
zrqx
.
resource
.
bg
.
mapper
.
authorLibrary
;
import
java.util.List
;
import
org.apache.ibatis.annotations.Select
;
import
com.zrqx.core.form.resource.bg.QueryResourceRelationForm
;
import
com.zrqx.core.mapper.BaseMapper
;
import
com.zrqx.core.model.resource.authorLibrary.AuthorResource
;
import
com.zrqx.core.vo.resource.ResourceRelationVo
;
public
interface
AuthorResourceMapper
extends
BaseMapper
<
AuthorResource
>
{
@Select
(
"<script>"
+
"select id ,resourceId,resourceType,createTime,sort from res_author_resource "
+
"where authorId = #{id} "
+
"<if test='resourceType != null'> and resourceType = #{resourceType}</if>"
+
" order by sort desc , createTime desc "
+
"</script>"
)
List
<
ResourceRelationVo
>
queryByIdAndResourceType
(
QueryResourceRelationForm
entity
);
/**
* 获取关联资源最大排序
* @return
*/
@Select
(
"select MAX(sort) from res_author_resource"
)
Integer
getMax
();
}
com.zrqx.resource/src/main/java/com/zrqx/resource/bg/mapper/ResourceRelationMapper.java
→
com.zrqx.resource/src/main/java/com/zrqx/resource/bg/mapper/
authorLibrary/
ResourceRelationMapper.java
浏览文件 @
6b32107d
package
com
.
zrqx
.
resource
.
bg
.
mapper
;
package
com
.
zrqx
.
resource
.
bg
.
mapper
.
authorLibrary
;
import
java.util.List
;
...
...
com.zrqx.resource/src/main/java/com/zrqx/resource/bg/service/ResourceRelationServiceImpl.java
浏览文件 @
6b32107d
...
...
@@ -17,8 +17,8 @@ import com.zrqx.core.model.resource.resourcerelation.ResourceRelation;
import
com.zrqx.core.service.BaseServiceImpl
;
import
com.zrqx.core.util.page.PageParam
;
import
com.zrqx.core.vo.resource.ResourceRelationVo
;
import
com.zrqx.resource.bg.mapper.ResourceRelationMapper
;
import
com.zrqx.resource.bg.mapper.annexlibrary.AnnexLibraryMapper
;
import
com.zrqx.resource.bg.mapper.authorLibrary.ResourceRelationMapper
;
import
com.zrqx.resource.bg.mapper.ebook.EbookMapper
;
import
com.zrqx.resource.bg.mapper.projectlibrary.ProjectLibraryMapper
;
...
...
com.zrqx.resource/src/main/java/com/zrqx/resource/bg/service/annexlibrary/AnnexLibrarySerivceImpl.java
浏览文件 @
6b32107d
...
...
@@ -33,10 +33,10 @@ import com.zrqx.core.util.page.PageInfo;
import
com.zrqx.core.util.page.PageParam
;
import
com.zrqx.core.vo.resource.annexlibrary.AnnexLibraryListVO
;
import
com.zrqx.resource.bg.client.order.OrderClient
;
import
com.zrqx.resource.bg.mapper.ResourceRelationMapper
;
import
com.zrqx.resource.bg.mapper.annexlibrary.AnnexLibraryDiyTypeMapper
;
import
com.zrqx.resource.bg.mapper.annexlibrary.AnnexLibraryMapper
;
import
com.zrqx.resource.bg.mapper.annexlibrary.AnnexResourceMapper
;
import
com.zrqx.resource.bg.mapper.authorLibrary.ResourceRelationMapper
;
import
com.zrqx.resource.bg.mapper.marketing.PromotionContentMapper
;
import
com.zrqx.resource.bg.mapper.membercollection.MemberCollectionMapper
;
import
com.zrqx.resource.bg.mapper.recommend.RecommendResourceMapper
;
...
...
com.zrqx.resource/src/main/java/com/zrqx/resource/bg/service/authorLibrary/AuthorLibraryService.java
0 → 100644
浏览文件 @
6b32107d
package
com
.
zrqx
.
resource
.
bg
.
service
.
authorLibrary
;
import
com.zrqx.core.form.resource.bg.QueryResourceForPoPForm
;
import
com.zrqx.core.form.resource.bg.authorLibrary.QueryAuthorLibraryForm
;
import
com.zrqx.core.form.resource.bg.authorLibrary.SaveUpdateAuthorForm
;
import
com.zrqx.core.model.resource.authorLibrary.AuthorLibrary
;
import
com.zrqx.core.service.BaseService
;
import
com.zrqx.core.util.page.PageInfo
;
import
com.zrqx.core.util.page.PageParam
;
import
com.zrqx.core.vo.resource.authorlibrary.AuthorLibraryListVO
;
public
interface
AuthorLibraryService
extends
BaseService
<
AuthorLibrary
,
String
>
{
/**
* 查询作者库列表
* @param entity
* @param pageParam
* @return
* @author yzg
* @date: 2018年7月11日 下午3:10:24
*/
PageInfo
<
AuthorLibraryListVO
>
queryAuthorLibraryList
(
QueryAuthorLibraryForm
entity
,
PageParam
pageParam
);
/**
* 添加或修改作者库
* @param authorLibrary
* @return
* @author yzg
* @date: 2018年7月11日 下午3:10:13
*/
Boolean
saveOrUpdate
(
SaveUpdateAuthorForm
entity
);
/**
* 选择弹窗中的列表
* @param form
* @param pageParam
* @return
* @author ycw
* @date: 2019年1月3日 下午7:12:29
*/
PageInfo
<
AuthorLibraryListVO
>
pageByTitleAndDiyType
(
QueryResourceForPoPForm
form
,
PageParam
pageParam
);
}
com.zrqx.resource/src/main/java/com/zrqx/resource/bg/service/authorLibrary/AuthorLibraryServiceImpl.java
0 → 100644
浏览文件 @
6b32107d
package
com
.
zrqx
.
resource
.
bg
.
service
.
authorLibrary
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.stream.Collectors
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.github.pagehelper.PageHelper
;
import
com.zrqx.core.enums.AllResourceTypeEnum
;
import
com.zrqx.core.enums.resource.LibraryStatusEnum
;
import
com.zrqx.core.form.resource.bg.QueryResourceForPoPForm
;
import
com.zrqx.core.form.resource.bg.authorLibrary.QueryAuthorLibraryForm
;
import
com.zrqx.core.form.resource.bg.authorLibrary.SaveUpdateAuthorForm
;
import
com.zrqx.core.mapper.BaseMapper
;
import
com.zrqx.core.model.resource.authorLibrary.AuthorLibrary
;
import
com.zrqx.core.model.resource.authorLibrary.AuthorLibraryDiytype
;
import
com.zrqx.core.model.resource.authorLibrary.AuthorLibraryLabelContentDiyType
;
import
com.zrqx.core.service.BaseServiceImpl
;
import
com.zrqx.core.util.page.PageInfo
;
import
com.zrqx.core.util.page.PageParam
;
import
com.zrqx.core.vo.resource.authorlibrary.AuthorLibraryListVO
;
import
com.zrqx.resource.bg.mapper.authorLibrary.AuthorLibraryMapper
;
@Service
public
class
AuthorLibraryServiceImpl
extends
BaseServiceImpl
<
AuthorLibrary
,
String
>
implements
AuthorLibraryService
{
@Autowired
private
AuthorLibraryMapper
authorLibraryMapper
;
@Override
public
BaseMapper
<
AuthorLibrary
>
getMapper
()
{
return
authorLibraryMapper
;
}
/**
* 查询作者列表
*/
@Override
public
PageInfo
<
AuthorLibraryListVO
>
queryAuthorLibraryList
(
QueryAuthorLibraryForm
entity
,
PageParam
pageParam
)
{
PageHelper
.
startPage
(
pageParam
.
getPageNum
(),
pageParam
.
getPageSize
(),
pageParam
.
getOrderBy
());
List
<
AuthorLibraryListVO
>
list
=
authorLibraryMapper
.
queryAuthorLibraryByConditions
(
entity
);
return
new
PageInfo
<
AuthorLibraryListVO
>(
list
);
}
/**
* 添加或修改作者库
*
* @param authorLibrary
* @return
*/
@Override
public
Boolean
saveOrUpdate
(
SaveUpdateAuthorForm
form
)
{
AuthorLibrary
authorLibrary
=
new
AuthorLibrary
();
BeanUtils
.
copyProperties
(
form
,
authorLibrary
);
if
(
authorLibrary
.
getId
()
==
null
)
{
authorLibrary
.
setUploadTime
(
new
Date
());
authorLibrary
.
setStatus
(
LibraryStatusEnum
.
STATUS_0
.
getCode
());
authorLibrary
.
setResourceType
(
AllResourceTypeEnum
.
AUTHOR
.
getCode
());
authorLibrary
.
setBrowseNum
(
50
);
authorLibraryMapper
.
insertSelective
(
authorLibrary
);
}
else
{
authorLibrary
.
setUpdateTime
(
new
Date
());
authorLibraryMapper
.
updateByPrimaryKeySelective
(
authorLibrary
);
}
return
true
;
}
@Override
public
PageInfo
<
AuthorLibraryListVO
>
pageByTitleAndDiyType
(
QueryResourceForPoPForm
form
,
PageParam
pageParam
){
startPage
(
pageParam
);
List
<
AuthorLibraryListVO
>
list
=
authorLibraryMapper
.
queryByTileAndDiyType
(
form
);
if
(!
list
.
isEmpty
()){
for
(
AuthorLibraryListVO
ebookListVO
:
list
){
ebookListVO
.
setStatus_zh
(
LibraryStatusEnum
.
getName
(
Integer
.
parseInt
(
ebookListVO
.
getStatus
())));
}
}
return
new
PageInfo
<
AuthorLibraryListVO
>(
list
);
}
}
com.zrqx.resource/src/main/java/com/zrqx/resource/bg/service/authorLibrary/AuthorResourceService.java
0 → 100644
浏览文件 @
6b32107d
package
com
.
zrqx
.
resource
.
bg
.
service
.
authorLibrary
;
import
java.util.List
;
import
com.zrqx.core.form.resource.bg.QueryResourceRelationForm
;
import
com.zrqx.core.model.resource.authorLibrary.AuthorResource
;
import
com.zrqx.core.service.BaseService
;
import
com.zrqx.core.util.page.PageParam
;
import
com.zrqx.core.vo.resource.ResourceRelationVo
;
public
interface
AuthorResourceService
extends
BaseService
<
AuthorResource
,
Integer
>
{
/**
* 获取相关资源列表
* @param entity
* @param pageParam
* @return
* @author yzg
* @date: 2018年7月24日 上午9:09:34
*/
List
<
ResourceRelationVo
>
queryByIdAndResourceType
(
QueryResourceRelationForm
entity
,
PageParam
pageParam
);
/**
* 获取资源最大排序
* @return
*/
Integer
getMaxSort
();
}
com.zrqx.resource/src/main/java/com/zrqx/resource/bg/service/authorLibrary/AuthorResourceServiceImpl.java
0 → 100644
浏览文件 @
6b32107d
package
com
.
zrqx
.
resource
.
bg
.
service
.
authorLibrary
;
import
java.util.List
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.github.pagehelper.PageHelper
;
import
com.zrqx.core.form.resource.bg.QueryResourceRelationForm
;
import
com.zrqx.core.mapper.BaseMapper
;
import
com.zrqx.core.model.resource.authorLibrary.AuthorResource
;
import
com.zrqx.core.service.BaseServiceImpl
;
import
com.zrqx.core.util.page.PageParam
;
import
com.zrqx.core.vo.resource.ResourceRelationVo
;
import
com.zrqx.resource.bg.mapper.authorLibrary.AuthorResourceMapper
;
@Service
public
class
AuthorResourceServiceImpl
extends
BaseServiceImpl
<
AuthorResource
,
Integer
>
implements
AuthorResourceService
{
@Autowired
private
AuthorResourceMapper
authorResourceMapper
;
@Override
public
BaseMapper
<
AuthorResource
>
getMapper
()
{
return
authorResourceMapper
;
}
/**
* 获取相关资源列表
* @see com.zrqx.resource.bg.service.articlelibrary.ArticleResourceService#queryByIdAndResourceType(com.zrqx.core.form.resource.bg.QueryResourceRelationForm, com.zrqx.core.util.page.PageParam)
* @param entity
* @param pageParam
* @return
* @author yzg
* @date: 2018年7月24日 上午9:10:11
*/
@Override
public
List
<
ResourceRelationVo
>
queryByIdAndResourceType
(
QueryResourceRelationForm
entity
,
PageParam
pageParam
)
{
PageHelper
.
startPage
(
pageParam
);
return
authorResourceMapper
.
queryByIdAndResourceType
(
entity
);
}
/**
* 获取资源最大排序
*/
@Override
public
Integer
getMaxSort
()
{
Integer
sort
=
authorResourceMapper
.
getMax
();
if
(
sort
==
null
){
sort
=
1
;
}
else
{
sort
+=
1
;
}
return
sort
;
}
}
com.zrqx.resource/src/main/java/com/zrqx/resource/bg/service/projectlibrary/ProjectLibrarySerivceImpl.java
浏览文件 @
6b32107d
...
...
@@ -25,7 +25,7 @@ import com.zrqx.core.util.bean.BeanUtils;
import
com.zrqx.core.util.page.PageInfo
;
import
com.zrqx.core.util.page.PageParam
;
import
com.zrqx.core.vo.resource.projectlibrary.ProjectLibraryListVO
;
import
com.zrqx.resource.bg.mapper.ResourceRelationMapper
;
import
com.zrqx.resource.bg.mapper.
authorLibrary.
ResourceRelationMapper
;
import
com.zrqx.resource.bg.mapper.projectlibrary.ProjectLibraryMapper
;
import
com.zrqx.resource.bg.mapper.recommend.RecommendResourceMapper
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论