更新报名信息管理人数统计情况

This commit is contained in:
wans 2021-05-19 15:56:06 +08:00
parent 120d73be5e
commit a51c49e2f6
2 changed files with 21 additions and 7 deletions

View File

@ -44,6 +44,7 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.*;
@ -724,6 +725,7 @@ public class ClassPlanServiceImpl extends DefaultBaseService implements IClassPl
query.put("applyWorkTypeId",workerCatalog);
List<String> applyAuditStates = new ArrayList<>();
applyAuditStates.add("0");
applyAuditStates.add("-1");
applyAuditStates.add("2");
query.put("applyAuditStates",applyAuditStates);
List<ApplyDTO> all = applyService.list(query);
@ -734,6 +736,16 @@ public class ClassPlanServiceImpl extends DefaultBaseService implements IClassPl
query.put("applyAuditStates",applyAuditStates);
List<ApplyDTO> pass = applyService.list(query);
res.put("signUpPassCounts",pass.size());
// 计算通过率
double ratio = 0L;
double x = Double.parseDouble(pass.size() + "");
double y = Double.parseDouble(all.size() + "");
if(y == 0L){
res.put("ratio","0.00");
} else {
BigDecimal bigDecimal = new BigDecimal(( x / y ) * 100);
res.put("ratio", bigDecimal.setScale(2,BigDecimal.ROUND_HALF_UP));
}
return res;
}
}

View File

@ -38,8 +38,8 @@
<div class="layui-col-md4 layui-col-xs4">
<div class="layui-card">
<div class="layui-card-header" style="background-color: #d7dee2">
<span id="totalSignUpUser">总计人数</span>
<span id="totalSignUpUserNumber" class="layui-badge layui-bg-cyan layuiadmin-badge">-</span>
<span id="totalSignUpUser">通过率</span>
<span id="ratio" class="layui-badge layui-bg-cyan layuiadmin-badge">-</span>
</div>
</div>
</div>
@ -111,7 +111,9 @@
var loadIndex = layer.load(1);
top.restAjax.get(top.restAjax.path('api/classplan/get-exam-check-type', []),
{orgId: orgId, workerCatalog : workerCatalog}, null, function (code, data) {
if(data.checkType != '1'){
if(data.checkType == '1'){
$('#class-plan-btn-event').show();
} else {
$('#class-plan-btn-event').hide();
}
layer.close(loadIndex);
@ -144,14 +146,13 @@
{orgId : orgId,workerCatalog : workerCatalog}, null, function (code, data) {
var signUpCounts = data.signUpCounts;
var signUpPassCounts = data.signUpPassCounts;
var ratio = data.ratio;
$('#signUpCounts').html(signUpCounts + " 人");
$('#signUpPassCounts').html(signUpPassCounts + " 人");
if(typeof (workerCatalog) === 'undefined' || workerCatalog == ''){
$('#totalSignUpUser').text('总计人数');
$('#totalSignUpUserNumber').text(signUpCounts + signUpPassCounts + ' 人');
$('#ratio').text(ratio + '%');
} else {
$('#totalSignUpUser').text('预计人数');
$('#totalSignUpUserNumber').text('50 人');
$('#ratio').text(ratio + '%');
}
}, function (code, data) {
top.dialog.msg(data.msg);
@ -337,6 +338,7 @@
height: $win.height() - 115,
});
getExamCheckType();
getSignUserCounts();
}
// 初始化日期