提交 813697e0 编写于 作者: Tyl666's avatar Tyl666

【自定义批处理】模板编辑

上级 43a1f3f6
...@@ -115,6 +115,7 @@ public interface I${item.codeName}Service { ...@@ -115,6 +115,7 @@ public interface I${item.codeName}Service {
<#if deaction.isEnableBackend()> <#if deaction.isEnableBackend()>
<#if (deaction.getActionType()=='USERCUSTOM') > <#if (deaction.getActionType()=='USERCUSTOM') >
${item.codeName} ${srfmethodname(deaction.getCodeName())}(${item.codeName} et); ${item.codeName} ${srfmethodname(deaction.getCodeName())}(${item.codeName} et);
boolean ${srfmethodname(deaction.getCodeName())}Batch(List<${item.codeName}> etList);
<#elseif deaction.getActionType()=='DELOGIC'> <#elseif deaction.getActionType()=='DELOGIC'>
${item.codeName} ${srfmethodname(deaction.getCodeName())}(${item.codeName} et); ${item.codeName} ${srfmethodname(deaction.getCodeName())}(${item.codeName} et);
<#elseif deaction.codeName?lower_case == 'get'> <#elseif deaction.codeName?lower_case == 'get'>
......
...@@ -205,6 +205,9 @@ public class ${item.getCodeName()}ServiceImpl extends ServiceImpl<${de.getCodeNa ...@@ -205,6 +205,9 @@ public class ${item.getCodeName()}ServiceImpl extends ServiceImpl<${de.getCodeNa
return et; return et;
} }
<#comment>自定义行为批处理</#comment>
<@customBatchAction deaction/>
<#elseif deaction.getActionType()=='DELOGIC'> <#elseif deaction.getActionType()=='DELOGIC'>
@Override @Override
<@transactionalAnno deaction/> <@transactionalAnno deaction/>
...@@ -1066,6 +1069,9 @@ public class ${item.getCodeName()}ServiceImpl implements I${de.getCodeName()}Ser ...@@ -1066,6 +1069,9 @@ public class ${item.getCodeName()}ServiceImpl implements I${de.getCodeName()}Ser
return et; return et;
} }
<#comment>自定义行为批处理</#comment>
<@customBatchAction deaction/>
<#elseif deaction.getActionType()=='DELOGIC'> <#elseif deaction.getActionType()=='DELOGIC'>
@Override @Override
<@transactionalAnno deaction/> <@transactionalAnno deaction/>
...@@ -1543,6 +1549,9 @@ public class ${item.getCodeName()}ServiceImpl implements I${de.getCodeName()}Ser ...@@ -1543,6 +1549,9 @@ public class ${item.getCodeName()}ServiceImpl implements I${de.getCodeName()}Ser
return et; return et;
} }
<#comment>自定义行为批处理</#comment>
<@customBatchAction deaction/>
<#elseif deaction.getActionType()=='DELOGIC'> <#elseif deaction.getActionType()=='DELOGIC'>
@Override @Override
<@transactionalAnno deaction/> <@transactionalAnno deaction/>
...@@ -2071,6 +2080,9 @@ public class ${item.getCodeName()}ServiceImpl implements I${de.getCodeName()}Ser ...@@ -2071,6 +2080,9 @@ public class ${item.getCodeName()}ServiceImpl implements I${de.getCodeName()}Ser
return et; return et;
} }
<#comment>自定义行为批处理</#comment>
<@customBatchAction deaction/>
<#elseif deaction.getActionType()=='DELOGIC'> <#elseif deaction.getActionType()=='DELOGIC'>
@Override @Override
<@transactionalAnno deaction/> <@transactionalAnno deaction/>
...@@ -3045,4 +3057,17 @@ public class ${item.getCodeName()}ServiceImpl implements I${de.getCodeName()}Ser ...@@ -3045,4 +3057,17 @@ public class ${item.getCodeName()}ServiceImpl implements I${de.getCodeName()}Ser
<#return dupCheck> <#return dupCheck>
</#function> </#function>
<#comment>用户自定义行为批处理</#comment>
<#macro customBatchAction deaction>
@Override
<@transactionalAnno deaction/>
public boolean ${item.getCodeName()} ${srfmethodname(deaction.getCodeName())}Batch(List<${item.codeName}> etList) {
for(${item.getCodeName()} et : etList)){
${srfmethodname(deaction.getCodeName())}(et);
}
return true;
}
</#macro>
</#if> </#if>
...@@ -265,6 +265,10 @@ public class ${itemCodeName}Resource { ...@@ -265,6 +265,10 @@ public class ${itemCodeName}Resource {
</#if> </#if>
return ResponseEntity.status(HttpStatus.OK).body(${itemCodeNameLC}dto); return ResponseEntity.status(HttpStatus.OK).body(${itemCodeNameLC}dto);
} }
<#comment>自定义行为批处理</#comment>
<#if (deaction.getActionType()=='USERCUSTOM')>
<@customBatchAction deaction/>
</#if>
</#if> </#if>
<#elseif apiMethod.getActionType()=='FETCH'> <#elseif apiMethod.getActionType()=='FETCH'>
...@@ -606,7 +610,10 @@ public class ${itemCodeName}Resource { ...@@ -606,7 +610,10 @@ public class ${itemCodeName}Resource {
</#if> </#if>
return ResponseEntity.status(HttpStatus.OK).body(${itemCodeNameLC}dto); return ResponseEntity.status(HttpStatus.OK).body(${itemCodeNameLC}dto);
} }
<#comment>自定义行为批处理</#comment>
<#if (deaction.getActionType()=='USERCUSTOM')>
<@customBatchActionRS deaction/>
</#if>
</#if> </#if>
<#elseif apiMethod.getActionType()=='FETCH'> <#elseif apiMethod.getActionType()=='FETCH'>
<#assign deds = apiMethod.getPSDEDataSet()> <#assign deds = apiMethod.getPSDEDataSet()>
...@@ -993,6 +1000,26 @@ public class ${itemCodeName}Resource { ...@@ -993,6 +1000,26 @@ public class ${itemCodeName}Resource {
</#if> </#if>
</#macro> </#macro>
<#comment>用户自定义行为批处理-主实体关系</#comment>
<#macro customBatchAction deaction>
<@SecurityAnnotation deaction/>
@ApiOperation(value = "${deaction.getLogicName()}Batch", tags = {"批量处理${deLogicName}" }, notes = "${deaction.getLogicName()}Batch")
@RequestMapping(method = RequestMethod.${reqMtd}, value = "${fullPath}<#if deaction.getRequestParamType() == 'NONE'><#else>/{${itemCodeNameLC + keyCNLC}}</#if>/${deactionCodeName?lower_case}batch")
public ResponseEntity<Boolean> ${deactionCodeName?uncap_first}Batch(${etParamsList}) {
return ResponseEntity.status(HttpStatus.OK).body(${deCodeNameLC}Service.${srfmethodname(deactionCodeName)}(${itemCodeNameLC}dtos));
}
</#macro>
<#comment>用户自定义行为批处理-从实体关系</#comment>
<#macro customBatchActionRS deaction>
@ApiOperation(value = "${byTagParams}${deLogicName}Batch", tags = {"批量处理${deLogicName}" }, notes = "${byTagParams}${deLogicName}Batch")
@RequestMapping(method = RequestMethod.${reqMtd}, value = "${fullPath}<#if deaction.getRequestParamType() == 'NONE'><#else>/{${itemCodeNameLC + keyCNLC}}</#if>/${deactionCodeName?lower_case}batch")
public ResponseEntity<Boolean> ${deactionCodeName?uncap_first}${byParams}(${etParamsList}) {
return ResponseEntity.status(HttpStatus.OK).body(${deCodeNameLC}Service.${srfmethodname(deactionCodeName)}(${itemCodeNameLC}dtos));
}
</#macro>
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册