培养方案置顶以及CMS置顶课程展示接口

dev_2307
Gitea 1 year ago
parent ecb80e2a0e
commit fac276f9a3
  1. 5
      ant-design-vue-jeecg/src/views/py/PyBasicCourseList.vue
  2. 21
      ant-design-vue-jeecg/src/views/py/PyBasicInfoList.vue
  3. 19
      ant-design-vue-jeecg/src/views/py/modules/PyBasicCourseForm.vue
  4. 60
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/py/controller/BasicInfoController.java
  5. 3
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/py/entity/PyBasicInfo.java

@ -35,7 +35,7 @@
<!-- 操作按钮区域 --> <!-- 操作按钮区域 -->
<div class="table-operator"> <div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button> <a-button @click="handleAdd" type="primary" icon="plus">设置培养方案课程</a-button>
</div> </div>
<!-- table区域-begin --> <!-- table区域-begin -->
<div> <div>
@ -102,7 +102,6 @@ export default {
title: '培养方案名称', title: '培养方案名称',
dataIndex: 'pyBasicInfo.chartHead', dataIndex: 'pyBasicInfo.chartHead',
align: 'center', align: 'center',
width: '30px',
ellipsis: true, ellipsis: true,
}, },
/*{ /*{
@ -158,6 +157,7 @@ export default {
title: '课程名称', title: '课程名称',
align: 'center', align: 'center',
dataIndex: 'seCourse.name', dataIndex: 'seCourse.name',
ellipsis: true,
}, },
{ {
title: '学期', title: '学期',
@ -168,7 +168,6 @@ export default {
{ {
title: '课程学分', title: '课程学分',
align: 'center', align: 'center',
width: 10,
dataIndex: 'seCourse.credit', dataIndex: 'seCourse.credit',
}, },
{ {

@ -96,7 +96,8 @@
<!--&lt;!&ndash; <a v-has="'py:edit'" @click="handleAdd1(record)">编辑</a>&ndash;&gt;--> <!--&lt;!&ndash; <a v-has="'py:edit'" @click="handleAdd1(record)">编辑</a>&ndash;&gt;-->
<!-- &lt;!&ndash; 更多 里面修改详情和删除&ndash;&gt;--> <!-- &lt;!&ndash; 更多 里面修改详情和删除&ndash;&gt;-->
<!-- <a-divider v-has="'py:edit'" type="vertical" />--> <!-- <a-divider v-has="'py:edit'" type="vertical" />-->
<a @click="zhiding(record)" >置顶</a>
<a-divider type="vertical" />
<a @click="handleEdit(record)" >编辑</a> <a @click="handleEdit(record)" >编辑</a>
<a-divider type="vertical" /> <a-divider type="vertical" />
@ -274,6 +275,11 @@ export default {
align: 'center', align: 'center',
dataIndex: 'startorstop_dicText', dataIndex: 'startorstop_dicText',
}, },
{
title: '是否置顶',
align: 'center',
dataIndex: 'isTop',
},
/*{ /*{
title: '修学年限', title: '修学年限',
align: 'center', align: 'center',
@ -288,8 +294,6 @@ export default {
title: '操作', title: '操作',
dataIndex: 'action', dataIndex: 'action',
align: 'center', align: 'center',
fixed: 'right',
width: 147,
scopedSlots: { customRender: 'action' }, scopedSlots: { customRender: 'action' },
}, },
], ],
@ -300,6 +304,7 @@ export default {
exportXlsUrl: '/py/pyBasicInfo/exportXls', exportXlsUrl: '/py/pyBasicInfo/exportXls',
importExcelUrl: 'py/pyBasicInfo/importExcel', importExcelUrl: 'py/pyBasicInfo/importExcel',
getId: '/py/basicinfo/', getId: '/py/basicinfo/',
zhiding:'/py/basicinfo/zhiding',
}, },
dictOptions: { dictOptions: {
collegeId: [], collegeId: [],
@ -331,6 +336,16 @@ export default {
}, },
}, },
methods: { methods: {
zhiding(record){
getAction(this.url.zhiding,{id:record.basicId}).then((res) => {
if (res.flag) {
this.$message.success("置顶成功");
this.loadData();
}else{
this.$message.error("置顶失败");
}
})
},
handleAdd1(){ handleAdd1(){
this.$router.push({ this.$router.push({
path: '/py/PyAddProject', path: '/py/PyAddProject',

@ -86,7 +86,9 @@ export default {
data() { data() {
return { return {
queryParam: { queryParam: {
coursecategory: '0' coursecategory: '0',
deptId: '',
majorId: '',
}, },
dicode: "se_major,name,id", dicode: "se_major,name,id",
basicInfoCode: "py_basic_info,chart_head,id", basicInfoCode: "py_basic_info,chart_head,id",
@ -105,7 +107,8 @@ export default {
url: { url: {
list: "py/pyBasicCourse/queryCourse4BasicInfo", list: "py/pyBasicCourse/queryCourse4BasicInfo",
add: "py/pyBasicCourse/add", add: "py/pyBasicCourse/add",
queryBasicInfoList: "py/pyBasicCourse/queryBasicInfoList" queryBasicInfoList: "py/pyBasicCourse/queryBasicInfoList",
dqyh: '/course/seCourse/dqyh',
}, },
selectedRowKeys: [], selectedRowKeys: [],
selectionRows: [], selectionRows: [],
@ -187,7 +190,19 @@ export default {
// this.modelDefault = JSON.parse(JSON.stringify(this.model)); // this.modelDefault = JSON.parse(JSON.stringify(this.model));
// console.log("modelDefault---->", modelDefault) // console.log("modelDefault---->", modelDefault)
}, },
mounted () {
this.getData()
},
methods: { methods: {
getData () {
getAction(this.url.dqyh).then((res) => {
if (res.success) {
this.queryParam.deptId = res.result.depid
this.queryParam.majorId = res.result.majorid
this.basicInfoCode = "py_basic_info,chart_head,id, major_id='" + this.queryParam.majorId + "'";
}
})
},
onSelectChange(selectedRowKeys, selectionRows) { onSelectChange(selectedRowKeys, selectionRows) {
this.selectedRowKeys = selectedRowKeys this.selectedRowKeys = selectedRowKeys
this.selectionRows = selectionRows this.selectionRows = selectionRows

@ -10,17 +10,20 @@ import org.apache.shiro.SecurityUtils;
import org.jeecg.common.aspect.annotation.AutoLog; import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.constant.CommonConstant; import org.jeecg.common.constant.CommonConstant;
import org.jeecg.common.system.base.controller.JeecgController; 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.common.system.vo.LoginUser;
import org.jeecg.modules.course.entity.SeCourse; import org.jeecg.modules.course.entity.SeCourse;
import org.jeecg.modules.course.service.ISeCourseService; import org.jeecg.modules.course.service.ISeCourseService;
import org.jeecg.modules.major.entity.SeMajor; import org.jeecg.modules.major.entity.SeMajor;
import org.jeecg.modules.major.service.ISeMajorService; 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.PyBasicInfo;
import org.jeecg.modules.py.entity.PyGraRequire; import org.jeecg.modules.py.entity.PyGraRequire;
import org.jeecg.modules.py.entity.PyTrainingObjective; import org.jeecg.modules.py.entity.PyTrainingObjective;
import org.jeecg.modules.py.mapper.PyGraRequireMapper; import org.jeecg.modules.py.mapper.PyGraRequireMapper;
import org.jeecg.modules.py.mapper.PyTrainingObjectiveMapper; import org.jeecg.modules.py.mapper.PyTrainingObjectiveMapper;
import org.jeecg.modules.py.service.BasicInfoService; 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.MessageConstant;
import org.jeecg.modules.py.utils.R; import org.jeecg.modules.py.utils.R;
import org.jeecg.modules.py.utils.Result; import org.jeecg.modules.py.utils.Result;
@ -32,7 +35,10 @@ import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
@ -60,6 +66,8 @@ public class BasicInfoController extends JeecgController<PyBasicInfo, BasicInfoS
ISeMajorService seMajorService; ISeMajorService seMajorService;
@Autowired @Autowired
private ISeTeacherManageService seTeacherManageService; 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 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);
}
/** /**
* 添加保存信息 * 添加保存信息

@ -86,4 +86,7 @@ public class PyBasicInfo implements Serializable {
@Dict(dictTable = "set_status", dicText = "type", dicCode = "id") @Dict(dictTable = "set_status", dicText = "type", dicCode = "id")
private String startorstop;//启用或停用 private String startorstop;//启用或停用
@ApiModelProperty(value = "是否置顶")
private String isTop;
} }

Loading…
Cancel
Save