main
王家东 7 months ago
parent b5c7398dbf
commit d5ecd33bc1
  1. 1
      ant-design-vue-jeecg/package.json
  2. 19
      ant-design-vue-jeecg/src/config/router.config.js
  3. 4
      ant-design-vue-jeecg/src/views/course/SeCourseList.vue
  4. 2
      ant-design-vue-jeecg/src/views/course/modules/yjjk/courseGoal.vue
  5. 103
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/course/controller/SeCourseController.java
  6. 113
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/course/controller/XinsecourseController.java
  7. 9
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/course/mapper/SeChapterMapper.java
  8. 3
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/course/service/ISeChapterService.java
  9. 10
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/course/service/impl/SeChapterServiceImpl.java
  10. 4
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/course/vo/SeChildChapterVo.java
  11. 89
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/knowcourse/controller/KnowcourseController.java

@ -10,6 +10,7 @@
"lint": "vue-cli-service lint"
},
"dependencies": {
"element-ui": "^2.15.6",
"3d-force-graph": "^1.73.3",
"@antv/data-set": "^0.11.4",
"@jeecg/antd-online-mini": "2.4.5-RC",

@ -387,4 +387,23 @@ export const constantRouterMap = [
component: () => import(/* webpackChunkName: "fail" */ '@/views/exception/404')
},
{
path: '/chapterManage',
component: () => import(/* webpackChunkName: "fail" */ '@/views/course/modules/yjjk/chapterManage')
},
{
path: '/knowledgeManage',
component: () => import(/* webpackChunkName: "fail" */ '@/views/course/modules/yjjk/knowledgeManage')
},
{
path: '/TestWay',
component: () => import(/* webpackChunkName: "fail" */ '@/views/course/modules/yjjk/TestWay')
},
]

@ -106,8 +106,8 @@
</template>
<span slot="action" slot-scope="text, record">
<!-- <a @click="tojk(record)">建课</a>
<a-divider type="vertical" />-->
<a @click="tojk(record)">建课</a>
<a-divider type="vertical" />
<a @click="handleEdit1(record)">编辑</a>
<a-divider type="vertical" />
<!-- 修改 -->

