jinxia.mo hai 3 semanas
pai
achega
6de19275a4

+ 36 - 0
ie-admin/src/main/java/com/ruoyi/web/controller/front/FrontAdjustWrongController.java

@@ -0,0 +1,36 @@
+package com.ruoyi.web.controller.front;
+
+import com.ruoyi.back.domain.BCustomerQuestionError;
+import com.ruoyi.back.service.IBCustomerQuestionErrorService;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.utils.SecurityUtils;
+import com.ruoyi.common.utils.StringUtils;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Date;
+
+@Api(tags = "04 题目纠错")
+@RestController
+@RequestMapping("front/adjustWrong/")
+public class FrontAdjustWrongController extends BaseController {
+    @Autowired
+    private IBCustomerQuestionErrorService bCustomerQuestionErrorService;
+
+    @ApiOperation("02 题目纠错")
+    @PostMapping(value = "/correctQuestion")
+    @ResponseBody
+    public AjaxResult correctQuestion(@RequestBody BCustomerQuestionError wrongQuestion) {
+        if(StringUtils.isNull(wrongQuestion.getQuestionid())){
+            return AjaxResult.error("题目id不能为空");
+        }
+        wrongQuestion.setCustomercode(String.valueOf(SecurityUtils.getLoginUser().getUserId()));
+        wrongQuestion.setCreateTime(new Date());
+        bCustomerQuestionErrorService.insertBCustomerQuestionError(wrongQuestion);
+        return AjaxResult.success("纠错成功");
+    }
+
+}

+ 91 - 0
ie-system/src/main/java/com/ruoyi/back/domain/BCustomerQuestionError.java

@@ -0,0 +1,91 @@
+package com.ruoyi.back.domain;
+
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.BaseEntity;
+import com.ruoyi.common.core.domain.entity.SysUser;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+/**
+ * 题目纠错对象 b_customer_question_error
+ *
+ * @author mingxue
+ * @date 2021-11-29
+ */
+public class BCustomerQuestionError extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** ID */
+    private Long id;
+
+    /** 客户 */
+    @Excel(name = "客户")
+    private String customercode;
+
+    /** 题目ID */
+    @Excel(name = "题目ID")
+    private String questionid;
+
+    /** 是否解决 */
+    @Excel(name = "是否解决")
+    private Integer status;
+    private SysUser user;
+
+    public SysUser getUser() {
+        return user;
+    }
+
+    public void setUser(SysUser user) {
+        this.user = user;
+    }
+
+    public void setId(Long id)
+    {
+        this.id = id;
+    }
+
+    public Long getId()
+    {
+        return id;
+    }
+    public void setCustomercode(String customercode)
+    {
+        this.customercode = customercode;
+    }
+
+    public String getCustomercode()
+    {
+        return customercode;
+    }
+    public void setQuestionid(String questionid)
+    {
+        this.questionid = questionid;
+    }
+
+    public String getQuestionid()
+    {
+        return questionid;
+    }
+    public void setStatus(Integer status)
+    {
+        this.status = status;
+    }
+
+    public Integer getStatus()
+    {
+        return status;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("customercode", getCustomercode())
+            .append("questionid", getQuestionid())
+            .append("remark", getRemark())
+            .append("createTime", getCreateTime())
+            .append("status", getStatus())
+            .toString();
+    }
+}

+ 62 - 0
ie-system/src/main/java/com/ruoyi/back/mapper/BCustomerQuestionErrorMapper.java

@@ -0,0 +1,62 @@
+package com.ruoyi.back.mapper;
+
+import com.ruoyi.back.domain.BCustomerQuestionError;
+
+import java.util.List;
+
+/**
+ * 题目纠错Mapper接口
+ * 
+ * @author mingxue
+ * @date 2021-11-29
+ */
+public interface BCustomerQuestionErrorMapper 
+{
+    /**
+     * 查询题目纠错
+     * 
+     * @param id 题目纠错ID
+     * @return 题目纠错
+     */
+    public BCustomerQuestionError selectBCustomerQuestionErrorById(Long id);
+
+    /**
+     * 查询题目纠错列表
+     * 
+     * @param bCustomerQuestionError 题目纠错
+     * @return 题目纠错集合
+     */
+    public List<BCustomerQuestionError> selectBCustomerQuestionErrorList(BCustomerQuestionError bCustomerQuestionError);
+
+    /**
+     * 新增题目纠错
+     * 
+     * @param bCustomerQuestionError 题目纠错
+     * @return 结果
+     */
+    public int insertBCustomerQuestionError(BCustomerQuestionError bCustomerQuestionError);
+
+    /**
+     * 修改题目纠错
+     * 
+     * @param bCustomerQuestionError 题目纠错
+     * @return 结果
+     */
+    public int updateBCustomerQuestionError(BCustomerQuestionError bCustomerQuestionError);
+
+    /**
+     * 删除题目纠错
+     * 
+     * @param id 题目纠错ID
+     * @return 结果
+     */
+    public int deleteBCustomerQuestionErrorById(Long id);
+
+    /**
+     * 批量删除题目纠错
+     * 
+     * @param ids 需要删除的数据ID
+     * @return 结果
+     */
+    public int deleteBCustomerQuestionErrorByIds(Long[] ids);
+}

