RemoteOrgService.java 6.1 KB

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