Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Z
zgzx
Project
Project
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
Graph
比较
统计图
议题
0
议题
0
列表
看板
标记
Milestones
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
注册表
注册表
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
svn
zgzx
Commits
9bc10771
提交
9bc10771
authored
9月 26, 2019
作者:
renjiancai
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
--no commit message
上级
732266f7
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
36 行增加
和
35 行删除
+36
-35
EbookListStatisticsVO.java
...om/zrqx/core/vo/resource/ebook/EbookListStatisticsVO.java
+0
-4
ArticleLibraryMapper.java
...source/bg/mapper/articlelibrary/ArticleLibraryMapper.java
+12
-9
BookMapper.java
...in/java/com/zrqx/resource/bg/mapper/ebook/BookMapper.java
+7
-5
FgArticleLibraryController.java
...controller/articlelibrary/FgArticleLibraryController.java
+3
-1
FgEbookController.java
.../zrqx/resource/fg/controller/ebook/FgEbookController.java
+2
-1
FgRecordService.java
.../com/zrqx/resource/fg/service/record/FgRecordService.java
+3
-2
FgRecordServiceImpl.java
.../zrqx/resource/fg/service/record/FgRecordServiceImpl.java
+7
-12
WapArticleLibraryController.java
...ontroller/articlelibrary/WapArticleLibraryController.java
+2
-1
没有找到文件。
com.zrqx.core/src/main/java/com/zrqx/core/vo/resource/ebook/EbookListStatisticsVO.java
浏览文件 @
9bc10771
...
...
@@ -12,10 +12,6 @@ import lombok.Data;
@Data
@ApiModel
(
value
=
"EbookListStatisticsVO"
,
description
=
"查询文章集合返回的实体"
)
public
class
EbookListStatisticsVO
{
@ApiModelProperty
(
"id,新增时不需要填写"
)
private
String
id
;
@ApiModelProperty
(
value
=
"标题"
)
private
String
name
;
@ApiModelProperty
(
value
=
"浏览数量"
)
private
Integer
browseNum
;
@ApiModelProperty
(
"上传时间"
)
...
...
com.zrqx.resource/src/main/java/com/zrqx/resource/bg/mapper/articlelibrary/ArticleLibraryMapper.java
浏览文件 @
9bc10771
...
...
@@ -13,6 +13,7 @@ import com.zrqx.core.model.resource.articlelibrary.ArticleLibrary;
import
com.zrqx.core.vo.resource.ResourceRelationListVo
;
import
com.zrqx.core.vo.resource.articlelibrary.ArticleLibraryListStatisticsVO
;
import
com.zrqx.core.vo.resource.articlelibrary.ArticleLibraryListVO
;
import
com.zrqx.core.vo.resource.ebook.EbookListStatisticsVO
;
/**
* 文章库
*/
...
...
@@ -70,15 +71,17 @@ public interface ArticleLibraryMapper extends BaseMapper<ArticleLibrary> {
* @date: 2019年9月20日 上午10:39:57
*/
@Select
(
"<script>"
+
"select id,name,DATE_FORMAT(uploadTime,'%Y-%m-%d') uploadTime,browseNum from res_article_library where DATE_SUB(CURDATE(), INTERVAL 7 DAY) < date(uploadTime) "
+
"<if test = '"
+
NOTBLANK
+
"(form.beginTime)'>"
+
"and uploadTime >= concat(#{form.beginTime}, ' 00:00:00' )"
+
"</if>"
+
"<if test = '"
+
NOTBLANK
+
"(form.endTime)'>"
+
"and uploadTime <= concat(#{form.endTime}, ' 23:59:59')"
+
"</if>"
+
" ORDER BY uploadTime desc"
+
"</script>"
)
+
"select createTime as uploadTime , count(createTime) as 'browseNum' from ("
+
"select id,DATE_FORMAT(createTime,'%Y-%m-%d') createTime,goodsType from res_record where "
+
"date_sub(curdate(), INTERVAL 7 DAY) <= date(createTime) and goodsType=2 "
+
"<if test = '"
+
NOTBLANK
+
"(form.beginTime)'>"
+
"and createTime >= concat(#{form.beginTime}, ' 00:00:00' )"
+
"</if>"
+
"<if test = '"
+
NOTBLANK
+
"(form.endTime)'>"
+
" and createTime <= concat(#{form.endTime}, ' 23:59:59')"
+
"</if>"
+
") ss group by createTime"
+
"</script>"
)
List
<
ArticleLibraryListStatisticsVO
>
queryArticleReadingVolume
(
@Param
(
"form"
)
QueryStatisticsForm
form
);
...
...
com.zrqx.resource/src/main/java/com/zrqx/resource/bg/mapper/ebook/BookMapper.java
浏览文件 @
9bc10771
...
...
@@ -27,14 +27,16 @@ public interface BookMapper extends BaseMapper<Book> {
+
"</script>"
)
List
<
ResourceRelationListVo
>
queryByTileAndDiyType
(
@Param
(
"form"
)
QueryResourceForPoPForm
form
);
@Select
(
"<script>"
+
"select id,name,DATE_FORMAT(uploadTime,'%Y-%m-%d') uploadTime,browseNum from res_book where DATE_SUB(CURDATE(), INTERVAL 7 DAY) < date(uploadTime) "
+
"<if test = '"
+
NOTBLANK
+
"(form.beginTime)'>"
+
"and uploadTime >= concat(#{form.beginTime}, ' 00:00:00' )"
+
"select createTime as uploadTime , count(createTime) as 'browseNum' from ("
+
"select id,DATE_FORMAT(createTime,'%Y-%m-%d') createTime,goodsType from res_record where "
+
"date_sub(curdate(), INTERVAL 7 DAY) <= date(createTime) and goodsType=1 "
+
"<if test = '"
+
NOTBLANK
+
"(form.beginTime)'>"
+
"and createTime >= concat(#{form.beginTime}, ' 00:00:00' )"
+
"</if>"
+
"<if test = '"
+
NOTBLANK
+
"(form.endTime)'>"
+
"
and upload
Time <= concat(#{form.endTime}, ' 23:59:59')"
+
"
and create
Time <= concat(#{form.endTime}, ' 23:59:59')"
+
"</if>"
+
"
ORDER BY uploadTime desc
"
+
"
) ss group by createTime
"
+
"</script>"
)
List
<
EbookListStatisticsVO
>
queryBookReadingVolume
(
@Param
(
"form"
)
QueryStatisticsForm
form
);
...
...
com.zrqx.resource/src/main/java/com/zrqx/resource/fg/controller/articlelibrary/FgArticleLibraryController.java
浏览文件 @
9bc10771
package
com
.
zrqx
.
resource
.
fg
.
controller
.
articlelibrary
;
import
java.text.ParseException
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
...
...
@@ -35,7 +37,7 @@ public class FgArticleLibraryController {
@ApiOperation
(
value
=
"查询"
,
notes
=
"根据ID查询"
)
@GetMapping
(
value
=
ResourceRequestPath
.
GET_OID
)
public
CallBack
<
FgArticleLibraryOneVO
>
getById
(
@PathVariable
String
oid
)
{
public
CallBack
<
FgArticleLibraryOneVO
>
getById
(
@PathVariable
String
oid
)
throws
ParseException
{
FgArticleLibraryOneVO
vo
=
service
.
articleOneInfoById
(
oid
,
true
);
// 保存浏览记录
recordService
.
saveOrUpdateRecord
(
oid
,
AllResourceTypeEnum
.
ARTICLE
.
getCode
().
toString
());
...
...
com.zrqx.resource/src/main/java/com/zrqx/resource/fg/controller/ebook/FgEbookController.java
浏览文件 @
9bc10771
package
com
.
zrqx
.
resource
.
fg
.
controller
.
ebook
;
import
java.text.ParseException
;
import
java.util.List
;
import
org.apache.commons.lang3.StringUtils
;
...
...
@@ -78,7 +79,7 @@ public class FgEbookController {
@ApiOperation
(
"根据id查找电子书"
)
@GetMapping
(
ResourceRequestPath
.
GET
)
public
CallBack
<
FgEbookVO
>
echo
(
QueryResourceRelationForm
entity
)
{
public
CallBack
<
FgEbookVO
>
echo
(
QueryResourceRelationForm
entity
)
throws
ParseException
{
FgEbookVO
vo
=
bookservice
.
ebookOneInfoById
(
entity
.
getId
()).
get
(
0
);
// 保存浏览记录
recordService
.
saveOrUpdateRecord
(
entity
.
getId
(),
AllResourceTypeEnum
.
BOOK
.
getCode
().
toString
());
...
...
com.zrqx.resource/src/main/java/com/zrqx/resource/fg/service/record/FgRecordService.java
浏览文件 @
9bc10771
package
com
.
zrqx
.
resource
.
fg
.
service
.
record
;
import
java.text.ParseException
;
import
java.util.List
;
import
com.zrqx.core.model.resource.record.Record
;
...
...
@@ -17,7 +18,7 @@ public interface FgRecordService extends BaseService<Record, Integer> {
* @author ycw
* @date: 2019年2月12日 下午3:02:55
*/
boolean
saveOrUpdateRecord
(
String
goodsId
,
String
goodsType
);
boolean
saveOrUpdateRecord
(
String
goodsId
,
String
goodsType
)
throws
ParseException
;
/**
* 我的浏览记录
...
...
@@ -25,5 +26,5 @@ public interface FgRecordService extends BaseService<Record, Integer> {
* @author ycw
* @date: 2019年2月12日 下午4:16:19
*/
List
<
FgMyRecordVO
>
getMyRecord
();
List
<
FgMyRecordVO
>
getMyRecord
()
;
}
com.zrqx.resource/src/main/java/com/zrqx/resource/fg/service/record/FgRecordServiceImpl.java
浏览文件 @
9bc10771
package
com
.
zrqx
.
resource
.
fg
.
service
.
record
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.List
;
...
...
@@ -60,31 +62,24 @@ public class FgRecordServiceImpl extends BaseServiceImpl<Record, Integer>
* @param goodsType 资源类型 电子书2-1 文章2-2
* @return
* @author ycw
* @throws ParseException
* @date: 2019年2月12日 下午3:02:55
*/
@Override
public
boolean
saveOrUpdateRecord
(
String
goodsId
,
String
goodsType
)
{
if
(!
redis
.
isExistMember
()){
return
false
;
}
public
boolean
saveOrUpdateRecord
(
String
goodsId
,
String
goodsType
)
throws
ParseException
{
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
Record
record
=
new
Record
();
record
.
setGoodsId
(
goodsId
);
record
.
setGoodsType
(
goodsType
);
record
.
setMemberId
(
redis
.
getMember
().
getId
());
Record
records
=
mapper
.
selectOne
(
record
);
if
(
records
!=
null
)
{
records
.
setCreateTime
(
new
Date
());
sdf
.
parse
(
new
Date
().
toString
());
records
.
setCreateTime
(
sdf
.
parse
(
new
Date
().
toString
()));
mapper
.
updateByPrimaryKeySelective
(
records
);
}
else
{
record
.
setCreateTime
(
new
Date
());
mapper
.
insertSelective
(
record
);
}
//如果浏览记录超过15条,按照浏览时间降序排列,删除多余的浏览记录
Record
myRecord
=
new
Record
();
myRecord
.
setMemberId
(
redis
.
getMember
().
getId
());
if
(
mapper
.
selectCount
(
myRecord
)
>
15
){
mapper
.
deleteOtherRecord
(
redis
.
getMember
().
getId
());
}
return
true
;
}
...
...
com.zrqx.resource/src/main/java/com/zrqx/resource/wap/controller/articlelibrary/WapArticleLibraryController.java
浏览文件 @
9bc10771
package
com
.
zrqx
.
resource
.
wap
.
controller
.
articlelibrary
;
import
java.text.ParseException
;
import
java.util.List
;
import
org.apache.commons.lang3.StringUtils
;
...
...
@@ -51,7 +52,7 @@ public class WapArticleLibraryController {
}
@ApiOperation
(
value
=
"查询"
,
notes
=
"根据ID查询"
)
@GetMapping
(
value
=
ResourceRequestPath
.
GET_OID
)
public
CallBack
<
FgArticleLibraryOneVO
>
getById
(
@PathVariable
String
oid
)
{
public
CallBack
<
FgArticleLibraryOneVO
>
getById
(
@PathVariable
String
oid
)
throws
ParseException
{
FgArticleLibraryOneVO
vo
=
service
.
articleOneInfoById
(
oid
,
true
);
// 保存浏览记录
recordService
.
saveOrUpdateRecord
(
oid
,
AllResourceTypeEnum
.
ARTICLE
.
getCode
().
toString
());
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论