开班计划和考试申请增加统计。

This commit is contained in:
Renpc-kilig 2021-05-13 16:22:29 +08:00
parent 3e1b1ef423
commit 7a252476ee
3 changed files with 579 additions and 3 deletions

View File

@ -238,11 +238,11 @@ public class ExamApplyServiceImpl extends DefaultBaseService implements IExamApp
@Override
public Map<String, Object> statistics(Map<String, Object> params) {
params.put("checkStatus", 1);
params.put("checkStatus", 0);
Integer noCheck = statisticsCount(params);
params.put("checkStatus", 2);
params.put("checkStatus", 1);
Integer pass = statisticsCount(params);
params.put("checkStatus", 3);
params.put("checkStatus", 2);
Integer fail = statisticsCount(params);
params = new HashMap<>(1);
params.put("noCheck", noCheck);

View File

@ -203,11 +203,14 @@ public class ExamCheckServiceImpl extends DefaultBaseService implements IExamChe
@Override
public Map<String, Object> statistics(Map<String, Object> params) {
params.put("checkStatus", 0);
Integer noCheck = statisticsCount(params);
params.put("checkStatus", 2);
Integer pass = statisticsCount(params);
params.put("checkStatus", 3);
Integer fail = statisticsCount(params);
params = new HashMap<>(1);
params.put("noCheck", noCheck);
params.put("pass", pass);
params.put("fail", fail);
return params;

View File

@ -0,0 +1,573 @@
<!doctype html>
<html lang="en">
<head>
<base href="/signup/">
<meta charset="utf-8">
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
<link rel="stylesheet" href="assets/fonts/font-awesome/css/font-awesome.css"/>
<link rel="stylesheet" href="assets/layuiadmin/layui/css/layui.css" media="all">
<link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all">
<link rel="stylesheet" type="text/css" href="assets/js/vendor/viewer/viewer.min.css">
</head>
<body>
<div class="layui-fluid layui-anim layui-anim-fadein">
<div class="layui-card">
<div class="layui-card-header">
<span class="layui-breadcrumb" lay-filter="breadcrumb" style="visibility: visible;">
<a class="close" href="javascript:void(0);">上级列表</a><span lay-separator="">/</span>
<a href="javascript:void(0);"><cite>编辑内容</cite></a>
</span>
</div>
<div class="layui-card-body" style="padding: 15px;">
<blockquote class="site-text layui-elem-quote">
培训机构提交信息
</blockquote>
<form class="layui-form layui-form-pane" lay-filter="initDataForm">
<div class="layui-form-item">
<label class="layui-form-label">培训计划</label>
<div class="layui-input-block">
<input type="text" id="plan" name="plan" class="layui-input" value="培训计划" placeholder="请输入培训计划" maxlength="255" readonly>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">计划名称</label>
<div class="layui-input-block">
<input type="text" id="planName" name="planName" class="layui-input" value="" placeholder="请输入计划名称" maxlength="255" readonly>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">计划类型</label>
<div class="layui-input-block">
<input type="text" id="planType" name="planType" class="layui-input" value="" placeholder="请输入计划名称" maxlength="255" readonly>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">考试机构</label>
<div class="layui-input-block">
<input type="text" id="orgName" name="orgName" class="layui-input" value="考试机构" placeholder="请输入考试机构" maxlength="255" readonly>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">计划人数</label>
<div class="layui-input-block">
<input type="number" id="planPersonNum" name="planPersonNum" class="layui-input" value="" placeholder="请输入计划人数" maxlength="255" readonly>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label" style="width: 120px;">计划开始时间</label>
<div class="layui-input-block" style="margin-left: 120px;">
<input type="text" id="planStartTime" name="planStartTime" class="layui-input" value="" placeholder="请输入计划人数" maxlength="255" readonly>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label" style="width: 120px;">计划结束时间</label>
<div class="layui-input-block" style="margin-left: 120px;">
<input type="text" id="planEndTime" name="planEndTime" class="layui-input" value="" placeholder="请输入计划人数" maxlength="255" readonly>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">培训地点</label>
<div class="layui-input-block">
<input type="text" id="planAddress" name="planAddress" class="layui-input" value="" placeholder="请输入计划人数" maxlength="255" readonly>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">负责人</label>
<div class="layui-input-block">
<input type="text" id="chargePerson" name="chargePerson" class="layui-input" value="" placeholder="请输入计划人数" maxlength="255" readonly>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">联系方式</label>
<div class="layui-input-block">
<input type="text" id="chargePersonTel" name="chargePersonTel" class="layui-input" value="" placeholder="请输入计划人数" maxlength="255" readonly>
</div>
</div>
</form>
<blockquote class="site-text layui-elem-quote">
应急局填写信息
</blockquote>
<form class="layui-form layui-form-pane" lay-filter="dataForm">
<!-- 考试申请ID -->
<input type="hidden" id="examId" name="examId" value="123456">
<div class="layui-form-item">
<label class="layui-form-label" style="width: 130px;">考试申请编号</label>
<div class="layui-input-block" style="margin-left: 130px;">
<input type="text" id="examApplyNum" name="examApplyNum" class="layui-input" value="" placeholder="考试申请编号" maxlength="255" readonly>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">发证机关</label>
<div class="layui-input-block">
<input type="text" id="certificateOffice" name="certificateOffice" class="layui-input" value="" lay-verify="required" placeholder="请输入发证机关" maxlength="255" readonly>
</div>
</div>
<div class="layui-form-item" id="theoryAddressDiv">
<label class="layui-form-label" style="width: 130px;">理论考试地点</label>
<div class="layui-input-block layui-form" id="theoryExamAddressIdSelectTemplateBox" lay-filter="theoryExamAddressIdSelectTemplateBox" style="margin-left: 130px;"></div>
<script id="theoryExamAddressIdSelectTemplate" type="text/html">
<select id="theoryExamAddressId" name="theoryExamAddressId" lay-search>
<option value="">请选择理论考试地点</option>
{{# for(var i = 0, item; item = d[i++];) { }}
<option value="{{item.institutionId}}">{{item.institutionName}}</option>
{{# } }}
</select>
</script>
</div>
<div class="layui-form-item layui-row" id="theoryTimeDiv">
<div class="layui-col-lg6">
<label class="layui-form-label" style="width: 144px;">理论考试开始时间</label>
<div class="layui-input-block" style="margin-left: 144px;">
<input type="text" id="theoryExamStartTime" name="theoryExamStartTime" class="layui-input" value="" placeholder="请选择理论考试开始时间" readonly style="cursor: pointer;" lay-verify="required" readonly>
</div>
</div>
<div class="layui-col-lg6">
<label class="layui-form-label" style="width: 144px;">理论考试结束时间</label>
<div class="layui-input-block" style="margin-left: 144px;">
<input type="text" id="theoryExamEndTime" name="theoryExamEndTime" class="layui-input" value="" placeholder="请选择理论考试结束时间" readonly style="cursor: pointer;" lay-verify="required" readonly>
</div>
</div>
</div>
<div class="layui-form-item" id="practiceAddressDiv">
<label class="layui-form-label" style="width: 130px;">实操考试地点</label>
<div class="layui-input-block layui-form" id="practiceExamAddressIdSelectTemplateBox" lay-filter="practiceExamAddressIdSelectTemplateBox" style="margin-left: 130px;"></div>
<script id="practiceExamAddressIdSelectTemplate" type="text/html">
<select id="practiceExamAddressId" name="practiceExamAddressId" lay-search>
<option value="">请选择实操考试地点</option>
{{# for(var i = 0, item; item = d[i++];) { }}
<option value="{{item.institutionId}}">{{item.institutionName}}</option>
{{# } }}
</select>
</script>
</div>
<div class="layui-form-item layui-row" id="practiceTimeDiv">
<div class="layui-col-lg6">
<label class="layui-form-label" style="width: 144px;">实操考试开始时间</label>
<div class="layui-input-block" style="margin-left: 144px;">
<input type="text" id="practiceExamStartTime" name="practiceExamStartTime" class="layui-input" value="" placeholder="请选择实操开始时间" readonly style="cursor: pointer;" readonly>
</div>
</div>
<div class="layui-col-lg6">
<label class="layui-form-label" style="width: 144px;">实操考试结束时间</label>
<div class="layui-input-block" style="margin-left: 144px;">
<input type="text" id="practiceExamEndTime" name="practiceExamEndTime" class="layui-input" value="" placeholder="请选择实操考试结束时间" readonly style="cursor: pointer;" readonly>
</div>
</div>
</div>
<div class="layui-form-item layui-form-text">
<label class="layui-form-label">缴费凭证</label>
<div class="layui-input-block">
<input type="hidden" id="paymentVoucher" name="paymentVoucher">
<div class="layui-btn-container" id="paymentVoucherFileBox" style="border: 1px solid #e6e6e6;"></div>
<script id="paymentVoucherFileDownload" type="text/html">
{{# var fileName = 'paymentVoucher'; }}
{{# if(d[fileName].length > 0) { }}
{{# var files = d[fileName];}}
{{# for(var i = 0, item = files[i]; item = files[i++];) { }}
<div class="upload-image-box">
<span class="upload-image-span">
<img src="route/file/download/false/{{item.fileId}}" align="加载失败">
</span>
<a class="layui-btn layui-btn-xs layui-btn-danger text-danger remove-image" href="javascript:void(0);" lay-form-button data-id="{{item.fileId}}" data-name="{{fileName}}" lay-filter="paymentVoucherRemoveFile">
<i class="fa fa-trash-o"></i>
</a>
</div>
{{# } }}
{{# } }}
{{# if(d[fileName].length < 9) { }}
<div class="upload-image-box" style="width: auto; height: auto; padding: 5px;">
<a href="javascript:void(0);" lay-form-button data-explain="缴费凭证" data-name="paymentVoucher" lay-filter="paymentVoucherUploadFile">
<i class="fa fa-plus-square-o" style="font-size: 70px;"></i>
</a>
</div>
{{# } }}
</script>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label" style="width: 130px;">缴费凭证编号</label>
<div class="layui-input-block" style="margin-left: 130px;">
<input type="text" id="paymentVoucherNum" name="paymentVoucherNum" class="layui-input" value="" placeholder="请输入缴费凭证编号" maxlength="255" readonly>
</div>
</div>
<div class="layui-form-item layui-layout-admin">
<div class="layui-input-block">
<div class="layui-footer" style="left: 0;">
<button type="button" class="layui-btn layui-btn-primary close">返回上级</button>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
<script src="assets/js/vendor/wangEditor/wangEditor.min.js"></script>
<script src="assets/js/vendor/ckplayer/ckplayer/ckplayer.js"></script>
<script src="assets/js/vendor/viewer/viewer.min.js"></script>
<script src="assets/layuiadmin/layui/layui.js"></script>
<script>
layui.config({
base: 'assets/layuiadmin/' //静态资源所在路径
}).extend({
index: 'lib/index' //主入口模块
}).use(['index', 'form', 'laydate', 'laytpl'], function(){
var $ = layui.$;
var form = layui.form;
var laytpl = layui.laytpl;
var laydate = layui.laydate;
var examApplyId = top.restAjax.params(window.location.href).examApplyId;
var classPlanId = top.restAjax.params(window.location.href).classPlanId;
var wangEditor = window.wangEditor;
var wangEditorObj = {};
var viewerObj = {};
var examType = 1;
// 初始化实操考试地点下拉选择
function initPracticeExamAddressIdSelect(selectValue) {
top.restAjax.get(top.restAjax.path('api/institution/list?institutionType=考点信息', []), {}, null, function(code, data, args) {
laytpl(document.getElementById('practiceExamAddressIdSelectTemplate').innerHTML).render(data, function(html) {
document.getElementById('practiceExamAddressIdSelectTemplateBox').innerHTML = html;
});
form.render('select', 'practiceExamAddressIdSelectTemplateBox');
var selectObj = {};
selectObj['practiceExamAddressId'] = selectValue;
form.val('dataForm', selectObj);
}, function(code, data) {
top.dialog.msg(data.msg);
});
}
// 初始化理论考试地点下拉选择
function initTheoryExamAddressIdSelect(selectValue) {
top.restAjax.get(top.restAjax.path('api/institution/list?institutionType=考点信息', []), {}, null, function(code, data, args) {
laytpl(document.getElementById('theoryExamAddressIdSelectTemplate').innerHTML).render(data, function(html) {
document.getElementById('theoryExamAddressIdSelectTemplateBox').innerHTML = html;
});
form.render('select', 'theoryExamAddressIdSelectTemplateBox');
var selectObj = {};
selectObj['theoryExamAddressId'] = selectValue;
form.val('dataForm', selectObj);
}, function(code, data) {
top.dialog.msg(data.msg);
});
}
function closeBox() {
parent.layer.close(parent.layer.getFrameIndex(window.name));
}
function refreshDownloadTemplet(fileName, file) {
var dataRander = {};
dataRander[fileName] = file;
laytpl(document.getElementById(fileName +'FileDownload').innerHTML).render(dataRander, function(html) {
document.getElementById(fileName +'FileBox').innerHTML = html;
});
}
// 初始化文件列表
function initFileList(fileName, ids, callback) {
var dataForm = {};
dataForm[fileName] = ids;
form.val('dataForm', dataForm);
if(!ids) {
refreshDownloadTemplet(fileName, []);
if(callback) {
callback(fileName, []);
}
return;
}
top.restAjax.get(top.restAjax.path('api/file/list', []), {
ids: ids
}, null, function(code, data) {
refreshDownloadTemplet(fileName, data);
if(callback) {
callback(fileName, data);
}
}, function(code, data) {
top.dialog.msg(data.msg);
});
}
// 初始化理论考试开始时间时间戳
function initTheoryExamStartTimeDateTime() {
laydate.render({
elem: '#theoryExamStartTime',
type: 'datetime',
trigger: 'click',
done: function (value, date, endDate) {
var startDate = new Date(value).getTime();
var endTime = new Date($('#theoryExamEndTime').val()).getTime();
if (endTime <= startDate) {
layer.msg('理论考试结束时间不能早于等于开始时间');
}
}
});
}
// 初始化理论考试结束时间时间戳
function initTheoryExamEndTimeDateTime() {
laydate.render({
elem: '#theoryExamEndTime',
type: 'datetime',
trigger: 'click',
done: function (value, date, endDate) {
var startDate = new Date(value).getTime();
var endTime = new Date($('#theoryExamStartTime').val()).getTime();
if (endTime >= startDate) {
layer.msg('理论考试结束时间不能早于等于开始时间');
}
}
});
}
// 初始化实操考试开始时间时间戳
function initPracticeExamStartTimeDateTime() {
laydate.render({
elem: '#practiceExamStartTime',
type: 'datetime',
trigger: 'click',
/*done: function (value, date, endDate) {
var startDate = new Date(value).getTime();
var endTime = new Date($('#practiceExamEndTime').val()).getTime();
if (endTime >= startDate) {
layer.msg('实操考试结束时间不能早于等于开始时间');
}
}*/
});
}
// 初始化实操考试结束时间时间戳
function initPracticeExamEndTimeDateTime() {
laydate.render({
elem: '#practiceExamEndTime',
type: 'datetime',
trigger: 'click',
/*done: function (value, date, endDate) {
var startDate = new Date($('#practiceExamStartTime').val()).getTime();
var endTime = new Date(value).getTime();
if (endTime >= startDate) {
layer.msg('实操考试结束时间不能早于等于开始时间');
}
}*/
});
}
// 初始化缴费凭证图片上传
function initPaymentVoucherUploadFile() {
var files = $('#paymentVoucher').val();
initFileList('paymentVoucher', files, function(fileName) {
var viewer = new Viewer(document.getElementById(fileName +'FileBox'), {navbar: false});
viewerObj[fileName] = viewer;
});
form.on('button(paymentVoucherUploadFile)', function(obj) {
var name = this.dataset.name;
var explain = this.dataset.explain;
top.dialog.file({
type: 'image',
title: '上传'+ explain,
width: '400px',
height: '420px',
maxFileCount: '1',
onClose: function() {
var uploadFileArray = top.dialog.dialogData.uploadFileArray;
if(typeof(uploadFileArray) != 'undefined' && uploadFileArray.length > 0) {
var files = $('#'+ name).val();
for(var j = 0, file = uploadFileArray[j]; file = uploadFileArray[j++];) {
if(files.length > 0) {
files += ',';
}
files += file.data;
}
initFileList(name, files, function(fileName) {
viewerObj[fileName].update();
});
}
}
});
});
form.on('button(paymentVoucherRemoveFile)', function(obj) {
var name = this.dataset.name;
var id = this.dataset.id;
var files = $('#'+ name).val().replace(id, '');
files = files.replace(/\,+/g, ',');
if(files.charAt(0) == ',') {
files = files.substring(1);
}
if(files.charAt(files.length - 1) == ',') {
files = files.substring(0, files.length - 1);
}
initFileList(name, files, function(fileName) {
viewerObj[fileName].update();
});
});
}
// 初始化内容
function initData() {
initExamBaseInfo();
var loadLayerIndex;
top.restAjax.get(top.restAjax.path('api/examapply/get/{examApplyId}', [examApplyId]), {}, null, function(code, data) {
var dataFormData = {};
examType = data.examType;
initExamType(data.examType);
for(var i in data) {
dataFormData[i] = data[i] +'';
}
form.val('dataForm', dataFormData);
form.render(null, 'dataForm');
initPracticeExamAddressIdSelect(data['practiceExamAddressId']);
initTheoryExamAddressIdSelect(data['theoryExamAddressId']);
initPracticeExamStartTimeDateTime();
initPracticeExamEndTimeDateTime();
initTheoryExamStartTimeDateTime();
initTheoryExamEndTimeDateTime();
initPaymentVoucherUploadFile();
}, function(code, data) {
top.dialog.msg(data.msg);
}, function() {
loadLayerIndex = top.dialog.msg(top.dataMessage.loading, {icon: 16, time: 0, shade: 0.3});
}, function() {
top.dialog.close(loadLayerIndex);
});
}
initData();
function initExamType(examType) {
if('1' == examType) {
$('#theoryAddressDiv').show();
$('#theoryTimeDiv').show();
$('#practiceAddressDiv').hide();
$('#practiceTimeDiv').hide();
}
if('2' == examType) {
$('#theoryAddressDiv').hide();
$('#theoryTimeDiv').hide();
$('#practiceAddressDiv').show();
$('#practiceTimeDiv').show();
}
if('3' == examType) {
$('#theoryAddressDiv').show();
$('#theoryTimeDiv').show();
$('#practiceAddressDiv').show();
$('#practiceTimeDiv').show();
}
}
// 获取考试申请基本信息
function initExamBaseInfo() {
var loadLayerIndex;
top.restAjax.get(top.restAjax.path('api/classplan/get/{classPlanId}', [classPlanId]), {}, null, function(code, data) {
orgNameFun.getOrgName(data.orgId, function(nameData) {
data['orgName'] = nameData.institutionName;
if ('1' == data.planType) {
data.planType = '初训';
} else if ('2' == data.planType) {
data.planType = '复训';
} else if ('3' == data.planType) {
data.planType = '换证 ';
}
var dataFormData = {};
for(var i in data) {
dataFormData[i] = data[i] +'';
}
form.val('initDataForm', dataFormData);
form.render(null, 'initDataForm');
})
}, function(code, data) {
top.dialog.msg(data.msg);
}, function() {
loadLayerIndex = top.dialog.msg(top.dataMessage.loading, {icon: 16, time: 0, shade: 0.3});
}, function() {
top.dialog.close(loadLayerIndex);
});
}
var orgNameFun = {
getOrgName: function (orgId, callback){
var loadLayerIndex;
top.restAjax.get(top.restAjax.path('api/institution/get/{orgId}', [orgId]), {}, null, function (code, data) {
if (null != data) {
callback(data);
}
}, function (code, data) {
top.dialog.msg(data.msg);
}, function () {
loadLayerIndex = top.dialog.msg(top.dataMessage.loading, {icon: 16, time: 0, shade: 0.3});
}, function () {
top.dialog.close(loadLayerIndex);
});
}
}
function theoryCheck() {
var theoryExamStartTime = new Date($('#theoryExamEndTime').val()).getTime();
var theoryExamEndTime = new Date($('#theoryExamStartTime').val()).getTime();
if(theoryExamEndTime >= theoryExamStartTime) {
top.dialog.msg('理论考试结束时间不能早于等于开始时间');
return false;
}
}
function practiceCheck() {
var practiceExamStartTime = new Date($('#practiceExamEndTime').val()).getTime();
var practiceExamEndTime = new Date($('#practiceExamStartTime').val()).getTime();
if(practiceExamEndTime >= practiceExamStartTime) {
layer.msg('实操考试结束时间不能早于等于开始时间');
return false;
}
}
// 提交表单
form.on('submit(submitForm)', function(formData) {
if('1' == examType) {
theoryCheck();
}
if('2' == examType) {
practiceCheck();
}
if('3' == examType) {
theoryCheck();
practiceCheck();
}
formData.field.planName = $('#planName').val();
formData.field.planPersonNum = $('#planPersonNum').val();
top.dialog.confirm(top.dataMessage.commit, function(index) {
top.dialog.close(index);
var loadLayerIndex;
top.restAjax.put(top.restAjax.path('api/examapply/update/{examApplyId}', [examApplyId]), formData.field, null, function(code, data) {
top.dialog.close(index);
}, function(code, data) {
top.dialog.msg(data.msg);
}, function() {
loadLayerIndex = top.dialog.msg(top.dataMessage.committing, {icon: 16, time: 0, shade: 0.3});
}, function() {
top.dialog.close(loadLayerIndex);
});
});
return false;
});
$('.close').on('click', function() {
closeBox();
});
// 校验
form.verify({
});
});
</script>
</body>
</html>