forked from liweijie/education
人才培养方案新增下拉框
This commit is contained in:
+10
@@ -1,5 +1,6 @@
|
|||||||
package com.roomroot.web.controller.jwgl;
|
package com.roomroot.web.controller.jwgl;
|
||||||
|
|
||||||
|
import com.roomroot.jwgl.entity.JXGLJG;
|
||||||
import com.roomroot.jwgl.entity.ZYB;
|
import com.roomroot.jwgl.entity.ZYB;
|
||||||
import com.roomroot.jwgl.service.TrainingProgramService;
|
import com.roomroot.jwgl.service.TrainingProgramService;
|
||||||
import com.roomroot.jwgl.unit.PageQuery;
|
import com.roomroot.jwgl.unit.PageQuery;
|
||||||
@@ -10,6 +11,7 @@ import org.springframework.web.bind.annotation.*;
|
|||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 培养方案管理控制器
|
* 培养方案管理控制器
|
||||||
@@ -137,4 +139,12 @@ public class TrainingProgramController {
|
|||||||
public void exportData(HttpServletResponse response) throws Exception {
|
public void exportData(HttpServletResponse response) throws Exception {
|
||||||
trainingProgramService.exportZYBExcel(response);
|
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;
|
package com.roomroot.jwgl.service;
|
||||||
|
|
||||||
|
import com.roomroot.jwgl.entity.JXGLJG;
|
||||||
import com.roomroot.jwgl.entity.ZYB;
|
import com.roomroot.jwgl.entity.ZYB;
|
||||||
import com.roomroot.jwgl.unit.PageQuery;
|
import com.roomroot.jwgl.unit.PageQuery;
|
||||||
import com.roomroot.jwgl.unit.PageResult;
|
import com.roomroot.jwgl.unit.PageResult;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 培养方案管理服务接口
|
* 培养方案管理服务接口
|
||||||
* <p>
|
* <p>
|
||||||
@@ -59,4 +62,9 @@ public interface TrainingProgramService {
|
|||||||
|
|
||||||
/** 导出培养方案(专业)到 Excel(.xlsx) */
|
/** 导出培养方案(专业)到 Excel(.xlsx) */
|
||||||
void exportZYBExcel(jakarta.servlet.http.HttpServletResponse response) throws Exception;
|
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.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.roomroot.jwgl.entity.JXGLJG;
|
||||||
import com.roomroot.jwgl.entity.ZYB;
|
import com.roomroot.jwgl.entity.ZYB;
|
||||||
|
import com.roomroot.jwgl.mapper.JXGLJGMapper;
|
||||||
import com.roomroot.jwgl.mapper.ZYBMapper;
|
import com.roomroot.jwgl.mapper.ZYBMapper;
|
||||||
import com.roomroot.jwgl.service.TrainingProgramService;
|
import com.roomroot.jwgl.service.TrainingProgramService;
|
||||||
import com.roomroot.jwgl.unit.PageQuery;
|
import com.roomroot.jwgl.unit.PageQuery;
|
||||||
@@ -28,6 +30,9 @@ public class TrainingProgramServiceImpl implements TrainingProgramService {
|
|||||||
@Resource
|
@Resource
|
||||||
private ZYBMapper zybMapper;
|
private ZYBMapper zybMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private JXGLJGMapper jxgljgMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public void add(ZYB entity) {
|
public void add(ZYB entity) {
|
||||||
@@ -114,4 +119,10 @@ public class TrainingProgramServiceImpl implements TrainingProgramService {
|
|||||||
response.getOutputStream().write(bytes);
|
response.getOutputStream().write(bytes);
|
||||||
response.getOutputStream().flush();
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -94,6 +94,18 @@ export function downloadTrainingProgramTemplate() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 教学管理机构下拉选项
|
||||||
|
* GET /training/teaching-organizations
|
||||||
|
* 返回:[{ bh, mc }]
|
||||||
|
*/
|
||||||
|
export function listTeachingOrganizations() {
|
||||||
|
return request({
|
||||||
|
url: '/training/teaching-organizations',
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导入培养方案 Excel(multipart,字段名 file)
|
* 导入培养方案 Excel(multipart,字段名 file)
|
||||||
* POST /training/import
|
* POST /training/import
|
||||||
|
|||||||
@@ -323,7 +323,7 @@
|
|||||||
<el-descriptions-item label="专业版本">{{ fmtVal(detail.data.zybb) }}</el-descriptions-item>
|
<el-descriptions-item label="专业版本">{{ fmtVal(detail.data.zybb) }}</el-descriptions-item>
|
||||||
<el-descriptions-item label="主干专业">{{ fmtYesNo(detail.data.zgzy) }}</el-descriptions-item>
|
<el-descriptions-item label="主干专业">{{ fmtYesNo(detail.data.zgzy) }}</el-descriptions-item>
|
||||||
<el-descriptions-item label="自定义分类">{{ fmtVal(detail.data.zdyfl) }}</el-descriptions-item>
|
<el-descriptions-item label="自定义分类">{{ fmtVal(detail.data.zdyfl) }}</el-descriptions-item>
|
||||||
<el-descriptions-item label="教学管理机构">{{ fmtVal(detail.data.jxgljgbh) }}</el-descriptions-item>
|
<el-descriptions-item label="教学管理机构">{{ fmtOrg(detail.data.jxgljgbh) }}</el-descriptions-item>
|
||||||
<el-descriptions-item label="规范名称">{{ fmtVal(detail.data.gfmc) }}</el-descriptions-item>
|
<el-descriptions-item label="规范名称">{{ fmtVal(detail.data.gfmc) }}</el-descriptions-item>
|
||||||
<el-descriptions-item label="专业规范">{{ fmtVal(detail.data.zygf) }}</el-descriptions-item>
|
<el-descriptions-item label="专业规范">{{ fmtVal(detail.data.zygf) }}</el-descriptions-item>
|
||||||
<el-descriptions-item label="简称">{{ fmtVal(detail.data.jc) }}</el-descriptions-item>
|
<el-descriptions-item label="简称">{{ fmtVal(detail.data.jc) }}</el-descriptions-item>
|
||||||
@@ -356,7 +356,8 @@ import {
|
|||||||
listTraining,
|
listTraining,
|
||||||
exportTrainingProgram,
|
exportTrainingProgram,
|
||||||
downloadTrainingProgramTemplate,
|
downloadTrainingProgramTemplate,
|
||||||
importTrainingProgram
|
importTrainingProgram,
|
||||||
|
listTeachingOrganizations
|
||||||
} from '@/api/teachBusiness/training'
|
} from '@/api/teachBusiness/training'
|
||||||
import { getDicts } from '@/api/system/dict/data'
|
import { getDicts } from '@/api/system/dict/data'
|
||||||
import { optionselect } from '@/api/system/dict/type'
|
import { optionselect } from '@/api/system/dict/type'
|
||||||
@@ -416,27 +417,31 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/**
|
/**
|
||||||
* 从系统字典加载表单下拉选项;文本业务字段提交标签,机构字段提交编号。
|
* 从系统字典加载表单下拉选项;文本业务字段提交标签。
|
||||||
|
* 教学管理机构来自业务表,提交编号、展示名称。
|
||||||
*/
|
*/
|
||||||
async loadTrainingDictionaries() {
|
async loadTrainingDictionaries() {
|
||||||
const emptyResponse = { data: [] }
|
const emptyResponse = { data: [] }
|
||||||
const [typeResponse, levelResponse, dictTypeResponse] = await Promise.all([
|
const [typeResponse, levelResponse, dictTypeResponse, organizationResponse] = await Promise.all([
|
||||||
getDicts(TRAINING_TYPE_DICT_CODE).catch(() => emptyResponse),
|
getDicts(TRAINING_TYPE_DICT_CODE).catch(() => emptyResponse),
|
||||||
getDicts(TRAINING_LEVEL_DICT_CODE).catch(() => emptyResponse),
|
getDicts(TRAINING_LEVEL_DICT_CODE).catch(() => emptyResponse),
|
||||||
optionselect().catch(() => emptyResponse)
|
optionselect().catch(() => emptyResponse),
|
||||||
|
listTeachingOrganizations().catch(() => emptyResponse)
|
||||||
])
|
])
|
||||||
this.trainingTypeOptions = typeResponse.data || []
|
this.trainingTypeOptions = typeResponse.data || []
|
||||||
this.trainingLevelOptions = levelResponse.data || []
|
this.trainingLevelOptions = levelResponse.data || []
|
||||||
|
this.teachingOrganizationOptions = (organizationResponse.data || []).map(item => ({
|
||||||
|
dictLabel: item.mc,
|
||||||
|
dictValue: item.bh
|
||||||
|
}))
|
||||||
|
|
||||||
const dictTypes = dictTypeResponse.data || []
|
const dictTypes = dictTypeResponse.data || []
|
||||||
const [directionOptions, categoryOptions, organizationOptions] = await Promise.all([
|
const [directionOptions, categoryOptions] = await Promise.all([
|
||||||
this.loadNamedDictionary(dictTypes, '专业方向'),
|
this.loadNamedDictionary(dictTypes, '专业方向'),
|
||||||
this.loadNamedDictionary(dictTypes, '学员类别'),
|
this.loadNamedDictionary(dictTypes, '学员类别')
|
||||||
this.loadNamedDictionary(dictTypes, '教学管理机构')
|
|
||||||
])
|
])
|
||||||
this.majorDirectionOptions = directionOptions
|
this.majorDirectionOptions = directionOptions
|
||||||
this.studentCategoryOptions = categoryOptions
|
this.studentCategoryOptions = categoryOptions
|
||||||
this.teachingOrganizationOptions = organizationOptions
|
|
||||||
this.mergeExistingSelectOptions()
|
this.mergeExistingSelectOptions()
|
||||||
},
|
},
|
||||||
async loadNamedDictionary(dictTypes, dictName) {
|
async loadNamedDictionary(dictTypes, dictName) {
|
||||||
@@ -673,6 +678,13 @@ export default {
|
|||||||
},
|
},
|
||||||
fmtVal(val) {
|
fmtVal(val) {
|
||||||
return val === '' || val === null || val === undefined ? '-' : val
|
return val === '' || val === null || val === undefined ? '-' : val
|
||||||
|
},
|
||||||
|
fmtOrg(bh) {
|
||||||
|
if (bh === '' || bh === null || bh === undefined) {
|
||||||
|
return '-'
|
||||||
|
}
|
||||||
|
const matched = this.teachingOrganizationOptions.find(item => String(item.dictValue) === String(bh))
|
||||||
|
return matched ? matched.dictLabel : bh
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user