Procházet zdrojové kódy

南岸纠错受理办结接口

zwq před 2 roky
rodič
revize
8bd52147d5

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

@@ -125,4 +125,27 @@ public class RectificationController {
         return rectificationService.page(page, limit, type, website, null, null, null ,null, null);
     }
 
+    /**
+     * description: 受理问题
+     * @author zwq
+     * @date 2023/1/30 16:19
+     * @param id 主键
+     * @return java.util.Map<java.lang.String,java.lang.Object>
+     */
+    @PostMapping("/work")
+    public Map<String,Object> work(@RequestBody String id) {
+        return rectificationService.work(id);
+    }
+
+    /**
+     * description: 办结问题
+     * @author zwq
+     * @date 2023/1/30 16:19
+     * @param id 主键
+     * @return java.util.Map<java.lang.String,java.lang.Object>
+     */
+    @PostMapping("/finish")
+    public Map<String,Object> finish(@RequestBody String id) {
+        return rectificationService.finish(id);
+    }
 }

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

@@ -67,4 +67,8 @@ public interface RectificationDao {
 
     Integer delete(@Param("id") String id);
 
+    Integer work(@Param("id") String id);
+
+    Integer finish(@Param("id") String id);
+
 }

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

@@ -41,7 +41,7 @@ public class RectificationDO implements Serializable {
     private String questionDescription;
     
     /**
-    * 办理状态【0:未处理 1:已处理
+    * 办理状态【0:未受理 1:已受理 2:已办结
     */
     private Integer status;
     

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

@@ -41,7 +41,7 @@ public class RectificationVO implements Serializable {
     private String questionDescription;
 
    /**
-    * 办理状态【0:未处理 1:已处理
+    * 办理状态【0:未受理 1:已受理 2:已办结
     */
     private Integer status;
 

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

@@ -82,4 +82,22 @@ public interface RectificationService {
      */
     Map<String, Object> delete(String id);
 
+    /**
+     * description: 受理问题
+     * @author zwq
+     * @date 2023/1/30 16:14
+     * @param id 主键
+     * @return java.util.Map<java.lang.String,java.lang.Object>
+     */
+    Map<String, Object> work(String id);
+
+    /**
+     * description: 办结问题
+     * @author zwq
+     * @date 2023/1/30 16:15
+     * @param id 主键
+     * @return java.util.Map<java.lang.String,java.lang.Object>
+     */
+    Map<String, Object> finish(String id);
+
 }

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

@@ -184,4 +184,44 @@ public class RectificationServiceImpl implements RectificationService {
         return SendUtil.send(true, ConstStr.RESULT_SUCCESS);
     }
 
+    /**
+     * description: 受理问题
+     * @author zwq
+     * @date 2023/1/30 16:15
+     * @param id 主键
+     * @return java.util.Map<java.lang.String,java.lang.Object>
+     */
+    @Override
+    public Map<String, Object> work(String id) {
+        RectificationDO rectificationDO = rectificationDao.queryById(id);
+        // 数据是否存在,是否是未受理状态
+        if (rectificationDO == null || rectificationDO.getStatus() != 0) {
+            return SendUtil.send(false, ConstStr.RESULT_FAILED);
+        }
+        if (rectificationDao.work(id) <= 0) {
+            return SendUtil.send(false, ConstStr.RESULT_FAILED);
+        }
+        return SendUtil.send(true, ConstStr.RESULT_SUCCESS);
+    }
+
+    /**
+     * description: 办结问题
+     * @author zwq
+     * @date 2023/1/30 16:16
+     * @param id 主键
+     * @return java.util.Map<java.lang.String,java.lang.Object>
+     */
+    @Override
+    public Map<String, Object> finish(String id) {
+        RectificationDO rectificationDO = rectificationDao.queryById(id);
+        // 数据是否存在,是否是已受理状态
+        if (rectificationDO == null || rectificationDO.getStatus() != 1) {
+            return SendUtil.send(false, ConstStr.RESULT_FAILED);
+        }
+        if (rectificationDao.finish(id) <= 0) {
+            return SendUtil.send(false, ConstStr.RESULT_FAILED);
+        }
+        return SendUtil.send(true, ConstStr.RESULT_SUCCESS);
+    }
+
 }

+ 21 - 6
nngkxxdp/src/main/resources/mapper/RectificationDao.xml

@@ -60,13 +60,13 @@
         FROM rectification
         <where>
             rectification.isdel = 0
-            <if test="type != null and type != 0">
+            <if test="type != null">
                 AND question_type = #{type}
             </if>
             <if test="url != null and url != ''">
                 AND error_url LIKE CONCAT('%', #{url}, '%')
             </if>
-            <if test="status != null and status != 0">
+            <if test="status != null">
                 AND status = #{status}
             </if>
             <if test="submitter != null and submitter != ''">
@@ -78,7 +78,7 @@
             <if test="phone != null and phone != ''">
                 AND phone LIKE CONCAT('%', #{phone}, '%')
             </if>
-            <if test="equipment != null and equipment != 0">
+            <if test="equipment != null">
                 AND equipment = #{equipment}
             </if>
         </where>
@@ -103,13 +103,13 @@
         FROM rectification
         <where>
             rectification.isdel = 0
-            <if test="type != null and type != 0">
+            <if test="type != null">
                 AND question_type = #{type}
             </if>
             <if test="url != null and url != ''">
                 AND error_url LIKE CONCAT('%', #{url}, '%')
             </if>
-            <if test="status != null and status != 0">
+            <if test="status != null">
                 AND status = #{status}
             </if>
             <if test="submitter != null and submitter != ''">
@@ -121,10 +121,11 @@
             <if test="phone != null and phone != ''">
                 AND phone LIKE CONCAT('%', #{phone}, '%')
             </if>
-            <if test="equipment != null and equipment != 0">
+            <if test="equipment != null">
                 AND equipment = #{equipment}
             </if>
         </where>
+        ORDER BY status, create_time DESC
         LIMIT #{startRows}, #{limit}
     </select>
 
@@ -188,4 +189,18 @@
         WHERE id = #{id}
     </delete>
 
+    <!--通过主键受理-->
+    <delete id="work">
+        UPDATE rectification
+        SET rectification.status = 1
+        WHERE id = #{id}
+    </delete>
+
+    <!--通过主键办结-->
+    <delete id="finish">
+        UPDATE rectification
+        SET rectification.status = 2
+        WHERE id = #{id}
+    </delete>
+
 </mapper>