bdLeader 邀请修改
This commit is contained in:
parent
f83883bf7d
commit
5ce9a5774e
@ -107,7 +107,12 @@ public enum TeamErrorCode implements IResponseErrorCode {
|
|||||||
*/
|
*/
|
||||||
USER_IS_ALREADY_A_BD(6028, "User is already a BD"),
|
USER_IS_ALREADY_A_BD(6028, "User is already a BD"),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* 用户已经是BDLEADER.
|
||||||
|
*/
|
||||||
|
USER_IS_ALREADY_A_BDLEADER(6028, "User is already a BD Leader"),
|
||||||
|
|
||||||
|
/**
|
||||||
* 用户不是BD.
|
* 用户不是BD.
|
||||||
*/
|
*/
|
||||||
USER_IS_NOT_BD(6029, "User is not BD"),
|
USER_IS_NOT_BD(6029, "User is not BD"),
|
||||||
|
|||||||
@ -106,14 +106,13 @@ public class BdLeaderInviteBdExe {
|
|||||||
roomBdLeadService.checkBdLeader(cmd.requiredReqUserId()));
|
roomBdLeadService.checkBdLeader(cmd.requiredReqUserId()));
|
||||||
|
|
||||||
// 权限不足
|
// 权限不足
|
||||||
ResponseAssert.isTrue(CommonErrorCode.INSUFFICIENT_PERMISSION,
|
ResponseAssert.isFalse(CommonErrorCode.INSUFFICIENT_PERMISSION,
|
||||||
roomBdLeadService.checkBdLeader(cmd.getInviteUserId()));
|
roomBdLeadService.checkBdLeader(cmd.getInviteUserId()));
|
||||||
|
|
||||||
|
|
||||||
List<Long> bdUserIds = businessDevelopmentBaseInfoService.listBdUserIdsByLeaderId(cmd.requiredReqUserId());
|
List<Long> bdUserIds = businessDevelopmentBaseInfoService.listBdUserIdsByLeaderId(cmd.requiredReqUserId());
|
||||||
ResponseAssert.isFalse(CommonErrorCode.INSUFFICIENT_PERMISSION, bdUserIds.contains(cmd.getInviteUserId()));
|
ResponseAssert.isFalse(CommonErrorCode.INSUFFICIENT_PERMISSION, bdUserIds.contains(cmd.getInviteUserId()));
|
||||||
|
|
||||||
|
|
||||||
// 消息已发送
|
// 消息已发送
|
||||||
ResponseAssert.isFalse(TeamErrorCode.MESSAGE_PROCESSED,
|
ResponseAssert.isFalse(TeamErrorCode.MESSAGE_PROCESSED,
|
||||||
bdInviteAgentMessageService.existsWaitMessage(cmd.requiredReqUserId(),
|
bdInviteAgentMessageService.existsWaitMessage(cmd.requiredReqUserId(),
|
||||||
|
|||||||
@ -1,8 +1,5 @@
|
|||||||
package com.red.circle.other.app.command.team;
|
package com.red.circle.other.app.command.team;
|
||||||
|
|
||||||
import com.red.circle.external.inner.endpoint.message.OfficialNoticeClient;
|
|
||||||
import com.red.circle.external.inner.model.cmd.message.notice.official.NoticeExtTemplateTypeCmd;
|
|
||||||
import com.red.circle.external.inner.model.enums.message.OfficialNoticeTypeEnum;
|
|
||||||
import com.red.circle.framework.core.asserts.ResponseAssert;
|
import com.red.circle.framework.core.asserts.ResponseAssert;
|
||||||
import com.red.circle.framework.core.response.CommonErrorCode;
|
import com.red.circle.framework.core.response.CommonErrorCode;
|
||||||
import com.red.circle.framework.core.response.ResponseErrorCode;
|
import com.red.circle.framework.core.response.ResponseErrorCode;
|
||||||
@ -10,9 +7,7 @@ import com.red.circle.mq.business.model.event.BadgeOperateEvent;
|
|||||||
import com.red.circle.mq.business.model.event.task.TaskApprovalEvent;
|
import com.red.circle.mq.business.model.event.task.TaskApprovalEvent;
|
||||||
import com.red.circle.mq.rocket.business.producer.TaskMqMessage;
|
import com.red.circle.mq.rocket.business.producer.TaskMqMessage;
|
||||||
import com.red.circle.mq.rocket.business.producer.UserMqMessageService;
|
import com.red.circle.mq.rocket.business.producer.UserMqMessageService;
|
||||||
import com.red.circle.other.app.convertor.user.UserProfileAppConvertor;
|
|
||||||
import com.red.circle.other.app.dto.cmd.team.DbInviteMessageProcessCmd;
|
import com.red.circle.other.app.dto.cmd.team.DbInviteMessageProcessCmd;
|
||||||
import com.red.circle.other.domain.gateway.user.UserProfileGateway;
|
|
||||||
import com.red.circle.other.infra.database.mongo.entity.team.bd.BdInviteAgentMessage;
|
import com.red.circle.other.infra.database.mongo.entity.team.bd.BdInviteAgentMessage;
|
||||||
import com.red.circle.other.infra.database.mongo.entity.team.bd.MessageInviteGroup;
|
import com.red.circle.other.infra.database.mongo.entity.team.bd.MessageInviteGroup;
|
||||||
import com.red.circle.other.infra.database.mongo.entity.team.team.TeamApplicationProcessApproval;
|
import com.red.circle.other.infra.database.mongo.entity.team.team.TeamApplicationProcessApproval;
|
||||||
@ -24,16 +19,13 @@ import com.red.circle.other.infra.database.rds.service.sys.AdministratorService;
|
|||||||
import com.red.circle.other.infra.database.rds.service.team.BusinessDevelopmentBaseInfoService;
|
import com.red.circle.other.infra.database.rds.service.team.BusinessDevelopmentBaseInfoService;
|
||||||
import com.red.circle.other.infra.database.rds.service.team.RoomBdLeadService;
|
import com.red.circle.other.infra.database.rds.service.team.RoomBdLeadService;
|
||||||
import com.red.circle.other.infra.database.rds.service.team.UserHistoryIdentityService;
|
import com.red.circle.other.infra.database.rds.service.team.UserHistoryIdentityService;
|
||||||
import com.red.circle.other.inner.asserts.user.UserErrorCode;
|
|
||||||
import com.red.circle.other.inner.enums.material.BadgeKeyEnum;
|
import com.red.circle.other.inner.enums.material.BadgeKeyEnum;
|
||||||
import com.red.circle.other.inner.model.dto.user.UserProfileDTO;
|
|
||||||
import com.red.circle.other.inner.asserts.team.TeamErrorCode;
|
import com.red.circle.other.inner.asserts.team.TeamErrorCode;
|
||||||
import com.red.circle.other.inner.enums.team.TeamAppProcessApprovalReason;
|
import com.red.circle.other.inner.enums.team.TeamAppProcessApprovalReason;
|
||||||
import com.red.circle.other.inner.enums.team.TeamApplicationType;
|
import com.red.circle.other.inner.enums.team.TeamApplicationType;
|
||||||
import com.red.circle.tool.core.collection.MapBuilder;
|
|
||||||
import com.red.circle.tool.core.date.LocalDateTimeUtils;
|
import com.red.circle.tool.core.date.LocalDateTimeUtils;
|
||||||
import com.red.circle.tool.core.date.TimestampUtils;
|
import com.red.circle.tool.core.date.TimestampUtils;
|
||||||
import com.red.circle.tool.core.json.JacksonUtils;
|
import com.red.circle.tool.core.sequence.IdWorkerUtils;
|
||||||
import com.red.circle.tool.core.text.StringUtils;
|
import com.red.circle.tool.core.text.StringUtils;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
@ -136,7 +128,7 @@ public class BdLeaderInviteMessageProcessExe {
|
|||||||
Objects.equals(message.getGroup(), MessageInviteGroup.BD_LEADER_INVITE_BD_LEADER.name()));
|
Objects.equals(message.getGroup(), MessageInviteGroup.BD_LEADER_INVITE_BD_LEADER.name()));
|
||||||
|
|
||||||
ResponseAssert
|
ResponseAssert
|
||||||
.isTrue(TeamErrorCode.USER_NOT_BDLEADER,
|
.isFalse(TeamErrorCode.USER_IS_ALREADY_A_BDLEADER,
|
||||||
roomBdLeadService.checkBdLeader(cmd.requiredReqUserId()));
|
roomBdLeadService.checkBdLeader(cmd.requiredReqUserId()));
|
||||||
|
|
||||||
ResponseAssert.isTrue(CommonErrorCode.INSUFFICIENT_PERMISSION,
|
ResponseAssert.isTrue(CommonErrorCode.INSUFFICIENT_PERMISSION,
|
||||||
@ -151,8 +143,15 @@ public class BdLeaderInviteMessageProcessExe {
|
|||||||
MessageInviteGroup.BD_LEADER_INVITE_BD_LEADER.name()));
|
MessageInviteGroup.BD_LEADER_INVITE_BD_LEADER.name()));
|
||||||
|
|
||||||
if (Objects.equals(cmd.getStatus(), 1)) {
|
if (Objects.equals(cmd.getStatus(), 1)) {
|
||||||
|
|
||||||
// 创建BD
|
// 创建BD
|
||||||
|
RoomBdLead bdLead = new RoomBdLead();
|
||||||
|
bdLead.setId(IdWorkerUtils.getId());
|
||||||
|
bdLead.setUserId(cmd.requiredReqUserId());
|
||||||
|
bdLead.setSysOrigin(roomBdLead.getSysOrigin());
|
||||||
|
bdLead.setRegionId(roomBdLead.getRegionId());
|
||||||
|
bdLead.setCreateUser(cmd.requiredReqUserId());
|
||||||
|
roomBdLeadService.save(bdLead);
|
||||||
|
|
||||||
businessDevelopmentBaseInfoService.add(new BusinessDevelopmentBaseInfo()
|
businessDevelopmentBaseInfoService.add(new BusinessDevelopmentBaseInfo()
|
||||||
.setSysOrigin(cmd.requireReqSysOrigin())
|
.setSysOrigin(cmd.requireReqSysOrigin())
|
||||||
.setBdLeadUserId(message.getUserId())
|
.setBdLeadUserId(message.getUserId())
|
||||||
@ -174,6 +173,10 @@ public class BdLeaderInviteMessageProcessExe {
|
|||||||
|
|
||||||
// 发送管理员任务消息
|
// 发送管理员任务消息
|
||||||
sendAdminTaskMessage(message.getUserId(), 13);
|
sendAdminTaskMessage(message.getUserId(), 13);
|
||||||
|
|
||||||
|
userMqMessageService.sendBadgeOperateEvent(cmd.requiredReqUserId(), BadgeKeyEnum.BD.name(), BadgeOperateEvent.OperationType.WEAR.name());
|
||||||
|
userMqMessageService.sendBadgeOperateEvent(cmd.requiredReqUserId(), BadgeKeyEnum.BD_LEADER.name(), BadgeOperateEvent.OperationType.WEAR.name());
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user