修改考场分配页面

This commit is contained in:
cuibaocheng 2021-05-15 19:11:09 +08:00
parent e7d9df37bd
commit 4e649f5c1a
6 changed files with 50 additions and 29 deletions

View File

@ -283,6 +283,8 @@ public class ClassPlanServiceImpl extends DefaultBaseService implements IClassPl
@Override @Override
public List<ClassPlanDTO> list(Map<String, Object> params) { public List<ClassPlanDTO> list(Map<String, Object> params) {
String[] classPlanIdListIds = params.get("classPlanIdListIds") == null ? null : params.get("classPlanIdListIds").toString().split(",");
params.put("classPlanIdList", classPlanIdListIds);
return classPlanDao.list(params); return classPlanDao.list(params);
} }

View File

@ -29,6 +29,8 @@ import cn.com.tenlion.service.examination.stationuser.IStationUserService;
import ink.wgink.common.base.DefaultBaseService; import ink.wgink.common.base.DefaultBaseService;
import ink.wgink.exceptions.SaveException; import ink.wgink.exceptions.SaveException;
import ink.wgink.exceptions.UpdateException; import ink.wgink.exceptions.UpdateException;
import ink.wgink.module.dictionary.pojo.dtos.DataDTO;
import ink.wgink.module.dictionary.service.IDataService;
import ink.wgink.pojo.ListPage; import ink.wgink.pojo.ListPage;
import ink.wgink.pojo.result.SuccessResultList; import ink.wgink.pojo.result.SuccessResultList;
import ink.wgink.util.map.HashMapUtil; import ink.wgink.util.map.HashMapUtil;
@ -64,11 +66,13 @@ public class DistributionServiceImpl extends DefaultBaseService implements IDist
@Autowired @Autowired
private IApplyService iApplyService; private IApplyService iApplyService;
@Autowired @Autowired
private IClassPlanService iClassPlanService;
@Autowired
private IDistributionCardService iDistributionCardService; private IDistributionCardService iDistributionCardService;
@Autowired @Autowired
private IApplyStudentsService applyStudentsService; private IApplyStudentsService applyStudentsService;
@Autowired
private IClassPlanService iClassPlanService;
@Autowired
private IDataService dataDictionaryServiceImpl;
@Override @Override
public void save(DistributionSaveVO dstributionSaveVO) { public void save(DistributionSaveVO dstributionSaveVO) {
@ -242,19 +246,15 @@ public class DistributionServiceImpl extends DefaultBaseService implements IDist
if(userTotalNumber > fieldTotalNumber ) { if(userTotalNumber > fieldTotalNumber ) {
throw new UpdateException("当前分配的考场无法容纳考试人数"); throw new UpdateException("当前分配的考场无法容纳考试人数");
} }
/**
* 遍历保存所有的考试申请分配信息
*/
Map<String, Object> params = HashMapUtil.beanToMap(distributionVO);
if (StringUtils.isBlank(token)) {
setUpdateInfo(params);
} else {
setAppUpdateInfo(token, params);
}
int index = 0; int index = 0;
int subNumber = 0; int subNumber = 0;
int currentNumber = 0;
String currentFieldId = ""; String currentFieldId = "";
for(String classPlanId : distributionIdArray) { for(String classPlanId : distributionIdArray) {
DistributionDTO distributionDTO = get(classPlanId);
if(distributionDTO != null) {
throw new UpdateException("非法操作.");
}
// 共分配的多个考场ID // 共分配的多个考场ID
ArrayList<OrganizationDTO> fieldList = new ArrayList<OrganizationDTO>(); ArrayList<OrganizationDTO> fieldList = new ArrayList<OrganizationDTO>();
// 是否存在跨考点, 做记录 // 是否存在跨考点, 做记录
@ -291,6 +291,7 @@ public class DistributionServiceImpl extends DefaultBaseService implements IDist
if(distributionDTOS != null && distributionDTOS.size() > 0) { if(distributionDTOS != null && distributionDTOS.size() > 0) {
throw new UpdateException(organizationDTO.getOrganizationName() + "该时段已被(" + distributionDTOS.get(0).getPlanName() + ")占用"); throw new UpdateException(organizationDTO.getOrganizationName() + "该时段已被(" + distributionDTOS.get(0).getPlanName() + ")占用");
} }
currentNumber = 0;
} }
/** /**
* 保存card表 * 保存card表
@ -298,12 +299,13 @@ public class DistributionServiceImpl extends DefaultBaseService implements IDist
DistributionCardVO distributionCardVO = new DistributionCardVO(); DistributionCardVO distributionCardVO = new DistributionCardVO();
distributionCardVO.setDistributionCardUserId(userList.get(i).getCreator()); distributionCardVO.setDistributionCardUserId(userList.get(i).getCreator());
distributionCardVO.setDistributionCardUserName(userList.get(i).getApplyName()); distributionCardVO.setDistributionCardUserName(userList.get(i).getApplyName());
distributionCardVO.setDistributionCardNumber(subNumber+""); distributionCardVO.setDistributionCardNumber( (++currentNumber ) + "" );
distributionCardVO.setDistributionFieldId(currentFieldId); distributionCardVO.setDistributionFieldId(currentFieldId);
distributionCardVO.setClassPlanId(classPlanId); distributionCardVO.setClassPlanId(classPlanId);
distributionCardVO.setDistributionId(classPlanId); distributionCardVO.setDistributionId(classPlanId);
distributionCardVO.setDistributionCardPictures(""); distributionCardVO.setDistributionCardPictures("");
distributionCardVO.setDistributionCardUserSex(userList.get(i).getApplySex()); DataDTO dataDTO = dataDictionaryServiceImpl.get(userList.get(i).getApplySex());
distributionCardVO.setDistributionCardUserSex(dataDTO.getDataName());
distributionCardVO.setDistributionCardUserIdentity(userList.get(i).getApplyCardNumber()); distributionCardVO.setDistributionCardUserIdentity(userList.get(i).getApplyCardNumber());
distributionCardVO.setDistributionCardUserResult(""); distributionCardVO.setDistributionCardUserResult("");
distributionCardVO.setDistributionCardUserStatus("0"); distributionCardVO.setDistributionCardUserStatus("0");
@ -325,6 +327,12 @@ public class DistributionServiceImpl extends DefaultBaseService implements IDist
/** /**
* 保存考试申请 * 保存考试申请
*/ */
Map<String, Object> params = HashMapUtil.beanToMap(distributionVO);
if (StringUtils.isBlank(token)) {
setUpdateInfo(params);
} else {
setAppUpdateInfo(token, params);
}
params.put("stationId", stationId.length() > 0 ? stationId.substring(1, stationId.length()) : ""); params.put("stationId", stationId.length() > 0 ? stationId.substring(1, stationId.length()) : "");
params.put("planId", classPlanId); params.put("planId", classPlanId);
params.put("planName", classPlanDTO.getPlanName()); params.put("planName", classPlanDTO.getPlanName());
@ -341,6 +349,7 @@ public class DistributionServiceImpl extends DefaultBaseService implements IDist
ExamApplyVO vo = new ExamApplyVO(); ExamApplyVO vo = new ExamApplyVO();
vo.setExamId(distributionId); vo.setExamId(distributionId);
vo.setStatus(1); vo.setStatus(1);
vo.setCheckStatus(1);
vo.setPracticeExamStartTime(distributionVO.getDistributionAllotTime()); vo.setPracticeExamStartTime(distributionVO.getDistributionAllotTime());
vo.setPracticeExamEndTime(distributionVO.getDistributionAllotEndTime()); vo.setPracticeExamEndTime(distributionVO.getDistributionAllotEndTime());
iExamApplyService.updateStatus(distributionId, vo); iExamApplyService.updateStatus(distributionId, vo);

View File

@ -317,6 +317,13 @@
#{classPlanIds[${index}]} #{classPlanIds[${index}]}
</foreach> </foreach>
</if> </if>
<if test="classPlanIdList!= null">
AND
t1.class_plan_id IN
<foreach collection="classPlanIdList" index="index" open="(" separator="," close=")">
#{classPlanIdList[${index}]}
</foreach>
</if>
</select> </select>
<!-- 列表 --> <!-- 列表 -->

View File

@ -461,7 +461,6 @@
var ids = ''; var ids = '';
var planIds = ''; var planIds = '';
for(var i = 0, item; item = checkDatas[i++];) { for(var i = 0, item; item = checkDatas[i++];) {
debugger
if(item.checkStatus === 0) { if(item.checkStatus === 0) {
if (i > 1) { if (i > 1) {
ids += '_'; ids += '_';

View File

@ -26,13 +26,14 @@
<div class="layui-form-item" style="text-align: center;width:100% !important;font-size: 17px"> <div class="layui-form-item" style="text-align: center;width:100% !important;font-size: 17px">
<b>考试计划申请</b> <b>考试计划申请</b>
</div> </div>
<div class="layui-input-block layui-form" id="distributionClassPlansBox" lay-filter="distributionClassPlansBox" pane="" style="margin-left: 0px !important;" ></div>
<script id="distributionClassPlansBoxTemplate" type="text/html"> <script id="distributionClassPlansBoxTemplate" type="text/html">
{{# for(var j = 0, classPlan; classPlan = d[j++];) { }} {{# for(var j = 0, classPlan; classPlan = d[j++];) { }}
<div class="layui-form-item layui-row "> <div class="layui-form-item layui-row ">
<div class="layui-col-lg2" > <div class="layui-col-lg2" >
<label class="layui-form-label">序号</label> <label class="layui-form-label">序号</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="text" readonly class="layui-input" value="{{j+1}}" placeholder="" lay-verify="required"> <input type="text" readonly class="layui-input" value="{{j}}" placeholder="" lay-verify="required">
</div> </div>
</div> </div>
<div class="layui-col-lg2" > <div class="layui-col-lg2" >
@ -47,16 +48,16 @@
<input type="text" readonly class="layui-input" value="{{classPlan.planName}}" placeholder="" lay-verify="required"> <input type="text" readonly class="layui-input" value="{{classPlan.planName}}" placeholder="" lay-verify="required">
</div> </div>
</div> </div>
<div class="layui-col-lg2"> <div class="layui-col-lg2" >
<label class="layui-form-label">班级人数</label> <label class="layui-form-label">参加考试</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="text" readonly class="layui-input" value="22" placeholder="{{classPlan.applyCount}}" lay-verify="required"> <input type="text" readonly class="layui-input" value="{{classPlan.applyCount}}人" placeholder="" lay-verify="required" >
</div> </div>
</div> </div>
<div class="layui-col-lg3"> <div class="layui-col-lg3">
<label class="layui-form-label">培训项目</label> <label class="layui-form-label">培训地址</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="text" readonly class="layui-input" value="2019-05-03 18:00:00" placeholder="{{classPlan.projectCatalogName}}" lay-verify="required"> <input type="text" readonly class="layui-input" value="{{classPlan.planAddress}}" placeholder="" lay-verify="required">
</div> </div>
</div> </div>
</div> </div>
@ -155,7 +156,7 @@
// 初始化开班计划 // 初始化开班计划
function initDistributionClassPlans() { function initDistributionClassPlans() {
classPlanArray = new Array(); classPlanArray = new Array();
top.restAjax.get(top.restAjax.path('api/classplan/list?classPlanIds={classPlanIds}', [ planId ]), {}, null, function (code, data, args) { top.restAjax.get(top.restAjax.path('api/classplan/list?classPlanIdListIds={classPlanIds}', [ planId ]), {}, null, function (code, data, args) {
planLength = data.length; planLength = data.length;
for (var i = 0; i < data.length; i++) { for (var i = 0; i < data.length; i++) {
var planData = {index: i, data: data[i]}; var planData = {index: i, data: data[i]};
@ -189,6 +190,7 @@
top.restAjax.get(top.restAjax.path('api/organization/list?organizationType={organizationType}', [data[i].institutionId]), {}, institutionData, function(code, orgData, args) { top.restAjax.get(top.restAjax.path('api/organization/list?organizationType={organizationType}', [data[i].institutionId]), {}, institutionData, function(code, orgData, args) {
// 回显 , 选中 // 回显 , 选中
for(var a = 0 ; a < orgData.length; a++) { for(var a = 0 ; a < orgData.length; a++) {
console.log(dataForm);
for(var j = 0 ; j < dataForm.distributionFieldList.length; j++) { for(var j = 0 ; j < dataForm.distributionFieldList.length; j++) {
if(orgData[a].organizationId == dataForm.distributionFieldList[j].fieldId) { if(orgData[a].organizationId == dataForm.distributionFieldList[j].fieldId) {
orgData[a].checked = 'checked="checked"'; orgData[a].checked = 'checked="checked"';
@ -286,6 +288,7 @@
function initData() { function initData() {
var loadLayerIndex; var loadLayerIndex;
top.restAjax.get(top.restAjax.path('api/distribution/get/{planId}', [planId]), {}, null, function(code, data) { top.restAjax.get(top.restAjax.path('api/distribution/get/{planId}', [planId]), {}, null, function(code, data) {
console.log(data);
var dataFormData = {}; var dataFormData = {};
for(var i in data) { for(var i in data) {
dataFormData[i] = data[i] +''; dataFormData[i] = data[i] +'';

View File

@ -17,7 +17,7 @@
<div class="layui-card-header"> <div class="layui-card-header">
<span class="layui-breadcrumb" lay-filter="breadcrumb" style="visibility: visible;"> <span class="layui-breadcrumb" lay-filter="breadcrumb" style="visibility: visible;">
<a class="close" href="javascript:void(0);">上级列表</a><span lay-separator="">/</span> <a class="close" href="javascript:void(0);">上级列表</a><span lay-separator="">/</span>
<a href="javascript:void(0);"><cite>分配考场与考试时间</cite></a> <a href="javascript:void(0);"><cite>查看考场分配与考试时间</cite></a>
</span> </span>
</div> </div>
<div class="layui-card-body" style="padding: 15px;"> <div class="layui-card-body" style="padding: 15px;">
@ -26,13 +26,14 @@
<div class="layui-form-item" style="text-align: center;width:100% !important;font-size: 17px"> <div class="layui-form-item" style="text-align: center;width:100% !important;font-size: 17px">
<b>考试计划申请</b> <b>考试计划申请</b>
</div> </div>
<div class="layui-input-block layui-form" id="distributionClassPlansBox" lay-filter="distributionClassPlansBox" pane="" style="margin-left: 0px !important;" ></div>
<script id="distributionClassPlansBoxTemplate" type="text/html"> <script id="distributionClassPlansBoxTemplate" type="text/html">
{{# for(var j = 0, classPlan; classPlan = d[j++];) { }} {{# for(var j = 0, classPlan; classPlan = d[j++];) { }}
<div class="layui-form-item layui-row "> <div class="layui-form-item layui-row ">
<div class="layui-col-lg2" > <div class="layui-col-lg2" >
<label class="layui-form-label">序号</label> <label class="layui-form-label">序号</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="text" readonly class="layui-input" value="{{j+1}}" placeholder="" lay-verify="required"> <input type="text" readonly class="layui-input" value="{{j}}" placeholder="" lay-verify="required">
</div> </div>
</div> </div>
<div class="layui-col-lg2" > <div class="layui-col-lg2" >
@ -48,15 +49,15 @@
</div> </div>
</div> </div>
<div class="layui-col-lg2"> <div class="layui-col-lg2">
<label class="layui-form-label">班级人数</label> <label class="layui-form-label">参加考试</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="text" readonly class="layui-input" value="22" placeholder="{{classPlan.applyCount}}" lay-verify="required"> <input type="text" readonly class="layui-input" value="{{classPlan.applyCount}}人" placeholder="" lay-verify="required">
</div> </div>
</div> </div>
<div class="layui-col-lg3"> <div class="layui-col-lg3">
<label class="layui-form-label">培训项目</label> <label class="layui-form-label">培训地址</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="text" readonly class="layui-input" value="2019-05-03 18:00:00" placeholder="{{classPlan.projectCatalogName}}" lay-verify="required"> <input type="text" readonly class="layui-input" value="{{classPlan.planAddress}}" placeholder="" lay-verify="required">
</div> </div>
</div> </div>
</div> </div>
@ -114,7 +115,7 @@
<div class="layui-form-item layui-layout-admin"> <div class="layui-form-item layui-layout-admin">
<div class="layui-input-block"> <div class="layui-input-block">
<div class="layui-footer" style="left: 0;"> <div class="layui-footer" style="left: 0;">
<button type="button" class="layui-btn" lay-submit lay-filter="submitForm">提交确认分配</button> <button type="button" class="layui-btn" lay-submit lay-filter="submitForm">审核确认分配</button>
<button type="button" class="layui-btn layui-btn-primary close">返回上级</button> <button type="button" class="layui-btn layui-btn-primary close">返回上级</button>
</div> </div>
</div> </div>
@ -155,7 +156,7 @@
// 初始化开班计划 // 初始化开班计划
function initDistributionClassPlans() { function initDistributionClassPlans() {
classPlanArray = new Array(); classPlanArray = new Array();
top.restAjax.get(top.restAjax.path('api/classplan/list?classPlanIds={classPlanIds}', [ planId ]), {}, null, function (code, data, args) { top.restAjax.get(top.restAjax.path('api/classplan/list?classPlanIdListIds={classPlanIds}', [ planId ]), {}, null, function (code, data, args) {
planLength = data.length; planLength = data.length;
for (var i = 0; i < data.length; i++) { for (var i = 0; i < data.length; i++) {
var planData = {index: i, data: data[i]}; var planData = {index: i, data: data[i]};