@ -225,7 +225,7 @@ export default {
if (this.setNum<3){
this.setNum++
this.$router.push({
path:'./chapterManage',
path:'/chapterManage',
query:this.tokenid
})
}

@ -21,6 +21,8 @@ import org.jeecg.modules.course.entity.SeCourse;
import org.jeecg.modules.course.entity.SeCourseobjectives;
import org.jeecg.modules.course.mapper.SeChapterMapper;
import org.jeecg.modules.course.service.*;
import org.jeecg.modules.course.vo.SeChapterVo;
import org.jeecg.modules.course.vo.SeChildChapterVo;
import org.jeecg.modules.demo.know.entity.SeKonw;
import org.jeecg.modules.demo.know.service.ISeKonwService;
import org.jeecg.modules.demo.knowcourse.entity.Knowcourse;
@ -884,6 +886,107 @@ public class SeCourseController extends JeecgController<SeCourse, ISeCourseServi
}
/**
* 通过课程ID查询
*
* @return
*/
@AutoLog(value = "章节-通过课程ID查询")
@ApiOperation(value = "章节-通过课程ID查询", notes = "章节-通过课程ID查询")
@GetMapping(value = "/listSeChapterByCourseId")
public Result<?> listSeChapterByCourseId(SeCourse course, HttpServletRequest req) {
List<SeChapterVo> seChapterVos = seChapterService.chapterList(course.getId(), "0");
//查询课程的总学时,总章节,总小节,总知识点
//总学时
SeCourse seCourse = seCourseService.getById(course.getId());
Integer classhours = seCourse.getClasshours();
//总章节
QueryWrapper<SeChapter> chapterQueryWrapper = new QueryWrapper<>();
chapterQueryWrapper.eq("pid", 0);
chapterQueryWrapper.eq("courseid", course.getId());
int chapterCount = seChapterService.count(chapterQueryWrapper);
//总小节
QueryWrapper<SeChapter> childChapterQw = new QueryWrapper<>();
childChapterQw.ne("pid", 0);
childChapterQw.eq("courseid", course.getId());
int childChapterCount = seChapterService.count(childChapterQw);
//总知识点
QueryWrapper<Knowcourse> knowcourseQueryWrapper = new QueryWrapper<>();
knowcourseQueryWrapper.eq("kcid", course.getId());
int knowCounts = knowcourseService.count(knowcourseQueryWrapper);
//遍历章节
int size = seChapterVos.size();
for (int i = 0; i < size; i++) {
Double used = 0.0;
List<SeChildChapterVo> childList = seChapterService.childChapterList(seChapterVos.get(i).getId());
//遍历本章的小节
for (SeChildChapterVo childChapterVo : childList) {
//计算本章已分配的学时
used += childChapterVo.getTotalclasshours();
//把知识点放到小节里
QueryWrapper<Knowcourse> knowcourseQueryWrapper1 = new QueryWrapper<>();
knowcourseQueryWrapper1.eq("uintid", childChapterVo.getId());
List<Knowcourse> list = knowcourseService.list(knowcourseQueryWrapper1);
Double usedKnow = 0.0;
for (Knowcourse knowcourse : list) {
usedKnow += knowcourse.getXs();
}
childChapterVo.setUsedKnow(usedKnow);
childChapterVo.setKonwLeave((double) Math.round((childChapterVo.getTotalclasshours() - usedKnow) * 1000) / 1000.0);
childChapterVo.setKnowcourses(list);
childChapterVo.setShowList(false);
}
seChapterVos.get(i).setChildCount(childList.size());
seChapterVos.get(i).setLeaveKonw((double) Math.round((seChapterVos.get(i).getTotalclasshours() - used) * 1000) / 1000.0);
seChapterVos.get(i).setUsedKnow(used);
seChapterVos.get(i).setChildChapter(childList);
seChapterVos.get(i).setShowList(false);
}
HashMap<Object, Object> hashMap = new HashMap<>();
hashMap.put("chapterList", seChapterVos);
hashMap.put("classhours", classhours);
hashMap.put("chapterCount", chapterCount);
hashMap.put("childChapterCount", childChapterCount);
hashMap.put("knowCounts", knowCounts);
return Result.ok(hashMap);
}
@AutoLog(value = "课程目标-通过课程查询")
@ApiOperation(value = "课程目标-通过课程查询", notes = "课程目标-通过课程查询")
@GetMapping(value = "/listByCourseId")
public Result<?> listByCourseId(@RequestParam(name = "courseid", required = true) String courseid) {
QueryWrapper<SeCourseobjectives> seCourseobjectivesQueryWrapper = new QueryWrapper<>();
seCourseobjectivesQueryWrapper.eq("courseid", courseid);
List<SeCourseobjectives> list = seCourseobjectivesService.list(seCourseobjectivesQueryWrapper);
return Result.ok(list);
}
/**
* 修改内容和细则
*
* @param seCourse
* @return
*/
@AutoLog(value = "修改内容和细则")
@ApiOperation(value = "修改内容和细则", notes = "修改内容和细则")
@PutMapping(value = "/editnrxz")
public Result<?> editnrxz(@RequestBody SeCourse seCourse) {
SeCourse sc = seCourseService.getById(seCourse.getId());
sc.setContentdistribution(seCourse.getContentdistribution());
sc.setAssessmentrules(seCourse.getAssessmentrules());
seCourseService.updateById(sc);
return Result.ok("成功!");
}
@AutoLog(value = "考核目标-分页列表查询")
@ApiOperation(value = "考核目标-分页列表查询", notes = "考核目标-分页列表查询")
@GetMapping(value = "/getnrxz")
public Result<?> getnrxz(@RequestParam(name = "id", required = true)String id) {
SeCourse sc = seCourseService.getById(id);
return Result.ok(sc);
}

