RemoteOrgService.java 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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.factory.RemoteOrgFallbackFactory;
  9. import org.springframework.cloud.openfeign.FeignClient;
  10. import org.springframework.web.bind.annotation.*;
  11. import java.util.List;
  12. @FeignClient(contextId = "remoteOrgService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteOrgFallbackFactory.class)
  13. public interface RemoteOrgService {
  14. /**
  15. * 通过用户名查询用户信息
  16. *
  17. * @param source 请求来源
  18. * @return 结果
  19. */
  20. @GetMapping("/org/list/nopage")
  21. R<List<SysOrg>> getAllOrg(@RequestHeader(SecurityConstants.FROM_SOURCE) String source);
  22. @GetMapping("/dept/selectCheckSubOrgIdList")
  23. List<Long> selectCheckSubOrgIdList(@RequestParam("orgId") Long orgId, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
  24. @GetMapping("/dept/selectSysOrgById")
  25. SysOrg selectSysOrgById(@RequestParam("id") Long id, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
  26. /**
  27. * 查询第一级机构
  28. * @param source
  29. * @return
  30. */
  31. @GetMapping("/org/selectSysOrgByParentId")
  32. List<SysOrg> selectSysOrgByParentId(@RequestParam("id")Long id,@RequestHeader(SecurityConstants.FROM_SOURCE) String source);
  33. @GetMapping("/dept/get/{orgId}")
  34. SysOrg selectOrgById(@PathVariable("orgId") Long orgId, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
  35. @GetMapping("/dept/listByIds")
  36. R<List<SysOrg>> listByIds(List<Long> ids, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
  37. @GetMapping("/dept/findListByOrgType")
  38. R<List<Long>> findListByOrgType(Integer execOrgType, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
  39. @PostMapping("/org/sync/batch")
  40. R<Boolean> batchSaveSyncOrg(@RequestBody List<SysOrg> orgList, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
  41. @PostMapping("/dept/findListByOrgTypes")
  42. R<List<SysOrg>> listByTypes(@RequestBody OrgListByTypesConditionEto eto);
  43. @GetMapping("/dept/top")
  44. SysOrg selectTopOrg(@RequestHeader(SecurityConstants.FROM_SOURCE) String source);
  45. @GetMapping("/dept/selectByOrgType/{orgType}")
  46. List<SysOrg> selectByOrgType(@PathVariable("orgType") Integer orgType, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
  47. @PostMapping("/dept/selectOrgByIdList")
  48. List<SysOrg> selectOrgByIdList(@RequestBody List<Long> orgList, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
  49. @GetMapping("/dept/getSysOrgByUserId/{userId}")
  50. SysOrg getSysOrgByUserId(@PathVariable("userId") Long userId, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
  51. /**
  52. * 获取机构及其上级机构的id列表
  53. * @param orgId
  54. * @return
  55. */
  56. @GetMapping("/org/getUpOrgs/{orgId}")
  57. List<Long> getUpOrgs(@PathVariable("orgId") Long orgId);
  58. /**
  59. *
  60. * @param source
  61. * @return
  62. */
  63. @GetMapping("/org/list/findAllOrg")
  64. List<SysOrg> findAllOrg(@RequestHeader(SecurityConstants.FROM_SOURCE) String source);
  65. /**
  66. * 获取机构及父级机构的名称
  67. * @param ids
  68. * @return
  69. */
  70. @PostMapping("/org/getParentNames")
  71. R<List<IdNameVo>> getParentName(@RequestBody List<Long> ids);
  72. }