cms首页-置顶培养方案 课程与毕业要求关系功能添加

dev_2307
hechao.zhu 1 year ago
parent 98350f4c19
commit c21650bacb
  1. 7
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/cms/controller/CmsHomeTrainingPlanController.java
  2. 74
      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-dev.yml

@ -37,4 +37,11 @@ public class CmsHomeTrainingPlanController {
public Result<?> getData4Top2() {
return Result.OK(iCmsHomeTrainingPlanService.getData4Top2());
}
@ApiOperation(value = "获取已置顶培养方案-课程与毕业要求的关系矩阵")
@GetMapping(value = "/getData4Top3")
public Result<?> getData4Top3() {
return Result.OK(iCmsHomeTrainingPlanService.getData4Top3());
}
}

@ -18,10 +18,7 @@ import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
* @Description: TODO
@ -52,6 +49,13 @@ public class CmsHomeTrainingPlanServiceImpl implements ICmsHomeTrainingPlanServi
@Autowired
private IPyCourseConstituteService pyCourseConstituteService;
@Autowired
private ISysUserService iSysUserService;
@Autowired
private ISeCourseService iSeCourseService;
@Override
public Object getData4Top1() {
@ -125,12 +129,6 @@ 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<>();
@ -162,6 +160,57 @@ public class CmsHomeTrainingPlanServiceImpl implements ICmsHomeTrainingPlanServi
return returnMap;
}
/**
* @Title: getData4Top3
* @Description: 课程与毕业要求的关系矩阵
* @Params: []
* @Return: java.lang.Object
* @Author: z.h.c
* @Date: 2023/9/13 9:25
*/
@Override
public Object getData4Top3() {
Map<String, Object> returnMap = new LinkedHashMap<>();
PyBasicInfo basicInfo = this.getTopPyBasicInfo();
if (ObjectUtils.isEmpty(basicInfo)) return returnMap;
String basicId = basicInfo.getBasicId();
// 查该培养方案对应的课程
List<PyBasicCourse> basicCourseList = pyBasicCourseService.list(new LambdaQueryWrapper<PyBasicCourse>()
.eq(PyBasicCourse::getBasicId, basicId)
.eq(PyBasicCourse::getStatus, "0"));
List<SeCourse> seCourseList = new LinkedList<>();
Optional.ofNullable(basicCourseList).orElse(new LinkedList<>()).forEach(pyBasicCourse -> {
SeCourse seCourse = iSeCourseService.getById(pyBasicCourse.getCourseId());
if (!ObjectUtils.isEmpty(seCourse)) {
seCourse.setAchievement("");
seCourseList.add(seCourse);
}
returnMap.put("课程列表", seCourseList);
});
// 查找毕业要求
QueryWrapper queryWrapper2 = new QueryWrapper();
queryWrapper2.eq("basic_id", basicId);
queryWrapper2.ne("pid", 0);
queryWrapper2.ne("has_child", 0);
List<PyGraRequire> pyGraRequires = pyGraRequireService.list(queryWrapper2);
List<PyGraRequire> pyGraRequireList = new LinkedList<>();
for (PyGraRequire py : pyGraRequires) {
String str = py.getGraduateRequire();
py.setGraduateRequire(str.split(":")[0]);
pyGraRequireList.add(py);
}
returnMap.put("毕业要求", pyGraRequireList);
return returnMap;
}
/**
* @description: 获取已置顶的培养方案
* @param: []
@ -174,8 +223,9 @@ public class CmsHomeTrainingPlanServiceImpl implements ICmsHomeTrainingPlanServi
PyBasicInfo pyBasicInfo = basicInfoService.getOne(new LambdaQueryWrapper<PyBasicInfo>()
.eq(PyBasicInfo::getStatu, "0")
// .eq(PyBasicInfo::getBasicId, "8bb1e5211f1390cdbda8ef9d723723eb")
.eq(PyBasicInfo::getBasicId, "236ee773b155859e845d9568ba02297b")
//.eq(PyBasicInfo::getStatu, 置顶标志)
.eq(PyBasicInfo::getBasicId, "485e2cbe976455f5683b816993799b66")
// .eq(PyBasicInfo::getBasicId, "236ee773b155859e845d9568ba02297b")
// .eq(PyBasicInfo::getIsTop, "是")
.last("limit 1")
);
return pyBasicInfo;

@ -10,4 +10,6 @@ public interface ICmsHomeTrainingPlanService {
Object getData4Top1();
Object getData4Top2();
Object getData4Top3();
}

@ -144,7 +144,7 @@ spring:
#redis 配置
redis:
database: 2
host: 127.0.0.1
host: 182.92.169.222
lettuce:
pool:
max-active: 8 #最大连接数据库连接数,设 -1 为没有限制
@ -152,8 +152,8 @@ spring:
max-wait: -1ms #最大建立连接等待时间。如果超过此时间将接到异常。设为-1表示无限制。
min-idle: 0 #最小等待连接中的数量,设 0 为没有限制
shutdown-timeout: 100ms
password: ''
port: 6379
password: 'redis@ycwl2022.'
# password: 'zy2021zy'
# port: 7480
#mybatis plus 设置

Loading…
Cancel
Save