|
@@ -3,7 +3,11 @@ package com.ym.mec.biz.service.impl;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
+import com.ym.mec.biz.dal.dao.TeacherDao;
|
|
|
import com.ym.mec.biz.dal.vo.DegreeNewsVo;
|
|
|
+import com.ym.mec.util.collection.MapUtil;
|
|
|
+import org.apache.commons.collections.CollectionUtils;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import com.ym.mec.biz.dal.entity.DegreeNews;
|
|
@@ -11,6 +15,10 @@ import com.ym.mec.biz.dal.wrapper.DegreeNewsWrapper;
|
|
|
import com.ym.mec.biz.dal.mapper.DegreeNewsMapper;
|
|
|
import com.ym.mec.biz.service.DegreeNewsService;
|
|
|
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+import java.util.stream.Collectors;
|
|
|
+
|
|
|
/**
|
|
|
* 考级资讯表
|
|
|
* 2023-04-10 10:24:25
|
|
@@ -19,6 +27,9 @@ import com.ym.mec.biz.service.DegreeNewsService;
|
|
|
@Service
|
|
|
public class DegreeNewsServiceImpl extends ServiceImpl<DegreeNewsMapper, DegreeNews> implements DegreeNewsService {
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private TeacherDao teacherDao;
|
|
|
+
|
|
|
/**
|
|
|
* 查询详情
|
|
|
* @param id 详情ID
|
|
@@ -38,8 +49,15 @@ public class DegreeNewsServiceImpl extends ServiceImpl<DegreeNewsMapper, DegreeN
|
|
|
*/
|
|
|
@Override
|
|
|
public IPage<DegreeNewsVo> selectPage(IPage<DegreeNewsVo> page, DegreeNewsWrapper.DegreeNewsQuery query) {
|
|
|
-
|
|
|
- return page.setRecords(baseMapper.selectPage(page, query));
|
|
|
+ List<DegreeNewsVo> degreeNewsVos = baseMapper.selectPage(page, query);
|
|
|
+ if(CollectionUtils.isNotEmpty(degreeNewsVos)){
|
|
|
+ List<Integer> operatorIds = degreeNewsVos.stream().map(e -> e.getOperatorId()).distinct().collect(Collectors.toList());
|
|
|
+ Map<Integer, String> nameIdMap = MapUtil.convertIntegerMap(teacherDao.queryNameByIdList(operatorIds));
|
|
|
+ for (DegreeNewsVo vo : degreeNewsVos) {
|
|
|
+ vo.setOperatorName(nameIdMap.get(vo.getOperatorId()));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return page.setRecords(degreeNewsVos);
|
|
|
}
|
|
|
|
|
|
/**
|