@ -1,9 +1,26 @@
package org.jeecg.modules.course.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.modules.course.entity.SeCoureseType;
import org.jeecg.modules.course.entity.SeCourseobjectives;
import org.jeecg.modules.course.service.ISeCourseobjectivesService;
import org.jeecg.modules.course.service.ISeCourseobjectivesService1;
import org.jeecg.modules.course.service.ISecourseMethodService;
import org.jeecg.modules.course.vo.SeCourseobjectives1;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.List;
@Api(tags = "新课程")
@RestController
@ -11,5 +28,99 @@ import org.springframework.web.bind.annotation.*;
@Slf4j
public class XinsecourseController {
@Autowired
private ISeCourseobjectivesService1 seCourseobjectivesService1;
@Autowired
private ISecourseMethodService iSecourseMethodService;
@AutoLog(value = "课程目标-分页列表查询")
@ApiOperation(value = "课程目标-分页列表查询", notes = "课程目标-分页列表查询")
@GetMapping(value = "/rootList")
public Result<?> queryPageList(SeCourseobjectives seCourseobjectives,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
System.out.println(seCourseobjectives.toString());
SeCourseobjectives sp=seCourseobjectivesService1.findParent(seCourseobjectives.getCourseid(),seCourseobjectives.getPid());
HashMap<Object,Object> hashMap=new HashMap<>();
hashMap.put("parent",sp);
if(sp==null){
hashMap.put("child",null);
return Result.ok(hashMap);
}
List<SeCourseobjectives1> list=seCourseobjectivesService1.findchild(sp.getId());
hashMap.put("child",list);
return Result.ok(hashMap);
}
@AutoLog(value = "Main-添加or修改")
@ApiOperation(value = "Main-添加or修改", notes = "Main-添加or修改")
@PostMapping(value = "/mainadd")
public Result<?> mainadd(@RequestBody SeCourseobjectives1 seCourseobjectives1){
System.out.println(seCourseobjectives1.toString());
if(seCourseobjectives1.getId()==null||seCourseobjectives1.getId().equals("")){
int a=seCourseobjectivesService1.selectcout(seCourseobjectives1.getCourseid());
if(a>=1)
return Result.error("数据库已存在,新增失败");
seCourseobjectivesService1.save(seCourseobjectives1);
return Result.ok("新增成功");
}else{
seCourseobjectivesService1.updateById(seCourseobjectives1);
return Result.ok("修改成功");
}
}
@AutoLog(value = "Child-添加or修改")
@ApiOperation(value = "Child-添加or修改", notes = "Child-添加or修改")
@PostMapping(value = "/childadd")
public Result<?> childadd(@RequestBody SeCourseobjectives1 seCourseobjectives1){
System.out.println(seCourseobjectives1.toString());
if(seCourseobjectives1.getId()==null||seCourseobjectives1.getId().equals("")){
if(seCourseobjectives1.getPid()==null||seCourseobjectives1.getPid().equals(""))
return Result.error("总体目标尚未确定,请先添加总体目标!!");
seCourseobjectivesService1.save(seCourseobjectives1);
seCourseobjectivesService1.updateChildSize(seCourseobjectives1.getPid());
return Result.ok("新增成功");
}else{
seCourseobjectivesService1.updateById(seCourseobjectives1);
return Result.ok("修改成功");
}
}
@AutoLog(value = "Child-删除")
@ApiOperation(value = "Child-删除", notes = "Child-删除")
@DeleteMapping(value = "/childdelete")
public Result<?> childdelete(@RequestParam(name = "id", required = true)String id){
seCourseobjectivesService1.deleteChild(id);
return Result.ok("删除成功!");
}
//考核方式*************************
@AutoLog(value = "考核-添加or修改")
@ApiOperation(value = "考核-添加or修改", notes = "考核-添加or修改")
@PostMapping(value = "/methodadd")
public Result<?> methodAdd(@RequestBody SeCoureseType seCoureseType){
System.out.println(seCoureseType.toString());
if(Integer.valueOf(seCoureseType.getFinalExam())+Integer.valueOf(seCoureseType.getProcessAssessment())!=100)
return Result.error("比例划分错误");
if(seCoureseType.getId()==null||seCoureseType.getId().equals("")){
QueryWrapper<SeCoureseType> queryWrapper=new QueryWrapper<>();
queryWrapper.eq("name",seCoureseType.getName());
int a=iSecourseMethodService.count(queryWrapper);
if(a>0)
return Result.error("已存在比例划分");
iSecourseMethodService.save(seCoureseType);
return Result.ok("新增成功!!!");
}
else {
iSecourseMethodService.updateById(seCoureseType);
return Result.ok("修改成功!!!");
}
}
@AutoLog(value = "考核目标-分页列表查询")
@ApiOperation(value = "考核目标-分页列表查询", notes = "考核目标-分页列表查询")
@GetMapping(value = "/methodList")
public Result<?> queryMethod(@RequestParam(name = "id", required = true)String id) {
QueryWrapper<SeCoureseType> queryWrapper=new QueryWrapper<>();
queryWrapper.eq("name",id);
SeCoureseType seCoureseType=iSecourseMethodService.getOne(queryWrapper);
return Result.ok(seCoureseType);
}
}

