Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
point-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
point-project
Commits
417dcc5b
Commit
417dcc5b
authored
Mar 10, 2025
by
阳浪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
我的积分 阅读文章五次
parent
71851344
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
30 additions
and
3 deletions
+30
-3
cloud-point-api/src/main/java/com/yizhi/point/application/vo/PointDetailVO.java
+2
-1
cloud-point-api/src/main/java/com/yizhi/point/application/vo/PointVo.java
+2
-0
cloud-point/src/main/java/com/yizhi/application/controller/PointListenerController.java
+5
-0
cloud-point/src/main/java/com/yizhi/application/mapper/PointDetailsMapper.java
+2
-0
cloud-point/src/main/java/com/yizhi/application/service/PointDetailsService.java
+2
-0
cloud-point/src/main/java/com/yizhi/application/service/impl/PointDetailsServiceImpl.java
+9
-2
cloud-point/src/main/resources/mapper/PointDetailsMapper.xml
+8
-0
No files found.
cloud-point-api/src/main/java/com/yizhi/point/application/vo/PointDetailVO.java
View file @
417dcc5b
...
...
@@ -26,9 +26,10 @@ public class PointDetailVO {
@ApiModelProperty
(
value
=
"积分活动分类"
)
private
List
<
PointVo
>
pointVoList
;
public
void
addPoint
(
String
learnType
,
String
learnName
,
Integer
flag
){
public
void
addPoint
(
String
learnType
,
String
learnName
,
Integer
countNum
,
Integer
flag
){
PointVo
pointVo
=
new
PointVo
();
pointVo
.
setFlag
(
flag
);
pointVo
.
setCountNum
(
countNum
);
pointVo
.
setLearnName
(
learnName
);
pointVo
.
setLearnType
(
learnType
);
if
(
CollectionUtils
.
isEmpty
(
this
.
pointVoList
)){
...
...
cloud-point-api/src/main/java/com/yizhi/point/application/vo/PointVo.java
View file @
417dcc5b
...
...
@@ -20,4 +20,6 @@ public class PointVo {
@ApiModelProperty
(
value
=
"学习活动名称"
)
private
String
learnName
;
private
Integer
countNum
;
}
cloud-point/src/main/java/com/yizhi/application/controller/PointListenerController.java
View file @
417dcc5b
...
...
@@ -3,6 +3,7 @@ package com.yizhi.application.controller;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.baomidou.mybatisplus.mapper.EntityWrapper
;
import
com.yizhi.application.constant.PointChangeReasonConstant
;
import
com.yizhi.application.constant.PointEventEnum
;
import
com.yizhi.application.domain.*
;
import
com.yizhi.application.orm.id.IdGenerator
;
...
...
@@ -370,6 +371,10 @@ public class PointListenerController {
pointActivity
.
setState
(
2
);
EntityWrapper
<
PointActivity
>
entityWrapper
=
new
EntityWrapper
<
PointActivity
>();
PointActivity
vo
=
pointActivityService
.
selectOne
(
entityWrapper
);
Integer
count
=
pointDetailsService
.
getCountToDay
(
accountId
,
siteId
,
code
);
if
(
Objects
.
equals
(
code
,
PointChangeReasonConstant
.
POINT_READ
.
getKey
())&&
count
>=
5
){
return
false
;
}
if
(
vo
!=
null
&&
ObjectUtil
.
isNotEmpty
(
vo
.
getCode
())&&
accountId
!=
null
&&
accountId
!=
0L
){
try
{
PointParamVO
pointParamVO
=
new
PointParamVO
();
...
...
cloud-point/src/main/java/com/yizhi/application/mapper/PointDetailsMapper.java
View file @
417dcc5b
...
...
@@ -99,4 +99,6 @@ public interface PointDetailsMapper extends BaseMapper<PointDetails> {
Integer
selectPointVo
(
@Param
(
"accountId"
)
Long
accountId
,
@Param
(
"siteId"
)
Long
siteId
,
@Param
(
"type"
)
String
type
,
@Param
(
"toDay"
)
String
toDay
);
Integer
getAmount
(
@Param
(
"accountId"
)
Long
accountId
,
@Param
(
"siteId"
)
Long
siteId
);
Integer
getCountToDay
(
@Param
(
"accountId"
)
Long
accountId
,
@Param
(
"siteId"
)
Long
siteId
,
@Param
(
"type"
)
String
type
,
@Param
(
"toDay"
)
String
toDay
);
}
cloud-point/src/main/java/com/yizhi/application/service/PointDetailsService.java
View file @
417dcc5b
...
...
@@ -27,6 +27,8 @@ public interface PointDetailsService extends IService<PointDetails> {
PointDetailVO
getPointDetail
(
Long
accountId
,
Long
siteId
);
Integer
getCountToDay
(
Long
accountId
,
Long
siteId
,
String
type
);
Integer
queryPiont
(
Long
userId
,
Long
companyId
,
Long
siteId
,
Long
orgId
);
Page
<
PointDetailsVO
>
getManagePointDetails
(
Integer
pageNo
,
Integer
pageSize
,
Long
activityId
,
...
...
cloud-point/src/main/java/com/yizhi/application/service/impl/PointDetailsServiceImpl.java
View file @
417dcc5b
...
...
@@ -446,15 +446,16 @@ public class PointDetailsServiceImpl extends ServiceImpl<PointDetailsMapper, com
Arrays
.
stream
(
PointChangeReasonConstant
.
values
()).
forEach
(
e
->{
if
(
pointTypeList
.
contains
(
e
.
getValue
())){
Integer
point
=
pointDetailsMapper
.
selectPointVo
(
accountId
,
siteId
,
e
.
getKey
(),
toDay
);
Integer
count
=
pointDetailsMapper
.
getCountToDay
(
accountId
,
siteId
,
e
.
getKey
(),
toDay
);
if
(
Objects
.
equals
(
e
.
getKey
(),
PointChangeReasonConstant
.
CREDITCOURSEDONE1
.
getKey
())
||
Objects
.
equals
(
e
.
getKey
(),
PointChangeReasonConstant
.
CREDITEXAMPASSED
.
getKey
())
||
Objects
.
equals
(
e
.
getKey
(),
PointChangeReasonConstant
.
CREDITCALENDARDONE
.
getKey
())){
}
else
if
(
Objects
.
equals
(
e
.
getKey
(),
PointChangeReasonConstant
.
CREDITEXAMDONE
.
getKey
())
||
Objects
.
equals
(
e
.
getKey
(),
PointChangeReasonConstant
.
CREDITSIGNDONE
.
getKey
()))
{
pointDetailVO
.
addPoint
(
e
.
getKey
(),
e
.
getValue
(),
0
);
pointDetailVO
.
addPoint
(
e
.
getKey
(),
e
.
getValue
(),
count
,
0
);
}
else
{
pointDetailVO
.
addPoint
(
e
.
getKey
(),
e
.
getValue
(),
(
point
!=
null
&&
point
>
0
)
?
1
:
0
);
pointDetailVO
.
addPoint
(
e
.
getKey
(),
e
.
getValue
(),
count
,
(
point
!=
null
&&
point
>
0
)
?
1
:
0
);
}
if
(
point
!=
null
&&
point
>
0
){
pointDetailVO
.
setPoint
(
point
+
pointDetailVO
.
getPoint
());
...
...
@@ -471,6 +472,12 @@ public class PointDetailsServiceImpl extends ServiceImpl<PointDetailsMapper, com
return
pointDetailVO
;
}
@Override
public
Integer
getCountToDay
(
Long
accountId
,
Long
siteId
,
String
type
)
{
String
toDay
=
DateUtil
.
formatDate
(
new
Date
());
return
pointDetailsMapper
.
getCountToDay
(
accountId
,
siteId
,
type
,
toDay
);
}
public
static
void
main
(
String
[]
args
)
{
DateTime
yesterday
=
DateUtil
.
yesterday
();
DateTime
beginOfDay
=
DateUtil
.
beginOfDay
(
yesterday
);
...
...
cloud-point/src/main/resources/mapper/PointDetailsMapper.xml
View file @
417dcc5b
...
...
@@ -254,6 +254,14 @@
point_details
where account_id =#{accountId} and site_id =#{siteId}
</select>
<select
id=
"getCountToDay"
resultType=
"java.lang.Integer"
>
select
count(distinct mpp.source_id)
from
mq_point_param mpp
where mpp.account_id =#{accountId} and mpp.site_id =#{siteId} and mpp.event_name =#{type}
and DATE_FORMAT(mpp.create_point_time, '%Y-%m-%d' ) = #{toDay}
</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