diff --git a/src/main/java/cn/com/tenlion/controller/app/api/basicstaffinfo/BasicStaffInfoAppController.java b/src/main/java/cn/com/tenlion/controller/app/api/basicstaffinfo/BasicStaffInfoAppController.java index f77bb45..e5924e9 100644 --- a/src/main/java/cn/com/tenlion/controller/app/api/basicstaffinfo/BasicStaffInfoAppController.java +++ b/src/main/java/cn/com/tenlion/controller/app/api/basicstaffinfo/BasicStaffInfoAppController.java @@ -1,5 +1,7 @@ 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.vos.basicstaffinfo.BasicStaffInfoVO; 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.web.bind.annotation.*; +import java.util.List; +import java.util.Map; + /** * 人员信息接口 * @ClassName: ExamCheckAppController @@ -27,6 +32,8 @@ public class BasicStaffInfoAppController extends DefaultBaseController { @Autowired private IBasicStaffInfoService basicStaffInfoService; + @Autowired + private IMyExamForAppService myExamForAppService; @ApiOperation(value = "查询个人资料信息", notes = "查询个人资料信息接口") @ApiImplicitParams({ @@ -50,4 +57,16 @@ public class BasicStaffInfoAppController extends DefaultBaseController { 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 listMyExam(@RequestHeader("token") String token) throws SaveException { + Map params = requestParams(); + List list = myExamForAppService.listMyExam(token,params); + return list; + } + } \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/pojo/dtos/myexam/MyExamDTO.java b/src/main/java/cn/com/tenlion/pojo/dtos/myexam/MyExamDTO.java new file mode 100644 index 0000000..111df90 --- /dev/null +++ b/src/main/java/cn/com/tenlion/pojo/dtos/myexam/MyExamDTO.java @@ -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; + } +} diff --git a/src/main/java/cn/com/tenlion/service/examination/distributioncard/impl/DistributionCardServiceImpl.java b/src/main/java/cn/com/tenlion/service/examination/distributioncard/impl/DistributionCardServiceImpl.java index 7bdf5d2..64c12ec 100644 --- a/src/main/java/cn/com/tenlion/service/examination/distributioncard/impl/DistributionCardServiceImpl.java +++ b/src/main/java/cn/com/tenlion/service/examination/distributioncard/impl/DistributionCardServiceImpl.java @@ -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.DistributionCardVO; 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.distributioncard.IDistributionCardService; 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.exceptions.SaveException; 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.pojo.ListPage; -import ink.wgink.pojo.result.SuccessResult; import ink.wgink.pojo.result.SuccessResultList; -import ink.wgink.util.map.HashMapUtil; import ink.wgink.util.UUIDUtil; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import io.swagger.annotations.ApiModelProperty; +import ink.wgink.util.map.HashMapUtil; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import java.util.*; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; /** * @ClassName: DistributionCardServiceImpl @@ -159,7 +158,7 @@ public class DistributionCardServiceImpl extends DefaultBaseService implements I } @Override - public List listByClassPlanIdAndUserId(String userId, String classPlanId) { + public List listByClassPlanIdAndUserId(String classPlanId, String userId) { Map params = new HashMap(); params.put("classPlanId", classPlanId); params.put("distributionCardUserId", userId); diff --git a/src/main/java/cn/com/tenlion/service/myexamforapp/IMyExamForAppService.java b/src/main/java/cn/com/tenlion/service/myexamforapp/IMyExamForAppService.java new file mode 100644 index 0000000..b05896b --- /dev/null +++ b/src/main/java/cn/com/tenlion/service/myexamforapp/IMyExamForAppService.java @@ -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 listMyExam(String token, Map params); +} diff --git a/src/main/java/cn/com/tenlion/service/myexamforapp/impl/MyExamForAppServiceImpl.java b/src/main/java/cn/com/tenlion/service/myexamforapp/impl/MyExamForAppServiceImpl.java new file mode 100644 index 0000000..7fc0f68 --- /dev/null +++ b/src/main/java/cn/com/tenlion/service/myexamforapp/impl/MyExamForAppServiceImpl.java @@ -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 listMyExam(String token, Map params) { + AppTokenUser appTokenUser = getAppTokenUser(token); + String userId = appTokenUser.getId(); + params.put("distributionCardUserId",userId); + List cardDTOS = distributionCardService.list(params); + if(cardDTOS == null || cardDTOS.size() == 0){ + return new ArrayList<>(0); + } + List 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 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; + } +} diff --git a/src/main/resources/static/route/classplan/show-report-exam.html b/src/main/resources/static/route/classplan/show-report-exam.html index 2c079ae..1c05eca 100644 --- a/src/main/resources/static/route/classplan/show-report-exam.html +++ b/src/main/resources/static/route/classplan/show-report-exam.html @@ -74,10 +74,10 @@ {{# for(var i = 0, item; item = d[i++];) { }} {{item.applyName}} - {{item.applySex}} + {{item.applySexName}} {{item.applyCardNumber}} {{item.applyPhone}} - {{item.applyPhone}} + {{# } }} @@ -131,7 +131,7 @@ }, function(code, data) { top.dialog.msg(data.msg); }); - $('.layui-card').height($win.height()); + $('.layui-card').height($win.height()) } initData(); @@ -142,6 +142,7 @@ document.getElementById('examUserTemplateBox').innerHTML = html; }); form.render(); + new Viewer(document.getElementById('dataTable'),{loop:true}); }, function(code, data) { top.dialog.msg(data.msg); });