UserArchivesController.java 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. package com.goafanti.customer.controller;
  2. import com.goafanti.common.bo.Result;
  3. import com.goafanti.common.controller.BaseController;
  4. import com.goafanti.common.model.UserArchives;
  5. import com.goafanti.customer.bo.InputSelectUserArchives;
  6. import com.goafanti.customer.service.UserArchivesService;
  7. import org.springframework.web.bind.annotation.GetMapping;
  8. import org.springframework.web.bind.annotation.PostMapping;
  9. import org.springframework.web.bind.annotation.RequestMapping;
  10. import org.springframework.web.bind.annotation.RestController;
  11. import javax.annotation.Resource;
  12. /**
  13. * 客户档案表(UserArchives)表控制层
  14. *
  15. * @author makejava
  16. * @since 2024-07-12 11:52:01
  17. */
  18. @RestController
  19. @RequestMapping("/api/admin/userArchives")
  20. public class UserArchivesController extends BaseController {
  21. /**
  22. * 服务对象
  23. */
  24. @Resource
  25. private UserArchivesService userArchivesService;
  26. /**
  27. * 新增数据
  28. *
  29. * @param userArchives 实体
  30. * @return 新增结果
  31. */
  32. @PostMapping("/add")
  33. public Result add(UserArchives userArchives) {
  34. return new Result<>().data(this.userArchivesService.insert(userArchives));
  35. }
  36. /**
  37. * 通过主键查询单条数据
  38. *
  39. * @param id 主键
  40. * @return 单条数据
  41. */
  42. @GetMapping("/get")
  43. public Result<UserArchives> queryById( Integer id) {
  44. return new Result<>().data(this.userArchivesService.queryById(id));
  45. }
  46. /**
  47. * 编辑用户档案数据
  48. *
  49. * @param userArchives 实体
  50. * @return 编辑结果
  51. */
  52. @PostMapping("/update")
  53. public Result edit(UserArchives userArchives,Integer channelType) {
  54. return new Result<>().data(this.userArchivesService.update(userArchives,channelType));
  55. }
  56. /**
  57. * 删除数据
  58. *
  59. * @param id 主键
  60. * @return 删除是否成功
  61. */
  62. @GetMapping("/delete")
  63. public Result deleteById(Integer id) {
  64. return new Result<>().data(this.userArchivesService.deleteById(id));
  65. }
  66. /**
  67. * 列表查询
  68. * @param in 参数
  69. */
  70. @GetMapping("/list")
  71. public Result<UserArchives> list(UserArchives in, Integer pageNo, Integer pageSize) {
  72. return new Result<>().data(this.userArchivesService.list(in, pageNo, pageSize));
  73. }
  74. /**
  75. * 查询企业档案
  76. *
  77. * @param id 主键
  78. * @return 单条数据
  79. */
  80. @GetMapping("/queryByUid")
  81. public Result<UserArchives> queryByUid( String id) {
  82. return new Result<>().data(this.userArchivesService.queryByUid(id));
  83. }
  84. /**
  85. * 微信查询查询企业其他信息与档案信息
  86. *
  87. * @param id 主键
  88. * @return 单条数据
  89. */
  90. @GetMapping("/queryByUidAll")
  91. public Result queryByUidAll( String id) {
  92. Result res = new Result<>();
  93. if (userArchivesService.checkPermission(id)){
  94. res.error(buildError("查看超时,请要分享人重新分享。"));
  95. return res;
  96. }
  97. res.data(this.userArchivesService.queryByUidAll(id));
  98. return res;
  99. }
  100. /**
  101. * 客户档案汇总
  102. */
  103. @GetMapping("/selectUserArchives")
  104. public Result selectUserArchives( InputSelectUserArchives in) {
  105. Result res = new Result<>();
  106. if (in.getNewChannel()==null)in.setNewChannel(0);
  107. res.data(this.userArchivesService.selectUserArchives(in));
  108. return res;
  109. }
  110. }