mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-09-11 15:41:54 +08:00
代码生成器:增加树形结构的 vm 模版
This commit is contained in:
@@ -85,28 +85,42 @@ public class ${sceneEnum.prefixClass}${table.className}Controller {
|
||||
return success(${table.className}Convert.INSTANCE.convert(${classNameVar}));
|
||||
}
|
||||
|
||||
#if ( $table.templateType != 2 )
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得${table.classComment}分页")
|
||||
#if ($sceneEnum.scene == 1)
|
||||
@PreAuthorize("@ss.hasPermission('${permissionPrefix}:query')")
|
||||
#end
|
||||
public CommonResult<PageResult<${sceneEnum.prefixClass}${table.className}RespVO>> get${simpleClassName}Page(@Valid ${sceneEnum.prefixClass}${table.className}PageReqVO pageVO) {
|
||||
PageResult<${table.className}DO> pageResult = ${classNameVar}Service.get${simpleClassName}Page(pageVO);
|
||||
public CommonResult<PageResult<${sceneEnum.prefixClass}${table.className}RespVO>> get${simpleClassName}Page(@Valid ${sceneEnum.prefixClass}${table.className}PageReqVO pageReqVO) {
|
||||
PageResult<${table.className}DO> pageResult = ${classNameVar}Service.get${simpleClassName}Page(pageReqVO);
|
||||
return success(${table.className}Convert.INSTANCE.convertPage(pageResult));
|
||||
}
|
||||
|
||||
## 特殊:树表专属逻辑(树不需要分页接口)
|
||||
#else
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "获得${table.classComment}列表")
|
||||
#if ($sceneEnum.scene == 1)
|
||||
@PreAuthorize("@ss.hasPermission('${permissionPrefix}:query')")
|
||||
#end
|
||||
public CommonResult<List<${sceneEnum.prefixClass}${table.className}RespVO>> get${simpleClassName}List(@Valid ${sceneEnum.prefixClass}${table.className}ListReqVO listReqVO) {
|
||||
List<${table.className}DO> list = ${classNameVar}Service.get${simpleClassName}List(listReqVO);
|
||||
return success(${table.className}Convert.INSTANCE.convertList(list));
|
||||
}
|
||||
|
||||
#end
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出${table.classComment} Excel")
|
||||
#if ($sceneEnum.scene == 1)
|
||||
@PreAuthorize("@ss.hasPermission('${permissionPrefix}:export')")
|
||||
#end
|
||||
@OperateLog(type = EXPORT)
|
||||
public void export${simpleClassName}Excel(@Valid ${sceneEnum.prefixClass}${table.className}ExportReqVO exportReqVO,
|
||||
public void export${simpleClassName}Excel(@Valid ${sceneEnum.prefixClass}${table.className}ListReqVO listReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
List<${table.className}DO> list = ${classNameVar}Service.get${simpleClassName}List(exportReqVO);
|
||||
List<${table.className}DO> list = ${classNameVar}Service.get${simpleClassName}List(listReqVO);
|
||||
// 导出 Excel
|
||||
List<${sceneEnum.prefixClass}${table.className}ExcelVO> datas = ${table.className}Convert.INSTANCE.convertList02(list);
|
||||
ExcelUtils.write(response, "${table.classComment}.xls", "数据", ${sceneEnum.prefixClass}${table.className}ExcelVO.class, datas);
|
||||
List<${sceneEnum.prefixClass}${table.className}ExcelVO> dataList = ${table.className}Convert.INSTANCE.convertList02(list);
|
||||
ExcelUtils.write(response, "${table.classComment}.xls", "数据", ${sceneEnum.prefixClass}${table.className}ExcelVO.class, dataList);
|
||||
}
|
||||
|
||||
## 特殊:主子表专属逻辑
|
||||
|
Reference in New Issue
Block a user