diff --git a/src/main/java/cn/com/tenlion/controller/app/api/examplan/ExamPlanAppController.java b/src/main/java/cn/com/tenlion/controller/app/api/examplan/ExamPlanAppController.java index a5b4c32..4229f6d 100644 --- a/src/main/java/cn/com/tenlion/controller/app/api/examplan/ExamPlanAppController.java +++ b/src/main/java/cn/com/tenlion/controller/app/api/examplan/ExamPlanAppController.java @@ -1,6 +1,7 @@ package cn.com.tenlion.controller.app.api.examplan; import cn.com.tenlion.pojo.dtos.examplan.ExamPlanDTO; +import cn.com.tenlion.pojo.dtos.examplan.MyExamDTO; import cn.com.tenlion.pojo.vos.examplan.ExamPlanVO; import cn.com.tenlion.service.examplan.IExamPlanService; import ink.wgink.annotation.CheckRequestBodyAnnotation; @@ -120,4 +121,18 @@ public class ExamPlanAppController extends DefaultBaseController { return new SuccessResultData<>(examPlanService.count(params)); } + @ApiOperation(value = "我的考试", notes = "我的考试接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "token", value = "token", paramType = "header"), + @ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "int", defaultValue = "1"), + @ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "int", defaultValue = "20") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("my-exam") + public SuccessResultList> myExam(@RequestHeader("token") String token, ListPage page) throws ParseException { + Map params = requestParams(); + page.setParams(params); + return examPlanService.myExam(token, page); + } + } \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/dao/examplan/IExamPlanDao.java b/src/main/java/cn/com/tenlion/dao/examplan/IExamPlanDao.java index efae776..dfbbcb0 100644 --- a/src/main/java/cn/com/tenlion/dao/examplan/IExamPlanDao.java +++ b/src/main/java/cn/com/tenlion/dao/examplan/IExamPlanDao.java @@ -2,6 +2,7 @@ package cn.com.tenlion.dao.examplan; import cn.com.tenlion.pojo.bos.examplan.ExamPlanBO; import cn.com.tenlion.pojo.dtos.examplan.ExamPlanDTO; +import cn.com.tenlion.pojo.dtos.examplan.MyExamDTO; import cn.com.tenlion.pojo.pos.examplan.ExamPlanPO; import ink.wgink.exceptions.RemoveException; import ink.wgink.exceptions.SaveException; @@ -117,4 +118,11 @@ public interface IExamPlanDao { */ Integer count(Map params) throws SearchException; + /** + * 我的考试列表 + * @param params + * @return + * @throws SearchException + */ + List myExam(Map params) throws SearchException; } \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/pojo/dtos/examplan/MyExamDTO.java b/src/main/java/cn/com/tenlion/pojo/dtos/examplan/MyExamDTO.java new file mode 100644 index 0000000..7a8d286 --- /dev/null +++ b/src/main/java/cn/com/tenlion/pojo/dtos/examplan/MyExamDTO.java @@ -0,0 +1,166 @@ +package cn.com.tenlion.pojo.dtos.examplan; + +import io.swagger.annotations.ApiModelProperty; + +public class MyExamDTO { + @ApiModelProperty(name = "fullName", value = "姓名") + private String fullName; + @ApiModelProperty(name = "sex", value = "性别") + private String sex; + @ApiModelProperty(name = "examName", value = "考试名称") + private String examName; + @ApiModelProperty(name = "workTypeName", value = "考试工种") + private String workTypeName; + @ApiModelProperty(name = "examType", value = "考试类型") + private String examType; + @ApiModelProperty(name = "startTime", value = "考试开始时间") + private String startTime; + @ApiModelProperty(name = "endTime", value = "考试结束时间") + private String endTime; + @ApiModelProperty(name = "level", value = "考试级别") + private String level; + @ApiModelProperty(name = "linkMan", value = "考试联系人") + private String linkMan; + @ApiModelProperty(name = "linkPhone", value = "考试联系方式") + private String linkPhone; + @ApiModelProperty(name = "roomName", value = "主键UUID") + private String roomName; + @ApiModelProperty(name = "siteName", value = "主键UUID") + private String siteName; + @ApiModelProperty(name = "applyStudentsNewId", value = "考生信息ID") + private String applyStudentsNewId; + @ApiModelProperty(name = "checkStatus", value = "考生审核状态") + private String checkStatus; + @ApiModelProperty(name = "reason", value = "驳回原因") + private String reason; + @ApiModelProperty(name = "examPlanId", value = "考试ID") + private String examPlanId; + + public String getFullName() { + return fullName; + } + + public void setFullName(String fullName) { + this.fullName = fullName; + } + + public String getSex() { + return sex; + } + + public void setSex(String sex) { + this.sex = sex; + } + + public String getExamName() { + return examName; + } + + public void setExamName(String examName) { + this.examName = examName; + } + + public String getWorkTypeName() { + return workTypeName; + } + + public void setWorkTypeName(String workTypeName) { + this.workTypeName = workTypeName; + } + + public String getExamType() { + return examType; + } + + public void setExamType(String examType) { + this.examType = examType; + } + + public String getStartTime() { + return startTime; + } + + public void setStartTime(String startTime) { + this.startTime = startTime; + } + + public String getEndTime() { + return endTime; + } + + public void setEndTime(String endTime) { + this.endTime = endTime; + } + + public String getLevel() { + return level; + } + + public void setLevel(String level) { + this.level = level; + } + + public String getLinkMan() { + return linkMan; + } + + public void setLinkMan(String linkMan) { + this.linkMan = linkMan; + } + + public String getLinkPhone() { + return linkPhone; + } + + public void setLinkPhone(String linkPhone) { + this.linkPhone = linkPhone; + } + + public String getRoomName() { + return roomName; + } + + public void setRoomName(String roomName) { + this.roomName = roomName; + } + + public String getSiteName() { + return siteName; + } + + public void setSiteName(String siteName) { + this.siteName = siteName; + } + + public String getApplyStudentsNewId() { + return applyStudentsNewId; + } + + public void setApplyStudentsNewId(String applyStudentsNewId) { + this.applyStudentsNewId = applyStudentsNewId; + } + + public String getCheckStatus() { + return checkStatus; + } + + public void setCheckStatus(String checkStatus) { + this.checkStatus = checkStatus; + } + + public String getReason() { + return reason; + } + + public void setReason(String reason) { + this.reason = reason; + } + + public String getExamPlanId() { + return examPlanId; + } + + public void setExamPlanId(String examPlanId) { + this.examPlanId = examPlanId; + } +} diff --git a/src/main/java/cn/com/tenlion/service/examplan/IExamPlanService.java b/src/main/java/cn/com/tenlion/service/examplan/IExamPlanService.java index a12394e..015df46 100644 --- a/src/main/java/cn/com/tenlion/service/examplan/IExamPlanService.java +++ b/src/main/java/cn/com/tenlion/service/examplan/IExamPlanService.java @@ -2,6 +2,7 @@ package cn.com.tenlion.service.examplan; import cn.com.tenlion.pojo.bos.examplan.ExamPlanBO; import cn.com.tenlion.pojo.dtos.examplan.ExamPlanDTO; +import cn.com.tenlion.pojo.dtos.examplan.MyExamDTO; import cn.com.tenlion.pojo.pos.examplan.ExamPlanPO; import cn.com.tenlion.pojo.vos.examplan.ExamPlanVO; import ink.wgink.pojo.ListPage; @@ -191,4 +192,12 @@ public interface IExamPlanService { * @param params */ void updateSendStatus(Map params); + + /** + * 我的考试列表 + * @param token + * @param page + * @return + */ + SuccessResultList> myExam(String token, ListPage page); } \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/service/examplan/impl/ExamPlanServiceImpl.java b/src/main/java/cn/com/tenlion/service/examplan/impl/ExamPlanServiceImpl.java index bf8fd56..79fb82e 100644 --- a/src/main/java/cn/com/tenlion/service/examplan/impl/ExamPlanServiceImpl.java +++ b/src/main/java/cn/com/tenlion/service/examplan/impl/ExamPlanServiceImpl.java @@ -4,6 +4,7 @@ import cn.com.tenlion.dao.examplan.IExamPlanDao; import cn.com.tenlion.pojo.bos.examplan.ExamPlanBO; import cn.com.tenlion.pojo.dtos.applystudentsnew.ApplyStudentsNewDTO; import cn.com.tenlion.pojo.dtos.examplan.ExamPlanDTO; +import cn.com.tenlion.pojo.dtos.examplan.MyExamDTO; import cn.com.tenlion.pojo.pos.examplan.ExamPlanPO; import cn.com.tenlion.pojo.vos.distribution.DistributionSaveVO; import cn.com.tenlion.pojo.vos.examplan.ExamPlanVO; @@ -30,7 +31,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import javax.servlet.http.HttpServletRequest; -import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.*; @@ -336,4 +336,36 @@ public class ExamPlanServiceImpl extends DefaultBaseService implements IExamPlan contentService.updatePublishStatus(params.get("contentId").toString(), Integer.valueOf(params.get("isSend").toString())); } + @Override + public SuccessResultList> myExam(String token, ListPage page) { + PageHelper.startPage(page.getPage(), page.getRows()); + AppTokenUser appTokenUser = getAppTokenUser(token); + page.getParams().put("userId", appTokenUser.getId()); + List examPlanDTOList = examPlanDao.myExam(page.getParams()); + if(null != examPlanDTOList && examPlanDTOList.size() > 0) { + for(MyExamDTO myExamDTO: examPlanDTOList) { + if(!StringUtils.isEmpty(myExamDTO.getCheckStatus())) { + if("0".equals(myExamDTO.getCheckStatus())) { + myExamDTO.setCheckStatus("未审核"); + }else if("1".equals(myExamDTO.getCheckStatus())) { + myExamDTO.setCheckStatus("审核通过"); + }else if("-1".equals(myExamDTO.getCheckStatus())) { + myExamDTO.setCheckStatus("审核驳回"); + } + } + if(!StringUtils.isEmpty(myExamDTO.getExamType())) { + if("1".equals(myExamDTO.getExamType())) { + myExamDTO.setExamType("知识"); + }else if("2".equals(myExamDTO.getExamType())) { + myExamDTO.setExamType("实操"); + }else if("3".equals(myExamDTO.getExamType())) { + myExamDTO.setExamType("补考"); + } + } + } + } + PageInfo pageInfo = new PageInfo<>(examPlanDTOList); + return new SuccessResultList<>(examPlanDTOList, pageInfo.getPageNum(), pageInfo.getTotal()); + } + } \ No newline at end of file diff --git a/src/main/resources/mybatis/mapper/applystudentsnew/apply-students-new-mapper.xml b/src/main/resources/mybatis/mapper/applystudentsnew/apply-students-new-mapper.xml index 72518ee..88d05f7 100644 --- a/src/main/resources/mybatis/mapper/applystudentsnew/apply-students-new-mapper.xml +++ b/src/main/resources/mybatis/mapper/applystudentsnew/apply-students-new-mapper.xml @@ -201,7 +201,7 @@ id_card, card_validity, review_time, - zhicheng + zhicheng, school, major, work_post, diff --git a/src/main/resources/mybatis/mapper/examplan/exam-plan-mapper.xml b/src/main/resources/mybatis/mapper/examplan/exam-plan-mapper.xml index f09c3c2..b171313 100644 --- a/src/main/resources/mybatis/mapper/examplan/exam-plan-mapper.xml +++ b/src/main/resources/mybatis/mapper/examplan/exam-plan-mapper.xml @@ -101,6 +101,25 @@ + + + + + + + + + + + + + + + + + + + INSERT INTO e_exam_plan( @@ -604,4 +623,31 @@ t1.is_delete = 0 + + \ No newline at end of file