提交 b2c0873f 编写于 作者: zhouweidong's avatar zhouweidong

消息队列切点

上级 0d7a9bbb
......@@ -78,7 +78,7 @@ public class RocketMQAspect
<#list dataEntity.getAllPSDEDataSyncs() as dataSync>
<#if dataSync.getOutPSSysDataSyncAgent?? && dataSync.getOutPSSysDataSyncAgent()??>
<#assign producer=dataEntity.codeName+dataSync.codeName>
@AfterReturning(value = "(execution(* ${pub.getPKGCodeName()}.core.*.service.*${dataEntity.codeName}*.create*(..))||execution(* ${pub.getPKGCodeName()}.core.*.service.*${dataEntity.codeName}*.update*(..))||execution(* ${pub.getPKGCodeName()}.core.*.service.*${dataEntity.codeName}*.save*(..)) ||execution(* ${pub.getPKGCodeName()}.core.*.service.*${dataEntity.codeName}*.remove*(..))) && !execution(* ${pub.getPKGCodeName()}.core.es.service.*.create*(..)) && !execution(* ${pub.getPKGCodeName()}.core.es.service.*.update*(..)) && !execution(* ${pub.getPKGCodeName()}.core.es.service.*.save*(..)) && !execution(* ${pub.getPKGCodeName()}.core.es.service.*.remove*(..))")
@AfterReturning(value = "${getPointCut(dataSync)}"
@Async
public void ${srfmethodname(producer)}(JoinPoint point) {
<#if dataSync.getOutTestPSDEAction?? && dataSync.getOutTestPSDEAction()??>
......@@ -152,4 +152,36 @@ public class RocketMQAspect
}
}
}
</#if>
\ No newline at end of file
</#if>
<#comment>数值代码表 1=新建; 2=编辑; 4=删除</#comment>
<#assign createArray = [1,3,5]>
<#assign updateArray = [2,3,6]>
<#assign deleteArray=[4,5,6]>
<#comment>输出切点</#comment>
<#function getPointCut dataSync>
<#assign result="">
<#if dataSync.getEventType?? && dataSync.getEventType()??>
<#assign type=dataSync.getEventType()>
<#assign isCreate=createArray?seq_contains(type)>
<#assign isUpdate=updateArray?seq_contains(type)>
<#assign isDelete=deleteArray?seq_contains(type)>
<#if isCreate>
<#assign result="execution(*"+pub.getPKGCodeName()+".core.*.service.*"+dataEntity.codeName+"*.create*(..))">
</#if>
<#if isUpdate>
<#if result!="">
<#assign result=result+"||">
</#if>
<#assign result=result+"execution(*"+pub.getPKGCodeName()+".core.*.service.*"+dataEntity.codeName+"*.update*(..))">
</#if>
<#if isDelete>
<#if result!="">
<#assign result=result+"||">
</#if>
<#assign result=result+"execution(*"+pub.getPKGCodeName()+".core.*.service.*"+dataEntity.codeName+"*.remove*(..))">
</#if>
</#if>
<#return "("+result+")">
</#function>
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册