Merge remote-tracking branch 'origin/feature/REQ-3300' into feature/REQ-3300
This commit is contained in:
commit
92d80654a7
@ -264,4 +264,26 @@ public class RocketMQEventConfiguration {
|
||||
super.onEvent(message, eventConsumer);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* IM 事件处理
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
@RocketMQMessageListener(topic = "topic_im_center_${spring.profiles.active}",
|
||||
consumerGroup = "GID_im_${spring.application.name}_${spring.profiles.active}",
|
||||
consumeMode = ConsumeMode.ORDERLY,
|
||||
nameServer = "${rocketmq.name-server}"
|
||||
)
|
||||
public static class ImCenterListener extends BaseListener implements RocketMQListener<MessageExt> {
|
||||
|
||||
@Autowired
|
||||
private EventConsumer eventConsumer;
|
||||
|
||||
@Override
|
||||
public void onMessage(MessageExt message) {
|
||||
log.info("ImCenterListener onMessage nanopart, message:{}", JSON.toJSONString(message));
|
||||
super.onEvent(message, eventConsumer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -17,10 +17,19 @@ public interface VisaConstant {
|
||||
* 用于发送待办的变量名
|
||||
*/
|
||||
String WORKFLOW_PENDING_TOPIC = "theme";
|
||||
String MSG_CENTER_APP_CODE = "nanopart-visa";
|
||||
/**
|
||||
* IM 群的扩展信息
|
||||
* IM 群的扩展信息:变洽签 ID
|
||||
*/
|
||||
String IM_GROUP_BIZ_INFO_RECORD_ID = "visaId";
|
||||
String IM_GROUP_BIZ_INFO_VISA_ID = "visaId";
|
||||
/**
|
||||
* IM 群扩展信息:变洽签单据类型
|
||||
*/
|
||||
String IM_GROUP_BIZ_INFO_VISA_TYPE = "visaType";
|
||||
/**
|
||||
* IM 群扩展信息:群主 workspaceId
|
||||
*/
|
||||
String IM_GROUP_BIZ_INFO_OWNER_WORKSPACE_ID = "ownerWorkspaceId";
|
||||
// **************** 业务传入审批的表单项组件的唯一的 KEY *****************
|
||||
// 单号
|
||||
String FORM_FIELD_NO = "no";
|
||||
|
||||
@ -4,6 +4,8 @@ import lombok.AccessLevel;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 签证业务类型
|
||||
*
|
||||
@ -21,4 +23,8 @@ public enum VisaTypeEnum {
|
||||
private final String processDefinitionKey;
|
||||
private final String code;
|
||||
private final String desc;
|
||||
|
||||
public static VisaTypeEnum valueOfCode(String code) {
|
||||
return Arrays.stream(VisaTypeEnum.values()).filter(item -> item.getCode().equals(code)).findFirst().orElse(null);
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,24 @@
|
||||
package cn.axzo.nanopart.visa.api.request;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
/**
|
||||
* IM 群成员投票操作的清除
|
||||
*
|
||||
* @author wangli
|
||||
* @since 2025-02-07 15:39
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@SuperBuilder
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class ImGroupOperationClearReq extends ImGroupOperationReq{
|
||||
|
||||
private Boolean clearAll;
|
||||
|
||||
}
|
||||
@ -22,6 +22,8 @@ public class ImGroupTipsResp {
|
||||
|
||||
private VisaStatusEnum status;
|
||||
|
||||
private String statusText;
|
||||
|
||||
private String tipsText;
|
||||
|
||||
private List<ImGroupButton> buttonList;
|
||||
|
||||
@ -0,0 +1,35 @@
|
||||
package cn.axzo.nanopart.visa.server.config;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.cloud.context.config.annotation.RefreshScope;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 可 nacos 动态更新的对象
|
||||
*
|
||||
* @author wangli
|
||||
* @since 2025-02-07 16:03
|
||||
*/
|
||||
@Data
|
||||
@Component
|
||||
@RefreshScope
|
||||
public class RefreshableConfiguration {
|
||||
|
||||
/**
|
||||
* IM 群创建成功后发送卡片模板
|
||||
*/
|
||||
@Value("${visa.im.card:261c7fa3db344fb69f3553f695a5a19c}")
|
||||
private String imGroupCardTemplateCode;
|
||||
/**
|
||||
* 变更签证洽商通知
|
||||
* IM 群添加成员,给新成员发送的通知
|
||||
*/
|
||||
@Value("${visa.im.notice.addMember:2a4fe042020f4dd783b73fdbb6e6ac98}")
|
||||
private String imGroupAddMemberNoticeTemplateCode;
|
||||
/**
|
||||
* 配合上面的通知发送使用
|
||||
*/
|
||||
@Value("${visa.im.event.addMember:visaNegotiation}")
|
||||
private String imGroupAddMemberNoticeEventCode;
|
||||
}
|
||||
@ -87,6 +87,8 @@ public class VisaConfirmDto {
|
||||
*/
|
||||
private Collection<Long> nodeIds;
|
||||
|
||||
private Long operator;
|
||||
|
||||
/**
|
||||
* 根据DataItem创建Dto
|
||||
*/
|
||||
|
||||
@ -28,4 +28,19 @@ public class VisaRelationDto {
|
||||
*/
|
||||
private String varName;
|
||||
|
||||
/**
|
||||
* 内容
|
||||
*/
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 内容扩展
|
||||
*/
|
||||
private String contentExt;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private Long createBy;
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,100 @@
|
||||
package cn.axzo.nanopart.visa.server.mq.listener.im;
|
||||
|
||||
import cn.axzo.basics.common.util.AssertUtil;
|
||||
import cn.axzo.basics.profiles.dto.basic.PersonProfileDto;
|
||||
import cn.axzo.framework.rocketmq.Event;
|
||||
import cn.axzo.framework.rocketmq.EventConsumer;
|
||||
import cn.axzo.framework.rocketmq.EventHandler;
|
||||
import cn.axzo.im.center.api.vo.group.GroupInfo;
|
||||
import cn.axzo.im.center.api.vo.group.GroupMemberInfo;
|
||||
import cn.axzo.im.center.api.vo.mq.GroupMembersChangeMessage;
|
||||
import cn.axzo.msg.center.api.MessageAPIV3;
|
||||
import cn.axzo.msg.center.api.request.v3.MessageSendReqV3;
|
||||
import cn.axzo.msg.center.service.dto.PersonV3DTO;
|
||||
import cn.axzo.nanopart.visa.api.enums.VisaTypeEnum;
|
||||
import cn.axzo.nanopart.visa.server.config.RefreshableConfiguration;
|
||||
import cn.axzo.nanopart.visa.server.rpc.VisaProfileGateway;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.google.common.collect.Lists;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.groovy.util.Maps;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
import static cn.axzo.im.center.api.enums.MqEventType.GROUP_ADD_MEMBERS;
|
||||
import static cn.axzo.nanopart.visa.api.constant.VisaConstant.IM_GROUP_BIZ_INFO_OWNER_WORKSPACE_ID;
|
||||
import static cn.axzo.nanopart.visa.api.constant.VisaConstant.IM_GROUP_BIZ_INFO_VISA_ID;
|
||||
import static cn.axzo.nanopart.visa.api.constant.VisaConstant.IM_GROUP_BIZ_INFO_VISA_TYPE;
|
||||
|
||||
/**
|
||||
* 监听 IM 添加群成员的广播事件
|
||||
*
|
||||
* @author wangli
|
||||
* @since 2025-02-07 13:53
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class ImGroupAddMembersEventHandler implements EventHandler, InitializingBean {
|
||||
@Autowired
|
||||
private EventConsumer eventConsumer;
|
||||
@Resource
|
||||
private RefreshableConfiguration refreshableConfiguration;
|
||||
@Resource
|
||||
private MessageAPIV3 noticeApi;
|
||||
@Resource
|
||||
private VisaProfileGateway visaProfileGateway;
|
||||
|
||||
@Override
|
||||
public void onEvent(Event event, EventConsumer.Context context) {
|
||||
if (Objects.isNull(event) || Objects.isNull(event.getEventCode())) {
|
||||
log.warn("illegal event code: {}", JSON.toJSONString(event));
|
||||
return;
|
||||
}
|
||||
log.info("receive add member event, push notice : {}", JSON.toJSONString(event));
|
||||
GroupMembersChangeMessage groupMembersChangeMessage = event.normalizedData(GroupMembersChangeMessage.class);
|
||||
GroupInfo group = groupMembersChangeMessage.getGroup();
|
||||
AssertUtil.notNull(group, "im group is null");
|
||||
|
||||
GroupMemberInfo member = groupMembersChangeMessage.getMember();
|
||||
AssertUtil.notNull(member, "im member is null");
|
||||
|
||||
Map<Long, PersonProfileDto> profileMap = visaProfileGateway.getProfileMap(Lists.newArrayList(group.getOwnerPersonId(), member.getPersonId()));
|
||||
|
||||
String visaId = (String) group.getBizGroupInfo().getOrDefault(IM_GROUP_BIZ_INFO_VISA_ID, "");
|
||||
String visaType = (String) group.getBizGroupInfo().getOrDefault(IM_GROUP_BIZ_INFO_VISA_TYPE, "");
|
||||
Long workspaceId = (Long) group.getBizGroupInfo().getOrDefault(IM_GROUP_BIZ_INFO_OWNER_WORKSPACE_ID, 0L);
|
||||
|
||||
PersonProfileDto memberProfile = profileMap.getOrDefault(member.getPersonId(), null);
|
||||
PersonProfileDto ownerProfile = profileMap.getOrDefault(group.getOwnerPersonId(), null);
|
||||
|
||||
if (Objects.nonNull(memberProfile) && Objects.nonNull(ownerProfile)) {
|
||||
MessageSendReqV3 notice = new MessageSendReqV3();
|
||||
notice.setSender(PersonV3DTO.builder().build());
|
||||
|
||||
notice.setReceivers(Lists.newArrayList(PersonV3DTO.builder()
|
||||
.id(member.getPersonId())
|
||||
.name(memberProfile.getRealName())
|
||||
.imReceiveModel(new PersonV3DTO.ReceiveModel(member.getPersonOuId(), workspaceId))
|
||||
.build()));
|
||||
notice.setBizEventMappingCode(refreshableConfiguration.getImGroupAddMemberNoticeEventCode());
|
||||
notice.setBizCode(visaId);
|
||||
notice.setBizExtParams(new JSONObject(Maps.of(
|
||||
"initiatorName", ownerProfile.getRealName(),
|
||||
"visaType", VisaTypeEnum.valueOfCode(visaType).getDesc(),
|
||||
"topic", group.getName())));
|
||||
noticeApi.send(notice);
|
||||
}
|
||||
log.info("receive add member event, push notice success!");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterPropertiesSet() {
|
||||
eventConsumer.registerHandler(GROUP_ADD_MEMBERS.getEventCode(), this);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,41 @@
|
||||
package cn.axzo.nanopart.visa.server.mq.listener.im;
|
||||
|
||||
import cn.axzo.framework.rocketmq.Event;
|
||||
import cn.axzo.framework.rocketmq.EventConsumer;
|
||||
import cn.axzo.framework.rocketmq.EventHandler;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import static cn.axzo.im.center.api.enums.MqEventType.GROUP_DISMISSED;
|
||||
|
||||
/**
|
||||
* 监听 IM 群解散的广播事件
|
||||
*
|
||||
* @author wangli
|
||||
* @since 2025-02-07 13:53
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class ImGroupDismissedEventHandler implements EventHandler, InitializingBean {
|
||||
@Autowired
|
||||
private EventConsumer eventConsumer;
|
||||
|
||||
@Override
|
||||
public void onEvent(Event event, EventConsumer.Context context) {
|
||||
if (Objects.isNull(event) || Objects.isNull(event.getEventCode())) {
|
||||
log.warn("illegal event code: {}", JSON.toJSONString(event));
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterPropertiesSet() {
|
||||
eventConsumer.registerHandler(GROUP_DISMISSED.getEventCode(), this);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,73 @@
|
||||
package cn.axzo.nanopart.visa.server.mq.listener.im;
|
||||
|
||||
import cn.axzo.basics.common.util.AssertUtil;
|
||||
import cn.axzo.framework.rocketmq.Event;
|
||||
import cn.axzo.framework.rocketmq.EventConsumer;
|
||||
import cn.axzo.framework.rocketmq.EventHandler;
|
||||
import cn.axzo.im.center.api.vo.group.GroupInfo;
|
||||
import cn.axzo.im.center.api.vo.group.GroupMemberInfo;
|
||||
import cn.axzo.im.center.api.vo.mq.GroupMembersChangeMessage;
|
||||
import cn.axzo.nanopart.visa.api.request.ImGroupOperationClearReq;
|
||||
import cn.axzo.nanopart.visa.server.service.ChangeRecordRelationService;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Objects;
|
||||
|
||||
import static cn.axzo.im.center.api.enums.MqEventType.GROUP_REMOVE_MEMBERS;
|
||||
import static cn.axzo.nanopart.visa.api.constant.VisaConstant.IM_GROUP_BIZ_INFO_VISA_ID;
|
||||
|
||||
/**
|
||||
* 监听 IM 群成员被移除的广播事件
|
||||
*
|
||||
* @author wangli
|
||||
* @since 2025-02-07 13:53
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class ImGroupRemoveMembersEventHandler implements EventHandler, InitializingBean {
|
||||
@Autowired
|
||||
private EventConsumer eventConsumer;
|
||||
@Resource
|
||||
private ChangeRecordRelationService changeRecordRelationService;
|
||||
|
||||
@Override
|
||||
public void onEvent(Event event, EventConsumer.Context context) {
|
||||
if (Objects.isNull(event) || Objects.isNull(event.getEventCode())) {
|
||||
log.warn("illegal event code: {}", JSON.toJSONString(event));
|
||||
return;
|
||||
}
|
||||
log.info("receive remove member event: {}", JSON.toJSONString(event));
|
||||
GroupMembersChangeMessage groupMembersChangeMessage = event.normalizedData(GroupMembersChangeMessage.class);
|
||||
GroupInfo group = groupMembersChangeMessage.getGroup();
|
||||
AssertUtil.notNull(group, "im group is null");
|
||||
|
||||
GroupMemberInfo member = groupMembersChangeMessage.getMember();
|
||||
AssertUtil.notNull(member, "im member is null");
|
||||
|
||||
// 移除该群成员的投票信息
|
||||
removeMemberVote(group, member);
|
||||
log.info("receive remove member event handle success!");
|
||||
}
|
||||
|
||||
private void removeMemberVote(GroupInfo group, GroupMemberInfo member) {
|
||||
Long visaId = (Long) group.getBizGroupInfo().getOrDefault(IM_GROUP_BIZ_INFO_VISA_ID, "");
|
||||
|
||||
ImGroupOperationClearReq build = new ImGroupOperationClearReq();
|
||||
build.setClearAll(false);
|
||||
build.setImGroupId(group.getTid());
|
||||
build.setVisaId(visaId);
|
||||
build.setOperatorPersonId(member.getPersonId());
|
||||
build.setOperatorOuId(member.getPersonOuId());
|
||||
changeRecordRelationService.clearImOperationParticipate(build);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterPropertiesSet() {
|
||||
eventConsumer.registerHandler(GROUP_REMOVE_MEMBERS.getEventCode(), this);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,103 @@
|
||||
package cn.axzo.nanopart.visa.server.mq.listener.im;
|
||||
|
||||
import cn.axzo.basics.common.util.AssertUtil;
|
||||
import cn.axzo.framework.rocketmq.Event;
|
||||
import cn.axzo.framework.rocketmq.EventConsumer;
|
||||
import cn.axzo.framework.rocketmq.EventHandler;
|
||||
import cn.axzo.im.center.api.vo.PersonAccountAttribute;
|
||||
import cn.axzo.im.center.api.vo.group.GroupInfo;
|
||||
import cn.axzo.im.center.api.vo.group.GroupMemberInfo;
|
||||
import cn.axzo.im.center.api.vo.mq.GroupChangedMessage;
|
||||
import cn.axzo.im.center.api.vo.req.GroupGetOwnerRequest;
|
||||
import cn.axzo.im.center.api.vo.req.SendChatMessageRequest;
|
||||
import cn.axzo.im.center.api.vo.resp.GroupGetOwnerResponse;
|
||||
import cn.axzo.im.center.common.enums.AppTypeEnum;
|
||||
import cn.axzo.msg.center.service.dto.PeerPerson;
|
||||
import cn.axzo.msg.center.service.pending.request.CardSendRequest;
|
||||
import cn.axzo.nanopart.visa.server.rpc.MsgCenterGateway;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.google.common.collect.Sets;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.groovy.util.Maps;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
import static cn.axzo.im.center.api.enums.MqEventType.GROUP_CREATED;
|
||||
import static cn.axzo.nanopart.visa.api.constant.VisaConstant.IM_GROUP_BIZ_INFO_OWNER_WORKSPACE_ID;
|
||||
import static cn.axzo.nanopart.visa.api.constant.VisaConstant.IM_GROUP_BIZ_INFO_VISA_ID;
|
||||
import static cn.axzo.nanopart.visa.api.constant.VisaConstant.MSG_CENTER_APP_CODE;
|
||||
|
||||
/**
|
||||
* 监听 IM 群创建的广播事件
|
||||
*
|
||||
* @author wangli
|
||||
* @since 2025-02-07 13:53
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class ImGroupsCreatedEventHandler implements EventHandler, InitializingBean {
|
||||
@Autowired
|
||||
private EventConsumer eventConsumer;
|
||||
@Resource
|
||||
private MsgCenterGateway msgCenterGateway;
|
||||
|
||||
@Override
|
||||
public void onEvent(Event event, EventConsumer.Context context) {
|
||||
if (Objects.isNull(event) || Objects.isNull(event.getEventCode())) {
|
||||
log.warn("illegal event code: {}", JSON.toJSONString(event));
|
||||
return;
|
||||
}
|
||||
log.info("receive create im group event: {}", JSON.toJSONString(event));
|
||||
GroupChangedMessage groupChangedMessage = event.normalizedData(GroupChangedMessage.class);
|
||||
GroupInfo group = groupChangedMessage.getGroup();
|
||||
AssertUtil.notNull(group, "group info is null");
|
||||
sendCardAndMsgToImGroup(group);
|
||||
log.info("receive create im group event, handle success: {}", JSON.toJSONString(event));
|
||||
}
|
||||
|
||||
private void sendCardAndMsgToImGroup(GroupInfo group) {
|
||||
Map<String, Object> bizGroupInfo = group.getBizGroupInfo();
|
||||
HashSet<String> imReceiveAccounts = Sets.newHashSet(String.valueOf(group.getTid()));
|
||||
GroupGetOwnerRequest ownerRequest = new GroupGetOwnerRequest();
|
||||
GroupGetOwnerResponse groupOwner = msgCenterGateway.getGroupOwner(ownerRequest);
|
||||
AssertUtil.isTrue(Objects.nonNull(groupOwner) && Objects.nonNull(groupOwner.getOwner()), "im group owner is null");
|
||||
GroupMemberInfo owner = groupOwner.getOwner();
|
||||
// 发送卡片
|
||||
CardSendRequest cardRequest = new CardSendRequest();
|
||||
cardRequest.setAppCode(MSG_CENTER_APP_CODE);
|
||||
cardRequest.setTemplateCode("");
|
||||
Long visaId = (Long) bizGroupInfo.getOrDefault(IM_GROUP_BIZ_INFO_VISA_ID, "");
|
||||
cardRequest.setBizCode(IM_GROUP_BIZ_INFO_VISA_ID + ":" + visaId);
|
||||
Long ownerWorkspaceId = (Long) bizGroupInfo.getOrDefault(IM_GROUP_BIZ_INFO_OWNER_WORKSPACE_ID, 0L);
|
||||
cardRequest.setSender(PeerPerson.create(owner.getPersonId(), owner.getPersonOuId(), ownerWorkspaceId));
|
||||
cardRequest.setImSenderAccountAppType(AppTypeEnum.CMP);
|
||||
cardRequest.setImReceiveAccounts(imReceiveAccounts);
|
||||
cardRequest.setBizParam(new JSONObject(Maps.of("topic", "")));
|
||||
msgCenterGateway.sendCardToCroup(cardRequest);
|
||||
|
||||
// 普通群消息
|
||||
SendChatMessageRequest msgRequest = new SendChatMessageRequest();
|
||||
msgRequest.setAsTextMessage(group.getName() + ",请各位审阅");
|
||||
msgRequest.setImReceiveAccounts(imReceiveAccounts);
|
||||
msgRequest.setSender(PersonAccountAttribute.builder()
|
||||
.personId(String.valueOf(owner.getPersonId()))
|
||||
.ouId(owner.getPersonOuId())
|
||||
.workspaceId(ownerWorkspaceId)
|
||||
.appType(AppTypeEnum.CMP)
|
||||
.build());
|
||||
msgRequest.setBizId(IM_GROUP_BIZ_INFO_VISA_ID + ":" + visaId);
|
||||
msgCenterGateway.sendMsgToGroup(msgRequest);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterPropertiesSet() {
|
||||
eventConsumer.registerHandler(GROUP_CREATED.getEventCode(), this);
|
||||
}
|
||||
}
|
||||
@ -2,14 +2,21 @@ package cn.axzo.nanopart.visa.server.rpc;
|
||||
|
||||
import cn.axzo.framework.domain.web.result.ApiResult;
|
||||
import cn.axzo.im.center.api.feign.GroupApi;
|
||||
import cn.axzo.im.center.api.feign.MessageApi;
|
||||
import cn.axzo.im.center.api.vo.req.GroupCreateRequest;
|
||||
import cn.axzo.im.center.api.vo.req.GroupDismissRequest;
|
||||
import cn.axzo.im.center.api.vo.req.GroupGetMembersRequest;
|
||||
import cn.axzo.im.center.api.vo.req.GroupGetOwnerRequest;
|
||||
import cn.axzo.im.center.api.vo.req.SendChatMessageRequest;
|
||||
import cn.axzo.im.center.api.vo.resp.GroupCreateResponse;
|
||||
import cn.axzo.im.center.api.vo.resp.GroupGetMembersResponse;
|
||||
import cn.axzo.im.center.api.vo.resp.GroupGetOwnerResponse;
|
||||
import cn.axzo.msg.center.service.pending.card.CardClient;
|
||||
import cn.axzo.msg.center.service.pending.request.CardSendRequest;
|
||||
import cn.axzo.msg.center.service.pending.request.CardUpdateStateRequest;
|
||||
import cn.axzo.msg.center.service.pending.response.CardSendResponse;
|
||||
import cn.azxo.framework.common.logger.MethodAroundLog;
|
||||
import cn.azxo.framework.common.model.CommonResponse;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -28,6 +35,8 @@ import java.util.Objects;
|
||||
public class MsgCenterGateway {
|
||||
|
||||
private final GroupApi groupApi;
|
||||
private final MessageApi messageApi;
|
||||
private final CardClient cardClient;
|
||||
|
||||
@MethodAroundLog(target = "imCenter", source = "nanopart", value = "创建 IM 群聊")
|
||||
public GroupCreateResponse createImGroup(GroupCreateRequest request) {
|
||||
@ -60,4 +69,27 @@ public class MsgCenterGateway {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@MethodAroundLog(target = "imCenter", source = "nanopart", value = "发送普通消息到群消息")
|
||||
public Long sendMsgToGroup(SendChatMessageRequest request) {
|
||||
ApiResult<Long> mesageId = messageApi.sendChatMessage(request);
|
||||
if(mesageId.isSuccess() && Objects.nonNull(mesageId.getData())) {
|
||||
return mesageId.getData();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@MethodAroundLog(target = "imCenter", source = "nanopart", value = "发送卡片消息到群消息")
|
||||
public CardSendResponse sendCardToCroup(CardSendRequest request) {
|
||||
CommonResponse<CardSendResponse> sendCard = cardClient.send(request);
|
||||
if (Objects.nonNull(sendCard) && sendCard.getCode() == 200) {
|
||||
return sendCard.getData();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@MethodAroundLog(target = "imCenter", source = "nanopart", value = "更新 IM 群内卡片状态")
|
||||
public void updateCardState(CardUpdateStateRequest request) {
|
||||
cardClient.updateState(request);
|
||||
}
|
||||
}
|
||||
|
||||
@ -5,13 +5,18 @@ import cn.axzo.basics.profiles.dto.basic.PersonProfileDto;
|
||||
import cn.azxo.framework.common.logger.MethodAroundLog;
|
||||
import cn.azxo.framework.common.model.CommonResponse;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.google.common.collect.Maps;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author chenwenjian
|
||||
@ -60,4 +65,13 @@ public class VisaProfileGateway {
|
||||
}
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@MethodAroundLog(target = "pudge", source = "nanopart", value = "获取用户档案并转换Map")
|
||||
public Map<Long, PersonProfileDto> getProfileMap(List<Long> personIds) {
|
||||
List<PersonProfileDto> profiles = getProfiles(personIds);
|
||||
if (CollectionUtils.isEmpty(profiles)) {
|
||||
return Maps.newHashMap();
|
||||
}
|
||||
return profiles.stream().collect(Collectors.toMap(PersonProfileDto::getId, Function.identity(), (x, y) -> x));
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package cn.axzo.nanopart.visa.server.service;
|
||||
|
||||
import cn.axzo.nanopart.visa.api.enums.VisaRelationFieldEnum;
|
||||
import cn.axzo.nanopart.visa.api.request.ImGroupOperationClearReq;
|
||||
import cn.axzo.nanopart.visa.api.request.ImGroupOperationReq;
|
||||
import cn.axzo.nanopart.visa.api.request.ImGroupTipsQueryReq;
|
||||
import cn.axzo.nanopart.visa.api.request.VisaChangeTempCreateReq;
|
||||
@ -45,7 +46,7 @@ public interface ChangeRecordRelationService extends IService<ChangeRecordRelati
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
Boolean clearImOperationParticipate(ImGroupOperationReq req);
|
||||
Boolean clearImOperationParticipate(ImGroupOperationClearReq req);
|
||||
|
||||
/**
|
||||
* IM 群聊界面,查询当前人的 tips 横条
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package cn.axzo.nanopart.visa.server.service.impl;
|
||||
|
||||
import cn.axzo.basics.common.BeanMapper;
|
||||
import cn.axzo.basics.profiles.dto.basic.PersonProfileDto;
|
||||
import cn.axzo.karma.client.feign.tyr.request.MatchDataObjectReq;
|
||||
import cn.axzo.karma.client.feign.tyr.response.MatchDataObjectResp;
|
||||
@ -25,7 +26,6 @@ import cn.axzo.nanopart.visa.server.service.ChangeRecordLogService;
|
||||
import cn.axzo.nanopart.visa.server.service.ChangeRecordService;
|
||||
import cn.axzo.workflow.common.model.request.bpmn.process.BpmnProcessInstanceCheckApproverDTO;
|
||||
import cn.axzo.workflow.common.model.request.bpmn.task.BpmnTaskDelegateAssigner;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.google.common.collect.Lists;
|
||||
@ -78,7 +78,10 @@ public class ChangeRecordConfirmServiceImpl extends ServiceImpl<ChangeRecordConf
|
||||
* @return true:成功;false:失败
|
||||
*/
|
||||
public boolean addConfirm(List<VisaConfirmDto> dtoList) {
|
||||
List<ChangeRecordConfirm> visaConfirmDtos = BeanUtil.copyToList(dtoList, ChangeRecordConfirm.class);
|
||||
List<ChangeRecordConfirm> visaConfirmDtos = BeanMapper.copyList(dtoList, ChangeRecordConfirm.class, (s, t) -> {
|
||||
t.setCreateBy(s.getOperator());
|
||||
t.setUpdateBy(s.getOperator());
|
||||
});
|
||||
return this.saveOrUpdateBatch(visaConfirmDtos);
|
||||
}
|
||||
|
||||
@ -273,17 +276,6 @@ public class ChangeRecordConfirmServiceImpl extends ServiceImpl<ChangeRecordConf
|
||||
return profiles.stream().collect(Collectors.toMap(PersonProfileDto::getId, PersonProfileDto::getRealName, (x, y) -> x));
|
||||
}
|
||||
|
||||
private Map<Long, PersonProfileDto> buildPersonDtoMap(Set<Long> personSet) {
|
||||
if (CollectionUtils.isEmpty(personSet)) {
|
||||
return Maps.newHashMap();
|
||||
}
|
||||
List<PersonProfileDto> profiles = visaProfileGateway.getProfiles(Lists.newArrayList(personSet));
|
||||
if (CollectionUtils.isEmpty(profiles)) {
|
||||
return Maps.newHashMap();
|
||||
}
|
||||
return profiles.stream().collect(Collectors.toMap(PersonProfileDto::getId, Function.identity(), (x, y) -> x));
|
||||
}
|
||||
|
||||
/**
|
||||
* 条件查询列表
|
||||
*/
|
||||
@ -351,9 +343,9 @@ public class ChangeRecordConfirmServiceImpl extends ServiceImpl<ChangeRecordConf
|
||||
if (CollectionUtils.isEmpty(list)) {
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
Map<Long, PersonProfileDto> personMap = buildPersonDtoMap(list.stream()
|
||||
Map<Long, PersonProfileDto> personMap = visaProfileGateway.getProfileMap(list.stream()
|
||||
.map(ChangeRecordConfirm::getPersonId)
|
||||
.collect(Collectors.toSet()));
|
||||
.collect(Collectors.toList()));
|
||||
return list.stream().map(i -> VisaChangeApproveCreateReq.ApprovePersonInfo.builder()
|
||||
.workspaceId(i.getWorkspaceId())
|
||||
.ouId(i.getOuId())
|
||||
|
||||
@ -1,13 +1,17 @@
|
||||
package cn.axzo.nanopart.visa.server.service.impl;
|
||||
|
||||
import cn.axzo.basics.common.util.AssertUtil;
|
||||
import cn.axzo.basics.profiles.dto.basic.PersonProfileDto;
|
||||
import cn.axzo.basics.common.util.NumberUtil;
|
||||
import cn.axzo.basics.profiles.dto.basic.PersonProfileDto;
|
||||
import cn.axzo.framework.domain.ServiceException;
|
||||
import cn.axzo.im.center.api.vo.PersonAccountAttribute;
|
||||
import cn.axzo.im.center.api.vo.req.SendChatMessageRequest;
|
||||
import cn.axzo.im.center.common.enums.AppTypeEnum;
|
||||
import cn.axzo.nanopart.visa.api.enums.VisaButtonTypeEnum;
|
||||
import cn.axzo.nanopart.visa.api.enums.VisaRelationFieldEnum;
|
||||
import cn.axzo.nanopart.visa.api.enums.VisaRelationVarTypeEnum;
|
||||
import cn.axzo.nanopart.visa.api.enums.VisaStatusEnum;
|
||||
import cn.axzo.nanopart.visa.api.request.ImGroupOperationClearReq;
|
||||
import cn.axzo.nanopart.visa.api.request.ImGroupOperationReq;
|
||||
import cn.axzo.nanopart.visa.api.request.ImGroupTipsQueryReq;
|
||||
import cn.axzo.nanopart.visa.api.request.VisaChangeTempCreateReq;
|
||||
@ -17,6 +21,7 @@ import cn.axzo.nanopart.visa.server.domain.ChangeRecord;
|
||||
import cn.axzo.nanopart.visa.server.domain.ChangeRecordRelation;
|
||||
import cn.axzo.nanopart.visa.server.dto.VisaRelationDto;
|
||||
import cn.axzo.nanopart.visa.server.mapper.ChangeRecordRelationDao;
|
||||
import cn.axzo.nanopart.visa.server.rpc.MsgCenterGateway;
|
||||
import cn.axzo.nanopart.visa.server.rpc.VisaProfileGateway;
|
||||
import cn.axzo.nanopart.visa.server.service.ChangeRecordRelationService;
|
||||
import cn.axzo.nanopart.visa.server.service.ChangeRecordService;
|
||||
@ -24,6 +29,7 @@ import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Sets;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
@ -37,6 +43,7 @@ import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static cn.axzo.nanopart.visa.api.constant.VisaConstant.IM_GROUP_BIZ_INFO_VISA_ID;
|
||||
import static cn.axzo.nanopart.visa.api.constant.VisaConstant.IM_GROUP_OWNER_TIPS;
|
||||
import static cn.axzo.nanopart.visa.api.constant.VisaConstant.IM_GROUP_PARTICIPATE_TIPS;
|
||||
|
||||
@ -51,6 +58,7 @@ import static cn.axzo.nanopart.visa.api.constant.VisaConstant.IM_GROUP_PARTICIPA
|
||||
public class ChangeRecordRelationServiceImpl extends ServiceImpl<ChangeRecordRelationDao, ChangeRecordRelation> implements ChangeRecordRelationService {
|
||||
private final ChangeRecordService changeRecordService;
|
||||
private final VisaProfileGateway visaProfileGateway;
|
||||
private final MsgCenterGateway msgCenterGateway;
|
||||
|
||||
/**
|
||||
* 保存
|
||||
@ -130,6 +138,9 @@ public class ChangeRecordRelationServiceImpl extends ServiceImpl<ChangeRecordRel
|
||||
}
|
||||
return this.lambdaQuery().eq(ChangeRecordRelation::getVisaId, dto.getVisaId())
|
||||
.eq(ChangeRecordRelation::getVarName, dto.getVarName())
|
||||
.eq(StringUtils.hasText(dto.getContent()), ChangeRecordRelation::getContent, dto.getContent())
|
||||
.eq(StringUtils.hasText(dto.getContentExt()), ChangeRecordRelation::getContentExt, dto.getContentExt())
|
||||
.eq(Objects.nonNull(dto.getCreateBy()), ChangeRecordRelation::getCreateBy, dto.getCreateBy())
|
||||
.eq(ChangeRecordRelation::getIsDelete, 0).list();
|
||||
}
|
||||
|
||||
@ -145,23 +156,47 @@ public class ChangeRecordRelationServiceImpl extends ServiceImpl<ChangeRecordRel
|
||||
relation.setVarName(VisaRelationFieldEnum.IM_GROUP_PARTICIPATE.getCode());
|
||||
relation.setVarExt(req.getButtonType().getCode());
|
||||
relation.setVarType(VisaRelationVarTypeEnum.LONG.getType());
|
||||
relation.setContentExt(String.valueOf(req.getOperatorOuId()));
|
||||
relation.setContent(String.valueOf(req.getOperatorWorkspaceId()));
|
||||
relation.setContentExt(String.valueOf(req.getOperatorWorkspaceId()));
|
||||
relation.setContent(String.valueOf(req.getOperatorOuId()));
|
||||
relation.setCreateBy(req.getOperatorPersonId());
|
||||
relation.setUpdateBy(req.getOperatorPersonId());
|
||||
|
||||
save(relation);
|
||||
|
||||
// 发送“同意”、“拒绝”的文案至群内
|
||||
SendChatMessageRequest msgRequest = new SendChatMessageRequest();
|
||||
msgRequest.setAsTextMessage(req.getButtonType().getDesc() + "!");
|
||||
msgRequest.setImReceiveAccounts(Sets.newHashSet(String.valueOf(req.getImGroupId())));
|
||||
msgRequest.setSender(PersonAccountAttribute.builder()
|
||||
.personId(String.valueOf(req.getOperatorPersonId()))
|
||||
.ouId(req.getOperatorOuId())
|
||||
.workspaceId(req.getOperatorWorkspaceId())
|
||||
.appType(AppTypeEnum.CMP)
|
||||
.build());
|
||||
msgRequest.setBizId(IM_GROUP_BIZ_INFO_VISA_ID + ":" + req.getVisaId());
|
||||
msgCenterGateway.sendMsgToGroup(msgRequest);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean clearImOperationParticipate(ImGroupOperationReq req) {
|
||||
public Boolean clearImOperationParticipate(ImGroupOperationClearReq req) {
|
||||
ChangeRecord record = changeRecordService.getById(req.getVisaId());
|
||||
AssertUtil.notNull(record, "未找到变洽签记录");
|
||||
AssertUtil.isTrue(Objects.equals(record.getImGroupId(), req.getImGroupId()), "IM 群信息不匹配");
|
||||
|
||||
deleteByVisaId(req.getVisaId(), Lists.newArrayList(VisaRelationFieldEnum.IM_GROUP_PARTICIPATE));
|
||||
if (Boolean.TRUE.equals(req.getClearAll())) {
|
||||
deleteByVisaId(req.getVisaId(), Lists.newArrayList(VisaRelationFieldEnum.IM_GROUP_PARTICIPATE));
|
||||
} else {
|
||||
List<ChangeRecordRelation> byCondition = findByCondition(VisaRelationDto.builder()
|
||||
.visaId(req.getVisaId())
|
||||
.varName(VisaRelationFieldEnum.IM_GROUP_PARTICIPATE.getCode())
|
||||
.content(String.valueOf(req.getOperatorOuId()))
|
||||
.contentExt(NumberUtil.isPositiveNumber(req.getOperatorWorkspaceId()) ? String.valueOf(req.getOperatorWorkspaceId()) : null)
|
||||
.createBy(req.getOperatorPersonId())
|
||||
.build());
|
||||
removeByIds(byCondition.stream().map(ChangeRecordRelation::getVisaId).collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -172,6 +207,7 @@ public class ChangeRecordRelationServiceImpl extends ServiceImpl<ChangeRecordRel
|
||||
|
||||
ImGroupTipsResp resp = new ImGroupTipsResp();
|
||||
resp.setStatus(record.getStatus());
|
||||
resp.setStatusText(record.getStatus().getDesc());
|
||||
List<ChangeRecordRelation> imGroupParticipate = findByCondition(VisaRelationDto.builder()
|
||||
.visaId(req.getVisaId())
|
||||
.varName(VisaRelationFieldEnum.IM_GROUP_PARTICIPATE.getCode())
|
||||
|
||||
@ -31,7 +31,7 @@ import cn.axzo.nanopart.visa.api.enums.VisaStatusEnum;
|
||||
import cn.axzo.nanopart.visa.api.enums.VisaTypeEnum;
|
||||
import cn.axzo.nanopart.visa.api.request.ChangeRecordButtonOperationReq;
|
||||
import cn.axzo.nanopart.visa.api.request.ChangeStatusRequest;
|
||||
import cn.axzo.nanopart.visa.api.request.ImGroupOperationReq;
|
||||
import cn.axzo.nanopart.visa.api.request.ImGroupOperationClearReq;
|
||||
import cn.axzo.nanopart.visa.api.request.VisaChangeApproveCreateReq;
|
||||
import cn.axzo.nanopart.visa.api.request.VisaChangeApproveOnlyReq;
|
||||
import cn.axzo.nanopart.visa.api.request.VisaChangeDiscussCreateReq;
|
||||
@ -123,7 +123,9 @@ import static cn.axzo.nanopart.visa.api.constant.VisaConstant.FORM_FIELD_RELATIO
|
||||
import static cn.axzo.nanopart.visa.api.constant.VisaConstant.FORM_FIELD_RELATION_TASK_ORDER;
|
||||
import static cn.axzo.nanopart.visa.api.constant.VisaConstant.FORM_FIELD_RELATION_VISA_ORDER;
|
||||
import static cn.axzo.nanopart.visa.api.constant.VisaConstant.FORM_FIELD_TOPIC;
|
||||
import static cn.axzo.nanopart.visa.api.constant.VisaConstant.IM_GROUP_BIZ_INFO_RECORD_ID;
|
||||
import static cn.axzo.nanopart.visa.api.constant.VisaConstant.IM_GROUP_BIZ_INFO_OWNER_WORKSPACE_ID;
|
||||
import static cn.axzo.nanopart.visa.api.constant.VisaConstant.IM_GROUP_BIZ_INFO_VISA_ID;
|
||||
import static cn.axzo.nanopart.visa.api.constant.VisaConstant.IM_GROUP_BIZ_INFO_VISA_TYPE;
|
||||
import static cn.axzo.nanopart.visa.api.constant.VisaConstant.WORKFLOW_PENDING_TOPIC;
|
||||
import static cn.axzo.nanopart.visa.api.constant.VisaConstant.WORKFLOW_VAR_VISA_TYPE_KEY;
|
||||
|
||||
@ -474,14 +476,16 @@ public class ChangeRecordServiceImpl extends ServiceImpl<ChangeRecordDao, Change
|
||||
changeRecord.setUpdateBy(req.getOperatorPersonId());
|
||||
save(changeRecord);
|
||||
// 发起人
|
||||
confirmPerson.add(buildVisaConfirmDto(req, changeRecord));
|
||||
confirmPerson.add(buildCreateVisaConfirmDto(req, changeRecord));
|
||||
} else {
|
||||
/*编辑*/
|
||||
oldContext = new VisaAddLogContext();
|
||||
changeRecord = getById(req.getId());
|
||||
AssertUtil.notNull(changeRecord, "记录不存在");
|
||||
AssertUtil.isTrue(changeRecord.getStatus() == VisaStatusEnum.TO_REPORT, "当前状态下不允许编辑");
|
||||
oldContext.setChangeRecord(changeRecord);
|
||||
|
||||
oldContext = new VisaAddLogContext();
|
||||
oldContext.setStatus(changeRecord.getStatus());
|
||||
oldContext.setChangeRecord(BeanUtil.copyProperties(changeRecord, ChangeRecord.class));
|
||||
/*更新主记录*/
|
||||
BeanUtil.copyProperties(req, changeRecord);
|
||||
changeRecord.setUpdateBy(req.getOperatorPersonId());
|
||||
@ -503,7 +507,7 @@ public class ChangeRecordServiceImpl extends ServiceImpl<ChangeRecordDao, Change
|
||||
// 相关单位与人员
|
||||
if (CollectionUtils.isNotEmpty(req.getRelationUnitAndPersonList())) {
|
||||
confirmPerson = req.getRelationUnitAndPersonList().stream()
|
||||
.map(p -> buildVisaConfirmDto(p, changeRecord))
|
||||
.map(p -> buildConfirmVisaConfirmDto(p, changeRecord, req.getOperatorPersonId()))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
changeRecordConfirmService.addConfirm(confirmPerson);
|
||||
@ -582,7 +586,9 @@ public class ChangeRecordServiceImpl extends ServiceImpl<ChangeRecordDao, Change
|
||||
// 群头像
|
||||
request.setAvatar("https://axzo-obs-public.obs.cn-north-4.myhuaweicloud.com:443/obs-public/obs-public/visa-group.png");
|
||||
request.setMemberLimit(100L);
|
||||
request.setBizGroupInfo(Maps.of(IM_GROUP_BIZ_INFO_RECORD_ID, visaId));
|
||||
request.setBizGroupInfo(Maps.of(IM_GROUP_BIZ_INFO_VISA_ID, visaId,
|
||||
IM_GROUP_BIZ_INFO_OWNER_WORKSPACE_ID, req.getRelationWorkspaceId(),
|
||||
IM_GROUP_BIZ_INFO_VISA_TYPE, req.getType().getCode()));
|
||||
GroupCreateResponse imGroup = msgCenterGateway.createImGroup(request);
|
||||
|
||||
updateImInfo(visaId, imGroup);
|
||||
@ -935,7 +941,7 @@ public class ChangeRecordServiceImpl extends ServiceImpl<ChangeRecordDao, Change
|
||||
}
|
||||
}
|
||||
|
||||
private static VisaConfirmDto buildVisaConfirmDto(VisaChangeTempCreateReq req, ChangeRecord changeRecord) {
|
||||
private static VisaConfirmDto buildCreateVisaConfirmDto(VisaChangeTempCreateReq req, ChangeRecord changeRecord) {
|
||||
return VisaConfirmDto.builder()
|
||||
.visaId(changeRecord.getId())
|
||||
.type(SaasCooperateShipCooperateTypeEnum.getByCode(req.getOperatorOuType()))
|
||||
@ -944,10 +950,11 @@ public class ChangeRecordServiceImpl extends ServiceImpl<ChangeRecordDao, Change
|
||||
.ouId(req.getOperatorOuId())
|
||||
.workspaceId(req.getRelationWorkspaceId())
|
||||
.projectId(req.getRelationProject())
|
||||
.operator(req.getOperatorPersonId())
|
||||
.build();
|
||||
}
|
||||
|
||||
private static VisaConfirmDto buildVisaConfirmDto(VisaChangeTempCreateReq.RelationUnitAndPerson person, ChangeRecord changeRecord) {
|
||||
private static VisaConfirmDto buildConfirmVisaConfirmDto(VisaChangeTempCreateReq.RelationUnitAndPerson person, ChangeRecord changeRecord, Long operator) {
|
||||
return VisaConfirmDto.builder()
|
||||
.visaId(changeRecord.getId())
|
||||
.type(person.getType())
|
||||
@ -957,6 +964,7 @@ public class ChangeRecordServiceImpl extends ServiceImpl<ChangeRecordDao, Change
|
||||
.workspaceId(changeRecord.getRelationWorkspaceId())
|
||||
.projectId(changeRecord.getRelationProject())
|
||||
.nodeId(person.getNodeId())
|
||||
.operator(operator)
|
||||
.build();
|
||||
}
|
||||
|
||||
@ -1187,10 +1195,11 @@ public class ChangeRecordServiceImpl extends ServiceImpl<ChangeRecordDao, Change
|
||||
public void reDecision(ChangeRecordButtonOperationReq req) {
|
||||
validOperationPermission(req.getVisaId(), req.getOperatorPersonId(), req.getOperatorOuId(), req.getOperatorWorkspaceId());
|
||||
|
||||
changeRecordRelationService.clearImOperationParticipate(ImGroupOperationReq.builder()
|
||||
.visaId(req.getVisaId())
|
||||
.imGroupId(req.getImGroupId())
|
||||
.build());
|
||||
ImGroupOperationClearReq build = new ImGroupOperationClearReq();
|
||||
build.setVisaId(req.getVisaId());
|
||||
build.setImGroupId(req.getImGroupId());
|
||||
build.setClearAll(true);
|
||||
changeRecordRelationService.clearImOperationParticipate(build);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Loading…
Reference in New Issue
Block a user