zwq hace 2 años
padre
commit
0e10c3d565

+ 67 - 0
nngkxxdp/src/main/java/com/example/nngkxxdp/controller/RectificationController.java

@@ -0,0 +1,67 @@
+package com.example.nngkxxdp.controller;
+
+import com.example.nngkxxdp.entity.dos.RectificationDO;
+import com.example.nngkxxdp.service.RectificationService;
+import com.example.nngkxxdp.util.Blank;
+import com.example.nngkxxdp.util.ConstStr;
+import com.example.nngkxxdp.util.SendUtil;
+import lombok.AllArgsConstructor;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Map;
+
+/**
+ * (Rectification)控制层
+ *
+ * @author zwq
+ * @Date 2023/01/30 10:46
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("rectification")
+public class RectificationController {
+
+    private final RectificationService rectificationService;
+    
+    @GetMapping("/info")
+    public Map<String,Object> info(String id) {
+        if (Blank.isEmpty(id)) {
+            return SendUtil.send(false, ConstStr.REQUEST_WRONGPARAMS);
+        }
+        return rectificationService.info(id);
+    }
+    
+    @GetMapping("/list")
+    public Map<String,Object> list() {
+        return rectificationService.list();
+    }
+
+    @GetMapping("/page")
+    public Map<String,Object> page(Integer page, Integer limit) {
+        if (!(Blank.isEmpty(page, limit) || page < 0 || limit < 0)) {
+            return SendUtil.send(false, ConstStr.REQUEST_WRONGPARAMS);
+        }
+        return rectificationService.page(page, limit);
+    }
+    
+    @PostMapping("/add")
+    public Map<String,Object> add(@RequestBody RectificationDO rectificationDO) {
+        // TODO 校验参数
+        return rectificationService.add(rectificationDO);
+    }
+    
+    @PostMapping("/update")
+    public Map<String,Object> update(@RequestBody RectificationDO rectificationDO) {
+        // TODO 校验参数
+        if (Blank.isEmpty(rectificationDO.getId())) {
+            return SendUtil.send(false, ConstStr.REQUEST_WRONGPARAMS);
+        }
+        return rectificationService.update(rectificationDO);
+    }
+    
+    @PostMapping("/delete")
+    public Map<String,Object> delete(@RequestBody String id) {
+        return rectificationService.delete(id);
+    }
+
+}

+ 36 - 0
nngkxxdp/src/main/java/com/example/nngkxxdp/dao/RectificationDao.java

@@ -0,0 +1,36 @@
+package com.example.nngkxxdp.dao;
+
+
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+import com.example.nngkxxdp.entity.dos.RectificationDO;
+import com.example.nngkxxdp.entity.vos.RectificationVO;
+
+import java.util.List;
+
+/**
+ * (Rectification)DAO
+ *
+ * @author zwq
+ * @Date 2023/01/30 10:44
+ */
+@Repository
+public interface RectificationDao {
+
+    RectificationDO queryById(@Param("id") String id);
+    
+    RectificationVO info(@Param("id") String id);
+
+    long pageCount();
+    
+    List<RectificationDO> list();
+    
+    List<RectificationVO> page(@Param("startRows") Integer startRows, @Param("limit") Integer limit);
+    
+    Integer add(RectificationDO rectificationDO);
+    
+    Integer update(RectificationDO rectificationDO);
+    
+    Integer delete(@Param("id") String id); 
+
+}

+ 88 - 0
nngkxxdp/src/main/java/com/example/nngkxxdp/entity/dos/RectificationDO.java

