Ver Fonte

1、增加同意邀请接口的效验逻辑

rayson há 1 ano atrás
pai
commit
26c88873a9

+ 3 - 0
menduner/menduner-system-api/src/main/java/com/citu/module/menduner/system/enums/ErrorCodeConstants.java

@@ -371,4 +371,7 @@ public interface ErrorCodeConstants {
 
     ErrorCode ENTERPRISE_INVITE_RECORD_PERSON_INFO_NOT_COMPLETE =
             new ErrorCode(1_100_041_011, "请先完善个人基本信息");
+
+    ErrorCode ENTERPRISE_INVITE_RECORD_EXIST_ENTERPRISE =
+            new ErrorCode(1_100_041_012, "无法加入相同的企业");
 }

+ 5 - 0
menduner/menduner-system-biz/src/main/java/com/citu/module/menduner/system/service/invite/EnterpriseInviteRecordServiceImpl.java

@@ -164,6 +164,11 @@ public class EnterpriseInviteRecordServiceImpl implements EnterpriseInviteRecord
                 // 不是管理员 不能操作加入
                 throw exception(ENTERPRISE_INVITE_RECORD_NOT_ADMIN);
             }
+            if(userBind.getEnterpriseId()
+                    .equals(invite.getEnterpriseId())) {
+                // 自己加入自己
+                throw exception(ENTERPRISE_INVITE_RECORD_EXIST_ENTERPRISE);
+            }
             if (enterpriseService.checkHasParent(enterpriseId)) {
                 // 自己的公司已有所属上级
                 throw exception(ENTERPRISE_INVITE_RECORD_EXIST_PARENT);

+ 1 - 0
menduner/menduner-system-biz/src/main/resources/i18n/messages_en_US.properties

@@ -272,3 +272,4 @@
 1_100_041_009=The company already has a superior and cannot be operated as a subsidiary
 1_100_041_010=Already joined the enterprise and cannot be operated repeatedly
 1_100_041_011=Please complete personal basic information first
+1_100_041_012=Cannot join the same enterprise

+ 2 - 1
menduner/menduner-system-biz/src/main/resources/i18n/messages_zh_CN.properties

@@ -274,4 +274,5 @@
 1_100_041_008=不是企业管理员不能操作成为子公司
 1_100_041_009=公司已存在所属上级,不能操作成为子公司
 1_100_041_010=已加入该企业不可重复操作
-1_100_041_011=请先完善个人基本信息
+1_100_041_011=请先完善个人基本信息
+1_100_041_012=无法加入相同的企业