修改培训报名申请逻辑添考试申请页面

This commit is contained in:
wans 2021-06-18 18:25:56 +08:00
parent 15cb9fe8a4
commit 9868bb7af7
11 changed files with 103 additions and 94 deletions

View File

@ -176,7 +176,7 @@ public class ApplyController extends DefaultBaseController {
Map<String, Object> params = requestParams();
if(null != params.get("applyAuditStates")){
if(!StringUtils.isBlank(params.get("applyAuditStates").toString())){
params.put("applyAuditStates",Arrays.asList(params.get("applyAuditStates")));
params.put("applyAuditStates",Arrays.asList(params.get("applyAuditStates").toString().split(",")));
}
}
page.setParams(params);

View File

@ -117,8 +117,6 @@ public class ClassPlanController extends DefaultBaseController {
@GetMapping("list-page-exam")
public SuccessResultList<List<ClassPlanDTO>> listPageExam(ListPage page) {
Map<String, Object> params = requestParams();
params.put("examNowDate", DateUtil.getTime());
params.put("reportType", "2");
page.setParams(params);
return classPlanService.listPageExam(page);
}

View File

@ -238,7 +238,7 @@ public class ClassPlanServiceImpl extends DefaultBaseService implements IClassPl
}
String startDate = params.get("startDate").toString();
String endDate = params.get("endDate").toString();
String startTime = params.get("endTime").toString();
String startTime = params.get("startTime").toString();
String endTime = params.get("endTime").toString();
List<String> dayList = new ArrayList<>();
long daySub = DateUtil.getDaySub(startDate, endDate);
@ -343,6 +343,15 @@ public class ClassPlanServiceImpl extends DefaultBaseService implements IClassPl
// 查询当前计划下所有课程和讲师绑定信息
List<Map<String, Object>> lessonTeacherArray = classPlanDao.listClassPlanLessons(classPlanId);
dto.setClassPlanLessons(lessonTeacherArray);
// 查询开班申请审核状态和原因
params.clear();
params.put("workTypeId", dto.getWorkerCatalog());
params.put("orgId", dto.getOrgId());
ExamCheckDTO examCheck = examCheckDao.getExamCheck(params);
if(examCheck != null){
dto.setReportType(examCheck.getCheckStatus() + "");
dto.setReportReason(examCheck.getReason());
}
return dto;
}
@ -400,7 +409,7 @@ public class ClassPlanServiceImpl extends DefaultBaseService implements IClassPl
//处理工种类型
WorkTypeDTO workTypeDTO = workTypeService.get(item.getWorkerCatalog());
item.setWorkerCatalogName(workTypeDTO == null ? "" : workTypeDTO.getWorkTypeName());
//查询审核状态
//查询考试申请状态
queryMap.clear();
queryMap.put("planId", item.getClassPlanId());
queryMap.put("workTypeId", item.getWorkerCatalog());
@ -408,7 +417,7 @@ public class ClassPlanServiceImpl extends DefaultBaseService implements IClassPl
ExamCheckDTO examCheck = examCheckDao.get(queryMap);
item.setReportType(examCheck.getCheckStatus() + "");
//查询报名人数
if(examCheck.getCheckStatus() == 2){
if(examCheck.getCheckStatus() == 1){
List<ApplyStudentsDTO> applyStudentsDTOS = studentsService.listByClssId(item.getClassPlanId());
item.setSignUpUserCount(applyStudentsDTOS == null ? 0 : applyStudentsDTOS.size());
} else {
@ -455,14 +464,16 @@ public class ClassPlanServiceImpl extends DefaultBaseService implements IClassPl
|| page.getParams().get("orgId").toString().length() == 0){
return new SuccessResultList<>(new ArrayList<>(), 0, 0L);
}
// 开班计划审核状态 1通过
page.getParams().put("checkStatus", "1");
// 当前时间,目前约定只有培训结束时间大于当前时间才可以申请考试
// TODO 正式上线时需要将约束放开
//page.getParams().put("examNowDate", DateUtil.getTime());
PageHelper.startPage(page.getPage(), page.getRows());
List<ClassPlanDTO> classPlanDTOs = list(page.getParams());
Map<String,Object> queryMap = getHashMap(4);
for(ClassPlanDTO item : classPlanDTOs){
//处理培训项目
DataDTO dataDTO = dataService.get(item.getProjectCatalogId());
item.setProjectCatalogName(dataDTO == null ? "" : dataDTO.getDataName());
//处理工种类型
// 查询工种类型
WorkTypeDTO workTypeDTO = workTypeService.get(item.getWorkerCatalog());
item.setWorkerCatalogName(workTypeDTO == null ? "" : workTypeDTO.getWorkTypeName());
//查询已报名人数

View File

@ -309,21 +309,23 @@
FROM
e_class_plan t1
LEFT JOIN e_work_type t2 ON t1.worker_catalog = t2.work_type_id
LEFT JOIN management_exam_check t3 ON t1.class_plan_id = t3.plan_id
WHERE
1 = 1
<if test="workerCatalog != null and workerCatalog != ''">
AND t1.worker_catalog = #{workerCatalog}
</if>
<if test="orgId != null">
AND t1.org_id = #{orgId}
</if>
<if test="reportType != null and reportType != ''">
AND t1.report_type = #{reportType}
<if test="workerCatalog != null and workerCatalog != ''">
AND t1.worker_catalog = #{workerCatalog}
</if>
<if test="signNowDate != null and signNowDate != ''">
AND t1.sign_up_start_time <![CDATA[ <= ]]> #{signNowDate}
AND t1.sign_up_end_time <![CDATA[ >= ]]> #{signNowDate}
</if>
<!-- 开班申请表状态-->
<if test="checkStatus != null and checkStatus != ''">
AND t3.check_status = #{checkStatus}
</if>
<if test="examNowDate != null and examNowDate != ''">
AND t1.plan_end_time <![CDATA[ <= ]]> #{examNowDate}
</if>

View File

@ -18,13 +18,7 @@
<div class="layui-card-body">
<div class="test-table-reload-btn" style="margin-bottom: 10px;">
<div class="layui-inline">
<input type="text" id="keywords" class="layui-input search-item" placeholder="输入关键字">
</div>
<div class="layui-inline">
<input type="text" id="startTime" class="layui-input search-item" placeholder="培训开始时间" readonly>
</div>
<div class="layui-inline">
<input type="text" id="endTime" class="layui-input search-item" placeholder="培训结束时间" readonly>
<input type="text" id="keywords" class="layui-input search-item" placeholder="工种|名称|班号|负责人">
</div>
<button type="button" id="search" class="layui-btn layui-btn-sm">
<i class="fa fa-lg fa-search"></i> 搜索
@ -108,31 +102,43 @@
templet: function(row) {
var dom = '';
if(row['examType'] === ''){
dom += '<a type="button" class="layui-btn layui-btn-info layui-btn-xs" lay-event="examEvent">考试申请</a>';
dom += '<a type="button" class="layui-btn layui-btn-info layui-btn-xs" lay-event="examEvent">申请考试</a>';
return dom;
}
if(row['examType'] === '0'){
dom += '<a type="button" class="layui-btn layui-btn-warm layui-btn-xs">审核中</a>';
dom += '<a type="button" class="layui-btn layui-btn-primary layui-btn-xs" lay-event="updateEvent">查看</a>';
dom += '<a type="button" class="layui-btn layui-btn-primary layui-btn-xs" lay-event="updateEvent">查看详情</a>';
return dom;
}
if(row['examType'] === '1' && row['examStatus'] === '1'){
dom += '<a type="button" class="layui-btn layui-btn-normal layui-btn-xs">审核通过</a>';
dom += '<a type="button" class="layui-btn layui-btn-primary layui-btn-xs" lay-event="showEvent">查看</a>';
if(row['examType'] === '1'){
dom += '<a type="button" class="layui-btn layui-btn-primary layui-btn-xs" lay-event="showEvent">查看详情</a>';
return dom;
}
if(row['examType'] === '1' && row['examStatus'] === '0'){
dom += '<a type="button" class="layui-btn layui-btn-normal layui-btn-xs">考场信息安排中</a>';
return dom;
}
if(row['examType'] === '2'){
dom += '<a type="button" class="layui-btn layui-btn-danger layui-btn-xs">审核驳回</a>';
dom += '<a type="button" class="layui-btn layui-btn-primary layui-btn-xs" lay-event="updateEvent">查看</a>';
if(row['examType'] === '-1'){
dom += '<a type="button" class="layui-btn layui-btn-primary layui-btn-xs" lay-event="updateEvent">修改重申</a>';
return dom;
}
}
},
{field: 'planName', width: 180, title: '培训计划名称', align:'center',
{width:120, title: '申请情况', fixed: 'left', align:'center',
templet: function(row) {
var dom = '';
if(row['examType'] === ''){
return '<a type="button" class="layui-btn layui-btn-warm layui-btn-xs">待申请</a>';
}
if(row['examType'] === '0'){
return '<a type="button" class="layui-btn layui-btn-warm layui-btn-xs">申请中</a>';
}
if(row['examType'] === '1'){
dom += '<a type="button" class="layui-btn layui-btn-info layui-btn-xs">申请通过</a>';
return dom;
}
if(row['examType'] === '-1'){
return '<a type="button" class="layui-btn layui-btn-danger layui-btn-xs">申请驳回</a>';
}
return dom;
}
},
{field: 'workerCatalogName', width: 180, title: '申考工种', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
@ -141,14 +147,29 @@
return rowData;
}
},
{field: 'planNumber', width: 200, title: '培训计划编号', align:'center',
{field: 'signUpUserCount', width: 120, title: '申考人数', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
if(typeof(rowData) === 'undefined' || rowData == null || rowData === '') {
return '-';
}
return rowData;
return '<span style="color: #0a54a6">' + rowData + '</span> 人';
}
},
{field: 'planNumber', width: 400, title: '班次及培训名称', align:'center',
templet: function(row) {
var planNumber = row['planNumber'];
var planType = row['planType'];
var planName = row['planName'];
var text = '';
var planNumber = '[' + planNumber + '] ';
if(planType == '1'){
text = '[初训] ' + text;
}
if(planType == '2'){
text = '[复训] ' + text;
}
return text + planNumber + planName;
}
},
{width: 150, title: '培训结束时间', align:'center',
@ -157,21 +178,6 @@
return end.substring(0,10);
}
},
{field: 'planType', width: 120, title: '培训类型', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(rowData == '1'){
return '初训';
}
if(rowData == '2'){
return '复训';
}
if(rowData == '3'){
return '换证';
}
return '-';
}
},
{field: 'projectCatalogName', width: 180, title: '培训项目', align:'center',
templet: function(row) {
var rowData = row[this.field];
@ -181,24 +187,6 @@
return rowData;
}
},
{field: 'workerCatalogName', width: 180, title: '培训工种', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
return rowData;
}
},
{field: 'signUpUserCount', width: 120, title: '报名人数', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData === '') {
return '-';
}
return '<span style="color: #0a54a6">' + rowData + '</span> 人';
}
},
]
],
page: true,
@ -219,8 +207,6 @@
url: top.restAjax.path(tableUrl, []),
where: {
keywords: $('#keywords').val(),
startTime: $('#startTime').val(),
endTime: $('#endTime').val(),
orgId : orgInfo.institutionId
},
page: {
@ -267,7 +253,7 @@
area: ['60%', '80%'],
shadeClose: false,
anim: 2,
content: top.restAjax.path('route/classplan/save-report-exam.html?classPlanId={classPlanId}', [obj.data.classPlanId]),
content: top.restAjax.path('route/classplan/save-exam-commit.html?classPlanId={classPlanId}', [obj.data.classPlanId]),
end: function () {
reloadTable();
}

View File

@ -91,11 +91,6 @@
type: 'get',
url: top.restAjax.path('api/lessons/list-tree-org-work-type?orgId={orgId}', [orgId]),
autoParam: ['id'],
otherParam: {
id : function () {
return parentId;
}
},
dataFilter: function (treeId, parentNode, childNodes) {
if (!childNodes) return null;
for (var i = 0, l = childNodes.length; i < l; i++) {
@ -106,6 +101,7 @@
} else {
childNodes[i].name = str[0];
}
childNodes[i].realName = str[0];
}
return childNodes;
}
@ -122,7 +118,7 @@
return;
}
parentId = treeNode.id;
parentName = treeNode.name;
parentName = treeNode.realName;
$('#treeTitle').text(parentName);
initIFrame();
return false;

