Эх сурвалжийг харах

Merge branch 'master' of ssh://192.168.8.213:10022/miaxis/zzjs

Althars123 4 жил өмнө
parent
commit
a7d910a6a8

+ 109 - 0
zzjs-admin/src/main/java/com/miaxis/app/controller/question/QuestionInfoController.java

@@ -0,0 +1,109 @@
+package com.miaxis.app.controller.question;
+
+import com.miaxis.common.annotation.Log;
+import com.miaxis.common.core.controller.BaseController;
+import com.miaxis.common.core.domain.Response;
+import com.miaxis.common.core.page.ResponsePageInfo;
+import com.miaxis.common.enums.BusinessTypeEnum;
+import com.miaxis.common.utils.poi.ExcelUtil;
+import com.miaxis.question.domain.QuestionInfo;
+import com.miaxis.question.service.IQuestionInfoService;
+import io.swagger.annotations.*;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * 【题库】Controller
+ *
+ * @author miaxis
+ * @date 2021-03-11
+ */
+@RestController
+@RequestMapping("/question/info")
+@Api(tags={"【app-题库】"})
+public class QuestionInfoController extends BaseController{
+    @Autowired
+    private IQuestionInfoService questionInfoService;
+
+    /**
+     * 查询题库列表
+     */
+    @PreAuthorize("@ss.hasPermi('question:info:list')")
+    @GetMapping("/list")
+    @ApiOperation("查询题库列表")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "pageNum",value = "当前页码" ,dataType = "int", paramType = "query", required = false),
+            @ApiImplicitParam(name = "pageSize",value = "每页数据量" , dataType = "int", paramType = "query", required = false),
+    })
+    public ResponsePageInfo<QuestionInfo> list(@ModelAttribute QuestionInfo questionInfo){
+        startPage();
+        List<QuestionInfo> list = questionInfoService.selectQuestionInfoList(questionInfo);
+        return toResponsePageInfo(list);
+    }
+
+    /**
+     * 导出题库列表
+     */
+    @PreAuthorize("@ss.hasPermi('question:info:export')")
+    @Log(title = "题库", businessType = BusinessTypeEnum.EXPORT)
+    @GetMapping("/export")
+    @ApiOperation("导出题库列表Excel")
+    public Response<String> export(@ModelAttribute QuestionInfo questionInfo){
+        List<QuestionInfo> list = questionInfoService.selectQuestionInfoList(questionInfo);
+        ExcelUtil<QuestionInfo> util = new ExcelUtil<QuestionInfo>(QuestionInfo.class);
+        return util.exportExcel(list, "info");
+    }
+
+    /**
+     * 获取题库详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('question:info:query')")
+    @GetMapping(value = "/{id}")
+    @ApiOperation("获取题库详细信息")
+    public Response<QuestionInfo> getInfo(
+            @ApiParam(name = "id", value = "题库参数", required = true)
+            @PathVariable("id") Long id
+    ){
+        return Response.success(questionInfoService.getById(id));
+    }
+
+    /**
+     * 新增题库
+     */
+    @PreAuthorize("@ss.hasPermi('question:info:add')")
+    @Log(title = "题库", businessType = BusinessTypeEnum.INSERT)
+    @PostMapping
+    @ApiOperation("新增题库")
+    public Response<Integer> add(@RequestBody QuestionInfo questionInfo){
+        return toResponse(questionInfoService.save(questionInfo) ? 1 : 0);
+    }
+
+    /**
+     * 修改题库
+     */
+    @PreAuthorize("@ss.hasPermi('question:info:edit')")
+    @Log(title = "题库", businessType = BusinessTypeEnum.UPDATE)
+    @PutMapping
+    @ApiOperation("修改题库")
+    public Response<Integer> edit(@RequestBody QuestionInfo questionInfo){
+        return toResponse(questionInfoService.updateById(questionInfo) ? 1 : 0);
+    }
+
+    /**
+     * 删除题库
+     */
+    @PreAuthorize("@ss.hasPermi('question:info:remove')")
+    @Log(title = "题库", businessType = BusinessTypeEnum.DELETE)
+	@DeleteMapping("/{ids}")
+    @ApiOperation("删除题库")
+    public  Response<Integer> remove(
+            @ApiParam(name = "ids", value = "题库ids参数", required = true)
+            @PathVariable Long[] ids
+    ){
+        return toResponse(questionInfoService.removeByIds(Arrays.asList(ids)) ? 1 : 0);
+    }
+}

+ 40 - 0
zzjs-service/src/main/java/com/miaxis/newgzpt/dto/GzptUserInfoDTO.java

@@ -0,0 +1,40 @@
+package com.miaxis.newgzpt.dto;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * <p>
+ * 学员基本信息表
+ * </p>
+ *
+ * @author ${author}
+ * @since 2021-03-09
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+public class GzptUserInfoDTO implements Serializable {
+
+
+    @ApiModelProperty(value = "登录账号")
+    private String logincode;
+
+    @ApiModelProperty(value = "登录密码 MD5加密")
+    private String password;
+
+    @ApiModelProperty(value = "地区编号")
+    @TableField("CITY")
+    private String city;
+
+
+
+}

