feat: (REQ-3057) 带班长与工人转换优化
This commit is contained in:
parent
3a5ed7daec
commit
0211be7e02
@ -13,11 +13,11 @@ import org.springframework.context.annotation.Import;
|
||||
import org.springframework.core.env.Environment;
|
||||
|
||||
@Slf4j
|
||||
//@SpringBootApplication(scanBasePackages = "cn.axzo", exclude = MybatisPlusAutoConfiguration.class)
|
||||
//@EnableFeignClients(basePackages = {"cn.axzo"})
|
||||
//@MapperScan(value = {"cn.axzo.im.dao.mapper"})
|
||||
//@EnableDiscoveryClient
|
||||
//@Import(RocketMQEventConfiguration.class)
|
||||
@SpringBootApplication(scanBasePackages = "cn.axzo", exclude = MybatisPlusAutoConfiguration.class)
|
||||
@EnableFeignClients(basePackages = {"cn.axzo"})
|
||||
@MapperScan(value = {"cn.axzo.im.dao.mapper"})
|
||||
@EnableDiscoveryClient
|
||||
@Import(RocketMQEventConfiguration.class)
|
||||
public class ImCenterTestApplication {
|
||||
public static void main(String[] args) {
|
||||
System.setProperty("spring.profiles.active", "test");
|
||||
|
||||
@ -13,6 +13,7 @@ import cn.axzo.im.channel.netease.dto.ChatGroupQueryResponse;
|
||||
import cn.axzo.im.config.JobCodeProperties;
|
||||
import cn.axzo.im.entity.ChatGroup;
|
||||
import cn.axzo.im.event.inner.EventTypeEnum;
|
||||
import cn.axzo.im.event.payload.OrganizationalNodeUser;
|
||||
import cn.axzo.im.event.payload.OrganizationalNodeUserPayload;
|
||||
import cn.axzo.im.event.payload.OrganizationalNodeUserUpsertedPayload;
|
||||
import cn.axzo.im.gateway.OrgJobApiGateway;
|
||||
@ -130,7 +131,7 @@ public class OrganizationalNodeUserChangeEventHandler implements EventHandler, I
|
||||
return null;
|
||||
}
|
||||
OrgNodeUserPayLoad newNodeUser = this.buildPayload(payload.getNewValue().getId());
|
||||
OrgNodeUserPayLoad oldNodeUser = this.buildPayload(payload.getOldValue().getId());
|
||||
OrgNodeUserPayLoad oldNodeUser = this.buildOldPayload(payload);
|
||||
return OrgNodeUserPayLoadBean.builder().newNodeUser(newNodeUser).oldNodeUser(oldNodeUser).build();
|
||||
}
|
||||
|
||||
@ -153,6 +154,22 @@ public class OrganizationalNodeUserChangeEventHandler implements EventHandler, I
|
||||
.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建处理对象
|
||||
*/
|
||||
private OrgNodeUserPayLoad buildOldPayload(OrganizationalNodeUserUpsertedPayload payload) {
|
||||
|
||||
OrganizationalNodeUser oldValue = payload.getOldValue();
|
||||
return OrgNodeUserPayLoad.builder()
|
||||
.workspaceId(oldValue.getWorkspaceId())
|
||||
.ouId(oldValue.getOrganizationalUnitId())
|
||||
.nodeId(oldValue.getOrganizationalNodeId())
|
||||
.jobId(oldValue.getOrganizationalJobId())
|
||||
.personId(oldValue.getPersonId())
|
||||
.tag(EventTypeEnum.NODE_USER_UPDATE.getName())
|
||||
.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 加入群聊或者退出群聊-通过人群
|
||||
* @param crowTypeEnum 人群
|
||||
@ -225,7 +242,7 @@ public class OrganizationalNodeUserChangeEventHandler implements EventHandler, I
|
||||
boolean flag = this.doEnterOrExitChatGroup(tag, chatGroup, currentImAccount, members, tInfo.getOwner(), JobCodeUtils.isTeam(currentJobCode));
|
||||
//工人->带班长,踢出工人
|
||||
//带班长->工人,踢出带班长
|
||||
this.kickWorkerOrProjTeamManagerWithJobConvert(currentImAccount, payLoad, members, chatGroup, tInfo);
|
||||
this.kickWorkerOrProjTeamManagerWithJobConvert(currentJobCode, payLoad, members, chatGroup, tInfo);
|
||||
if (flag) {
|
||||
//当处理项目内班组时,更改群组
|
||||
this.changeOwnerWithTeam(chatGroup, currentImAccount, JobCodeUtils.isProjectTeamLeader(currentJobCode));
|
||||
|
||||
Loading…
Reference in New Issue
Block a user