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 | 8 | import cn.iocoder.yudao.module.system.controller.admin.dept.vo.post.PostSaveReqVO; |
| 9 | 9 | import cn.iocoder.yudao.module.system.dal.dataobject.dept.PostDO; |
| 10 | 10 | import cn.iocoder.yudao.module.system.dal.mysql.dept.PostMapper; |
| 11 | +import jakarta.annotation.Resource; | |
| 11 | 12 | import org.springframework.stereotype.Service; |
| 12 | 13 | import org.springframework.validation.annotation.Validated; |
| 13 | 14 | |
| 14 | -import jakarta.annotation.Resource; | |
| 15 | 15 | import java.util.Collection; |
| 16 | 16 | import java.util.Collections; |
| 17 | 17 | import java.util.List; |
| ... | ... | @@ -58,10 +58,16 @@ public class PostServiceImpl implements PostService { |
| 58 | 58 | public void deletePost(Long id) { |
| 59 | 59 | // 校验是否存在 |
| 60 | 60 | validatePostExists(id); |
| 61 | - // 删除部门 | |
| 61 | + // 删除岗位 | |
| 62 | 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 | 71 | private void validatePostForCreateOrUpdate(Long id, String name, String code) { |
| 66 | 72 | // 校验自己存在 |
| 67 | 73 | validatePostExists(id); | ... | ... |