TgjjGtjkrxxController.java 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. package com.sooka.system.controller;
  2. import java.util.List;
  3. import com.sooka.common.core.controller.BaseController;
  4. import com.sooka.common.core.domain.AjaxResult;
  5. import com.sooka.common.core.page.TableDataInfo;
  6. import com.sooka.common.enums.BusinessType;
  7. import com.sooka.common.utils.poi.ExcelUtil;
  8. import org.apache.shiro.authz.annotation.RequiresPermissions;
  9. import org.springframework.beans.factory.annotation.Autowired;
  10. import org.springframework.stereotype.Controller;
  11. import org.springframework.ui.ModelMap;
  12. import org.springframework.web.bind.annotation.GetMapping;
  13. import org.springframework.web.bind.annotation.PathVariable;
  14. import org.springframework.web.bind.annotation.PostMapping;
  15. import org.springframework.web.bind.annotation.RequestMapping;
  16. import org.springframework.web.bind.annotation.ResponseBody;
  17. import com.sooka.common.annotation.Log;
  18. import com.sooka.system.domain.TgjjGtjkrxx;
  19. import com.sooka.system.service.ITgjjGtjkrxxService;
  20. /**
  21. * 共同借款人信息Controller
  22. *
  23. * @author lei
  24. * @date 2021-11-16
  25. */
  26. @Controller
  27. @RequestMapping("/system/gtjkrxx")
  28. public class TgjjGtjkrxxController extends BaseController
  29. {
  30. private String prefix = "system/gtjkrxx";
  31. @Autowired
  32. private ITgjjGtjkrxxService tgjjGtjkrxxService;
  33. @RequiresPermissions("system:gtjkrxx:view")
  34. @GetMapping()
  35. public String gtjkrxx()
  36. {
  37. return prefix + "/gtjkrxx";
  38. }
  39. /**
  40. * 查询共同借款人信息列表
  41. */
  42. @RequiresPermissions("system:gtjkrxx:list")
  43. @PostMapping("/list")
  44. @ResponseBody
  45. public TableDataInfo list(TgjjGtjkrxx tgjjGtjkrxx)
  46. {
  47. startPage();
  48. List<TgjjGtjkrxx> list = tgjjGtjkrxxService.selectTgjjGtjkrxxList(tgjjGtjkrxx);
  49. return getDataTable(list);
  50. }
  51. /**
  52. * 导出共同借款人信息列表
  53. */
  54. @RequiresPermissions("system:gtjkrxx:export")
  55. @Log(title = "共同借款人信息", businessType = BusinessType.EXPORT)
  56. @PostMapping("/export")
  57. @ResponseBody
  58. public AjaxResult export(TgjjGtjkrxx tgjjGtjkrxx)
  59. {
  60. List<TgjjGtjkrxx> list = tgjjGtjkrxxService.selectTgjjGtjkrxxList(tgjjGtjkrxx);
  61. ExcelUtil<TgjjGtjkrxx> util = new ExcelUtil<TgjjGtjkrxx>(TgjjGtjkrxx.class);
  62. return util.exportExcel(list, "gtjkrxx");
  63. }
  64. /**
  65. * 新增共同借款人信息
  66. */
  67. @GetMapping("/add")
  68. public String add()
  69. {
  70. return prefix + "/add";
  71. }
  72. /**
  73. * 新增保存共同借款人信息
  74. */
  75. @RequiresPermissions("system:gtjkrxx:add")
  76. @Log(title = "共同借款人信息", businessType = BusinessType.INSERT)
  77. @PostMapping("/add")
  78. @ResponseBody
  79. public AjaxResult addSave(TgjjGtjkrxx tgjjGtjkrxx)
  80. {
  81. return toAjax(tgjjGtjkrxxService.insertTgjjGtjkrxx(tgjjGtjkrxx));
  82. }
  83. /**
  84. * 修改共同借款人信息
  85. */
  86. @GetMapping("/edit/{ID}")
  87. public String edit(@PathVariable("ID") Long ID, ModelMap mmap)
  88. {
  89. TgjjGtjkrxx tgjjGtjkrxx = tgjjGtjkrxxService.selectTgjjGtjkrxxById(ID);
  90. mmap.put("tgjjGtjkrxx", tgjjGtjkrxx);
  91. return prefix + "/edit";
  92. }
  93. /**
  94. * 修改保存共同借款人信息
  95. */
  96. @RequiresPermissions("system:gtjkrxx:edit")
  97. @Log(title = "共同借款人信息", businessType = BusinessType.UPDATE)
  98. @PostMapping("/edit")
  99. @ResponseBody
  100. public AjaxResult editSave(TgjjGtjkrxx tgjjGtjkrxx)
  101. {
  102. return toAjax(tgjjGtjkrxxService.updateTgjjGtjkrxx(tgjjGtjkrxx));
  103. }
  104. /**
  105. * 删除共同借款人信息
  106. */
  107. @RequiresPermissions("system:gtjkrxx:remove")
  108. @Log(title = "共同借款人信息", businessType = BusinessType.DELETE)
  109. @PostMapping( "/remove")
  110. @ResponseBody
  111. public AjaxResult remove(String ids)
  112. {
  113. return toAjax(tgjjGtjkrxxService.deleteTgjjGtjkrxxByIds(ids));
  114. }
  115. }