From 9ee2e3d725961564f8abda5cb531042767bcf59a Mon Sep 17 00:00:00 2001 From: yinzuomei <57602893@qq.com> Date: Sat, 11 Apr 2020 12:54:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A8=E8=8D=90=E7=BE=A4=E8=BF=94=E5=8F=82?= =?UTF-8?q?=E6=96=B0=E5=A2=9Estatus,ErrorCode=E6=B7=BB=E5=8A=A0=E6=B3=A8?= =?UTF-8?q?=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/entity/SysLogErrorEntity.java | 2 +- .../commons/tools/exception/ErrorCode.java | 81 +++++++++++++++++++ .../tools/exception/RenExceptionHandler.java | 4 +- .../epmet/commons/tools/log/SysLogError.java | 2 +- .../group/result/RecommendGroupResultDTO.java | 5 ++ .../service/impl/ResiGroupServiceImpl.java | 8 ++ .../member/dao/GroupMemeberOperationDao.java | 11 +++ .../service/GroupMemeberOperationService.java | 11 +++ .../GroupMemeberOperationServiceImpl.java | 13 +++ .../member/GroupMemeberOperationDao.xml | 14 ++++ 10 files changed, 147 insertions(+), 4 deletions(-) diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/entity/SysLogErrorEntity.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/entity/SysLogErrorEntity.java index d408b6da24..9e6e78784c 100644 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/entity/SysLogErrorEntity.java +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/entity/SysLogErrorEntity.java @@ -62,7 +62,7 @@ public class SysLogErrorEntity implements Serializable { /** * 创建者 */ - private Long creator; + private String creator; /** * 创建时间 */ diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/ErrorCode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/ErrorCode.java index 1e124f87b0..55e30ac1c3 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/ErrorCode.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/ErrorCode.java @@ -18,26 +18,107 @@ package com.epmet.commons.tools.exception; * @since 1.0.0 */ public interface ErrorCode { + /** + * 服务器内部异常 + */ int INTERNAL_SERVER_ERROR = 500; + /** + * 未授权 + */ int UNAUTHORIZED = 401; + + /** + * 拒绝访问,没有权限 + */ int FORBIDDEN = 403; + /** + * {0}不能为空 + */ int NOT_NULL = 10001; + + /** + * 数据库中已存在该记录 + */ int DB_RECORD_EXISTS = 10002; + + /** + * 获取参数失败 + */ int PARAMS_GET_ERROR = 10003; + + /** + * 账号或密码错误 + */ int ACCOUNT_PASSWORD_ERROR = 10004; + + /** + * 账号已被停用 + */ int ACCOUNT_DISABLE = 10005; + + /** + * 唯一标识不能为空 + */ int IDENTIFIER_NOT_NULL = 10006; + + /** + * 验证码不正确 + */ int CAPTCHA_ERROR = 10007; + + /** + * 先删除子菜单或按钮 + */ int SUB_MENU_EXIST = 10008; + + /** + * 原密码不正确 + */ int PASSWORD_ERROR = 10009; + + /** + * 账号不存在 + */ int ACCOUNT_NOT_EXIST = 10010; + + /** + * 上级部门选择错误 + */ int SUPERIOR_DEPT_ERROR = 10011; + + /** + * 上级菜单不能为自身 + */ int SUPERIOR_MENU_ERROR = 10012; + + /** + * 数据权限接口,只能是Map类型参数 + */ int DATA_SCOPE_PARAMS_ERROR = 10013; + + /** + * 请先删除下级部门 + */ int DEPT_SUB_DELETE_ERROR = 10014; + + /** + * 请先删除部门下的用户 + */ int DEPT_USER_DELETE_ERROR = 10015; + + /** + * 参数格式不正确,请使用JSON格式 + */ int JSON_FORMAT_ERROR = 10016; + + /** + * 上级区域选择错误 + */ int SUPERIOR_REGION_ERROR = 10017; + + /** + * 请先删除下级区域 + */ int REGION_SUB_DELETE_ERROR = 10018; } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/RenExceptionHandler.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/RenExceptionHandler.java index 2fafc0cd81..6896d99dd5 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/RenExceptionHandler.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/RenExceptionHandler.java @@ -14,7 +14,7 @@ import com.epmet.commons.tools.config.ModuleConfig; import com.epmet.commons.tools.log.SysLogError; import com.epmet.commons.tools.log.enums.LogTypeEnum; import com.epmet.commons.tools.log.producer.LogProducer; -import com.epmet.commons.tools.security.user.SecurityUser; +import com.epmet.commons.tools.security.user.LoginUserUtil; import com.epmet.commons.tools.utils.HttpContextUtils; import com.epmet.commons.tools.utils.IpUtils; import com.epmet.commons.tools.utils.Result; @@ -93,8 +93,8 @@ public class RenExceptionHandler { } //登录用户ID - log.setCreator(SecurityUser.getUserId()); + log.setCreator(LoginUserUtil.getLoginUserId()); //异常信息 log.setErrorInfo(ExceptionUtils.getErrorStackTrace(ex)); diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/log/SysLogError.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/log/SysLogError.java index 3b002a399f..4108944cb5 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/log/SysLogError.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/log/SysLogError.java @@ -56,7 +56,7 @@ public class SysLogError extends BaseLog { /** * 创建者 */ - private Long creator; + private String creator; /** * 创建时间 */ diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/RecommendGroupResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/RecommendGroupResultDTO.java index 49918db469..1c2fb006a0 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/RecommendGroupResultDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/RecommendGroupResultDTO.java @@ -38,4 +38,9 @@ public class RecommendGroupResultDTO implements Serializable { */ private Integer totalPartyMember; + /** + * under_auditting审核中、rejected已拒绝的前端显示加入 + */ + private String status=""; + } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java index 85c11e2858..ee936b3911 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java @@ -19,6 +19,7 @@ package com.epmet.modules.group.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.api.R; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.EpmetRoleKeyConstant; import com.epmet.commons.tools.constant.FieldConstant; @@ -186,6 +187,13 @@ public class ResiGroupServiceImpl extends BaseServiceImpl recommendGroupList = baseDao.selectListRecommendGroup(recommendGroupFormDTO); + for (RecommendGroupResultDTO recommendGroupResultDTO : recommendGroupList) { + GroupMemeberOperationDTO groupMemeberOperationDTO = groupMemeberOperationService.selectLatestRecord(recommendGroupResultDTO.getGroupId(), + recommendGroupFormDTO.getUserId()); + if (null != groupMemeberOperationDTO) { + recommendGroupResultDTO.setStatus(groupMemeberOperationDTO.getOperateStatus()); + } + } return new Result>().ok(recommendGroupList); } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/dao/GroupMemeberOperationDao.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/dao/GroupMemeberOperationDao.java index c2d4bc16aa..8d56bd49af 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/dao/GroupMemeberOperationDao.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/dao/GroupMemeberOperationDao.java @@ -21,6 +21,7 @@ import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.modules.member.entity.GroupMemeberOperationEntity; import com.epmet.resi.group.dto.member.GroupMemeberOperationDTO; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; /** * 组成员出入群记录表 @@ -39,4 +40,14 @@ public interface GroupMemeberOperationDao extends BaseDao + +