TgjjDkxxController.java 3.6 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.TgjjDkxx;
  19. import com.sooka.system.service.ITgjjDkxxService;
  20. /**
  21. * 个人贷款信息Controller
  22. *
  23. * @author lei
  24. * @date 2021-11-16
  25. */
  26. @Controller
  27. @RequestMapping("/system/dkxx")
  28. public class TgjjDkxxController extends BaseController
  29. {
  30. private String prefix = "system/dkxx";
  31. @Autowired
  32. private ITgjjDkxxService tgjjDkxxService;
  33. @RequiresPermissions("system:dkxx:view")
  34. @GetMapping()
  35. public String dkxx()
  36. {
  37. return prefix + "/dkxx";
  38. }
  39. /**
  40. * 查询个人贷款信息列表
  41. */
  42. @RequiresPermissions("system:dkxx:list")
  43. @PostMapping("/list")
  44. @ResponseBody
  45. public TableDataInfo list(TgjjDkxx tgjjDkxx)
  46. {
  47. startPage();
  48. List<TgjjDkxx> list = tgjjDkxxService.selectTgjjDkxxList(tgjjDkxx);
  49. return getDataTable(list);
  50. }
  51. /**
  52. * 导出个人贷款信息列表
  53. */
  54. @RequiresPermissions("system:dkxx:export")
  55. @Log(title = "个人贷款信息", businessType = BusinessType.EXPORT)
  56. @PostMapping("/export")
  57. @ResponseBody
  58. public AjaxResult export(TgjjDkxx tgjjDkxx)
  59. {
  60. List<TgjjDkxx> list = tgjjDkxxService.selectTgjjDkxxList(tgjjDkxx);
  61. ExcelUtil<TgjjDkxx> util = new ExcelUtil<TgjjDkxx>(TgjjDkxx.class);
  62. return util.exportExcel(list, "dkxx");
  63. }
  64. /**
  65. * 新增个人贷款信息
  66. */
  67. @GetMapping("/add")
  68. public String add()
  69. {
  70. return prefix + "/add";
  71. }
  72. /**
  73. * 新增保存个人贷款信息
  74. */
  75. @RequiresPermissions("system:dkxx:add")
  76. @Log(title = "个人贷款信息", businessType = BusinessType.INSERT)
  77. @PostMapping("/add")
  78. @ResponseBody
  79. public AjaxResult addSave(TgjjDkxx tgjjDkxx)
  80. {
  81. return toAjax(tgjjDkxxService.insertTgjjDkxx(tgjjDkxx));
  82. }
  83. /**
  84. * 修改个人贷款信息
  85. */
  86. @GetMapping("/edit/{ID}")
  87. public String edit(@PathVariable("ID") Long ID, ModelMap mmap)
  88. {
  89. TgjjDkxx tgjjDkxx = tgjjDkxxService.selectTgjjDkxxById(ID);
  90. mmap.put("tgjjDkxx", tgjjDkxx);
  91. return prefix + "/edit";
  92. }
  93. /**
  94. * 修改保存个人贷款信息
  95. */
  96. @RequiresPermissions("system:dkxx:edit")
  97. @Log(title = "个人贷款信息", businessType = BusinessType.UPDATE)
  98. @PostMapping("/edit")
  99. @ResponseBody
  100. public AjaxResult editSave(TgjjDkxx tgjjDkxx)
  101. {
  102. return toAjax(tgjjDkxxService.updateTgjjDkxx(tgjjDkxx));
  103. }
  104. /**
  105. * 删除个人贷款信息
  106. */
  107. @RequiresPermissions("system:dkxx:remove")
  108. @Log(title = "个人贷款信息", businessType = BusinessType.DELETE)
  109. @PostMapping( "/remove")
  110. @ResponseBody
  111. public AjaxResult remove(String ids)
  112. {
  113. return toAjax(tgjjDkxxService.deleteTgjjDkxxByIds(ids));
  114. }
  115. }