|
|
|
@ -3,15 +3,20 @@ package org.jeecg.modules.cms.service; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
import org.jeecg.modules.course.entity.SeCourse; |
|
|
|
|
import org.jeecg.modules.course.service.ISeCourseService; |
|
|
|
|
import org.jeecg.modules.py.entity.*; |
|
|
|
|
import org.jeecg.modules.py.entity.vo.OGListVo; |
|
|
|
|
import org.jeecg.modules.py.entity.vo.PyGraRequireVo; |
|
|
|
|
import org.jeecg.modules.py.service.*; |
|
|
|
|
import org.jeecg.modules.py.utils.MessageConstant; |
|
|
|
|
import org.jeecg.modules.system.entity.SysUser; |
|
|
|
|
import org.jeecg.modules.system.service.ISysUserService; |
|
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
import org.springframework.util.ObjectUtils; |
|
|
|
|
import org.springframework.util.StringUtils; |
|
|
|
|
|
|
|
|
|
import java.util.LinkedHashMap; |
|
|
|
|
import java.util.LinkedList; |
|
|
|
@ -120,6 +125,43 @@ public class CmsHomeTrainingPlanServiceImpl implements ICmsHomeTrainingPlanServi |
|
|
|
|
return returnMap; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private ISysUserService iSysUserService; |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private ISeCourseService iSeCourseService; |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public Object getData4Top2() { |
|
|
|
|
Map<String, Object> returnMap = new LinkedHashMap<>(); |
|
|
|
|
List<PyBasicCourse> pyBasicCourseList; |
|
|
|
|
|
|
|
|
|
PyBasicInfo basicInfo = this.getTopPyBasicInfo(); |
|
|
|
|
if (ObjectUtils.isEmpty(basicInfo)) return returnMap; |
|
|
|
|
|
|
|
|
|
final String basicId = basicInfo.getBasicId(); |
|
|
|
|
pyBasicCourseList = pyBasicCourseService.list(new LambdaQueryWrapper<PyBasicCourse>() |
|
|
|
|
.eq(!StringUtils.isEmpty(basicId), PyBasicCourse::getBasicId, basicId) |
|
|
|
|
.eq(PyBasicCourse::getStatus, 0) |
|
|
|
|
.orderByDesc(PyBasicCourse::getBasicId)); |
|
|
|
|
|
|
|
|
|
if (!ObjectUtils.isEmpty(pyBasicCourseList)) { |
|
|
|
|
pyBasicCourseList.stream().forEach(e -> { |
|
|
|
|
SeCourse seCourse = iSeCourseService.getById(e.getCourseId()); |
|
|
|
|
SysUser sysUser = iSysUserService.getOne(new LambdaQueryWrapper<SysUser>().eq(SysUser::getUsername, seCourse.getTeacher())); |
|
|
|
|
if (!ObjectUtils.isEmpty(sysUser)) { |
|
|
|
|
seCourse.setTeacher(sysUser.getRealname()); |
|
|
|
|
} |
|
|
|
|
this.pyBasicCourseService.convertSeCourse(seCourse); |
|
|
|
|
e.setSeCourse(seCourse); |
|
|
|
|
e.setPyBasicInfo(basicInfoService.getById(e.getBasicId())); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
returnMap.put("课程", pyBasicCourseList); |
|
|
|
|
|
|
|
|
|
return returnMap; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @description: 获取已置顶的培养方案 |
|
|
|
|
* @param: [] |
|
|
|
@ -131,7 +173,8 @@ public class CmsHomeTrainingPlanServiceImpl implements ICmsHomeTrainingPlanServi |
|
|
|
|
|
|
|
|
|
PyBasicInfo pyBasicInfo = basicInfoService.getOne(new LambdaQueryWrapper<PyBasicInfo>() |
|
|
|
|
.eq(PyBasicInfo::getStatu, "0") |
|
|
|
|
.eq(PyBasicInfo::getBasicId, "8bb1e5211f1390cdbda8ef9d723723eb") |
|
|
|
|
// .eq(PyBasicInfo::getBasicId, "8bb1e5211f1390cdbda8ef9d723723eb")
|
|
|
|
|
.eq(PyBasicInfo::getBasicId, "236ee773b155859e845d9568ba02297b") |
|
|
|
|
//.eq(PyBasicInfo::getStatu, 置顶标志)
|
|
|
|
|
.last("limit 1") |
|
|
|
|
); |
|
|
|
@ -179,7 +222,6 @@ public class CmsHomeTrainingPlanServiceImpl implements ICmsHomeTrainingPlanServi |
|
|
|
|
for (PyObjectiveGraduate pyObjectiveGraduate : pyObjectiveGraduates) { |
|
|
|
|
String gId = pyObjectiveGraduate.getGraduateId(); |
|
|
|
|
for (int i = 0; i < pyGraRequires.size(); i++) { |
|
|
|
|
boolean b = gId.equals(pyGraRequires.get(i).getId()); |
|
|
|
|
if (gId.equals(pyGraRequires.get(i).getId())) { |
|
|
|
|
pyObjectiveGraduate.setGraduateId(String.valueOf(i + 1)); |
|
|
|
|
break; |
|
|
|
|