Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
dj
/
rpc-riskmanage
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 1ea3e9cc
authored
Nov 26, 2025
by
崔彦峰
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
提交等级考试详情接口
1 parent
872466c1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
64 additions
and
7 deletions
rpc-dj-riskmanage/src/main/java/cn/com/glsx/dj/riskmanage/remote/learningcenter/LearningCenterLevelExamRemoteImpl.java
rpc-dj-riskmanage/src/main/java/cn/com/glsx/dj/riskmanage/service/learningcenter/LearningCenterLevelExamService.java
rpc-dj-riskmanage/src/main/java/cn/com/glsx/dj/riskmanage/remote/learningcenter/LearningCenterLevelExamRemoteImpl.java
View file @
1ea3e9c
...
...
@@ -30,7 +30,12 @@ public class LearningCenterLevelExamRemoteImpl implements LearningCenterLevelExa
@Override
public
RpcResponse
<
LevelExamDetailResponseDTO
>
getLevelExamDetail
(
Integer
id
)
{
return
null
;
try
{
return
RpcResponse
.
success
(
learningCenterLevelExamService
.
getLevelExamDetail
(
id
));
}
catch
(
RpcServiceException
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
return
RpcResponse
.
error
(
e
);
}
}
...
...
rpc-dj-riskmanage/src/main/java/cn/com/glsx/dj/riskmanage/service/learningcenter/LearningCenterLevelExamService.java
View file @
1ea3e9c
...
...
@@ -9,6 +9,7 @@ import cn.com.glsx.dj.riskmanage.mapper.learningcenter.LearningCenterLevelExamLe
import
cn.com.glsx.dj.riskmanage.mapper.learningcenter.LearningCenterLevelExamMapper
;
import
cn.com.glsx.dj.riskmanage.model.learningcenter.LearningCenterLevelExam
;
import
cn.com.glsx.dj.riskmanage.model.learningcenter.LearningCenterLevelExamLevel
;
import
cn.com.glsx.dj.riskmanage.model.learningcenter.LearningCenterTrainingPlanPerson
;
import
cn.com.glsx.dj.riskmanage.service.beisen.BeiSenOrganizationService
;
import
cn.com.glsx.framework.core.beans.BaseModel
;
import
cn.com.glsx.framework.core.beans.rpc.RpcPagination
;
...
...
@@ -16,6 +17,7 @@ import cn.com.glsx.framework.core.exception.RpcServiceException;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.date.DateUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.github.pagehelper.Page
;
import
com.github.pagehelper.PageHelper
;
import
lombok.RequiredArgsConstructor
;
...
...
@@ -28,6 +30,7 @@ import org.springframework.stereotype.Service;
import
org.springframework.transaction.annotation.Transactional
;
import
tk.mybatis.mapper.entity.Example
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.stream.Collectors
;
...
...
@@ -48,25 +51,74 @@ public class LearningCenterLevelExamService {
public
Page
<
LevelExamPageListResponseDTO
>
levelExamListPage
(
RpcPagination
<
LevelExamPageListRequestDTO
>
pagination
)
{
Page
<
LevelExamPageListResponseDTO
>
page
=
PageHelper
.
startPage
(
pagination
.
getPageNum
(),
pagination
.
getPageSize
(),
pagination
.
isNeedCount
());
LevelExamPageListRequestDTO
condition
=
pagination
.
getCondition
();
//递归查询组织机构树,并赋值DepartmentIds
//递归查询组织机构树,填充查询条件DepartmentIds
fillConditionDepartmentIds
(
condition
);
List
<
LevelExamPageListResponseDTO
>
responseDTOS
=
levelExamMapper
.
levelExamListPage
(
condition
);
//填充考试等级
fillExamLevel
(
responseDTOS
);
List
<
LevelExamPageListResponseDTO
>
resultList
=
new
ArrayList
<>(
responseDTOS
);
page
.
clear
();
page
.
addAll
(
resultList
);
return
page
;
}
/**
* 递归查询组织机构树,填充查询条件DepartmentIds
*
* @param condition
*/
private
void
fillConditionDepartmentIds
(
LevelExamPageListRequestDTO
condition
)
{
if
(
condition
.
getDepartmentId
()
!=
null
)
{
List
<
OrganizationListResponseDTO
>
organizations
=
beiSenOrganizationService
.
getAllSubOrganizationIncludeSelf
(
condition
.
getDepartmentId
());
if
(
CollectionUtil
.
isNotEmpty
(
organizations
))
{
condition
.
setDepartmentIds
(
organizations
.
stream
().
map
(
OrganizationListResponseDTO:
:
getOId
).
collect
(
Collectors
.
toList
()));
}
}
List
<
LevelExamPageListResponseDTO
>
responseDTOS
=
levelExamMapper
.
levelExamListPage
(
condition
);
return
page
;
}
/**
* 填充考试等级
*
* @param responseDTOS
*/
private
void
fillExamLevel
(
List
<
LevelExamPageListResponseDTO
>
responseDTOS
)
{
if
(
CollectionUtils
.
isNotEmpty
(
responseDTOS
))
{
for
(
LevelExamPageListResponseDTO
responseDTO
:
responseDTOS
)
{
//获取等级考试等级信息
Example
example
=
new
Example
(
LearningCenterLevelExamLevel
.
class
);
Example
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andEqualTo
(
"examId"
,
responseDTO
.
getId
());
criteria
.
andEqualTo
(
"deletedFlag"
,
"N"
);
List
<
LearningCenterLevelExamLevel
>
examLevels
=
levelExamLevelMapper
.
selectByExample
(
example
);
responseDTO
.
setExamLevel
(
examLevels
.
size
());
}
}
}
public
LevelExamDetailResponseDTO
getLevelExamDetail
(
Integer
id
)
{
if
(
id
==
null
)
{
return
null
;
}
LearningCenterLevelExam
learningCenterLevelExam
=
levelExamMapper
.
selectByPrimaryKey
(
id
);
if
(
learningCenterLevelExam
==
null
)
{
return
null
;
}
LevelExamDetailResponseDTO
levelExamDetailResponseDTO
=
new
LevelExamDetailResponseDTO
();
BeanUtils
.
copyProperties
(
learningCenterLevelExam
,
levelExamDetailResponseDTO
);
return
levelExamDetailResponseDTO
;
//获取等级考试信息
LevelExamDetailResponseDTO
responseDTO
=
new
LevelExamDetailResponseDTO
();
BeanUtils
.
copyProperties
(
learningCenterLevelExam
,
responseDTO
);
//获取等级考试等级信息
Example
example
=
new
Example
(
LearningCenterLevelExamLevel
.
class
);
Example
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andEqualTo
(
"examId"
,
id
);
criteria
.
andEqualTo
(
"deletedFlag"
,
"N"
);
List
<
LearningCenterLevelExamLevel
>
examLevels
=
levelExamLevelMapper
.
selectByExample
(
example
);
//转换为DTO
List
<
LevelExamLevelDTO
>
examLevelDTOS
=
JSON
.
parseArray
(
JSON
.
toJSONString
(
examLevels
),
LevelExamLevelDTO
.
class
);
responseDTO
.
setExamLevel
(
examLevelDTOS
);
return
responseDTO
;
}
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment