diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/cms/controller/CmsHomeTrainingPlanController.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/cms/controller/CmsHomeTrainingPlanController.java index f0835b4..7456346 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/cms/controller/CmsHomeTrainingPlanController.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/cms/controller/CmsHomeTrainingPlanController.java @@ -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()); + } } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/cms/service/CmsHomeTrainingPlanServiceImpl.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/cms/service/CmsHomeTrainingPlanServiceImpl.java index 60b5e8a..baf19ac 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/cms/service/CmsHomeTrainingPlanServiceImpl.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/cms/service/CmsHomeTrainingPlanServiceImpl.java @@ -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 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 returnMap = new LinkedHashMap<>(); + + PyBasicInfo basicInfo = this.getTopPyBasicInfo(); + if (ObjectUtils.isEmpty(basicInfo)) return returnMap; + + String basicId = basicInfo.getBasicId(); + + // 查该培养方案对应的课程 + List basicCourseList = pyBasicCourseService.list(new LambdaQueryWrapper() + .eq(PyBasicCourse::getBasicId, basicId) + .eq(PyBasicCourse::getStatus, "0")); + + List 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 pyGraRequires = pyGraRequireService.list(queryWrapper2); + List 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() .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; diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/cms/service/ICmsHomeTrainingPlanService.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/cms/service/ICmsHomeTrainingPlanService.java index fe48cdc..0716915 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/cms/service/ICmsHomeTrainingPlanService.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/cms/service/ICmsHomeTrainingPlanService.java @@ -10,4 +10,6 @@ public interface ICmsHomeTrainingPlanService { Object getData4Top1(); Object getData4Top2(); + + Object getData4Top3(); } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/application-dev.yml b/jeecg-boot/jeecg-boot-module-system/src/main/resources/application-dev.yml index a6df848..d24da92 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/resources/application-dev.yml +++ b/jeecg-boot/jeecg-boot-module-system/src/main/resources/application-dev.yml @@ -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 设置