人才培养方案新增下拉框
This commit is contained in:
+10
@@ -1,5 +1,6 @@
|
||||
package com.roomroot.web.controller.jwgl;
|
||||
|
||||
import com.roomroot.jwgl.entity.JXGLJG;
|
||||
import com.roomroot.jwgl.entity.ZYB;
|
||||
import com.roomroot.jwgl.service.TrainingProgramService;
|
||||
import com.roomroot.jwgl.unit.PageQuery;
|
||||
@@ -10,6 +11,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 培养方案管理控制器
|
||||
@@ -137,4 +139,12 @@ public class TrainingProgramController {
|
||||
public void exportData(HttpServletResponse response) throws Exception {
|
||||
trainingProgramService.exportZYBExcel(response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 教学管理机构下拉选项(来自教学管理机构表,提交编号、展示名称)。
|
||||
*/
|
||||
@GetMapping("/teaching-organizations")
|
||||
public Result<List<JXGLJG>> listTeachingOrganizations() {
|
||||
return Result.success(trainingProgramService.listTeachingOrganizations());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.roomroot.jwgl.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.roomroot.jwgl.entity.JXGLJG;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 教学管理机构 Mapper
|
||||
*/
|
||||
@Mapper
|
||||
public interface JXGLJGMapper extends BaseMapper<JXGLJG> {
|
||||
|
||||
/**
|
||||
* 查询未停用的教学管理机构,供下拉选项使用。
|
||||
*/
|
||||
@Select("SELECT \"编号\" AS bh, \"名称\" AS mc FROM \"教学管理机构\" "
|
||||
+ "WHERE (\"停用\" = 0 OR \"停用\" IS NULL) ORDER BY \"名称\"")
|
||||
List<JXGLJG> selectEnabledOptions();
|
||||
}
|
||||
+8
@@ -1,10 +1,13 @@
|
||||
package com.roomroot.jwgl.service;
|
||||
|
||||
import com.roomroot.jwgl.entity.JXGLJG;
|
||||
import com.roomroot.jwgl.entity.ZYB;
|
||||
import com.roomroot.jwgl.unit.PageQuery;
|
||||
import com.roomroot.jwgl.unit.PageResult;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 培养方案管理服务接口
|
||||
* <p>
|
||||
@@ -59,4 +62,9 @@ public interface TrainingProgramService {
|
||||
|
||||
/** 导出培养方案(专业)到 Excel(.xlsx) */
|
||||
void exportZYBExcel(jakarta.servlet.http.HttpServletResponse response) throws Exception;
|
||||
|
||||
/**
|
||||
* 查询未停用的教学管理机构下拉选项。
|
||||
*/
|
||||
List<JXGLJG> listTeachingOrganizations();
|
||||
}
|
||||
|
||||
+11
@@ -2,7 +2,9 @@ package com.roomroot.jwgl.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.roomroot.jwgl.entity.JXGLJG;
|
||||
import com.roomroot.jwgl.entity.ZYB;
|
||||
import com.roomroot.jwgl.mapper.JXGLJGMapper;
|
||||
import com.roomroot.jwgl.mapper.ZYBMapper;
|
||||
import com.roomroot.jwgl.service.TrainingProgramService;
|
||||
import com.roomroot.jwgl.unit.PageQuery;
|
||||
@@ -28,6 +30,9 @@ public class TrainingProgramServiceImpl implements TrainingProgramService {
|
||||
@Resource
|
||||
private ZYBMapper zybMapper;
|
||||
|
||||
@Resource
|
||||
private JXGLJGMapper jxgljgMapper;
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void add(ZYB entity) {
|
||||
@@ -114,4 +119,10 @@ public class TrainingProgramServiceImpl implements TrainingProgramService {
|
||||
response.getOutputStream().write(bytes);
|
||||
response.getOutputStream().flush();
|
||||
}
|
||||
|
||||
@Override
|
||||
public java.util.List<JXGLJG> listTeachingOrganizations() {
|
||||
java.util.List<JXGLJG> list = jxgljgMapper.selectEnabledOptions();
|
||||
return list == null ? java.util.Collections.emptyList() : list;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user