|
|
|
@ -10,17 +10,20 @@ import org.apache.shiro.SecurityUtils; |
|
|
|
|
import org.jeecg.common.aspect.annotation.AutoLog; |
|
|
|
|
import org.jeecg.common.constant.CommonConstant; |
|
|
|
|
import org.jeecg.common.system.base.controller.JeecgController; |
|
|
|
|
import org.jeecg.common.system.query.QueryGenerator; |
|
|
|
|
import org.jeecg.common.system.vo.LoginUser; |
|
|
|
|
import org.jeecg.modules.course.entity.SeCourse; |
|
|
|
|
import org.jeecg.modules.course.service.ISeCourseService; |
|
|
|
|
import org.jeecg.modules.major.entity.SeMajor; |
|
|
|
|
import org.jeecg.modules.major.service.ISeMajorService; |
|
|
|
|
import org.jeecg.modules.py.entity.PyBasicCourse; |
|
|
|
|
import org.jeecg.modules.py.entity.PyBasicInfo; |
|
|
|
|
import org.jeecg.modules.py.entity.PyGraRequire; |
|
|
|
|
import org.jeecg.modules.py.entity.PyTrainingObjective; |
|
|
|
|
import org.jeecg.modules.py.mapper.PyGraRequireMapper; |
|
|
|
|
import org.jeecg.modules.py.mapper.PyTrainingObjectiveMapper; |
|
|
|
|
import org.jeecg.modules.py.service.BasicInfoService; |
|
|
|
|
import org.jeecg.modules.py.service.IPyBasicCourseService; |
|
|
|
|
import org.jeecg.modules.py.utils.MessageConstant; |
|
|
|
|
import org.jeecg.modules.py.utils.R; |
|
|
|
|
import org.jeecg.modules.py.utils.Result; |
|
|
|
@ -32,7 +35,10 @@ import org.springframework.web.bind.annotation.*; |
|
|
|
|
import org.springframework.web.servlet.ModelAndView; |
|
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
import java.util.HashMap; |
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.Map; |
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -60,6 +66,8 @@ public class BasicInfoController extends JeecgController<PyBasicInfo, BasicInfoS |
|
|
|
|
ISeMajorService seMajorService; |
|
|
|
|
@Autowired |
|
|
|
|
private ISeTeacherManageService seTeacherManageService; |
|
|
|
|
@Autowired |
|
|
|
|
private IPyBasicCourseService pyBasicCourseService; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 分页查询所有 |
|
|
|
@ -112,6 +120,58 @@ public class BasicInfoController extends JeecgController<PyBasicInfo, BasicInfoS |
|
|
|
|
return new Result<PyBasicInfo>(true, CommonConstant.SC_OK_200, MessageConstant.QUERY_BSAICINFO_SUCCESS, pyBasicInfo); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 置顶 |
|
|
|
|
* |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
@AutoLog(value = "置顶") |
|
|
|
|
@ApiOperation(value = "置顶", notes = "置顶") |
|
|
|
|
@GetMapping("/zhiding") |
|
|
|
|
public Result<?> zhiding(@RequestParam(name="id",required=true) String id,HttpServletRequest req) { |
|
|
|
|
PyBasicInfo pyBasicInfo = basicInfoService.getById(id); |
|
|
|
|
PyBasicInfo pyBasicInfolist = new PyBasicInfo(); |
|
|
|
|
QueryWrapper<PyBasicInfo> queryWrapper = QueryGenerator.initQueryWrapper(pyBasicInfolist, req.getParameterMap()); |
|
|
|
|
queryWrapper.eq("is_top","是"); |
|
|
|
|
queryWrapper.eq("major_id",pyBasicInfo.getMajorId()); |
|
|
|
|
List<PyBasicInfo> list = basicInfoService.list(queryWrapper); |
|
|
|
|
if(list.size()>0){ |
|
|
|
|
pyBasicInfolist = list.get(0); |
|
|
|
|
pyBasicInfolist.setIsTop("否"); |
|
|
|
|
basicInfoService.updateById(pyBasicInfolist); |
|
|
|
|
} |
|
|
|
|
if(pyBasicInfo!=null){ |
|
|
|
|
pyBasicInfo.setIsTop("是"); |
|
|
|
|
basicInfoService.updateById(pyBasicInfo); |
|
|
|
|
} |
|
|
|
|
return new Result<String>(true,CommonConstant.SC_OK_200,"置顶成功"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ApiOperation(value = "获取置顶课程", notes = "获取置顶课程") |
|
|
|
|
@GetMapping(value = "/getTopCourse") |
|
|
|
|
public org.jeecg.common.api.vo.Result<?> getTopCourse(HttpServletRequest req) { |
|
|
|
|
PyBasicInfo pyBasicInfo = new PyBasicInfo(); |
|
|
|
|
QueryWrapper<PyBasicInfo> queryWrapper = QueryGenerator.initQueryWrapper(pyBasicInfo, req.getParameterMap()); |
|
|
|
|
queryWrapper.eq("is_top","是"); |
|
|
|
|
//写死为软件工程(合作办学)专业
|
|
|
|
|
queryWrapper.eq("major_id","1479007021540012033"); |
|
|
|
|
List<PyBasicInfo> list = basicInfoService.list(queryWrapper); |
|
|
|
|
PyBasicCourse pyBasicCourse = new PyBasicCourse(); |
|
|
|
|
QueryWrapper<PyBasicCourse> queryWrapper1 = QueryGenerator.initQueryWrapper(pyBasicCourse, req.getParameterMap()); |
|
|
|
|
queryWrapper1.eq("basic_id",list.get(0).getBasicId()); |
|
|
|
|
queryWrapper1.eq("status","0"); |
|
|
|
|
List<PyBasicCourse> list1 = pyBasicCourseService.list(queryWrapper1); |
|
|
|
|
List<Map<String,String>> listmap = new ArrayList<>(); |
|
|
|
|
for (int i = 0 ; i < list1.size() ; i++){ |
|
|
|
|
Map<String,String> maptemp = new HashMap<String,String>(); |
|
|
|
|
SeCourse seCourse = seCourseService.getById(list1.get(i).getCourseId()); |
|
|
|
|
maptemp.put("title",seCourse.getName()); |
|
|
|
|
maptemp.put("url","http://localhost:8080/jeecg-boot/sys/common/static/"+seCourse.getImg()); |
|
|
|
|
listmap.add(maptemp); |
|
|
|
|
} |
|
|
|
|
return org.jeecg.common.api.vo.Result.OK(listmap); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 添加保存信息 |
|
|
|
|