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

es支持

上级 d1b16bea
......@@ -18,6 +18,9 @@ import com.alibaba.fastjson.annotation.JSONField;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
<#if de.getUserTag()?? && de.getUserTag()=='elasticsearch'>
import org.elasticsearch.index.query.QueryBuilders;
</#if>
<#comment>SQL存储-Mybatis</#comment>
<#if de.getStorageMode()==1>
......@@ -91,6 +94,8 @@ public class ${item.codeName}SearchContext extends QueryWrapperContext<${item.co
<#assign valueSeparator=getInCondSeparator(formitem)>
this.getSearchCond().notIn("${formitem.getPSDEField().getName()?lower_case}",this.${formitem.getName()?lower_case}.split("${valueSeparator}"));
</#if>
<#comment>构造es查询条件</#comment>
<@esqueryCond formitem/>
}
}
</#if>
......@@ -203,6 +208,8 @@ public class ${item.codeName}SearchContext extends QueryBuildContext {
<#assign valueSeparator=getInCondSeparator(formitem)>
this.getSearchCond().and("${formitem.getPSDEField().getName()?lower_case}").notIn(this.${formitem.getName()?lower_case}.split("${valueSeparator}")));
</#if>
<#comment>构造es查询条件</#comment>
<@esqueryCond formitem/>
}
}
</#if>
......@@ -319,4 +326,34 @@ public class ${item.codeName}SearchContext extends SearchContextBase {
<#return valueSeparator/>
</#function>
<#comment>构造es查询条件</#comment>
<#macro esqueryCond formitem>
<#if de.getUserTag()?? && de.getUserTag()=='elasticsearch'>
<#if formitem.getValueOp() == "LIKE">
this.getEsCond().must(QueryBuilders.wildcardQuery("${formitem.getPSDEField().getName()?lower_case}", String.format("*%s*",${formitem.getName()?lower_case})));
<#elseif formitem.getValueOp() == "LEFTLIKE">
this.getEsCond().must(QueryBuilders.wildcardQuery("${formitem.getPSDEField().getName()?lower_case}", String.format("%s*",${formitem.getName()?lower_case})));
<#elseif formitem.getValueOp() == "RIGHTLIKE">
this.getEsCond().must(QueryBuilders.wildcardQuery("${formitem.getPSDEField().getName()?lower_case}", String.format("*%s",${formitem.getName()?lower_case})));
<#elseif formitem.getValueOp() == "EQ">
this.getEsCond().must(QueryBuilders.termQuery("${formitem.getPSDEField().getName()?lower_case}", ${formitem.getName()?lower_case}));
<#elseif formitem.getValueOp() == "NOTEQ">
this.getEsCond().mustNot(QueryBuilders.termQuery("${formitem.getPSDEField().getName()?lower_case}", ${formitem.getName()?lower_case}));
<#elseif formitem.getValueOp() == "GT">
this.getEsCond().must(QueryBuilders.rangeQuery("${formitem.getPSDEField().getName()?lower_case}").gt(${formitem.getName()?lower_case}));
<#elseif formitem.getValueOp() == "GTANDEQ">
this.getEsCond().must(QueryBuilders.rangeQuery("${formitem.getPSDEField().getName()?lower_case}").gte(${formitem.getName()?lower_case}));
<#elseif formitem.getValueOp() == "LT">
this.getEsCond().must(QueryBuilders.rangeQuery("${formitem.getPSDEField().getName()?lower_case}").lt(${formitem.getName()?lower_case}));
<#elseif formitem.getValueOp() == "LTANDEQ">
this.getEsCond().must(QueryBuilders.rangeQuery("${formitem.getPSDEField().getName()?lower_case}").lte(${formitem.getName()?lower_case}));
<#elseif formitem.getValueOp() == "ISNOTNULL">
this.getEsCond().mustNot(QueryBuilders.existsQuery("${formitem.getPSDEField().getName()?lower_case}"));
<#elseif formitem.getValueOp() == "ISNULL">
this.getEsCond().must(QueryBuilders.existsQuery("${formitem.getPSDEField().getName()?lower_case}"));
<#elseif formitem.getValueOp() == "IN">
<#elseif formitem.getValueOp() == "NOTIN">
</#if>
</#if>
</#macro>
<#ibiztemplate>
TARGET=PSDATAENTITY
</#ibiztemplate>
<#if de.getUserTag()?? && de.getUserTag()=='elasticsearch'>
package ${pub.getPKGCodeName()}.core.${de.getPSSystemModule().codeName?lower_case}.mapping;
import ${pub.getPKGCodeName()}.core.${de.getPSSystemModule().codeName?lower_case}.domain.${item.codeName};
import org.mapstruct.Mapper;
import org.mapstruct.NullValueCheckStrategy;
import org.mapstruct.NullValuePropertyMappingStrategy;
import java.util.List;
@Mapper(componentModel = "spring", uses = {},implementationName="${item.codeName}ESMapping",
nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE,
nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface ${item.codeName}ESMapping{
${item.codeName} toDomain(${pub.getPKGCodeName()}.core.es.domain.${item.codeName} esEntity);
${pub.getPKGCodeName()}.core.es.domain.${item.codeName} toESDomain(${item.codeName} entity);
List<${item.codeName}> toDomain(List<${pub.getPKGCodeName()}.core.es.domain.${item.codeName}> esEntityList);
List<${pub.getPKGCodeName()}.core.es.domain.${item.codeName}> toESDomain(List<${item.codeName}> entityList);
}
</#if>
......@@ -954,6 +954,9 @@ public class ${item.getCodeName()}ServiceImpl extends ServiceImpl<${de.getCodeNa
return true;
}
</#if>
<#comment>发布es服务对象</#comment>
<@esAnno/>
}
<#comment>NOSQL存储</#comment>
......@@ -1444,6 +1447,9 @@ public class ${item.getCodeName()}ServiceImpl implements I${de.getCodeName()}Ser
<#comment>实体数据导入</#comment>
<@deImportData/>
<#comment>发布es服务对象</#comment>
<@esAnno/>
}
......@@ -2814,4 +2820,33 @@ public class ${item.getCodeName()}ServiceImpl implements I${de.getCodeName()}Ser
<#return unionKeyResult>
</#function>
<#comment>发布es对象</#comment>
<#macro esAnno>
<#if de.getUserTag()?? && de.getUserTag()=='elasticsearch'>
@Autowired
@Lazy
${pub.getPKGCodeName()}.core.es.service.I${de.codeName}Service esService;
@Autowired
@Lazy
${pub.getPKGCodeName()}.core.${de.getPSSystemModule().codeName?lower_case}.mapping.${de.codeName}ESMapping esMapping;
/**
* 获取es service
* @return
*/
public ${pub.getPKGCodeName()}.core.es.service.I${de.codeName}Service getESService(){
return esService;
}
/**
* 获取es mapping
* @return
*/
public ${pub.getPKGCodeName()}.core.${de.getPSSystemModule().codeName?lower_case}.mapping.${de.codeName}ESMapping getESMapping(){
return esMapping;
}
</#if>
</#macro>
</#if>
<#ibiztemplate>
TARGET=PSDATAENTITY
</#ibiztemplate>
<#if de.getUserTag()?? && de.getUserTag()=='elasticsearch'>
package ${pub.getPKGCodeName()}.core.es.dao;
import ${pub.getPKGCodeName()}.core.es.domain.${item.getCodeName()};
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;
import org.springframework.stereotype.Repository;
/**
* 实体[${item.getLogicName()}]
*/
@Repository
public class ${item.getCodeName()}Repository extends ElasticsearchRepository<${item.getCodeName()}, String>{
}
</#if>
<#ibiztemplate>
TARGET=PSDATAENTITY
</#ibiztemplate>
<#if de.getUserTag()?? && de.getUserTag()=='elasticsearch'>
package ${pub.getPKGCodeName()}.core.es.domain;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.math.BigInteger;
import java.util.HashMap;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.util.ObjectUtils;
import org.springframework.util.DigestUtils;
import java.io.Serializable;
import lombok.*;
import org.springframework.data.annotation.Transient;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
@Document(indexName = "${sys.codeName}", type = "${item.codeName}", shards = 5, replicas = 1)
public class ${item.codeName} implements Serializable {
private static final long serialVersionUID = 1L;
<#if de.getPSDEFields()??>
<#comment>输出实体属性</#comment>
<#list de.getPSDEFields() as defield>
<#assign privateCodeName = srfcaseformat(defield.getCodeName(),'l_u2lC') >
<#assign javaType=srfr7javatype(defield.getStdDataType())>
<#assign esType="FieldType.Text">
<#if javaType=='Long'>
<#assign esType="FieldType.Long">
<#elseif javaType=='Integer'>
<#assign esType="FieldType.Integer">
<#elseif javaType=='Double'|| javaType=='BigDecimal'>
<#assign esType="FieldType.Double">
<#elseif javaType=='Timestamp'>
<#assign esType="FieldType.Date">
</#if>
@Field(type = ${esType})
private ${javaType} ${privateCodeName};
</#list>
</#if>
}
</#if>
<#ibiztemplate>
TARGET=PSDATAENTITY
</#ibiztemplate>
<#if de.getUserTag()?? && de.getUserTag()=='elasticsearch'>
package ${pub.getPKGCodeName()}.core.es.service;
import java.io.Serializable;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import java.util.Collection;
import java.math.BigInteger;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.scheduling.annotation.Async;
import com.alibaba.fastjson.JSONObject;
import org.springframework.cache.annotation.CacheEvict;
import ${pub.getPKGCodeName()}.core.es.domain.${item.codeName};
import ${pub.getPKGCodeName()}.core.${de.getPSSystemModule().getCodeName()?lower_case}.filter.${de.getCodeName()}SearchContext;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* 实体[${item.codeName}] 服务对象接口
*/
public interface I${item.codeName}Service extends IService<${item.codeName}>{
<@addIDESerivceBody />
}
<#macro addIDESerivceBody >
<#comment>实体接口主体内容</#comment>
<#assign keyfield=item.getKeyPSDEField()>
<#if item.getAllPSDEActions()??>
<#list item.getAllPSDEActions() as deaction>
<#if deaction.isEnableBackend()>
<#if deaction.codeName?lower_case == 'get'>
${item.codeName} get(${srfr7javatype(keyfield.stdDataType)} key) ;
<#elseif deaction.codeName?lower_case == "create">
boolean create(${item.codeName} et) ;
void createBatch(List<${item.codeName}> list) ;
<#elseif deaction.codeName?lower_case == "update">
boolean update(${item.codeName} et) ;
void updateBatch(List<${item.codeName}> list) ;
<#elseif deaction.codeName?lower_case == "remove">
boolean remove(${srfr7javatype(keyfield.stdDataType)} key) ;
void removeBatch(Collection<${srfr7javatype(keyfield.stdDataType)}> idList) ;
<#elseif deaction.codeName?lower_case == "save">
boolean save(${item.codeName} et) ;
void saveBatch(List<${item.codeName}> list) ;
</#if>
</#if>
</#list>
</#if>
<#if item.getAllPSDEDataSets()??>
<#list item.getAllPSDEDataSets() as dedataset>
Page<${item.getCodeName()}> search${dedataset.getCodeName()}(${item.codeName}SearchContext context) ;
</#list>
</#if>
</#macro>
</#if>
\ No newline at end of file
<#ibiztemplate>
TARGET=PSDATAENTITY
</#ibiztemplate>
<#if de.getUserTag()?? && de.getUserTag()=='elasticsearch'>
package ${pub.getPKGCodeName()}.core.es.service.impl;
import com.google.common.collect.Lists;
import ${pub.getPKGCodeName()}.core.es.dao.HumanRepository;
import ${pub.getPKGCodeName()}.core.es.domain.Human;
import ${pub.getPKGCodeName()}.core.es.service.IHumanService;
import ${pub.getPKGCodeName()}.core.valuerule.filter.HumanSearchContext;
import ${pub.getPKGCodeName()}.util.helper.CachedBeanCopier;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Optional;
/**
* 实体[${item.getLogicName()}] 服务对象接口实现
*/
@Slf4j
@Service("${item.getCodeName()}ServiceImpl")
public class ${item.getCodeName()}ServiceImpl implements I${de.getCodeName()}Service {
@Autowired
@Lazy
${item.getCodeName()}Repository repository;
<#assign keyfield=de.getKeyPSDEField()>
<#comment>输出实体行为</#comment>
<#if item.getAllPSDEActions()??>
<#list item.getAllPSDEActions() as deaction>
<#if deaction.getCodeName()?lower_case == 'get'>
@Override
public ${item.getCodeName()} get(${srfr7javatype(keyfield.stdDataType)} key) {
Optional<${item.getCodeName()}> result = repository.findById(key);
if(!result.isPresent()){
${item.getCodeName()} et=new ${item.getCodeName()}();
et.set${srfcaseformat(keyfield.codeName,'l_u2lC')?cap_first}(key);
return et;
}
else{
${item.getCodeName()} et=result.get();
return et;
}
}
<#elseif deaction.getCodeName()?lower_case == "create">
@Override
public boolean create(${item.getCodeName()} et) {
repository.save(et);
CachedBeanCopier.copy(get(et.get${srfcaseformat(keyfield.codeName,'l_u2lC')?cap_first}()),et);
return true;
}
@Override
public void createBatch(List<${item.getCodeName()}> list) {
}
<#elseif deaction.getCodeName()?lower_case == "update">
@Override
public boolean update(${item.getCodeName()} et) {
repository.save(et);
CachedBeanCopier.copy(get(et.get${srfcaseformat(keyfield.codeName,'l_u2lC')?cap_first}()),et);
return true;
}
@Override
public void updateBatch(List<${item.getCodeName()}> list) {
}
<#elseif deaction.getCodeName()?lower_case == "save">
@Override
public boolean save(${item.getCodeName()} et) {
repository.save(et);
CachedBeanCopier.copy(get(et.get${srfcaseformat(keyfield.codeName,'l_u2lC')?cap_first}()),et);
return true;
}
@Override
public void saveBatch(List<${item.getCodeName()}> list) {
}
<#elseif deaction.getCodeName()?lower_case == "remove">
@Override
public boolean remove(${srfr7javatype(keyfield.stdDataType)} key) {
repository.deleteById(key);
return true;
}
@Override
public void removeBatch(Collection<${srfr7javatype(keyfield.stdDataType)}> idList) {
}
</#if>
</#list>
</#if>
<#comment>输出实体数据集</#comment>
<#if item.getAllPSDEDataSets()??>
<#list item.getAllPSDEDataSets() as dedataset>
public Page<${item.getCodeName()}> search${dedataset.getCodeName()}(${item.codeName}SearchContext context){
Iterable<${item.getCodeName()}> list= repository.search(context.getEsCond());
List<${item.getCodeName()}> entities = Lists.newArrayList(list);
return new PageImpl<${item.getCodeName()}>(entities,context.getPageable(),entities.size());
}
</#list>
</#if>
}
</#if>
\ No newline at end of file
......@@ -8,6 +8,13 @@ TARGET=PSSYSTEM
<#break>
</#if>
</#list>
<#assign hasESEntity=false>
<#list sys.getAllPSDataEntities() as dataEntity>
<#if dataEntity.getUserTag()?? && dataEntity.getUserTag()=='elasticsearch'>
<#assign hasESEntity=true>
<#break>
</#if>
</#list>
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
......@@ -422,6 +429,12 @@ TARGET=PSSYSTEM
</dependency>
</#if>
<#if hasESEntity>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-elasticsearch</artifactId>
</dependency>
</#if>
</dependencies>
</project>
......@@ -312,9 +312,46 @@ public class ${itemCodeName}Resource {
.body(new PageImpl(${itemCodeNameLC}Mapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
</#if>
}
<#if de.getUserTag()?? && de.getUserTag()=='elasticsearch'>
<@DataQuerySecurityAnnotation deds/>
@ApiOperation(value = "获取${deds.getLogicName()}", tags = {"${deLogicName}" } ,notes = "获取${deds.getLogicName()}")
@RequestMapping(method= RequestMethod.${reqMtd} , value="${fullPath}/fetch<#if (deds.getName()=='DEFAULT')>${deds.getCodeName()?lower_case}<#else>${deds.getCodeName()?lower_case}</#if>/es")
public ResponseEntity<List<${itemCodeName}DTO>> ESFetch<#if (deds.getName()=='DEFAULT')>${deds.getCodeName()}<#else>${deds.getCodeName()}</#if>(${deCodeName}SearchContext context) {
Page<${pub.getPKGCodeName()}.core.es.domain.${item.codeName}> domains = esService.search${deds.getCodeName()}(context) ;
List<${itemCodeName}DTO> list = ${itemCodeNameLC}Mapping.toDto(esMapping.toDomain(domains.getContent()));
return ResponseEntity.status(${statusCode})
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
</#if>
</#if>
</#list>
</#if>
<#comment>es get行为</#comment>
<#if de.getUserTag()?? && de.getUserTag()=='elasticsearch'>
@Autowired
@Lazy
${pub.getPKGCodeName()}.core.es.service.I${de.codeName}Service esService;
@Autowired
@Lazy
${pub.getPKGCodeName()}.core.${de.getPSSystemModule().codeName?lower_case}.mapping.${de.codeName}ESMapping esMapping;
<@SecurityAnnotation deaction/>
@ApiOperation(value = "获取${deLogicName}", tags = {"${deLogicName}" }, notes = "获取${deLogicName}")
@RequestMapping(method = RequestMethod.GET, value = "${fullPath}/{${itemCodeNameLC + keyCNLC}}/es")
public ResponseEntity<${itemCodeName}DTO> ESGet(${idParams}) {
${pub.getPKGCodeName()}.core.es.domain.${item.codeName} domain = esService.get(${itemCodeNameLC + keyCNLC});
${itemCodeName}DTO dto = ${itemCodeNameLC}Mapping.toDto(esMapping.toDomain(domain));
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
</#if>
</#if>
<#-- 主接口 end -->
<#-- 关系接口 start -->
......
<#ibiztemplate>
TARGET=PSDATAENTITY
</#ibiztemplate>
<#assign hasESEntity=false>
<#list sys.getAllPSDataEntities() as dataEntity>
<#if dataEntity.getUserTag()?? && dataEntity.getUserTag()=='elasticsearch'>
<#assign hasESEntity=true>
<#break>
</#if>
</#list>
<#if hasESEntity==true>
package ${pub.getPKGCodeName()}.util.es.aspect;
import lombok.extern.slf4j.Slf4j;
import ${pub.getPKGCodeName()}.util.domain.EntityBase;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.expression.EvaluationContext;
import org.springframework.expression.Expression;
import org.springframework.expression.ExpressionParser;
import org.springframework.expression.spel.standard.SpelExpressionParser;
import org.springframework.expression.spel.support.StandardEvaluationContext;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import java.util.List;
/**
* es同步数据切面
*/
@Aspect
@Component
@Slf4j
public class ESAspect
{
private final ExpressionParser parser = new SpelExpressionParser();
<#list sys.getAllPSDataEntities() as dataEntity>
<#if dataEntity.getUserTag()?? && dataEntity.getUserTag()=='elasticsearch'>
/**
* 实体[${dataEntity.codeName}]es切面
* @param point
*/
@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.es.service.*.create*(..)) && !execution(* ${pub.getPKGCodeName()}.core.es.service.*.update*(..)) && !execution(* ${pub.getPKGCodeName()}.core.es.service.*.save*(..))")
@Async
public void Sync${dataEntity.codeName?lower_case?cap_first}(JoinPoint point){
syncSaveESData(point,"${dataEntity.codeName}");
}
</#if>
</#list>
/**
* 异步往es中保存数据
* @param point
*/
public void syncSaveESData(JoinPoint point,String deName){
try {
Object service=point.getTarget();
String action=point.getSignature().getName();
Object [] args = point.getArgs();
if(ObjectUtils.isEmpty(args) || args.length==0 || StringUtils.isEmpty(action))
return;
EvaluationContext exServiceCtx = new StandardEvaluationContext();
exServiceCtx.setVariable("service",service);
Expression esServiceExp = parser.parseExpression("#service.getESService()");
Object exService=esServiceExp.getValue(exServiceCtx);
if(ObjectUtils.isEmpty(exService)){
log.error("获取[{}]实体全文检索服务对象失败",deName);
return;
}
Object arg=args[0];
if(arg instanceof EntityBase || arg instanceof List){
EvaluationContext exMappingCtx = new StandardEvaluationContext();
exMappingCtx.setVariable("service",service);
Expression esMappingExp = parser.parseExpression("#service.getESMapping()");
Object exMapping=esMappingExp.getValue(exMappingCtx);
if(ObjectUtils.isEmpty(exMapping)){
log.error("获取[{}]实体全文检索映射对象失败",deName);
return;
}
EvaluationContext exDomainCtx = new StandardEvaluationContext();
exDomainCtx.setVariable("mapping",exMapping);
exDomainCtx.setVariable("arg",arg);
Expression esDomainExp = parser.parseExpression("#mapping.toESDomain(#arg)");
arg=esDomainExp.getValue(exDomainCtx);
EvaluationContext esContext = new StandardEvaluationContext();
esContext.setVariable("exService",exService);
esContext.setVariable("arg",arg);
Expression exExp = parser.parseExpression(String.format("#exService.%s(#arg)",action));
exExp.getValue(esContext);
}
} catch (Exception e) {
log.error("保存[{}]实体全文检索数据失败,{}",deName,e);
}
}
}
</#if>
\ No newline at end of file
<#ibiztemplate>
TARGET=PSSYSTEM
</#ibiztemplate>
<#assign hasESEntity=false>
<#list sys.getAllPSDataEntities() as dataEntity>
<#if dataEntity.getUserTag()?? && dataEntity.getUserTag()=='elasticsearch'>
<#assign hasESEntity=true>
<#break>
</#if>
</#list>
package ${pub.getPKGCodeName()}.util.filter;
import ${pub.getPKGCodeName()}.util.security.AuthenticationUser;
......@@ -70,7 +77,12 @@ public class SearchContextBase implements ISearchContext{
* 工作流流程标识
*/
public String processDefinitionKey;
<#if hasESEntity>
/**
* es查询条件
*/
public BoolQueryBuilder esCond=new BoolQueryBuilder();
</#if>
/**
* 获取工作流步骤标识
*/
......
......@@ -26,7 +26,13 @@ TARGET=PSSYSTEM
<#break>
</#if>
</#list>
<#assign hasESEntity=false>
<#list sys.getAllPSDataEntities() as dataEntity>
<#if dataEntity.getUserTag()?? && dataEntity.getUserTag()=='elasticsearch'>
<#assign hasESEntity=true>
<#break>
</#if>
</#list>
<#assign TcServerCluster="default">
<#assign seataServerName="seata-server">
<#assign nacosAddress="localhost">
......@@ -219,6 +225,11 @@ spring:
mongodb:
uri: ${mongodbUri}
</#if>
<#if hasESEntity>
elasticsearch:
repositories:
enabled: true
</#if>
<#if bDynamicDS>
<@dynamicDatasourceConfig/>
<#else>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册