考试申请审核功能bug修改

This commit is contained in:
Renpc-kilig 2021-06-28 15:06:52 +08:00
parent b4bc3d1581
commit 89bffb101a
3 changed files with 43 additions and 11 deletions

View File

@ -136,8 +136,21 @@ public class ExamApplyController extends DefaultBaseController {
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@PutMapping("update-more/{ids}")
@CheckRequestBodyAnnotation
public SuccessResult updateMore(@PathVariable("ids") String ids, @RequestBody ExamApplyVO examApplyVO) {
examApplyService.updateMore(Arrays.asList(ids.split("\\_")), examApplyVO);
public SuccessResult updateMore(@PathVariable("ids") String ids) {
Map<String, Object> params = requestParams();
List<String> examId = Arrays.asList(params.get("examId").toString().split(","));
List<String> point = Arrays.asList(params.get("point").toString().split(","));
Integer checkStatus = Integer.parseInt(params.get("checkStatus").toString());
List<String> examApplyIds = Arrays.asList(ids.split("\\_"));
if(null != examApplyIds && examApplyIds.size() > 0) {
for(int i=0;i<examApplyIds.size();i++) {
ExamApplyVO examApplyVO = new ExamApplyVO();
examApplyVO.setCheckStatus(checkStatus);
examApplyVO.setExamId(examId.get(i));
examApplyVO.setPoint(point.get(i));
examApplyService.update(examApplyIds.get(i), examApplyVO);
}
}
return new SuccessResult();
}

View File

@ -133,7 +133,7 @@ public class ExamApplyServiceImpl extends DefaultBaseService implements IExamApp
@Override
public void update(String token, String examApplyId, ExamApplyVO examApplyVO) {
PlanCheckVO planCheckVO = null;
PlanCheckVO planCheckVO = new PlanCheckVO();
Boolean canUpdate = planCheckService.canUpdate(null, examApplyVO, planCheckVO);
if(canUpdate) {
planCheckService.save(planCheckVO);

View File

@ -216,6 +216,7 @@
{field: 'point', width: 180, title: '审核人角色', align:'center',
templet: function(row) {
var rowData = row[this.field];
point = rowData;
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
return '-';
}
@ -242,7 +243,6 @@
},
{field: 'planName', width: 180, title: '计划名称', align:'center',
templet: function(row) {
point = row['point'];
checkStatus = row['checkStatus'];
var rowData = row.classPlanDTO[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
@ -342,7 +342,7 @@
return '-';
}
if(rowData != '1') {
rowData = '<a class="layui-btn layui-btn-warm layui-btn-xs">暂无考场信息</a>';
rowData = '<a class="layui-btn layui-btn-warm layui-btn-xs" lay-event="sentExamMsg">分配考场信息</a>';
}else {
rowData = '<a class="layui-btn layui-btn-xs" lay-event="addressShow">查看考场信息</a>';
}
@ -393,7 +393,7 @@
}
// 考试申请批量审核
function checkMore(ids, planIds) {
function checkMore(ids, planIds, points) {
top.dialog.msg('考试申请审核', {
time: 0,
btn: ['通过', '退回'],
@ -401,9 +401,23 @@
yes: function (index) {
top.dialog.close(index);
// 审核
if('分管领导' == point && '1' == checkStatus) {
var layIndex;
top.restAjax.put(top.restAjax.path('api/examapply/update-more/{ids}?checkStatus=1&point={points}&examId={planIds}', [ids, points, planIds]), {}, null, function (code, data) {
top.dialog.msg('审核成功', {time: 1000});
var pointIdArray = points.split(',');
if(null != pointIdArray && pointIdArray.length > 0) {
if('分管领导' == pointIdArray[0]) {
sentExamMsg(planIds);
}
}
reloadTable();
}, function (code, data) {
top.dialog.msg(data.msg);
}, function () {
layIndex = top.dialog.msg(top.dataMessage.updating, {icon: 16, time: 0, shade: 0.3});
}, function () {
top.dialog.close(layIndex);
});
},
btn2: function(index) {
top.dialog.close(index);
@ -504,8 +518,9 @@
} else {
var ids = '';
var planIds = '';
var points = '';
for(var i = 0, item; item = checkDatas[i++];) {
if(item.checkStatus === 1 || item.checkStatus === 2) {
if(item.checkStatus === 1 || item.checkStatus === -1) {
top.dialog.msg('当前选择存在已经审核完成数据,请重新选择');
reloadTable();
return false;
@ -513,16 +528,18 @@
if (i > 1) {
ids += '_';
planIds += ',';
points += ',';
}
ids += item['examApplyId'];
planIds += item['examId'];
points += item['point'];
}
if(ids.length <= 0) {
top.dialog.msg('当前选择数据已经审核完成,请重新选择');
reloadTable();
return false;
}
checkMore(ids, planIds);
checkMore(ids, planIds, points);
}
}
});
@ -613,6 +630,8 @@
teacher(data)
}else if('examMsg' == obj.event) {
examMsg(data)
}else if('sentExamMsg' == obj.event) {
sentExamMsg(data.examId)
}
});
});