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

实体行为批处理

上级 598df9ee
...@@ -1024,14 +1024,20 @@ public class ${itemCodeName}Resource { ...@@ -1024,14 +1024,20 @@ public class ${itemCodeName}Resource {
</#if> </#if>
<@SecurityAnnotation deaction/> <@SecurityAnnotation deaction/>
@ApiOperation(value = "批量处理[${deaction.getLogicName()}]", tags = {"${deLogicName}" }, notes = "批量处理[${deaction.getLogicName()}]") @ApiOperation(value = "批量处理[${deaction.getLogicName()}]", tags = {"${deLogicName}" }, notes = "批量处理[${deaction.getLogicName()}]")
@RequestMapping(method = RequestMethod.${reqMtd}, value = "${fullPath}<#if deaction.getRequestParamType() == 'NONE'><#else>/{${itemCodeNameLC + keyCNLC}}</#if>${deactionCodeName?lower_case}batch") @RequestMapping(method = RequestMethod.${reqMtd}, value = "${fullPath}/${deactionCodeName?lower_case}batch")
public ResponseEntity<${resultValueType}> ${deactionCodeName?uncap_first}Batch(${etParamsList}) { public ResponseEntity<${resultValueType}> ${deactionCodeName?uncap_first}Batch(<#if deaction.getRequestParamType() == 'NONE'><#else>${etParamsList}</#if>) {
<#if resultValueType?lower_case =='void'> <#if deaction.getRequestParamType() == 'NONE'>
${deCodeNameLC}Service.${srfmethodname(deactionCodeName)}Batch(${itemCodeNameLC}Mapping.toDomain(${itemCodeNameLC}dtos)); List<${deCodeName}> domains = new List<${deCodeName}>();
boolean result = ${deCodeNameLC}Service.${srfmethodname(deactionCodeName)}Batch(domains);
<#else>
List<${deCodeName}> domains = ${itemCodeNameLC}Mapping.toDomain(${itemCodeNameLC}dtos);
boolean result = ${deCodeNameLC}Service.${srfmethodname(deactionCodeName)}Batch(domains);
</#if>
<#if resultValueType?lower_case =='void'>
return ResponseEntity.status(HttpStatus.OK).build(); return ResponseEntity.status(HttpStatus.OK).build();
<#else> <#else>
return ResponseEntity.status(HttpStatus.OK).body(${deCodeNameLC}Service.${srfmethodname(deactionCodeName)}Batch(${itemCodeNameLC}Mapping.toDomain(${itemCodeNameLC}dtos))); return ResponseEntity.status(HttpStatus.OK).body(result);
</#if> </#if>
} }
</#macro> </#macro>
...@@ -1043,13 +1049,19 @@ public class ${itemCodeName}Resource { ...@@ -1043,13 +1049,19 @@ public class ${itemCodeName}Resource {
<#assign resultValueType='Void'> <#assign resultValueType='Void'>
</#if> </#if>
@ApiOperation(value = "批量处理[${byTagParams}${deLogicName}]", tags = {"${deLogicName}" }, notes = "批量处理[${byTagParams}${deLogicName}]") @ApiOperation(value = "批量处理[${byTagParams}${deLogicName}]", tags = {"${deLogicName}" }, notes = "批量处理[${byTagParams}${deLogicName}]")
@RequestMapping(method = RequestMethod.${reqMtd}, value = "${fullPath}<#if deaction.getRequestParamType() == 'NONE'><#else>/{${itemCodeNameLC + keyCNLC}}</#if>${deactionCodeName?lower_case}batch") @RequestMapping(method = RequestMethod.${reqMtd}, value = "${fullPath}/${deactionCodeName?lower_case}batch")
public ResponseEntity<${resultValueType}> ${deactionCodeName?uncap_first}${byParams}(${etParamsList}) { public ResponseEntity<${resultValueType}> ${deactionCodeName?uncap_first}${byParams}(<#if deaction.getRequestParamType() == 'NONE'><#else>${etParamsList}</#if>) {
<#if deaction.getRequestParamType() == 'NONE'>
List<${deCodeName}> domains = new List<${deCodeName}>();
boolean result = ${deCodeNameLC}Service.${srfmethodname(deactionCodeName)}Batch(domains);
<#else>
List<${deCodeName}> domains = ${itemCodeNameLC}Mapping.toDomain(${itemCodeNameLC}dtos);
boolean result = ${deCodeNameLC}Service.${srfmethodname(deactionCodeName)}Batch(domains);
</#if>
<#if resultValueType?lower_case =='void'> <#if resultValueType?lower_case =='void'>
${deCodeNameLC}Service.${srfmethodname(deactionCodeName)}Batch(${itemCodeNameLC}Mapping.toDomain(${itemCodeNameLC}dtos));
return ResponseEntity.status(HttpStatus.OK).build(); return ResponseEntity.status(HttpStatus.OK).build();
<#else> <#else>
return ResponseEntity.status(HttpStatus.OK).body(${deCodeNameLC}Service.${srfmethodname(deactionCodeName)}Batch(${itemCodeNameLC}Mapping.toDomain(${itemCodeNameLC}dtos))); return ResponseEntity.status(HttpStatus.OK).body(result);
</#if> </#if>
} }
</#macro> </#macro>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册