@ -4,6 +4,9 @@ package org.jeecg.modules.course.mapper;
import org.apache.ibatis.annotations.Select;
import org.jeecg.modules.course.entity.SeChapter;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.jeecg.modules.course.vo.SeChapterVo;
import java.util.List;
/**
@ -22,4 +25,10 @@ public interface SeChapterMapper extends BaseMapper<SeChapter> {
@Select("select courseid from se_chapter where id = #{c}")
String getkcid(String c);
@Select("select * from se_chapter where courseid = #{courseId} and pid = #{pid}")
List<SeChapterVo> chapterList(String courseId, String pid);
@Select("select * from se_chapter where pid = #{pid}")
List<org.jeecg.modules.course.vo.SeChildChapterVo> childChapterList(String pid);
}

@ -23,5 +23,8 @@ public interface ISeChapterService extends IService<SeChapter> {
String getchapterid(String c);
String getkcid(String c);
List<SeChapterVo> chapterList(String courseId,String pid);
List<SeChildChapterVo> childChapterList(String pid);
}

@ -37,4 +37,14 @@ public class SeChapterServiceImpl extends ServiceImpl<SeChapterMapper, SeChapter
public String getkcid(String c) {
return seChapterMapper.getkcid(c);
}
@Override
public List<SeChapterVo> chapterList(String courseId, String pid) {
return seChapterMapper.chapterList(courseId,pid);
}
@Override
public List<SeChildChapterVo> childChapterList(String pid) {
return seChapterMapper.childChapterList(pid);
}
}

@ -7,7 +7,7 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.jeecg.common.aspect.annotation.Dict;
import org.jeecg.modules.demo.knowcourse.entity.Knowcourse;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
@ -139,5 +139,5 @@ public class SeChildChapterVo implements Serializable {
private Boolean showList;
private List<Knowcourse> Knowcourses;
}

@ -23,6 +23,8 @@ import org.jeecg.modules.course.service.ISeChapterService;
import org.jeecg.modules.course.service.ISeCourseService;
import org.jeecg.modules.course.service.ISeCourseobjectivesService;
import org.jeecg.modules.demo.know.entity.SeKonw;
import org.jeecg.modules.demo.know.service.ISeKonwService;
import org.jeecg.modules.demo.knowcourse.entity.Knowcourse;
import org.jeecg.modules.demo.knowcourse.service.IKnowcourseService;
@ -68,6 +70,9 @@ public class KnowcourseController extends JeecgController<Knowcourse, IKnowcours
@Autowired
private ISeCourseService seCourseService;
@Autowired
private ISeKonwService seKonwService;
/**
* 分页列表查询
@ -455,6 +460,90 @@ public class KnowcourseController extends JeecgController<Knowcourse, IKnowcours
return Result.OK(knowcourse);
}
/**
*
* @param knowcourse
* @return
*/
@AutoLog(value = "知识点课程目标-添加课程知识点和知识点")
@ApiOperation(value = "知识点课程目标-添加课程知识点和知识点", notes = "知识点课程目标-添加课程知识点和知识点")
@PostMapping(value = "/add1")
public Result<?> add1(@RequestBody Knowcourse knowcourse) {
//知识点库里没有的情况,先向知识点库里添加
if (knowcourse.getKnowid().equals("")|| knowcourse.getKnowid() == ""){
SeKonw seKonw = new SeKonw();
seKonw.setName(knowcourse.getKnow());
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
String getrealname =sysUser.getRealname();
seKonw.setInrealname(getrealname);
seKonwService.save(seKonw);
knowcourse.setKnowid(seKonw.getId());
}
//设置课程目标 名称
if (knowcourse.getKcmb().equals("")|| knowcourse.getKcmb().equals(null)){
SeCourseobjectives mb = seCourseobjectivesService.getById(knowcourse.getKcmbid());
knowcourse.setKcmb(mb.getName());
}
//判断知识点的学时是否大于小节总学时
SeChapter chapter = seChapterService.getById(knowcourse.getUintid());
Double totalclasshours = chapter.getTotalclasshours();
if (totalclasshours < knowcourse.getXs() ){
return Result.error("知识点学时大于本小节学时");
}
QueryWrapper<Knowcourse> seChapterQueryWrapper = new QueryWrapper<>();
seChapterQueryWrapper.eq("uintid",knowcourse.getUintid());
List<Knowcourse> list = knowcourseService.list(seChapterQueryWrapper);
Double toutalXs = 0.0;
for (Knowcourse knowcourse1 : list){
toutalXs += knowcourse1.getXs();
}
if (totalclasshours-toutalXs < knowcourse.getXs()){
return Result.error("知识点的学时超过本小节的学时,本节共有" + totalclasshours + "学时。所有知识点已经占有" + toutalXs + "学时。请仔细检查");
}
knowcourseService.save(knowcourse);
return Result.ok("添加成功!");
}
/**
*
* @param knowcourse
* @return
*/
@AutoLog(value = "知识点课程目标-修改课程知识点")
@ApiOperation(value = "知识点课程目标-修改课程知识点", notes = "知识点课程目标-修改课程知识点")
@PutMapping(value = "/edit1")
public Result<?> edit1(@RequestBody Knowcourse knowcourse) {
//设置课程目标 名称
if (knowcourse.getKcmb().equals("")|| knowcourse.getKcmb().equals(null)){
SeCourseobjectives mb = seCourseobjectivesService.getById(knowcourse.getKcmbid());
knowcourse.setKcmb(mb.getName());
}
//看知识点的学时是否大于小节总学时
SeChapter chapter = seChapterService.getById(knowcourse.getUintid());
Double totalclasshours = chapter.getTotalclasshours();
if (totalclasshours < knowcourse.getXs() ){
return Result.error("知识点学时大于本小节学时");
}
QueryWrapper<Knowcourse> seChapterQueryWrapper = new QueryWrapper<>();
seChapterQueryWrapper.eq("uintid",knowcourse.getUintid());
List<Knowcourse> list = knowcourseService.list(seChapterQueryWrapper);
Double toutalXs = 0.0;
for (Knowcourse knowcourse1 : list){
toutalXs += knowcourse1.getXs();
}
if (totalclasshours-toutalXs < knowcourse.getXs()){
return Result.error("知识点的学时超过本小节的学时,本节共有" + totalclasshours + "学时。所有知识点已经占有" + toutalXs + "学时。请仔细检查");
}
knowcourseService.updateById(knowcourse);
return Result.ok("编辑成功!");
}
}

Loading…
Cancel
Save