cms 首页-已置顶培养方案数据整合 9.1

dev_2307
zhc077 1 year ago
parent 508f39d58f
commit ecb80e2a0e
  1. 8
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/cms/controller/CmsHomeTrainingPlanController.java
  2. 54
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/cms/service/CmsHomeTrainingPlanServiceImpl.java
  3. 2
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/cms/service/ICmsHomeTrainingPlanService.java
  4. 4
      jeecg-boot/jeecg-boot-module-system/src/main/resources/application-prod.yml

@ -26,9 +26,15 @@ public class CmsHomeTrainingPlanController {
@Autowired @Autowired
private ICmsHomeTrainingPlanService iCmsHomeTrainingPlanService; private ICmsHomeTrainingPlanService iCmsHomeTrainingPlanService;
@ApiOperation(value = "获取已置顶培养方案", notes = "获取已置顶培养方案") @ApiOperation(value = "获取已置顶培养方案-data1")
@GetMapping(value = "/getData4Top1") @GetMapping(value = "/getData4Top1")
public Result<?> getData4Top1() { public Result<?> getData4Top1() {
return Result.OK(iCmsHomeTrainingPlanService.getData4Top1()); return Result.OK(iCmsHomeTrainingPlanService.getData4Top1());
} }
@ApiOperation(value = "获取已置顶培养方案-课程")
@GetMapping(value = "/getData4Top2")
public Result<?> getData4Top2() {
return Result.OK(iCmsHomeTrainingPlanService.getData4Top2());
}
} }

@ -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.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import lombok.extern.slf4j.Slf4j; 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.*;
import org.jeecg.modules.py.entity.vo.OGListVo; import org.jeecg.modules.py.entity.vo.OGListVo;
import org.jeecg.modules.py.entity.vo.PyGraRequireVo; import org.jeecg.modules.py.entity.vo.PyGraRequireVo;
import org.jeecg.modules.py.service.*; import org.jeecg.modules.py.service.*;
import org.jeecg.modules.py.utils.MessageConstant; 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.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
import java.util.LinkedList; import java.util.LinkedList;
@ -63,7 +68,7 @@ public class CmsHomeTrainingPlanServiceImpl implements ICmsHomeTrainingPlanServi
PyTrainingObjective pyTrainingObjective = pyTrainingObjectiveService.getOne(new LambdaQueryWrapper<PyTrainingObjective>() PyTrainingObjective pyTrainingObjective = pyTrainingObjectiveService.getOne(new LambdaQueryWrapper<PyTrainingObjective>()
.eq(PyTrainingObjective::getBasicId, basicId) .eq(PyTrainingObjective::getBasicId, basicId)
.eq(PyTrainingObjective::getPid, "0") .eq(PyTrainingObjective::getPid, "0")
.last( "limit 1") .last("limit 1")
); );
returnMap.put("培养目标描述", pyTrainingObjective); returnMap.put("培养目标描述", pyTrainingObjective);
@ -120,6 +125,43 @@ public class CmsHomeTrainingPlanServiceImpl implements ICmsHomeTrainingPlanServi
return returnMap; 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: 获取已置顶的培养方案 * @description: 获取已置顶的培养方案
* @param: [] * @param: []
@ -130,10 +172,11 @@ public class CmsHomeTrainingPlanServiceImpl implements ICmsHomeTrainingPlanServi
PyBasicInfo getTopPyBasicInfo() { PyBasicInfo getTopPyBasicInfo() {
PyBasicInfo pyBasicInfo = basicInfoService.getOne(new LambdaQueryWrapper<PyBasicInfo>() PyBasicInfo pyBasicInfo = basicInfoService.getOne(new LambdaQueryWrapper<PyBasicInfo>()
.eq(PyBasicInfo::getStatu, "0") .eq(PyBasicInfo::getStatu, "0")
.eq(PyBasicInfo::getBasicId, "8bb1e5211f1390cdbda8ef9d723723eb") // .eq(PyBasicInfo::getBasicId, "8bb1e5211f1390cdbda8ef9d723723eb")
//.eq(PyBasicInfo::getStatu, 置顶标志) .eq(PyBasicInfo::getBasicId, "236ee773b155859e845d9568ba02297b")
.last("limit 1") //.eq(PyBasicInfo::getStatu, 置顶标志)
.last("limit 1")
); );
return pyBasicInfo; return pyBasicInfo;
} }
@ -179,7 +222,6 @@ public class CmsHomeTrainingPlanServiceImpl implements ICmsHomeTrainingPlanServi
for (PyObjectiveGraduate pyObjectiveGraduate : pyObjectiveGraduates) { for (PyObjectiveGraduate pyObjectiveGraduate : pyObjectiveGraduates) {
String gId = pyObjectiveGraduate.getGraduateId(); String gId = pyObjectiveGraduate.getGraduateId();
for (int i = 0; i < pyGraRequires.size(); i++) { for (int i = 0; i < pyGraRequires.size(); i++) {
boolean b = gId.equals(pyGraRequires.get(i).getId());
if (gId.equals(pyGraRequires.get(i).getId())) { if (gId.equals(pyGraRequires.get(i).getId())) {
pyObjectiveGraduate.setGraduateId(String.valueOf(i + 1)); pyObjectiveGraduate.setGraduateId(String.valueOf(i + 1));
break; break;

@ -8,4 +8,6 @@ package org.jeecg.modules.cms.service;
*/ */
public interface ICmsHomeTrainingPlanService { public interface ICmsHomeTrainingPlanService {
Object getData4Top1(); Object getData4Top1();
Object getData4Top2();
} }

@ -179,10 +179,10 @@ minidao :
jeecg : jeecg :
wordPath: /opt/word wordPath: /opt/word
# 本地:local\Minio:minio\阿里云:alioss # 本地:local\Minio:minio\阿里云:alioss
uploadType: alioss uploadType: local
path : path :
#文件上传根目录 设置 #文件上传根目录 设置
upload: /opt/upFiles upload: /opt/jeecgboot/upFiles/edu
#webapp文件路径 #webapp文件路径
webapp: /opt/webapp webapp: /opt/webapp
shiro: shiro:

Loading…
Cancel
Save