Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
site-project
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hqzhdj
site-project
Commits
4e140d36
Commit
4e140d36
authored
Aug 09, 2025
by
梅存智
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加阅读人数
parent
3b8cfd21
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
45 additions
and
4 deletions
+45
-4
cloud-site-api/src/main/java/com/yizhi/site/application/vo/domain/InformationVo.java
+3
-0
cloud-site-service/src/main/java/com/yizhi/site/application/domain/Information.java
+4
-0
cloud-site-service/src/main/java/com/yizhi/site/application/mapper/TrInformationReadNumberMapper.java
+5
-0
cloud-site-service/src/main/java/com/yizhi/site/application/service/ITrInformationReadNumberService.java
+3
-0
cloud-site-service/src/main/java/com/yizhi/site/application/service/impl/InformationServiceImpl.java
+1
-0
cloud-site-service/src/main/java/com/yizhi/site/application/service/impl/PublicationServiceImpl.java
+4
-1
cloud-site-service/src/main/java/com/yizhi/site/application/service/impl/TrInformationReadNumberServiceImpl.java
+10
-2
cloud-site-service/src/main/resources/mapper/MyItemConfigMapper.xml
+3
-1
cloud-site-service/src/main/resources/mapper/TrInformationReadNumberMapper.xml
+12
-0
No files found.
cloud-site-api/src/main/java/com/yizhi/site/application/vo/domain/InformationVo.java
View file @
4e140d36
...
...
@@ -114,6 +114,9 @@ public class InformationVo{
@ApiModelProperty
(
value
=
"阅读数量"
)
private
Integer
readNum
=
0
;
@ApiModelProperty
(
value
=
"阅读人数"
)
private
Integer
readDistinctNum
=
0
;
@ApiModelProperty
(
value
=
"点赞数量"
)
private
Integer
admireNum
=
0
;
...
...
cloud-site-service/src/main/java/com/yizhi/site/application/domain/Information.java
View file @
4e140d36
...
...
@@ -140,6 +140,10 @@ public class Information extends Model<Information> {
@ApiModelProperty
(
value
=
"阅读数量"
)
@TableField
(
exist
=
false
)
private
Integer
readNum
=
0
;
@ApiModelProperty
(
value
=
"阅读人数"
)
@TableField
(
exist
=
false
)
private
Integer
readDistinctNum
=
0
;
@ApiModelProperty
(
value
=
"点赞数量"
)
@TableField
(
exist
=
false
)
...
...
cloud-site-service/src/main/java/com/yizhi/site/application/mapper/TrInformationReadNumberMapper.java
View file @
4e140d36
package
com
.
yizhi
.
site
.
application
.
mapper
;
import
com.yizhi.site.application.domain.TrInformationReadNumber
;
import
org.apache.ibatis.annotations.Param
;
import
com.baomidou.mybatisplus.mapper.BaseMapper
;
/**
...
...
@@ -13,4 +16,6 @@ import com.baomidou.mybatisplus.mapper.BaseMapper;
*/
public
interface
TrInformationReadNumberMapper
extends
BaseMapper
<
TrInformationReadNumber
>
{
Integer
getInformationReadDistinctCount
(
@Param
(
"informationId"
)
Long
informationId
);
}
cloud-site-service/src/main/java/com/yizhi/site/application/service/ITrInformationReadNumberService.java
View file @
4e140d36
...
...
@@ -22,4 +22,7 @@ public interface ITrInformationReadNumberService extends IService<TrInformationR
public
Integer
getInformationReadCountPc
(
Long
informationId
);
public
Integer
getInformationReadDistinctCount
(
Long
informationId
);
}
cloud-site-service/src/main/java/com/yizhi/site/application/service/impl/InformationServiceImpl.java
View file @
4e140d36
...
...
@@ -1052,6 +1052,7 @@ public class InformationServiceImpl extends ServiceImpl<InformationMapper, Infor
info
.
setFavoriteNum
(
eventTrackService
.
getNum
(
"event_comment_"
+
info
.
getTypeOne
(),
info
.
getId
()));
info
.
setRelayNum
(
eventTrackService
.
getNum
(
"event_relay_"
+
info
.
getTypeOne
(),
info
.
getId
()));
info
.
setReadNum
(
informationReadNumberService
.
getInformationReadCountPc
(
info
.
getId
()));
info
.
setReadDistinctNum
(
informationReadNumberService
.
getInformationReadDistinctCount
(
info
.
getId
()));
}
}
page
.
setRecords
(
list
);
...
...
cloud-site-service/src/main/java/com/yizhi/site/application/service/impl/PublicationServiceImpl.java
View file @
4e140d36
...
...
@@ -25,6 +25,7 @@ import com.yizhi.util.application.constant.ReturnCode;
import
com.yizhi.util.application.date.DateUtil
;
import
lombok.extern.log4j.Log4j2
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.BeanUtils
;
...
...
@@ -177,7 +178,9 @@ public class PublicationServiceImpl extends ServiceImpl<PublicationMapper, Publi
try
{
JSONArray
jsonArray
=
JSONArray
.
parseArray
(
selectById
.
getOssUrl
());
if
(
jsonArray
.
size
()>
0
){
information
.
setLogoPath
(
jsonArray
.
getString
(
0
));
if
(
StringUtils
.
isEmpty
(
selectById
.
getLogoPath
())){
information
.
setLogoPath
(
jsonArray
.
getString
(
0
));
}
information
.
setPdfOssUrl
(
selectById
.
getOssUrl
());
String
imgDiv
=
"<p></p><div class=\"media-wrap image-wrap\"><img id=\"%s\" title=\"%s\" alt=\"image\" src=\"%s\"/></div><p></p>\n"
;
String
content
=
selectById
.
getContent
();
...
...
cloud-site-service/src/main/java/com/yizhi/site/application/service/impl/TrInformationReadNumberServiceImpl.java
View file @
4e140d36
...
...
@@ -29,6 +29,9 @@ public class TrInformationReadNumberServiceImpl extends ServiceImpl<TrInformatio
@Autowired
private
IdGenerator
idGenerator
;
@Autowired
TrInformationReadNumberMapper
informationReadNumberMapper
;
/**
* 获取阅读次数d
...
...
@@ -47,8 +50,8 @@ public class TrInformationReadNumberServiceImpl extends ServiceImpl<TrInformatio
trInformationReadNumber
.
setInformationId
(
informationId
);
trInformationReadNumber
.
setSiteId
(
context
.
getSiteId
());
trInformationReadNumber
.
setCreateTime
(
new
Date
());
this
.
insert
(
trInformationReadNumber
);
trInformationReadNumber
.
setCreateById
(
context
.
getAccountId
());
this
.
insert
(
trInformationReadNumber
);
TrInformationReadNumber
informationReadNumber
=
new
TrInformationReadNumber
();
...
...
@@ -68,4 +71,9 @@ public class TrInformationReadNumberServiceImpl extends ServiceImpl<TrInformatio
Integer
num
=
this
.
selectCount
(
QueryUtil
.
condition
(
informationReadNumber
));
return
num
==
null
?
0
:
num
;
}
@Override
public
Integer
getInformationReadDistinctCount
(
Long
informationId
)
{
return
informationReadNumberMapper
.
getInformationReadDistinctCount
(
informationId
);
}
}
cloud-site-service/src/main/resources/mapper/MyItemConfigMapper.xml
View file @
4e140d36
...
...
@@ -67,9 +67,11 @@
and my.site_id = #{siteId}
</if>
<if
test=
"accountId !=null"
>
and my.id in(
and
(
my.id in(
select item_id from my_item_config_role where role_id in(
select role_id from cloud_system.authz_account_role aar where account_id =#{accountId}))
OR my.id IN(1237069526114295815)
)
</if>
<if
test=
"accountId ==null"
>
and my.id not in(1237069526114295813)
...
...
cloud-site-service/src/main/resources/mapper/TrInformationReadNumberMapper.xml
0 → 100644
View file @
4e140d36
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yizhi.site.application.mapper.TrInformationReadNumberMapper"
>
<select
id=
"getInformationReadDistinctCount"
resultType=
"java.lang.Integer"
>
SELECT COUNT(DISTINCT create_by_id)
FROM tr_information_read_number
WHERE information_id=#{informationId}
</select>
</mapper>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment