|
|
@@ -1,31 +1,13 @@
|
|
|
package com.lc.ibps.bpmn.listener;
|
|
|
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.Date;
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
-
|
|
|
-import javax.annotation.Resource;
|
|
|
-
|
|
|
-import org.activiti.engine.impl.entity.SubProcessStartOrEndEventModel;
|
|
|
-import org.apache.commons.lang3.StringUtils;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.context.ApplicationListener;
|
|
|
-import org.springframework.core.Ordered;
|
|
|
-import org.springframework.stereotype.Service;
|
|
|
-
|
|
|
import com.lc.ibps.api.base.model.User;
|
|
|
import com.lc.ibps.base.core.exception.BaseException;
|
|
|
import com.lc.ibps.base.core.util.BeanUtils;
|
|
|
import com.lc.ibps.base.core.util.string.StringValidator;
|
|
|
+import com.lc.ibps.base.saas.context.TenantContext;
|
|
|
import com.lc.ibps.bpmn.api.cmd.ActionCmd;
|
|
|
import com.lc.ibps.bpmn.api.cmd.TaskFinishCmd;
|
|
|
-import com.lc.ibps.bpmn.api.constant.ActionType;
|
|
|
-import com.lc.ibps.bpmn.api.constant.BpmConstants;
|
|
|
-import com.lc.ibps.bpmn.api.constant.BpmOperTypeEnum;
|
|
|
-import com.lc.ibps.bpmn.api.constant.ProcInstStatus;
|
|
|
-import com.lc.ibps.bpmn.api.constant.TemplateType;
|
|
|
+import com.lc.ibps.bpmn.api.constant.*;
|
|
|
import com.lc.ibps.bpmn.api.context.BpmnContextUtil;
|
|
|
import com.lc.ibps.bpmn.api.event.NotifyTaskModel;
|
|
|
import com.lc.ibps.bpmn.api.event.ProcEndEvent;
|
|
|
@@ -37,21 +19,25 @@ import com.lc.ibps.bpmn.cmd.IbpsTaskFinishCmd;
|
|
|
import com.lc.ibps.bpmn.domain.BpmApprove;
|
|
|
import com.lc.ibps.bpmn.domain.BpmInst;
|
|
|
import com.lc.ibps.bpmn.domain.BpmOperNotify;
|
|
|
-import com.lc.ibps.bpmn.persistence.entity.BpmApprovePo;
|
|
|
-import com.lc.ibps.bpmn.persistence.entity.BpmInstPo;
|
|
|
-import com.lc.ibps.bpmn.persistence.entity.BpmOperLogPo;
|
|
|
-import com.lc.ibps.bpmn.persistence.entity.BpmOperNotifyPo;
|
|
|
-import com.lc.ibps.bpmn.persistence.entity.BpmTaskSignPo;
|
|
|
-import com.lc.ibps.bpmn.repository.BpmApproveRepository;
|
|
|
-import com.lc.ibps.bpmn.repository.BpmInstHisRepository;
|
|
|
-import com.lc.ibps.bpmn.repository.BpmInstRepository;
|
|
|
-import com.lc.ibps.bpmn.repository.BpmOperNotifyRepository;
|
|
|
-import com.lc.ibps.bpmn.repository.BpmTaskSignRepository;
|
|
|
+import com.lc.ibps.bpmn.persistence.entity.*;
|
|
|
+import com.lc.ibps.bpmn.repository.*;
|
|
|
import com.lc.ibps.bpmn.utils.BpmUtil;
|
|
|
import com.lc.ibps.bpmn.utils.NotifyUtil;
|
|
|
import com.lc.ibps.cloud.entity.APIResult;
|
|
|
+import com.lc.ibps.cloud.message.util.MessageQueueProductorUtil;
|
|
|
+import com.lc.ibps.cloud.mq.core.constants.QueueConstants;
|
|
|
+import com.lc.ibps.cloud.mq.core.model.DefaultMessage;
|
|
|
import com.lc.ibps.org.api.IPartyUserService;
|
|
|
import com.lc.ibps.org.party.persistence.entity.PartyUserPo;
|
|
|
+import org.activiti.engine.impl.entity.SubProcessStartOrEndEventModel;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.context.ApplicationListener;
|
|
|
+import org.springframework.core.Ordered;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+
|
|
|
+import javax.annotation.Resource;
|
|
|
+import java.util.*;
|
|
|
|
|
|
|
|
|
/**
|
|
|
@@ -139,7 +125,7 @@ public class ProcEndEventListener implements ApplicationListener<ProcEndEvent>,O
|
|
|
/**
|
|
|
*
|
|
|
*更新流程实例状态。
|
|
|
- * @param bpmnInstId
|
|
|
+ * @param execution
|
|
|
* void
|
|
|
*/
|
|
|
private BpmInstPo updProcessInstance(BpmDelegateExecution execution){
|
|
|
@@ -178,10 +164,25 @@ public class ProcEndEventListener implements ApplicationListener<ProcEndEvent>,O
|
|
|
BpmInst bpmInstDomain = bpmInstRepository.newInstance();
|
|
|
bpmInstDomain.createHistory(instId);
|
|
|
bpmInstDomain.delete(instId);
|
|
|
-
|
|
|
+ MessageQueueProductorUtil.send(buildSnapshotMessage(instId));
|
|
|
return instance;
|
|
|
}
|
|
|
|
|
|
+ private DefaultMessage buildSnapshotMessage(String instId){
|
|
|
+ DefaultMessage<String> message = new DefaultMessage<String>();
|
|
|
+
|
|
|
+ message.setTenantId(TenantContext.getCurrentTenantId());
|
|
|
+
|
|
|
+ message.setRouting(QueueConstants.Message.ROUTING_KEY_MESSAGE_SNAPSHOT);
|
|
|
+ message.setExchange(QueueConstants.Message.EXCHANGE_MESSAGE);
|
|
|
+ message.setQueue(QueueConstants.Message.QUEUE_NAME_SNAPSHOT);
|
|
|
+
|
|
|
+ message.setData(instId);
|
|
|
+
|
|
|
+
|
|
|
+ return message;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 流程结束通知
|
|
|
*
|