View File

@ -74,6 +74,9 @@
<button type="button" id="class-plan-btn-event" class="layui-btn layui-btn-sm layui-btn-normal" style="display: none;">
<i class="layui-icon">&#xe629</i>开班
</button>
<button type="button" id="is-commit-plan-btn" class="layui-btn layui-btn-sm layui-btn-warm" style="display: none;">
<i class="layui-icon">&#xe629</i>已申请开班
</button>
</div>
<table class="layui-hide" id="dataTable" lay-filter="dataTable"></table>
</div>
@ -115,6 +118,7 @@
$('#class-plan-btn-event').show();
} else {
$('#class-plan-btn-event').hide();
$('#is-commit-plan-btn').show();
}
layer.close(loadIndex);
}, function (code, data) {
@ -175,7 +179,8 @@
limitName: 'rows'
},
where : {
applyWorkTypeId : workerCatalog
applyWorkTypeId : workerCatalog,
applyAuditStates : '-1,0,2,3'
},
cols: [
[
@ -254,11 +259,12 @@
templet: function(row) {
var applyAuditState = row['applyAuditState'];
var rowData = '<div class="layui-btn-group">';
rowData +='<button type="button" class="layui-btn layui-btn-xs" lay-event="show">人员详情</button>';
if (applyAuditState === 0) {
rowData +='<button type="button" class="layui-btn layui-btn-danger layui-btn-xs" lay-event="audit">审核</button>';
rowData +='<button type="button" class="layui-btn layui-btn-danger layui-btn-xs" lay-event="audit">查审</button>';
} else {
rowData +='<button type="button" class="layui-btn layui-btn-xs" lay-event="show">详情</button>';
}
rowData +='<button type="button" class="layui-btn layui-btn-warm layui-btn-xs" lay-event="audithistory">审核记录</button>'
rowData +='<button type="button" class="layui-btn layui-btn-warm layui-btn-xs" lay-event="audithistory">历史</button>'
rowData +='</div>';
return rowData;
}
@ -285,7 +291,7 @@
keywords: $('#keywords').val(),
startTime: $('#startTime').val(),
endTime: $('#endTime').val(),
applyAuditStates:$('#applyAuditStates').val(),
applyAuditStates:$('#applyAuditStates').val() == '' ? '-1,0,2,3' : $('#applyAuditStates').val(),
applyWorkTypeId : workerCatalog
},
page: {

View File

@ -18,7 +18,7 @@
<div class="layui-card-body">
<div class="test-table-reload-btn" style="margin-bottom: 10px;">
<div class="layui-inline">
<input type="text" id="keywords" class="layui-input search-item" autocomplete="off" placeholder="工种类别|名称|班号|负责人">
<input type="text" id="keywords" class="layui-input search-item" autocomplete="off" placeholder="工种|名称|班号|负责人">
</div>
<div class="layui-inline">
<input type="text" id="startTime" class="layui-input search-item" placeholder="开始时间" readonly>
@ -97,12 +97,12 @@
dom += '<a type="button" class="layui-btn layui-btn-info layui-btn-xs" lay-event="showEvent">查看申请</a>';
return dom;
}
if(row['reportType'] === '2'){
if(row['reportType'] === '1'){
dom += '<a type="button" class="layui-btn layui-btn-normal layui-btn-xs" lay-event="signUpUserEvent">报名人员</a>';
dom += '<a type="button" class="layui-btn layui-btn-normal layui-btn-xs">申请通过</a>';
dom += '<a type="button" class="layui-btn layui-btn-normal layui-btn-xs" lay-event="showEvent">申请通过</a>';
return dom;
}
if(row['reportType'] === '3'){
if(row['reportType'] === '-1'){
dom += '<a type="button" class="layui-btn layui-btn-normal layui-btn-xs" lay-event="signUpUserEvent">报名人员</a>';
dom += '<a type="button" class="layui-btn layui-btn-danger layui-btn-xs" lay-event="unPassEvent">修改重申</a>';
return dom;
@ -116,11 +116,11 @@
if(row['reportType'] === '0'){
return '<a type="button" class="layui-btn layui-btn-warm layui-btn-xs">等待审核</a>';
}
if(row['reportType'] === '2'){
if(row['reportType'] === '1'){
dom += '<a type="button" class="layui-btn layui-btn-info layui-btn-xs">审核通过</a>';
return dom;
}
if(row['reportType'] === '3'){
if(row['reportType'] === '-1'){
return '<a type="button" class="layui-btn layui-btn-danger layui-btn-xs">审核未通过</a>';
}
return dom;
@ -223,6 +223,7 @@
},
height: $win.height() - 90,
});
}
// 初始化日期

View File

@ -461,6 +461,7 @@
var loadLayerIndex;
top.restAjax.post(top.restAjax.path('api/classplan/save', []), formData.field, null, function(code, data) {
top.dialog.close(index);
top.dialog.msg('申请已递交');
closeBox();
}, function(code, data) {
top.dialog.msg(data.msg);

View File

@ -259,7 +259,7 @@
initPlanPDFUploadFile();
initPlanStartTimeDateTime();
initPlanEndTimeDateTime();
if(dataFormData['reportReason'] != ''){
if(dataFormData['reportReason'] != '' || dataFormData['reportType'] == '-1'){
$('#report-reason-block').text('未通过原因:' + dataFormData['reportReason']);
$('#report-reason-block').show();
}

View File

@ -488,6 +488,14 @@
self.resizeTimeout = null;
}, 500);
});
top.restAjax.get(top.restAjax.path('api/teacher/getorginfo', []), {}, null, function (code, data) {
if(typeof (data.institutionName) != 'undefined'
&& data.institutionName != ''){
$(parent.document).find('#sideMenu .layui-logo span').text(data.institutionName);
}
}, function (code, data) {
top.dialog.msg(data.msg);
});
}
})