考试系统第一版
This commit is contained in:
parent
9bac380c26
commit
b9f2f6c2c4
@ -19,6 +19,7 @@ import com.yf.exam.modules.exam.mapper.ExamMapper;
|
||||
import com.yf.exam.modules.exam.service.ExamDepartService;
|
||||
import com.yf.exam.modules.exam.service.ExamRepoService;
|
||||
import com.yf.exam.modules.exam.service.ExamService;
|
||||
import com.yf.exam.modules.paper.enums.ExamType;
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
@ -62,8 +63,13 @@ public class ExamServiceImpl extends ServiceImpl<ExamMapper, Exam> implements Ex
|
||||
this.calcScore(reqDTO);
|
||||
|
||||
|
||||
if (reqDTO.getTimeLimit() && (reqDTO.getStartDate() == null || reqDTO.getEndDate() == null || reqDTO.getStartTime() == null || reqDTO.getEndTime() == null)) {
|
||||
throw new ServiceException(1, "日期时间范围不能为空!");
|
||||
}
|
||||
// 复制基本数据
|
||||
BeanUtils.copyProperties(reqDTO, entity);
|
||||
if (reqDTO != null) {
|
||||
BeanUtils.copyProperties(reqDTO, entity);
|
||||
}
|
||||
entity.setId(id);
|
||||
|
||||
// 修复状态
|
||||
@ -98,7 +104,9 @@ public class ExamServiceImpl extends ServiceImpl<ExamMapper, Exam> implements Ex
|
||||
ExamSaveReqDTO respDTO = new ExamSaveReqDTO();
|
||||
Exam exam = this.getById(id);
|
||||
//BeanMapper.copy(exam, respDTO);
|
||||
BeanUtils.copyProperties(exam, respDTO);
|
||||
if (exam != null){
|
||||
BeanUtils.copyProperties(exam, respDTO);
|
||||
}
|
||||
|
||||
// 考试部门
|
||||
List<String> departIds = examDepartService.listByExam(id);
|
||||
@ -115,7 +123,9 @@ public class ExamServiceImpl extends ServiceImpl<ExamMapper, Exam> implements Ex
|
||||
public ExamDTO findById(String id) {
|
||||
ExamDTO respDTO = new ExamDTO();
|
||||
Exam exam = this.getById(id);
|
||||
BeanUtils.copyProperties(exam, respDTO);
|
||||
if (exam != null){
|
||||
BeanUtils.copyProperties(exam, respDTO);
|
||||
}
|
||||
return respDTO;
|
||||
}
|
||||
|
||||
@ -161,7 +171,9 @@ public class ExamServiceImpl extends ServiceImpl<ExamMapper, Exam> implements Ex
|
||||
*/
|
||||
@Override
|
||||
public List<ExamDTO> getExamList(ExamSearchDTO reqDTO) {
|
||||
reqDTO.setExamType(ExamType.FORMAL);
|
||||
reqDTO.setStartDate(LocalDate.now());
|
||||
reqDTO.setEndDate(LocalDate.now());
|
||||
List<ExamDTO> list = baseMapper.getExamList(reqDTO);
|
||||
return list;
|
||||
}
|
||||
|
||||
@ -26,5 +26,11 @@ public class UserExamReqDTO extends UserExamDTO {
|
||||
@ApiModelProperty(value = "人员名称", required=true)
|
||||
private String realName;
|
||||
|
||||
/**
|
||||
* 考试类型(1:模拟考试,2:正式考试)
|
||||
* */
|
||||
@ApiModelProperty(value = "考试类型(1:模拟考试,2:正式考试)", required=true)
|
||||
private Integer examType;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -23,6 +23,12 @@ public class UserExamRespDTO extends UserExamDTO {
|
||||
@ApiModelProperty(value = "考试名称", required=true)
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 考试类型(1:模拟考试,2:正式考试)
|
||||
* */
|
||||
@ApiModelProperty(value = "考试类型(1:模拟考试,2:正式考试)", required=true)
|
||||
private Integer examType;
|
||||
|
||||
@ApiModelProperty(value = "人员名称", required=true)
|
||||
private String realName;
|
||||
|
||||
|
||||
@ -107,11 +107,14 @@
|
||||
<if test="query.openType!=null">
|
||||
AND open_type = #{query.openType}
|
||||
</if>
|
||||
<if test="query.examType!=null">
|
||||
AND exam_type = #{query.examType}
|
||||
</if>
|
||||
<if test="query.startDate!=null">
|
||||
AND start_date >= #{query.startDate}
|
||||
AND start_date <= #{query.startDate}
|
||||
</if>
|
||||
<if test="query.endDate!=null">
|
||||
AND end_date <= #{query.endDate}
|
||||
AND end_date >= #{query.endDate}
|
||||
</if>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
@ -29,7 +29,7 @@
|
||||
|
||||
|
||||
<select id="paging" resultMap="ListResultMap">
|
||||
SELECT ue.*,ee.title,uc.real_name FROM el_user_exam ue
|
||||
SELECT ue.*,ee.title,ee.exam_type, uc.real_name FROM el_user_exam ue
|
||||
LEFT JOIN el_exam ee ON ue.exam_id=ee.id
|
||||
LEFT JOIN sys_user uc ON ue.user_id=uc.id
|
||||
WHERE ee.id IS NOT NULL AND uc.id IS NOT NULL
|
||||
@ -45,6 +45,9 @@
|
||||
<if test="query.title!=null and query.title!=''">
|
||||
AND ee.title LIKE CONCAT('%',#{query.title},'%')
|
||||
</if>
|
||||
<if test="query.examType!=null">
|
||||
AND ee.exam_type = #{query.examType}
|
||||
</if>
|
||||
<if test="query.realName!=null and query.realName!=''">
|
||||
AND uc.real_name LIKE CONCAT('%',#{query.realName},'%')
|
||||
</if>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user