@@ -0,0 +1,88 @@
+package com.example.nngkxxdp.entity.dos;
+
+import java.util.Date;
+import java.io.Serializable;
+import lombok.Data;
+
+/**
+ * (Rectification)实体类
+ *
+ * @author zwq
+ * @Date 2023/01/30 10:43
+ */
+@Data
+public class RectificationDO implements Serializable {
+
+    private static final long serialVersionUID = -74151860341749924L;
+    
+    /**
+    * id
+    */
+    private String id;
+    
+    /**
+    * 问题类型【0:功能无法使用 1:内容无法访问 2:信息不更新 3:内容不准确 4:咨询互动不回应 5:错别字 6:虚假伪造内容 7:其它】
+    */
+    private Integer questionType;
+    
+    /**
+    * 问题页面网址
+    */
+    private String errorUrl;
+    
+    /**
+    * 截图
+    */
+    private String picture;
+    
+    /**
+    * 描述
+    */
+    private String questionDescription;
+    
+    /**
+    * 办理状态【0:未处理 1:已处理】
+    */
+    private Integer status;
+    
+    /**
+    * 提交人姓名
+    */
+    private String submitter;
+    
+    /**
+    * 邮箱
+    */
+    private String mail;
+    
+    /**
+    * 手机号
+    */
+    private String phone;
+    
+    /**
+    * 设备类型【0:首页 1:小程序 2:智能问答服务兜底问题 3:政策问答库提问】
+    */
+    private Integer equipment;
+    
+    /**
+    * 创建时间
+    */
+    private Date createTime;
+    
+    /**
+    * 更新时间
+    */
+    private Date updateTime;
+    
+    /**
+    * 办结时间
+    */
+    private Date finishTime;
+    
+    /**
+    * 是否删除【0:未删除 1:删除】
+    */
+    private Integer isdel;
+    
+}

+ 88 - 0
nngkxxdp/src/main/java/com/example/nngkxxdp/entity/vos/RectificationVO.java

@@ -0,0 +1,88 @@
+package com.example.nngkxxdp.entity.vos;
+
+import java.util.Date;
+import java.io.Serializable;
+import lombok.Data;
+
+/**
+ * (Rectification)视图类
+ *
+ * @author zwq
+ * @Date 2023/01/30 10:44
+ */
+@Data
+public class RectificationVO implements Serializable {
+
+    private static final long serialVersionUID = -88315819290369011L;
+
+   /**
+    * id
+    */
+    private String id;
+
+   /**
+    * 问题类型【0:功能无法使用 1:内容无法访问 2:信息不更新 3:内容不准确 4:咨询互动不回应 5:错别字 6:虚假伪造内容 7:其它】
+    */
+    private Integer questionType;
+
+   /**
+    * 问题页面网址
+    */
+    private String errorUrl;
+
+   /**
+    * 截图
+    */
+    private String picture;
+
+   /**
+    * 描述
+    */
+    private String questionDescription;
+
+   /**
+    * 办理状态【0:未处理 1:已处理】
+    */
+    private Integer status;
+
+   /**
+    * 提交人姓名
+    */
+    private String submitter;
+
+   /**
+    * 邮箱
+    */
+    private String mail;
+
+   /**
+    * 手机号
+    */
+    private String phone;
+
+   /**
+    * 设备类型【0:首页 1:小程序 2:智能问答服务兜底问题 3:政策问答库提问】
+    */
+    private Integer equipment;
+
+   /**
+    * 创建时间
+    */
+    private Date createTime;
+
+   /**
+    * 更新时间
+    */
+    private Date updateTime;
+
+   /**
+    * 办结时间
+    */
+    private Date finishTime;
+
+   /**
+    * 是否删除【0:未删除 1:删除】
+    */
+    private Integer isdel;
+
+}

+ 75 - 0
nngkxxdp/src/main/java/com/example/nngkxxdp/service/RectificationService.java

