Merge branch 'baotou-signup' of e.coding.net:tsteam/btsaqscksfwpt/system-examination-signup into baotou-signup

This commit is contained in:
wans 2021-06-20 16:34:23 +08:00
commit 7e3690a999
4 changed files with 131 additions and 111 deletions

View File

@ -18,6 +18,7 @@ import cn.com.tenlion.pojo.dtos.teacher.TeacherDTO;
import cn.com.tenlion.pojo.dtos.worktype.WorkTypeDTO;
import cn.com.tenlion.pojo.pos.classplan.ClassPlanPO;
import cn.com.tenlion.pojo.vos.classplan.ClassPlanVO;
import cn.com.tenlion.pojo.vos.distribution.DistributionSaveVO;
import cn.com.tenlion.pojo.vos.examapply.ExamApplyVO;
import cn.com.tenlion.pojo.vos.examcheck.ExamCheckVO;
import cn.com.tenlion.service.apply.IApplyService;
@ -25,6 +26,7 @@ import cn.com.tenlion.service.applystudents.IApplyStudentsService;
import cn.com.tenlion.service.classplan.IClassPlanService;
import cn.com.tenlion.service.examapply.IExamApplyService;
import cn.com.tenlion.service.examcheck.IExamCheckService;
import cn.com.tenlion.service.examination.distribution.IDistributionService;
import cn.com.tenlion.service.examination.distributioncard.IDistributionCardService;
import cn.com.tenlion.service.teacher.ITeacherService;
import cn.com.tenlion.service.worktype.IWorkTypeService;
@ -88,6 +90,8 @@ public class ClassPlanServiceImpl extends DefaultBaseService implements IClassPl
private IApplyStudentsService studentsService;
@Autowired
private IPicturesTemplateBuildingService credentialService;
@Autowired
private IDistributionService iDistributionService;
@Override
public void save(ClassPlanVO classPlanVO) {
@ -549,6 +553,13 @@ public class ClassPlanServiceImpl extends DefaultBaseService implements IClassPl
params.put("examImages",classPlanVO.getExamImages());
params.put("examPDF",classPlanVO.getExamPDF());
classPlanDao.saveExamFile(params);
/**
* CBC 准考证生成基础信息关联 2021年6月19日16:29:30加入代码
*/
DistributionSaveVO saveData = new DistributionSaveVO();
saveData.setPlanId(classPlanId);
saveData.setPlanName(classPlanDTO.getPlanName());
iDistributionService.save(saveData);
}
@Override

View File

