Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
cloud-web
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
cloud-web
Commits
3793be10
Commit
3793be10
authored
Nov 12, 2025
by
wangxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
消息数量接口增加我的信箱
parent
296d7be4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
118 additions
and
55 deletions
+118
-55
cloud-web-manage/src/main/java/com/yizhi/application/dashboard/controller/PromptStatisticsController.java
+79
-53
cloud-web-manage/src/main/java/com/yizhi/application/vo/PromptStatisticsVO.java
+4
-0
cloud-web-student/src/main/java/com/yizhi/application/promptStatistics/PromptStatisticsController.java
+31
-2
cloud-web-student/src/main/java/com/yizhi/application/vo/PromptStatisticsVO.java
+4
-0
No files found.
cloud-web-manage/src/main/java/com/yizhi/application/dashboard/controller/PromptStatisticsController.java
View file @
3793be10
package
com
.
yizhi
.
application
.
dashboard
.
controller
;
package
com
.
yizhi
.
application
.
promptStatistics
;
import
com.yizhi.application.vo.PromptStatisticsVO
;
import
com.yizhi.core.application.context.ContextHolder
;
...
...
@@ -7,6 +6,8 @@ import com.yizhi.core.application.context.RequestContext;
import
com.yizhi.research.application.feign.ResearchClient
;
import
com.yizhi.research.application.vo.BaseModel
;
import
com.yizhi.research.application.vo.api.PageVo
;
import
com.yizhi.site.application.feign.api.SystemMailboxClients
;
import
com.yizhi.site.application.vo.domain.SystemMailboxParamVo
;
import
com.yizhi.training.application.feign.TrainingProjectClient
;
import
com.yizhi.training.application.vo.api.TrainingProjectMyParamVo
;
import
com.yizhi.util.application.domain.Response
;
...
...
@@ -30,62 +31,68 @@ import com.baomidou.mybatisplus.plugins.Page;
@Api
(
tags
=
"提示统计接口"
)
@RestController
@RequestMapping
(
"/
manage
/prompt"
)
@RequestMapping
(
"/
api
/prompt"
)
public
class
PromptStatisticsController
{
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
PromptStatisticsController
.
class
);
@Autowired
private
ResearchClient
researchClient
;
@Autowired
private
TrainingProjectClient
trainingProjectClient
;
@Autowired
private
ExamApiClient
examApiClient
;
@Autowired
private
SystemMailboxClients
systemMailboxClients
;
@ApiOperation
(
value
=
"获取提示统计信息"
,
notes
=
"获取总提示数量及各类提示数量统计"
)
@GetMapping
(
"/statistics"
)
public
Response
<
PromptStatisticsVO
>
getPromptStatistics
()
{
try
{
LOGGER
.
error
(
"获取提示统计信息"
);
PromptStatisticsVO
statistics
=
new
PromptStatisticsVO
();
RequestContext
context
=
ContextHolder
.
get
();
// 1. 获取
未参与的
工作任务数量(调研表biz_type=1,已上架且处于调研期间)
Integer
workTaskCount
=
get
Unparticipated
WorkTaskCount
(
context
);
// 1. 获取工作任务数量(调研表biz_type=1,已上架且处于调研期间)
Integer
workTaskCount
=
getWorkTaskCount
(
context
);
statistics
.
setWorkTaskCount
(
workTaskCount
);
// 2. 获取
未参与的
主题活动数量(培训项目已上架未结束)
Integer
themeActivityCount
=
get
Unparticipated
ThemeActivityCount
(
context
);
// 2. 获取主题活动数量(培训项目已上架未结束)
Integer
themeActivityCount
=
getThemeActivityCount
(
context
);
statistics
.
setThemeActivityCount
(
themeActivityCount
);
// 3. 获取
未参与的
投票数量(调研表biz_type=2,已上架)
Integer
voteCount
=
get
Unparticipated
VoteCount
(
context
);
// 3. 获取
我要
投票数量(调研表biz_type=2,已上架)
Integer
voteCount
=
getVoteCount
(
context
);
statistics
.
setVoteCount
(
voteCount
);
// 4. 获取
未参与的
培训测试数量(考试相关的提示数量)
Integer
trainingTestCount
=
get
Unparticipated
TrainingTestCount
(
context
);
// 4. 获取培训测试数量(考试相关的提示数量)
Integer
trainingTestCount
=
getTrainingTestCount
(
context
);
statistics
.
setTrainingTestCount
(
trainingTestCount
);
// 5. 计算总提示数量
int
totalPromptCount
=
workTaskCount
+
themeActivityCount
+
voteCount
+
trainingTestCount
;
// 5. 获取信箱提示数量(未读消息数量)
Integer
mailboxCount
=
getMailboxCount
(
context
);
statistics
.
setMailboxCount
(
mailboxCount
);
// 6. 计算总提示数量
int
totalPromptCount
=
workTaskCount
+
themeActivityCount
+
voteCount
+
trainingTestCount
+
mailboxCount
;
statistics
.
setTotalPromptCount
(
totalPromptCount
);
return
Response
.
ok
(
statistics
);
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"获取提示统计信息失败"
,
e
);
return
Response
.
fail
(
"500"
,
"获取提示统计信息失败"
);
}
}
/**
* 获取
未参与的工作任务数量(调研表biz_type=1,已上架且处于调研期间)
* 获取
工作任务数量
* @param context
* @return
*/
private
Integer
get
Unparticipated
WorkTaskCount
(
RequestContext
context
)
{
private
Integer
getWorkTaskCount
(
RequestContext
context
)
{
try
{
PageVo
pageVo
=
new
PageVo
();
pageVo
.
setAccountId
(
context
.
getAccountId
());
...
...
@@ -93,14 +100,14 @@ public class PromptStatisticsController {
pageVo
.
setPageNo
(
1
);
pageVo
.
setPageSize
(
1
);
pageVo
.
setBizType
(
1
);
// 调研类型
pageVo
.
setState
(
2
);
// 进行中的任务
(未完成,未参与)
pageVo
.
setState
(
2
);
// 进行中的任务
BaseModel
<
PageVo
>
model
=
new
BaseModel
<>();
model
.
setDate
(
new
Date
());
model
.
setObj
(
pageVo
);
model
.
setContext
(
context
);
// 获取
未参与的
调研列表,只取数量
// 获取调研列表,只取数量
Page
<
ResearchVo
>
response
=
researchClient
.
apiListPage
(
model
);
if
(
response
!=
null
)
{
...
...
@@ -108,47 +115,47 @@ public class PromptStatisticsController {
}
return
0
;
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"获取
未参与的
工作任务数量失败"
,
e
);
LOGGER
.
error
(
"获取工作任务数量失败"
,
e
);
return
0
;
}
}
/**
* 获取
未参与的主题活动数量(培训项目已上架未结束)
* 获取
主题活动数量
* @param context
* @return
*/
private
Integer
get
Unparticipated
ThemeActivityCount
(
RequestContext
context
)
{
private
Integer
getThemeActivityCount
(
RequestContext
context
)
{
try
{
TrainingProjectMyParamVo
paramVo
=
new
TrainingProjectMyParamVo
();
paramVo
.
setPageNo
(
1
);
paramVo
.
setPageSize
(
1
);
paramVo
.
setType
(
2
);
// 进行中的活动
com
.
yizhi
.
training
.
application
.
model
.
BaseModel
<
TrainingProjectMyParamVo
>
model
=
new
com
.
yizhi
.
training
.
application
.
model
.
BaseModel
<>();
com
.
yizhi
.
training
.
application
.
model
.
BaseModel
<
TrainingProjectMyParamVo
>
model
=
new
com
.
yizhi
.
training
.
application
.
model
.
BaseModel
<>();
model
.
setContext
(
context
);
model
.
setDate
(
new
Date
());
model
.
setObj
(
paramVo
);
// 获取
未参与的
培训项目列表,只取数量
// 获取培训项目列表,只取数量
Page
<
TrainingProjectListVo
>
response
=
trainingProjectClient
.
apiMyPageList
(
model
);
if
(
response
!=
null
)
{
return
response
.
getTotal
();
}
return
0
;
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"获取
未参与的
主题活动数量失败"
,
e
);
LOGGER
.
error
(
"获取主题活动数量失败"
,
e
);
return
0
;
}
}
/**
* 获取
未参与的投票数量(调研表biz_type=2,已上架)
* 获取
投票数量
* @param context
* @return
*/
private
Integer
get
Unparticipated
VoteCount
(
RequestContext
context
)
{
private
Integer
getVoteCount
(
RequestContext
context
)
{
try
{
PageVo
pageVo
=
new
PageVo
();
pageVo
.
setAccountId
(
context
.
getAccountId
());
...
...
@@ -156,31 +163,31 @@ public class PromptStatisticsController {
pageVo
.
setPageNo
(
1
);
pageVo
.
setPageSize
(
1
);
pageVo
.
setBizType
(
2
);
// 投票类型
pageVo
.
setState
(
2
);
// 进行中的投票
(未完成,未参与)
pageVo
.
setState
(
2
);
// 进行中的投票
BaseModel
<
PageVo
>
model
=
new
BaseModel
<>();
model
.
setDate
(
new
Date
());
model
.
setObj
(
pageVo
);
model
.
setContext
(
context
);
// 获取
未参与的
投票列表,只取数量
// 获取投票列表,只取数量
Page
<
ResearchVo
>
response
=
researchClient
.
apiListPage
(
model
);
if
(
response
!=
null
)
{
return
response
.
getTotal
();
}
return
0
;
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"获取
未参与的
投票数量失败"
,
e
);
LOGGER
.
error
(
"获取投票数量失败"
,
e
);
return
0
;
}
}
/**
* 获取
未参与的培训测试数量(考试相关的提示数量)
* 获取
培训测试数量
* @param context
* @return
*/
private
Integer
get
Unparticipated
TrainingTestCount
(
RequestContext
context
)
{
private
Integer
getTrainingTestCount
(
RequestContext
context
)
{
try
{
// 使用考试dashboard接口获取考试统计信息
ExamDashboardQueryVO
query
=
new
ExamDashboardQueryVO
();
...
...
@@ -190,12 +197,31 @@ public class PromptStatisticsController {
Date
startDate
=
new
Date
(
endDate
.
getTime
()
-
7
*
24
*
60
*
60
*
1000L
);
query
.
setStartDate
(
startDate
);
query
.
setEndDate
(
endDate
);
Map
<
Long
,
Integer
>
examData
=
examApiClient
.
getExamDashboardData
(
query
);
// 返回考试数量
return
examData
!=
null
?
examData
.
size
()
:
0
;
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"获取未参与的培训测试数量失败"
,
e
);
LOGGER
.
error
(
"获取培训测试数量失败"
,
e
);
return
0
;
}
}
/**
* 获取信箱提示数量(未读消息数量)
* @param context
* @return
*/
private
Integer
getMailboxCount
(
RequestContext
context
)
{
try
{
// 获取未读消息数量
Page
<
SystemMailboxParamVo
>
response
=
systemMailboxClients
.
selectMyPage
(
1
,
1
,
2
);
if
(
response
!=
null
)
{
return
response
.
getTotal
();
}
return
0
;
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"获取信箱提示数量失败"
,
e
);
return
0
;
}
}
...
...
cloud-web-manage/src/main/java/com/yizhi/application/vo/PromptStatisticsVO.java
View file @
3793be10
...
...
@@ -22,4 +22,7 @@ public class PromptStatisticsVO {
@ApiModelProperty
(
value
=
"培训测试提示数量"
)
private
Integer
trainingTestCount
;
@ApiModelProperty
(
value
=
"信箱提示数量"
)
private
Integer
mailboxCount
;
}
\ No newline at end of file
cloud-web-student/src/main/java/com/yizhi/application/promptStatistics/PromptStatisticsController.java
View file @
3793be10
...
...
@@ -6,6 +6,8 @@ import com.yizhi.core.application.context.RequestContext;
import
com.yizhi.research.application.feign.ResearchClient
;
import
com.yizhi.research.application.vo.BaseModel
;
import
com.yizhi.research.application.vo.api.PageVo
;
import
com.yizhi.site.application.feign.api.SystemMailboxClients
;
import
com.yizhi.site.application.vo.domain.SystemMailboxParamVo
;
import
com.yizhi.training.application.feign.TrainingProjectClient
;
import
com.yizhi.training.application.vo.api.TrainingProjectMyParamVo
;
import
com.yizhi.util.application.domain.Response
;
...
...
@@ -43,6 +45,9 @@ public class PromptStatisticsController {
@Autowired
private
ExamApiClient
examApiClient
;
@Autowired
private
SystemMailboxClients
systemMailboxClients
;
@ApiOperation
(
value
=
"获取提示统计信息"
,
notes
=
"获取总提示数量及各类提示数量统计"
)
@GetMapping
(
"/statistics"
)
public
Response
<
PromptStatisticsVO
>
getPromptStatistics
()
{
...
...
@@ -66,9 +71,13 @@ public class PromptStatisticsController {
// 4. 获取培训测试数量(考试相关的提示数量)
Integer
trainingTestCount
=
getTrainingTestCount
(
context
);
statistics
.
setTrainingTestCount
(
trainingTestCount
);
// 5. 获取信箱提示数量(未读消息数量)
Integer
mailboxCount
=
getMailboxCount
(
context
);
statistics
.
setMailboxCount
(
mailboxCount
);
//
5
. 计算总提示数量
int
totalPromptCount
=
workTaskCount
+
themeActivityCount
+
voteCount
+
trainingTestCount
;
//
6
. 计算总提示数量
int
totalPromptCount
=
workTaskCount
+
themeActivityCount
+
voteCount
+
trainingTestCount
+
mailboxCount
;
statistics
.
setTotalPromptCount
(
totalPromptCount
);
return
Response
.
ok
(
statistics
);
...
...
@@ -197,4 +206,23 @@ public class PromptStatisticsController {
return
0
;
}
}
/**
* 获取信箱提示数量(未读消息数量)
* @param context
* @return
*/
private
Integer
getMailboxCount
(
RequestContext
context
)
{
try
{
// 获取未读消息数量
Page
<
SystemMailboxParamVo
>
response
=
systemMailboxClients
.
selectMyPage
(
1
,
1
,
2
);
if
(
response
!=
null
)
{
return
response
.
getTotal
();
}
return
0
;
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"获取信箱提示数量失败"
,
e
);
return
0
;
}
}
}
\ No newline at end of file
cloud-web-student/src/main/java/com/yizhi/application/vo/PromptStatisticsVO.java
View file @
3793be10
...
...
@@ -22,4 +22,7 @@ public class PromptStatisticsVO {
@ApiModelProperty
(
value
=
"培训测试提示数量"
)
private
Integer
trainingTestCount
;
@ApiModelProperty
(
value
=
"信箱提示数量"
)
private
Integer
mailboxCount
;
}
\ No newline at end of file
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