diff --git a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/controller/DictController.java b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/controller/DictController.java index 33ee3a4f..2512b391 100644 --- a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/controller/DictController.java +++ b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/controller/DictController.java @@ -113,7 +113,8 @@ public class DictController { @DeleteMapping("/{id}") @PreAuthorize("@pms.hasPermission('sys_dict_del')") public R removeById(@PathVariable Integer id) { - return sysDictService.removeDict(id); + sysDictService.removeDict(id); + return R.ok(); } /** @@ -126,7 +127,8 @@ public class DictController { @SysLog("修改字典") @PreAuthorize("@pms.hasPermission('sys_dict_edit')") public R updateById(@Valid @RequestBody SysDict sysDict) { - return sysDictService.updateDict(sysDict); + sysDictService.updateDict(sysDict); + return R.ok(); } /** diff --git a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/controller/MenuController.java b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/controller/MenuController.java index e3aba959..be4b481b 100644 --- a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/controller/MenuController.java +++ b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/controller/MenuController.java @@ -122,7 +122,7 @@ public class MenuController { @DeleteMapping("/{id}") @PreAuthorize("@pms.hasPermission('sys_menu_del')") public R removeById(@PathVariable Integer id) { - return sysMenuService.removeMenuById(id); + return R.ok(sysMenuService.removeMenuById(id)); } /** diff --git a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/controller/UserController.java b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/controller/UserController.java index c55251e7..7559a01c 100644 --- a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/controller/UserController.java +++ b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/controller/UserController.java @@ -163,7 +163,7 @@ public class UserController { @SysLog("修改个人信息") @PutMapping("/edit") public R updateUserInfo(@Valid @RequestBody UserDTO userDto) { - return userService.updateUserInfo(userDto); + return R.ok(userService.updateUserInfo(userDto)); } /** diff --git a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/SysDictService.java b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/SysDictService.java index 1858d00d..56b21fc3 100755 --- a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/SysDictService.java +++ b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/SysDictService.java @@ -19,7 +19,6 @@ package com.pig4cloud.pig.admin.service; import com.baomidou.mybatisplus.extension.service.IService; import com.pig4cloud.pig.admin.api.entity.SysDict; -import com.pig4cloud.pig.common.core.util.R; /** * 字典表 @@ -35,7 +34,7 @@ public interface SysDictService extends IService { * @param id * @return */ - R removeDict(Integer id); + void removeDict(Integer id); /** * 更新字典 @@ -43,5 +42,5 @@ public interface SysDictService extends IService { * @param sysDict 字典 * @return */ - R updateDict(SysDict sysDict); + void updateDict(SysDict sysDict); } diff --git a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/SysMenuService.java b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/SysMenuService.java index 470a0344..60ac735d 100644 --- a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/SysMenuService.java +++ b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/SysMenuService.java @@ -23,7 +23,6 @@ import com.baomidou.mybatisplus.extension.service.IService; import com.pig4cloud.pig.admin.api.dto.MenuTree; import com.pig4cloud.pig.admin.api.entity.SysMenu; import com.pig4cloud.pig.admin.api.vo.MenuVO; -import com.pig4cloud.pig.common.core.util.R; import java.util.List; import java.util.Set; @@ -49,9 +48,9 @@ public interface SysMenuService extends IService { * 级联删除菜单 * * @param id 菜单ID - * @return 成功、失败 + * @return true成功,false失败 */ - R removeMenuById(Integer id); + Boolean removeMenuById(Integer id); /** * 更新菜单信息 diff --git a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/SysUserService.java b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/SysUserService.java index 972b123e..b54a5248 100644 --- a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/SysUserService.java +++ b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/SysUserService.java @@ -25,7 +25,6 @@ import com.pig4cloud.pig.admin.api.dto.UserDTO; import com.pig4cloud.pig.admin.api.dto.UserInfo; import com.pig4cloud.pig.admin.api.entity.SysUser; import com.pig4cloud.pig.admin.api.vo.UserVO; -import com.pig4cloud.pig.common.core.util.R; import java.util.List; @@ -65,7 +64,7 @@ public interface SysUserService extends IService { * @param userDto 用户信息 * @return Boolean */ - R updateUserInfo(UserDTO userDto); + Boolean updateUserInfo(UserDTO userDto); /** * 更新指定用户信息 diff --git a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/impl/SysDictServiceImpl.java b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/impl/SysDictServiceImpl.java index a0f1eba4..c767495b 100755 --- a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/impl/SysDictServiceImpl.java +++ b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/impl/SysDictServiceImpl.java @@ -26,7 +26,6 @@ import com.pig4cloud.pig.admin.mapper.SysDictMapper; import com.pig4cloud.pig.admin.service.SysDictService; import com.pig4cloud.pig.common.core.constant.CacheConstants; import com.pig4cloud.pig.common.core.constant.enums.DictTypeEnum; -import com.pig4cloud.pig.common.core.util.R; import lombok.RequiredArgsConstructor; import org.springframework.cache.annotation.CacheEvict; import org.springframework.stereotype.Service; @@ -53,14 +52,13 @@ public class SysDictServiceImpl extends ServiceImpl impl @Override @CacheEvict(value = CacheConstants.DICT_DETAILS, allEntries = true) @Transactional(rollbackFor = Exception.class) - public R removeDict(Integer id) { + public void removeDict(Integer id) { SysDict dict = this.getById(id); // 系统内置 Assert.state(!DictTypeEnum.SYSTEM.getType().equals(dict.getSystem()),"系统内置字典项目不能删除"); baseMapper.deleteById(id); dictItemMapper.delete(Wrappers.lambdaQuery() .eq(SysDictItem::getDictId, id)); - return R.ok(); } /** @@ -70,10 +68,10 @@ public class SysDictServiceImpl extends ServiceImpl impl * @return */ @Override - public R updateDict(SysDict dict) { + public void updateDict(SysDict dict) { SysDict sysDict = this.getById(dict.getId()); // 系统内置 Assert.state(!DictTypeEnum.SYSTEM.getType().equals(sysDict.getSystem()),"系统内置字典项目不能修改"); - return R.ok(this.updateById(dict)); + this.updateById(dict); } } diff --git a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/impl/SysMenuServiceImpl.java b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/impl/SysMenuServiceImpl.java index f01b5ef9..a423db95 100644 --- a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/impl/SysMenuServiceImpl.java +++ b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/impl/SysMenuServiceImpl.java @@ -18,7 +18,6 @@ package com.pig4cloud.pig.admin.service.impl; -import cn.hutool.core.collection.CollUtil; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.pig4cloud.pig.admin.api.dto.MenuTree; @@ -32,7 +31,6 @@ import com.pig4cloud.pig.admin.service.SysMenuService; import com.pig4cloud.pig.common.core.constant.CacheConstants; import com.pig4cloud.pig.common.core.constant.CommonConstants; import com.pig4cloud.pig.common.core.constant.enums.MenuTypeEnum; -import com.pig4cloud.pig.common.core.util.R; import lombok.RequiredArgsConstructor; import org.springframework.cache.annotation.CacheEvict; import org.springframework.cache.annotation.Cacheable; @@ -64,10 +62,16 @@ public class SysMenuServiceImpl extends ServiceImpl impl return baseMapper.listMenusByRoleId(roleId); } + /** + * 级联删除菜单 + * + * @param id 菜单ID + * @return true成功,false失败 + */ @Override @Transactional(rollbackFor = Exception.class) @CacheEvict(value = CacheConstants.MENU_DETAILS, allEntries = true) - public R removeMenuById(Integer id) { + public Boolean removeMenuById(Integer id) { // 查询父节点为当前节点的节点 List menuList = this.list(Wrappers.query() .lambda().eq(SysMenu::getParentId, id)); @@ -76,7 +80,7 @@ public class SysMenuServiceImpl extends ServiceImpl impl sysRoleMenuMapper.delete(Wrappers.query() .lambda().eq(SysRoleMenu::getMenuId, id)); //删除当前菜单及其子菜单 - return R.ok(this.removeById(id)); + return this.removeById(id); } @Override diff --git a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/impl/SysUserServiceImpl.java b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/impl/SysUserServiceImpl.java index 3e86af99..dfb9ddd9 100644 --- a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/impl/SysUserServiceImpl.java +++ b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/impl/SysUserServiceImpl.java @@ -36,7 +36,6 @@ import com.pig4cloud.pig.admin.mapper.SysUserMapper; import com.pig4cloud.pig.admin.service.*; import com.pig4cloud.pig.common.core.constant.CacheConstants; import com.pig4cloud.pig.common.core.constant.CommonConstants; -import com.pig4cloud.pig.common.core.util.R; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang.StringUtils; @@ -162,7 +161,7 @@ public class SysUserServiceImpl extends ServiceImpl impl @Override @CacheEvict(value = CacheConstants.USER_DETAILS, key = "#userDto.username") - public R updateUserInfo(UserDTO userDto) { + public Boolean updateUserInfo(UserDTO userDto) { UserVO userVO = baseMapper.getUserVoByUsername(userDto.getUsername()); SysUser sysUser = new SysUser(); @@ -174,7 +173,7 @@ public class SysUserServiceImpl extends ServiceImpl impl sysUser.setPhone(userDto.getPhone()); sysUser.setUserId(userVO.getUserId()); sysUser.setAvatar(userDto.getAvatar()); - return R.ok(this.updateById(sysUser)); + return this.updateById(sysUser); } @Override