讲师课程培训计划关联机构ID

This commit is contained in:
wans 2021-05-05 14:48:07 +08:00
parent 3d73403c72
commit 84c80dbe25
13 changed files with 171 additions and 24 deletions

View File

@ -1,5 +1,6 @@
package cn.com.tenlion.controller.api.teacher;
import cn.com.tenlion.institutionmanagement.pojo.dtos.institution.InstitutionDTO;
import cn.com.tenlion.pojo.dtos.teacher.TeacherDTO;
import cn.com.tenlion.pojo.vos.teacher.TeacherVO;
import cn.com.tenlion.service.service.ITeacherService;
@ -107,4 +108,12 @@ public class TeacherController extends DefaultBaseController {
return teacherService.delete(ids);
}
@ApiOperation(value = "查询当前用户机构ID", notes = "查询当前用户机构ID接口")
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@GetMapping("getorginfo")
public InstitutionDTO getOrgInfo() throws SearchException {
InstitutionDTO institutionDTO = teacherService.getOrgInfo();
return institutionDTO;
}
}

View File

@ -16,6 +16,8 @@ public class LessonsDTO {
@ApiModelProperty(name = "lessonId", value = "课程ID")
private String lessonId;
@ApiModelProperty(name = "orgId", value = "组织机构ID")
private String orgId;
@ApiModelProperty(name = "projectCatalogId", value = "培训项目类别ID")
private String projectCatalogId;
@ApiModelProperty(name = "lessonName", value = "课程名称")
@ -45,6 +47,14 @@ public class LessonsDTO {
this.lessonId = lessonId;
}
public String getOrgId() {
return orgId == null ? "" : orgId;
}
public void setOrgId(String orgId) {
this.orgId = orgId;
}
public String getProjectCatalogId() {
return projectCatalogId == null ? "" : projectCatalogId.trim();
}

View File

@ -1,7 +1,5 @@
package cn.com.tenlion.pojo.vos.lessons;
import ink.wgink.annotation.CheckEmptyAnnotation;
import ink.wgink.annotation.CheckNumberAnnotation;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@ -18,6 +16,8 @@ public class LessonsVO {
@ApiModelProperty(name = "lessonId", value = "课程ID")
private String lessonId;
@ApiModelProperty(name = "orgId", value = "培训机构ID")
private String orgId;
@ApiModelProperty(name = "projectCatalogId", value = "培训项目类别ID")
private String projectCatalogId;
@ApiModelProperty(name = "lessonName", value = "课程名称")
@ -35,6 +35,14 @@ public class LessonsVO {
this.lessonId = lessonId;
}
public String getOrgId() {
return orgId == null ? "" : orgId;
}
public void setOrgId(String orgId) {
this.orgId = orgId;
}
public String getProjectCatalogId() {
return projectCatalogId == null ? "" : projectCatalogId.trim();
}

View File

@ -1,5 +1,6 @@
package cn.com.tenlion.service.service;
import cn.com.tenlion.institutionmanagement.pojo.dtos.institution.InstitutionDTO;
import cn.com.tenlion.pojo.dtos.teacher.TeacherDTO;
import cn.com.tenlion.pojo.vos.teacher.TeacherVO;
import ink.wgink.exceptions.RemoveException;
@ -76,4 +77,10 @@ public interface ITeacherService {
* @return
*/
List<TeacherDTO> list(Map<String, Object> params);
/**
* 查询当前用户培训机构信息
* @return
*/
InstitutionDTO getOrgInfo();
}

View File

@ -1,15 +1,18 @@
package cn.com.tenlion.service.service.impl;
import cn.com.tenlion.dao.teacher.ITeacherDao;
import cn.com.tenlion.institutionmanagement.pojo.dtos.institution.InstitutionDTO;
import cn.com.tenlion.pojo.dtos.teacher.TeacherDTO;
import cn.com.tenlion.pojo.vos.teacher.TeacherVO;
import cn.com.tenlion.service.service.ITeacherService;
import cn.com.tenlion.service.traininginstitutionuser.ITrainingInstitutionUserService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import ink.wgink.common.base.DefaultBaseService;
import ink.wgink.exceptions.RemoveException;
import ink.wgink.exceptions.SearchException;
import ink.wgink.pojo.ListPage;
import ink.wgink.pojo.bos.UserInfoBO;
import ink.wgink.pojo.result.SuccessResult;
import ink.wgink.pojo.result.SuccessResultData;
import ink.wgink.pojo.result.SuccessResultList;
@ -34,6 +37,8 @@ public class TeacherServiceImpl extends DefaultBaseService implements ITeacherSe
@Autowired
private ITeacherDao teacherDao;
@Autowired
private ITrainingInstitutionUserService trainingInstitutionUserService;
@Override
public SuccessResultList<List<TeacherDTO>> listPage(ListPage page) throws SearchException {
@ -104,4 +109,11 @@ public class TeacherServiceImpl extends DefaultBaseService implements ITeacherSe
teacherDao.delete(params);
return new SuccessResult();
}
@Override
public InstitutionDTO getOrgInfo() {
UserInfoBO currentUser = securityComponent.getCurrentUser();
InstitutionDTO institutionDTO = trainingInstitutionUserService.getByUserId(currentUser.getUserId());
return institutionDTO;
}
}

View File

@ -289,6 +289,9 @@
<if test="workerCatalog != null and workerCatalog != ''">
AND t1.worker_catalog = #{workerCatalog}
</if>
<if test="orgId != null">
AND t1.org_id = #{orgId}
</if>
<if test="keywords != null and keywords != ''">
AND (
t1.id LIKE CONCAT('%', #{keywords}, '%')

View File

@ -4,6 +4,7 @@
<resultMap id="lessonsDTO" type="cn.com.tenlion.pojo.dtos.lessons.LessonsDTO">
<result column="lesson_id" property="lessonId"/>
<result column="org_id" property="orgId"/>
<result column="project_catalog_id" property="projectCatalogId"/>
<result column="lesson_name" property="lessonName"/>
<result column="lesson_type" property="lessonType"/>
@ -45,6 +46,7 @@
<insert id="save" parameterType="map">
INSERT INTO e_lessons(
lesson_id,
org_id,
project_catalog_id,
lesson_name,
lesson_type,
@ -56,6 +58,7 @@
is_delete
) VALUES(
#{lessonId},
#{orgId},
#{projectCatalogId},
#{lessonName},
#{lessonType},
@ -182,19 +185,18 @@
<select id="list" parameterType="map" resultMap="lessonsDTO">
SELECT
t1.lesson_id,
t1.org_id,
t1.project_catalog_id,
t1.lesson_name,
t1.lesson_type,
t1.teach_way,
t1.creator,
t1.gmt_create,
t1.modifier,
t1.gmt_modified,
t1.is_delete
t1.teach_way
FROM
e_lessons t1
WHERE
t1.is_delete = 0
<if test="orgId != null">
AND t1.org_id = #{orgId}
</if>
<if test="projectCatalogId != null and projectCatalogId != ''">
AND t1.project_catalog_id = #{projectCatalogId}
</if>

View File

@ -66,6 +66,22 @@
var common = layui.common;
var resizeTimeout = null;
var tableUrl = 'api/classplan/listpage';
var orgInfo = {};
function initData(){
initDate();
getOrgInfo();
}
initData();
function getOrgInfo(){
top.restAjax.get(top.restAjax.path('api/teacher/getorginfo', []), {}, null, function (code, data) {
orgInfo = data;
initTable();
}, function (code, data) {
top.dialog.msg(data.msg);
});
}
// 初始化表格
function initTable() {
@ -82,6 +98,9 @@
pageName: 'page',
limitName: 'rows'
},
where : {
orgId : orgInfo.institutionId
},
cols: [
[
{type:'checkbox', fixed: 'left'},
@ -228,6 +247,7 @@
}
});
}
// 重载表格
function reloadTable(currentPage) {
table.reload('dataTable', {
@ -235,7 +255,8 @@
where: {
keywords: $('#keywords').val(),
startTime: $('#startTime').val(),
endTime: $('#endTime').val()
endTime: $('#endTime').val(),
orgId : orgInfo.institutionId
},
page: {
curr: currentPage
@ -243,6 +264,7 @@
height: $win.height() - 90,
});
}
// 初始化日期
function initDate() {
// 日期选择
@ -255,6 +277,7 @@
format: 'yyyy-MM-dd'
});
}
// 删除
function removeData(ids) {
top.dialog.msg(top.dataMessage.delete, {
@ -277,8 +300,7 @@
}
});
}
initTable();
initDate();
// 事件 - 页面变化
$win.on('resize', function() {
clearTimeout(resizeTimeout);
@ -296,6 +318,11 @@
var checkStatus = table.checkStatus('dataTable');
var checkDatas = checkStatus.data;
if(layEvent === 'saveEvent') {
if(typeof (orgInfo.institutionId) === 'undefined'
|| orgInfo.institutionId == ''){
layer.msg('当前用户未绑定机构信息');
return;
}
layer.open({
type: 2,
title: false,
@ -303,7 +330,8 @@
area: ['100%', '100%'],
shadeClose: true,
anim: 2,
content: top.restAjax.path('route/classplan/save.html', []),
content: top.restAjax.path('route/classplan/save.html?orgId={orgId}&orgName={orgName}',
[orgInfo.institutionId,orgInfo.institutionName]),
end: function() {
reloadTable();
}

View File

@ -27,6 +27,7 @@
<div class="layui-form-item">
<label class="layui-form-label">培训机构</label>
<div class="layui-input-block">
<input type="hidden" id="orgId" name="orgId">
<input type="text" id="orgName" name="orgName" class="layui-input" value="" readonly="readonly" maxlength="100">
</div>
</div>
@ -235,9 +236,16 @@
var wangEditorObj = {};
var viewerObj = {};
var teacherList = [];
var orgId = top.restAjax.params(window.location.href).orgId;
var orgName = top.restAjax.params(window.location.href).orgName;
// 初始化内容
function initData() {
var dataObj = {}
dataObj['orgId'] = orgId;
dataObj['orgName'] = orgName;
form.val('dataForm',dataObj);
form.render();
initPlanStartTimeDateTime();
initPlanEndTimeDateTime();
initSignUpStartTimeDateTime();
@ -248,16 +256,18 @@
//查询课程列表
function initLessonsList(){
var dataObj = {};
var projectCatalogId = $('#projectCatalogId').val();
if(projectCatalogId == ''){
laytpl(document.getElementById('lessonTbodyTemplate').innerHTML).render([], function(html) {
dataObj['lesson'] = [];
dataObj['teacher'] = [];
laytpl(document.getElementById('lessonTbodyTemplate').innerHTML).render(dataObj, function(html) {
document.getElementById('lessonTbodyBox').innerHTML = html;
});
form.render();
return;
}
top.restAjax.get(top.restAjax.path('api/lessons/list',[]), {projectCatalogId : projectCatalogId}, null, function(code,data){
var dataObj = {};
dataObj['lesson'] = data;
dataObj['teacher'] = teacherList;
laytpl(document.getElementById('lessonTbodyTemplate').innerHTML).render(dataObj, function(html) {

View File

@ -68,6 +68,22 @@
var tableUrl = 'api/lessons/listpage';
var projectCatalogId = top.restAjax.params(window.location.href).projectCatalogId;
var projectCatalogName = top.restAjax.params(window.location.href).parentName;
var orgInfo = {};
function initData(){
initDate();
getOrgInfo()
}
initData();
function getOrgInfo(){
top.restAjax.get(top.restAjax.path('api/teacher/getorginfo', []), {}, null, function (code, data) {
orgInfo = data;
initTable();
}, function (code, data) {
top.dialog.msg(data.msg);
});
}
// 初始化表格
function initTable() {
@ -84,6 +100,9 @@
pageName: 'page',
limitName: 'rows'
},
where : {
orgId : orgInfo.institutionId
},
cols: [
[
{type:'checkbox', fixed: 'left'},
@ -140,6 +159,7 @@
}
});
}
// 重载表格
function reloadTable(currentPage) {
table.reload('dataTable', {
@ -148,7 +168,8 @@
keywords: $('#keywords').val(),
startTime: $('#startTime').val(),
endTime: $('#endTime').val(),
projectCatalogId : projectCatalogId
projectCatalogId : projectCatalogId,
orgId : orgInfo.institutionId
},
page: {
curr: currentPage
@ -190,8 +211,7 @@
}
});
}
initTable();
initDate();
// 事件 - 页面变化
$win.on('resize', function() {
clearTimeout(resizeTimeout);
@ -209,6 +229,11 @@
var checkStatus = table.checkStatus('dataTable');
var checkDatas = checkStatus.data;
if(layEvent === 'saveEvent') {
if(typeof (orgInfo.institutionId) === 'undefined'
|| orgInfo.institutionId == ''){
layer.msg('当前用户未绑定机构信息');
return;
}
layer.open({
type: 2,
title: false,
@ -216,8 +241,10 @@
area: ['100%', '100%'],
shadeClose: true,
anim: 2,
content: top.restAjax.path('route/lessons/save.html?projectCatalogId={projectCatalogId}&projectCatalogName={projectCatalogName}',
[projectCatalogId,projectCatalogName]),
content: top.restAjax.path('route/lessons/save.html' +
'?projectCatalogId={projectCatalogId}&projectCatalogName={projectCatalogName}' +
'&orgId={orgId}',
[projectCatalogId,projectCatalogName,orgInfo.institutionId]),
end: function() {
reloadTable();
}

View File

@ -22,11 +22,12 @@
</div>
<div class="layui-card-body" style="padding: 15px;">
<form class="layui-form layui-form-pane" lay-filter="dataForm">
<input type="hidden" id="orgId" name="orgId">
<div class="layui-form-item">
<label class="layui-form-label">培训项目</label>
<div class="layui-input-block">
<input type="hidden" id="projectCatalogId" name="projectCatalogId">
<input type="text" id="projectCatalogName" name="projectCatalogName" class="layui-input" value="" readonly="readonly" maxlength="36">
<input type="hidden" id="projectCatalogId" name="projectCatalogId" class="layui-input" value="" placeholder="请输入培训项目类别ID" maxlength="36">
</div>
</div>
<div class="layui-form-item">
@ -83,12 +84,14 @@
var viewerObj = {};
var projectCatalogId = top.restAjax.params(window.location.href).projectCatalogId;
var projectCatalogName = top.restAjax.params(window.location.href).projectCatalogName;
var orgId = top.restAjax.params(window.location.href).orgId;
// 初始化内容
function initData() {
var dataObj = {};
dataObj['projectCatalogId'] = projectCatalogId;
dataObj['projectCatalogName'] = projectCatalogName;
dataObj['orgId'] = orgId;
form.val('dataForm', dataObj);
form.render(null, 'dataForm');
}

View File

@ -59,12 +59,22 @@
var laydate = layui.laydate;
var resizeTimeout = null;
var tableUrl = 'api/teacher/listpage';
var orgInfo = {};
function initData(){
initTable();
getOrgInfo();
}
initData();
function getOrgInfo(){
top.restAjax.get(top.restAjax.path('api/teacher/getorginfo', []), {}, null, function (code, data) {
orgInfo = data;
initTable();
}, function (code, data) {
top.dialog.msg(data.msg);
});
}
// 事件 - 页面变化
$win.on('resize', function() {
clearTimeout(resizeTimeout);
@ -92,6 +102,9 @@
pageName: 'page',
limitName: 'rows'
},
where : {
orgId : orgInfo.institutionId
},
cols: [
[
{type:'checkbox', fixed: 'left'},
@ -211,6 +224,7 @@
url: top.restAjax.path(tableUrl, []),
where: {
keywords: $('#keywords').val(),
orgId : orgInfo.institutionId
},
page: {
curr: currentPage
@ -224,6 +238,11 @@
var checkStatus = table.checkStatus('dataTable');
var checkDatas = checkStatus.data;
if(layEvent === 'saveEvent') {
if(typeof (orgInfo.institutionId) === 'undefined'
|| orgInfo.institutionId == ''){
layer.msg('当前用户未绑定机构信息');
return;
}
layer.open({
type: 2,
title: false,
@ -231,7 +250,8 @@
area: ['100%', '100%'],
shadeClose: true,
anim: 2,
content: top.restAjax.path('route/teacher/save.html', []),
content: top.restAjax.path('route/teacher/save.html?orgId={orgId}&orgName={orgName}',
[orgInfo.institutionId,orgInfo.institutionName]),
end: function() {
reloadTable();
}

View File

@ -27,7 +27,8 @@
<div class="layui-form-item">
<label class="layui-form-label">所属机构</label>
<div class="layui-input-block">
<input type="text" id="orgId" name="orgId" class="layui-input" value="" autocomplete="off" placeholder="所属机构" readonly="readonly">
<input type="hidden" id="orgId" name="orgId">
<input type="text" id="orgName" name="orgName" class="layui-input" value="" autocomplete="off" placeholder="所属机构" readonly="readonly">
</div>
</div>
</div>
@ -189,9 +190,16 @@
var laytpl = layui.laytpl;
var laydate = layui.laydate;
var viewerObj = {};
var orgId = top.restAjax.params(window.location.href).orgId;
var orgName = top.restAjax.params(window.location.href).orgName;
// 初始化内容
function initData() {
var dataObj = {}
dataObj['orgId'] = orgId;
dataObj['orgName'] = orgName;
form.val('dataForm',dataObj);
form.render();
initGenderSelect();
initNationSelect();
initPoliticalStatusSelect();