feat:考试详情

pg_adapter
wangxy 9 months ago
parent 672eb4b7bc
commit 5ee67b9bca

@ -1,7 +1,10 @@
package com.ruoyi.web.controller.exam;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.domain.userexam.dto.request.UserExamReqDTO;
import com.ruoyi.system.domain.userexam.dto.response.UserExamRespDTO;
import com.ruoyi.web.controller.manager.UserExamManager;
@ -52,4 +55,13 @@ public class UserExamController extends BaseController {
List<UserExamRespDTO> list = userExamManager.selectExamList(reqDTO);
return getDataTable(list);
}
@ApiOperation("详情")
@GetMapping("/detail")
@ResponseBody
public AjaxResult detail(String examId,Long userId) {
return success(userExamManager.detail(examId,userId));
}
}

@ -1,9 +1,13 @@
package com.ruoyi.web.controller.manager;
import com.ruoyi.system.domain.exam.dto.ExamDTO;
import com.ruoyi.system.domain.exam.dto.request.ExamSaveReqDTO;
import com.ruoyi.system.domain.paper.dto.request.PaperListReqDTO;
import com.ruoyi.system.domain.paper.dto.response.PaperListRespDTO;
import com.ruoyi.system.domain.userexam.ElUserExam;
import com.ruoyi.system.domain.userexam.dto.request.UserExamReqDTO;
import com.ruoyi.system.domain.userexam.dto.response.UserExamRespDTO;
import com.ruoyi.system.service.ElPaperService;
import com.ruoyi.system.service.ElUserExamService;
import org.springframework.stereotype.Component;
@ -28,6 +32,10 @@ public class UserExamManager {
private ElUserExamService elUserExamService;
@Resource
private ElPaperService paperService;
@ -76,4 +84,11 @@ public class UserExamManager {
}
elUserExamService.updateById(record);
}
public List<PaperListRespDTO> detail(String examId,Long userId) {
PaperListReqDTO paperListReqDTO = new PaperListReqDTO();
paperListReqDTO.setUserId(userId);
paperListReqDTO.setExamId(examId);
return paperService.paging(paperListReqDTO);
}
}

@ -26,7 +26,7 @@ public class PaperDTO implements Serializable {
private String id;
@ApiModelProperty(value = "用户ID")
private String userId;
private Long userId;
@ApiModelProperty(value = "部门ID")
private String departId;

@ -21,7 +21,7 @@ public class PaperListReqDTO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "用户ID")
private String userId;
private Long userId;
@ApiModelProperty(value = "部门ID")
private String departId;
@ -30,7 +30,7 @@ public class PaperListReqDTO implements Serializable {
private String examId;
@ApiModelProperty(value = "用户昵称")
private String realName;
private String userName;
@ApiModelProperty(value = "试卷状态")
private Integer state;

@ -20,7 +20,7 @@ public class PaperListRespDTO extends PaperDTO {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "人员")
private String realName;
private String userName;
}

@ -25,7 +25,7 @@ public class UserExamDTO implements Serializable {
private String id;
@ApiModelProperty(value = "用户ID")
private String userId;
private Long userId;
@ApiModelProperty(value = "考试ID")
private String examId;

@ -2,8 +2,12 @@ package com.ruoyi.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.system.domain.paper.ElPaper;
import com.ruoyi.system.domain.paper.dto.request.PaperListReqDTO;
import com.ruoyi.system.domain.paper.dto.response.PaperListRespDTO;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* @author 13560
* @description el_paper()Mapper
@ -13,6 +17,14 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface ElPaperMapper extends BaseMapper<ElPaper> {
/**
*
* @param paperListReqDTO
* @return
*/
List<PaperListRespDTO> paging(PaperListReqDTO paperListReqDTO);
}

@ -1,7 +1,14 @@
package com.ruoyi.system.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.system.domain.paper.ElPaper;
import com.ruoyi.system.domain.paper.dto.request.PaperListReqDTO;
import com.ruoyi.system.domain.paper.dto.response.PaperListRespDTO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @author 13560
@ -10,4 +17,12 @@ import com.ruoyi.system.domain.paper.ElPaper;
*/
public interface ElPaperService extends IService<ElPaper> {
/**
*
* @param query
* @return
*/
List<PaperListRespDTO> paging(PaperListReqDTO query);
}

@ -2,10 +2,15 @@ package com.ruoyi.system.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.system.domain.paper.ElPaper;
import com.ruoyi.system.domain.paper.dto.request.PaperListReqDTO;
import com.ruoyi.system.domain.paper.dto.response.PaperListRespDTO;
import com.ruoyi.system.mapper.ElPaperMapper;
import com.ruoyi.system.service.ElPaperService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/**
* @author 13560
* @description el_paper()Service
@ -15,6 +20,13 @@ import org.springframework.stereotype.Service;
public class ElPaperServiceImpl extends ServiceImpl<ElPaperMapper, ElPaper>
implements ElPaperService {
@Resource
private ElPaperMapper elPaperMapper;
@Override
public List<PaperListRespDTO> paging(PaperListReqDTO paperListReqDTO) {
return elPaperMapper.paging(paperListReqDTO);
}
}

@ -32,4 +32,28 @@
has_saq,state,create_time,
update_time,limit_time
</sql>
<select id="paging" parameterType="com.ruoyi.system.domain.paper.dto.request.PaperListReqDTO" resultType="com.ruoyi.system.domain.paper.dto.response.PaperListRespDTO">
SELECT pp.*,uc.user_name FROM el_paper pp
LEFT JOIN ${prefix}sys_user uc ON pp.user_id=uc.user_id
<trim prefix="where" prefixOverrides="and|or">
<if test="examId!=null and examId!=''">
AND pp.exam_id=#{examId}
</if>
<if test="userId!=null and userId!=''">
AND pp.user_id=#{userId}
</if>
<if test="departId!=null and departId!=''">
AND pp.depart_id=#{departId}
</if>
<if test="state!=null">
AND pp.state=#{state}
</if>
<if test="userName!=null and userName!=''">
AND uc.user_name LIKE CONCAT('%',#{userName},'%')
</if>
</trim>
ORDER BY create_time DESC
</select>
</mapper>

Loading…
Cancel
Save