|
|
@@ -2,11 +2,14 @@ package com.dk.mdm.service.mst;
|
|
|
|
|
|
import com.dk.common.infrastructure.annotaiton.Pagination;
|
|
|
import com.dk.common.infrastructure.constant.Constant;
|
|
|
+import com.dk.common.infrastructure.enums.ErrorCodeEnum;
|
|
|
import com.dk.common.model.pojo.PageList;
|
|
|
+import com.dk.common.response.ResponseCodeEnum;
|
|
|
import com.dk.common.response.ResponseResultUtil;
|
|
|
import com.dk.common.response.ResponseResultVO;
|
|
|
import com.dk.mdm.infrastructure.convert.mst.RoleConvert;
|
|
|
import com.dk.mdm.infrastructure.util.AuthUtils;
|
|
|
+import com.dk.mdm.model.pojo.mst.DictionaryData;
|
|
|
import com.dk.mdm.model.pojo.mst.Role;
|
|
|
import com.dk.mdm.mapper.mst.RoleMapper;
|
|
|
import com.dk.common.service.BaseService;
|
|
|
@@ -124,6 +127,12 @@ public class RoleService extends BaseService<Role> {
|
|
|
rollbackFor = {Exception.class}
|
|
|
)
|
|
|
public ResponseResultVO<?> updateRole(RoleVo roleVO) {
|
|
|
+
|
|
|
+ Role role1 = roleMapper.selectById(roleVO.getRoleId());
|
|
|
+ if (role1.getSysCode() != null) {
|
|
|
+ //系统预制 无法编辑
|
|
|
+ return ResponseResultUtil.error(ResponseCodeEnum.OPERATE_FAIL.getCode(), ErrorCodeEnum.SYSTEM_PRESET_DATA_UNABLE_TO_OPERATE.getMessage());
|
|
|
+ }
|
|
|
Role role = roleConvert.convertToPo(roleVO);
|
|
|
updateByUuid(role);
|
|
|
if (roleVO.getRoleFunList() != null) {
|
|
|
@@ -177,11 +186,54 @@ public class RoleService extends BaseService<Role> {
|
|
|
rollbackFor = {Exception.class}
|
|
|
)
|
|
|
public ResponseResultVO<?> update(RoleVo roleVO) {
|
|
|
+ Role role1 = roleMapper.selectById(roleVO.getRoleId());
|
|
|
+ if (role1.getSysCode() != null) {
|
|
|
+ //系统预制 无法编辑
|
|
|
+ return ResponseResultUtil.error(ResponseCodeEnum.OPERATE_FAIL.getCode(), ErrorCodeEnum.SYSTEM_PRESET_DATA_UNABLE_TO_OPERATE.getMessage());
|
|
|
+ }
|
|
|
Role role = roleConvert.convertToPo(roleVO);
|
|
|
updateByUuid(role);
|
|
|
return ResponseResultUtil.success();
|
|
|
}
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
+ * @desc : 停用
|
|
|
+ * @author : 于继渤
|
|
|
+ * @date : 2023/1/4 9:39
|
|
|
+ */
|
|
|
+ @Transactional(
|
|
|
+ rollbackFor = {Exception.class}
|
|
|
+ )
|
|
|
+ public ResponseResultVO<Boolean> disable(String id) {
|
|
|
+ Role role = roleMapper.selectById(id);
|
|
|
+ if (role.getSysCode() != null) {
|
|
|
+ //系统预制 无法编辑
|
|
|
+ return ResponseResultUtil.error(ResponseCodeEnum.OPERATE_FAIL.getCode(), ErrorCodeEnum.SYSTEM_PRESET_DATA_UNABLE_TO_OPERATE.getMessage());
|
|
|
+ }
|
|
|
+ super.disable(id);
|
|
|
+
|
|
|
+ return ResponseResultUtil.success();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @desc : 启用
|
|
|
+ * @author : 于继渤
|
|
|
+ * @date : 2023/1/4 9:39
|
|
|
+ */
|
|
|
+ @Transactional(
|
|
|
+ rollbackFor = {Exception.class}
|
|
|
+ )
|
|
|
+ public ResponseResultVO<Boolean> enable(String id) {
|
|
|
+ Role role = roleMapper.selectById(id);
|
|
|
+ if (role.getSysCode() != null) {
|
|
|
+ //系统预制 无法编辑
|
|
|
+ return ResponseResultUtil.error(ResponseCodeEnum.OPERATE_FAIL.getCode(), ErrorCodeEnum.SYSTEM_PRESET_DATA_UNABLE_TO_OPERATE.getMessage());
|
|
|
+ }
|
|
|
+ super.enable(id);
|
|
|
+
|
|
|
+ return ResponseResultUtil.success();
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
}
|