RemoteOrgService.java 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. package com.xunmei.system.api;
  2. import com.xunmei.common.core.constant.SecurityConstants;
  3. import com.xunmei.common.core.constant.ServiceNameConstants;
  4. import com.xunmei.common.core.domain.R;
  5. import com.xunmei.common.core.vo.IdNameVo;
  6. import com.xunmei.system.api.Eto.OrgListByTypesConditionEto;
  7. import com.xunmei.system.api.domain.SysOrg;
  8. import com.xunmei.system.api.domain.SysOrgExtend;
  9. import com.xunmei.system.api.factory.RemoteOrgFallbackFactory;
  10. import com.xunmei.system.api.vo.SysOrgVO;
  11. import org.springframework.cloud.openfeign.FeignClient;
  12. import org.springframework.web.bind.annotation.*;
  13. import java.util.List;
  14. @FeignClient(contextId = "remoteOrgService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteOrgFallbackFactory.class)
  15. public interface RemoteOrgService {
  16. /**
  17. * 通过用户名查询用户信息
  18. *
  19. * @param source 请求来源
  20. * @return 结果
  21. */
  22. @GetMapping("/org/list/nopage")
  23. R<List<SysOrg>> getAllOrg(@RequestHeader(SecurityConstants.FROM_SOURCE) String source);
  24. @GetMapping("/dept/selectCheckSubOrgIdList")
  25. List<Long> selectCheckSubOrgIdList(@RequestParam("orgId") Long orgId, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
  26. @GetMapping("/dept/selectSysOrgById")
  27. SysOrg selectSysOrgById(@RequestParam("id") Long id, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
  28. /**
  29. * 查询第一级机构
  30. *
  31. * @param source
  32. * @return
  33. */
  34. @GetMapping("/org/selectSysOrgByParentId")
  35. List<SysOrg> selectSysOrgByParentId(@RequestParam("id") Long id, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
  36. @GetMapping("/dept/get/{orgId}")
  37. SysOrg selectOrgById(@PathVariable("orgId") Long orgId, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
  38. @GetMapping("/dept/listByIds")
  39. R<List<SysOrg>> listByIds(List<Long> ids, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
  40. @PostMapping("/dept/findListByOrgType")
  41. R<List<Long>> findListByOrgType(@RequestBody Integer execOrgType, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
  42. @PostMapping("/org/sync/batch")
  43. R<Boolean> batchSaveSyncOrg(@RequestBody List<SysOrg> orgList, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
  44. @PostMapping("/dept/findListByOrgTypes")
  45. R<List<SysOrg>> listByTypes(@RequestBody OrgListByTypesConditionEto eto);
  46. @PostMapping("/dept/listByParentIdAndType")
  47. List<SysOrg>listByParentIdAndType(@RequestBody SysOrg sysOrg, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
  48. @GetMapping("/dept/top")
  49. SysOrg selectTopOrg(@RequestHeader(SecurityConstants.FROM_SOURCE) String source);
  50. @GetMapping("/dept/selectByOrgType/{orgType}")
  51. List<SysOrg> selectByOrgType(@PathVariable("orgType") Integer orgType, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
  52. @GetMapping("/dept/selectByOrgPathAndOrgType/{orgPath}/{orgType}")
  53. List<SysOrg> selectByOrgPathAndOrgType(@PathVariable("orgPath") String orgPath,@PathVariable("orgType") Integer orgType, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
  54. @PostMapping("/dept/selectOrgByIdList")
  55. List<SysOrg> selectOrgByIdList(@RequestBody List<Long> orgList, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
  56. /**
  57. * 获取上级行社
  58. *
  59. * @param orgList
  60. * @param source
  61. * @return
  62. */
  63. @PostMapping("/dept/selectParentHs")
  64. List<SysOrg> selectParentHs(@RequestBody List<Long> orgList, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
  65. /**
  66. * 获取下级所有行社
  67. *
  68. * @param orgList
  69. * @param source
  70. * @return
  71. */
  72. @GetMapping("/dept/selectChildHs/{orgId}")
  73. List<SysOrg> selectChildHs(@PathVariable("orgId") Long orgId, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
  74. @GetMapping("/dept/getSysOrgByUserId/{userId}")
  75. SysOrg getSysOrgByUserId(@PathVariable("userId") Long userId, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
  76. /**
  77. * 获取机构及其上级机构的id列表
  78. *
  79. * @param orgId
  80. * @return
  81. */
  82. @GetMapping("/org/getUpOrgs/{orgId}")
  83. List<Long> getUpOrgs(@PathVariable("orgId") Long orgId);
  84. /**
  85. * @param source
  86. * @return
  87. */
  88. @GetMapping("/org/list/findAllOrg")
  89. List<SysOrg> findAllOrg(@RequestHeader(SecurityConstants.FROM_SOURCE) String source);
  90. /**
  91. * 获取机构及父级机构的名称
  92. *
  93. * @param ids
  94. * @return
  95. */
  96. @PostMapping("/org/getParentNames")
  97. R<List<IdNameVo>> getParentName(@RequestBody List<Long> ids, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
  98. /**
  99. * 根据机构ID查询机构信息
  100. *
  101. * @param ids
  102. * @return
  103. */
  104. @PostMapping("/dept/selectByOrgIdList")
  105. List<SysOrg> selectByOrgIdList(@RequestBody List<Long> ids, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
  106. @GetMapping("/extend/selectSysOrgExtendById")
  107. SysOrgExtend selectSysOrgExtendById(@RequestParam("orgId") Long orgId, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
  108. @PostMapping("/dept/deptTree/hangshewhole")
  109. R<List<SysOrgVO>> hangsheWholePathTree(@RequestBody Long orgId, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
  110. // @PostMapping("/dept/selectParentHs")
  111. // List<SysOrg> selectParentHs(@RequestBody List<Long> orgList, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
  112. }