@@ -0,0 +1,75 @@
+package com.example.nngkxxdp.service;
+
+import com.example.nngkxxdp.entity.dos.RectificationDO;
+import com.example.nngkxxdp.entity.vos.RectificationVO;
+import java.util.Map;
+
+/**
+ * (Rectification)表服务接口
+ *
+ * @author zwq
+ * @Date 2023/01/30 10:44
+ */
+public interface RectificationService {
+
+    /**
+     * description: 详情
+     *
+     * @author zwq
+     * @date 2023/01/30 10:44
+     * @param id 主键
+     * return java.util.Map<java.lang.String,java.lang.Object> 数据
+     */
+    Map<String, Object> info(String id);
+    
+    /**
+     * description: 列表
+     *
+     * @author zwq
+     * @date 2023/01/30 10:44
+     * @return java.util.Map<java.lang.String,java.lang.Object> 数据
+     */
+    Map<String, Object> list();
+
+    /**
+     * description: 分页
+     *
+     * @author zwq
+     * @date 2023/01/30 10:44
+     * @param startRows 分页参数
+     * @param limit 分页参数
+     * @return java.util.Map<java.lang.String,java.lang.Object> 数据
+     */
+    Map<String, Object> page(Integer startRows, Integer limit);
+
+    /**
+     * description: 新增
+     *
+     * @author zwq
+     * @date 2023/01/30 10:44
+     * @param rectificationDO 实例对象
+     * @return java.util.Map<java.lang.String,java.lang.Object> 数据
+     */
+    Map<String, Object> add(RectificationDO rectificationDO);
+
+    /**
+     * description: 修改
+     *
+     * @author zwq
+     * @date 2023/01/30 10:44
+     * @param rectificationDO 实例对象
+     * @return java.util.Map<java.lang.String,java.lang.Object> 数据
+     */
+    Map<String, Object> update(RectificationDO rectificationDO);
+
+    /**
+     * description: 通过主键删除数据
+     *
+     * @author zwq
+     * @date 2023/01/30 10:44
+     * @param id 主键
+     * @return java.util.Map<java.lang.String,java.lang.Object> 数据
+     */
+    Map<String, Object> delete(String id);
+
+}

+ 133 - 0
nngkxxdp/src/main/java/com/example/nngkxxdp/service/impl/RectificationServiceImpl.java

@@ -0,0 +1,133 @@
+package com.example.nngkxxdp.service.impl;
+
+import cn.hutool.core.lang.UUID;
+import com.example.nngkxxdp.dao.RectificationDao;
+import com.example.nngkxxdp.service.RectificationService;
+import com.example.nngkxxdp.util.ConstStr;
+import com.example.nngkxxdp.util.SendUtil;
+import org.springframework.stereotype.Service;
+import com.example.nngkxxdp.entity.dos.RectificationDO;
+import com.example.nngkxxdp.entity.vos.RectificationVO;
+
+import javax.annotation.Resource;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * (Rectification)表服务实现类
+ *
+ * @author zwq
+ * @Date 2023/01/30 10:44
+ */
+@Service("rectificationService")
+public class RectificationServiceImpl implements RectificationService {
+
+    @Resource
+    private RectificationDao rectificationDao;
+    
+    /**
+     * description: 详情
+     *
+     * @author zwq
+     * @date 2023/01/30 10:44
+     * @param id 主键
+     * return java.util.Map<java.lang.String,java.lang.Object> 数据
+     */
+    @Override
+    public Map<String, Object> info(String id) {
+        RectificationVO rectificationVO = rectificationDao.info(id);
+        return SendUtil.send(true, ConstStr.RESULT_SUCCESS, rectificationVO);
+    }
+    
+    /**
+     * description: 列表
+     *
+     * @author zwq
+     * @date 2023/01/30 10:44
+     * @return java.util.Map<java.lang.String,java.lang.Object> 数据
+     */
+    @Override
+    public Map<String, Object> list() {
+        return SendUtil.send(true, ConstStr.RESULT_SUCCESS, rectificationDao.list());
+    }
+
+    /**
+     * description: 分页
+     *
+     * @author zwq
+     * @date 2023/01/30 10:44
+     * @param startRows 分页参数
+     * @param limit 分页参数
+     * @return java.util.Map<java.lang.String,java.lang.Object> 数据
+     */
+    @Override
+    public Map<String, Object> page(Integer startRows, Integer limit) {
+        long count = rectificationDao.pageCount();
+        if (count == 0) {
+            return SendUtil.layuiTable(count, null);
+        }
+        startRows = (startRows - 1) * limit;
+        List<RectificationVO> pageList = rectificationDao.page(startRows, limit);
+        if (!pageList.isEmpty()) {
+            return SendUtil.layuiTable(count, pageList);
+        }
+        return SendUtil.send(false, ConstStr.RESULT_FAILED);
+    }
+
+    /**
+     * description: 新增
+     *
+     * @author zwq
+     * @date 2023/01/30 10:44
+     * @param rectificationDO 实例对象
+     * @return java.util.Map<java.lang.String,java.lang.Object> 数据
+     */
+    @Override
+    public Map<String, Object> add(RectificationDO rectificationDO) {
+        // TODO 校验
+        rectificationDO.setId(UUID.randomUUID().toString());
+        rectificationDO.setCreateTime(new Date());
+        rectificationDO.setIsdel(0);
+        if (rectificationDao.add(rectificationDO) <= 0) {
+            return SendUtil.send(false, ConstStr.RESULT_FAILED);
+        }
+        return SendUtil.send(true, ConstStr.RESULT_SUCCESS);
+    }
+
+    /**
+     * description: 修改
+     *
+     * @author zwq
+     * @date 2023/01/30 10:44
+     * @param rectificationDO 实例对象
+     * @return java.util.Map<java.lang.String,java.lang.Object> 数据
+     */
+    @Override
+    public Map<String, Object> update(RectificationDO rectificationDO) {
+        // TODO 校验
+        // 更新
+        rectificationDO.setUpdateTime(new Date());
+        if (rectificationDao.update(rectificationDO) <= 0) {
+            return SendUtil.send(false, ConstStr.RESULT_FAILED);
+        }
+        return SendUtil.send(true, ConstStr.RESULT_SUCCESS);
+    }
+
+    /**
+     * description: 通过主键删除数据
+     *
+     * @author zwq
+     * @date 2023/01/30 10:44
+     * @param id 主键
+     * @return java.util.Map<java.lang.String,java.lang.Object> 数据
+     */
+    @Override
+    public Map<String, Object> delete(String id) {
+        if (rectificationDao.delete(id) <= 0) {
+            return SendUtil.send(false, ConstStr.RESULT_FAILED);
+        }
+        return SendUtil.send(true, ConstStr.RESULT_SUCCESS);
+    }
+
+}

