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 4bfc79b..f0835b4 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 @@ -26,9 +26,15 @@ public class CmsHomeTrainingPlanController { @Autowired private ICmsHomeTrainingPlanService iCmsHomeTrainingPlanService; - @ApiOperation(value = "获取已置顶培养方案", notes = "获取已置顶培养方案") + @ApiOperation(value = "获取已置顶培养方案-data1") @GetMapping(value = "/getData4Top1") public Result getData4Top1() { return Result.OK(iCmsHomeTrainingPlanService.getData4Top1()); } + + @ApiOperation(value = "获取已置顶培养方案-课程") + @GetMapping(value = "/getData4Top2") + public Result getData4Top2() { + return Result.OK(iCmsHomeTrainingPlanService.getData4Top2()); + } } 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 97035ec..60b5e8a 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 @@ -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; @@ -63,7 +68,7 @@ public class CmsHomeTrainingPlanServiceImpl implements ICmsHomeTrainingPlanServi PyTrainingObjective pyTrainingObjective = pyTrainingObjectiveService.getOne(new LambdaQueryWrapper() .eq(PyTrainingObjective::getBasicId, basicId) .eq(PyTrainingObjective::getPid, "0") - .last( "limit 1") + .last("limit 1") ); returnMap.put("培养目标描述", pyTrainingObjective); @@ -120,6 +125,43 @@ public class CmsHomeTrainingPlanServiceImpl implements ICmsHomeTrainingPlanServi return returnMap; } + @Autowired + private ISysUserService iSysUserService; + + @Autowired + private ISeCourseService iSeCourseService; + + @Override + public Object getData4Top2() { + Map returnMap = new LinkedHashMap<>(); + List pyBasicCourseList; + + PyBasicInfo basicInfo = this.getTopPyBasicInfo(); + if (ObjectUtils.isEmpty(basicInfo)) return returnMap; + + final String basicId = basicInfo.getBasicId(); + pyBasicCourseList = pyBasicCourseService.list(new LambdaQueryWrapper() + .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().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: [] @@ -130,10 +172,11 @@ public class CmsHomeTrainingPlanServiceImpl implements ICmsHomeTrainingPlanServi PyBasicInfo getTopPyBasicInfo() { PyBasicInfo pyBasicInfo = basicInfoService.getOne(new LambdaQueryWrapper() - .eq(PyBasicInfo::getStatu, "0") - .eq(PyBasicInfo::getBasicId, "8bb1e5211f1390cdbda8ef9d723723eb") - //.eq(PyBasicInfo::getStatu, 置顶标志) - .last("limit 1") + .eq(PyBasicInfo::getStatu, "0") +// .eq(PyBasicInfo::getBasicId, "8bb1e5211f1390cdbda8ef9d723723eb") + .eq(PyBasicInfo::getBasicId, "236ee773b155859e845d9568ba02297b") + //.eq(PyBasicInfo::getStatu, 置顶标志) + .last("limit 1") ); return pyBasicInfo; } @@ -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; 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 3b15c13..fe48cdc 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 @@ -8,4 +8,6 @@ package org.jeecg.modules.cms.service; */ public interface ICmsHomeTrainingPlanService { Object getData4Top1(); + + Object getData4Top2(); } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/application-prod.yml b/jeecg-boot/jeecg-boot-module-system/src/main/resources/application-prod.yml index 3fd4577..2906291 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/resources/application-prod.yml +++ b/jeecg-boot/jeecg-boot-module-system/src/main/resources/application-prod.yml @@ -179,10 +179,10 @@ minidao : jeecg : wordPath: /opt/word # 本地:local\Minio:minio\阿里云:alioss - uploadType: alioss + uploadType: local path : #文件上传根目录 设置 - upload: /opt/upFiles + upload: /opt/jeecgboot/upFiles/edu #webapp文件路径 webapp: /opt/webapp shiro: