mirror of https://github.com/jeecgboot/jeecg-boot
生成代码返回结果泛型支持问题处理
parent
bc711932f7
commit
eacaa7ed81
|
@ -149,7 +149,7 @@ public class ${entityName}Controller extends JeecgController<${entityName}, I${e
|
|||
public Result<${entityName}> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
${entityName} ${entityName?uncap_first} = ${entityName?uncap_first}Service.getById(id);
|
||||
if(${entityName?uncap_first}==null) {
|
||||
return Result.error("未找到对应数据",null);
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(${entityName?uncap_first});
|
||||
}
|
||||
|
|
|
@ -79,10 +79,10 @@ public class ${entityName}Controller {
|
|||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "${tableVo.ftlDescription}-分页列表查询")
|
||||
//@AutoLog(value = "${tableVo.ftlDescription}-分页列表查询")
|
||||
@ApiOperation(value="${tableVo.ftlDescription}-分页列表查询", notes="${tableVo.ftlDescription}-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<?> queryPageList(${entityName} ${entityName?uncap_first},
|
||||
public Result<IPage<${entityName}>> queryPageList(${entityName} ${entityName?uncap_first},
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
|
@ -101,7 +101,7 @@ public class ${entityName}Controller {
|
|||
@AutoLog(value = "${tableVo.ftlDescription}-添加")
|
||||
@ApiOperation(value="${tableVo.ftlDescription}-添加", notes="${tableVo.ftlDescription}-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<?> add(@RequestBody ${entityName}Page ${entityName?uncap_first}Page) {
|
||||
public Result<String> add(@RequestBody ${entityName}Page ${entityName?uncap_first}Page) {
|
||||
${entityName} ${entityName?uncap_first} = new ${entityName}();
|
||||
BeanUtils.copyProperties(${entityName?uncap_first}Page, ${entityName?uncap_first});
|
||||
<#if bpm_flag>
|
||||
|
@ -120,7 +120,7 @@ public class ${entityName}Controller {
|
|||
@AutoLog(value = "${tableVo.ftlDescription}-编辑")
|
||||
@ApiOperation(value="${tableVo.ftlDescription}-编辑", notes="${tableVo.ftlDescription}-编辑")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||
public Result<?> edit(@RequestBody ${entityName}Page ${entityName?uncap_first}Page) {
|
||||
public Result<String> edit(@RequestBody ${entityName}Page ${entityName?uncap_first}Page) {
|
||||
${entityName} ${entityName?uncap_first} = new ${entityName}();
|
||||
BeanUtils.copyProperties(${entityName?uncap_first}Page, ${entityName?uncap_first});
|
||||
${entityName} ${entityName?uncap_first}Entity = ${entityName?uncap_first}Service.getById(${entityName?uncap_first}.getId());
|
||||
|
@ -140,7 +140,7 @@ public class ${entityName}Controller {
|
|||
@AutoLog(value = "${tableVo.ftlDescription}-通过id删除")
|
||||
@ApiOperation(value="${tableVo.ftlDescription}-通过id删除", notes="${tableVo.ftlDescription}-通过id删除")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
|
||||
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||
${entityName?uncap_first}Service.delMain(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
@ -154,7 +154,7 @@ public class ${entityName}Controller {
|
|||
@AutoLog(value = "${tableVo.ftlDescription}-批量删除")
|
||||
@ApiOperation(value="${tableVo.ftlDescription}-批量删除", notes="${tableVo.ftlDescription}-批量删除")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
this.${entityName?uncap_first}Service.delBatchMain(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
@ -165,10 +165,10 @@ public class ${entityName}Controller {
|
|||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "${tableVo.ftlDescription}-通过id查询")
|
||||
//@AutoLog(value = "${tableVo.ftlDescription}-通过id查询")
|
||||
@ApiOperation(value="${tableVo.ftlDescription}-通过id查询", notes="${tableVo.ftlDescription}-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<?> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
public Result<${entityName}> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
${entityName} ${entityName?uncap_first} = ${entityName?uncap_first}Service.getById(id);
|
||||
if(${entityName?uncap_first}==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
|
@ -184,10 +184,10 @@ public class ${entityName}Controller {
|
|||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "${sub.ftlDescription}通过主表ID查询")
|
||||
//@AutoLog(value = "${sub.ftlDescription}通过主表ID查询")
|
||||
@ApiOperation(value="${sub.ftlDescription}主表ID查询", notes="${sub.ftlDescription}-通主表ID查询")
|
||||
@GetMapping(value = "/query${sub.entityName}ByMainId")
|
||||
public Result<?> query${sub.entityName}ListByMainId(@RequestParam(name="id",required=true) String id) {
|
||||
public Result<List<${sub.entityName}>> query${sub.entityName}ListByMainId(@RequestParam(name="id",required=true) String id) {
|
||||
List<${sub.entityName}> ${sub.entityName?uncap_first}List = ${sub.entityName?uncap_first}Service.selectByMainId(id);
|
||||
return Result.OK(${sub.entityName?uncap_first}List);
|
||||
}
|
||||
|
|
|
@ -65,10 +65,10 @@ public class ${entityName}Controller extends JeecgController<${entityName}, I${e
|
|||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "${tableVo.ftlDescription}-分页列表查询")
|
||||
//@AutoLog(value = "${tableVo.ftlDescription}-分页列表查询")
|
||||
@ApiOperation(value="${tableVo.ftlDescription}-分页列表查询", notes="${tableVo.ftlDescription}-分页列表查询")
|
||||
@GetMapping(value = "/rootList")
|
||||
public Result<?> queryPageList(${entityName} ${entityName?uncap_first},
|
||||
public Result<IPage<${entityName}>> queryPageList(${entityName} ${entityName?uncap_first},
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
|
@ -100,10 +100,10 @@ public class ${entityName}Controller extends JeecgController<${entityName}, I${e
|
|||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "${tableVo.ftlDescription}-获取子数据")
|
||||
//@AutoLog(value = "${tableVo.ftlDescription}-获取子数据")
|
||||
@ApiOperation(value="${tableVo.ftlDescription}-获取子数据", notes="${tableVo.ftlDescription}-获取子数据")
|
||||
@GetMapping(value = "/childList")
|
||||
public Result<?> queryPageList(${entityName} ${entityName?uncap_first},HttpServletRequest req) {
|
||||
public Result<IPage<${entityName}>> queryPageList(${entityName} ${entityName?uncap_first},HttpServletRequest req) {
|
||||
QueryWrapper<${entityName}> queryWrapper = QueryGenerator.initQueryWrapper(${entityName?uncap_first}, req.getParameterMap());
|
||||
List<${entityName}> list = ${entityName?uncap_first}Service.list(queryWrapper);
|
||||
IPage<${entityName}> pageList = new Page<>(1, 10, list.size());
|
||||
|
@ -118,7 +118,7 @@ public class ${entityName}Controller extends JeecgController<${entityName}, I${e
|
|||
* @param parentIds
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "${tableVo.ftlDescription}-批量获取子数据")
|
||||
//@AutoLog(value = "${tableVo.ftlDescription}-批量获取子数据")
|
||||
@ApiOperation(value="${tableVo.ftlDescription}-批量获取子数据", notes="${tableVo.ftlDescription}-批量获取子数据")
|
||||
@GetMapping("/getChildListBatch")
|
||||
public Result getChildListBatch(@RequestParam("parentIds") String parentIds) {
|
||||
|
@ -145,7 +145,7 @@ public class ${entityName}Controller extends JeecgController<${entityName}, I${e
|
|||
@AutoLog(value = "${tableVo.ftlDescription}-添加")
|
||||
@ApiOperation(value="${tableVo.ftlDescription}-添加", notes="${tableVo.ftlDescription}-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<?> add(@RequestBody ${entityName} ${entityName?uncap_first}) {
|
||||
public Result<String> add(@RequestBody ${entityName} ${entityName?uncap_first}) {
|
||||
${entityName?uncap_first}Service.add${entityName}(${entityName?uncap_first});
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
@ -159,7 +159,7 @@ public class ${entityName}Controller extends JeecgController<${entityName}, I${e
|
|||
@AutoLog(value = "${tableVo.ftlDescription}-编辑")
|
||||
@ApiOperation(value="${tableVo.ftlDescription}-编辑", notes="${tableVo.ftlDescription}-编辑")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||
public Result<?> edit(@RequestBody ${entityName} ${entityName?uncap_first}) {
|
||||
public Result<String> edit(@RequestBody ${entityName} ${entityName?uncap_first}) {
|
||||
${entityName?uncap_first}Service.update${entityName}(${entityName?uncap_first});
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
@ -173,7 +173,7 @@ public class ${entityName}Controller extends JeecgController<${entityName}, I${e
|
|||
@AutoLog(value = "${tableVo.ftlDescription}-通过id删除")
|
||||
@ApiOperation(value="${tableVo.ftlDescription}-通过id删除", notes="${tableVo.ftlDescription}-通过id删除")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
|
||||
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||
${entityName?uncap_first}Service.delete${entityName}(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
@ -187,7 +187,7 @@ public class ${entityName}Controller extends JeecgController<${entityName}, I${e
|
|||
@AutoLog(value = "${tableVo.ftlDescription}-批量删除")
|
||||
@ApiOperation(value="${tableVo.ftlDescription}-批量删除", notes="${tableVo.ftlDescription}-批量删除")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
this.${entityName?uncap_first}Service.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
@ -198,10 +198,10 @@ public class ${entityName}Controller extends JeecgController<${entityName}, I${e
|
|||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "${tableVo.ftlDescription}-通过id查询")
|
||||
//@AutoLog(value = "${tableVo.ftlDescription}-通过id查询")
|
||||
@ApiOperation(value="${tableVo.ftlDescription}-通过id查询", notes="${tableVo.ftlDescription}-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<?> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
public Result<${entityName}> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
${entityName} ${entityName?uncap_first} = ${entityName?uncap_first}Service.getById(id);
|
||||
if(${entityName?uncap_first}==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
|
|
|
@ -70,10 +70,10 @@ public class ${entityName}Controller extends JeecgController<${entityName}, I${e
|
|||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "${tableVo.ftlDescription}-分页列表查询")
|
||||
//@AutoLog(value = "${tableVo.ftlDescription}-分页列表查询")
|
||||
@ApiOperation(value="${tableVo.ftlDescription}-分页列表查询", notes="${tableVo.ftlDescription}-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<?> queryPageList(${entityName} ${entityName?uncap_first},
|
||||
public Result<IPage<${entityName}>> queryPageList(${entityName} ${entityName?uncap_first},
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
|
@ -91,7 +91,7 @@ public class ${entityName}Controller extends JeecgController<${entityName}, I${e
|
|||
@AutoLog(value = "${tableVo.ftlDescription}-添加")
|
||||
@ApiOperation(value="${tableVo.ftlDescription}-添加", notes="${tableVo.ftlDescription}-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<?> add(@RequestBody ${entityName} ${entityName?uncap_first}) {
|
||||
public Result<String> add(@RequestBody ${entityName} ${entityName?uncap_first}) {
|
||||
${entityName?uncap_first}Service.save(${entityName?uncap_first});
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
@ -104,7 +104,7 @@ public class ${entityName}Controller extends JeecgController<${entityName}, I${e
|
|||
@AutoLog(value = "${tableVo.ftlDescription}-编辑")
|
||||
@ApiOperation(value="${tableVo.ftlDescription}-编辑", notes="${tableVo.ftlDescription}-编辑")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||
public Result<?> edit(@RequestBody ${entityName} ${entityName?uncap_first}) {
|
||||
public Result<String> edit(@RequestBody ${entityName} ${entityName?uncap_first}) {
|
||||
${entityName?uncap_first}Service.updateById(${entityName?uncap_first});
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
@ -117,7 +117,7 @@ public class ${entityName}Controller extends JeecgController<${entityName}, I${e
|
|||
@AutoLog(value = "${tableVo.ftlDescription}-通过id删除")
|
||||
@ApiOperation(value="${tableVo.ftlDescription}-通过id删除", notes="${tableVo.ftlDescription}-通过id删除")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
|
||||
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||
${entityName?uncap_first}Service.delMain(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
@ -130,7 +130,7 @@ public class ${entityName}Controller extends JeecgController<${entityName}, I${e
|
|||
@AutoLog(value = "${tableVo.ftlDescription}-批量删除")
|
||||
@ApiOperation(value="${tableVo.ftlDescription}-批量删除", notes="${tableVo.ftlDescription}-批量删除")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
this.${entityName?uncap_first}Service.delBatchMain(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
@ -161,10 +161,10 @@ public class ${entityName}Controller extends JeecgController<${entityName}, I${e
|
|||
* 通过主表ID查询
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "${sub.ftlDescription}-通过主表ID查询")
|
||||
//@AutoLog(value = "${sub.ftlDescription}-通过主表ID查询")
|
||||
@ApiOperation(value="${sub.ftlDescription}-通过主表ID查询", notes="${sub.ftlDescription}-通过主表ID查询")
|
||||
@GetMapping(value = "/list${sub.entityName}ByMainId")
|
||||
public Result<?> list${sub.entityName}ByMainId(${sub.entityName} ${sub.entityName?uncap_first},
|
||||
public Result<IPage<${sub.entityName}>> list${sub.entityName}ByMainId(${sub.entityName} ${sub.entityName?uncap_first},
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
|
@ -182,7 +182,7 @@ public class ${entityName}Controller extends JeecgController<${entityName}, I${e
|
|||
@AutoLog(value = "${sub.ftlDescription}-添加")
|
||||
@ApiOperation(value="${sub.ftlDescription}-添加", notes="${sub.ftlDescription}-添加")
|
||||
@PostMapping(value = "/add${sub.entityName}")
|
||||
public Result<?> add${sub.entityName}(@RequestBody ${sub.entityName} ${sub.entityName?uncap_first}) {
|
||||
public Result<String> add${sub.entityName}(@RequestBody ${sub.entityName} ${sub.entityName?uncap_first}) {
|
||||
${sub.entityName?uncap_first}Service.save(${sub.entityName?uncap_first});
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
@ -195,7 +195,7 @@ public class ${entityName}Controller extends JeecgController<${entityName}, I${e
|
|||
@AutoLog(value = "${sub.ftlDescription}-编辑")
|
||||
@ApiOperation(value="${sub.ftlDescription}-编辑", notes="${sub.ftlDescription}-编辑")
|
||||
@RequestMapping(value = "/edit${sub.entityName}", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||
public Result<?> edit${sub.entityName}(@RequestBody ${sub.entityName} ${sub.entityName?uncap_first}) {
|
||||
public Result<String> edit${sub.entityName}(@RequestBody ${sub.entityName} ${sub.entityName?uncap_first}) {
|
||||
${sub.entityName?uncap_first}Service.updateById(${sub.entityName?uncap_first});
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
@ -208,7 +208,7 @@ public class ${entityName}Controller extends JeecgController<${entityName}, I${e
|
|||
@AutoLog(value = "${sub.ftlDescription}-通过id删除")
|
||||
@ApiOperation(value="${sub.ftlDescription}-通过id删除", notes="${sub.ftlDescription}-通过id删除")
|
||||
@DeleteMapping(value = "/delete${sub.entityName}")
|
||||
public Result<?> delete${sub.entityName}(@RequestParam(name="id",required=true) String id) {
|
||||
public Result<String> delete${sub.entityName}(@RequestParam(name="id",required=true) String id) {
|
||||
${sub.entityName?uncap_first}Service.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
@ -221,7 +221,7 @@ public class ${entityName}Controller extends JeecgController<${entityName}, I${e
|
|||
@AutoLog(value = "${sub.ftlDescription}-批量删除")
|
||||
@ApiOperation(value="${sub.ftlDescription}-批量删除", notes="${sub.ftlDescription}-批量删除")
|
||||
@DeleteMapping(value = "/deleteBatch${sub.entityName}")
|
||||
public Result<?> deleteBatch${sub.entityName}(@RequestParam(name="ids",required=true) String ids) {
|
||||
public Result<String> deleteBatch${sub.entityName}(@RequestParam(name="ids",required=true) String ids) {
|
||||
this.${sub.entityName?uncap_first}Service.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
|
|
@ -73,10 +73,10 @@ public class ${entityName}Controller {
|
|||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "${tableVo.ftlDescription}-分页列表查询")
|
||||
//@AutoLog(value = "${tableVo.ftlDescription}-分页列表查询")
|
||||
@ApiOperation(value="${tableVo.ftlDescription}-分页列表查询", notes="${tableVo.ftlDescription}-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<?> queryPageList(${entityName} ${entityName?uncap_first},
|
||||
public Result<IPage<${entityName}>> queryPageList(${entityName} ${entityName?uncap_first},
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
|
@ -95,7 +95,7 @@ public class ${entityName}Controller {
|
|||
@AutoLog(value = "${tableVo.ftlDescription}-添加")
|
||||
@ApiOperation(value="${tableVo.ftlDescription}-添加", notes="${tableVo.ftlDescription}-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<?> add(@RequestBody ${entityName}Page ${entityName?uncap_first}Page) {
|
||||
public Result<String> add(@RequestBody ${entityName}Page ${entityName?uncap_first}Page) {
|
||||
${entityName} ${entityName?uncap_first} = new ${entityName}();
|
||||
BeanUtils.copyProperties(${entityName?uncap_first}Page, ${entityName?uncap_first});
|
||||
${entityName?uncap_first}Service.saveMain(${entityName?uncap_first}, <#list subTables as sub>${entityName?uncap_first}Page.get${sub.entityName}List()<#if sub_has_next>,</#if></#list>);
|
||||
|
@ -111,7 +111,7 @@ public class ${entityName}Controller {
|
|||
@AutoLog(value = "${tableVo.ftlDescription}-编辑")
|
||||
@ApiOperation(value="${tableVo.ftlDescription}-编辑", notes="${tableVo.ftlDescription}-编辑")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||
public Result<?> edit(@RequestBody ${entityName}Page ${entityName?uncap_first}Page) {
|
||||
public Result<String> edit(@RequestBody ${entityName}Page ${entityName?uncap_first}Page) {
|
||||
${entityName} ${entityName?uncap_first} = new ${entityName}();
|
||||
BeanUtils.copyProperties(${entityName?uncap_first}Page, ${entityName?uncap_first});
|
||||
${entityName} ${entityName?uncap_first}Entity = ${entityName?uncap_first}Service.getById(${entityName?uncap_first}.getId());
|
||||
|
@ -131,7 +131,7 @@ public class ${entityName}Controller {
|
|||
@AutoLog(value = "${tableVo.ftlDescription}-通过id删除")
|
||||
@ApiOperation(value="${tableVo.ftlDescription}-通过id删除", notes="${tableVo.ftlDescription}-通过id删除")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
|
||||
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||
${entityName?uncap_first}Service.delMain(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
@ -145,7 +145,7 @@ public class ${entityName}Controller {
|
|||
@AutoLog(value = "${tableVo.ftlDescription}-批量删除")
|
||||
@ApiOperation(value="${tableVo.ftlDescription}-批量删除", notes="${tableVo.ftlDescription}-批量删除")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
this.${entityName?uncap_first}Service.delBatchMain(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
@ -156,10 +156,10 @@ public class ${entityName}Controller {
|
|||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "${tableVo.ftlDescription}-通过id查询")
|
||||
//@AutoLog(value = "${tableVo.ftlDescription}-通过id查询")
|
||||
@ApiOperation(value="${tableVo.ftlDescription}-通过id查询", notes="${tableVo.ftlDescription}-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<?> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
public Result<${entityName}> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
${entityName} ${entityName?uncap_first} = ${entityName?uncap_first}Service.getById(id);
|
||||
if(${entityName?uncap_first}==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
|
@ -175,10 +175,10 @@ public class ${entityName}Controller {
|
|||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "${sub.ftlDescription}-通过主表ID查询")
|
||||
//@AutoLog(value = "${sub.ftlDescription}-通过主表ID查询")
|
||||
@ApiOperation(value="${sub.ftlDescription}-通过主表ID查询", notes="${sub.ftlDescription}-通过主表ID查询")
|
||||
@GetMapping(value = "/query${sub.entityName}ByMainId")
|
||||
public Result<?> query${sub.entityName}ListByMainId(@RequestParam(name="id",required=true) String id) {
|
||||
public Result<IPage<${sub.entityName}>> query${sub.entityName}ListByMainId(@RequestParam(name="id",required=true) String id) {
|
||||
List<${sub.entityName}> ${sub.entityName?uncap_first}List = ${sub.entityName?uncap_first}Service.selectByMainId(id);
|
||||
<#-- 包裹分页对象,用于翻译注解 -->
|
||||
IPage <${sub.entityName}> page = new Page<>();
|
||||
|
|
|
@ -54,7 +54,13 @@
|
|||
<#assign indent=" ">
|
||||
<template v-if="toggleSearchStatus">
|
||||
</#if>
|
||||
<#-- update-begin-author:taoyan date:20220303 for: /issues/3420 内嵌风格,datetime控件样式异常 -->
|
||||
<#if po.queryModel=='group' && po.classType=='datetime'>
|
||||
${indent}<a-col :xl="10" :lg="12" :md="12" :sm="24">
|
||||
<#else>
|
||||
${indent}<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
||||
</#if>
|
||||
<#-- update-end-author:taoyan date:20220303 for: /issues/3420 内嵌风格,datetime控件样式异常 -->
|
||||
${indent}<a-form-item label="${po.filedComment}">
|
||||
<#-- 普通查询 -->
|
||||
<#if po.queryMode=='single'>
|
||||
|
@ -409,7 +415,7 @@
|
|||
customRender: (text) => (text ? filterMultiDictText(this.dictOptions['${po.fieldName}'], text) : '')
|
||||
<#else>
|
||||
dataIndex: '${po.fieldName}',
|
||||
customRender: (text, record) => (text ? record['${po.dictText}'] : '')
|
||||
customRender: (text, record) => (text ? record['${dashedToCamel(po.dictText)}'] : '')
|
||||
</#if>
|
||||
<#elseif po.classType=='switch'>
|
||||
dataIndex: '${po.fieldName}',
|
||||
|
|
|
@ -79,10 +79,10 @@ public class ${entityName}Controller {
|
|||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "${tableVo.ftlDescription}-分页列表查询")
|
||||
//@AutoLog(value = "${tableVo.ftlDescription}-分页列表查询")
|
||||
@ApiOperation(value="${tableVo.ftlDescription}-分页列表查询", notes="${tableVo.ftlDescription}-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<?> queryPageList(${entityName} ${entityName?uncap_first},
|
||||
public Result<IPage<${entityName}>> queryPageList(${entityName} ${entityName?uncap_first},
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
|
@ -101,7 +101,7 @@ public class ${entityName}Controller {
|
|||
@AutoLog(value = "${tableVo.ftlDescription}-添加")
|
||||
@ApiOperation(value="${tableVo.ftlDescription}-添加", notes="${tableVo.ftlDescription}-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<?> add(@RequestBody ${entityName}Page ${entityName?uncap_first}Page) {
|
||||
public Result<String> add(@RequestBody ${entityName}Page ${entityName?uncap_first}Page) {
|
||||
${entityName} ${entityName?uncap_first} = new ${entityName}();
|
||||
BeanUtils.copyProperties(${entityName?uncap_first}Page, ${entityName?uncap_first});
|
||||
<#if bpm_flag>
|
||||
|
@ -120,7 +120,7 @@ public class ${entityName}Controller {
|
|||
@AutoLog(value = "${tableVo.ftlDescription}-编辑")
|
||||
@ApiOperation(value="${tableVo.ftlDescription}-编辑", notes="${tableVo.ftlDescription}-编辑")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||
public Result<?> edit(@RequestBody ${entityName}Page ${entityName?uncap_first}Page) {
|
||||
public Result<String> edit(@RequestBody ${entityName}Page ${entityName?uncap_first}Page) {
|
||||
${entityName} ${entityName?uncap_first} = new ${entityName}();
|
||||
BeanUtils.copyProperties(${entityName?uncap_first}Page, ${entityName?uncap_first});
|
||||
${entityName} ${entityName?uncap_first}Entity = ${entityName?uncap_first}Service.getById(${entityName?uncap_first}.getId());
|
||||
|
@ -140,7 +140,7 @@ public class ${entityName}Controller {
|
|||
@AutoLog(value = "${tableVo.ftlDescription}-通过id删除")
|
||||
@ApiOperation(value="${tableVo.ftlDescription}-通过id删除", notes="${tableVo.ftlDescription}-通过id删除")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
|
||||
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||
${entityName?uncap_first}Service.delMain(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
@ -154,7 +154,7 @@ public class ${entityName}Controller {
|
|||
@AutoLog(value = "${tableVo.ftlDescription}-批量删除")
|
||||
@ApiOperation(value="${tableVo.ftlDescription}-批量删除", notes="${tableVo.ftlDescription}-批量删除")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
this.${entityName?uncap_first}Service.delBatchMain(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
@ -165,10 +165,10 @@ public class ${entityName}Controller {
|
|||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "${tableVo.ftlDescription}-通过id查询")
|
||||
//@AutoLog(value = "${tableVo.ftlDescription}-通过id查询")
|
||||
@ApiOperation(value="${tableVo.ftlDescription}-通过id查询", notes="${tableVo.ftlDescription}-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<?> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
public Result<${entityName}> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
${entityName} ${entityName?uncap_first} = ${entityName?uncap_first}Service.getById(id);
|
||||
if(${entityName?uncap_first}==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
|
@ -184,10 +184,10 @@ public class ${entityName}Controller {
|
|||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "${sub.ftlDescription}通过主表ID查询")
|
||||
//@AutoLog(value = "${sub.ftlDescription}通过主表ID查询")
|
||||
@ApiOperation(value="${sub.ftlDescription}主表ID查询", notes="${sub.ftlDescription}-通主表ID查询")
|
||||
@GetMapping(value = "/query${sub.entityName}ByMainId")
|
||||
public Result<?> query${sub.entityName}ListByMainId(@RequestParam(name="id",required=true) String id) {
|
||||
public Result<List<${sub.entityName}>> query${sub.entityName}ListByMainId(@RequestParam(name="id",required=true) String id) {
|
||||
List<${sub.entityName}> ${sub.entityName?uncap_first}List = ${sub.entityName?uncap_first}Service.selectByMainId(id);
|
||||
return Result.OK(${sub.entityName?uncap_first}List);
|
||||
}
|
||||
|
|
|
@ -73,10 +73,10 @@ public class ${entityName}Controller {
|
|||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "${tableVo.ftlDescription}-分页列表查询")
|
||||
//@AutoLog(value = "${tableVo.ftlDescription}-分页列表查询")
|
||||
@ApiOperation(value="${tableVo.ftlDescription}-分页列表查询", notes="${tableVo.ftlDescription}-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<?> queryPageList(${entityName} ${entityName?uncap_first},
|
||||
public Result<IPage<${entityName}>> queryPageList(${entityName} ${entityName?uncap_first},
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
|
@ -95,7 +95,7 @@ public class ${entityName}Controller {
|
|||
@AutoLog(value = "${tableVo.ftlDescription}-添加")
|
||||
@ApiOperation(value="${tableVo.ftlDescription}-添加", notes="${tableVo.ftlDescription}-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<?> add(@RequestBody ${entityName}Page ${entityName?uncap_first}Page) {
|
||||
public Result<String> add(@RequestBody ${entityName}Page ${entityName?uncap_first}Page) {
|
||||
${entityName} ${entityName?uncap_first} = new ${entityName}();
|
||||
BeanUtils.copyProperties(${entityName?uncap_first}Page, ${entityName?uncap_first});
|
||||
${entityName?uncap_first}Service.saveMain(${entityName?uncap_first}, <#list subTables as sub>${entityName?uncap_first}Page.get${sub.entityName}List()<#if sub_has_next>,</#if></#list>);
|
||||
|
@ -111,7 +111,7 @@ public class ${entityName}Controller {
|
|||
@AutoLog(value = "${tableVo.ftlDescription}-编辑")
|
||||
@ApiOperation(value="${tableVo.ftlDescription}-编辑", notes="${tableVo.ftlDescription}-编辑")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||
public Result<?> edit(@RequestBody ${entityName}Page ${entityName?uncap_first}Page) {
|
||||
public Result<String> edit(@RequestBody ${entityName}Page ${entityName?uncap_first}Page) {
|
||||
${entityName} ${entityName?uncap_first} = new ${entityName}();
|
||||
BeanUtils.copyProperties(${entityName?uncap_first}Page, ${entityName?uncap_first});
|
||||
${entityName} ${entityName?uncap_first}Entity = ${entityName?uncap_first}Service.getById(${entityName?uncap_first}.getId());
|
||||
|
@ -131,7 +131,7 @@ public class ${entityName}Controller {
|
|||
@AutoLog(value = "${tableVo.ftlDescription}-通过id删除")
|
||||
@ApiOperation(value="${tableVo.ftlDescription}-通过id删除", notes="${tableVo.ftlDescription}-通过id删除")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
|
||||
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||
${entityName?uncap_first}Service.delMain(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
@ -145,7 +145,7 @@ public class ${entityName}Controller {
|
|||
@AutoLog(value = "${tableVo.ftlDescription}-批量删除")
|
||||
@ApiOperation(value="${tableVo.ftlDescription}-批量删除", notes="${tableVo.ftlDescription}-批量删除")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
this.${entityName?uncap_first}Service.delBatchMain(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
@ -156,10 +156,10 @@ public class ${entityName}Controller {
|
|||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "${tableVo.ftlDescription}-通过id查询")
|
||||
//@AutoLog(value = "${tableVo.ftlDescription}-通过id查询")
|
||||
@ApiOperation(value="${tableVo.ftlDescription}-通过id查询", notes="${tableVo.ftlDescription}-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<?> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
public Result<${entityName}> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
${entityName} ${entityName?uncap_first} = ${entityName?uncap_first}Service.getById(id);
|
||||
if(${entityName?uncap_first}==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
|
@ -175,10 +175,10 @@ public class ${entityName}Controller {
|
|||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "${sub.ftlDescription}通过主表ID查询")
|
||||
//@AutoLog(value = "${sub.ftlDescription}通过主表ID查询")
|
||||
@ApiOperation(value="${sub.ftlDescription}主表ID查询", notes="${sub.ftlDescription}-通主表ID查询")
|
||||
@GetMapping(value = "/query${sub.entityName}ByMainId")
|
||||
public Result<?> query${sub.entityName}ListByMainId(@RequestParam(name="id",required=true) String id) {
|
||||
public Result<List<${sub.entityName}>> query${sub.entityName}ListByMainId(@RequestParam(name="id",required=true) String id) {
|
||||
List<${sub.entityName}> ${sub.entityName?uncap_first}List = ${sub.entityName?uncap_first}Service.selectByMainId(id);
|
||||
return Result.OK(${sub.entityName?uncap_first}List);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue