Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
J
jgjy
Project
Project
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
Graph
比较
统计图
议题
0
议题
0
列表
看板
标记
Milestones
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
注册表
注册表
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
svn
jgjy
Commits
8ddd194c
提交
8ddd194c
authored
4月 26, 2019
作者:
liupengfei
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
--no commit message
上级
278ccae3
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
20 行增加
和
4 行删除
+20
-4
ResourceController.java
...a/com/zrqx/fg/resource/controller/ResourceController.java
+1
-1
ResourceServiceImpl.java
...om/zrqx/fg/resource/service/impl/ResourceServiceImpl.java
+7
-0
FgBrowseRecordsController.java
...r/controller/browseRecords/FgBrowseRecordsController.java
+5
-0
FgCollectionsController.java
...suser/controller/collections/FgCollectionsController.java
+1
-1
FgBrowseRecordsMapper.java
...fg/sysuser/mapper/browseRecord/FgBrowseRecordsMapper.java
+1
-0
FgBrowseRecordsServiceImpl.java
...user/service/browseRecord/FgBrowseRecordsServiceImpl.java
+2
-0
FgCollectionsServiceImpl.java
...sysuser/service/collections/FgCollectionsServiceImpl.java
+3
-2
没有找到文件。
com.zrqx.fg.resource/src/main/java/com/zrqx/fg/resource/controller/ResourceController.java
浏览文件 @
8ddd194c
...
...
@@ -112,7 +112,7 @@ public class ResourceController {
public
CallBack
<
List
<
FgResourceVo
>>
batchGet
(
@RequestBody
List
<
FgResourceForm
>
forms
)
{
return
CallBack
.
success
(
resourceService
.
batchGet
(
forms
));
}
// TODO URL 格式修改 /get/业务名称 使用get 方法查询,get方法下不存在 @RequestBody
@ApiOperation
(
"根据资源id/资源类别,返回资源详情"
)
@GetMapping
(
ResourceRequestPath
.
GET
+
ResourceRequestPath
.
BATCH
)
public
CallBack
<
CollectionsVo
>
batchGet
(
GoodsForm
forms
)
{
...
...
com.zrqx.fg.resource/src/main/java/com/zrqx/fg/resource/service/impl/ResourceServiceImpl.java
浏览文件 @
8ddd194c
...
...
@@ -570,25 +570,32 @@ public class ResourceServiceImpl extends BaseModelServiceImpl<PhyResource, Strin
@Override
public
CollectionsVo
get
(
GoodsForm
forms
)
{
CollectionsVo
collectionsVo
=
new
CollectionsVo
();
// TODO 常量值 交由 GoodsTypeStartEnum
if
(
forms
.
getGoodsType
().
contains
(
"1-"
)){
FgPhyResourceVo
fgPhyResourceVo
=
new
FgPhyResourceVo
();
// TODO 空指针异常
PhyResource
phyResource
=
phyResourceMapper
.
selectByPrimaryKey
(
forms
.
getGoodsId
());
try
{
// TODO BeanUtils 使用 core包下 或者 spring包下, 不要使用 apache包下
BeanUtils
.
copyProperties
(
fgPhyResourceVo
,
phyResource
);
}
catch
(
Exception
e
)
{
logger
.
error
(
"批量查询实体资源信息-属性copy失败\n"
+
e
.
getMessage
());
}
ResourceBinding
record
=
new
ResourceBinding
();
record
.
setMainId
(
forms
.
getGoodsId
());
// TODO 获取收藏商品vo 判断是否有绑定信息 需要使用 计数方法
List
<
ResourceBinding
>
resourceBindings
=
resourceBindingMapper
.
select
(
record
);
fgPhyResourceVo
.
setIsHaveBinding
(
resourceBindings
==
null
?
"0"
:
"1"
);
// TODO 判断 集合是否为空 使用 ArrayUtils.isNotEmpty 方法
if
(
resourceBindings
!=
null
){
// TODO 使用 boolean flag = resourceBindings.stream().map(ResourceBinding :: getOtherType).anymath(type -> GoodsTypeEnum.PDF.getCode().equals(type))
List
<
String
>
otherTypes
=
resourceBindings
.
stream
().
map
(
ResourceBinding
::
getOtherType
).
collect
(
Collectors
.
toList
());
fgPhyResourceVo
.
setIsTrialReading
(
otherTypes
.
contains
(
GoodsTypeEnum
.
PDF
.
getCode
())
?
"0"
:
"1"
);
}
collectionsVo
.
setFgPhyResourceVo
(
fgPhyResourceVo
);
}
else
{
FgEleResourceVo
fgEleResourceVo
=
new
FgEleResourceVo
();
// TODO 空指针异常
EleResource
eleResource
=
eleResourceMapper
.
selectByPrimaryKey
(
forms
.
getGoodsId
());
try
{
BeanUtils
.
copyProperties
(
fgEleResourceVo
,
eleResource
);
...
...
com.zrqx.fg.sysuser/src/main/java/com/zrqx/fg/sysuser/controller/browseRecords/FgBrowseRecordsController.java
浏览文件 @
8ddd194c
...
...
@@ -36,18 +36,22 @@ public class FgBrowseRecordsController {
@Autowired
private
FgBrowseRecordsService
browseRecordsService
;
@ApiOperation
(
"浏览记录批量删除"
)
@PostMapping
(
SysUserRequestPath
.
BATCH_DELETE
)
public
CallBack
<
Boolean
>
batchDelete
(
@ApiParam
(
value
=
"*记录id集合"
,
required
=
true
)
@RequestBody
List
<
Integer
>
oids
){
// TODO 根据 oids 和当前登录人 id 删除 浏览记录
return
browseRecordsService
.
batchDelete
(
oids
)
?
CallBack
.
success
()
:
CallBack
.
fail
();
}
@ApiOperation
(
"删除当天"
)
// TODO BATCH_DELETE_TODAY 常量拼接不正确
@PostMapping
(
SysUserRequestPath
.
BATCH_DELETE_TODAY
)
public
CallBack
<
Boolean
>
batchDeleteToDay
(
@RequestBody
QueryBrowseRecordsForm
form
){
return
CallBack
.
success
(
browseRecordsService
.
deleteByParam
(
form
));
}
// TODO 会员id
@ApiOperation
(
"浏览记录分页列表"
)
@GetMapping
(
SysUserRequestPath
.
OID
+
SysUserRequestPath
.
PAGE
)
public
CallBack
<
PageMap
<
String
,
List
<
CollectionsVo
>>>
page
(
@ApiParam
(
value
=
"*会员id"
,
required
=
true
)
@PathVariable
Integer
oid
,
PageParam
pageParam
){
...
...
@@ -57,4 +61,5 @@ public class FgBrowseRecordsController {
return
CallBack
.
success
(
browseRecordsService
.
page
(
oid
,
pageParam
));
}
// TODO 缺少接口, 获取指定数量的 浏览记录
}
com.zrqx.fg.sysuser/src/main/java/com/zrqx/fg/sysuser/controller/collections/FgCollectionsController.java
浏览文件 @
8ddd194c
...
...
@@ -63,7 +63,7 @@ public class FgCollectionsController {
}
return
CallBack
.
success
(
fgCollectionsService
.
page
(
pageParam
));
}
// TODO isExist判断是否存在
@ApiOperation
(
value
=
"判断是否收藏 true:被收藏 false:未收藏"
)
@GetMapping
(
SysUserRequestPath
.
CHECK_IS_COLLECT
)
public
CallBack
<
Boolean
>
check
(
CollectionsForm
form
){
...
...
com.zrqx.fg.sysuser/src/main/java/com/zrqx/fg/sysuser/mapper/browseRecord/FgBrowseRecordsMapper.java
浏览文件 @
8ddd194c
...
...
@@ -39,6 +39,7 @@ public interface FgBrowseRecordsMapper extends BaseMapper<BrowseRecords>{
* @author chyj
* @date: 2019年4月19日 上午10:20:49
*/
// TODO 使用 @Delete 注解 用户id不应该为空
@Select
(
" <script> "
+
" DELETE FROM sys_browse_records where 1=1 "
+
" <if test='(from.uid) != null'> "
...
...
com.zrqx.fg.sysuser/src/main/java/com/zrqx/fg/sysuser/service/browseRecord/FgBrowseRecordsServiceImpl.java
浏览文件 @
8ddd194c
...
...
@@ -53,6 +53,7 @@ public class FgBrowseRecordsServiceImpl extends BaseServiceImpl<BrowseRecords, I
// 2. 取第n页数据
// 3. 组装PageInfo对象
startPage
(
pageParam
);
// TODO oid 为用户id 从redis 中获取
List
<
CollectionsVo
>
result
=
fgBrowseRecordsMapper
.
list
(
oid
);
Map
<
String
,
List
<
CollectionsVo
>>
map
=
result
.
stream
().
map
(
vo
->
{
GoodsForm
goodsForm
=
new
GoodsForm
();
...
...
@@ -78,6 +79,7 @@ public class FgBrowseRecordsServiceImpl extends BaseServiceImpl<BrowseRecords, I
*/
@Override
public
Boolean
deleteByParam
(
QueryBrowseRecordsForm
form
)
{
// TODO 根据用户id 和 日期删除浏览记录
return
fgBrowseRecordsMapper
.
deleteByParam
(
form
);
}
...
...
com.zrqx.fg.sysuser/src/main/java/com/zrqx/fg/sysuser/service/collections/FgCollectionsServiceImpl.java
浏览文件 @
8ddd194c
...
...
@@ -67,8 +67,8 @@ public class FgCollectionsServiceImpl extends BaseModelServiceImpl<Collections,
goodsForm
.
setGoodsType
(
vo
.
getGoodsType
());
CallBack
<
CollectionsVo
>
call
=
resourceClient
.
get
(
goodsForm
);
if
(
call
.
hasEntity
()){
vo
.
setFgEleResourceVo
(
call
.
getData
().
getFgEleResourceVo
());
vo
.
setFgPhyResourceVo
(
call
.
getData
().
getFgPhyResourceVo
());
vo
.
setFgEleResourceVo
(
call
.
getData
().
getFgEleResourceVo
());
vo
.
setFgPhyResourceVo
(
call
.
getData
().
getFgPhyResourceVo
());
}
}
return
new
PageInfo
<
CollectionsVo
>(
result
);
...
...
@@ -87,6 +87,7 @@ public class FgCollectionsServiceImpl extends BaseModelServiceImpl<Collections,
collections
.
setGoodsId
(
form
.
getGoodsId
());
collections
.
setGoodsType
(
form
.
getGoodsType
());
collections
.
setUserId
(
fgRedisManage
.
getMember
().
getId
()
==
null
?
""
:
fgRedisManage
.
getMember
().
getId
()+
""
);
// TODO 使用计数方法
List
<
Collections
>
result
=
fgcollectionsMapper
.
select
(
collections
);
return
!
result
.
isEmpty
();
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论