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
ac848f72
Commit
ac848f72
authored
Mar 10, 2025
by
阳浪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
我的积分
parent
ccc52922
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
147 additions
and
5 deletions
+147
-5
cloud-point-api/src/main/java/com/yizhi/point/application/feign/PointDetailsFeignClients.java
+6
-0
cloud-point-api/src/main/java/com/yizhi/point/application/vo/PointDetailVO.java
+39
-0
cloud-point-api/src/main/java/com/yizhi/point/application/vo/PointVo.java
+23
-0
cloud-point/src/main/java/com/yizhi/application/constant/PointChangeReasonConstant.java
+5
-5
cloud-point/src/main/java/com/yizhi/application/controller/PointDetailsController.java
+7
-0
cloud-point/src/main/java/com/yizhi/application/mapper/PointDetailsMapper.java
+4
-0
cloud-point/src/main/java/com/yizhi/application/service/PointDetailsService.java
+3
-0
cloud-point/src/main/java/com/yizhi/application/service/impl/PointDetailsServiceImpl.java
+43
-0
cloud-point/src/main/resources/mapper/PointDetailsMapper.xml
+17
-0
No files found.
cloud-point-api/src/main/java/com/yizhi/point/application/feign/PointDetailsFeignClients.java
View file @
ac848f72
package
com
.
yizhi
.
point
.
application
.
feign
;
package
com
.
yizhi
.
point
.
application
.
feign
;
import
com.yizhi.point.application.vo.PointDetailVO
;
import
com.yizhi.point.application.vo.domain.PointDetailsVo
;
import
com.yizhi.point.application.vo.domain.PointDetailsVo
;
import
com.yizhi.point.application.vo.PointImportVO
;
import
com.yizhi.point.application.vo.PointImportVO
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.cloud.openfeign.FeignClient
;
...
@@ -28,6 +29,11 @@ public interface PointDetailsFeignClients {
...
@@ -28,6 +29,11 @@ public interface PointDetailsFeignClients {
@RequestParam
(
"pageNo"
)
Integer
pageNo
,
@RequestParam
(
"pageSize"
)
Integer
pageSize
,
@RequestParam
(
"companyId"
)
Long
companyId
,
@RequestParam
(
"pageNo"
)
Integer
pageNo
,
@RequestParam
(
"pageSize"
)
Integer
pageSize
,
@RequestParam
(
"companyId"
)
Long
companyId
,
@RequestParam
(
"siteId"
)
Long
siteId
,
@RequestParam
(
"orgId"
)
Long
orgId
);
@RequestParam
(
"siteId"
)
Long
siteId
,
@RequestParam
(
"orgId"
)
Long
orgId
);
@GetMapping
(
"/api/point/detail/getPointDetail"
)
PointDetailVO
getPointDetail
(
@RequestParam
(
"accountId"
)
Long
accountId
,
@RequestParam
(
"siteId"
)
Long
siteId
);
@GetMapping
(
"/api/point/detail/countList"
)
@GetMapping
(
"/api/point/detail/countList"
)
Integer
queryPiont
(
@RequestParam
(
"userId"
)
Long
userId
,
@RequestParam
(
value
=
"companyId"
,
required
=
false
)
Long
companyId
,
Integer
queryPiont
(
@RequestParam
(
"userId"
)
Long
userId
,
@RequestParam
(
value
=
"companyId"
,
required
=
false
)
Long
companyId
,
@RequestParam
(
"siteId"
)
Long
siteId
,
@RequestParam
(
name
=
"orgId"
,
required
=
false
)
Long
orgId
);
@RequestParam
(
"siteId"
)
Long
siteId
,
@RequestParam
(
name
=
"orgId"
,
required
=
false
)
Long
orgId
);
...
...
cloud-point-api/src/main/java/com/yizhi/point/application/vo/PointDetailVO.java
0 → 100644
View file @
ac848f72
package
com
.
yizhi
.
point
.
application
.
vo
;
import
com.baomidou.mybatisplus.annotations.TableField
;
import
com.google.common.collect.Lists
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
org.springframework.util.CollectionUtils
;
import
java.util.List
;
/**
* com.yizhi.point.application.vo
*
* @author yanglang
* @create 2025-03-10 10:35:16
*/
@Data
public
class
PointDetailVO
{
@ApiModelProperty
(
value
=
"积分"
)
private
Integer
point
;
@ApiModelProperty
(
value
=
"当前积分的总量"
)
private
String
amount
;
@ApiModelProperty
(
value
=
"积分活动分类"
)
private
List
<
PointVo
>
pointVoList
;
public
void
addPoint
(
String
learnType
,
String
learnName
,
Integer
flag
){
PointVo
pointVo
=
new
PointVo
();
pointVo
.
setFlag
(
flag
);
pointVo
.
setLearnName
(
learnName
);
pointVo
.
setLearnType
(
learnType
);
if
(
CollectionUtils
.
isEmpty
(
this
.
pointVoList
)){
this
.
pointVoList
=
Lists
.
newArrayList
();
}
this
.
pointVoList
.
add
(
pointVo
);
}
}
cloud-point-api/src/main/java/com/yizhi/point/application/vo/PointVo.java
0 → 100644
View file @
ac848f72
package
com
.
yizhi
.
point
.
application
.
vo
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
* com.yizhi.point.application.vo
*
* @author yanglang
* @create 2025-03-10 12:54:32
*/
@Data
public
class
PointVo
{
@ApiModelProperty
(
value
=
"今日是否完成:1-是,0-否"
)
private
Integer
flag
;
@ApiModelProperty
(
value
=
"学习活动类型"
)
private
String
learnType
;
@ApiModelProperty
(
value
=
"学习活动名称"
)
private
String
learnName
;
}
cloud-point/src/main/java/com/yizhi/application/constant/PointChangeReasonConstant.java
View file @
ac848f72
...
@@ -2,9 +2,9 @@ package com.yizhi.application.constant;
...
@@ -2,9 +2,9 @@ package com.yizhi.application.constant;
public
enum
PointChangeReasonConstant
{
public
enum
PointChangeReasonConstant
{
CREDITEXAMDONE
(
"CreditExamDone"
,
"
考试阅卷通过
"
),
CREDITEXAMDONE
(
"CreditExamDone"
,
"
培训测试
"
),
CREDITCOURSEDONE1
(
"CreditCourseDone1"
,
"
课程学习完成
"
),
CREDITCOURSEDONE1
(
"CreditCourseDone1"
,
"
培训测试
"
),
CREDITEXAMPASSED
(
"CreditExamPassed"
,
"
考试通过
"
),
CREDITEXAMPASSED
(
"CreditExamPassed"
,
"
培训测试
"
),
CREDITRESEARCHDONE
(
"CreditResearchDone"
,
"投票通过"
),
CREDITRESEARCHDONE
(
"CreditResearchDone"
,
"投票通过"
),
CREDITCOURSECHAPTERDONE
(
"CreditCourseChapterDone"
,
"课程章节完成"
),
CREDITCOURSECHAPTERDONE
(
"CreditCourseChapterDone"
,
"课程章节完成"
),
CREDITASSIGNMENTPASSED
(
"CreditAssignmentPassed"
,
"作业通过"
),
CREDITASSIGNMENTPASSED
(
"CreditAssignmentPassed"
,
"作业通过"
),
...
@@ -16,8 +16,8 @@ public enum PointChangeReasonConstant {
...
@@ -16,8 +16,8 @@ public enum PointChangeReasonConstant {
CREDITCASELIBRARYDONE
(
"CreditCaseLibraryDone"
,
"案例活动审核通过"
),
CREDITCASELIBRARYDONE
(
"CreditCaseLibraryDone"
,
"案例活动审核通过"
),
CREDITFORUMINVITATION
(
"CreditForumInvitation"
,
"发布论坛帖子发放积分"
),
CREDITFORUMINVITATION
(
"CreditForumInvitation"
,
"发布论坛帖子发放积分"
),
CREDITFORUMCOMMENT
(
"CreditForumComment"
,
"发布论坛回复发放积分"
),
CREDITFORUMCOMMENT
(
"CreditForumComment"
,
"发布论坛回复发放积分"
),
CREDITCALENDARDONE
(
"CreditClendarDone"
,
"
签到打卡成功
"
),
CREDITCALENDARDONE
(
"CreditClendarDone"
,
"
参加活动
"
),
CREDITSIGNDONE
(
"CreditSignDone"
,
"
项目签到成功
"
),
CREDITSIGNDONE
(
"CreditSignDone"
,
"
参加活动
"
),
POINT_LOGIN
(
"point_login"
,
"登录"
),
POINT_LOGIN
(
"point_login"
,
"登录"
),
POINT_READ
(
"point_read"
,
"阅读文章"
),
POINT_READ
(
"point_read"
,
"阅读文章"
),
POINT_DRAFT
(
"point_draft"
,
"我要投稿"
),
POINT_DRAFT
(
"point_draft"
,
"我要投稿"
),
...
...
cloud-point/src/main/java/com/yizhi/application/controller/PointDetailsController.java
View file @
ac848f72
...
@@ -11,6 +11,7 @@ import cn.hutool.core.date.DateTime;
...
@@ -11,6 +11,7 @@ import cn.hutool.core.date.DateTime;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.date.DateUtil
;
import
com.yizhi.application.domain.PointDetails
;
import
com.yizhi.application.domain.PointDetails
;
import
com.yizhi.application.service.PointDetailsService
;
import
com.yizhi.application.service.PointDetailsService
;
import
com.yizhi.point.application.vo.PointDetailVO
;
import
com.yizhi.point.application.vo.PointImportVO
;
import
com.yizhi.point.application.vo.PointImportVO
;
import
com.yizhi.point.application.vo.domain.PointDetailsVo
;
import
com.yizhi.point.application.vo.domain.PointDetailsVo
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
...
@@ -49,6 +50,12 @@ public class PointDetailsController {
...
@@ -49,6 +50,12 @@ public class PointDetailsController {
return
pointDetailsService
.
pointList
(
year
,
type
,
accountId
,
pageNo
,
pageSize
,
companyId
,
siteId
,
orgId
);
return
pointDetailsService
.
pointList
(
year
,
type
,
accountId
,
pageNo
,
pageSize
,
companyId
,
siteId
,
orgId
);
}
}
@GetMapping
(
"/getPointDetail"
)
public
PointDetailVO
getPointDetail
(
@RequestParam
(
"accountId"
)
Long
accountId
,
@RequestParam
(
"siteId"
)
Long
siteId
)
{
return
pointDetailsService
.
getPointDetail
(
accountId
,
siteId
);
}
@GetMapping
(
"/countList"
)
@GetMapping
(
"/countList"
)
public
Integer
queryPiont
(
@RequestParam
(
name
=
"userId"
,
required
=
false
)
Long
userId
,
@RequestParam
(
name
=
"companyId"
,
required
=
false
)
Long
companyId
,
public
Integer
queryPiont
(
@RequestParam
(
name
=
"userId"
,
required
=
false
)
Long
userId
,
@RequestParam
(
name
=
"companyId"
,
required
=
false
)
Long
companyId
,
@RequestParam
(
"siteId"
)
Long
siteId
,
@RequestParam
(
name
=
"orgId"
,
required
=
false
)
Long
orgId
)
{
@RequestParam
(
"siteId"
)
Long
siteId
,
@RequestParam
(
name
=
"orgId"
,
required
=
false
)
Long
orgId
)
{
...
...
cloud-point/src/main/java/com/yizhi/application/mapper/PointDetailsMapper.java
View file @
ac848f72
...
@@ -95,4 +95,8 @@ public interface PointDetailsMapper extends BaseMapper<PointDetails> {
...
@@ -95,4 +95,8 @@ public interface PointDetailsMapper extends BaseMapper<PointDetails> {
Integer
getPointCountByAccountId
(
@Param
(
"accountId"
)
Long
accountId
,
Integer
getPointCountByAccountId
(
@Param
(
"accountId"
)
Long
accountId
,
@Param
(
"companyId"
)
Long
companyId
,
@Param
(
"companyId"
)
Long
companyId
,
@Param
(
"siteId"
)
Long
siteId
);
@Param
(
"siteId"
)
Long
siteId
);
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
);
}
}
cloud-point/src/main/java/com/yizhi/application/service/PointDetailsService.java
View file @
ac848f72
...
@@ -3,6 +3,7 @@ package com.yizhi.application.service;
...
@@ -3,6 +3,7 @@ package com.yizhi.application.service;
import
com.baomidou.mybatisplus.plugins.Page
;
import
com.baomidou.mybatisplus.plugins.Page
;
import
com.baomidou.mybatisplus.service.IService
;
import
com.baomidou.mybatisplus.service.IService
;
import
com.yizhi.application.domain.PointDetails
;
import
com.yizhi.application.domain.PointDetails
;
import
com.yizhi.point.application.vo.PointDetailVO
;
import
com.yizhi.point.application.vo.PointDetailsVO
;
import
com.yizhi.point.application.vo.PointDetailsVO
;
import
com.yizhi.point.application.vo.PointImportVO
;
import
com.yizhi.point.application.vo.PointImportVO
;
import
com.yizhi.point.application.vo.domain.PointDetailsVo
;
import
com.yizhi.point.application.vo.domain.PointDetailsVo
;
...
@@ -24,6 +25,8 @@ public interface PointDetailsService extends IService<PointDetails> {
...
@@ -24,6 +25,8 @@ public interface PointDetailsService extends IService<PointDetails> {
Map
<
String
,
Object
>
pointList
(
String
year
,
String
type
,
Long
accountId
,
Integer
pageNo
,
Integer
pageSize
,
Long
companyId
,
Map
<
String
,
Object
>
pointList
(
String
year
,
String
type
,
Long
accountId
,
Integer
pageNo
,
Integer
pageSize
,
Long
companyId
,
Long
siteId
,
Long
orgId
);
Long
siteId
,
Long
orgId
);
PointDetailVO
getPointDetail
(
Long
accountId
,
Long
siteId
);
Integer
queryPiont
(
Long
userId
,
Long
companyId
,
Long
siteId
,
Long
orgId
);
Integer
queryPiont
(
Long
userId
,
Long
companyId
,
Long
siteId
,
Long
orgId
);
Page
<
PointDetailsVO
>
getManagePointDetails
(
Integer
pageNo
,
Integer
pageSize
,
Long
activityId
,
Page
<
PointDetailsVO
>
getManagePointDetails
(
Integer
pageNo
,
Integer
pageSize
,
Long
activityId
,
...
...
cloud-point/src/main/java/com/yizhi/application/service/impl/PointDetailsServiceImpl.java
View file @
ac848f72
...
@@ -4,6 +4,7 @@ import cn.hutool.core.date.DateTime;
...
@@ -4,6 +4,7 @@ import cn.hutool.core.date.DateTime;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.date.DateUtil
;
import
com.baomidou.mybatisplus.plugins.Page
;
import
com.baomidou.mybatisplus.plugins.Page
;
import
com.baomidou.mybatisplus.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.service.impl.ServiceImpl
;
import
com.google.common.collect.Lists
;
import
com.yizhi.application.constant.PointChangeReasonConstant
;
import
com.yizhi.application.constant.PointChangeReasonConstant
;
import
com.yizhi.application.domain.PointDetails
;
import
com.yizhi.application.domain.PointDetails
;
import
com.yizhi.application.domain.PointUser
;
import
com.yizhi.application.domain.PointUser
;
...
@@ -14,8 +15,10 @@ import com.yizhi.application.orm.id.IdGenerator;
...
@@ -14,8 +15,10 @@ import com.yizhi.application.orm.id.IdGenerator;
import
com.yizhi.application.repository.PointDetailsRepository
;
import
com.yizhi.application.repository.PointDetailsRepository
;
import
com.yizhi.application.service.PointDetailsService
;
import
com.yizhi.application.service.PointDetailsService
;
import
com.yizhi.application.service.PointUserService
;
import
com.yizhi.application.service.PointUserService
;
import
com.yizhi.point.application.vo.PointDetailVO
;
import
com.yizhi.point.application.vo.PointDetailsVO
;
import
com.yizhi.point.application.vo.PointDetailsVO
;
import
com.yizhi.point.application.vo.PointImportVO
;
import
com.yizhi.point.application.vo.PointImportVO
;
import
com.yizhi.point.application.vo.PointVo
;
import
com.yizhi.point.application.vo.domain.PointDetailsVo
;
import
com.yizhi.point.application.vo.domain.PointDetailsVo
;
import
lombok.extern.log4j.Log4j2
;
import
lombok.extern.log4j.Log4j2
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.commons.lang.StringUtils
;
...
@@ -428,6 +431,46 @@ public class PointDetailsServiceImpl extends ServiceImpl<PointDetailsMapper, com
...
@@ -428,6 +431,46 @@ public class PointDetailsServiceImpl extends ServiceImpl<PointDetailsMapper, com
return
list
;
return
list
;
}
}
@Override
public
PointDetailVO
getPointDetail
(
Long
accountId
,
Long
siteId
){
PointDetailVO
pointDetailVO
=
new
PointDetailVO
();
List
<
String
>
pointTypeList
=
Lists
.
newArrayList
();
pointTypeList
.
add
(
"登录"
);
pointTypeList
.
add
(
"阅读文章"
);
pointTypeList
.
add
(
"我要投稿"
);
pointTypeList
.
add
(
"发表评论"
);
pointTypeList
.
add
(
"参加活动"
);
pointTypeList
.
add
(
"培训测试"
);
pointDetailVO
.
setPoint
(
0
);
String
toDay
=
DateUtil
.
formatDate
(
new
Date
());
Arrays
.
stream
(
PointChangeReasonConstant
.
values
()).
forEach
(
e
->{
if
(
pointTypeList
.
contains
(
e
.
getValue
())){
Integer
point
=
pointDetailsMapper
.
selectPointVo
(
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
);
}
else
{
pointDetailVO
.
addPoint
(
e
.
getKey
(),
e
.
getValue
(),
(
point
!=
null
&&
point
>
0
)
?
1
:
0
);
}
if
(
point
!=
null
&&
point
>
0
){
pointDetailVO
.
setPoint
(
point
+
pointDetailVO
.
getPoint
());
}
}
});
Integer
point
=
pointDetailsMapper
.
getAmount
(
accountId
,
siteId
);
if
(
point
!=
null
){
pointDetailVO
.
setPoint
(
point
);
}
else
{
pointDetailVO
.
setPoint
(
0
);
}
return
pointDetailVO
;
}
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
DateTime
yesterday
=
DateUtil
.
yesterday
();
DateTime
yesterday
=
DateUtil
.
yesterday
();
DateTime
beginOfDay
=
DateUtil
.
beginOfDay
(
yesterday
);
DateTime
beginOfDay
=
DateUtil
.
beginOfDay
(
yesterday
);
...
...
cloud-point/src/main/resources/mapper/PointDetailsMapper.xml
View file @
ac848f72
...
@@ -237,6 +237,23 @@
...
@@ -237,6 +237,23 @@
and site_id = #{siteId}
and site_id = #{siteId}
</if>
</if>
</select>
</select>
<select
id=
"selectPointVo"
resultType=
"java.lang.Integer"
>
select
sum(pd.`point`)
from
point_details pd
inner join mq_point_param mpp on
pd.learn_source_id = mpp.source_id
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>
<select
id=
"getAmount"
resultType=
"java.lang.Integer"
>
select
sum(`point`)
from
point_details
where account_id =#{accountId} and site_id =#{siteId}
</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