mirror of
https://gitee.com/dromara/RuoYi-Cloud-Plus.git
synced 2025-09-03 11:05:58 +00:00
update 优化 岗位如果绑定了用户则不允许禁用
This commit is contained in:
@@ -51,6 +51,16 @@ public interface UserConstants {
|
||||
*/
|
||||
String DEPT_DISABLE = "1";
|
||||
|
||||
/**
|
||||
* 岗位正常状态
|
||||
*/
|
||||
String POST_NORMAL = "0";
|
||||
|
||||
/**
|
||||
* 岗位停用状态
|
||||
*/
|
||||
String POST_DISABLE = "1";
|
||||
|
||||
/**
|
||||
* 字典正常状态
|
||||
*/
|
||||
|
@@ -1,6 +1,7 @@
|
||||
package com.ruoyi.system.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.ruoyi.common.core.constant.UserConstants;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.web.controller.BaseController;
|
||||
import com.ruoyi.common.excel.utils.ExcelUtil;
|
||||
@@ -105,7 +106,9 @@ public class SysPostController extends BaseController {
|
||||
*/
|
||||
@GetMapping("/optionselect")
|
||||
public R<List<SysPost>> optionselect() {
|
||||
List<SysPost> posts = postService.selectPostAll();
|
||||
SysPost post = new SysPost();
|
||||
post.setStatus(UserConstants.POST_NORMAL);
|
||||
List<SysPost> posts = postService.selectPostList(post);
|
||||
return R.ok(posts);
|
||||
}
|
||||
}
|
||||
|
@@ -147,7 +147,7 @@ public class SysPostServiceImpl implements ISysPostService {
|
||||
for (Long postId : postIds) {
|
||||
SysPost post = selectPostById(postId);
|
||||
if (countUserPostById(postId) > 0) {
|
||||
throw new ServiceException(String.format("%1$s已分配,不能删除", post.getPostName()));
|
||||
throw new ServiceException(String.format("%1$s已分配,不能删除!", post.getPostName()));
|
||||
}
|
||||
}
|
||||
return baseMapper.deleteBatchIds(Arrays.asList(postIds));
|
||||
|
Reference in New Issue
Block a user