|
@@ -28,9 +28,7 @@ import org.springframework.data.mongodb.core.query.Query;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
-import java.util.ArrayList;
|
|
|
|
-import java.util.Collection;
|
|
|
|
-import java.util.List;
|
|
|
|
|
|
+import java.util.*;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -64,6 +62,8 @@ public class PaperStructService {
|
|
// return Page.empty();
|
|
// return Page.empty();
|
|
// }
|
|
// }
|
|
|
|
|
|
|
|
+ // todo userDataRule
|
|
|
|
+
|
|
Query query = new Query();
|
|
Query query = new Query();
|
|
query.addCriteria(Criteria.where("orgId").is(searchInfo.getOrgId()));
|
|
query.addCriteria(Criteria.where("orgId").is(searchInfo.getOrgId()));
|
|
query.addCriteria(Criteria.where("type").is(searchInfo.getType()));
|
|
query.addCriteria(Criteria.where("type").is(searchInfo.getType()));
|
|
@@ -109,15 +109,24 @@ public class PaperStructService {
|
|
return Page.empty();
|
|
return Page.empty();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ Map<String, String> courseNameMaps = new HashMap<>();
|
|
|
|
+
|
|
for (PaperStruct paperStruct : paperStructs) {
|
|
for (PaperStruct paperStruct : paperStructs) {
|
|
if (StringUtils.isBlank(paperStruct.getCourseNo())) {
|
|
if (StringUtils.isBlank(paperStruct.getCourseNo())) {
|
|
paperStruct.setCourseName("公用");
|
|
paperStruct.setCourseName("公用");
|
|
} else {
|
|
} else {
|
|
- GetCourseReq req = new GetCourseReq();
|
|
|
|
- req.setRootOrgId(Long.valueOf(paperStruct.getOrgId()));
|
|
|
|
- req.setCode(paperStruct.getCourseNo());
|
|
|
|
- GetCourseResp resp = courseCloudService.getCourse(req);
|
|
|
|
- paperStruct.setCourseName(resp.getCourseBean().getName());
|
|
|
|
|
|
+ String courseName = courseNameMaps.get(paperStruct.getCourseNo());
|
|
|
|
+
|
|
|
|
+ if (StringUtils.isEmpty(courseName)) {
|
|
|
|
+ GetCourseReq req = new GetCourseReq();
|
|
|
|
+ req.setRootOrgId(Long.valueOf(paperStruct.getOrgId()));
|
|
|
|
+ req.setCode(paperStruct.getCourseNo());
|
|
|
|
+ GetCourseResp resp = courseCloudService.getCourse(req);
|
|
|
|
+ courseName = resp.getCourseBean().getName();
|
|
|
|
+ courseNameMaps.put(paperStruct.getCourseNo(), courseName);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ paperStruct.setCourseName(courseName);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|