Commit ce69fd8ab257d89751ac91a496855dcb1faece46
1 parent
777d64f0
feat: system 模块新增批量删除接口
Showing
1 changed file
with
8 additions
and
2 deletions
yudao-module-system/src/main/java/cn/iocoder/yudao/module/system/service/dept/PostServiceImpl.java
| @@ -8,10 +8,10 @@ import cn.iocoder.yudao.module.system.controller.admin.dept.vo.post.PostPageReqV | @@ -8,10 +8,10 @@ import cn.iocoder.yudao.module.system.controller.admin.dept.vo.post.PostPageReqV | ||
| 8 | import cn.iocoder.yudao.module.system.controller.admin.dept.vo.post.PostSaveReqVO; | 8 | import cn.iocoder.yudao.module.system.controller.admin.dept.vo.post.PostSaveReqVO; |
| 9 | import cn.iocoder.yudao.module.system.dal.dataobject.dept.PostDO; | 9 | import cn.iocoder.yudao.module.system.dal.dataobject.dept.PostDO; |
| 10 | import cn.iocoder.yudao.module.system.dal.mysql.dept.PostMapper; | 10 | import cn.iocoder.yudao.module.system.dal.mysql.dept.PostMapper; |
| 11 | +import jakarta.annotation.Resource; | ||
| 11 | import org.springframework.stereotype.Service; | 12 | import org.springframework.stereotype.Service; |
| 12 | import org.springframework.validation.annotation.Validated; | 13 | import org.springframework.validation.annotation.Validated; |
| 13 | 14 | ||
| 14 | -import jakarta.annotation.Resource; | ||
| 15 | import java.util.Collection; | 15 | import java.util.Collection; |
| 16 | import java.util.Collections; | 16 | import java.util.Collections; |
| 17 | import java.util.List; | 17 | import java.util.List; |
| @@ -58,10 +58,16 @@ public class PostServiceImpl implements PostService { | @@ -58,10 +58,16 @@ public class PostServiceImpl implements PostService { | ||
| 58 | public void deletePost(Long id) { | 58 | public void deletePost(Long id) { |
| 59 | // 校验是否存在 | 59 | // 校验是否存在 |
| 60 | validatePostExists(id); | 60 | validatePostExists(id); |
| 61 | - // 删除部门 | 61 | + // 删除岗位 |
| 62 | postMapper.deleteById(id); | 62 | postMapper.deleteById(id); |
| 63 | } | 63 | } |
| 64 | 64 | ||
| 65 | + @Override | ||
| 66 | + public void deletePostList(List<Long> ids) { | ||
| 67 | + // 删除岗位 | ||
| 68 | + postMapper.deleteByIds(ids); | ||
| 69 | + } | ||
| 70 | + | ||
| 65 | private void validatePostForCreateOrUpdate(Long id, String name, String code) { | 71 | private void validatePostForCreateOrUpdate(Long id, String name, String code) { |
| 66 | // 校验自己存在 | 72 | // 校验自己存在 |
| 67 | validatePostExists(id); | 73 | validatePostExists(id); |