+ 62 - 0
ie-system/src/main/java/com/ruoyi/back/service/IBCustomerQuestionErrorService.java

@@ -0,0 +1,62 @@
+package com.ruoyi.back.service;
+
+import com.ruoyi.back.domain.BCustomerQuestionError;
+
+import java.util.List;
+
+/**
+ * 题目纠错Service接口
+ * 
+ * @author mingxue
+ * @date 2021-11-29
+ */
+public interface IBCustomerQuestionErrorService 
+{
+    /**
+     * 查询题目纠错
+     * 
+     * @param id 题目纠错ID
+     * @return 题目纠错
+     */
+    public BCustomerQuestionError selectBCustomerQuestionErrorById(Long id);
+
+    /**
+     * 查询题目纠错列表
+     * 
+     * @param bCustomerQuestionError 题目纠错
+     * @return 题目纠错集合
+     */
+    public List<BCustomerQuestionError> selectBCustomerQuestionErrorList(BCustomerQuestionError bCustomerQuestionError);
+
+    /**
+     * 新增题目纠错
+     * 
+     * @param bCustomerQuestionError 题目纠错
+     * @return 结果
+     */
+    public int insertBCustomerQuestionError(BCustomerQuestionError bCustomerQuestionError);
+
+    /**
+     * 修改题目纠错
+     * 
+     * @param bCustomerQuestionError 题目纠错
+     * @return 结果
+     */
+    public int updateBCustomerQuestionError(BCustomerQuestionError bCustomerQuestionError);
+
+    /**
+     * 批量删除题目纠错
+     * 
+     * @param ids 需要删除的题目纠错ID
+     * @return 结果
+     */
+    public int deleteBCustomerQuestionErrorByIds(Long[] ids);
+
+    /**
+     * 删除题目纠错信息
+     * 
+     * @param id 题目纠错ID
+     * @return 结果
+     */
+    public int deleteBCustomerQuestionErrorById(Long id);
+}

+ 94 - 0
ie-system/src/main/java/com/ruoyi/back/service/impl/BCustomerQuestionErrorServiceImpl.java

@@ -0,0 +1,94 @@
+package com.ruoyi.back.service.impl;
+
+import com.ruoyi.back.domain.BCustomerQuestionError;
+import com.ruoyi.back.mapper.BCustomerQuestionErrorMapper;
+import com.ruoyi.back.service.IBCustomerQuestionErrorService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 题目纠错Service业务层处理
+ * 
+ * @author mingxue
+ * @date 2021-11-29
+ */
+@Service
+public class BCustomerQuestionErrorServiceImpl implements IBCustomerQuestionErrorService 
+{
+    @Autowired
+    private BCustomerQuestionErrorMapper bCustomerQuestionErrorMapper;
+
+    /**
+     * 查询题目纠错
+     * 
+     * @param id 题目纠错ID
+     * @return 题目纠错
+     */
+    @Override
+    public BCustomerQuestionError selectBCustomerQuestionErrorById(Long id)
+    {
+        return bCustomerQuestionErrorMapper.selectBCustomerQuestionErrorById(id);
+    }
+
+    /**
+     * 查询题目纠错列表
+     * 
+     * @param bCustomerQuestionError 题目纠错
+     * @return 题目纠错
+     */
+    @Override
+    public List<BCustomerQuestionError> selectBCustomerQuestionErrorList(BCustomerQuestionError bCustomerQuestionError)
+    {
+        return bCustomerQuestionErrorMapper.selectBCustomerQuestionErrorList(bCustomerQuestionError);
+    }
+
+    /**
+     * 新增题目纠错
+     * 
+     * @param bCustomerQuestionError 题目纠错
+     * @return 结果
+     */
+    @Override
+    public int insertBCustomerQuestionError(BCustomerQuestionError bCustomerQuestionError)
+    {
+        return bCustomerQuestionErrorMapper.insertBCustomerQuestionError(bCustomerQuestionError);
+    }
+
+    /**
+     * 修改题目纠错
+     * 
+     * @param bCustomerQuestionError 题目纠错
+     * @return 结果
+     */
+    @Override
+    public int updateBCustomerQuestionError(BCustomerQuestionError bCustomerQuestionError)
+    {
+        return bCustomerQuestionErrorMapper.updateBCustomerQuestionError(bCustomerQuestionError);
+    }
+
+    /**
+     * 批量删除题目纠错
+     * 
+     * @param ids 需要删除的题目纠错ID
+     * @return 结果
+     */
+    @Override
+    public int deleteBCustomerQuestionErrorByIds(Long[] ids)
+    {
+        return bCustomerQuestionErrorMapper.deleteBCustomerQuestionErrorByIds(ids);
+    }
+
+    /**
+     * 删除题目纠错信息
+     * 
+     * @param id 题目纠错ID
+     * @return 结果
+     */
+    @Override
+    public int deleteBCustomerQuestionErrorById(Long id)
+    {
+        return bCustomerQuestionErrorMapper.deleteBCustomerQuestionErrorById(id);
+    }
+}

