我的考试列表接口新增。
This commit is contained in:
parent
b4344d623b
commit
b4eb1bd0cd
@ -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<List<MyExamDTO>> myExam(@RequestHeader("token") String token, ListPage page) throws ParseException {
|
||||
Map<String, Object> params = requestParams();
|
||||
page.setParams(params);
|
||||
return examPlanService.myExam(token, page);
|
||||
}
|
||||
|
||||
}
|
@ -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<String, Object> params) throws SearchException;
|
||||
|
||||
/**
|
||||
* 我的考试列表
|
||||
* @param params
|
||||
* @return
|
||||
* @throws SearchException
|
||||
*/
|
||||
List<MyExamDTO> myExam(Map<String, Object> params) throws SearchException;
|
||||
}
|
166
src/main/java/cn/com/tenlion/pojo/dtos/examplan/MyExamDTO.java
Normal file
166
src/main/java/cn/com/tenlion/pojo/dtos/examplan/MyExamDTO.java
Normal file
@ -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;
|
||||
}
|
||||
}
|
@ -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<String, Object> params);
|
||||
|
||||
/**
|
||||
* 我的考试列表
|
||||
* @param token
|
||||
* @param page
|
||||
* @return
|
||||
*/
|
||||
SuccessResultList<List<MyExamDTO>> myExam(String token, ListPage page);
|
||||
}
|
@ -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<List<MyExamDTO>> myExam(String token, ListPage page) {
|
||||
PageHelper.startPage(page.getPage(), page.getRows());
|
||||
AppTokenUser appTokenUser = getAppTokenUser(token);
|
||||
page.getParams().put("userId", appTokenUser.getId());
|
||||
List<MyExamDTO> 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<MyExamDTO> pageInfo = new PageInfo<>(examPlanDTOList);
|
||||
return new SuccessResultList<>(examPlanDTOList, pageInfo.getPageNum(), pageInfo.getTotal());
|
||||
}
|
||||
|
||||
}
|
@ -201,7 +201,7 @@
|
||||
id_card,
|
||||
card_validity,
|
||||
review_time,
|
||||
zhicheng
|
||||
zhicheng,
|
||||
school,
|
||||
major,
|
||||
work_post,
|
||||
|
@ -101,6 +101,25 @@
|
||||
<result column="is_delete" property="isDelete"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="myExamDTO" type="cn.com.tenlion.pojo.dtos.examplan.MyExamDTO">
|
||||
<result column="full_name" property="fullName"/>
|
||||
<result column="sex" property="sex"/>
|
||||
<result column="exam_name" property="examName"/>
|
||||
<result column="work_type_name" property="workTypeName"/>
|
||||
<result column="exam_type" property="examType"/>
|
||||
<result column="start_time" property="startTime"/>
|
||||
<result column="end_time" property="endTime"/>
|
||||
<result column="level" property="level"/>
|
||||
<result column="link_man" property="linkMan"/>
|
||||
<result column="link_phone" property="linkPhone"/>
|
||||
<result column="room_name" property="roomName"/>
|
||||
<result column="site_name" property="siteName"/>
|
||||
<result column="apply_students_new_id" property="applyStudentsNewId"/>
|
||||
<result column="check_status" property="checkStatus"/>
|
||||
<result column="reason" property="reason"/>
|
||||
<result column="exam_plan_id" property="examPlanId"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 新增考试计划 -->
|
||||
<insert id="save" parameterType="map">
|
||||
INSERT INTO e_exam_plan(
|
||||
@ -604,4 +623,31 @@
|
||||
t1.is_delete = 0
|
||||
</select>
|
||||
|
||||
<select id="myExam" parameterType="map" resultMap="myExamDTO">
|
||||
SELECT
|
||||
t1.apply_students_new_id,
|
||||
t1.name full_name,
|
||||
t1.sex,
|
||||
t1.check_status,
|
||||
t1.reason,
|
||||
t2.exam_plan_id,
|
||||
t2.`name` exam_name,
|
||||
t2.work_type_name,
|
||||
t2.exam_type,
|
||||
t2.start_time,
|
||||
t2.end_time,
|
||||
t2.`level`,
|
||||
t2.link_man,
|
||||
t2.link_phone,
|
||||
t2.room_name,
|
||||
t2.site_name
|
||||
FROM
|
||||
e_apply_students_new t1
|
||||
LEFT JOIN e_exam_plan t2 ON t1.class_plan_id = t2.exam_plan_id
|
||||
AND t2.is_delete = 0
|
||||
WHERE
|
||||
t1.is_delete = 0
|
||||
AND t1.user_id = #{userId}
|
||||
</select>
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue
Block a user