|
@@ -118,10 +118,8 @@ public class EnterpriseInviteRecordServiceImpl implements EnterpriseInviteRecord
|
|
|
@CacheEvict(cacheNames = {
|
|
|
RedisKeyConstants.MDE_ENTERPRISE_TREE
|
|
|
}, allEntries = true)
|
|
|
- public void consent(AppRecruitEnterpriseInviteConsentReqVO reqVO) {
|
|
|
- LoginUser loginUser = LoginUserContext.get();
|
|
|
- Long enterpriseId = LoginUserContext.getEnterpriseId2(loginUser);
|
|
|
- Long userId = LoginUserContext.getUserId(loginUser);
|
|
|
+ public void jobSeekerConsentToEnterpriseInvite(AppRecruitEnterpriseInviteConsentReqVO reqVO) {
|
|
|
+ Long userId = LoginUserContext.getUserId();
|
|
|
|
|
|
EnterpriseInviteDO invite = inviteService.getByCode(reqVO.getCode());
|
|
|
|
|
@@ -166,8 +164,35 @@ public class EnterpriseInviteRecordServiceImpl implements EnterpriseInviteRecord
|
|
|
userBindService.createUser(userBindDO);
|
|
|
|
|
|
|
|
|
- } else {
|
|
|
+ }
|
|
|
+
|
|
|
+ // 增加邀请记录
|
|
|
+ mapper.insert(
|
|
|
+ EnterpriseInviteRecordDO.builder()
|
|
|
+ .enterpriseId(invite.getEnterpriseId())
|
|
|
+ .userId(userId)
|
|
|
+ .inviteEnterpriseId(invite.getEnterpriseId())
|
|
|
+ .inviteUserId(invite.getUserId())
|
|
|
+ .type(invite.getType())
|
|
|
+ .code(invite.getCode())
|
|
|
+ .build()
|
|
|
+ );
|
|
|
+ }
|
|
|
|
|
|
+ @Override
|
|
|
+ @DSTransactional
|
|
|
+ @CacheEvict(cacheNames = {
|
|
|
+ RedisKeyConstants.MDE_ENTERPRISE_TREE
|
|
|
+ }, allEntries = true)
|
|
|
+ public void enterpriseAdminConsentToSubordinateJoin(AppRecruitEnterpriseInviteConsentReqVO reqVO) {
|
|
|
+ Long enterpriseId = LoginUserContext.getEnterpriseId();
|
|
|
+ Long userId = LoginUserContext.getUserId();
|
|
|
+
|
|
|
+ EnterpriseInviteDO invite = inviteService.getByCode(reqVO.getCode());
|
|
|
+ if (EnterpriseInviteTypeEnum.SUBSIDIARY.getType()
|
|
|
+ .equals(invite.getType())) {
|
|
|
+
|
|
|
+ // 查询是否已经加入
|
|
|
EnterpriseUserBindDO userBind = userBindService
|
|
|
.selectByEnterpriseIdAndUserId(enterpriseId, userId);
|
|
|
|
|
@@ -187,13 +212,12 @@ public class EnterpriseInviteRecordServiceImpl implements EnterpriseInviteRecord
|
|
|
}
|
|
|
// 更改企业的上级
|
|
|
enterpriseService.updateParent(enterpriseId, invite.getEnterpriseId());
|
|
|
- }
|
|
|
|
|
|
+ }
|
|
|
// 增加邀请记录
|
|
|
mapper.insert(
|
|
|
EnterpriseInviteRecordDO.builder()
|
|
|
- .enterpriseId(EnterpriseInviteTypeEnum.COLLEAGUE.getType()
|
|
|
- .equals(invite.getType()) ? invite.getEnterpriseId() : enterpriseId)
|
|
|
+ .enterpriseId(enterpriseId)
|
|
|
.userId(userId)
|
|
|
.inviteEnterpriseId(invite.getEnterpriseId())
|
|
|
.inviteUserId(invite.getUserId())
|
|
@@ -201,5 +225,7 @@ public class EnterpriseInviteRecordServiceImpl implements EnterpriseInviteRecord
|
|
|
.code(invite.getCode())
|
|
|
.build()
|
|
|
);
|
|
|
+
|
|
|
}
|
|
|
+
|
|
|
}
|