+ 86 - 0
ie-system/src/main/resources/mapper/back/BCustomerQuestionErrorMapper.xml

@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ruoyi.back.mapper.BCustomerQuestionErrorMapper">
+
+    <resultMap type="BCustomerQuestionError" id="BCustomerQuestionErrorResult">
+        <result property="id"    column="id"    />
+        <result property="customercode"    column="customerCode"    />
+        <result property="questionid"    column="questionId"    />
+        <result property="remark"    column="remark"    />
+        <result property="createTime"    column="createTime"    />
+        <result property="status"    column="status"    />
+        <association property="user"    column="customerCode" javaType="SysUser" resultMap="SysUserResult" />
+    </resultMap>
+
+    <resultMap type="SysUser" id="SysUserResult">
+        <id     property="userId"       column="user_id"      />
+        <result property="userName"     column="user_name"    />
+        <result property="nickName"     column="nick_name"    />
+        <result property="phonenumber"  column="phonenumber"  />
+    </resultMap>
+
+    <sql id="selectBCustomerQuestionErrorVo">
+        select bcqe.id, bcqe.customerCode, bcqe.questionId, bcqe.remark, bcqe.createTime, bcqe.status
+             ,u.user_id,u.user_name,u.nick_name,u.phonenumber
+        from b_customer_question_error bcqe
+        LEFT JOIN sys_user u on bcqe.customerCode=u.user_id
+    </sql>
+
+    <select id="selectBCustomerQuestionErrorList" parameterType="BCustomerQuestionError" resultMap="BCustomerQuestionErrorResult">
+        <include refid="selectBCustomerQuestionErrorVo"/>
+        where 1=1
+            <if test="customercode != null  and customercode != ''"> and bcqe.customerCode = #{customercode}</if>
+            <if test="questionid != null  and questionid != ''"> and bcqe.questionId = #{questionid}</if>
+            <if test="createTime != null "> and bcqe.createTime = #{createTime}</if>
+            <if test="status != null "> and bcqe.status = #{status}</if>
+        order by id desc
+    </select>
+
+    <select id="selectBCustomerQuestionErrorById" parameterType="Long" resultMap="BCustomerQuestionErrorResult">
+        <include refid="selectBCustomerQuestionErrorVo"/>
+        where id = #{id}
+    </select>
+
+    <insert id="insertBCustomerQuestionError" parameterType="BCustomerQuestionError" useGeneratedKeys="true" keyProperty="id">
+        insert into b_customer_question_error
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="customercode != null">customerCode,</if>
+            <if test="questionid != null">questionId,</if>
+            <if test="remark != null and remark != ''">remark,</if>
+            <if test="createTime != null">createTime,</if>
+            <if test="status != null">status,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="customercode != null">#{customercode},</if>
+            <if test="questionid != null">#{questionid},</if>
+            <if test="remark != null and remark != ''">#{remark},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="status != null">#{status},</if>
+         </trim>
+    </insert>
+
+    <update id="updateBCustomerQuestionError" parameterType="BCustomerQuestionError">
+        update b_customer_question_error
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="customercode != null">customerCode = #{customercode},</if>
+            <if test="questionid != null">questionId = #{questionid},</if>
+            <if test="remark != null and remark != ''">remark = #{remark},</if>
+            <if test="createTime != null">createTime = #{createTime},</if>
+            <if test="status != null">status = #{status},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteBCustomerQuestionErrorById" parameterType="Long">
+        delete from b_customer_question_error where id = #{id}
+    </delete>
+
+    <delete id="deleteBCustomerQuestionErrorByIds" parameterType="String">
+        delete from b_customer_question_error where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>