From 8219cdfcb825b6d75c3a235a7e5195c8cac9a2ea Mon Sep 17 00:00:00 2001
From: songhuangfeng123 <shf18767906695@163.com>
Date: Tue, 06 Sep 2022 11:32:14 +0800
Subject: [PATCH] 统计接口rpc
---
goal-manage/goal-manage-service/src/main/java/com/gkhy/safePlatform/targetDuty/service/impl/ExamineMngServiceImpl.java | 59 +++++++++++++++++++++++++++++++----------------------------
1 files changed, 31 insertions(+), 28 deletions(-)
diff --git a/goal-manage/goal-manage-service/src/main/java/com/gkhy/safePlatform/targetDuty/service/impl/ExamineMngServiceImpl.java b/goal-manage/goal-manage-service/src/main/java/com/gkhy/safePlatform/targetDuty/service/impl/ExamineMngServiceImpl.java
index 229f028..724970c 100644
--- a/goal-manage/goal-manage-service/src/main/java/com/gkhy/safePlatform/targetDuty/service/impl/ExamineMngServiceImpl.java
+++ b/goal-manage/goal-manage-service/src/main/java/com/gkhy/safePlatform/targetDuty/service/impl/ExamineMngServiceImpl.java
@@ -55,8 +55,8 @@
@Resource
private CommonService commonService;
-
-
+
+
@Override
public ResultVO queryAll(PageQuery<ExamineMngQueryCriteria> pageQuery) {
Long pageIndex = pageQuery.getPageIndex();
@@ -87,19 +87,21 @@
List<CurrentExamineDto> list = JSONObject.parseArray( dto.getNumberDetailJson(), CurrentExamineDto.class);
List<Long> idList = list.stream().map(CurrentExamineDto::getId).collect(Collectors.toList());
- List<ExamineItem> itemList = examineItemRepository.selectBatchIds(idList);
- Map<Long,ExamineItem> itemMap = itemList.stream().collect(
- Collectors.toMap(ExamineItem::getId, Function.identity(),(k1, k2)->k1));
+ if(!idList.isEmpty()){
+ List<ExamineItem> itemList = examineItemRepository.selectBatchIds(idList);
+ Map<Long,ExamineItem> itemMap = itemList.stream().collect(
+ Collectors.toMap(ExamineItem::getId, Function.identity(),(k1, k2)->k1));
- if(itemMap != null){
- list.forEach(f->{
- ExamineItem item = itemMap.get(f.getId());
- if(item != null){
- f.setItemDetail(item.getItemDetail());
- f.setContent(item.getContent());
- f.setJudgeStandard(item.getJudgeStandard());
- }
- });
+ if(itemMap != null){
+ list.forEach(f->{
+ ExamineItem item = itemMap.get(f.getId());
+ if(item != null){
+ f.setItemDetail(item.getItemDetail());
+ f.setContent(item.getContent());
+ f.setJudgeStandard(item.getJudgeStandard());
+ }
+ });
+ }
}
dto.setCurrentExamineDtoList(list);
});
@@ -135,20 +137,21 @@
//获取打分明细
List<CurrentExamineDto> list = JSONObject.parseArray( examineMng.getNumberDetailJson(), CurrentExamineDto.class);
List<Long> idList = list.stream().map(CurrentExamineDto::getId).collect(Collectors.toList());
+ if (!idList.isEmpty()){
+ List<ExamineItem> itemList = examineItemRepository.selectBatchIds(idList);
+ Map<Long,ExamineItem> itemMap = itemList.stream().collect(
+ Collectors.toMap(ExamineItem::getId, Function.identity(),(k1, k2)->k1));
- List<ExamineItem> itemList = examineItemRepository.selectBatchIds(idList);
- Map<Long,ExamineItem> itemMap = itemList.stream().collect(
- Collectors.toMap(ExamineItem::getId, Function.identity(),(k1, k2)->k1));
-
- if(itemMap != null){
- list.forEach(f->{
- ExamineItem item = itemMap.get(f.getId());
- if(item != null){
- f.setItemDetail(item.getItemDetail());
- f.setContent(item.getContent());
- f.setJudgeStandard(item.getJudgeStandard());
- }
- });
+ if(itemMap != null){
+ list.forEach(f->{
+ ExamineItem item = itemMap.get(f.getId());
+ if(item != null){
+ f.setItemDetail(item.getItemDetail());
+ f.setContent(item.getContent());
+ f.setJudgeStandard(item.getJudgeStandard());
+ }
+ });
+ }
}
dto.setCurrentExamineDtoList(list);
@@ -161,4 +164,4 @@
return dto;
}
-}
\ No newline at end of file
+}
--
Gitblit v1.9.2