+ 242 - 0
zzjs-service/src/main/java/com/miaxis/question/domain/QuestionInfo.java

@@ -0,0 +1,242 @@
+package com.miaxis.question.domain;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.miaxis.common.annotation.Excel;
+import com.miaxis.common.core.domain.BaseEntity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.miaxis.common.core.domain.BaseBusinessEntity;
+import lombok.Data;
+/**
+ * 题库对象 question_info
+ *
+ * @author miaxis
+ * @date 2021-03-11
+ */
+@Data
+@TableName("question_info")
+@ApiModel(value = "QuestionInfo", description = "题库对象 question_info")
+public class QuestionInfo extends BaseBusinessEntity{
+    private static final long serialVersionUID = 1L;
+
+    /** 1 */
+    @TableId(value = "id")
+    @ApiModelProperty(value = "1")
+    private Long id;
+
+    /** 1 */
+    @Excel(name = "1")
+    @TableField("question_id")
+    @ApiModelProperty(value = "1")
+    private Long questionId;
+
+    /** 2 */
+    @Excel(name = "2")
+    @TableField("media_type")
+    @ApiModelProperty(value = "2")
+    private Long mediaType;
+
+    /** 3 */
+    @Excel(name = "3")
+    @TableField("chapter_id")
+    @ApiModelProperty(value = "3")
+    private Long chapterId;
+
+    /** 4 */
+    @Excel(name = "4")
+    @TableField("label")
+    @ApiModelProperty(value = "4")
+    private String label;
+
+    /** 5 */
+    @Excel(name = "5")
+    @TableField("question")
+    @ApiModelProperty(value = "5")
+    private byte[] question;
+
+    /** 6 */
+    @Excel(name = "6")
+    @TableField("media_key")
+    @ApiModelProperty(value = "6")
+    private String mediaKey;
+
+    /** 7 */
+    @Excel(name = "7")
+    @TableField("answer")
+    @ApiModelProperty(value = "7")
+    private Long answer;
+
+    /** 8 */
+    @Excel(name = "8")
+    @TableField("option_a")
+    @ApiModelProperty(value = "8")
+    private String optionA;
+
+    /** 9 */
+    @Excel(name = "9")
+    @TableField("option_b")
+    @ApiModelProperty(value = "9")
+    private String optionB;
+
+    /** 10 */
+    @Excel(name = "10")
+    @TableField("option_c")
+    @ApiModelProperty(value = "10")
+    private String optionC;
+
+    /** 11 */
+    @Excel(name = "11")
+    @TableField("option_d")
+    @ApiModelProperty(value = "11")
+    private String optionD;
+
+    /** 12 */
+    @Excel(name = "12")
+    @TableField("option_e")
+    @ApiModelProperty(value = "12")
+    private String optionE;
+
+    /** 13 */
+    @Excel(name = "13")
+    @TableField("option_f")
+    @ApiModelProperty(value = "13")
+    private String optionF;
+
+    /** 13 */
+    @Excel(name = "13")
+    @TableField("option_g")
+    @ApiModelProperty(value = "13")
+    private String optionG;
+
+    /** 13 */
+    @Excel(name = "13")
+    @TableField("option_h")
+    @ApiModelProperty(value = "13")
+    private String optionH;
+
+    /** 1 */
+    @Excel(name = "1")
+    @TableField("explain")
+    @ApiModelProperty(value = "1")
+    private byte[] explain;
+
+    /** 1 */
+    @Excel(name = "1")
+    @TableField("concise_explain")
+    @ApiModelProperty(value = "1")
+    private byte[] conciseExplain;
+
+    /** 1 */
+    @Excel(name = "1")
+    @TableField("keywords")
+    @ApiModelProperty(value = "1")
+    private byte[] keywords;
+
+    /** 1 */
+    @Excel(name = "1")
+    @TableField("assured_keywords")
+    @ApiModelProperty(value = "1")
+    private byte[] assuredKeywords;
+
+    /** 1 */
+    @Excel(name = "1")
+    @TableField("illiteracy_explain")
+    @ApiModelProperty(value = "1")
+    private byte[] illiteracyExplain;
+
+    /** 1 */
+    @Excel(name = "1")
+    @TableField("illiteracy_keywords")
+    @ApiModelProperty(value = "1")
+    private byte[] illiteracyKeywords;
+
+    /** 1 */
+    @Excel(name = "1")
+    @TableField("difficulty")
+    @ApiModelProperty(value = "1")
+    private Long difficulty;
+
+    /** 1 */
+    @Excel(name = "1")
+    @TableField("wrong_rate")
+    @ApiModelProperty(value = "1")
+    private Long wrongRate;
+
+    /** 1 */
+    @Excel(name = "1")
+    @TableField("option_type")
+    @ApiModelProperty(value = "1")
+    private Long optionType;
+
+    /** 1 */
+    @Excel(name = "1")
+    @TableField("knack_keyword")
+    @ApiModelProperty(value = "1")
+    private byte[] knackKeyword;
+
+    /** 1 */
+    @Excel(name = "1")
+    @TableField("knack_img_url")
+    @ApiModelProperty(value = "1")
+    private byte[] knackImgUrl;
+
+    /** 1 */
+    @Excel(name = "1")
+    @TableField("knack_detail")
+    @ApiModelProperty(value = "1")
+    private byte[] knackDetail;
+
+    /** 1 */
+    @Excel(name = "1")
+    @TableField("knack_voice_txt")
+    @ApiModelProperty(value = "1")
+    private byte[] knackVoiceTxt;
+
+    /** 1 */
+    @Excel(name = "1")
+    @TableField("m")
+    @ApiModelProperty(value = "1")
+    private Long m;
+
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("questionId", getQuestionId())
+            .append("mediaType", getMediaType())
+            .append("chapterId", getChapterId())
+            .append("label", getLabel())
+            .append("question", getQuestion())
+            .append("mediaKey", getMediaKey())
+            .append("answer", getAnswer())
+            .append("optionA", getOptionA())
+            .append("optionB", getOptionB())
+            .append("optionC", getOptionC())
+            .append("optionD", getOptionD())
+            .append("optionE", getOptionE())
+            .append("optionF", getOptionF())
+            .append("optionG", getOptionG())
+            .append("optionH", getOptionH())
+            .append("explain", getExplain())
+            .append("conciseExplain", getConciseExplain())
+            .append("keywords", getKeywords())
+            .append("assuredKeywords", getAssuredKeywords())
+            .append("illiteracyExplain", getIlliteracyExplain())
+            .append("illiteracyKeywords", getIlliteracyKeywords())
+            .append("difficulty", getDifficulty())
+            .append("wrongRate", getWrongRate())
+            .append("optionType", getOptionType())
+            .append("knackKeyword", getKnackKeyword())
+            .append("knackImgUrl", getKnackImgUrl())
+            .append("knackDetail", getKnackDetail())
+            .append("knackVoiceTxt", getKnackVoiceTxt())
+            .append("m", getM())
+            .toString();
+    }
+}