@ -38,6 +38,7 @@ import com.github.pagehelper.PageInfo;
import ink.wgink.common.base.DefaultBaseService;
import ink.wgink.exceptions.SaveException;
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.result.SuccessResultList;
@ -139,39 +140,39 @@ public class DistributionServiceImpl extends DefaultBaseService implements IDist
/**
* 判断考点是否为空
*/
if (StringUtils.isEmpty(dDistributionSaveVO.getStationId())) {
/* if (StringUtils.isEmpty(dDistributionSaveVO.getStationId())) {
throw new SaveException("考点不能为空");
}
}*/
/**
* 判断考试人数是否为空
* renpc2021-06-17注释掉此段内容
*/
if (dDistributionSaveVO.getDistributionNumber() == null || dDistributionSaveVO.getDistributionNumber() < 1) {
/* if (dDistributionSaveVO.getDistributionNumber() == null || dDistributionSaveVO.getDistributionNumber() < 1) {
throw new SaveException("考试人数不合法");
}
}*/
/**
* 判断预计考试时间是否为空是否大于今天
*/
/**
* 判断该考点是否有考场
*/
Map<String, Object> params = new HashMap<String, Object>();
/* Map<String, Object> params = new HashMap<String, Object>();
params.put("organizationType" ,dDistributionSaveVO.getStationId());
List<OrganizationDTO> orgList = iOrganizationService.list(params);
if(orgList == null || orgList.size() < 1) {
throw new SaveException("该考点暂无考场可以分配");
}
}*/
/**
* 判断该考点的全部考场容纳相加是否大于参加考试人数
*/
int totalNumber = 0;
/* int totalNumber = 0;
for (OrganizationDTO dto : orgList) {
totalNumber = totalNumber + dto.getOrganizationUserNum();
}
// renpc2021-06-17注释掉此段内容
if(totalNumber < dDistributionSaveVO.getDistributionNumber()) {
throw new SaveException("该考点无法容纳本次考试的人数");
}
}*/
Map<String, Object> save = HashMapUtil.beanToMap(dDistributionSaveVO);
save.put("distributionAllotTime", "");
save.put("distributionFields", "");
@ -282,7 +283,7 @@ public class DistributionServiceImpl extends DefaultBaseService implements IDist
String currentFieldId = "";
for(String classPlanId : distributionIdArray) {
DistributionDTO distributionDTO = get(classPlanId);
if(distributionDTO != null) {
if(distributionDTO == null) {
throw new UpdateException("非法操作.");
}
// 共分配的多个考场ID
@ -335,8 +336,8 @@ public class DistributionServiceImpl extends DefaultBaseService implements IDist
distributionCardVO.setDistributionId(classPlanId);
distributionCardVO.setDistributionCardPictures("");
// 保存性别中文又用中文差名称暂时改为直接输出
// DataDTO dataDTO = dataDictionaryServiceImpl.get(userList.get(i).getApplySex());
// distributionCardVO.setDistributionCardUserSex(dataDTO.getDataName());
// DataDTO dataDTO = dataDictionaryServiceImpl.get(userList.get(i).getApplySex());
// distributionCardVO.setDistributionCardUserSex(dataDTO.getDataName());
distributionCardVO.setDistributionCardUserSex(userList.get(i).getApplySex());
distributionCardVO.setDistributionCardUserIdentity(userList.get(i).getApplyCardNumber());
distributionCardVO.setDistributionCardUserResult("");
@ -381,48 +382,59 @@ public class DistributionServiceImpl extends DefaultBaseService implements IDist
params.put("distributionStatus", "1");
params.put("distributionNumber", userList == null ? 0 : userList.size());
params.put("distributionId", classPlanId);
distributionDao.save(params);
distributionDao.update(params);
/**
* 为任鹏程接口 CBC 2021年6月19日17:43:16
* 更新此条申请的考场分配信息与考点分配信息
*/
Map<String, Object> ren = new HashMap<>(1);
if(!StringUtils.isEmpty(stationId)) {
String[] stationArray = stationId.substring(1, stationId.length()).split(",");
// 考点名称与ID串
StringBuffer stationNameBuffer = new StringBuffer();
for(String tempStationId : stationArray) {
InstitutionDTO institutionDTO = institutionService.get(tempStationId);
if(stationNameBuffer.length() < 1) {
stationNameBuffer.append(institutionDTO.getInstitutionName());
}else{
stationNameBuffer.append("," + institutionDTO.getInstitutionName());
}
}
ren.put("examOrgId", stationId.substring(1, stationId.length()));
ren.put("examOrgName", stationNameBuffer.toString());
}else{
ren.put("examOrgId", "");
ren.put("examOrgName", "");
}
if(!StringUtils.isEmpty(fieldId)) {
// 考场名称与ID串
StringBuffer fieldNameBuffer = new StringBuffer();
for(OrganizationDTO organizationDTO : fieldList) {
if(fieldNameBuffer.length() < 1) {
fieldNameBuffer.append(organizationDTO.getOrganizationName());
}else{
fieldNameBuffer.append("," + organizationDTO.getOrganizationName());
}
}
ren.put("examPointId", fieldId.substring(1, fieldId.length()));
ren.put("examPointName", fieldNameBuffer.toString());
} else{
ren.put("examPointId","");
ren.put("examPointName", "");
}
ren.put("classPlanId", classPlanId);
applyStudentsNewDao.update(ren);
/**
* 更新应急局的考试申请审核主表中的考试时间以及状态
*/
ExamApplyVO vo = new ExamApplyVO();
vo.setExamId(distributionId);
vo.setStatus(1);
vo.setCheckStatus(1);
// vo.setCheckStatus(1);
vo.setPracticeExamStartTime(distributionVO.getDistributionAllotTime());
vo.setPracticeExamEndTime(distributionVO.getDistributionAllotEndTime());
iExamApplyService.updateStatus(distributionId, vo);
/**
* 更新考试人员信息添加考场信息到考试人员表中
*/
params = new HashMap<>(1);
String examOrgId = "";
String examOrgName = "";
for(int i=0;i<fieldList.size();i++) {
if(i != 0) {
examOrgId += ",";
examOrgName += ",";
}
examOrgId += fieldList.get(i).getOrganizationId();
examOrgName += fieldList.get(i).getOrganizationName();
}
params.put("examOrgId", examOrgId);
params.put("examOrgName", examOrgName);
distributionDTO = get(distributionId);
// 获取考点ID
stationId = distributionDTO.getStationId();
String stationName = "";
// 通过考点ID获取考点名称
InstitutionDTO institutionDTO = institutionService.get(stationId);
if(null != institutionDTO) {
stationName = institutionDTO.getInstitutionName();
}
params.put("examPointId", stationId);
params.put("examPointName", stationName);
params.put("handsPointId", stationId);
params.put("handsPointName", stationName);
applyStudentsNewDao.update(params);
}
}
@ -666,8 +678,8 @@ public class DistributionServiceImpl extends DefaultBaseService implements IDist
return null;
}
Map<String, Object> query = new HashMap<String, Object>();
query.put("examPlanId", dto.getDistributionId());
ExamPlanDTO examPlanDTO = examPlanService.get(query);
query.put("examId", dto.getDistributionId());
ExamApplyDTO examPlanDTO = iExamApplyService.get(query);
dto.setExamType(examPlanDTO.getExamType());
return dto;
}

