zhangyang 2 жил өмнө
parent
commit
a4e7472a93

+ 14 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/PoTetherController.java

@@ -190,5 +190,19 @@ public class PoTetherController extends BaseController
         }
         return toAjax(poTetherService.deletePoTetherByTetherIdsWithCollection(tetherIds));
     }
+
+    /**
+     * 逻辑删除
+     */
+    @PreAuthorize("@ss.hasPermi('system:tether:remove')")
+    @Log(title = "套系", businessType = BusinessType.DELETE)
+    @DeleteMapping("/delete/{tetherIds}")
+    public AjaxResult delete(@PathVariable Long[] tetherIds)
+    {
+        if (!getUsername().equals("admin")){
+            return AjaxResult.error("删除消息失败当前用户不是管理员");
+        }
+        return toAjax(poTetherService.removePoTetherByTetherIdsWithCollection(tetherIds));
+    }
 }
 

+ 2 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/PoTetherMapper.java

@@ -116,4 +116,6 @@ public interface PoTetherMapper
      * @return
      */
     PoTether checkPostTetherImageUnique(String image);
+
+    void removePoTetherByTetherIdsWithCollection(Long[] tetherIds);
 }

+ 6 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/IPoTetherService.java

@@ -105,5 +105,11 @@ public interface IPoTetherService
      */
     String checkPostTetherImageUnique(TetherVo tetherVo);
 
+    /**
+     * 逻辑删除
+     * @param tetherIds
+     * @return
+     */
+    boolean removePoTetherByTetherIdsWithCollection(Long[] tetherIds);
 }
 

+ 7 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/PoTetherServiceImpl.java

@@ -228,5 +228,12 @@ public class PoTetherServiceImpl implements IPoTetherService
         return UserConstants.UNIQUE;
 
     }
+
+    @Override
+    public boolean removePoTetherByTetherIdsWithCollection(Long[] tetherIds) {
+
+        poTetherMapper.removePoTetherByTetherIdsWithCollection(tetherIds);
+        return true;
+    }
 }
 

+ 5 - 0
ruoyi-system/src/main/resources/mapper/system/PoTetherMapper.xml

@@ -184,6 +184,11 @@
         where tether_id = #{tetherId}
     </update>
 
+<!--    逻辑删除-->
+    <update id="removePoTetherByTetherIdsWithCollection">
+        update  po_tether set del_flag = '1'
+    </update>
+
     <delete id="deletePoTetherByTetherId" parameterType="Long">
         delete from po_tether where tether_id = #{tetherId}
     </delete>