+ 22 - 0
zzjs-service/src/main/java/com/miaxis/question/mapper/QuestionInfoMapper.java

@@ -0,0 +1,22 @@
+package com.miaxis.question.mapper;
+
+import java.util.List;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.miaxis.question.domain.QuestionInfo;
+
+/**
+ * 题库Mapper接口
+ *
+ * @author miaxis
+ * @date 2021-03-11
+ */
+public interface QuestionInfoMapper extends BaseMapper<QuestionInfo> {
+    /**
+     * 查询题库列表
+     *
+     * @param questionInfo 题库
+     * @return 题库集合
+     */
+    public List<QuestionInfo> selectQuestionInfoList(QuestionInfo questionInfo);
+
+}

+ 21 - 0
zzjs-service/src/main/java/com/miaxis/question/service/IQuestionInfoService.java

@@ -0,0 +1,21 @@
+package com.miaxis.question.service;
+
+import java.util.List;
+import com.miaxis.question.domain.QuestionInfo;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * 题库Service接口
+ *
+ * @author miaxis
+ * @date 2021-03-11
+ */
+public interface IQuestionInfoService extends IService<QuestionInfo>{
+    /**
+     * 查询题库列表
+     *
+     * @param questionInfo 题库
+     * @return 题库集合
+     */
+    public List<QuestionInfo> selectQuestionInfoList(QuestionInfo questionInfo);
+}

+ 35 - 0
zzjs-service/src/main/java/com/miaxis/question/service/impl/QuestionInfoServiceImpl.java

@@ -0,0 +1,35 @@
+package com.miaxis.question.service.impl;
+
+import java.util.List;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.apache.commons.lang3.StringUtils;
+import com.miaxis.question.mapper.QuestionInfoMapper;
+import com.miaxis.question.domain.QuestionInfo;
+import com.miaxis.question.service.IQuestionInfoService;
+
+/**
+ * 题库Service业务层处理
+ *
+ * @author miaxis
+ * @date 2021-03-11
+ */
+@Service
+public class QuestionInfoServiceImpl extends ServiceImpl<QuestionInfoMapper, QuestionInfo> implements IQuestionInfoService {
+    @Autowired
+    private QuestionInfoMapper questionInfoMapper;
+
+    /**
+     * 查询题库列表
+     *
+     * @param questionInfo 题库
+     * @return 题库
+     */
+    @Override
+    public List<QuestionInfo> selectQuestionInfoList(QuestionInfo questionInfo){
+        return questionInfoMapper.selectQuestionInfoList(questionInfo);
+    }
+}