提交代码
parent
c51bd4bc1e
commit
a440b1c265
|
@ -0,0 +1,31 @@
|
||||||
|
package com.yanzhu.common.core.enums;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工种类型
|
||||||
|
*/
|
||||||
|
public enum CraftType {
|
||||||
|
|
||||||
|
PTGZ("1", "普通工种"),
|
||||||
|
TSGZ("2", "特殊工种"),
|
||||||
|
GLRY("3", "管理人员");
|
||||||
|
|
||||||
|
private final String code;
|
||||||
|
private final String info;
|
||||||
|
|
||||||
|
CraftType(String code, String info)
|
||||||
|
{
|
||||||
|
this.code = code;
|
||||||
|
this.info = info;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCode()
|
||||||
|
{
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getInfo()
|
||||||
|
{
|
||||||
|
return info;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,32 @@
|
||||||
|
package com.yanzhu.common.core.enums;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 进场状态
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
*/
|
||||||
|
public enum UseStateEnums {
|
||||||
|
|
||||||
|
IN("1", "进场"),
|
||||||
|
OUT("2", "离场");
|
||||||
|
|
||||||
|
private final String code;
|
||||||
|
private final String info;
|
||||||
|
|
||||||
|
UseStateEnums(String code, String info)
|
||||||
|
{
|
||||||
|
this.code = code;
|
||||||
|
this.info = info;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCode()
|
||||||
|
{
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getInfo()
|
||||||
|
{
|
||||||
|
return info;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -5,6 +5,8 @@ import com.yanzhu.common.core.web.domain.BaseEntity;
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户试卷对象 bus_exam_user
|
* 用户试卷对象 bus_exam_user
|
||||||
*
|
*
|
||||||
|
@ -39,11 +41,11 @@ public class BusExamUser extends BaseEntity
|
||||||
|
|
||||||
/** 用户名称 */
|
/** 用户名称 */
|
||||||
@Excel(name = "用户名称")
|
@Excel(name = "用户名称")
|
||||||
private Long userNick;
|
private String userNick;
|
||||||
|
|
||||||
/** 用户账号 */
|
/** 用户账号 */
|
||||||
@Excel(name = "用户账号")
|
@Excel(name = "用户账号")
|
||||||
private Long userName;
|
private String userName;
|
||||||
|
|
||||||
/** 试卷名称 */
|
/** 试卷名称 */
|
||||||
@Excel(name = "试卷名称")
|
@Excel(name = "试卷名称")
|
||||||
|
@ -89,6 +91,9 @@ public class BusExamUser extends BaseEntity
|
||||||
@Excel(name = "删除标识")
|
@Excel(name = "删除标识")
|
||||||
private Long isDel;
|
private Long isDel;
|
||||||
|
|
||||||
|
/** 用户试卷结果信息 */
|
||||||
|
private List<BusExamUserResult> busExamUserResultList;
|
||||||
|
|
||||||
public void setId(Long id)
|
public void setId(Long id)
|
||||||
{
|
{
|
||||||
this.id = id;
|
this.id = id;
|
||||||
|
@ -143,19 +148,19 @@ public class BusExamUser extends BaseEntity
|
||||||
return userId;
|
return userId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Long getUserNick() {
|
public String getUserNick() {
|
||||||
return userNick;
|
return userNick;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUserNick(Long userNick) {
|
public void setUserNick(String userNick) {
|
||||||
this.userNick = userNick;
|
this.userNick = userNick;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Long getUserName() {
|
public String getUserName() {
|
||||||
return userName;
|
return userName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUserName(Long userName) {
|
public void setUserName(String userName) {
|
||||||
this.userName = userName;
|
this.userName = userName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -259,6 +264,14 @@ public class BusExamUser extends BaseEntity
|
||||||
return isDel;
|
return isDel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<BusExamUserResult> getBusExamUserResultList() {
|
||||||
|
return busExamUserResultList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBusExamUserResultList(List<BusExamUserResult> busExamUserResultList) {
|
||||||
|
this.busExamUserResultList = busExamUserResultList;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
|
|
@ -9,27 +9,41 @@ import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
* 用户试卷结果对象 bus_exam_user_result
|
* 用户试卷结果对象 bus_exam_user_result
|
||||||
*
|
*
|
||||||
* @author JiangYuQi
|
* @author JiangYuQi
|
||||||
* @date 2024-08-25
|
* @date 2024-10-03
|
||||||
*/
|
*/
|
||||||
public class BusExamUserResult extends BaseEntity
|
public class BusExamUserResult extends BaseEntity
|
||||||
{
|
{
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** 主键 */
|
||||||
|
private Long id;
|
||||||
|
|
||||||
/** 用户试卷主键 */
|
/** 用户试卷主键 */
|
||||||
@Excel(name = "用户试卷主键")
|
@Excel(name = "用户试卷主键")
|
||||||
private Long examUserId;
|
private Long examUserId;
|
||||||
|
|
||||||
/** 问题主键 */
|
/** 问题主键 */
|
||||||
@Excel(name = "问题主键")
|
|
||||||
private Long questionId;
|
private Long questionId;
|
||||||
|
|
||||||
|
/** 问题描述 */
|
||||||
|
@Excel(name = "问题描述")
|
||||||
|
private String questionTitle;
|
||||||
|
|
||||||
|
/** 问题类型 */
|
||||||
|
@Excel(name = "问题类型")
|
||||||
|
private Long questionType;
|
||||||
|
|
||||||
|
/** 问题选项 */
|
||||||
|
@Excel(name = "问题选项")
|
||||||
|
private String questionOption;
|
||||||
|
|
||||||
/** 用户答案 */
|
/** 用户答案 */
|
||||||
@Excel(name = "用户答案")
|
@Excel(name = "用户答案")
|
||||||
private String answers;
|
private String userAnswer;
|
||||||
|
|
||||||
/** 排序 */
|
/** 问题答案 */
|
||||||
@Excel(name = "排序")
|
@Excel(name = "问题答案")
|
||||||
private Long sortBy;
|
private String answer;
|
||||||
|
|
||||||
/** 答题结果 */
|
/** 答题结果 */
|
||||||
@Excel(name = "答题结果")
|
@Excel(name = "答题结果")
|
||||||
|
@ -39,6 +53,15 @@ public class BusExamUserResult extends BaseEntity
|
||||||
@Excel(name = "答题得分")
|
@Excel(name = "答题得分")
|
||||||
private String useMark;
|
private String useMark;
|
||||||
|
|
||||||
|
public void setId(Long id)
|
||||||
|
{
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getId()
|
||||||
|
{
|
||||||
|
return id;
|
||||||
|
}
|
||||||
public void setExamUserId(Long examUserId)
|
public void setExamUserId(Long examUserId)
|
||||||
{
|
{
|
||||||
this.examUserId = examUserId;
|
this.examUserId = examUserId;
|
||||||
|
@ -48,32 +71,58 @@ public class BusExamUserResult extends BaseEntity
|
||||||
{
|
{
|
||||||
return examUserId;
|
return examUserId;
|
||||||
}
|
}
|
||||||
public void setQuestionId(Long questionId)
|
public void setQuestionTitle(String questionTitle)
|
||||||
{
|
{
|
||||||
|
this.questionTitle = questionTitle;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getQuestionTitle()
|
||||||
|
{
|
||||||
|
return questionTitle;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getQuestionId() {
|
||||||
|
return questionId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setQuestionId(Long questionId) {
|
||||||
this.questionId = questionId;
|
this.questionId = questionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Long getQuestionId()
|
public Long getQuestionType() {
|
||||||
{
|
return questionType;
|
||||||
return questionId;
|
|
||||||
}
|
|
||||||
public void setAnswers(String answers)
|
|
||||||
{
|
|
||||||
this.answers = answers;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getAnswers()
|
public void setQuestionType(Long questionType) {
|
||||||
{
|
this.questionType = questionType;
|
||||||
return answers;
|
|
||||||
}
|
|
||||||
public void setSortBy(Long sortBy)
|
|
||||||
{
|
|
||||||
this.sortBy = sortBy;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Long getSortBy()
|
public void setQuestionOption(String questionOption)
|
||||||
{
|
{
|
||||||
return sortBy;
|
this.questionOption = questionOption;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getQuestionOption()
|
||||||
|
{
|
||||||
|
return questionOption;
|
||||||
|
}
|
||||||
|
public void setUserAnswer(String userAnswer)
|
||||||
|
{
|
||||||
|
this.userAnswer = userAnswer;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUserAnswer()
|
||||||
|
{
|
||||||
|
return userAnswer;
|
||||||
|
}
|
||||||
|
public void setAnswer(String answer)
|
||||||
|
{
|
||||||
|
this.answer = answer;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAnswer()
|
||||||
|
{
|
||||||
|
return answer;
|
||||||
}
|
}
|
||||||
public void setUseRes(String useRes)
|
public void setUseRes(String useRes)
|
||||||
{
|
{
|
||||||
|
@ -97,10 +146,12 @@ public class BusExamUserResult extends BaseEntity
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
.append("id", getId())
|
||||||
.append("examUserId", getExamUserId())
|
.append("examUserId", getExamUserId())
|
||||||
.append("questionId", getQuestionId())
|
.append("questionTitle", getQuestionTitle())
|
||||||
.append("answers", getAnswers())
|
.append("questionOption", getQuestionOption())
|
||||||
.append("sortBy", getSortBy())
|
.append("userAnswer", getUserAnswer())
|
||||||
|
.append("answer", getAnswer())
|
||||||
.append("useRes", getUseRes())
|
.append("useRes", getUseRes())
|
||||||
.append("useMark", getUseMark())
|
.append("useMark", getUseMark())
|
||||||
.toString();
|
.toString();
|
||||||
|
|
|
@ -44,6 +44,14 @@ public interface BusExamInfoMapper
|
||||||
*/
|
*/
|
||||||
public int updateBusExamInfo(BusExamInfo busExamInfo);
|
public int updateBusExamInfo(BusExamInfo busExamInfo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改基础试卷使用次数
|
||||||
|
*
|
||||||
|
* @param id 基础试卷主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public void updateExamUseNumber(Long id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除基础试卷
|
* 删除基础试卷
|
||||||
*
|
*
|
||||||
|
|
|
@ -2,6 +2,7 @@ package com.yanzhu.manage.mapper;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import com.yanzhu.manage.domain.BusExamUser;
|
import com.yanzhu.manage.domain.BusExamUser;
|
||||||
|
import com.yanzhu.manage.domain.BusExamUserResult;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户试卷Mapper接口
|
* 用户试卷Mapper接口
|
||||||
|
@ -58,4 +59,30 @@ public interface BusExamUserMapper
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteBusExamUserByIds(Long[] ids);
|
public int deleteBusExamUserByIds(Long[] ids);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除用户试卷结果
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteBusExamUserResultByExamUserIds(Long[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量新增用户试卷结果
|
||||||
|
*
|
||||||
|
* @param busExamUserResultList 用户试卷结果列表
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int batchBusExamUserResult(List<BusExamUserResult> busExamUserResultList);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过用户试卷主键删除用户试卷结果信息
|
||||||
|
*
|
||||||
|
* @param id 用户试卷ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteBusExamUserResultByExamUserId(Long id);
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,6 +60,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="examType != null and examType != ''"> and bei.exam_type = #{examType}</if>
|
<if test="examType != null and examType != ''"> and bei.exam_type = #{examType}</if>
|
||||||
<if test="craftType != null and craftType != ''"> and bei.craft_type = #{craftType}</if>
|
<if test="craftType != null and craftType != ''"> and bei.craft_type = #{craftType}</if>
|
||||||
<if test="craftPost != null and craftPost != ''"> and bei.craft_post = #{craftPost}</if>
|
<if test="craftPost != null and craftPost != ''"> and bei.craft_post = #{craftPost}</if>
|
||||||
|
<if test="isDel != null "> and bei.is_del = #{isDel}</if>
|
||||||
</where>
|
</where>
|
||||||
order by bei.id desc
|
order by bei.id desc
|
||||||
</select>
|
</select>
|
||||||
|
@ -152,6 +153,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
<update id="updateExamUseNumber" parameterType="Long">
|
||||||
|
update bus_exam_info set use_number = use_number+1 where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
<delete id="deleteBusExamInfoById" parameterType="Long">
|
<delete id="deleteBusExamInfoById" parameterType="Long">
|
||||||
delete from bus_exam_info where id = #{id}
|
delete from bus_exam_info where id = #{id}
|
||||||
</delete>
|
</delete>
|
||||||
|
|
|
@ -62,6 +62,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="questionType != null "> and beq.question_type = #{questionType} </if>
|
<if test="questionType != null "> and beq.question_type = #{questionType} </if>
|
||||||
<if test="questionScope != null and questionScope != ''"> and beq.question_scope = #{questionScope}</if>
|
<if test="questionScope != null and questionScope != ''"> and beq.question_scope = #{questionScope}</if>
|
||||||
<if test="questionDesc != null and questionDesc != ''"> and beq.question_desc = #{questionDesc}</if>
|
<if test="questionDesc != null and questionDesc != ''"> and beq.question_desc = #{questionDesc}</if>
|
||||||
|
<if test="isDel != null"> and beq.is_del = #{isDel}</if>
|
||||||
</where>
|
</where>
|
||||||
order by beq.id desc
|
order by beq.id desc
|
||||||
</select>
|
</select>
|
||||||
|
|
|
@ -31,8 +31,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<result property="remark" column="remark" />
|
<result property="remark" column="remark" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
|
<resultMap id="BusExamUserBusExamUserResultResult" type="BusExamUser" extends="BusExamUserResult">
|
||||||
|
<collection property="busExamUserResultList" notNullColumn="sub_id" javaType="java.util.List" resultMap="BusExamUserResultResult" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<resultMap type="BusExamUserResult" id="BusExamUserResultResult">
|
||||||
|
<result property="id" column="sub_id" />
|
||||||
|
<result property="examUserId" column="sub_exam_user_id" />
|
||||||
|
<result property="questionId" column="sub_question_id" />
|
||||||
|
<result property="questionTitle" column="sub_question_title" />
|
||||||
|
<result property="questionType" column="sub_question_type" />
|
||||||
|
<result property="questionOption" column="sub_question_option" />
|
||||||
|
<result property="userAnswer" column="sub_user_answer" />
|
||||||
|
<result property="answer" column="sub_answer" />
|
||||||
|
<result property="useRes" column="sub_use_res" />
|
||||||
|
<result property="useMark" column="sub_use_mark" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectBusExamUserVo">
|
<sql id="selectBusExamUserVo">
|
||||||
select beu.id, beu.com_id, sd.dept_name as com_name, beu.project_id, pi.project_name, beu.user_id, su.user_nick, su.user_name, beu.exam_title, beu.exam_type, beu.craft_type, beu.craft_post, beu.single_num, beu.multiple_num, beu.estimate_num, beu.user_mark, beu.res_status, beu.use_times, beu.is_del, beu.create_by, beu.create_time, beu.update_by, beu.update_time, beu.remark from bus_exam_user beu
|
select beu.id, beu.com_id, sd.dept_name as com_name, beu.project_id, pi.project_name, beu.user_id, su.nick_name as user_nick, su.user_name, beu.exam_title, beu.exam_type, beu.craft_type, beu.craft_post, beu.single_num, beu.multiple_num, beu.estimate_num, beu.user_mark, beu.res_status, beu.use_times, beu.is_del, beu.create_by, beu.create_time, beu.update_by, beu.update_time, beu.remark from bus_exam_user beu
|
||||||
left join pro_project_info pi on pi.id = beu.project_id
|
left join pro_project_info pi on pi.id = beu.project_id
|
||||||
left join sys_dept sd on sd.dept_id = pi.com_id
|
left join sys_dept sd on sd.dept_id = pi.com_id
|
||||||
left join sys_user su on su.user_id = beu.user_id
|
left join sys_user su on su.user_id = beu.user_id
|
||||||
|
@ -41,7 +58,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<select id="selectBusExamUserList" parameterType="BusExamUser" resultMap="BusExamUserResult">
|
<select id="selectBusExamUserList" parameterType="BusExamUser" resultMap="BusExamUserResult">
|
||||||
<include refid="selectBusExamUserVo"/>
|
<include refid="selectBusExamUserVo"/>
|
||||||
<where>
|
<where>
|
||||||
beu.is_del = 0
|
and beu.is_del = 0
|
||||||
<if test="comId != null "> and beu.com_id = #{comId}</if>
|
<if test="comId != null "> and beu.com_id = #{comId}</if>
|
||||||
<if test="projectId != null "> and beu.project_id = #{projectId}</if>
|
<if test="projectId != null "> and beu.project_id = #{projectId}</if>
|
||||||
<if test="activeComId != null "> and beu.com_id = #{activeComId}</if>
|
<if test="activeComId != null "> and beu.com_id = #{activeComId}</if>
|
||||||
|
@ -58,15 +75,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
order by beu.id desc
|
order by beu.id desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectBusExamUserById" parameterType="Long" resultMap="BusExamUserResult">
|
<select id="selectBusExamUserById" parameterType="Long" resultMap="BusExamUserBusExamUserResultResult">
|
||||||
<include refid="selectBusExamUserVo"/>
|
select a.id, a.com_id, sd.dept_name as com_name, a.project_id, pi.project_name, a.user_id, su.nick_name as user_nick, su.user_name, a.exam_title, a.exam_type, a.craft_type, a.craft_post, a.single_num, a.multiple_num, a.estimate_num, a.user_mark, a.res_status, a.use_times, a.is_del, a.create_by, a.create_time, a.update_by, a.update_time, a.remark,
|
||||||
where beu.id = #{id}
|
b.id as sub_id, b.exam_user_id as sub_exam_user_id, b.question_id as sub_question_id, b.question_title as sub_question_title, b.question_type as sub_question_type, b.question_option as sub_question_option, b.user_answer as sub_user_answer, b.answer as sub_answer, b.use_res as sub_use_res, b.use_mark as sub_use_mark
|
||||||
|
from bus_exam_user a
|
||||||
|
left join pro_project_info pi on pi.id = a.project_id
|
||||||
|
left join sys_dept sd on sd.dept_id = a.com_id
|
||||||
|
left join sys_user su on su.user_id = a.user_id
|
||||||
|
left join bus_exam_user_result b on b.exam_user_id = a.id
|
||||||
|
where a.id = #{id}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<insert id="insertBusExamUser" parameterType="BusExamUser" useGeneratedKeys="true" keyProperty="id">
|
<insert id="insertBusExamUser" parameterType="BusExamUser" useGeneratedKeys="true" keyProperty="id">
|
||||||
insert into bus_exam_user
|
insert into bus_exam_user
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
<if test="deptId != null">dept_id,</if>
|
<if test="comId != null">com_id,</if>
|
||||||
<if test="projectId != null">project_id,</if>
|
<if test="projectId != null">project_id,</if>
|
||||||
<if test="userId != null">user_id,</if>
|
<if test="userId != null">user_id,</if>
|
||||||
<if test="examTitle != null">exam_title,</if>
|
<if test="examTitle != null">exam_title,</if>
|
||||||
|
@ -87,7 +110,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="remark != null">remark,</if>
|
<if test="remark != null">remark,</if>
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
<if test="deptId != null">#{deptId},</if>
|
<if test="comId != null">#{comId},</if>
|
||||||
<if test="projectId != null">#{projectId},</if>
|
<if test="projectId != null">#{projectId},</if>
|
||||||
<if test="userId != null">#{userId},</if>
|
<if test="userId != null">#{userId},</if>
|
||||||
<if test="examTitle != null">#{examTitle},</if>
|
<if test="examTitle != null">#{examTitle},</if>
|
||||||
|
@ -112,7 +135,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<update id="updateBusExamUser" parameterType="BusExamUser">
|
<update id="updateBusExamUser" parameterType="BusExamUser">
|
||||||
update bus_exam_user
|
update bus_exam_user
|
||||||
<trim prefix="SET" suffixOverrides=",">
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
<if test="deptId != null">dept_id = #{deptId},</if>
|
<if test="comId != null">com_id = #{comId},</if>
|
||||||
<if test="projectId != null">project_id = #{projectId},</if>
|
<if test="projectId != null">project_id = #{projectId},</if>
|
||||||
<if test="userId != null">user_id = #{userId},</if>
|
<if test="userId != null">user_id = #{userId},</if>
|
||||||
<if test="examTitle != null">exam_title = #{examTitle},</if>
|
<if test="examTitle != null">exam_title = #{examTitle},</if>
|
||||||
|
@ -145,4 +168,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
#{id}
|
#{id}
|
||||||
</foreach>
|
</foreach>
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteBusExamUserResultByExamUserIds" parameterType="String">
|
||||||
|
delete from bus_exam_user_result where exam_user_id in
|
||||||
|
<foreach item="examUserId" collection="array" open="(" separator="," close=")">
|
||||||
|
#{examUserId}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteBusExamUserResultByExamUserId" parameterType="Long">
|
||||||
|
delete from bus_exam_user_result where exam_user_id = #{examUserId}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<insert id="batchBusExamUserResult">
|
||||||
|
insert into bus_exam_user_result( id, exam_user_id, question_id, question_title, question_type, question_option, user_answer, answer, use_res, use_mark) values
|
||||||
|
<foreach item="item" index="index" collection="list" separator=",">
|
||||||
|
( #{item.id}, #{item.examUserId}, #{item.questionId}, #{item.questionTitle}, #{item.questionType}, #{item.questionOption}, #{item.userAnswer}, #{item.answer}, #{item.useRes}, #{item.useMark})
|
||||||
|
</foreach>
|
||||||
|
</insert>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
|
@ -63,17 +63,6 @@ public class BusExamUserController extends BaseController
|
||||||
return success(busExamUserService.selectBusExamUserById(id));
|
return success(busExamUserService.selectBusExamUserById(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增用户试卷
|
|
||||||
*/
|
|
||||||
@RequiresPermissions("manage:busExamUser:add")
|
|
||||||
@Log(title = "用户试卷", businessType = BusinessType.INSERT)
|
|
||||||
@PostMapping
|
|
||||||
public AjaxResult add(@RequestBody BusExamUser busExamUser)
|
|
||||||
{
|
|
||||||
return success(busExamUserService.insertBusExamUser(busExamUser));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改用户试卷
|
* 修改用户试卷
|
||||||
*/
|
*/
|
||||||
|
@ -102,8 +91,8 @@ public class BusExamUserController extends BaseController
|
||||||
*/
|
*/
|
||||||
@Log(title = "新增试卷考题", businessType = BusinessType.INSERT)
|
@Log(title = "新增试卷考题", businessType = BusinessType.INSERT)
|
||||||
@PostMapping("/push")
|
@PostMapping("/push")
|
||||||
public AjaxResult pushBusExamUser(@RequestBody BusExamUser busExamUser)
|
public AjaxResult pushBusExamUser()
|
||||||
{
|
{
|
||||||
return success(busExamUserService.insertBusExamUser(busExamUser));
|
return success(busExamUserService.insertBusExamUser());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,98 +0,0 @@
|
||||||
package com.yanzhu.manage.controller;
|
|
||||||
|
|
||||||
import com.yanzhu.common.core.utils.poi.ExcelUtil;
|
|
||||||
import com.yanzhu.common.core.web.controller.BaseController;
|
|
||||||
import com.yanzhu.common.core.web.domain.AjaxResult;
|
|
||||||
import com.yanzhu.common.core.web.page.TableDataInfo;
|
|
||||||
import com.yanzhu.common.log.annotation.Log;
|
|
||||||
import com.yanzhu.common.log.enums.BusinessType;
|
|
||||||
import com.yanzhu.common.security.annotation.RequiresPermissions;
|
|
||||||
import com.yanzhu.manage.domain.BusExamUserResult;
|
|
||||||
import com.yanzhu.manage.service.IBusExamUserResultService;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 用户试卷结果Controller
|
|
||||||
*
|
|
||||||
* @author JiangYuQi
|
|
||||||
* @date 2024-08-25
|
|
||||||
*/
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/busExamUserResult")
|
|
||||||
public class BusExamUserResultController extends BaseController
|
|
||||||
{
|
|
||||||
@Autowired
|
|
||||||
private IBusExamUserResultService busExamUserResultService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询用户试卷结果列表
|
|
||||||
*/
|
|
||||||
@RequiresPermissions("manage:busExamUserResult:list")
|
|
||||||
@GetMapping("/list")
|
|
||||||
public TableDataInfo list(BusExamUserResult busExamUserResult)
|
|
||||||
{
|
|
||||||
startPage();
|
|
||||||
List<BusExamUserResult> list = busExamUserResultService.selectBusExamUserResultList(busExamUserResult);
|
|
||||||
return getDataTable(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 导出用户试卷结果列表
|
|
||||||
*/
|
|
||||||
@RequiresPermissions("manage:busExamUserResult:export")
|
|
||||||
@Log(title = "用户试卷结果", businessType = BusinessType.EXPORT)
|
|
||||||
@PostMapping("/export")
|
|
||||||
public void export(HttpServletResponse response, BusExamUserResult busExamUserResult)
|
|
||||||
{
|
|
||||||
List<BusExamUserResult> list = busExamUserResultService.selectBusExamUserResultList(busExamUserResult);
|
|
||||||
ExcelUtil<BusExamUserResult> util = new ExcelUtil<BusExamUserResult>(BusExamUserResult.class);
|
|
||||||
util.exportExcel(response, list, "用户试卷结果数据");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取用户试卷结果详细信息
|
|
||||||
*/
|
|
||||||
@RequiresPermissions("manage:busExamUserResult:query")
|
|
||||||
@GetMapping(value = "/{examUserId}")
|
|
||||||
public AjaxResult getInfo(@PathVariable("examUserId") Long examUserId)
|
|
||||||
{
|
|
||||||
return success(busExamUserResultService.selectBusExamUserResultByExamUserId(examUserId));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增用户试卷结果
|
|
||||||
*/
|
|
||||||
@RequiresPermissions("manage:busExamUserResult:add")
|
|
||||||
@Log(title = "用户试卷结果", businessType = BusinessType.INSERT)
|
|
||||||
@PostMapping
|
|
||||||
public AjaxResult add(@RequestBody BusExamUserResult busExamUserResult)
|
|
||||||
{
|
|
||||||
return toAjax(busExamUserResultService.insertBusExamUserResult(busExamUserResult));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改用户试卷结果
|
|
||||||
*/
|
|
||||||
@RequiresPermissions("manage:busExamUserResult:edit")
|
|
||||||
@Log(title = "用户试卷结果", businessType = BusinessType.UPDATE)
|
|
||||||
@PutMapping
|
|
||||||
public AjaxResult edit(@RequestBody BusExamUserResult busExamUserResult)
|
|
||||||
{
|
|
||||||
return toAjax(busExamUserResultService.updateBusExamUserResult(busExamUserResult));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除用户试卷结果
|
|
||||||
*/
|
|
||||||
@RequiresPermissions("manage:busExamUserResult:remove")
|
|
||||||
@Log(title = "用户试卷结果", businessType = BusinessType.DELETE)
|
|
||||||
@DeleteMapping("/{examUserIds}")
|
|
||||||
public AjaxResult remove(@PathVariable Long[] examUserIds)
|
|
||||||
{
|
|
||||||
return toAjax(busExamUserResultService.deleteBusExamUserResultByExamUserIds(examUserIds));
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -30,10 +30,9 @@ public interface IBusExamUserService
|
||||||
/**
|
/**
|
||||||
* 新增用户试卷
|
* 新增用户试卷
|
||||||
*
|
*
|
||||||
* @param busExamUser 用户试卷
|
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public BusExamUser insertBusExamUser(BusExamUser busExamUser);
|
public BusExamUser insertBusExamUser();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改用户试卷
|
* 修改用户试卷
|
||||||
|
|
|
@ -1,14 +1,24 @@
|
||||||
package com.yanzhu.manage.service.impl;
|
package com.yanzhu.manage.service.impl;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson2.JSON;
|
||||||
|
import com.yanzhu.common.core.enums.CraftType;
|
||||||
|
import com.yanzhu.common.core.enums.IsDelEnums;
|
||||||
|
import com.yanzhu.common.core.enums.UseStateEnums;
|
||||||
|
import com.yanzhu.common.core.exception.ServiceException;
|
||||||
|
import com.yanzhu.common.core.text.Convert;
|
||||||
import com.yanzhu.common.core.utils.DateUtils;
|
import com.yanzhu.common.core.utils.DateUtils;
|
||||||
|
import com.yanzhu.common.core.utils.StringUtils;
|
||||||
import com.yanzhu.common.security.utils.SecurityUtils;
|
import com.yanzhu.common.security.utils.SecurityUtils;
|
||||||
|
import com.yanzhu.manage.domain.*;
|
||||||
|
import com.yanzhu.manage.mapper.*;
|
||||||
import com.yanzhu.system.api.domain.SysUser;
|
import com.yanzhu.system.api.domain.SysUser;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.yanzhu.manage.mapper.BusExamUserMapper;
|
|
||||||
import com.yanzhu.manage.domain.BusExamUser;
|
|
||||||
import com.yanzhu.manage.service.IBusExamUserService;
|
import com.yanzhu.manage.service.IBusExamUserService;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户试卷Service业务层处理
|
* 用户试卷Service业务层处理
|
||||||
|
@ -19,9 +29,18 @@ import com.yanzhu.manage.service.IBusExamUserService;
|
||||||
@Service
|
@Service
|
||||||
public class BusExamUserServiceImpl implements IBusExamUserService
|
public class BusExamUserServiceImpl implements IBusExamUserService
|
||||||
{
|
{
|
||||||
|
@Autowired
|
||||||
|
private BusExamInfoMapper busExamInfoMapper;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private BusExamUserMapper busExamUserMapper;
|
private BusExamUserMapper busExamUserMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private BusExamQuestionMapper busExamQuestionMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ProProjectInfoSubdeptsUsersMapper proProjectInfoSubdeptsUsersMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询用户试卷
|
* 查询用户试卷
|
||||||
*
|
*
|
||||||
|
@ -43,22 +62,176 @@ public class BusExamUserServiceImpl implements IBusExamUserService
|
||||||
@Override
|
@Override
|
||||||
public List<BusExamUser> selectBusExamUserList(BusExamUser busExamUser)
|
public List<BusExamUser> selectBusExamUserList(BusExamUser busExamUser)
|
||||||
{
|
{
|
||||||
|
busExamUser.setActiveComId(SecurityUtils.getLoginUser().getProjectDeptId());
|
||||||
|
busExamUser.setActiveProjectId(SecurityUtils.getLoginUser().getProjectId());
|
||||||
return busExamUserMapper.selectBusExamUserList(busExamUser);
|
return busExamUserMapper.selectBusExamUserList(busExamUser);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增用户试卷
|
* 新增用户试卷
|
||||||
*
|
*
|
||||||
* @param busExamUser 用户试卷
|
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public BusExamUser insertBusExamUser(BusExamUser busExamUser)
|
@Transactional
|
||||||
|
public BusExamUser insertBusExamUser()
|
||||||
{
|
{
|
||||||
|
BusExamUser busExamUser = new BusExamUser();
|
||||||
SysUser cache = SecurityUtils.getLoginUser().getSysUser();
|
SysUser cache = SecurityUtils.getLoginUser().getSysUser();
|
||||||
|
// 查询用户详细
|
||||||
busExamUser.setCreateTime(DateUtils.getNowDate());
|
ProProjectInfoSubdeptsUsers userQuery = new ProProjectInfoSubdeptsUsers();
|
||||||
return busExamUserMapper.insertBusExamUser(busExamUser);
|
userQuery.setUserId(cache.getUserId());
|
||||||
|
userQuery.setComId(cache.getActiveComId());
|
||||||
|
userQuery.setProjectId(cache.getActiveProjectId());
|
||||||
|
userQuery.setUseStatus(UseStateEnums.IN.getCode());
|
||||||
|
userQuery.setIsDel(IsDelEnums.NO.getCode());
|
||||||
|
List<ProProjectInfoSubdeptsUsers> userList = proProjectInfoSubdeptsUsersMapper.selectProProjectInfoSubdeptsUsersList(userQuery);
|
||||||
|
|
||||||
|
if(StringUtils.isEmpty(userList)){
|
||||||
|
throw new ServiceException("用户信息异常...不能抽取试题...");
|
||||||
|
}
|
||||||
|
ProProjectInfoSubdeptsUsers userEntity = userList.get(0);
|
||||||
|
|
||||||
|
// 查询试卷列表
|
||||||
|
BusExamInfo query = new BusExamInfo();
|
||||||
|
query.setComId(cache.getActiveComId());
|
||||||
|
query.setProjectId(cache.getActiveProjectId());
|
||||||
|
query.setCraftType(userEntity.getCraftType());
|
||||||
|
// 管理人员获取所有管理类试卷
|
||||||
|
if(!Objects.equals(CraftType.GLRY.getCode(),query.getCraftType())){
|
||||||
|
query.setCraftPost(userEntity.getCraftPost());
|
||||||
|
}
|
||||||
|
query.setIsDel(IsDelEnums.NO.getCode());
|
||||||
|
List<BusExamInfo> examInfoList = busExamInfoMapper.selectBusExamInfoList(query);
|
||||||
|
if(StringUtils.isNotEmpty(examInfoList)){
|
||||||
|
// 优先从项目试卷中获取试卷、未找到项目试卷则从所有试卷中筛选
|
||||||
|
List<BusExamInfo> _projectExamInfolist = examInfoList.stream().filter(examInfo -> examInfo.getProjectId() != null)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
Random random = new Random();
|
||||||
|
BusExamInfo findExamInfo;
|
||||||
|
if(StringUtils.isNotEmpty(_projectExamInfolist)){
|
||||||
|
int randomIntBound = random.nextInt(_projectExamInfolist.size());
|
||||||
|
findExamInfo = _projectExamInfolist.get(randomIntBound);
|
||||||
|
}else{
|
||||||
|
int randomIntBound = random.nextInt(examInfoList.size());
|
||||||
|
findExamInfo = examInfoList.get(randomIntBound);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取试卷试题
|
||||||
|
List<BusExamQuestion> questions = extractExamQuestion(findExamInfo,userEntity.getCraftPost());
|
||||||
|
// 试题重新排序
|
||||||
|
Collections.shuffle(questions);
|
||||||
|
|
||||||
|
busExamUser.setComId(userEntity.getComId());
|
||||||
|
busExamUser.setProjectId(userEntity.getProjectId());
|
||||||
|
busExamUser.setUserId(cache.getUserId());
|
||||||
|
busExamUser.setExamTitle(findExamInfo.getExamTitle());
|
||||||
|
busExamUser.setExamType(findExamInfo.getExamType());
|
||||||
|
busExamUser.setCraftType(userEntity.getCraftType());
|
||||||
|
busExamUser.setCraftPost(userEntity.getCraftPost());
|
||||||
|
busExamUser.setSingleNum(findExamInfo.getSingleNum());
|
||||||
|
busExamUser.setMultipleNum(findExamInfo.getMultipleNum());
|
||||||
|
busExamUser.setEstimateNum(findExamInfo.getEstimateNum());
|
||||||
|
busExamUser.setCreateBy(cache.getUserName());
|
||||||
|
busExamUser.setCreateTime(DateUtils.getNowDate());
|
||||||
|
busExamUserMapper.insertBusExamUser(busExamUser);
|
||||||
|
|
||||||
|
List<BusExamUserResult> busExamUserResultList = new ArrayList<>();
|
||||||
|
for(BusExamQuestion examQuestion:questions){
|
||||||
|
BusExamQuestion question = busExamQuestionMapper.selectBusExamQuestionById(examQuestion.getId());
|
||||||
|
BusExamUserResult entity = new BusExamUserResult();
|
||||||
|
entity.setExamUserId(busExamUser.getId());
|
||||||
|
entity.setQuestionId(examQuestion.getId());
|
||||||
|
entity.setQuestionTitle(examQuestion.getQuestionDesc());
|
||||||
|
entity.setQuestionType(examQuestion.getQuestionType());
|
||||||
|
entity.setQuestionOption(JSON.toJSONString(question.getBusExamQuestionResultList()));
|
||||||
|
entity.setAnswer(question.getQuestionAnswer());
|
||||||
|
busExamUserResultList.add(entity);
|
||||||
|
}
|
||||||
|
busExamUser.setBusExamUserResultList(busExamUserResultList);
|
||||||
|
busExamUserMapper.batchBusExamUserResult(busExamUserResultList);
|
||||||
|
|
||||||
|
// 修改试卷使用次数
|
||||||
|
busExamInfoMapper.updateExamUseNumber(findExamInfo.getId());
|
||||||
|
}else{
|
||||||
|
throw new ServiceException("当前项目未配置试卷信息,请联系管理员配置...");
|
||||||
|
}
|
||||||
|
return busExamUser;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据试卷抽取考题
|
||||||
|
* @param findExamInfo 试卷
|
||||||
|
* @param craftPost 试题范围
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private List<BusExamQuestion> extractExamQuestion(BusExamInfo findExamInfo,String craftPost){
|
||||||
|
BusExamQuestion questionQuery = new BusExamQuestion();
|
||||||
|
questionQuery.setActiveComId(findExamInfo.getComId());
|
||||||
|
questionQuery.setActiveProjectId(findExamInfo.getProjectId());
|
||||||
|
questionQuery.setCraftPost(craftPost);
|
||||||
|
questionQuery.setIsDel(IsDelEnums.NO.getCode());
|
||||||
|
List<BusExamQuestion> list = new ArrayList<>();
|
||||||
|
List<BusExamQuestion> allQuestionList = busExamQuestionMapper.selectBusExamQuestionList(questionQuery);
|
||||||
|
if(StringUtils.isNotEmpty(allQuestionList)){
|
||||||
|
/**
|
||||||
|
* 根据试卷配置进行抽题
|
||||||
|
* oxtQuestionList 单选题列表
|
||||||
|
* dxtQuestionList 多选题列表
|
||||||
|
* pdtQuestionList 判断题列表
|
||||||
|
*/
|
||||||
|
List<BusExamQuestion> oxtQuestionList = allQuestionList.stream().filter(question -> question.getQuestionType() == 1L).collect(Collectors.toList());
|
||||||
|
List<BusExamQuestion> dxtQuestionList = allQuestionList.stream().filter(question -> question.getQuestionType() == 2L).collect(Collectors.toList());
|
||||||
|
List<BusExamQuestion> pdtQuestionList = allQuestionList.stream().filter(question -> question.getQuestionType() == 3L).collect(Collectors.toList());
|
||||||
|
int singleNum = Convert.toInt(findExamInfo.getSingleNum(),0);
|
||||||
|
if(singleNum>0){
|
||||||
|
if(Objects.nonNull(oxtQuestionList) && oxtQuestionList.size()>singleNum){
|
||||||
|
list.addAll(getRandomQuestions(oxtQuestionList,singleNum));
|
||||||
|
}else{
|
||||||
|
if(Objects.nonNull(oxtQuestionList)){
|
||||||
|
list.addAll(oxtQuestionList);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
int multipleNum = Convert.toInt(findExamInfo.getMultipleNum(),0);
|
||||||
|
if(multipleNum>0){
|
||||||
|
if(Objects.nonNull(dxtQuestionList) && dxtQuestionList.size()>multipleNum){
|
||||||
|
list.addAll(getRandomQuestions(dxtQuestionList,multipleNum));
|
||||||
|
}else{
|
||||||
|
if(Objects.nonNull(dxtQuestionList)){
|
||||||
|
list.addAll(dxtQuestionList);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
int estimateNum = Convert.toInt(findExamInfo.getEstimateNum(),0);
|
||||||
|
if(singleNum>0){
|
||||||
|
if(Objects.nonNull(pdtQuestionList) && pdtQuestionList.size()>estimateNum){
|
||||||
|
list.addAll(getRandomQuestions(pdtQuestionList,estimateNum));
|
||||||
|
}else{
|
||||||
|
if(Objects.nonNull(pdtQuestionList)){
|
||||||
|
list.addAll(pdtQuestionList);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
throw new ServiceException("请联系管理员配置试题...");
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 随机试题
|
||||||
|
* @param questionList
|
||||||
|
* @param numberOfQuestions
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private static List<BusExamQuestion> getRandomQuestions(List<BusExamQuestion> questionList, int numberOfQuestions) {
|
||||||
|
// 打乱列表
|
||||||
|
Collections.shuffle(questionList);
|
||||||
|
// 获取前 numberOfQuestions 个元素
|
||||||
|
return questionList.stream()
|
||||||
|
.limit(numberOfQuestions)
|
||||||
|
.collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -97,4 +270,28 @@ public class BusExamUserServiceImpl implements IBusExamUserService
|
||||||
{
|
{
|
||||||
return busExamUserMapper.deleteBusExamUserById(id);
|
return busExamUserMapper.deleteBusExamUserById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增用户试卷结果信息
|
||||||
|
*
|
||||||
|
* @param busExamUser 用户试卷对象
|
||||||
|
*/
|
||||||
|
public void insertBusExamUserResult(BusExamUser busExamUser)
|
||||||
|
{
|
||||||
|
List<BusExamUserResult> busExamUserResultList = busExamUser.getBusExamUserResultList();
|
||||||
|
Long id = busExamUser.getId();
|
||||||
|
if (StringUtils.isNotNull(busExamUserResultList))
|
||||||
|
{
|
||||||
|
List<BusExamUserResult> list = new ArrayList<BusExamUserResult>();
|
||||||
|
for (BusExamUserResult busExamUserResult : busExamUserResultList)
|
||||||
|
{
|
||||||
|
busExamUserResult.setExamUserId(id);
|
||||||
|
list.add(busExamUserResult);
|
||||||
|
}
|
||||||
|
if (list.size() > 0)
|
||||||
|
{
|
||||||
|
busExamUserMapper.batchBusExamUserResult(list);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -102,12 +102,12 @@
|
||||||
<dict-tag :options="pro_craft_post" :value="scope.row.craftPost"/>
|
<dict-tag :options="pro_craft_post" :value="scope.row.craftPost"/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="单选题数量" align="center" prop="singleNum" width="88"/>
|
<el-table-column label="单选题数量" align="center" prop="singleNum" width="68"/>
|
||||||
<el-table-column label="单选题分数" align="center" prop="fullMark" width="88"/>
|
<el-table-column label="单选题分数" align="center" prop="singleMark" width="68"/>
|
||||||
<el-table-column label="多选题数量" align="center" prop="multipleNum" width="88"/>
|
<el-table-column label="多选题数量" align="center" prop="multipleNum" width="68"/>
|
||||||
<el-table-column label="多选题分数" align="center" prop="fullMark" width="88"/>
|
<el-table-column label="多选题分数" align="center" prop="multipleMark" width="68"/>
|
||||||
<el-table-column label="判断题数量" align="center" prop="estimateNum" width="88"/>
|
<el-table-column label="判断题数量" align="center" prop="estimateNum" width="68"/>
|
||||||
<el-table-column label="判断题分数" align="center" prop="fullMark" width="88"/>
|
<el-table-column label="判断题分数" align="center" prop="estimateMark" width="68"/>
|
||||||
<el-table-column label="通过分数" align="center" prop="passMark" width="100">
|
<el-table-column label="通过分数" align="center" prop="passMark" width="100">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-tag type="success" effect="dark">{{ scope.row.passMark }}</el-tag>
|
<el-tag type="success" effect="dark">{{ scope.row.passMark }}</el-tag>
|
||||||
|
@ -130,7 +130,6 @@
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['manage:busExamInfo:edit']">修改</el-button>
|
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['manage:busExamInfo:edit']">修改</el-button>
|
||||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['manage:busExamInfo:remove']">删除</el-button>
|
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['manage:busExamInfo:remove']">删除</el-button>
|
||||||
<el-button type="danger" link disabled>-</el-button>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
@ -145,7 +144,7 @@
|
||||||
|
|
||||||
<!-- 添加或修改基础试卷对话框 -->
|
<!-- 添加或修改基础试卷对话框 -->
|
||||||
<el-dialog :title="title" v-model="open" width="680px" append-to-body>
|
<el-dialog :title="title" v-model="open" width="680px" append-to-body>
|
||||||
<el-form ref="busExamInfoRef" :model="form" :rules="rules" label-width="88px">
|
<el-form ref="busExamInfoRef" :model="form" :rules="rules" label-width="100px">
|
||||||
<el-form-item label="项目名称" v-if="form.projectId">
|
<el-form-item label="项目名称" v-if="form.projectId">
|
||||||
<el-tag effect="plain">{{ form.projectName }}</el-tag>
|
<el-tag effect="plain">{{ form.projectName }}</el-tag>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
@ -210,8 +209,8 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-form-item label="及格分数" prop="passMark">
|
<el-form-item label="及格分数线" prop="passMark">
|
||||||
<el-input v-model.number="form.passMark" placeholder="请输入及格分数" />
|
<el-input v-model.number="form.passMark" placeholder="请输入及格分数线" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
|
@ -319,8 +318,11 @@ function reset() {
|
||||||
craftType: null,
|
craftType: null,
|
||||||
craftPost: null,
|
craftPost: null,
|
||||||
singleNum: null,
|
singleNum: null,
|
||||||
|
singleMark: null,
|
||||||
multipleNum: null,
|
multipleNum: null,
|
||||||
|
multipleMark: null,
|
||||||
estimateNum: null,
|
estimateNum: null,
|
||||||
|
estimateMark: null,
|
||||||
fullMark: null,
|
fullMark: null,
|
||||||
passMark: null,
|
passMark: null,
|
||||||
useNumber: null,
|
useNumber: null,
|
||||||
|
|
|
@ -9,15 +9,15 @@
|
||||||
@keyup.enter="handleQuery"
|
@keyup.enter="handleQuery"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="问题描述" prop="questionDesc">
|
<el-form-item label="试题描述" prop="questionDesc">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="queryParams.questionDesc"
|
v-model="queryParams.questionDesc"
|
||||||
placeholder="请输入问题描述"
|
placeholder="请输入试题描述"
|
||||||
clearable
|
clearable
|
||||||
@keyup.enter="handleQuery"
|
@keyup.enter="handleQuery"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="工种类型" prop="craftType">
|
<el-form-item label="工种类型" prop="craftType" v-if="false">
|
||||||
<el-select v-model="queryParams.craftType" placeholder="请选择工种类型" clearable>
|
<el-select v-model="queryParams.craftType" placeholder="请选择工种类型" clearable>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in pro_craft_type"
|
v-for="dict in pro_craft_type"
|
||||||
|
@ -27,19 +27,23 @@
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="工种岗位" prop="craftPost" v-if="queryParams.craftType">
|
<el-form-item label="工种岗位" prop="craftPost">
|
||||||
<el-select v-model="queryParams.craftPost" placeholder="请选择工种岗位" clearable>
|
<el-select v-model="queryParams.craftPost" placeholder="请选择工种岗位" filterable clearable>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in pro_craft_post"
|
v-for="dict in pro_craft_post"
|
||||||
v-show="dict.elTagClass == queryParams.craftType"
|
|
||||||
:key="dict.value"
|
:key="dict.value"
|
||||||
:label="dict.label"
|
:label="dict.label"
|
||||||
:value="dict.value"
|
:value="dict.value"
|
||||||
/>
|
>
|
||||||
|
<span style="float: left">{{ dict.label }}</span>
|
||||||
|
<span style="float: right;color: var(--el-text-color-secondary);font-size: 13px;">
|
||||||
|
{{ findCraftPost(dict.elTagClass) }}
|
||||||
|
</span>
|
||||||
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="问题类型" prop="questionType">
|
<el-form-item label="试题类型" prop="questionType">
|
||||||
<el-select v-model="queryParams.questionType" placeholder="请选择问题类型" clearable>
|
<el-select v-model="queryParams.questionType" placeholder="请选择试题类型" clearable>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in edu_question_type"
|
v-for="dict in edu_question_type"
|
||||||
:key="dict.value"
|
:key="dict.value"
|
||||||
|
@ -48,8 +52,8 @@
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="问题范围" prop="questionScope">
|
<el-form-item label="试题范围" prop="questionScope" v-if="false">
|
||||||
<el-select v-model="queryParams.questionScope" placeholder="请选择问题范围" clearable>
|
<el-select v-model="queryParams.questionScope" placeholder="请选择试题范围" clearable>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in edu_question_scope"
|
v-for="dict in edu_question_scope"
|
||||||
:key="dict.value"
|
:key="dict.value"
|
||||||
|
@ -71,7 +75,7 @@
|
||||||
icon="Plus"
|
icon="Plus"
|
||||||
@click="handleAdd"
|
@click="handleAdd"
|
||||||
v-hasPermi="['manage:busExamQuestion:add']"
|
v-hasPermi="['manage:busExamQuestion:add']"
|
||||||
>新增通用问题</el-button>
|
>新增通用试题</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col v-if="FirRoles=='admin' || FirRoles=='gsAdmin'" :span="1.5">
|
<el-col v-if="FirRoles=='admin' || FirRoles=='gsAdmin'" :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
|
@ -80,7 +84,7 @@
|
||||||
icon="Plus"
|
icon="Plus"
|
||||||
@click="handleAddCom"
|
@click="handleAddCom"
|
||||||
v-hasPermi="['manage:busExamQuestion:add']"
|
v-hasPermi="['manage:busExamQuestion:add']"
|
||||||
>新增公司问题</el-button>
|
>新增公司试题</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
|
@ -89,7 +93,7 @@
|
||||||
icon="Plus"
|
icon="Plus"
|
||||||
@click="handleAddProject"
|
@click="handleAddProject"
|
||||||
v-hasPermi="['manage:busExamQuestion:add']"
|
v-hasPermi="['manage:busExamQuestion:add']"
|
||||||
>新增项目问题</el-button>
|
>新增项目试题</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
|
@ -125,26 +129,26 @@
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="busExamQuestionList" @selection-change="handleSelectionChange">
|
<el-table v-loading="loading" :data="busExamQuestionList" @selection-change="handleSelectionChange">
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
<el-table-column label="问题编号" align="center" prop="id" width="80"/>
|
<el-table-column label="试题编号" align="center" prop="id" width="80"/>
|
||||||
<el-table-column label="所属公司" align="center" prop="comName" >
|
<el-table-column label="所属公司" align="center" prop="comName" width="120" :show-overflow-tooltip="true">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<span v-if="scope.row.comId">{{scope.row.comName}}</span>
|
<span v-if="scope.row.comId">{{scope.row.comName}}</span>
|
||||||
<span v-else>-</span>
|
<span v-else>-</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="项目名称" align="center" prop="projectName" >
|
<el-table-column label="项目名称" align="center" prop="projectName" width="120" :show-overflow-tooltip="true">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<span v-if="scope.row.projectId">{{scope.row.projectName}}</span>
|
<span v-if="scope.row.projectId">{{scope.row.projectName}}</span>
|
||||||
<span v-else>-</span>
|
<span v-else>-</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="问题描述" align="center" prop="questionDesc" width="200"/>
|
<el-table-column label="试题描述" align="center" prop="questionDesc"/>
|
||||||
<el-table-column label="工种类型" align="center" prop="craftType" width="100">
|
<el-table-column label="工种类型" align="center" prop="craftType" width="100" v-if="false">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<dict-tag :options="pro_craft_type" :value="scope.row.craftType"/>
|
<dict-tag :options="pro_craft_type" :value="scope.row.craftType"/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="工种岗位" align="center" prop="craftPost" width="250">
|
<el-table-column label="工种岗位" align="center" prop="craftPost" width="450">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<div class="flex gap-2">
|
<div class="flex gap-2">
|
||||||
<el-tag
|
<el-tag
|
||||||
|
@ -157,17 +161,17 @@
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="问题类型" align="center" prop="questionType" width="80">
|
<el-table-column label="试题类型" align="center" prop="questionType" width="80">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<dict-tag :options="edu_question_type" :value="scope.row.questionType"/>
|
<dict-tag :options="edu_question_type" :value="scope.row.questionType"/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="问题范围" align="center" prop="questionScope" width="100">
|
<el-table-column label="试题范围" align="center" prop="questionScope" width="100" v-if="false">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<dict-tag :options="edu_question_scope" :value="scope.row.questionScope"/>
|
<dict-tag :options="edu_question_scope" :value="scope.row.questionScope"/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="问题答案" align="center" prop="questionAnswer" />
|
<el-table-column label="试题答案" align="center" prop="questionAnswer" width="100"/>
|
||||||
<el-table-column label="是否启用" align="center" prop="isDel" width="88">
|
<el-table-column label="是否启用" align="center" prop="isDel" width="88">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-tooltip :content="scope.row.isDel == 0 ? '启用' : '停用'" placement="top">
|
<el-tooltip :content="scope.row.isDel == 0 ? '启用' : '停用'" placement="top">
|
||||||
|
@ -212,7 +216,7 @@
|
||||||
<el-form-item label="项目名称" v-if="form.projectId">
|
<el-form-item label="项目名称" v-if="form.projectId">
|
||||||
<el-tag effect="plain">{{ form.projectName }}</el-tag>
|
<el-tag effect="plain">{{ form.projectName }}</el-tag>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="工种类型" prop="craftType">
|
<el-form-item label="工种类型" prop="craftType" v-if="false">
|
||||||
<el-select v-model="form.craftType" placeholder="请选择工种类型" style="width:100%" @change="changeCraftType">
|
<el-select v-model="form.craftType" placeholder="请选择工种类型" style="width:100%" @change="changeCraftType">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in pro_craft_type"
|
v-for="dict in pro_craft_type"
|
||||||
|
@ -222,19 +226,17 @@
|
||||||
></el-option>
|
></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="工种岗位" prop="craftPost" v-if="form.craftType">
|
<el-form-item label="工种岗位" prop="craftPost">
|
||||||
<el-select v-model="form.craftPost" multiple placeholder="请选择工种岗位" style="width:100%">
|
<el-cascader
|
||||||
<el-option
|
v-model="form.craftPost"
|
||||||
v-for="dict in pro_craft_post"
|
:options="craftPostOptions"
|
||||||
v-show="dict.elTagClass == form.craftType"
|
:props="casProps"
|
||||||
:key="dict.value"
|
style="width: 100%"
|
||||||
:label="dict.label"
|
placeholder="请选择工种岗位"
|
||||||
:value="dict.value"
|
/>
|
||||||
></el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="问题类型" prop="questionType">
|
<el-form-item label="试题类型" prop="questionType">
|
||||||
<el-select v-model="form.questionType" placeholder="请选择问题类型" style="width:100%">
|
<el-select v-model="form.questionType" placeholder="请选择试题类型" style="width:100%">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in edu_question_type"
|
v-for="dict in edu_question_type"
|
||||||
:key="dict.value"
|
:key="dict.value"
|
||||||
|
@ -243,15 +245,15 @@
|
||||||
></el-option>
|
></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="问题范围" prop="questionScope">
|
<el-form-item label="试题范围" prop="questionScope" v-if="false">
|
||||||
<el-radio-group v-model="form.questionScope">
|
<el-radio-group v-model="form.questionScope">
|
||||||
<el-radio v-for="dict in edu_question_scope" :label="dict.value" border>{{dict.label}}</el-radio>
|
<el-radio v-for="dict in edu_question_scope" :label="dict.value" border>{{dict.label}}</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="问题描述" prop="questionDesc">
|
<el-form-item label="试题描述" prop="questionDesc">
|
||||||
<el-input v-model="form.questionDesc" placeholder="请输入问题描述" type="textarea" rows="2" maxlength="64" show-word-limit/>
|
<el-input v-model="form.questionDesc" placeholder="请输入试题描述" type="textarea" rows="2" maxlength="64" show-word-limit/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-divider content-position="center">问题答案信息</el-divider>
|
<el-divider content-position="center">试题答案信息</el-divider>
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button type="primary" icon="Plus" @click="handleAddBusExamQuestionResult">添加</el-button>
|
<el-button type="primary" icon="Plus" @click="handleAddBusExamQuestionResult">添加</el-button>
|
||||||
|
@ -316,6 +318,7 @@ const multiple = ref(true);
|
||||||
const total = ref(0);
|
const total = ref(0);
|
||||||
const title = ref("");
|
const title = ref("");
|
||||||
const FirRoles = ref("");
|
const FirRoles = ref("");
|
||||||
|
const craftPostOptions = ref([]);
|
||||||
|
|
||||||
const data = reactive({
|
const data = reactive({
|
||||||
form: {},
|
form: {},
|
||||||
|
@ -332,14 +335,20 @@ const data = reactive({
|
||||||
rules: {
|
rules: {
|
||||||
craftType: [{ required: true, message: "工种类型不能为空", trigger: "change" }],
|
craftType: [{ required: true, message: "工种类型不能为空", trigger: "change" }],
|
||||||
craftPost: [{ required: true, message: "工种岗位不能为空", trigger: "change" }],
|
craftPost: [{ required: true, message: "工种岗位不能为空", trigger: "change" }],
|
||||||
questionType: [{ required: true, message: "问题类型不能为空", trigger: "change" }],
|
questionType: [{ required: true, message: "试题类型不能为空", trigger: "change" }],
|
||||||
questionScope: [{ required: true, message: "问题范围不能为空", trigger: "change" }],
|
questionScope: [{ required: true, message: "试题范围不能为空", trigger: "change" }],
|
||||||
questionDesc: [{ required: true, message: "问题描述不能为空", trigger: "blur" }]
|
questionDesc: [{ required: true, message: "试题描述不能为空", trigger: "blur" }]
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const { queryParams, form, rules } = toRefs(data);
|
const { queryParams, form, rules } = toRefs(data);
|
||||||
|
|
||||||
|
const casProps = {
|
||||||
|
value: "value",
|
||||||
|
label: "label",
|
||||||
|
multiple: true,
|
||||||
|
};
|
||||||
|
|
||||||
/** 查询基础题库列表 */
|
/** 查询基础题库列表 */
|
||||||
function getList() {
|
function getList() {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
|
@ -408,8 +417,9 @@ function handleSelectionChange(selection) {
|
||||||
/** 新增按钮操作 */
|
/** 新增按钮操作 */
|
||||||
function handleAdd() {
|
function handleAdd() {
|
||||||
reset();
|
reset();
|
||||||
|
initPost();
|
||||||
open.value = true;
|
open.value = true;
|
||||||
title.value = "添加问题及答案";
|
title.value = "添加试题及答案";
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 新增按钮操作 */
|
/** 新增按钮操作 */
|
||||||
|
@ -419,10 +429,11 @@ function handleAddCom() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
reset();
|
reset();
|
||||||
|
initPost();
|
||||||
form.value.comId = userStore.currentComId;
|
form.value.comId = userStore.currentComId;
|
||||||
form.value.comName = userStore.currentComName;
|
form.value.comName = userStore.currentComName;
|
||||||
open.value = true;
|
open.value = true;
|
||||||
title.value = "添加问题及答案";
|
title.value = "添加试题及答案";
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 新增按钮操作 */
|
/** 新增按钮操作 */
|
||||||
|
@ -432,24 +443,26 @@ function handleAddProject() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
reset();
|
reset();
|
||||||
|
initPost();
|
||||||
form.value.comId = userStore.currentComId;
|
form.value.comId = userStore.currentComId;
|
||||||
form.value.comName = userStore.currentComName;
|
form.value.comName = userStore.currentComName;
|
||||||
form.value.projectId = userStore.currentProId;
|
form.value.projectId = userStore.currentProId;
|
||||||
form.value.projectName = userStore.currentProName;
|
form.value.projectName = userStore.currentProName;
|
||||||
open.value = true;
|
open.value = true;
|
||||||
title.value = "添加问题及答案";
|
title.value = "添加试题及答案";
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
function handleUpdate(row) {
|
function handleUpdate(row) {
|
||||||
reset();
|
reset();
|
||||||
|
initPost();
|
||||||
const _id = row.id || ids.value
|
const _id = row.id || ids.value
|
||||||
getBusExamQuestion(_id).then(response => {
|
getBusExamQuestion(_id).then(response => {
|
||||||
response.data.craftPost = response.data.craftPost.split(',');
|
response.data.craftPost = JSON.parse(response.data.remark);
|
||||||
form.value = response.data;
|
form.value = response.data;
|
||||||
busExamQuestionResultList.value = response.data.busExamQuestionResultList;
|
busExamQuestionResultList.value = response.data.busExamQuestionResultList;
|
||||||
open.value = true;
|
open.value = true;
|
||||||
title.value = "修改问题及答案";
|
title.value = "修改试题及答案";
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -458,18 +471,18 @@ function submitForm() {
|
||||||
proxy.$refs["busExamQuestionRef"].validate(valid => {
|
proxy.$refs["busExamQuestionRef"].validate(valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
if (busExamQuestionResultList.value.length == 0) {
|
if (busExamQuestionResultList.value.length == 0) {
|
||||||
proxy.$modal.msgError("请添加问题答案信息");
|
proxy.$modal.msgError("请添加试题答案信息");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
let answer = [];
|
let answer = [];
|
||||||
//筛选正确答案信息
|
//筛选正确答案信息
|
||||||
busExamQuestionResultList.value.forEach((item,idx) => {
|
busExamQuestionResultList.value.forEach((item,idx) => {
|
||||||
if(!item.opt){
|
if(!item.opt){
|
||||||
proxy.$modal.msgError("请输入第"+(idx+1)+"个问题的答案选项");
|
proxy.$modal.msgError("请输入第"+(idx+1)+"个试题的答案选项");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if(!item.result){
|
if(!item.result){
|
||||||
proxy.$modal.msgError("请输入第"+(idx+1)+"个问题的答案描述");
|
proxy.$modal.msgError("请输入第"+(idx+1)+"个试题的答案描述");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (item.isOk != 0) {
|
if (item.isOk != 0) {
|
||||||
|
@ -480,7 +493,17 @@ function submitForm() {
|
||||||
proxy.$modal.msgError("请选择正确答案信息");
|
proxy.$modal.msgError("请选择正确答案信息");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
form.value.craftPost = form.value.craftPost.toString();
|
form.value.remark = JSON.stringify(form.value.craftPost);
|
||||||
|
let craftTypeValues = [];
|
||||||
|
let craftPostValues = [];
|
||||||
|
form.value.craftPost.forEach((item) => {
|
||||||
|
if(craftTypeValues.indexOf(item[0])<0){
|
||||||
|
craftTypeValues.push(item[0])
|
||||||
|
}
|
||||||
|
craftPostValues.push(item[1]);
|
||||||
|
});
|
||||||
|
form.value.craftType = craftTypeValues.toString();
|
||||||
|
form.value.craftPost = craftPostValues.toString();
|
||||||
form.value.questionAnswer = answer.toString();
|
form.value.questionAnswer = answer.toString();
|
||||||
form.value.busExamQuestionResultList = busExamQuestionResultList.value;
|
form.value.busExamQuestionResultList = busExamQuestionResultList.value;
|
||||||
if (form.value.id != null) {
|
if (form.value.id != null) {
|
||||||
|
@ -533,12 +556,12 @@ function handleDelete(row) {
|
||||||
}).catch(() => {});
|
}).catch(() => {});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 题库问题序号 */
|
/** 题库试题序号 */
|
||||||
function rowBusExamQuestionResultIndex({ row, rowIndex }) {
|
function rowBusExamQuestionResultIndex({ row, rowIndex }) {
|
||||||
row.index = rowIndex + 1;
|
row.index = rowIndex + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 题库问题添加按钮操作 */
|
/** 题库试题添加按钮操作 */
|
||||||
function handleAddBusExamQuestionResult() {
|
function handleAddBusExamQuestionResult() {
|
||||||
let obj = {};
|
let obj = {};
|
||||||
obj.opt = "";
|
obj.opt = "";
|
||||||
|
@ -547,10 +570,10 @@ function handleAddBusExamQuestionResult() {
|
||||||
busExamQuestionResultList.value.push(obj);
|
busExamQuestionResultList.value.push(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 题库问题删除按钮操作 */
|
/** 题库试题删除按钮操作 */
|
||||||
function handleDeleteBusExamQuestionResult() {
|
function handleDeleteBusExamQuestionResult() {
|
||||||
if (checkedBusExamQuestionResult.value.length == 0) {
|
if (checkedBusExamQuestionResult.value.length == 0) {
|
||||||
proxy.$modal.msgError("请先选择要删除的题库问题数据");
|
proxy.$modal.msgError("请先选择要删除的题库试题数据");
|
||||||
} else {
|
} else {
|
||||||
const busExamQuestionResults = busExamQuestionResultList.value;
|
const busExamQuestionResults = busExamQuestionResultList.value;
|
||||||
const checkedBusExamQuestionResults = checkedBusExamQuestionResult.value;
|
const checkedBusExamQuestionResults = checkedBusExamQuestionResult.value;
|
||||||
|
@ -603,6 +626,28 @@ function initPage() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function initPost() {
|
||||||
|
// 初始化岗位选择
|
||||||
|
let craftTypeDatas=pro_craft_type._object.pro_craft_type;
|
||||||
|
let craftPostDatas=pro_craft_post._object.pro_craft_post;
|
||||||
|
craftTypeDatas.forEach(item =>{
|
||||||
|
item.children = craftPostDatas.filter(deatil=>deatil.elTagClass==item.value);
|
||||||
|
});
|
||||||
|
console.log("DEFAULT" , craftTypeDatas);
|
||||||
|
craftPostOptions.value = craftTypeDatas;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 搜索岗位类型
|
||||||
|
function findCraftPost(value) {
|
||||||
|
let craftTypeDatas=pro_craft_type._object.pro_craft_type;
|
||||||
|
for(let i=0;i<craftTypeDatas.length;i++){
|
||||||
|
if(craftTypeDatas[i].value == value){
|
||||||
|
return craftTypeDatas[i].label;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return "-";
|
||||||
|
}
|
||||||
|
|
||||||
initPage();
|
initPage();
|
||||||
getList();
|
getList();
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="工种类型" prop="craftType">
|
<el-form-item label="工种类型" prop="craftType">
|
||||||
<el-select v-model="queryParams.craftType" placeholder="请选择工种类型" clearable>
|
<el-select v-model="queryParams.craftType" placeholder="请选择工种类型" @change="changeCraftType" clearable>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in pro_craft_type"
|
v-for="dict in pro_craft_type"
|
||||||
:key="dict.value"
|
:key="dict.value"
|
||||||
|
@ -62,8 +62,8 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row v-if="false" :gutter="10" class="mb8">
|
||||||
<!-- <el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
type="primary"
|
type="primary"
|
||||||
plain
|
plain
|
||||||
|
@ -71,7 +71,7 @@
|
||||||
@click="handleAdd"
|
@click="handleAdd"
|
||||||
v-hasPermi="['manage:busExamUser:add']"
|
v-hasPermi="['manage:busExamUser:add']"
|
||||||
>新增</el-button>
|
>新增</el-button>
|
||||||
</el-col> -->
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
type="success"
|
type="success"
|
||||||
|
@ -109,7 +109,6 @@
|
||||||
<el-table-column label="项目名称" align="center" prop="projectName" />
|
<el-table-column label="项目名称" align="center" prop="projectName" />
|
||||||
<el-table-column label="用户账号" align="center" prop="userName" />
|
<el-table-column label="用户账号" align="center" prop="userName" />
|
||||||
<el-table-column label="试卷名称" align="center" prop="examTitle" />
|
<el-table-column label="试卷名称" align="center" prop="examTitle" />
|
||||||
<el-table-column label="试卷类型" align="center" prop="examType" />
|
|
||||||
<el-table-column label="工种类型" align="center" prop="craftType">
|
<el-table-column label="工种类型" align="center" prop="craftType">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<dict-tag :options="pro_craft_type" :value="scope.row.craftType"/>
|
<dict-tag :options="pro_craft_type" :value="scope.row.craftType"/>
|
||||||
|
@ -120,22 +119,30 @@
|
||||||
<dict-tag :options="pro_craft_post" :value="scope.row.craftPost"/>
|
<dict-tag :options="pro_craft_post" :value="scope.row.craftPost"/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column label="考试用户" align="center" prop="userName">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button link type="primary" @click="handleDetail(scope.row)">{{
|
||||||
|
scope.row.userName
|
||||||
|
}}</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="考试结果" align="center" prop="resStatus">
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :options="edu_res_status" :value="scope.row.resStatus"/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column label="用户分数" align="center" prop="userMark" />
|
<el-table-column label="用户分数" align="center" prop="userMark" />
|
||||||
|
<el-table-column label="答题耗时" align="center" prop="useTimes" />
|
||||||
<el-table-column label="答题时间" align="center" prop="createTime" width="150">
|
<el-table-column label="答题时间" align="center" prop="createTime" width="150">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}') }}</span>
|
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}') }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="结果状态" align="center" prop="resStatus">
|
|
||||||
<template #default="scope">
|
|
||||||
<dict-tag :options="edu_res_status" :value="scope.row.resStatus"/>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="答题耗时" align="center" prop="useTimes" />
|
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['manage:busExamUser:edit']">修改</el-button>
|
<el-button v-if="false" link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['manage:busExamUser:edit']">修改</el-button>
|
||||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['manage:busExamUser:remove']">删除</el-button>
|
<el-button v-if="false" link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['manage:busExamUser:remove']">删除</el-button>
|
||||||
|
<el-button link type="primary" icon="Management" @click="handleDetail(scope.row)" v-hasPermi="['manage:busExamUser:query']">试卷详情</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
@ -149,82 +156,121 @@
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- 添加或修改用户试卷对话框 -->
|
<!-- 添加或修改用户试卷对话框 -->
|
||||||
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
<el-dialog :title="title" v-model="open" width="880px" append-to-body modal-class="busExamUserDlg">
|
||||||
<el-form ref="busExamUserRef" :model="form" :rules="rules" label-width="80px">
|
<el-row class="task_panel">
|
||||||
<el-form-item label="部门主键" prop="deptId">
|
<el-col :span="6">
|
||||||
<el-input v-model="form.deptId" placeholder="请输入部门主键" />
|
<el-statistic class="statistic_div">
|
||||||
</el-form-item>
|
<template #title>
|
||||||
<el-form-item label="项目主键" prop="projectId">
|
<div style="display: inline-flex; align-items: center">
|
||||||
<el-input v-model="form.projectId" placeholder="请输入项目主键" />
|
<el-icon style="margin-right: 4px; color: #409eff" :size="12">
|
||||||
</el-form-item>
|
<InfoFilled />
|
||||||
<el-form-item label="用户主键" prop="userId">
|
</el-icon>
|
||||||
<el-input v-model="form.userId" placeholder="请输入用户主键" />
|
<strong>考试结果</strong>
|
||||||
</el-form-item>
|
</div>
|
||||||
<el-form-item label="试卷名称" prop="examTitle">
|
</template>
|
||||||
<el-input v-model="form.examTitle" placeholder="请输入试卷名称" />
|
</el-statistic>
|
||||||
</el-form-item>
|
<div v-if="form.resStatus == '0'" class="countdown-footer">
|
||||||
<el-form-item label="工种类型" prop="craftType">
|
<strong style="font-size: 16px; color: #909399; font-weight: 800;">未提交</strong>
|
||||||
<el-select v-model="form.craftType" placeholder="请选择工种类型">
|
</div>
|
||||||
<el-option
|
<div v-if="form.resStatus == '1'" class="countdown-footer">
|
||||||
v-for="dict in pro_craft_type"
|
<strong style="font-size: 16px; color: #67c23a; font-weight: 800;">已通过</strong>
|
||||||
:key="dict.value"
|
</div>
|
||||||
:label="dict.label"
|
<div v-if="form.resStatus == '2'" class="countdown-footer">
|
||||||
:value="dict.value"
|
<strong style="font-size: 16px; color: #f56c6c; font-weight: 800;">不通过</strong>
|
||||||
></el-option>
|
</div>
|
||||||
</el-select>
|
</el-col>
|
||||||
</el-form-item>
|
<el-col :span="6">
|
||||||
<el-form-item label="工种岗位" prop="craftPost">
|
<el-statistic class="statistic_div">
|
||||||
<el-select v-model="form.craftPost" placeholder="请选择工种岗位">
|
<template #title>
|
||||||
<el-option
|
<div style="display: inline-flex; align-items: center">
|
||||||
v-for="dict in pro_craft_post"
|
<el-icon style="margin-right: 4px; color: #67c23a" :size="12">
|
||||||
:key="dict.value"
|
<TrendCharts />
|
||||||
:label="dict.label"
|
</el-icon>
|
||||||
:value="dict.value"
|
<strong>考试分数</strong>
|
||||||
></el-option>
|
</div>
|
||||||
</el-select>
|
</template>
|
||||||
</el-form-item>
|
</el-statistic>
|
||||||
<el-form-item label="单选题数量" prop="singleNum">
|
<div class="countdown-footer">
|
||||||
<el-input v-model="form.singleNum" placeholder="请输入单选题数量" />
|
<strong style="font-size: 16px; color: #909399">{{form.userMark!=null?form.userMark:'-'}}</strong>
|
||||||
</el-form-item>
|
</div>
|
||||||
<el-form-item label="多选题数量" prop="multipleNum">
|
</el-col>
|
||||||
<el-input v-model="form.multipleNum" placeholder="请输入多选题数量" />
|
<el-col :span="6">
|
||||||
</el-form-item>
|
<el-statistic class="statistic_div">
|
||||||
<el-form-item label="判断题数量" prop="estimateNum">
|
<template #title>
|
||||||
<el-input v-model="form.estimateNum" placeholder="请输入判断题数量" />
|
<div style="display: inline-flex; align-items: center">
|
||||||
</el-form-item>
|
<el-icon style="margin-right: 4px; color: #409eff" :size="12">
|
||||||
<el-form-item label="用户分数" prop="userMark">
|
<InfoFilled />
|
||||||
<el-input v-model="form.userMark" placeholder="请输入用户分数" />
|
</el-icon>
|
||||||
</el-form-item>
|
<strong>答题耗时</strong>
|
||||||
<el-form-item label="结果状态" prop="resStatus">
|
</div>
|
||||||
<el-radio-group v-model="form.resStatus">
|
</template>
|
||||||
<el-radio
|
</el-statistic>
|
||||||
v-for="dict in edu_res_status"
|
<div class="countdown-footer">
|
||||||
:key="dict.value"
|
<strong style="font-size: 16px; color: #909399">{{form.useTimes?form.useTimes:'-'}}</strong>
|
||||||
:label="parseInt(dict.value)"
|
</div>
|
||||||
>{{dict.label}}</el-radio>
|
</el-col>
|
||||||
</el-radio-group>
|
<el-col :span="6">
|
||||||
</el-form-item>
|
<el-statistic class="statistic_div">
|
||||||
<el-form-item label="答题耗时" prop="useTimes">
|
<template #title>
|
||||||
<el-input v-model="form.useTimes" placeholder="请输入答题耗时" />
|
<div style="display: inline-flex; align-items: center">
|
||||||
</el-form-item>
|
<el-icon style="margin-right: 4px" :size="12">
|
||||||
<el-form-item label="删除标识" prop="isDel">
|
<Calendar />
|
||||||
<el-select v-model="form.isDel" placeholder="请选择删除标识">
|
</el-icon>
|
||||||
<el-option
|
答题时间
|
||||||
v-for="dict in sys_is_del"
|
</div>
|
||||||
:key="dict.value"
|
</template>
|
||||||
:label="dict.label"
|
</el-statistic>
|
||||||
:value="parseInt(dict.value)"
|
<div class="countdown-footer">
|
||||||
></el-option>
|
<strong>{{ parseTime(form.createTime, "{y}-{m}-{d} {h}:{i}") }}</strong>
|
||||||
</el-select>
|
</div>
|
||||||
</el-form-item>
|
</el-col>
|
||||||
<el-form-item label="备注" prop="remark">
|
</el-row>
|
||||||
<el-input v-model="form.remark" placeholder="请输入备注" />
|
|
||||||
</el-form-item>
|
<div class="startExamination">
|
||||||
</el-form>
|
<ul>
|
||||||
|
<li v-for="(item,idx) in useQuestionList" :key="item.id">
|
||||||
|
<div class="topicTilte" style="font-weight: bold" ref="topicTilte">
|
||||||
|
{{ idx + 1 }}、<span class="score">[{{ item.questionType==1?'单选题':(item.questionType==2?'多选题':'判断题')}}]</span>{{ item.questionTitle }}
|
||||||
|
</div>
|
||||||
|
<template v-if="item.questionType === 1">
|
||||||
|
<el-radio-group v-model="item.userAnswer" class="ml-4 Selected_item_radio" style="width: 100%">
|
||||||
|
<div v-for="(option,ox) in item.questionOption" class="Selected_item">
|
||||||
|
<el-radio :label="option.opt" disabled> {{ option.result }} </el-radio>
|
||||||
|
</div>
|
||||||
|
</el-radio-group>
|
||||||
|
<div :class="item.answer == item.userAnswer?'answer':'error'">
|
||||||
|
<div class="correctAnswer">正确答案:{{ item.answer }}</div>
|
||||||
|
<div class="testAnswers">试卷答案:{{ item.userAnswer }}</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<template v-if="item.questionType === 2">
|
||||||
|
<el-checkbox-group v-model="item.userAnswerValues" class="ml-4 Selected_item_radio" style="width: 100%">
|
||||||
|
<div v-for="option in item.questionOption" class="Selected_item">
|
||||||
|
<el-checkbox :label="option.opt" disabled> {{ option.result }} </el-checkbox>
|
||||||
|
</div>
|
||||||
|
</el-checkbox-group>
|
||||||
|
<div :class="item.answer == item.userAnswer?'answer':'error'">
|
||||||
|
<div class="correctAnswer">正确答案:{{ item.answer }}</div>
|
||||||
|
<div class="testAnswers">试卷答案:{{ item.userAnswer }}</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<template v-if="item.questionType === 3">
|
||||||
|
<el-checkbox-group v-model="item.userAnswerValues" class="ml-4 Selected_item_radio" style="width: 100%">
|
||||||
|
<div v-for="option in item.questionOption" class="Selected_item">
|
||||||
|
<el-checkbox :label="option.opt" disabled> {{ option.result }} </el-checkbox>
|
||||||
|
</div>
|
||||||
|
</el-checkbox-group>
|
||||||
|
<div :class="item.answer == item.userAnswer?'answer':'error'">
|
||||||
|
<div class="correctAnswer">正确答案:{{ item.answer }}</div>
|
||||||
|
<div class="testAnswers">试卷答案:{{ item.userAnswer }}</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<div class="dialog-footer">
|
<div class="dialog-footer">
|
||||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
<el-button @click="cancel">关 闭</el-button>
|
||||||
<el-button @click="cancel">取 消</el-button>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
@ -248,6 +294,7 @@ const single = ref(true);
|
||||||
const multiple = ref(true);
|
const multiple = ref(true);
|
||||||
const total = ref(0);
|
const total = ref(0);
|
||||||
const title = ref("");
|
const title = ref("");
|
||||||
|
const useQuestionList = ref([]);
|
||||||
|
|
||||||
const data = reactive({
|
const data = reactive({
|
||||||
form: {},
|
form: {},
|
||||||
|
@ -348,6 +395,28 @@ function handleUpdate(row) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 试卷详情按钮 */
|
||||||
|
function handleDetail(row) {
|
||||||
|
reset();
|
||||||
|
getBusExamUser(row.id).then(response => {
|
||||||
|
let list = response.data.busExamUserResultList;
|
||||||
|
list.forEach(item => {
|
||||||
|
if(item.questionType===2){
|
||||||
|
if(item.userAnswer==null){
|
||||||
|
item.userAnswer = "";
|
||||||
|
}
|
||||||
|
item.userAnswerValues = item.userAnswer.split(',');
|
||||||
|
}
|
||||||
|
item.questionOption = JSON.parse(item.questionOption);
|
||||||
|
});
|
||||||
|
console.log("LIST",list);
|
||||||
|
useQuestionList.value = list;
|
||||||
|
form.value = response.data;
|
||||||
|
open.value = true;
|
||||||
|
title.value = "查看试卷详情";
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
function submitForm() {
|
function submitForm() {
|
||||||
proxy.$refs["busExamUserRef"].validate(valid => {
|
proxy.$refs["busExamUserRef"].validate(valid => {
|
||||||
|
@ -387,5 +456,131 @@ function handleExport() {
|
||||||
}, `busExamUser_${new Date().getTime()}.xlsx`)
|
}, `busExamUser_${new Date().getTime()}.xlsx`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 改变工种类型 */
|
||||||
|
function changeCraftType() {
|
||||||
|
queryParams.value.craftPost = null;
|
||||||
|
}
|
||||||
|
|
||||||
getList();
|
getList();
|
||||||
</script>
|
</script>
|
||||||
|
<style lang="scss" scope>
|
||||||
|
.el-divider__text{
|
||||||
|
color: #409eff;
|
||||||
|
font-weight: 800;
|
||||||
|
}
|
||||||
|
.busExamUserDlg{
|
||||||
|
.el-dialog__body{
|
||||||
|
margin-top: -25px;
|
||||||
|
overflow: auto;
|
||||||
|
max-height: 680px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.task_panel {
|
||||||
|
text-align: center;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
.statistic_div {
|
||||||
|
.el-statistic__content {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.startExamination {
|
||||||
|
ul {
|
||||||
|
margin: 30px 0;
|
||||||
|
li {
|
||||||
|
list-style: none;
|
||||||
|
margin-top: 10px;
|
||||||
|
.Selected_item_radio {
|
||||||
|
display: block;
|
||||||
|
flex: none;
|
||||||
|
}
|
||||||
|
.topicTilte {
|
||||||
|
.score {
|
||||||
|
display: inline-block;
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.Selected_item_fill {
|
||||||
|
height: 45px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
.answer {
|
||||||
|
height: 30px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
border: 1px solid #e1f3d8;
|
||||||
|
color: #67c23a;
|
||||||
|
padding: 0 15px;
|
||||||
|
//margin: 10px 20px 10px 0;
|
||||||
|
background-color: #f0f9eb;
|
||||||
|
.correctAnswer {
|
||||||
|
margin-right: 40px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.error {
|
||||||
|
height: 30px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 0 15px;
|
||||||
|
//margin: 10px 20px 10px 0;
|
||||||
|
background: #fdf6ec;
|
||||||
|
border: 1px solid #faecd8;
|
||||||
|
color: #f56c6c;
|
||||||
|
.correctAnswer {
|
||||||
|
margin-right: 40px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.CompletionAnswer {
|
||||||
|
height: 80px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
border: 1px solid #e1f3d8;
|
||||||
|
color: #67c23a;
|
||||||
|
padding: 0 15px;
|
||||||
|
margin: 10px 20px 10px 0;
|
||||||
|
background-color: #f0f9eb;
|
||||||
|
.CompletionAnswerIndex {
|
||||||
|
width: 50px;
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
border-right: 1px solid #e1f3d8;
|
||||||
|
margin-right: 20px;
|
||||||
|
}
|
||||||
|
.correctAnswer {
|
||||||
|
margin-right: 40px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.CompletionError {
|
||||||
|
height: 80px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 0 15px;
|
||||||
|
margin: 10px 20px 10px 0;
|
||||||
|
background: #fdf6ec;
|
||||||
|
border: 1px solid #faecd8;
|
||||||
|
color: #f56c6c;
|
||||||
|
.CompletionAnswerIndex {
|
||||||
|
width: 25px;
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
border-right: 1px solid #faecd8;
|
||||||
|
margin-right: 20px;
|
||||||
|
}
|
||||||
|
.correctAnswer {
|
||||||
|
height: 40px;
|
||||||
|
margin-right: 40px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.el-alert {
|
||||||
|
margin: 20px 0 0;
|
||||||
|
}
|
||||||
|
.el-alert:first-child {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
</style>
|
|
@ -1,295 +0,0 @@
|
||||||
<template>
|
|
||||||
<div class="app-container">
|
|
||||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
|
|
||||||
<el-form-item label="用户试卷主键" prop="examUserId">
|
|
||||||
<el-input
|
|
||||||
v-model="queryParams.examUserId"
|
|
||||||
placeholder="请输入用户试卷主键"
|
|
||||||
clearable
|
|
||||||
@keyup.enter="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="问题主键" prop="questionId">
|
|
||||||
<el-input
|
|
||||||
v-model="queryParams.questionId"
|
|
||||||
placeholder="请输入问题主键"
|
|
||||||
clearable
|
|
||||||
@keyup.enter="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="用户答案" prop="answers">
|
|
||||||
<el-input
|
|
||||||
v-model="queryParams.answers"
|
|
||||||
placeholder="请输入用户答案"
|
|
||||||
clearable
|
|
||||||
@keyup.enter="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="排序" prop="sortBy">
|
|
||||||
<el-input
|
|
||||||
v-model="queryParams.sortBy"
|
|
||||||
placeholder="请输入排序"
|
|
||||||
clearable
|
|
||||||
@keyup.enter="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="答题结果" prop="useRes">
|
|
||||||
<el-input
|
|
||||||
v-model="queryParams.useRes"
|
|
||||||
placeholder="请输入答题结果"
|
|
||||||
clearable
|
|
||||||
@keyup.enter="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="答题得分" prop="useMark">
|
|
||||||
<el-input
|
|
||||||
v-model="queryParams.useMark"
|
|
||||||
placeholder="请输入答题得分"
|
|
||||||
clearable
|
|
||||||
@keyup.enter="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item>
|
|
||||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
|
||||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
|
|
||||||
<el-row :gutter="10" class="mb8">
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="primary"
|
|
||||||
plain
|
|
||||||
icon="Plus"
|
|
||||||
@click="handleAdd"
|
|
||||||
v-hasPermi="['manage:busExamUserResult:add']"
|
|
||||||
>新增</el-button>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="success"
|
|
||||||
plain
|
|
||||||
icon="Edit"
|
|
||||||
:disabled="single"
|
|
||||||
@click="handleUpdate"
|
|
||||||
v-hasPermi="['manage:busExamUserResult:edit']"
|
|
||||||
>修改</el-button>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="danger"
|
|
||||||
plain
|
|
||||||
icon="Delete"
|
|
||||||
:disabled="multiple"
|
|
||||||
@click="handleDelete"
|
|
||||||
v-hasPermi="['manage:busExamUserResult:remove']"
|
|
||||||
>删除</el-button>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="warning"
|
|
||||||
plain
|
|
||||||
icon="Download"
|
|
||||||
@click="handleExport"
|
|
||||||
v-hasPermi="['manage:busExamUserResult:export']"
|
|
||||||
>导出</el-button>
|
|
||||||
</el-col>
|
|
||||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
|
||||||
</el-row>
|
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="busExamUserResultList" @selection-change="handleSelectionChange">
|
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
|
||||||
<el-table-column label="用户试卷主键" align="center" prop="examUserId" />
|
|
||||||
<el-table-column label="问题主键" align="center" prop="questionId" />
|
|
||||||
<el-table-column label="用户答案" align="center" prop="answers" />
|
|
||||||
<el-table-column label="排序" align="center" prop="sortBy" />
|
|
||||||
<el-table-column label="答题结果" align="center" prop="useRes" />
|
|
||||||
<el-table-column label="答题得分" align="center" prop="useMark" />
|
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
||||||
<template #default="scope">
|
|
||||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['manage:busExamUserResult:edit']">修改</el-button>
|
|
||||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['manage:busExamUserResult:remove']">删除</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
|
|
||||||
<pagination
|
|
||||||
v-show="total>0"
|
|
||||||
:total="total"
|
|
||||||
v-model:page="queryParams.pageNum"
|
|
||||||
v-model:limit="queryParams.pageSize"
|
|
||||||
@pagination="getList"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<!-- 添加或修改用户试卷结果对话框 -->
|
|
||||||
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
|
||||||
<el-form ref="busExamUserResultRef" :model="form" :rules="rules" label-width="80px">
|
|
||||||
<el-form-item label="用户试卷主键" prop="examUserId">
|
|
||||||
<el-input v-model="form.examUserId" placeholder="请输入用户试卷主键" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="问题主键" prop="questionId">
|
|
||||||
<el-input v-model="form.questionId" placeholder="请输入问题主键" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="用户答案" prop="answers">
|
|
||||||
<el-input v-model="form.answers" placeholder="请输入用户答案" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="排序" prop="sortBy">
|
|
||||||
<el-input v-model="form.sortBy" placeholder="请输入排序" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="答题结果" prop="useRes">
|
|
||||||
<el-input v-model="form.useRes" placeholder="请输入答题结果" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="答题得分" prop="useMark">
|
|
||||||
<el-input v-model="form.useMark" placeholder="请输入答题得分" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
<template #footer>
|
|
||||||
<div class="dialog-footer">
|
|
||||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
|
||||||
<el-button @click="cancel">取 消</el-button>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</el-dialog>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup name="BusExamUserResult">
|
|
||||||
import { listBusExamUserResult, getBusExamUserResult, delBusExamUserResult, addBusExamUserResult, updateBusExamUserResult } from "@/api/manage/busExamUserResult";
|
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance();
|
|
||||||
|
|
||||||
const busExamUserResultList = ref([]);
|
|
||||||
const open = ref(false);
|
|
||||||
const loading = ref(true);
|
|
||||||
const showSearch = ref(true);
|
|
||||||
const ids = ref([]);
|
|
||||||
const single = ref(true);
|
|
||||||
const multiple = ref(true);
|
|
||||||
const total = ref(0);
|
|
||||||
const title = ref("");
|
|
||||||
|
|
||||||
const data = reactive({
|
|
||||||
form: {},
|
|
||||||
queryParams: {
|
|
||||||
pageNum: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
examUserId: null,
|
|
||||||
questionId: null,
|
|
||||||
answers: null,
|
|
||||||
sortBy: null,
|
|
||||||
useRes: null,
|
|
||||||
useMark: null
|
|
||||||
},
|
|
||||||
rules: {
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
const { queryParams, form, rules } = toRefs(data);
|
|
||||||
|
|
||||||
/** 查询用户试卷结果列表 */
|
|
||||||
function getList() {
|
|
||||||
loading.value = true;
|
|
||||||
listBusExamUserResult(queryParams.value).then(response => {
|
|
||||||
busExamUserResultList.value = response.rows;
|
|
||||||
total.value = response.total;
|
|
||||||
loading.value = false;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// 取消按钮
|
|
||||||
function cancel() {
|
|
||||||
open.value = false;
|
|
||||||
reset();
|
|
||||||
}
|
|
||||||
|
|
||||||
// 表单重置
|
|
||||||
function reset() {
|
|
||||||
form.value = {
|
|
||||||
examUserId: null,
|
|
||||||
questionId: null,
|
|
||||||
answers: null,
|
|
||||||
sortBy: null,
|
|
||||||
useRes: null,
|
|
||||||
useMark: null
|
|
||||||
};
|
|
||||||
proxy.resetForm("busExamUserResultRef");
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 搜索按钮操作 */
|
|
||||||
function handleQuery() {
|
|
||||||
queryParams.value.pageNum = 1;
|
|
||||||
getList();
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 重置按钮操作 */
|
|
||||||
function resetQuery() {
|
|
||||||
proxy.resetForm("queryRef");
|
|
||||||
handleQuery();
|
|
||||||
}
|
|
||||||
|
|
||||||
// 多选框选中数据
|
|
||||||
function handleSelectionChange(selection) {
|
|
||||||
ids.value = selection.map(item => item.examUserId);
|
|
||||||
single.value = selection.length != 1;
|
|
||||||
multiple.value = !selection.length;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 新增按钮操作 */
|
|
||||||
function handleAdd() {
|
|
||||||
reset();
|
|
||||||
open.value = true;
|
|
||||||
title.value = "添加用户试卷结果";
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 修改按钮操作 */
|
|
||||||
function handleUpdate(row) {
|
|
||||||
reset();
|
|
||||||
const _examUserId = row.examUserId || ids.value
|
|
||||||
getBusExamUserResult(_examUserId).then(response => {
|
|
||||||
form.value = response.data;
|
|
||||||
open.value = true;
|
|
||||||
title.value = "修改用户试卷结果";
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 提交按钮 */
|
|
||||||
function submitForm() {
|
|
||||||
proxy.$refs["busExamUserResultRef"].validate(valid => {
|
|
||||||
if (valid) {
|
|
||||||
if (form.value.examUserId != null) {
|
|
||||||
updateBusExamUserResult(form.value).then(response => {
|
|
||||||
proxy.$modal.msgSuccess("修改成功");
|
|
||||||
open.value = false;
|
|
||||||
getList();
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
addBusExamUserResult(form.value).then(response => {
|
|
||||||
proxy.$modal.msgSuccess("新增成功");
|
|
||||||
open.value = false;
|
|
||||||
getList();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 删除按钮操作 */
|
|
||||||
function handleDelete(row) {
|
|
||||||
const _examUserIds = row.examUserId || ids.value;
|
|
||||||
proxy.$modal.confirm('是否确认删除用户试卷结果编号为"' + _examUserIds + '"的数据项?').then(function() {
|
|
||||||
return delBusExamUserResult(_examUserIds);
|
|
||||||
}).then(() => {
|
|
||||||
getList();
|
|
||||||
proxy.$modal.msgSuccess("删除成功");
|
|
||||||
}).catch(() => {});
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 导出按钮操作 */
|
|
||||||
function handleExport() {
|
|
||||||
proxy.download('manage/busExamUserResult/export', {
|
|
||||||
...queryParams.value
|
|
||||||
}, `busExamUserResult_${new Date().getTime()}.xlsx`)
|
|
||||||
}
|
|
||||||
|
|
||||||
getList();
|
|
||||||
</script>
|
|
Loading…
Reference in New Issue