Commit 2e2e4547 by zhiwj

咨询建议

parent 7b955843
......@@ -91,9 +91,8 @@ public class EvaluateOverviewApiServiceImpl implements EvaluateOverviewApiServic
List<Map<String, Object>> result = new ArrayList<>();
for (String date : dateList) {
Map<Object, Object> collect = chart.stream().collect(Collectors.toMap(e -> e.get("statisticsDate"), e -> e.get("count")));
Object value = collect.get(date);
Map<String, Object> map = new HashMap<>(4);
map.put(date, value == null ? 0 : value);
map.put(date, collect.getOrDefault(date, 0));
result.add(map);
}
return result;
......
......@@ -103,16 +103,14 @@ public class ProblemOutApiServiceImpl implements ProblemOutApiService {
public ServiceResponse<ProblemDTO> getProblem(Integer problemId) {
TabProblem problem = problemService.getProblem(problemId);
ProblemDTO problemDTO = EntityUtil.changeEntityByJSON(ProblemDTO.class, problem);
if (Constants.OPEN.equals(problemDTO.getHasOtherImage())) {
List<TabProblemImg> imgList = problemImgService.listImageByProblemId(problemId);
List<String> list = Optional.ofNullable(imgList).orElse(Collections.emptyList()).stream().map(TabProblemImg::getImgUrl).collect(Collectors.toList());
problemDTO.setImgList(list);
}
List<TabProblemImg> imgList = problemImgService.listImageByProblemId(problemId);
List<String> list = Optional.ofNullable(imgList).orElse(Collections.emptyList()).stream().map(TabProblemImg::getImgUrl).collect(Collectors.toList());
problemDTO.setImgList(list);
List<ProblemReplyDTO> replyList = problemReplyService.listReply(problemId);
for (ProblemReplyDTO problemReplyDTO : replyList) {
List<TabProblemImg> tabProblemImgs = problemImgService.listImageByProblemReplyId(problemReplyDTO.getProblemReplyId());
List<String> imgList = Optional.ofNullable(tabProblemImgs).orElse(Collections.emptyList()).stream().map(TabProblemImg::getImgUrl).collect(Collectors.toList());
problemReplyDTO.setImgList(imgList);
List<String> replyImgList = Optional.ofNullable(tabProblemImgs).orElse(Collections.emptyList()).stream().map(TabProblemImg::getImgUrl).collect(Collectors.toList());
problemReplyDTO.setImgList(replyImgList);
}
problemDTO.setReplyList(replyList);
return EnterpriseServiceResponse.success(problemDTO);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment