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
3bf55899
Commit
3bf55899
authored
Jan 16, 2025
by
阳浪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新积分排名
parent
982f12f6
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
144 additions
and
2 deletions
+144
-2
cloud-point-api/src/main/java/com/yizhi/point/application/feign/PointUserFeignClients.java
+3
-0
cloud-point-api/src/main/java/com/yizhi/point/application/vo/PointUserParamVO.java
+8
-0
cloud-point/src/main/java/com/yizhi/application/controller/PointUserController.java
+5
-0
cloud-point/src/main/java/com/yizhi/application/mapper/PointUserMapper.java
+5
-1
cloud-point/src/main/java/com/yizhi/application/service/PointUserService.java
+2
-0
cloud-point/src/main/java/com/yizhi/application/service/impl/PointUserServiceImpl.java
+24
-0
cloud-point/src/main/resources/mapper/PointUserMapper.xml
+97
-1
No files found.
cloud-point-api/src/main/java/com/yizhi/point/application/feign/PointUserFeignClients.java
View file @
3bf55899
...
...
@@ -28,6 +28,9 @@ public interface PointUserFeignClients {
@GetMapping
(
"/manage/point/user/rank/list"
)
Page
<
PointUserListVO
>
userRankList
(
@RequestBody
PointUserParamVO
vo
);
@GetMapping
(
"/manage/point/new/user/rank/list"
)
Page
<
PointUserListVO
>
newUserRankList
(
@RequestBody
PointUserParamVO
vo
);
@GetMapping
(
"/manage/point/user/rank/list/export"
)
List
<
PointUserListVO
>
userRankListExport
(
@RequestBody
PointUserParamVO
vo
);
...
...
cloud-point-api/src/main/java/com/yizhi/point/application/vo/PointUserParamVO.java
View file @
3bf55899
...
...
@@ -39,4 +39,12 @@ public class PointUserParamVO {
private
Date
endAt
;
@ApiModelProperty
(
"时间类型:1年,2月,3日"
)
private
Integer
dateType
;
private
String
dateString
;
@ApiModelProperty
(
"显示名称:1部门,2用户"
)
private
Integer
nameType
;
}
cloud-point/src/main/java/com/yizhi/application/controller/PointUserController.java
View file @
3bf55899
...
...
@@ -59,6 +59,11 @@ public class PointUserController {
}
@GetMapping
(
"/new/rank/list"
)
public
Page
<
PointUserListVO
>
newUserRankList
(
@RequestBody
PointUserParamVO
vo
)
{
return
pointUserService
.
newUserRankList
(
vo
);
}
@GetMapping
(
"/rank/list/export"
)
public
List
<
PointUserListVO
>
userRankListExport
(
@RequestBody
PointUserParamVO
vo
)
{
return
pointUserService
.
userRankListExport
(
vo
);
...
...
cloud-point/src/main/java/com/yizhi/application/mapper/PointUserMapper.java
View file @
3bf55899
...
...
@@ -31,7 +31,11 @@ public interface PointUserMapper extends BaseMapper<PointUser> {
Integer
acquirePoint
(
@Param
(
"accountId"
)
Long
accountId
,
@Param
(
"learnSourceId"
)
Long
learnSourceId
,
@Param
(
"createTime"
)
String
createTime
);
Timestamp
getStartDate
();
List
<
PointUserListVO
>
getNewUserRankList
(
@Param
(
"vo"
)
PointUserParamVO
vo
);
Integer
getNewUserRankCount
(
@Param
(
"vo"
)
PointUserParamVO
vo
);
List
<
TotalPointVO
>
totalPoint
(
@Param
(
"siteIds"
)
List
<
Long
>
siteIds
,
@Param
(
"startDate"
)
String
startDate
,
@Param
(
"endDate"
)
String
endDate
);
}
cloud-point/src/main/java/com/yizhi/application/service/PointUserService.java
View file @
3bf55899
...
...
@@ -24,6 +24,8 @@ public interface PointUserService extends IService<PointUser> {
Page
<
PointUserListVO
>
userRankList
(
PointUserParamVO
vo
);
Page
<
PointUserListVO
>
newUserRankList
(
PointUserParamVO
vo
);
List
<
PointUserListVO
>
userRankListExport
(
PointUserParamVO
vo
);
Integer
acquirePoint
(
Long
accountId
,
Long
learnSourceId
,
String
createTime
);
...
...
cloud-point/src/main/java/com/yizhi/application/service/impl/PointUserServiceImpl.java
View file @
3bf55899
...
...
@@ -17,6 +17,7 @@ import com.yizhi.system.application.vo.HQAccountInManageParam;
import
com.yizhi.system.application.vo.ReportAccountRespInManageVO
;
import
com.yizhi.system.application.vo.ReportAccountRespVO
;
import
com.yizhi.system.application.vo.ReportRangeAccountReqVO
;
import
com.yizhi.util.application.date.DateUtil
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -59,6 +60,29 @@ public class PointUserServiceImpl extends ServiceImpl<PointUserMapper, PointUser
}
@Override
public
Page
<
PointUserListVO
>
newUserRankList
(
PointUserParamVO
vo
)
{
Integer
start
=(
vo
.
getPageNo
()-
1
)*
vo
.
getPageSize
();
Integer
end
=
vo
.
getPageNo
()*
vo
.
getPageSize
();
Page
<
PointUserListVO
>
page
=
new
Page
<
PointUserListVO
>(
vo
.
getPageNo
(),
vo
.
getPageSize
());
String
date
=
DateUtil
.
toDay
(
new
Date
());
String
[]
dateArrays
=
date
.
split
(
"-"
);
vo
.
setDateString
(
date
);
if
(
Objects
.
equals
(
vo
.
getDateType
(),
1
)){
vo
.
setDateString
(
dateArrays
[
0
]);
}
if
(
Objects
.
equals
(
vo
.
getDateType
(),
2
)){
vo
.
setDateString
(
dateArrays
[
0
]+
"-"
+
dateArrays
[
1
]);
}
vo
.
setPageNo
(
start
);
vo
.
setPageSize
(
end
);
List
<
PointUserListVO
>
pointUserListVOS
=
pointUserMapper
.
getNewUserRankList
(
vo
);
Integer
size
=
pointUserMapper
.
getNewUserRankCount
(
vo
);
page
.
setRecords
(
pointUserListVOS
);
page
.
setSize
(
size
);
return
page
;
}
@Override
public
Page
<
PointUserListVO
>
userRankList
(
PointUserParamVO
vo
)
{
...
...
cloud-point/src/main/resources/mapper/PointUserMapper.xml
View file @
3bf55899
...
...
@@ -34,8 +34,56 @@
AS companyId, org_id AS orgId, site_id AS
siteId
</sql>
<select
id=
"getNewUserRankList"
resultType=
"com.yizhi.point.application.vo.PointUserListVO"
>
select
<if
test=
"vo.nameType!=null and vo.nameType==1"
>
aug.name as name,
</if>
<if
test=
"vo.nameType!=null and vo.nameType==1"
>
a.full_name as name,
</if>
sum(pu.total_point) as totalPoint
from
cloud_point.point_user pu
left join cloud_system.account a on
pu.user_id = a.id
left join (
select
aug.id,
aug.name,
aug.description,
aug.site_id,
aug.company_id,
aar.account_id
from
cloud_system.authz_user_group aug
inner join cloud_system.authz_role_user_group arug on
aug.id = arug.user_group_id
inner join cloud_system.authz_account_role aar on
arug.role_id = aar.role_id) aug on
a.id = aug.account_id
where
pu.state = 1
<if
test=
"vo.dateType!=null and vo.dateType==1"
>
and DATE_FORMAT(pu.create_time, '%Y') = #{vo.dateString}
</if>
<if
test=
"vo.dateType!=null and vo.dateType==2"
>
and DATE_FORMAT(pu.create_time, '%Y-%m') = #{vo.dateString}
</if>
<if
test=
"vo.dateType!=null and vo.dateType==3"
>
and DATE_FORMAT(pu.create_time, '%Y-%m-%d') = #{vo.dateString}
</if>
<if
test=
"vo.nameType!=null and vo.nameType==1"
>
group by aug.name
</if>
<if
test=
"vo.nameType!=null and vo.nameType==1"
>
group by a.full_name
</if>
order by sum(pu.total_point) desc
LIMIT #{vo.pageNo}, #{vo.pageSize}
</select>
<select
id=
"queryPiont"
resultType=
"java.lang.Integer"
>
<select
id=
"queryPiont"
resultType=
"java.lang.Integer"
>
select SUM(point) from
point_details
where site_id=#{siteId}
...
...
@@ -101,4 +149,52 @@
AND #{endDate}
group by accountId
</select>
<select
id=
"getNewUserRankCount"
resultType=
"java.lang.Integer"
>
select count(1) from(select
<if
test=
"vo.nameType!=null and vo.nameType==1"
>
aug.name,
</if>
<if
test=
"vo.nameType!=null and vo.nameType==1"
>
a.full_name,
</if>
sum(pu.total_point)
from
cloud_point.point_user pu
left join cloud_system.account a on
pu.user_id = a.id
left join (
select
aug.id,
aug.name,
aug.description,
aug.site_id,
aug.company_id,
aar.account_id
from
cloud_system.authz_user_group aug
inner join cloud_system.authz_role_user_group arug on
aug.id = arug.user_group_id
inner join cloud_system.authz_account_role aar on
arug.role_id = aar.role_id) aug on
a.id = aug.account_id
where
pu.state = 1
<if
test=
"vo.dateType!=null and vo.dateType==1"
>
and DATE_FORMAT(pu.create_time, '%Y') = #{vo.dateString}
</if>
<if
test=
"vo.dateType!=null and vo.dateType==2"
>
and DATE_FORMAT(pu.create_time, '%Y-%m') = #{vo.dateString}
</if>
<if
test=
"vo.dateType!=null and vo.dateType==3"
>
and DATE_FORMAT(pu.create_time, '%Y-%m-%d') = #{vo.dateString}
</if>
<if
test=
"vo.nameType!=null and vo.nameType==1"
>
group by aug.name
</if>
<if
test=
"vo.nameType!=null and vo.nameType==1"
>
group by a.full_name
</if>
order by sum(pu.total_point) desc
) a
</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