ZwywLrZvxxController.java 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. package com.ruoyi.business.controller;
  2. import com.ruoyi.business.domain.ZwywLrZvxx;
  3. import com.ruoyi.business.service.IZwywLrZvxxService;
  4. import com.ruoyi.common.core.web.controller.BaseController;
  5. import com.ruoyi.common.core.web.domain.AjaxResult;
  6. import com.ruoyi.common.core.web.page.TableDataInfo;
  7. import com.ruoyi.common.log.annotation.Log;
  8. import com.ruoyi.common.log.enums.BusinessType;
  9. import com.ruoyi.common.security.annotation.Logical;
  10. import com.ruoyi.common.security.annotation.RequiresPermissions;
  11. import com.ruoyi.system.validate.group.AddGroup;
  12. import org.springframework.beans.factory.annotation.Autowired;
  13. import org.springframework.validation.annotation.Validated;
  14. import org.springframework.web.bind.annotation.*;
  15. import java.util.List;
  16. /**
  17. * 子女信息Controller
  18. *
  19. * @author CH
  20. * @date 2022-04-28
  21. */
  22. @RestController
  23. @RequestMapping("/lrzvxx")
  24. public class ZwywLrZvxxController extends BaseController
  25. {
  26. @Autowired
  27. private IZwywLrZvxxService zwywLrZvxxService;
  28. /**
  29. * 查询子女信息列表
  30. */
  31. @RequiresPermissions(value = {"business:lrzvxx:list", "search:lrzvxx:list"}, logical = Logical.OR)
  32. @GetMapping("/list")
  33. public TableDataInfo list(ZwywLrZvxx zwywLrZvxx)
  34. {
  35. startPage();
  36. List<ZwywLrZvxx> list = zwywLrZvxxService.selectZwywLrZvxxList(zwywLrZvxx);
  37. return getDataTable(list);
  38. }
  39. /**
  40. * 获取子女信息详细信息
  41. */
  42. @RequiresPermissions(value = {"business:lrzvxx:query", "search:lrzvxx:query"}, logical = Logical.OR)
  43. @GetMapping(value = "/{id}")
  44. public AjaxResult getInfo(@PathVariable("id") String id)
  45. {
  46. return AjaxResult.success(zwywLrZvxxService.selectZwywLrZvxxById(id));
  47. }
  48. /**
  49. * 新增子女信息
  50. */
  51. @RequiresPermissions("business:lrzvxx:add")
  52. @Log(title = "子女信息", businessType = BusinessType.INSERT)
  53. @PostMapping
  54. public AjaxResult add(@Validated({AddGroup.class}) @RequestBody ZwywLrZvxx zwywLrZvxx)
  55. {
  56. zwywLrZvxxService.checkExist(zwywLrZvxx);
  57. zwywLrZvxxService.checkIdCard(zwywLrZvxx);
  58. return toAjax(zwywLrZvxxService.insertZwywLrZvxx(zwywLrZvxx),zwywLrZvxx.getId());
  59. }
  60. /**
  61. * 修改子女信息
  62. */
  63. @RequiresPermissions("business:lrzvxx:edit")
  64. @Log(title = "子女信息", businessType = BusinessType.UPDATE)
  65. @PutMapping
  66. public AjaxResult edit(@Validated @RequestBody ZwywLrZvxx zwywLrZvxx)
  67. {
  68. zwywLrZvxxService.checkExist(zwywLrZvxx);
  69. zwywLrZvxxService.checkIdCard(zwywLrZvxx);
  70. zwywLrZvxxService.updateCheck(zwywLrZvxx);
  71. return toAjax(zwywLrZvxxService.updateZwywLrZvxx(zwywLrZvxx));
  72. }
  73. /**
  74. * 删除子女信息
  75. */
  76. @RequiresPermissions("business:lrzvxx:remove")
  77. @Log(title = "子女信息", businessType = BusinessType.DELETE)
  78. @DeleteMapping("/{ids}")
  79. public AjaxResult remove(@PathVariable String[] ids)
  80. {
  81. return toAjax(zwywLrZvxxService.deleteZwywLrZvxxByIds(ids));
  82. }
  83. }