安全教育
This commit is contained in:
@ -0,0 +1,49 @@
|
||||
package com.ruoyi.wgz.bo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
import java.time.LocalDate;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 题库分页查询对象 wgz_question_bank
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-02-17
|
||||
*/
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel("题库分页查询对象")
|
||||
public class WgzQuestionBankQueryBo extends BaseEntity {
|
||||
|
||||
/** 分页大小 */
|
||||
@ApiModelProperty("分页大小")
|
||||
private Integer pageSize;
|
||||
/** 当前页数 */
|
||||
@ApiModelProperty("当前页数")
|
||||
private Integer pageNum;
|
||||
/** 排序列 */
|
||||
@ApiModelProperty("排序列")
|
||||
private String orderByColumn;
|
||||
/** 排序的方向desc或者asc */
|
||||
@ApiModelProperty(value = "排序的方向", example = "asc,desc")
|
||||
private String isAsc;
|
||||
|
||||
|
||||
/** 题目类别(外键关联到类别表) */
|
||||
@ApiModelProperty("题目类别(外键关联到类别表)")
|
||||
private Long categoryId;
|
||||
/** 题目类型(1单选、2多选、3判断、4填空、5问答) */
|
||||
@ApiModelProperty("题目类型(1单选、2多选、3判断、4填空、5问答)")
|
||||
private String questionType;
|
||||
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
package com.ruoyi.wgz.bo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
import java.time.LocalDate;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 题库_题库类别分页查询对象 wgz_question_category
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-02-17
|
||||
*/
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel("题库_题库类别分页查询对象")
|
||||
public class WgzQuestionCategoryQueryBo extends BaseEntity {
|
||||
|
||||
/** 分页大小 */
|
||||
@ApiModelProperty("分页大小")
|
||||
private Integer pageSize;
|
||||
/** 当前页数 */
|
||||
@ApiModelProperty("当前页数")
|
||||
private Integer pageNum;
|
||||
/** 排序列 */
|
||||
@ApiModelProperty("排序列")
|
||||
private String orderByColumn;
|
||||
/** 排序的方向desc或者asc */
|
||||
@ApiModelProperty(value = "排序的方向", example = "asc,desc")
|
||||
private String isAsc;
|
||||
|
||||
|
||||
/** 题库类别 */
|
||||
@ApiModelProperty("题库类别")
|
||||
private String categoryName;
|
||||
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
package com.ruoyi.wgz.bo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
import java.time.LocalDate;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 用户试卷存储分页查询对象 wgz_question_save
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-02-17
|
||||
*/
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel("用户试卷存储分页查询对象")
|
||||
public class WgzQuestionSaveQueryBo extends BaseEntity {
|
||||
|
||||
/** 分页大小 */
|
||||
@ApiModelProperty("分页大小")
|
||||
private Integer pageSize;
|
||||
/** 当前页数 */
|
||||
@ApiModelProperty("当前页数")
|
||||
private Integer pageNum;
|
||||
/** 排序列 */
|
||||
@ApiModelProperty("排序列")
|
||||
private String orderByColumn;
|
||||
/** 排序的方向desc或者asc */
|
||||
@ApiModelProperty(value = "排序的方向", example = "asc,desc")
|
||||
private String isAsc;
|
||||
|
||||
|
||||
/** 务工者唯一标识 */
|
||||
@ApiModelProperty("务工者唯一标识")
|
||||
private Long userId;
|
||||
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
package com.ruoyi.wgz.bo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
import java.time.LocalDate;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 题库配置分页查询对象 wgz_questions_configuration
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-02-17
|
||||
*/
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel("题库配置分页查询对象")
|
||||
public class WgzQuestionsConfigurationQueryBo extends BaseEntity {
|
||||
|
||||
/** 分页大小 */
|
||||
@ApiModelProperty("分页大小")
|
||||
private Integer pageSize;
|
||||
/** 当前页数 */
|
||||
@ApiModelProperty("当前页数")
|
||||
private Integer pageNum;
|
||||
/** 排序列 */
|
||||
@ApiModelProperty("排序列")
|
||||
private String orderByColumn;
|
||||
/** 排序的方向desc或者asc */
|
||||
@ApiModelProperty(value = "排序的方向", example = "asc,desc")
|
||||
private String isAsc;
|
||||
|
||||
|
||||
|
||||
}
|
@ -1,6 +1,5 @@
|
||||
package com.ruoyi.wgz.bo.req;
|
||||
|
||||
import com.ruoyi.wgz.bo.WgzAutonymAnnex;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
@ -9,7 +8,6 @@ import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
|
@ -0,0 +1,35 @@
|
||||
package com.ruoyi.wgz.bo.req;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
@ApiModel("题库新增对象")
|
||||
public class WgzQuestionReq implements Serializable {
|
||||
|
||||
@ApiModelProperty("题目类别(外键关联到类别表)")
|
||||
private Long categoryId;
|
||||
|
||||
|
||||
@ApiModelProperty("题目类型(1单选、2多选、3判断)")
|
||||
private String questionType;
|
||||
|
||||
@ApiModelProperty("题目内容")
|
||||
private String questionText;
|
||||
|
||||
|
||||
@ApiModelProperty("选项(对单选、多选、判断这种固定答案有效,以JSON数组形式存储)")
|
||||
private String options;
|
||||
|
||||
@ApiModelProperty("正确答案")
|
||||
private String correctAnswer;
|
||||
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
package com.ruoyi.wgz.bo.res;
|
||||
|
||||
import com.ruoyi.wgz.bo.WgzAutonymAnnex;
|
||||
import com.ruoyi.wgz.bo.rests.WgzAutonymAnnex;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
@ -0,0 +1,25 @@
|
||||
package com.ruoyi.wgz.bo.res;
|
||||
|
||||
import com.ruoyi.wgz.bo.rests.WgzAppGetTestPaperTwo;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
@ApiModel("获取试卷返回")
|
||||
public class WgzAppGetTestPaperRes implements Serializable {
|
||||
@ApiModelProperty("最大考试时间(分钟)")
|
||||
private int maximum;
|
||||
@ApiModelProperty("单选题")
|
||||
private WgzAppGetTestPaperTwo singleList;
|
||||
@ApiModelProperty("多选题")
|
||||
private WgzAppGetTestPaperTwo multipleList;
|
||||
@ApiModelProperty("判断题")
|
||||
private WgzAppGetTestPaperTwo estimateList;
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package com.ruoyi.wgz.bo.rests;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
public class WgzAppGetTestPaperThree implements Serializable {
|
||||
@ApiModelProperty("题库id")
|
||||
private long id;
|
||||
|
||||
@ApiModelProperty("题类型")
|
||||
private String questionType;
|
||||
|
||||
@ApiModelProperty("题内容")
|
||||
private String questionText;
|
||||
|
||||
@ApiModelProperty("题选项")
|
||||
private String options;
|
||||
|
||||
@ApiModelProperty("题分数")
|
||||
private double score;
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package com.ruoyi.wgz.bo.rests;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
public class WgzAppGetTestPaperTwo implements Serializable {
|
||||
@ApiModelProperty("题目+分数")
|
||||
private String topic;
|
||||
@ApiModelProperty("题目选项")
|
||||
private List<WgzAppGetTestPaperThree> list;
|
||||
}
|
@ -1,6 +1,5 @@
|
||||
package com.ruoyi.wgz.bo;
|
||||
package com.ruoyi.wgz.bo.rests;
|
||||
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import com.ruoyi.common.domain.Annex;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
@ -9,8 +8,6 @@ import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
@ -0,0 +1,104 @@
|
||||
package com.ruoyi.wgz.domain;
|
||||
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* 题库对象 wgz_question_bank
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-02-17
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
@TableName("wgz_question_bank")
|
||||
@ApiModel("题库视图对象")
|
||||
public class WgzQuestionBank implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/** 主键ID */
|
||||
@ApiModelProperty("主键ID")
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/** 题目类别(外键关联到类别表) */
|
||||
@Excel(name = "题目类别" , readConverterExp = "外=键关联到类别表")
|
||||
@ApiModelProperty("题目类别(外键关联到类别表)")
|
||||
private Long categoryId;
|
||||
|
||||
/** 题目类型(1单选、2多选、3判断、4填空、5问答) */
|
||||
@Excel(name = "题目类型" , readConverterExp = "1=单选、2多选、3判断、4填空、5问答")
|
||||
@ApiModelProperty("题目类型(1单选、2多选、3判断、4填空、5问答)")
|
||||
private String questionType;
|
||||
|
||||
/** 题目内容 */
|
||||
@Excel(name = "题目内容")
|
||||
@ApiModelProperty("题目内容")
|
||||
private String questionText;
|
||||
|
||||
/** 选项(对单选、多选、判断这种固定答案有效,以JSON数组形式存储) */
|
||||
@Excel(name = "选项" , readConverterExp = "对=单选、多选、判断这种固定答案有效,以JSON数组形式存储")
|
||||
@ApiModelProperty("选项(对单选、多选、判断这种固定答案有效,以JSON数组形式存储)")
|
||||
private String options;
|
||||
|
||||
/** 正确答案 */
|
||||
@Excel(name = "正确答案")
|
||||
@ApiModelProperty("正确答案")
|
||||
private String correctAnswer;
|
||||
|
||||
/** 得分 */
|
||||
@Excel(name = "得分")
|
||||
@ApiModelProperty("得分")
|
||||
private Long score;
|
||||
|
||||
/** 删除标志(0代表存在 2代表删除) */
|
||||
@Excel(name = "删除标志" , readConverterExp = "0=代表存在,2=代表删除")
|
||||
@ApiModelProperty("删除标志(0代表存在 2代表删除)")
|
||||
@TableLogic
|
||||
private String delFlag;
|
||||
|
||||
/** 创建者 */
|
||||
@Excel(name = "创建者")
|
||||
@ApiModelProperty("创建者")
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private String createBy;
|
||||
|
||||
/** 创建时间 */
|
||||
@Excel(name = "创建时间" , width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty("创建时间")
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/** 更新者 */
|
||||
@Excel(name = "更新者")
|
||||
@ApiModelProperty("更新者")
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private String updateBy;
|
||||
|
||||
/** 更新时间 */
|
||||
@Excel(name = "更新时间" , width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty("更新时间")
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/** 备注 */
|
||||
@Excel(name = "备注")
|
||||
@ApiModelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
package com.ruoyi.wgz.domain;
|
||||
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* 题库_题库类别对象 wgz_question_category
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-02-17
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
@TableName("wgz_question_category")
|
||||
@ApiModel("题库_题库类别视图对象")
|
||||
public class WgzQuestionCategory implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/** 主键ID */
|
||||
@ApiModelProperty("主键ID")
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/** 题库类别 */
|
||||
@Excel(name = "题库类别")
|
||||
@ApiModelProperty("题库类别")
|
||||
private String categoryName;
|
||||
|
||||
}
|
@ -0,0 +1,119 @@
|
||||
package com.ruoyi.wgz.domain;
|
||||
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* 用户试卷存储对象 wgz_question_save
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-02-17
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
@TableName("wgz_question_save")
|
||||
@ApiModel("用户试卷存储视图对象")
|
||||
public class WgzQuestionSave implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/** 主键ID */
|
||||
@ApiModelProperty("主键ID")
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/** 务工者唯一标识 */
|
||||
@Excel(name = "务工者唯一标识")
|
||||
@ApiModelProperty("务工者唯一标识")
|
||||
private Long userId;
|
||||
|
||||
/** 题库ID */
|
||||
@Excel(name = "题库ID")
|
||||
@ApiModelProperty("题库ID")
|
||||
private Long bankId;
|
||||
|
||||
/** 答案 */
|
||||
@Excel(name = "答案")
|
||||
@ApiModelProperty("答案")
|
||||
private String answer;
|
||||
|
||||
/** 答题是否正确(1正确 2错误) */
|
||||
@Excel(name = "答题是否正确" , readConverterExp = "1=正确,2=错误")
|
||||
@ApiModelProperty("答题是否正确(1正确 2错误)")
|
||||
private String correct;
|
||||
|
||||
/** 得分(当前题) */
|
||||
@Excel(name = "得分" , readConverterExp = "当=前题")
|
||||
@ApiModelProperty("得分(当前题)")
|
||||
private Long score;
|
||||
|
||||
/** 签名路径 */
|
||||
@Excel(name = "签名路径")
|
||||
@ApiModelProperty("签名路径")
|
||||
private String sign;
|
||||
|
||||
/** 用时时间(时间戳/秒) */
|
||||
@Excel(name = "用时时间" , readConverterExp = "时=间戳/秒")
|
||||
@ApiModelProperty("用时时间(时间戳/秒)")
|
||||
private Long takeTime;
|
||||
|
||||
/** 最大超时时间(单位/分钟) */
|
||||
@Excel(name = "最大超时时间" , readConverterExp = "单=位/分钟")
|
||||
@ApiModelProperty("最大超时时间(单位/分钟)")
|
||||
private Long timeOut;
|
||||
|
||||
/** 及格线/总分(格式:60,100) */
|
||||
@Excel(name = "及格线/总分" , readConverterExp = "格=式:60,100")
|
||||
@ApiModelProperty("及格线/总分(格式:60,100)")
|
||||
private String pass;
|
||||
|
||||
/** 删除标志(0代表存在 2代表删除) */
|
||||
@Excel(name = "删除标志" , readConverterExp = "0=代表存在,2=代表删除")
|
||||
@ApiModelProperty("删除标志(0代表存在 2代表删除)")
|
||||
@TableLogic
|
||||
private String delFlag;
|
||||
|
||||
/** 创建者 */
|
||||
@Excel(name = "创建者")
|
||||
@ApiModelProperty("创建者")
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private String createBy;
|
||||
|
||||
/** 创建时间 */
|
||||
@Excel(name = "创建时间" , width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty("创建时间")
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/** 更新者 */
|
||||
@Excel(name = "更新者")
|
||||
@ApiModelProperty("更新者")
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private String updateBy;
|
||||
|
||||
/** 更新时间 */
|
||||
@Excel(name = "更新时间" , width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty("更新时间")
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/** 备注 */
|
||||
@Excel(name = "备注")
|
||||
@ApiModelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
}
|
@ -0,0 +1,84 @@
|
||||
package com.ruoyi.wgz.domain;
|
||||
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* 题库配置对象 wgz_questions_configuration
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-02-17
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
@TableName("wgz_questions_configuration")
|
||||
@ApiModel("题库配置视图对象")
|
||||
public class WgzQuestionsConfiguration implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/** 主键ID */
|
||||
@ApiModelProperty("主键ID")
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/** 单选题(单位/道) */
|
||||
@Excel(name = "单选题" , readConverterExp = "单=位/道")
|
||||
@ApiModelProperty("单选题(单位/道)")
|
||||
private Integer singleChoice;
|
||||
|
||||
/** 单选分数 */
|
||||
@Excel(name = "单选分数")
|
||||
@ApiModelProperty("单选分数")
|
||||
private Float singleScore;
|
||||
|
||||
/** 多选题(单位/道) */
|
||||
@Excel(name = "多选题" , readConverterExp = "单=位/道")
|
||||
@ApiModelProperty("多选题(单位/道)")
|
||||
private Integer multipleChoice;
|
||||
|
||||
/** 多选分数 */
|
||||
@Excel(name = "多选分数")
|
||||
@ApiModelProperty("多选分数")
|
||||
private Float multipleScore;
|
||||
|
||||
/** 判断题(单位/道) */
|
||||
@Excel(name = "判断题" , readConverterExp = "单=位/道")
|
||||
@ApiModelProperty("判断题(单位/道)")
|
||||
private Integer estimate;
|
||||
|
||||
/** 判断分数 */
|
||||
@Excel(name = "判断分数")
|
||||
@ApiModelProperty("判断分数")
|
||||
private Float estimateScore;
|
||||
|
||||
/** 满分 */
|
||||
@Excel(name = "满分")
|
||||
@ApiModelProperty("满分")
|
||||
private Long fullMark;
|
||||
|
||||
/** 及格线 */
|
||||
@Excel(name = "及格线")
|
||||
@ApiModelProperty("及格线")
|
||||
private Long passingScore;
|
||||
|
||||
/** 答题最大时间(单位/分钟) */
|
||||
@Excel(name = "答题最大时间" , readConverterExp = "单=位/分钟")
|
||||
@ApiModelProperty("答题最大时间(单位/分钟)")
|
||||
private int answerTime;
|
||||
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.ruoyi.wgz.mapper;
|
||||
|
||||
import com.ruoyi.wgz.domain.WgzQuestionBank;
|
||||
import com.ruoyi.common.core.mybatisplus.core.BaseMapperPlus;
|
||||
import com.ruoyi.common.core.mybatisplus.cache.MybatisPlusRedisCache;
|
||||
import org.apache.ibatis.annotations.CacheNamespace;
|
||||
|
||||
/**
|
||||
* 题库Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-02-17
|
||||
*/
|
||||
// 如使需切换数据源 请勿使用缓存 会造成数据不一致现象
|
||||
@CacheNamespace(implementation = MybatisPlusRedisCache.class, eviction = MybatisPlusRedisCache.class)
|
||||
public interface WgzQuestionBankMapper extends BaseMapperPlus<WgzQuestionBank> {
|
||||
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.ruoyi.wgz.mapper;
|
||||
|
||||
import com.ruoyi.wgz.domain.WgzQuestionCategory;
|
||||
import com.ruoyi.common.core.mybatisplus.core.BaseMapperPlus;
|
||||
import com.ruoyi.common.core.mybatisplus.cache.MybatisPlusRedisCache;
|
||||
import org.apache.ibatis.annotations.CacheNamespace;
|
||||
|
||||
/**
|
||||
* 题库_题库类别Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-02-17
|
||||
*/
|
||||
// 如使需切换数据源 请勿使用缓存 会造成数据不一致现象
|
||||
@CacheNamespace(implementation = MybatisPlusRedisCache.class, eviction = MybatisPlusRedisCache.class)
|
||||
public interface WgzQuestionCategoryMapper extends BaseMapperPlus<WgzQuestionCategory> {
|
||||
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.ruoyi.wgz.mapper;
|
||||
|
||||
import com.ruoyi.wgz.domain.WgzQuestionSave;
|
||||
import com.ruoyi.common.core.mybatisplus.core.BaseMapperPlus;
|
||||
import com.ruoyi.common.core.mybatisplus.cache.MybatisPlusRedisCache;
|
||||
import org.apache.ibatis.annotations.CacheNamespace;
|
||||
|
||||
/**
|
||||
* 用户试卷存储Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-02-17
|
||||
*/
|
||||
// 如使需切换数据源 请勿使用缓存 会造成数据不一致现象
|
||||
@CacheNamespace(implementation = MybatisPlusRedisCache.class, eviction = MybatisPlusRedisCache.class)
|
||||
public interface WgzQuestionSaveMapper extends BaseMapperPlus<WgzQuestionSave> {
|
||||
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.ruoyi.wgz.mapper;
|
||||
|
||||
import com.ruoyi.wgz.domain.WgzQuestionsConfiguration;
|
||||
import com.ruoyi.common.core.mybatisplus.core.BaseMapperPlus;
|
||||
import com.ruoyi.common.core.mybatisplus.cache.MybatisPlusRedisCache;
|
||||
import org.apache.ibatis.annotations.CacheNamespace;
|
||||
|
||||
/**
|
||||
* 题库配置Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-02-17
|
||||
*/
|
||||
// 如使需切换数据源 请勿使用缓存 会造成数据不一致现象
|
||||
@CacheNamespace(implementation = MybatisPlusRedisCache.class, eviction = MybatisPlusRedisCache.class)
|
||||
public interface WgzQuestionsConfigurationMapper extends BaseMapperPlus<WgzQuestionsConfiguration> {
|
||||
|
||||
}
|
@ -0,0 +1,73 @@
|
||||
package com.ruoyi.wgz.service;
|
||||
|
||||
import com.ruoyi.wgz.bo.req.WgzQuestionReq;
|
||||
import com.ruoyi.wgz.bo.rests.WgzAppGetTestPaperThree;
|
||||
import com.ruoyi.wgz.domain.WgzQuestionBank;
|
||||
import com.ruoyi.wgz.bo.WgzQuestionBankQueryBo;
|
||||
import com.ruoyi.common.core.mybatisplus.core.IServicePlus;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 题库Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-02-17
|
||||
*/
|
||||
public interface IWgzQuestionBankService extends IServicePlus<WgzQuestionBank> {
|
||||
/**
|
||||
* 查询单个
|
||||
* @return
|
||||
*/
|
||||
WgzQuestionBank queryById(Long id);
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
*/
|
||||
TableDataInfo<WgzQuestionBank> queryPageList(WgzQuestionBankQueryBo bo);
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
*/
|
||||
List<WgzQuestionBank> queryList(WgzQuestionBankQueryBo bo);
|
||||
|
||||
/**
|
||||
* 根据新增业务对象插入题库
|
||||
* @param bo 题库新增业务对象
|
||||
* @return
|
||||
*/
|
||||
Boolean insert(WgzQuestionReq bo);
|
||||
|
||||
/**
|
||||
* 根据编辑业务对象修改题库
|
||||
* @param bo 题库编辑业务对象
|
||||
* @return
|
||||
*/
|
||||
Boolean update(WgzQuestionBank bo);
|
||||
|
||||
/**
|
||||
* 校验并删除数据
|
||||
* @param ids 主键集合
|
||||
* @param isValid 是否校验,true-删除前校验,false-不校验
|
||||
* @return
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
|
||||
/**
|
||||
* 务工者APP相关
|
||||
* =================================================================================================================
|
||||
* =================================================================================================================
|
||||
* =================================================================================================================
|
||||
*/
|
||||
/**
|
||||
* 随机获取指定个数类型的题
|
||||
* @param type 类型
|
||||
* 1:单选
|
||||
* 2:多选
|
||||
* 3:判断
|
||||
* @param num 数量
|
||||
*/
|
||||
List<WgzAppGetTestPaperThree> appQueryList(int type, int num);
|
||||
}
|
@ -0,0 +1,55 @@
|
||||
package com.ruoyi.wgz.service;
|
||||
|
||||
import com.ruoyi.wgz.domain.WgzQuestionCategory;
|
||||
import com.ruoyi.wgz.bo.WgzQuestionCategoryQueryBo;
|
||||
import com.ruoyi.common.core.mybatisplus.core.IServicePlus;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 题库_题库类别Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-02-17
|
||||
*/
|
||||
public interface IWgzQuestionCategoryService extends IServicePlus<WgzQuestionCategory> {
|
||||
/**
|
||||
* 查询单个
|
||||
* @return
|
||||
*/
|
||||
WgzQuestionCategory queryById(Long id);
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
*/
|
||||
TableDataInfo<WgzQuestionCategory> queryPageList(WgzQuestionCategoryQueryBo bo);
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
*/
|
||||
List<WgzQuestionCategory> queryList(WgzQuestionCategoryQueryBo bo);
|
||||
|
||||
/**
|
||||
* 根据新增业务对象插入题库_题库类别
|
||||
* @param bo 题库_题库类别新增业务对象
|
||||
* @return
|
||||
*/
|
||||
Boolean insert(WgzQuestionCategory bo);
|
||||
|
||||
/**
|
||||
* 根据编辑业务对象修改题库_题库类别
|
||||
* @param bo 题库_题库类别编辑业务对象
|
||||
* @return
|
||||
*/
|
||||
Boolean update(WgzQuestionCategory bo);
|
||||
|
||||
/**
|
||||
* 校验并删除数据
|
||||
* @param ids 主键集合
|
||||
* @param isValid 是否校验,true-删除前校验,false-不校验
|
||||
* @return
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
@ -0,0 +1,55 @@
|
||||
package com.ruoyi.wgz.service;
|
||||
|
||||
import com.ruoyi.wgz.domain.WgzQuestionSave;
|
||||
import com.ruoyi.wgz.bo.WgzQuestionSaveQueryBo;
|
||||
import com.ruoyi.common.core.mybatisplus.core.IServicePlus;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户试卷存储Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-02-17
|
||||
*/
|
||||
public interface IWgzQuestionSaveService extends IServicePlus<WgzQuestionSave> {
|
||||
/**
|
||||
* 查询单个
|
||||
* @return
|
||||
*/
|
||||
WgzQuestionSave queryById(Long id);
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
*/
|
||||
TableDataInfo<WgzQuestionSave> queryPageList(WgzQuestionSaveQueryBo bo);
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
*/
|
||||
List<WgzQuestionSave> queryList(WgzQuestionSaveQueryBo bo);
|
||||
|
||||
/**
|
||||
* 根据新增业务对象插入用户试卷存储
|
||||
* @param bo 用户试卷存储新增业务对象
|
||||
* @return
|
||||
*/
|
||||
Boolean insert(WgzQuestionSave bo);
|
||||
|
||||
/**
|
||||
* 根据编辑业务对象修改用户试卷存储
|
||||
* @param bo 用户试卷存储编辑业务对象
|
||||
* @return
|
||||
*/
|
||||
Boolean update(WgzQuestionSave bo);
|
||||
|
||||
/**
|
||||
* 校验并删除数据
|
||||
* @param ids 主键集合
|
||||
* @param isValid 是否校验,true-删除前校验,false-不校验
|
||||
* @return
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
@ -0,0 +1,68 @@
|
||||
package com.ruoyi.wgz.service;
|
||||
|
||||
import com.ruoyi.wgz.domain.WgzQuestionsConfiguration;
|
||||
import com.ruoyi.wgz.bo.WgzQuestionsConfigurationQueryBo;
|
||||
import com.ruoyi.common.core.mybatisplus.core.IServicePlus;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 题库配置Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-02-17
|
||||
*/
|
||||
public interface IWgzQuestionsConfigurationService extends IServicePlus<WgzQuestionsConfiguration> {
|
||||
/**
|
||||
* 查询单个
|
||||
* @return
|
||||
*/
|
||||
WgzQuestionsConfiguration queryById(Long id);
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
*/
|
||||
TableDataInfo<WgzQuestionsConfiguration> queryPageList(WgzQuestionsConfigurationQueryBo bo);
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
*/
|
||||
List<WgzQuestionsConfiguration> queryList(WgzQuestionsConfigurationQueryBo bo);
|
||||
|
||||
/**
|
||||
* 根据新增业务对象插入题库配置
|
||||
* @param bo 题库配置新增业务对象
|
||||
* @return
|
||||
*/
|
||||
Boolean insert(WgzQuestionsConfiguration bo);
|
||||
|
||||
/**
|
||||
* 根据编辑业务对象修改题库配置
|
||||
* @param bo 题库配置编辑业务对象
|
||||
* @return
|
||||
*/
|
||||
Boolean update(WgzQuestionsConfiguration bo);
|
||||
|
||||
/**
|
||||
* 校验并删除数据
|
||||
* @param ids 主键集合
|
||||
* @param isValid 是否校验,true-删除前校验,false-不校验
|
||||
* @return
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
|
||||
/**
|
||||
* 务工者APP相关
|
||||
* =================================================================================================================
|
||||
* =================================================================================================================
|
||||
* =================================================================================================================
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* 根据id查询到具体信息
|
||||
*/
|
||||
WgzQuestionsConfiguration appQueryById(Long id);
|
||||
}
|
@ -0,0 +1,103 @@
|
||||
package com.ruoyi.wgz.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.common.utils.PageUtils;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.wgz.bo.req.WgzQuestionReq;
|
||||
import com.ruoyi.wgz.bo.rests.WgzAppGetTestPaperThree;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.ruoyi.wgz.bo.WgzQuestionBankQueryBo;
|
||||
import com.ruoyi.wgz.domain.WgzQuestionBank;
|
||||
import com.ruoyi.wgz.mapper.WgzQuestionBankMapper;
|
||||
import com.ruoyi.wgz.service.IWgzQuestionBankService;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 题库Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-02-17
|
||||
*/
|
||||
@Service
|
||||
public class WgzQuestionBankServiceImpl extends ServicePlusImpl<WgzQuestionBankMapper, WgzQuestionBank> implements IWgzQuestionBankService {
|
||||
|
||||
@Override
|
||||
public WgzQuestionBank queryById(Long id){
|
||||
return getById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TableDataInfo<WgzQuestionBank> queryPageList(WgzQuestionBankQueryBo bo) {
|
||||
Page<WgzQuestionBank> result = page(PageUtils.buildPage(), buildQueryWrapper(bo));
|
||||
return PageUtils.buildDataInfo(result);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WgzQuestionBank> queryList(WgzQuestionBankQueryBo bo) {
|
||||
return list(buildQueryWrapper(bo));
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<WgzQuestionBank> buildQueryWrapper(WgzQuestionBankQueryBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<WgzQuestionBank> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(bo.getCategoryId() != null, WgzQuestionBank::getCategoryId, bo.getCategoryId());
|
||||
lqw.eq(StrUtil.isNotBlank(bo.getQuestionType()), WgzQuestionBank::getQuestionType, bo.getQuestionType());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean insert(WgzQuestionReq bo) {
|
||||
WgzQuestionBank add = BeanUtil.toBean(bo, WgzQuestionBank.class);
|
||||
validEntityBeforeSave(add);
|
||||
return save(add);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean update(WgzQuestionBank bo) {
|
||||
WgzQuestionBank update = BeanUtil.toBean(bo, WgzQuestionBank.class);
|
||||
validEntityBeforeSave(update);
|
||||
return updateById(update);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*
|
||||
* @param entity 实体类数据
|
||||
*/
|
||||
private void validEntityBeforeSave(WgzQuestionBank entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return removeByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 务工者APP相关
|
||||
* =================================================================================================================
|
||||
* =================================================================================================================
|
||||
* =================================================================================================================
|
||||
*/
|
||||
|
||||
@Override
|
||||
public List<WgzAppGetTestPaperThree> appQueryList(int type, int num) {
|
||||
LambdaQueryWrapper<WgzQuestionBank> last = new LambdaQueryWrapper<WgzQuestionBank>().
|
||||
eq(WgzQuestionBank::getQuestionType, type).
|
||||
last("order by rand() limit " + num);
|
||||
List<WgzQuestionBank> wgzQuestionBanks = baseMapper.selectList(last);
|
||||
List<WgzAppGetTestPaperThree> wgzAppGetTestPaperThrees = new ArrayList<>();
|
||||
BeanUtils.copyProperties(wgzQuestionBanks, wgzAppGetTestPaperThrees);
|
||||
return wgzAppGetTestPaperThrees;
|
||||
}
|
||||
}
|
@ -0,0 +1,84 @@
|
||||
package com.ruoyi.wgz.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.common.utils.PageUtils;
|
||||
import com.ruoyi.common.core.page.PagePlus;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.ruoyi.wgz.bo.WgzQuestionCategoryQueryBo;
|
||||
import com.ruoyi.wgz.domain.WgzQuestionCategory;
|
||||
import com.ruoyi.wgz.mapper.WgzQuestionCategoryMapper;
|
||||
import com.ruoyi.wgz.service.IWgzQuestionCategoryService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 题库_题库类别Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-02-17
|
||||
*/
|
||||
@Service
|
||||
public class WgzQuestionCategoryServiceImpl extends ServicePlusImpl<WgzQuestionCategoryMapper, WgzQuestionCategory> implements IWgzQuestionCategoryService {
|
||||
|
||||
@Override
|
||||
public WgzQuestionCategory queryById(Long id){
|
||||
return getById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TableDataInfo<WgzQuestionCategory> queryPageList(WgzQuestionCategoryQueryBo bo) {
|
||||
Page<WgzQuestionCategory> result = page(PageUtils.buildPage(), buildQueryWrapper(bo));
|
||||
return PageUtils.buildDataInfo(result);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WgzQuestionCategory> queryList(WgzQuestionCategoryQueryBo bo) {
|
||||
return list(buildQueryWrapper(bo));
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<WgzQuestionCategory> buildQueryWrapper(WgzQuestionCategoryQueryBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<WgzQuestionCategory> lqw = Wrappers.lambdaQuery();
|
||||
lqw.like(StrUtil.isNotBlank(bo.getCategoryName()), WgzQuestionCategory::getCategoryName, bo.getCategoryName());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean insert(WgzQuestionCategory bo) {
|
||||
WgzQuestionCategory add = BeanUtil.toBean(bo, WgzQuestionCategory.class);
|
||||
validEntityBeforeSave(add);
|
||||
return save(add);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean update(WgzQuestionCategory bo) {
|
||||
WgzQuestionCategory update = BeanUtil.toBean(bo, WgzQuestionCategory.class);
|
||||
validEntityBeforeSave(update);
|
||||
return updateById(update);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*
|
||||
* @param entity 实体类数据
|
||||
*/
|
||||
private void validEntityBeforeSave(WgzQuestionCategory entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return removeByIds(ids);
|
||||
}
|
||||
}
|
@ -0,0 +1,84 @@
|
||||
package com.ruoyi.wgz.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.common.utils.PageUtils;
|
||||
import com.ruoyi.common.core.page.PagePlus;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.ruoyi.wgz.bo.WgzQuestionSaveQueryBo;
|
||||
import com.ruoyi.wgz.domain.WgzQuestionSave;
|
||||
import com.ruoyi.wgz.mapper.WgzQuestionSaveMapper;
|
||||
import com.ruoyi.wgz.service.IWgzQuestionSaveService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 用户试卷存储Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-02-17
|
||||
*/
|
||||
@Service
|
||||
public class WgzQuestionSaveServiceImpl extends ServicePlusImpl<WgzQuestionSaveMapper, WgzQuestionSave> implements IWgzQuestionSaveService {
|
||||
|
||||
@Override
|
||||
public WgzQuestionSave queryById(Long id){
|
||||
return getById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TableDataInfo<WgzQuestionSave> queryPageList(WgzQuestionSaveQueryBo bo) {
|
||||
Page<WgzQuestionSave> result = page(PageUtils.buildPage(), buildQueryWrapper(bo));
|
||||
return PageUtils.buildDataInfo(result);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WgzQuestionSave> queryList(WgzQuestionSaveQueryBo bo) {
|
||||
return list(buildQueryWrapper(bo));
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<WgzQuestionSave> buildQueryWrapper(WgzQuestionSaveQueryBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<WgzQuestionSave> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(bo.getUserId() != null, WgzQuestionSave::getUserId, bo.getUserId());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean insert(WgzQuestionSave bo) {
|
||||
WgzQuestionSave add = BeanUtil.toBean(bo, WgzQuestionSave.class);
|
||||
validEntityBeforeSave(add);
|
||||
return save(add);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean update(WgzQuestionSave bo) {
|
||||
WgzQuestionSave update = BeanUtil.toBean(bo, WgzQuestionSave.class);
|
||||
validEntityBeforeSave(update);
|
||||
return updateById(update);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*
|
||||
* @param entity 实体类数据
|
||||
*/
|
||||
private void validEntityBeforeSave(WgzQuestionSave entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return removeByIds(ids);
|
||||
}
|
||||
}
|
@ -0,0 +1,95 @@
|
||||
package com.ruoyi.wgz.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.common.utils.PageUtils;
|
||||
import com.ruoyi.common.core.page.PagePlus;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.ruoyi.wgz.bo.WgzQuestionsConfigurationQueryBo;
|
||||
import com.ruoyi.wgz.domain.WgzQuestionsConfiguration;
|
||||
import com.ruoyi.wgz.mapper.WgzQuestionsConfigurationMapper;
|
||||
import com.ruoyi.wgz.service.IWgzQuestionsConfigurationService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 题库配置Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-02-17
|
||||
*/
|
||||
@Service
|
||||
public class WgzQuestionsConfigurationServiceImpl extends ServicePlusImpl<WgzQuestionsConfigurationMapper, WgzQuestionsConfiguration> implements IWgzQuestionsConfigurationService {
|
||||
|
||||
@Override
|
||||
public WgzQuestionsConfiguration queryById(Long id){
|
||||
return getById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TableDataInfo<WgzQuestionsConfiguration> queryPageList(WgzQuestionsConfigurationQueryBo bo) {
|
||||
Page<WgzQuestionsConfiguration> result = page(PageUtils.buildPage(), buildQueryWrapper(bo));
|
||||
return PageUtils.buildDataInfo(result);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WgzQuestionsConfiguration> queryList(WgzQuestionsConfigurationQueryBo bo) {
|
||||
return list(buildQueryWrapper(bo));
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<WgzQuestionsConfiguration> buildQueryWrapper(WgzQuestionsConfigurationQueryBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<WgzQuestionsConfiguration> lqw = Wrappers.lambdaQuery();
|
||||
return lqw;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean insert(WgzQuestionsConfiguration bo) {
|
||||
WgzQuestionsConfiguration add = BeanUtil.toBean(bo, WgzQuestionsConfiguration.class);
|
||||
validEntityBeforeSave(add);
|
||||
return save(add);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean update(WgzQuestionsConfiguration bo) {
|
||||
WgzQuestionsConfiguration update = BeanUtil.toBean(bo, WgzQuestionsConfiguration.class);
|
||||
validEntityBeforeSave(update);
|
||||
return updateById(update);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*
|
||||
* @param entity 实体类数据
|
||||
*/
|
||||
private void validEntityBeforeSave(WgzQuestionsConfiguration entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return removeByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 务工者APP相关
|
||||
* =================================================================================================================
|
||||
* =================================================================================================================
|
||||
* =================================================================================================================
|
||||
*/
|
||||
|
||||
@Override
|
||||
public WgzQuestionsConfiguration appQueryById(Long id) {
|
||||
return baseMapper.selectById(id);
|
||||
}
|
||||
}
|
22
ruoyi-system/src/main/resources/mapper/wgz/bankMenu.sql
Normal file
22
ruoyi-system/src/main/resources/mapper/wgz/bankMenu.sql
Normal file
@ -0,0 +1,22 @@
|
||||
-- 菜单 SQL
|
||||
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('题库', '${parentMenuId}', '1', 'bank', 'wgz/bank/index', 1, 0, 'C', '0', '0', 'wgz:bank:list', '#', 'admin', sysdate(), '', null, '题库菜单');
|
||||
|
||||
-- 按钮父菜单ID
|
||||
SELECT @parentId := LAST_INSERT_ID();
|
||||
|
||||
-- 按钮 SQL
|
||||
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('题库查询', @parentId, '1', '#', '', 1, 0, 'F', '0', '0', 'wgz:bank:query', '#', 'admin', sysdate(), '', null, '');
|
||||
|
||||
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('题库新增', @parentId, '2', '#', '', 1, 0, 'F', '0', '0', 'wgz:bank:add', '#', 'admin', sysdate(), '', null, '');
|
||||
|
||||
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('题库修改', @parentId, '3', '#', '', 1, 0, 'F', '0', '0', 'wgz:bank:edit', '#', 'admin', sysdate(), '', null, '');
|
||||
|
||||
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('题库删除', @parentId, '4', '#', '', 1, 0, 'F', '0', '0', 'wgz:bank:remove', '#', 'admin', sysdate(), '', null, '');
|
||||
|
||||
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('题库导出', @parentId, '5', '#', '', 1, 0, 'F', '0', '0', 'wgz:bank:export', '#', 'admin', sysdate(), '', null, '');
|
22
ruoyi-system/src/main/resources/mapper/wgz/categoryMenu.sql
Normal file
22
ruoyi-system/src/main/resources/mapper/wgz/categoryMenu.sql
Normal file
@ -0,0 +1,22 @@
|
||||
-- 菜单 SQL
|
||||
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('题库_题库类别', '3', '1', 'category', 'wgz/category/index', 1, 0, 'C', '0', '0', 'wgz:category:list', '#', 'admin', sysdate(), '', null, '题库_题库类别菜单');
|
||||
|
||||
-- 按钮父菜单ID
|
||||
SELECT @parentId := LAST_INSERT_ID();
|
||||
|
||||
-- 按钮 SQL
|
||||
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('题库_题库类别查询', @parentId, '1', '#', '', 1, 0, 'F', '0', '0', 'wgz:category:query', '#', 'admin', sysdate(), '', null, '');
|
||||
|
||||
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('题库_题库类别新增', @parentId, '2', '#', '', 1, 0, 'F', '0', '0', 'wgz:category:add', '#', 'admin', sysdate(), '', null, '');
|
||||
|
||||
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('题库_题库类别修改', @parentId, '3', '#', '', 1, 0, 'F', '0', '0', 'wgz:category:edit', '#', 'admin', sysdate(), '', null, '');
|
||||
|
||||
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('题库_题库类别删除', @parentId, '4', '#', '', 1, 0, 'F', '0', '0', 'wgz:category:remove', '#', 'admin', sysdate(), '', null, '');
|
||||
|
||||
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('题库_题库类别导出', @parentId, '5', '#', '', 1, 0, 'F', '0', '0', 'wgz:category:export', '#', 'admin', sysdate(), '', null, '');
|
@ -0,0 +1,22 @@
|
||||
-- 菜单 SQL
|
||||
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('题库配置', '${parentMenuId}', '1', 'configuration', 'wgz/configuration/index', 1, 0, 'C', '0', '0', 'wgz:configuration:list', '#', 'admin', sysdate(), '', null, '题库配置菜单');
|
||||
|
||||
-- 按钮父菜单ID
|
||||
SELECT @parentId := LAST_INSERT_ID();
|
||||
|
||||
-- 按钮 SQL
|
||||
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('题库配置查询', @parentId, '1', '#', '', 1, 0, 'F', '0', '0', 'wgz:configuration:query', '#', 'admin', sysdate(), '', null, '');
|
||||
|
||||
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('题库配置新增', @parentId, '2', '#', '', 1, 0, 'F', '0', '0', 'wgz:configuration:add', '#', 'admin', sysdate(), '', null, '');
|
||||
|
||||
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('题库配置修改', @parentId, '3', '#', '', 1, 0, 'F', '0', '0', 'wgz:configuration:edit', '#', 'admin', sysdate(), '', null, '');
|
||||
|
||||
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('题库配置删除', @parentId, '4', '#', '', 1, 0, 'F', '0', '0', 'wgz:configuration:remove', '#', 'admin', sysdate(), '', null, '');
|
||||
|
||||
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('题库配置导出', @parentId, '5', '#', '', 1, 0, 'F', '0', '0', 'wgz:configuration:export', '#', 'admin', sysdate(), '', null, '');
|
22
ruoyi-system/src/main/resources/mapper/wgz/saveMenu.sql
Normal file
22
ruoyi-system/src/main/resources/mapper/wgz/saveMenu.sql
Normal file
@ -0,0 +1,22 @@
|
||||
-- 菜单 SQL
|
||||
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('用户试卷存储', '${parentMenuId}', '1', 'save', 'wgz/save/index', 1, 0, 'C', '0', '0', 'wgz:save:list', '#', 'admin', sysdate(), '', null, '用户试卷存储菜单');
|
||||
|
||||
-- 按钮父菜单ID
|
||||
SELECT @parentId := LAST_INSERT_ID();
|
||||
|
||||
-- 按钮 SQL
|
||||
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('用户试卷存储查询', @parentId, '1', '#', '', 1, 0, 'F', '0', '0', 'wgz:save:query', '#', 'admin', sysdate(), '', null, '');
|
||||
|
||||
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('用户试卷存储新增', @parentId, '2', '#', '', 1, 0, 'F', '0', '0', 'wgz:save:add', '#', 'admin', sysdate(), '', null, '');
|
||||
|
||||
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('用户试卷存储修改', @parentId, '3', '#', '', 1, 0, 'F', '0', '0', 'wgz:save:edit', '#', 'admin', sysdate(), '', null, '');
|
||||
|
||||
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('用户试卷存储删除', @parentId, '4', '#', '', 1, 0, 'F', '0', '0', 'wgz:save:remove', '#', 'admin', sysdate(), '', null, '');
|
||||
|
||||
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('用户试卷存储导出', @parentId, '5', '#', '', 1, 0, 'F', '0', '0', 'wgz:save:export', '#', 'admin', sysdate(), '', null, '');
|
Reference in New Issue
Block a user