TenantProxyInfoController.java 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. package com.ym.mec.web.controller;
  2. import com.ym.mec.auth.api.entity.SysUser;
  3. import com.ym.mec.biz.dal.dto.TenantProxyDto;
  4. import com.ym.mec.biz.dal.vo.ProxyUserVo;
  5. import com.ym.mec.biz.service.TenantProxyInfoService;
  6. import com.ym.mec.common.controller.BaseController;
  7. import com.ym.mec.common.entity.HttpResponseResult;
  8. import com.ym.mec.common.page.PageInfo;
  9. import io.swagger.annotations.Api;
  10. import io.swagger.annotations.ApiImplicitParam;
  11. import io.swagger.annotations.ApiImplicitParams;
  12. import io.swagger.annotations.ApiOperation;
  13. import org.springframework.beans.factory.annotation.Value;
  14. import org.springframework.web.bind.annotation.*;
  15. import javax.annotation.Resource;
  16. import javax.validation.Valid;
  17. import java.util.List;
  18. import java.util.Map;
  19. /**
  20. * 机构代理商信息表(TenantProxyInfo)表控制层
  21. *
  22. * @author hgw
  23. * @since 2022-04-22 14:08:20
  24. */
  25. @Api(tags = "机构代理商信息表")
  26. @RestController
  27. @RequestMapping("/tenantProxyInfo")
  28. public class TenantProxyInfoController extends BaseController {
  29. /**
  30. * 服务对象
  31. */
  32. @Resource
  33. private TenantProxyInfoService tenantProxyInfoService;
  34. @ApiOperation("添加代理商信息")
  35. @PostMapping(value = "/addProxyInfo")
  36. public HttpResponseResult<Object> addProxyInfo(@Valid @RequestBody TenantProxyDto dto) {
  37. tenantProxyInfoService.addProxyInfo(dto);
  38. return succeed();
  39. }
  40. @ApiOperation("添加代理商下面的员工")
  41. @PostMapping(value = "/addProxyStaff")
  42. public HttpResponseResult<Object> addProxyStaff(@RequestBody TenantProxyDto dto) {
  43. tenantProxyInfoService.addProxyStaff(dto);
  44. return succeed();
  45. }
  46. @ApiOperation("查询代理商下级人员数据")
  47. @ApiImplicitParam(name = "id", value = "代理商负责人id", required = true, dataType = "Integer")
  48. @GetMapping("/queryProxyUserStaff")
  49. public HttpResponseResult<List<ProxyUserVo>> queryProxyUserStaff(Integer id) {
  50. return succeed(tenantProxyInfoService.queryProxyUserStaff(id));
  51. }
  52. @ApiImplicitParams({
  53. @ApiImplicitParam(name = "search", dataType = "String", value = "关键字"),
  54. @ApiImplicitParam(name = "state", dataType = "Integer", value = "状态 0正常 1冻结"),
  55. @ApiImplicitParam(name = "page", dataType = "Integer", value = "页数"),
  56. @ApiImplicitParam(name = "rows", dataType = "Integer", value = "每页数量"),
  57. })
  58. @ApiOperation("分页查询代理商负责人数据")
  59. @PostMapping(value = "/queryProxyUser")
  60. public HttpResponseResult<PageInfo<ProxyUserVo>> queryPage(@RequestBody Map<String, Object> param) {
  61. return succeed(tenantProxyInfoService.queryProxyUser(param));
  62. }
  63. @ApiOperation("冻结/解冻代理商")
  64. @ApiImplicitParams({
  65. @ApiImplicitParam(name = "id", dataType = "Integer", value = "代理商负责人id"),
  66. @ApiImplicitParam(name = "state", dataType = "Integer", value = "状态 0正常 1冻结"),
  67. })
  68. @GetMapping("/freezeProxy")
  69. public HttpResponseResult<Object> freezeProxy(Integer id, Integer state) {
  70. tenantProxyInfoService.freezeProxy(id, state);
  71. return succeed();
  72. }
  73. @ApiOperation("修改人员信息")
  74. @PostMapping(value = "/updateProxyUserInfo")
  75. public HttpResponseResult<Object> updateProxyUserInfo(@RequestBody TenantProxyDto dto) {
  76. tenantProxyInfoService.updateProxyUserInfo(dto);
  77. return succeed();
  78. }
  79. @ApiImplicitParams({
  80. @ApiImplicitParam(name = "search", dataType = "String", value = "手机号/姓名模糊查询条件"),
  81. })
  82. @ApiOperation("手机号/姓名模糊查询所有平台账号信息手机号/姓名模糊查询所有平台账号信息")
  83. @PostMapping(value = "/queryUserList")
  84. public HttpResponseResult<List<SysUser>> queryUserList(@RequestBody Map<String, Object> param) {
  85. return succeed(tenantProxyInfoService.queryUserList(param));
  86. }
  87. @ApiOperation("根据token查询用户信息-代理商专用")
  88. @GetMapping("/queryUserListByToken")
  89. public HttpResponseResult<SysUser> queryUserList() {
  90. return succeed(tenantProxyInfoService.queryUserList());
  91. }
  92. }