Commit de807d61 authored by 赵啸非's avatar 赵啸非

修改部分pom

parent 7e49ea3f
...@@ -22,6 +22,7 @@ import com.mortals.xhx.module.platform.service.PlatformListenerService; ...@@ -22,6 +22,7 @@ import com.mortals.xhx.module.platform.service.PlatformListenerService;
import com.mortals.xhx.module.platform.service.PlatformModelinfoService; import com.mortals.xhx.module.platform.service.PlatformModelinfoService;
import com.mortals.xhx.module.platform.service.PlatformService; import com.mortals.xhx.module.platform.service.PlatformService;
import lombok.extern.apachecommons.CommonsLog; import lombok.extern.apachecommons.CommonsLog;
import lombok.extern.slf4j.Slf4j;
import org.flowable.common.engine.api.delegate.event.FlowableEngineEntityEvent; import org.flowable.common.engine.api.delegate.event.FlowableEngineEntityEvent;
import org.flowable.engine.HistoryService; import org.flowable.engine.HistoryService;
import org.flowable.engine.delegate.event.AbstractFlowableEngineEventListener; import org.flowable.engine.delegate.event.AbstractFlowableEngineEventListener;
...@@ -45,10 +46,10 @@ import java.util.stream.Collectors; ...@@ -45,10 +46,10 @@ import java.util.stream.Collectors;
* @date: 2021/9/9 10:56 * @date: 2021/9/9 10:56
*/ */
@Component @Component
@CommonsLog @Slf4j
public class GlobalProcistEndListener extends AbstractFlowableEngineEventListener { public class GlobalProcistEndListener extends AbstractFlowableEngineEventListener {
public static String ProcessEnd="1"; public static String ProcessEnd = "1";
@Autowired @Autowired
private ExtendProcinstService extendProcinstService; private ExtendProcinstService extendProcinstService;
...@@ -75,7 +76,7 @@ public class GlobalProcistEndListener extends AbstractFlowableEngineEventListene ...@@ -75,7 +76,7 @@ public class GlobalProcistEndListener extends AbstractFlowableEngineEventListene
Map<String, Object> variables = ((ProcessInstance) flowableEntityEvent.getEntity()).getProcessVariables(); Map<String, Object> variables = ((ProcessInstance) flowableEntityEvent.getEntity()).getProcessVariables();
//拷贝数据 //拷贝数据
this.updateExtendInfoToHis(processInstanceId,variables); this.updateExtendInfoToHis(processInstanceId, variables);
} }
/** /**
...@@ -83,7 +84,7 @@ public class GlobalProcistEndListener extends AbstractFlowableEngineEventListene ...@@ -83,7 +84,7 @@ public class GlobalProcistEndListener extends AbstractFlowableEngineEventListene
* *
* @param processInstanceId 流程实例id * @param processInstanceId 流程实例id
*/ */
private void updateExtendInfoToHis(String processInstanceId,Map<String, Object> variables) { private void updateExtendInfoToHis(String processInstanceId, Map<String, Object> variables) {
//1.更新历史的流程实例的扩展信息 批量更新 //1.更新历史的流程实例的扩展信息 批量更新
ExtendHisprocinstEntity extendHisProcinst = extendHisprocinstService.selectOne(new ExtendHisprocinstQuery().processInstanceId(processInstanceId), null); ExtendHisprocinstEntity extendHisProcinst = extendHisprocinstService.selectOne(new ExtendHisprocinstQuery().processInstanceId(processInstanceId), null);
if (extendHisProcinst != null && !ProcessStatusEnum.ZZ.toString().equals(extendHisProcinst.getProcessStatus())) { if (extendHisProcinst != null && !ProcessStatusEnum.ZZ.toString().equals(extendHisProcinst.getProcessStatus())) {
...@@ -111,21 +112,23 @@ public class GlobalProcistEndListener extends AbstractFlowableEngineEventListene ...@@ -111,21 +112,23 @@ public class GlobalProcistEndListener extends AbstractFlowableEngineEventListene
//发送消息或者http回调 //发送消息或者http回调
PlatformEntity modelinfoEntity = platformService.selectOne(new PlatformQuery().platformSn(extendHisProcinst.getTenantId()), null); PlatformEntity modelinfoEntity = platformService.selectOne(new PlatformQuery().platformSn(extendHisProcinst.getTenantId()), null);
if(ObjectUtils.isEmpty(modelinfoEntity)){ if (ObjectUtils.isEmpty(modelinfoEntity)) {
log.info("平台用户为空,sn:"+extendHisProcinst.getTenantId()); log.info("平台用户为空,sn:" + extendHisProcinst.getTenantId());
return; return;
} }
//校验当前平台用户是否订阅了流程终结消息 //校验当前平台用户是否订阅了流程终结消息
Set<String> collect = platformListenerService.find(new PlatformListenerQuery().platformId(modelinfoEntity.getId())).stream().map(item -> item.getTypeCode()).collect(Collectors.toSet()); Set<String> collect = platformListenerService.find(new PlatformListenerQuery().platformId(modelinfoEntity.getId())).stream().map(item -> item.getTypeCode()).collect(Collectors.toSet());
if(!collect.contains(ProcessEnd)){ if (!collect.contains(ProcessEnd)) {
log.info("当前平台用户未订阅流程结束通知,sn:"+modelinfoEntity.getPlatformSn()); log.info("当前平台用户未订阅流程结束通知,sn:" + modelinfoEntity.getPlatformSn());
return; return;
} }
log.info("发送消息或者http回调,type:{}", modelinfoEntity.getType());
//手动终止撤销的不触发通知消息 //手动终止撤销的不触发通知消息
if (!ObjectUtils.isEmpty(modelinfoEntity)&&!ProcessStatusEnum.ZZ.toString().equals(extendHisProcinst.getProcessStatus())) { if (!ObjectUtils.isEmpty(modelinfoEntity)
&& !ProcessStatusEnum.ZZ.toString().equals(extendHisProcinst.getProcessStatus())) {
if (PlatformTypeEnum.HTTP.getValue() == modelinfoEntity.getType()) { if (PlatformTypeEnum.HTTP.getValue() == modelinfoEntity.getType()) {
//http //http
FlowMessageReq flowMessageReq = new FlowMessageReq(); FlowMessageReq flowMessageReq = new FlowMessageReq();
...@@ -135,7 +138,7 @@ public class GlobalProcistEndListener extends AbstractFlowableEngineEventListene ...@@ -135,7 +138,7 @@ public class GlobalProcistEndListener extends AbstractFlowableEngineEventListene
flowMessageReq.setBusinessKey(extendHisProcinst.getBusinessKey()); flowMessageReq.setBusinessKey(extendHisProcinst.getBusinessKey());
if(historicProcessInstance!=null&&historicProcessInstance.getProcessVariables()!=null){ if (historicProcessInstance != null && historicProcessInstance.getProcessVariables() != null) {
flowMessageReq.setContent(JSON.toJSONString(variables)); flowMessageReq.setContent(JSON.toJSONString(variables));
} }
...@@ -166,7 +169,7 @@ public class GlobalProcistEndListener extends AbstractFlowableEngineEventListene ...@@ -166,7 +169,7 @@ public class GlobalProcistEndListener extends AbstractFlowableEngineEventListene
} catch (InterruptedException interruptedException) { } catch (InterruptedException interruptedException) {
interruptedException.printStackTrace(); interruptedException.printStackTrace();
} }
doPostMessage(url,flowMessageReq); doPostMessage(url, flowMessageReq);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment