添加查询准考证的逻辑
This commit is contained in:
parent
536a619b12
commit
14b2998622
@ -1,5 +1,7 @@
|
|||||||
package cn.com.tenlion.controller.app.api.basicstaffinfo;
|
package cn.com.tenlion.controller.app.api.basicstaffinfo;
|
||||||
|
|
||||||
|
import cn.com.tenlion.pojo.dtos.myexam.MyExamDTO;
|
||||||
|
import cn.com.tenlion.service.myexamforapp.IMyExamForAppService;
|
||||||
import cn.com.tenlion.staff.pojo.dtos.basicstaffinfo.BasicStaffInfoDTO;
|
import cn.com.tenlion.staff.pojo.dtos.basicstaffinfo.BasicStaffInfoDTO;
|
||||||
import cn.com.tenlion.staff.pojo.vos.basicstaffinfo.BasicStaffInfoVO;
|
import cn.com.tenlion.staff.pojo.vos.basicstaffinfo.BasicStaffInfoVO;
|
||||||
import cn.com.tenlion.staff.service.basicstaffinfo.IBasicStaffInfoService;
|
import cn.com.tenlion.staff.service.basicstaffinfo.IBasicStaffInfoService;
|
||||||
@ -12,6 +14,9 @@ import io.swagger.annotations.*;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 人员信息接口
|
* 人员信息接口
|
||||||
* @ClassName: ExamCheckAppController
|
* @ClassName: ExamCheckAppController
|
||||||
@ -27,6 +32,8 @@ public class BasicStaffInfoAppController extends DefaultBaseController {
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IBasicStaffInfoService basicStaffInfoService;
|
private IBasicStaffInfoService basicStaffInfoService;
|
||||||
|
@Autowired
|
||||||
|
private IMyExamForAppService myExamForAppService;
|
||||||
|
|
||||||
@ApiOperation(value = "查询个人资料信息", notes = "查询个人资料信息接口")
|
@ApiOperation(value = "查询个人资料信息", notes = "查询个人资料信息接口")
|
||||||
@ApiImplicitParams({
|
@ApiImplicitParams({
|
||||||
@ -50,4 +57,16 @@ public class BasicStaffInfoAppController extends DefaultBaseController {
|
|||||||
return new SuccessResult();
|
return new SuccessResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "查询我的考试", notes = "查询我的考试接口")
|
||||||
|
@ApiImplicitParams({
|
||||||
|
@ApiImplicitParam(name = "token", value = "token", paramType = "header")
|
||||||
|
})
|
||||||
|
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||||
|
@GetMapping("list-my-exam")
|
||||||
|
public List<MyExamDTO> listMyExam(@RequestHeader("token") String token) throws SaveException {
|
||||||
|
Map<String,Object> params = requestParams();
|
||||||
|
List<MyExamDTO> list = myExamForAppService.listMyExam(token,params);
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
125
src/main/java/cn/com/tenlion/pojo/dtos/myexam/MyExamDTO.java
Normal file
125
src/main/java/cn/com/tenlion/pojo/dtos/myexam/MyExamDTO.java
Normal file
@ -0,0 +1,125 @@
|
|||||||
|
package cn.com.tenlion.pojo.dtos.myexam;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 我的考试信息
|
||||||
|
* @author xwangs
|
||||||
|
* @create 2021-05-12 16:05
|
||||||
|
* @description
|
||||||
|
*/
|
||||||
|
@ApiModel
|
||||||
|
public class MyExamDTO {
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "orgName", value = "培训机构名称")
|
||||||
|
private String orgName;
|
||||||
|
@ApiModelProperty(name = "planName", value = "培训计划名称")
|
||||||
|
private String planName;
|
||||||
|
@ApiModelProperty(name = "planNumber", value = "考试编号")
|
||||||
|
private String planNumber;
|
||||||
|
@ApiModelProperty(name = "planTypeName", value = "考试类型")
|
||||||
|
private String planTypeName;
|
||||||
|
@ApiModelProperty(name = "projectCatalogName", value = "考试项目类型")
|
||||||
|
private String projectCatalogName;
|
||||||
|
@ApiModelProperty(name = "workerCatalogName", value = "工种类别")
|
||||||
|
private String workerCatalogName;
|
||||||
|
@ApiModelProperty(name = "examTypeName", value = "考试内容")
|
||||||
|
private String examTypeName;
|
||||||
|
@ApiModelProperty(name = "examTimeStart", value = "考试时间开始")
|
||||||
|
private String examTimeStart;
|
||||||
|
@ApiModelProperty(name = "examTimeEnd", value = "考试时间截止")
|
||||||
|
private String examTimeEnd;
|
||||||
|
@ApiModelProperty(name = "examAddress", value = "考试地点")
|
||||||
|
private String examAddress;
|
||||||
|
@ApiModelProperty(name = "distributionCardCode", value = "准考证Base64码")
|
||||||
|
private String distributionCardCode;
|
||||||
|
|
||||||
|
public String getOrgName() {
|
||||||
|
return orgName == null ? "" : orgName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOrgName(String orgName) {
|
||||||
|
this.orgName = orgName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPlanName() {
|
||||||
|
return planName == null ? "" : planName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPlanName(String planName) {
|
||||||
|
this.planName = planName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPlanNumber() {
|
||||||
|
return planNumber == null ? "" : planNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPlanNumber(String planNumber) {
|
||||||
|
this.planNumber = planNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPlanTypeName() {
|
||||||
|
return planTypeName == null ? "" : planTypeName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPlanTypeName(String planTypeName) {
|
||||||
|
this.planTypeName = planTypeName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getProjectCatalogName() {
|
||||||
|
return projectCatalogName == null ? "" : projectCatalogName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProjectCatalogName(String projectCatalogName) {
|
||||||
|
this.projectCatalogName = projectCatalogName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getWorkerCatalogName() {
|
||||||
|
return workerCatalogName == null ? "" : workerCatalogName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setWorkerCatalogName(String workerCatalogName) {
|
||||||
|
this.workerCatalogName = workerCatalogName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getExamTypeName() {
|
||||||
|
return examTypeName == null ? "" : examTypeName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExamTypeName(String examTypeName) {
|
||||||
|
this.examTypeName = examTypeName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getExamTimeStart() {
|
||||||
|
return examTimeStart == null ? "" : examTimeStart;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExamTimeStart(String examTimeStart) {
|
||||||
|
this.examTimeStart = examTimeStart;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getExamTimeEnd() {
|
||||||
|
return examTimeEnd == null ? "" : examTimeEnd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExamTimeEnd(String examTimeEnd) {
|
||||||
|
this.examTimeEnd = examTimeEnd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getExamAddress() {
|
||||||
|
return examAddress == null ? "" : examAddress;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExamAddress(String examAddress) {
|
||||||
|
this.examAddress = examAddress;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDistributionCardCode() {
|
||||||
|
return distributionCardCode == null ? "" : distributionCardCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDistributionCardCode(String distributionCardCode) {
|
||||||
|
this.distributionCardCode = distributionCardCode;
|
||||||
|
}
|
||||||
|
}
|
@ -13,27 +13,26 @@ import cn.com.tenlion.pojo.pos.distributioncard.DistributionCardPO;
|
|||||||
import cn.com.tenlion.pojo.vos.distributioncard.DistributionCardUserVO;
|
import cn.com.tenlion.pojo.vos.distributioncard.DistributionCardUserVO;
|
||||||
import cn.com.tenlion.pojo.vos.distributioncard.DistributionCardVO;
|
import cn.com.tenlion.pojo.vos.distributioncard.DistributionCardVO;
|
||||||
import cn.com.tenlion.service.apply.IApplyService;
|
import cn.com.tenlion.service.apply.IApplyService;
|
||||||
import cn.com.tenlion.service.classplan.IClassPlanService;
|
|
||||||
import cn.com.tenlion.service.examination.distribution.IDistributionService;
|
import cn.com.tenlion.service.examination.distribution.IDistributionService;
|
||||||
import cn.com.tenlion.service.examination.distributioncard.IDistributionCardService;
|
import cn.com.tenlion.service.examination.distributioncard.IDistributionCardService;
|
||||||
import cn.com.tenlion.service.examination.distributionfield.IDistributionFieldService;
|
import cn.com.tenlion.service.examination.distributionfield.IDistributionFieldService;
|
||||||
|
import com.github.pagehelper.PageHelper;
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
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.module.dictionary.pojo.dtos.DataDTO;
|
import ink.wgink.module.dictionary.pojo.dtos.DataDTO;
|
||||||
import ink.wgink.module.dictionary.service.IAreaService;
|
|
||||||
import ink.wgink.module.dictionary.service.IDataService;
|
import ink.wgink.module.dictionary.service.IDataService;
|
||||||
import ink.wgink.pojo.ListPage;
|
import ink.wgink.pojo.ListPage;
|
||||||
import ink.wgink.pojo.result.SuccessResult;
|
|
||||||
import ink.wgink.pojo.result.SuccessResultList;
|
import ink.wgink.pojo.result.SuccessResultList;
|
||||||
import ink.wgink.util.map.HashMapUtil;
|
|
||||||
import ink.wgink.util.UUIDUtil;
|
import ink.wgink.util.UUIDUtil;
|
||||||
import com.github.pagehelper.PageHelper;
|
import ink.wgink.util.map.HashMapUtil;
|
||||||
import com.github.pagehelper.PageInfo;
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import java.util.*;
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ClassName: DistributionCardServiceImpl
|
* @ClassName: DistributionCardServiceImpl
|
||||||
@ -159,7 +158,7 @@ public class DistributionCardServiceImpl extends DefaultBaseService implements I
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<DistributionCardDTO> listByClassPlanIdAndUserId(String userId, String classPlanId) {
|
public List<DistributionCardDTO> listByClassPlanIdAndUserId(String classPlanId, String userId) {
|
||||||
Map<String, Object> params = new HashMap<String, Object>();
|
Map<String, Object> params = new HashMap<String, Object>();
|
||||||
params.put("classPlanId", classPlanId);
|
params.put("classPlanId", classPlanId);
|
||||||
params.put("distributionCardUserId", userId);
|
params.put("distributionCardUserId", userId);
|
||||||
|
@ -0,0 +1,22 @@
|
|||||||
|
package cn.com.tenlion.service.myexamforapp;
|
||||||
|
|
||||||
|
import cn.com.tenlion.pojo.dtos.myexam.MyExamDTO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 个人中心考试信息接口
|
||||||
|
* @author xwangs
|
||||||
|
* @create 2021-05-12 15:59
|
||||||
|
* @description
|
||||||
|
*/
|
||||||
|
public interface IMyExamForAppService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询我的考试信息
|
||||||
|
* @param token
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<MyExamDTO> listMyExam(String token, Map<String,Object> params);
|
||||||
|
}
|
@ -0,0 +1,115 @@
|
|||||||
|
package cn.com.tenlion.service.myexamforapp.impl;
|
||||||
|
|
||||||
|
import cn.com.tenlion.institutionmanagement.pojo.dtos.institution.InstitutionDTO;
|
||||||
|
import cn.com.tenlion.institutionmanagement.service.institution.IInstitutionService;
|
||||||
|
import cn.com.tenlion.pojo.dtos.classplan.ClassPlanDTO;
|
||||||
|
import cn.com.tenlion.pojo.dtos.distributioncard.DistributionCardDTO;
|
||||||
|
import cn.com.tenlion.pojo.dtos.examapply.ExamApplyDTO;
|
||||||
|
import cn.com.tenlion.pojo.dtos.myexam.MyExamDTO;
|
||||||
|
import cn.com.tenlion.pojo.dtos.worktype.WorkTypeDTO;
|
||||||
|
import cn.com.tenlion.service.classplan.IClassPlanService;
|
||||||
|
import cn.com.tenlion.service.examapply.IExamApplyService;
|
||||||
|
import cn.com.tenlion.service.examination.distributioncard.IDistributionCardService;
|
||||||
|
import cn.com.tenlion.service.myexamforapp.IMyExamForAppService;
|
||||||
|
import cn.com.tenlion.service.worktype.IWorkTypeService;
|
||||||
|
import ink.wgink.common.base.DefaultBaseService;
|
||||||
|
import ink.wgink.module.dictionary.pojo.dtos.DataDTO;
|
||||||
|
import ink.wgink.module.dictionary.service.IDataService;
|
||||||
|
import ink.wgink.pojo.app.AppTokenUser;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author xwangs
|
||||||
|
* @create 2021-05-12 16:00
|
||||||
|
* @description
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class MyExamForAppServiceImpl extends DefaultBaseService implements IMyExamForAppService {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 准考证
|
||||||
|
*/
|
||||||
|
@Autowired
|
||||||
|
private IDistributionCardService distributionCardService;
|
||||||
|
/**
|
||||||
|
* 培训计划
|
||||||
|
*/
|
||||||
|
@Autowired
|
||||||
|
private IClassPlanService classPlanService;
|
||||||
|
/**
|
||||||
|
* 培训机构
|
||||||
|
*/
|
||||||
|
@Autowired
|
||||||
|
private IInstitutionService iInstitutionService;
|
||||||
|
/**
|
||||||
|
* 数据字典
|
||||||
|
*/
|
||||||
|
@Autowired
|
||||||
|
private IDataService dataService;
|
||||||
|
/**
|
||||||
|
* 工种
|
||||||
|
*/
|
||||||
|
@Autowired
|
||||||
|
private IWorkTypeService workTypeService;
|
||||||
|
/**
|
||||||
|
* 考试申请
|
||||||
|
*/
|
||||||
|
@Autowired
|
||||||
|
private IExamApplyService examApplyService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<MyExamDTO> listMyExam(String token, Map<String, Object> params) {
|
||||||
|
AppTokenUser appTokenUser = getAppTokenUser(token);
|
||||||
|
String userId = appTokenUser.getId();
|
||||||
|
params.put("distributionCardUserId",userId);
|
||||||
|
List<DistributionCardDTO> cardDTOS = distributionCardService.list(params);
|
||||||
|
if(cardDTOS == null || cardDTOS.size() == 0){
|
||||||
|
return new ArrayList<>(0);
|
||||||
|
}
|
||||||
|
List<MyExamDTO> list = new ArrayList<>();
|
||||||
|
for(DistributionCardDTO item : cardDTOS){
|
||||||
|
MyExamDTO myExamDTO = new MyExamDTO();
|
||||||
|
// 查询计划信息
|
||||||
|
ClassPlanDTO classPlanDTO = classPlanService.get(item.getClassPlanId());
|
||||||
|
// 查询培训机构
|
||||||
|
InstitutionDTO institutionDTO = iInstitutionService.get(classPlanDTO.getOrgId());
|
||||||
|
// 查询培训项目
|
||||||
|
DataDTO dataDTO = dataService.get(classPlanDTO.getProjectCatalogId());
|
||||||
|
// 查询工种类别
|
||||||
|
WorkTypeDTO workTypeDTO = workTypeService.get(classPlanDTO.getWorkerCatalog());
|
||||||
|
myExamDTO.setOrgName(institutionDTO.getInstitutionName());
|
||||||
|
myExamDTO.setPlanName(classPlanDTO.getPlanName());
|
||||||
|
myExamDTO.setPlanNumber(classPlanDTO.getPlanNumber());
|
||||||
|
switch (classPlanDTO.getPlanType()){
|
||||||
|
case "1" : myExamDTO.setPlanTypeName("初训"); break;
|
||||||
|
case "2" : myExamDTO.setPlanTypeName("复训"); break;
|
||||||
|
case "3" : myExamDTO.setPlanTypeName("换证"); break;
|
||||||
|
default : myExamDTO.setPlanTypeName("-");
|
||||||
|
}
|
||||||
|
myExamDTO.setProjectCatalogName(dataDTO.getDataName());
|
||||||
|
myExamDTO.setWorkerCatalogName(workTypeDTO.getWorkTypeName());
|
||||||
|
Map<String, Object> queryMap = getHashMap(8);
|
||||||
|
queryMap.put("examId",item.getClassPlanId());
|
||||||
|
ExamApplyDTO examApplyDTO = examApplyService.get(queryMap);
|
||||||
|
switch (examApplyDTO.getExamType()){
|
||||||
|
case 1 : myExamDTO.setExamTypeName("理论考试"); break;
|
||||||
|
case 2 : myExamDTO.setExamTypeName("实操考试"); break;
|
||||||
|
case 3 : myExamDTO.setExamTypeName("理论与实操"); break;
|
||||||
|
default : myExamDTO.setExamTypeName("-");
|
||||||
|
}
|
||||||
|
myExamDTO.setExamTimeStart(examApplyDTO.getTheoryExamStartTime());
|
||||||
|
myExamDTO.setExamTimeEnd(examApplyDTO.getTheoryExamEndTime());
|
||||||
|
InstitutionDTO addrDto = iInstitutionService.get(examApplyDTO.getTheoryExamAddressId());
|
||||||
|
myExamDTO.setExamAddress(addrDto.getInstitutionName() + "-" + addrDto.getInstitutionAddress());
|
||||||
|
myExamDTO.setDistributionCardCode(item.getDistributionCardPictures());
|
||||||
|
list.add(myExamDTO);
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
}
|
@ -74,10 +74,10 @@
|
|||||||
{{# for(var i = 0, item; item = d[i++];) { }}
|
{{# for(var i = 0, item; item = d[i++];) { }}
|
||||||
<tr>
|
<tr>
|
||||||
<td style="text-align: center">{{item.applyName}}</td>
|
<td style="text-align: center">{{item.applyName}}</td>
|
||||||
<td style="text-align: center">{{item.applySex}}</td>
|
<td style="text-align: center">{{item.applySexName}}</td>
|
||||||
<td style="text-align: center">{{item.applyCardNumber}}</td>
|
<td style="text-align: center">{{item.applyCardNumber}}</td>
|
||||||
<td style="text-align: center">{{item.applyPhone}}</td>
|
<td style="text-align: center">{{item.applyPhone}}</td>
|
||||||
<td style="text-align: center">{{item.applyPhone}}</td>
|
<td style="text-align: center"><img src="{{item.distributionCardCode}}"></td>
|
||||||
</tr>
|
</tr>
|
||||||
{{# } }}
|
{{# } }}
|
||||||
</script>
|
</script>
|
||||||
@ -131,7 +131,7 @@
|
|||||||
}, function(code, data) {
|
}, function(code, data) {
|
||||||
top.dialog.msg(data.msg);
|
top.dialog.msg(data.msg);
|
||||||
});
|
});
|
||||||
$('.layui-card').height($win.height());
|
$('.layui-card').height($win.height())
|
||||||
}
|
}
|
||||||
initData();
|
initData();
|
||||||
|
|
||||||
@ -142,6 +142,7 @@
|
|||||||
document.getElementById('examUserTemplateBox').innerHTML = html;
|
document.getElementById('examUserTemplateBox').innerHTML = html;
|
||||||
});
|
});
|
||||||
form.render();
|
form.render();
|
||||||
|
new Viewer(document.getElementById('dataTable'),{loop:true});
|
||||||
}, function(code, data) {
|
}, function(code, data) {
|
||||||
top.dialog.msg(data.msg);
|
top.dialog.msg(data.msg);
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user