+ 147 - 0
nngkxxdp/src/main/resources/mapper/RectificationDao.xml

@@ -0,0 +1,147 @@
+<?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.example.nngkxxdp.dao.RectificationDao">
+
+    <!--DO-->
+    <resultMap type="com.example.nngkxxdp.entity.dos.RectificationDO" id="RectificationMap">
+        <result property="id" column="id" jdbcType="VARCHAR"/>
+        <result property="questionType" column="question_type" jdbcType="INTEGER"/>
+        <result property="errorUrl" column="error_url" jdbcType="VARCHAR"/>
+        <result property="picture" column="picture" jdbcType="VARCHAR"/>
+        <result property="questionDescription" column="question_description" jdbcType="VARCHAR"/>
+        <result property="status" column="status" jdbcType="INTEGER"/>
+        <result property="submitter" column="submitter" jdbcType="VARCHAR"/>
+        <result property="mail" column="mail" jdbcType="VARCHAR"/>
+        <result property="phone" column="phone" jdbcType="VARCHAR"/>
+        <result property="equipment" column="equipment" jdbcType="INTEGER"/>
+        <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
+        <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
+        <result property="finishTime" column="finish_time" jdbcType="TIMESTAMP"/>
+        <result property="isdel" column="isdel" jdbcType="INTEGER"/>
+    </resultMap>
+    
+    <!--VO-->
+    <resultMap type="com.example.nngkxxdp.entity.vos.RectificationVO" id="RectificationVOMap">
+        <result property="id" column="id" jdbcType="VARCHAR"/>
+        <result property="questionType" column="question_type" jdbcType="INTEGER"/>
+        <result property="errorUrl" column="error_url" jdbcType="VARCHAR"/>
+        <result property="picture" column="picture" jdbcType="VARCHAR"/>
+        <result property="questionDescription" column="question_description" jdbcType="VARCHAR"/>
+        <result property="status" column="status" jdbcType="INTEGER"/>
+        <result property="submitter" column="submitter" jdbcType="VARCHAR"/>
+        <result property="mail" column="mail" jdbcType="VARCHAR"/>
+        <result property="phone" column="phone" jdbcType="VARCHAR"/>
+        <result property="equipment" column="equipment" jdbcType="INTEGER"/>
+        <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
+        <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
+        <result property="finishTime" column="finish_time" jdbcType="TIMESTAMP"/>
+        <result property="isdel" column="isdel" jdbcType="INTEGER"/>
+    </resultMap>
+
+    <!--查询单个(DO)-->
+    <select id="queryById" resultMap="RectificationMap">
+        SELECT
+          id, question_type, error_url, picture, question_description, status, submitter, mail, phone, equipment, create_time, update_time, finish_time, isdel
+        FROM rectification
+        WHERE id = #{id}
+    </select>
+    
+    <!--查询单个(VO)-->
+    <select id="info" resultMap="RectificationVOMap">
+        SELECT
+          id, question_type, error_url, picture, question_description, status, submitter, mail, phone, equipment, create_time, update_time, finish_time, isdel 
+        FROM rectification
+        WHERE id = #{id}
+    </select>
+    
+    <!--分页计数-->
+    <select id="pageCount" resultType="java.lang.Long">
+        SELECT COUNT(*)
+        FROM rectification
+        <where>
+          rectification.isdel = 0
+        </where>
+    </select>
+    
+    <!--所有列表-->
+    <select id="list" resultMap="RectificationVOMap">
+        SELECT
+          id, question_type, error_url, picture, question_description, status, submitter, mail, phone, equipment, create_time, update_time, finish_time, isdel 
+        FROM rectification
+        <where>
+          rectification.isdel = 0
+        </where>
+    </select>
+
+    <!--分页列表-->
+    <select id="page" resultMap="RectificationVOMap">
+        SELECT
+          id, question_type, error_url, picture, question_description, status, submitter, mail, phone, equipment, create_time, update_time, finish_time, isdel 
+        FROM rectification
+        <where>
+          rectification.isdel = 0
+        </where>
+        LIMIT #{startRows}, #{limit}
+    </select>
+
+    <!--新增所有列-->
+    <insert id="add">
+        INSERT INTO rectification(id, question_type, error_url, picture, question_description, status, submitter, mail, phone, equipment, create_time, update_time, finish_time, isdel)
+        VALUES (#{id}, #{questionType}, #{errorUrl}, #{picture}, #{questionDescription}, #{status}, #{submitter}, #{mail}, #{phone}, #{equipment}, #{createTime}, #{updateTime}, #{finishTime}, #{isdel})
+    </insert>
+
+    <!--通过主键修改数据-->
+    <update id="update">
+        UPDATE rectification
+        <set>
+            <if test="questionType != null">
+                question_type = #{questionType},
+            </if>
+            <if test="errorUrl != null and errorUrl != ''">
+                error_url = #{errorUrl},
+            </if>
+            <if test="picture != null and picture != ''">
+                picture = #{picture},
+            </if>
+            <if test="questionDescription != null and questionDescription != ''">
+                question_description = #{questionDescription},
+            </if>
+            <if test="status != null">
+                status = #{status},
+            </if>
+            <if test="submitter != null and submitter != ''">
+                submitter = #{submitter},
+            </if>
+            <if test="mail != null and mail != ''">
+                mail = #{mail},
+            </if>
+            <if test="phone != null and phone != ''">
+                phone = #{phone},
+            </if>
+            <if test="equipment != null">
+                equipment = #{equipment},
+            </if>
+            <if test="createTime != null">
+                create_time = #{createTime},
+            </if>
+            <if test="updateTime != null">
+                update_time = #{updateTime},
+            </if>
+            <if test="finishTime != null">
+                finish_time = #{finishTime},
+            </if>
+            <if test="isdel != null">
+                isdel = #{isdel},
+            </if>
+        </set>
+        WHERE id = #{id}
+    </update>
+
+    <!--通过主键删除-->
+    <delete id="delete">
+        UPDATE rectification
+        SET rectification.isdel = 1
+        WHERE id = #{id}
+    </delete>
+
+</mapper>