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
842aac7e
Commit
842aac7e
authored
Oct 16, 2025
by
“Kongxiangkun”
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加积分商城相关代码
parent
34a806ff
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
2 deletions
+14
-2
cloud-point/src/main/java/com/yizhi/application/controller/PointRedisController.java
+9
-2
cloud-point/src/main/java/com/yizhi/application/service/impl/PointServiceImpl.java
+5
-0
No files found.
cloud-point/src/main/java/com/yizhi/application/controller/PointRedisController.java
View file @
842aac7e
...
...
@@ -7,11 +7,12 @@ import com.yizhi.application.redis.RedisUtils;
import
com.yizhi.application.service.MqPointParamService
;
import
com.yizhi.application.service.PointService
;
import
com.yizhi.point.application.vo.PointParamVO
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
@Slf4j
@RestController
public
class
PointRedisController
{
...
...
@@ -46,7 +47,13 @@ public class PointRedisController {
@RequestParam
(
name
=
"type"
,
required
=
false
)
String
type
,
@RequestParam
(
name
=
"accountId"
,
required
=
false
)
Long
accountId
,
@RequestParam
(
name
=
"sourceId"
,
required
=
false
)
String
sourceId
)
{
pointService
.
addPoint
(
accountId
,
type
,
sourceId
);
try
{
log
.
info
(
"增加积分新接口入参 type:{}, accountId:{}, sourceId:{}"
,
type
,
accountId
,
sourceId
);
pointService
.
addPoint
(
accountId
,
type
,
sourceId
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
log
.
error
(
"增加积分新接口发生异常:{}"
,
e
.
getMessage
());
}
}
}
cloud-point/src/main/java/com/yizhi/application/service/impl/PointServiceImpl.java
View file @
842aac7e
package
com
.
yizhi
.
application
.
service
.
impl
;
import
cn.hutool.json.JSONUtil
;
import
com.baomidou.mybatisplus.mapper.EntityWrapper
;
import
com.baomidou.mybatisplus.service.impl.ServiceImpl
;
import
com.yizhi.application.constant.PointTypeEnum
;
...
...
@@ -14,6 +15,7 @@ import com.yizhi.application.service.PointService;
import
com.yizhi.application.service.PointUserService
;
import
com.yizhi.core.application.context.ContextHolder
;
import
com.yizhi.util.application.date.DateUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -27,6 +29,7 @@ import java.util.Date;
* @author bob123
* @since 2018-04-20
*/
@Slf4j
@Service
public
class
PointServiceImpl
extends
ServiceImpl
<
PointMapper
,
Point
>
implements
PointService
{
...
...
@@ -83,6 +86,7 @@ public class PointServiceImpl extends ServiceImpl<PointMapper, Point> implements
String
accountName
=
ContextHolder
.
get
().
getAccountName
();
//执行积分奖励策略进行相应的业务校验
PointTypeStrategy
strategy
=
getPointByType
(
type
,
accountId
);
log
.
info
(
"获取赠送积分策略:{}"
,
JSONUtil
.
toJsonStr
(
strategy
));
if
(
strategy
!=
null
)
{
PointUser
pu
=
new
PointUser
();
pu
.
setUserId
(
accountId
);
...
...
@@ -143,6 +147,7 @@ public class PointServiceImpl extends ServiceImpl<PointMapper, Point> implements
pd
.
setLearnSource
(
date
);
EntityWrapper
<
PointDetails
>
wrapper
=
new
EntityWrapper
<
PointDetails
>(
pd
);
int
cnt
=
pointDetailsService
.
selectCount
(
wrapper
);
log
.
info
(
"赠送积分判断是否为首次登录:{}"
,
cnt
);
if
(
cnt
<=
0
)
{
return
new
PointTypeStrategy
(
PointTypeEnum
.
LOGIN
,
date
);
}
...
...
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