View File

@ -30,34 +30,28 @@
<script id="distributionClassPlansBoxTemplate" type="text/html">
{{# for(var j = 0, classPlan; classPlan = d[j++];) { }}
<div class="layui-form-item layui-row ">
<div class="layui-col-lg2" >
<label class="layui-form-label">序号</label>
<div class="layui-input-block">
<input type="text" readonly class="layui-input" value="{{j}}" placeholder="" lay-verify="required">
</div>
</div>
<div class="layui-col-lg2" >
<label class="layui-form-label">班级编号</label>
<div class="layui-input-block">
<input type="text" readonly class="layui-input" value="{{classPlan.planNumber}}" placeholder="" lay-verify="required">
</div>
</div>
<div class="layui-col-lg3" >
<label class="layui-form-label">班级名称</label>
<label class="layui-form-label">培训机构</label>
<div class="layui-input-block">
<input type="text" readonly class="layui-input" value="{{classPlan.orgName}}" placeholder="" lay-verify="required">
</div>
</div>
<div class="layui-col-lg4" >
<label class="layui-form-label">申请名称</label>
<div class="layui-input-block">
<input type="text" readonly class="layui-input" value="{{classPlan.planName}}" placeholder="" lay-verify="required">
</div>
</div>
<div class="layui-col-lg2" >
<label class="layui-form-label">参加考试</label>
<div class="layui-col-lg3" >
<label class="layui-form-label">培训科目</label>
<div class="layui-input-block">
<input type="text" readonly class="layui-input" value="{{classPlan.applyCount}}人" placeholder="" lay-verify="required" >
<input type="text" readonly class="layui-input" value="{{classPlan.workerCatalogName}}" placeholder="" lay-verify="required">
</div>
</div>
<div class="layui-col-lg3">
<label class="layui-form-label">培训地址</label>
<div class="layui-col-lg2">
<label class="layui-form-label">参考人员</label>
<div class="layui-input-block">
<input type="text" readonly class="layui-input" value="{{classPlan.planAddress}}" placeholder="" lay-verify="required">
<input type="text" readonly class="layui-input" value="{{classPlan.applyCount}}人" placeholder="" lay-verify="required">
</div>
</div>
</div>
@ -154,21 +148,26 @@
// 初始化开班计划
function initDistributionClassPlans() {
classPlanArray = new Array();
var planIdArray = planId.split(",");
// 批量分配
for(var i = 0 ; i < planIdArray.length; i++) {
$.ajax({
url:'api/classplan/list?classPlanIdListIds=' + planId,
// url:'api/examplan/list?examPlanIdList=' + planId,
url:'api/classplan/get/' + planIdArray[i],
async:false,
type:'get',
dataType:'json',
success: function (data) {
for (var i = 0; i < data.length; i++) {
$.ajax({
url: 'api/applystudents/list-by-classid/' + data[i].classPlanId,
url: 'api/applystudents/list-by-classid/' + planIdArray[i],
async: false,
type: 'get',
dataType: 'json',
success: function (userData) {
data[i].applyCount = userData.length;
classPlanArray.push( data[i]);
data.applyCount = userData.length;
}
});
classPlanArray.push(data);
}
});
}
@ -178,8 +177,6 @@
});
form.render('checkbox', 'distributionClassPlansBox');
}
});
}
// 初始化考场
function initDistributionFields() {

View File

@ -24,34 +24,34 @@
<form class="layui-form layui-form-pane" lay-filter="dataForm">
<input type="hidden" readonly id="stationId" name="stationId" class="layui-input" value="" maxlength="36">
<div class="layui-form-item" style="text-align: center;width:100% !important;font-size: 17px">
<b>考试计划申请</b>
<b>考试计划申请列表</b>
</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">
{{# for(var j = 0, classPlan; classPlan = d[j++];) { }}
<div class="layui-form-item layui-row ">
<div class="layui-col-lg2" >
<label class="layui-form-label">序号</label>
<div class="layui-col-lg3" >
<label class="layui-form-label">培训机构</label>
<div class="layui-input-block">
<input type="text" readonly class="layui-input" value="{{j}}" placeholder="" lay-verify="required">
<input type="text" readonly class="layui-input" value="{{classPlan.orgName}}" placeholder="" lay-verify="required">
</div>
</div>
<div class="layui-col-lg4" >
<label class="layui-form-label">班级名称</label>
<label class="layui-form-label">申请名称</label>
<div class="layui-input-block">
<input type="text" readonly class="layui-input" value="{{classPlan.name}}" placeholder="" lay-verify="required">
<input type="text" readonly class="layui-input" value="{{classPlan.planName}}" placeholder="" lay-verify="required">
</div>
</div>
<div class="layui-col-lg3" >
<label class="layui-form-label">考试等级</label>
<label class="layui-form-label">培训科目</label>
<div class="layui-input-block">
<input type="text" readonly class="layui-input" value="{{classPlan.level}}" placeholder="" lay-verify="required">
<input type="text" readonly class="layui-input" value="{{classPlan.workerCatalogName}}" placeholder="" lay-verify="required">
</div>
</div>
<div class="layui-col-lg3">
<label class="layui-form-label">加考试</label>
<div class="layui-col-lg2">
<label class="layui-form-label">考人员</label>
<div class="layui-input-block">
<input type="text" readonly class="layui-input" value="{{classPlan.examCount}}人" placeholder="" lay-verify="required">
<input type="text" readonly class="layui-input" value="{{classPlan.applyCount}}人" placeholder="" lay-verify="required">
</div>
</div>
</div>
@ -148,26 +148,28 @@
// 初始化开班计划
function initDistributionClassPlans() {
classPlanArray = new Array();
var planIdArray = planId.split(",");
// 批量分配
for(var i = 0 ; i < planIdArray.length; i++) {
$.ajax({
url:'api/examplan/list?examPlanIdList=' + planId,
// url:'api/examplan/list?examPlanIdList=' + planId,
url:'api/classplan/get/' + planIdArray[i],
async:false,
type:'get',
dataType:'json',
success: function (data) {
/*for (var i = 0; i < data.length; i++) {
$.ajax({
url: 'api/applystudents/list-by-classid/' + data[i].classPlanId,
url: 'api/applystudents/list-by-classid/' + planIdArray[i],
async: false,
type: 'get',
dataType: 'json',
success: function (userData) {
data[i].applyCount = userData.length;
classPlanArray.push( data[i]);
data.applyCount = userData.length;
}
});
classPlanArray.push(data);
}
});
}*/
for (var i = 0; i < data.length; i++) {
classPlanArray.push(data[i]);
}
laytpl(document.getElementById('distributionClassPlansBoxTemplate').innerHTML).render(classPlanArray, function (html) {
console.log(classPlanArray);
@ -175,8 +177,6 @@
});
form.render('checkbox', 'distributionClassPlansBox');
}
});
}
// 初始化考场
function initDistributionFields() {