Commit ff4ec9c7 authored by luzhuang's avatar luzhuang

fix:知识广场查询,重新统计

parent 51902470
......@@ -21,6 +21,9 @@ public class HomeParamDTO {
@ApiModelProperty(value = "标签集合")
private List<BLabel> labels;
@ApiModelProperty(value = "allNewCount")
private int allNewCount;
@ApiModelProperty(value = "分类计数")
private int classifyCount;
@ApiModelProperty(value = "标签计数")
private int LableCount;
}
......@@ -83,6 +83,8 @@ public class BLabelServiceImpl implements BLabelService {
@Override
public HomeParamDTO queryBlabelAndCourse(SearchParamDTO searchParamDTO, CurUser curUser) {
int classifyCount = 0;
int lableCount = 0;
//新建返回对象
HomeParamDTO paramDTO = new HomeParamDTO();
//根据条件查询出对应的课程
......@@ -93,11 +95,17 @@ public class BLabelServiceImpl implements BLabelService {
if("1".equals(b.getIsNew()))
newLessons.add(b);
}
paramDTO.setAllNewCount(newLessons.size());
LogUtil.addnNewLog("-----------addNewLable----------当前查询课程总个数--"+lessons.size()+"--------------------");
//遍历分类数据
List<QueryCourseResDTO> dtoList = bCourseRepository.queryFirstLevel(curUser.getCorpId(),20);
paramDTO.setCourses(addNewFolder(dtoList,newLessons));
List<QueryCourseResDTO> courseResDTOS = addNewFolder(dtoList,newLessons);
for(QueryCourseResDTO dto :courseResDTOS){
if(StringUtils.isNotEmpty(String.valueOf(dto.getNewCount())) && dto.getNewCount() > 0){
classifyCount+=dto.getNewCount();
}
}
paramDTO.setClassifyCount(classifyCount);
paramDTO.setCourses(courseResDTOS);
//遍历标签数据
List<BLabel> labels = bLabelRepository.queryBlabels(searchParamDTO.getLName(), curUser.getCorpId());
List<BLabel> labelsForPlatform = bLabelRepository.queryBLabelsForPlatform(searchParamDTO.getLName(), curUser.getCorpId());
......@@ -121,6 +129,12 @@ public class BLabelServiceImpl implements BLabelService {
if(curUser.getCorpId().equals(lable.getCorpId()) || (!curUser.getCorpId().equals(lable.getCorpId()) && 0 < lable.getNewCount()))
newLables.add(lable);
});
for(BLabel label : newLables){
if(StringUtils.isNotEmpty(String.valueOf(label.getNewCount())) && label.getNewCount() > 0){
lableCount += label.getNewCount();
}
}
paramDTO.setLableCount(lableCount);
paramDTO.setLabels(newLables);
return paramDTO;
}
......
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