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
ac1e0612
Commit
ac1e0612
authored
Oct 22, 2025
by
“Kongxiangkun”
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加积分商城相关代码
parent
593f8d04
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
5 deletions
+27
-5
cloud-point-api/src/main/java/com/yizhi/point/application/feign/PointApiFeignClients.java
+5
-0
cloud-point/src/main/java/com/yizhi/application/controller/PointApiController.java
+1
-1
cloud-point/src/main/java/com/yizhi/application/mapper/PointDetailsMapper.java
+2
-0
cloud-point/src/main/java/com/yizhi/application/service/impl/PointServiceImpl.java
+11
-4
cloud-point/src/main/resources/mapper/PointDetailsMapper.xml
+8
-0
No files found.
cloud-point-api/src/main/java/com/yizhi/point/application/feign/PointApiFeignClients.java
View file @
ac1e0612
...
@@ -38,4 +38,9 @@ public interface PointApiFeignClients {
...
@@ -38,4 +38,9 @@ public interface PointApiFeignClients {
@GetMapping
(
"/api/point/product/list"
)
@GetMapping
(
"/api/point/product/list"
)
List
<
PointProductVo
>
productList
(
@RequestParam
(
name
=
"pageNo"
,
required
=
false
)
Integer
pageNo
,
List
<
PointProductVo
>
productList
(
@RequestParam
(
name
=
"pageNo"
,
required
=
false
)
Integer
pageNo
,
@RequestParam
(
name
=
"pageSize"
,
required
=
false
)
Integer
pageSize
);
@RequestParam
(
name
=
"pageSize"
,
required
=
false
)
Integer
pageSize
);
@GetMapping
(
"/read/finished"
)
boolean
readFinished
(
@RequestParam
(
name
=
"accountId"
,
required
=
false
)
Long
accountId
,
@RequestParam
(
name
=
"infoId"
,
required
=
false
)
String
infoId
);
}
}
cloud-point/src/main/java/com/yizhi/application/controller/PointApiController.java
View file @
ac1e0612
...
@@ -73,7 +73,7 @@ public class PointApiController {
...
@@ -73,7 +73,7 @@ public class PointApiController {
}
}
@GetMapping
(
"/read/finished"
)
@GetMapping
(
"/read/finished"
)
public
boolean
f
inished
(
public
boolean
readF
inished
(
@RequestParam
(
name
=
"accountId"
,
required
=
false
)
Long
accountId
,
@RequestParam
(
name
=
"accountId"
,
required
=
false
)
Long
accountId
,
@RequestParam
(
name
=
"infoId"
,
required
=
false
)
String
infoId
){
@RequestParam
(
name
=
"infoId"
,
required
=
false
)
String
infoId
){
pointService
.
addPoint
(
accountId
,
"point_read"
,
infoId
);
pointService
.
addPoint
(
accountId
,
"point_read"
,
infoId
);
...
...
cloud-point/src/main/java/com/yizhi/application/mapper/PointDetailsMapper.java
View file @
ac1e0612
...
@@ -104,4 +104,6 @@ public interface PointDetailsMapper extends BaseMapper<PointDetails> {
...
@@ -104,4 +104,6 @@ public interface PointDetailsMapper extends BaseMapper<PointDetails> {
Integer
getCountToDay
(
@Param
(
"accountId"
)
Long
accountId
,
@Param
(
"siteId"
)
Long
siteId
,
@Param
(
"type"
)
String
type
,
@Param
(
"toDay"
)
String
toDay
);
Integer
getCountToDay
(
@Param
(
"accountId"
)
Long
accountId
,
@Param
(
"siteId"
)
Long
siteId
,
@Param
(
"type"
)
String
type
,
@Param
(
"toDay"
)
String
toDay
);
List
<
PointDetailListVO
>
getPointDetailsList
(
@Param
(
"page"
)
Page
<
PointDetailListVO
>
page
,
@Param
(
"accountId"
)
Long
accountId
);
List
<
PointDetailListVO
>
getPointDetailsList
(
@Param
(
"page"
)
Page
<
PointDetailListVO
>
page
,
@Param
(
"accountId"
)
Long
accountId
);
int
getCountTodayByLearnType
(
@Param
(
"accountId"
)
Long
accountId
,
@Param
(
"learnType"
)
String
learnType
);
}
}
cloud-point/src/main/java/com/yizhi/application/service/impl/PointServiceImpl.java
View file @
ac1e0612
...
@@ -9,6 +9,7 @@ import com.yizhi.application.domain.Point;
...
@@ -9,6 +9,7 @@ import com.yizhi.application.domain.Point;
import
com.yizhi.application.domain.PointDetails
;
import
com.yizhi.application.domain.PointDetails
;
import
com.yizhi.application.domain.PointTypeStrategy
;
import
com.yizhi.application.domain.PointTypeStrategy
;
import
com.yizhi.application.domain.PointUser
;
import
com.yizhi.application.domain.PointUser
;
import
com.yizhi.application.mapper.PointDetailsMapper
;
import
com.yizhi.application.mapper.PointMapper
;
import
com.yizhi.application.mapper.PointMapper
;
import
com.yizhi.application.mapper.PointProductMapper
;
import
com.yizhi.application.mapper.PointProductMapper
;
import
com.yizhi.application.mapper.PointUserMapper
;
import
com.yizhi.application.mapper.PointUserMapper
;
...
@@ -51,6 +52,8 @@ public class PointServiceImpl extends ServiceImpl<PointMapper, Point> implements
...
@@ -51,6 +52,8 @@ public class PointServiceImpl extends ServiceImpl<PointMapper, Point> implements
private
PointUserMapper
pointUserMapper
;
private
PointUserMapper
pointUserMapper
;
@Autowired
@Autowired
private
PointProductMapper
pointProductMapper
;
private
PointProductMapper
pointProductMapper
;
@Autowired
private
PointDetailsMapper
pointDetailsMapper
;
@Override
@Override
public
Point
pointList
(
Long
companyId
,
Long
siteId
)
{
public
Point
pointList
(
Long
companyId
,
Long
siteId
)
{
...
@@ -95,7 +98,7 @@ public class PointServiceImpl extends ServiceImpl<PointMapper, Point> implements
...
@@ -95,7 +98,7 @@ public class PointServiceImpl extends ServiceImpl<PointMapper, Point> implements
Long
siteId
=
ContextHolder
.
get
().
getSiteId
();
Long
siteId
=
ContextHolder
.
get
().
getSiteId
();
String
accountName
=
ContextHolder
.
get
().
getAccountName
();
String
accountName
=
ContextHolder
.
get
().
getAccountName
();
//执行积分奖励策略进行相应的业务校验
//执行积分奖励策略进行相应的业务校验
PointTypeStrategy
strategy
=
getPointByType
(
type
,
accountId
);
PointTypeStrategy
strategy
=
getPointByType
(
type
,
accountId
,
sourceId
);
log
.
info
(
"获取赠送积分策略:{}"
,
JSONUtil
.
toJsonStr
(
strategy
));
log
.
info
(
"获取赠送积分策略:{}"
,
JSONUtil
.
toJsonStr
(
strategy
));
if
(
strategy
!=
null
)
{
if
(
strategy
!=
null
)
{
PointUser
pu
=
new
PointUser
();
PointUser
pu
=
new
PointUser
();
...
@@ -146,7 +149,7 @@ public class PointServiceImpl extends ServiceImpl<PointMapper, Point> implements
...
@@ -146,7 +149,7 @@ public class PointServiceImpl extends ServiceImpl<PointMapper, Point> implements
}
}
}
}
public
PointTypeStrategy
getPointByType
(
String
type
,
Long
accountId
){
public
PointTypeStrategy
getPointByType
(
String
type
,
Long
accountId
,
String
sourceId
){
PointTypeStrategy
strategy
=
null
;
PointTypeStrategy
strategy
=
null
;
if
(
type
.
equals
(
PointTypeEnum
.
LOGIN
.
getKey
())){
if
(
type
.
equals
(
PointTypeEnum
.
LOGIN
.
getKey
())){
//查询当天是否首次登录,奖励积分
//查询当天是否首次登录,奖励积分
...
@@ -157,13 +160,17 @@ public class PointServiceImpl extends ServiceImpl<PointMapper, Point> implements
...
@@ -157,13 +160,17 @@ public class PointServiceImpl extends ServiceImpl<PointMapper, Point> implements
pd
.
setLearnSource
(
date
);
pd
.
setLearnSource
(
date
);
EntityWrapper
<
PointDetails
>
wrapper
=
new
EntityWrapper
<
PointDetails
>(
pd
);
EntityWrapper
<
PointDetails
>
wrapper
=
new
EntityWrapper
<
PointDetails
>(
pd
);
int
cnt
=
pointDetailsService
.
selectCount
(
wrapper
);
int
cnt
=
pointDetailsService
.
selectCount
(
wrapper
);
log
.
info
(
"赠送积分判断是否为首次登录:{}"
,
cnt
);
log
.
info
(
"
登录
赠送积分判断是否为首次登录:{}"
,
cnt
);
if
(
cnt
<=
0
)
{
if
(
cnt
<=
0
)
{
return
new
PointTypeStrategy
(
PointTypeEnum
.
LOGIN
,
date
);
return
new
PointTypeStrategy
(
PointTypeEnum
.
LOGIN
,
date
);
}
}
}
}
if
(
type
.
equals
(
PointTypeEnum
.
READ
.
getKey
())){
if
(
type
.
equals
(
PointTypeEnum
.
READ
.
getKey
())){
return
null
;
int
cnt
=
pointDetailsMapper
.
getCountTodayByLearnType
(
accountId
,
type
);
log
.
info
(
"阅读文章 赠送积分判断当日是否超过次数:{}"
,
cnt
);
if
(
cnt
<=
5
){
return
new
PointTypeStrategy
(
PointTypeEnum
.
READ
,
sourceId
);
}
}
}
if
(
type
.
equals
(
PointTypeEnum
.
PUBLICATION
.
getKey
())){
if
(
type
.
equals
(
PointTypeEnum
.
PUBLICATION
.
getKey
())){
return
null
;
return
null
;
...
...
cloud-point/src/main/resources/mapper/PointDetailsMapper.xml
View file @
ac1e0612
...
@@ -268,4 +268,12 @@
...
@@ -268,4 +268,12 @@
where account_id = #{accountId} order by time desc
where account_id = #{accountId} order by time desc
</select>
</select>
<select
id=
"getCountTodayByLearnType"
resultType=
"java.lang.Integer"
>
select count(*) from point_details where
account_id = #{accountId}
and learn_type =#{learnType}
and DATE_FORMAT(time, '%Y-%m-%d' ) = DATE_FORMAT(now(), '%Y-%m-%d')
</select>
</mapper>
</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