package com.xunmei.system.api; import com.xunmei.common.core.constant.SecurityConstants; import com.xunmei.common.core.constant.ServiceNameConstants; import com.xunmei.common.core.domain.OrgTreeReq; import com.xunmei.common.core.domain.OrgTreeResp; import com.xunmei.common.core.domain.R; import com.xunmei.common.core.vo.IdNameVo; import com.xunmei.system.api.Eto.OrgListByTypesConditionEto; import com.xunmei.system.api.domain.SysOrg; import com.xunmei.system.api.domain.SysOrgExtend; import com.xunmei.system.api.factory.RemoteOrgFallbackFactory; import com.xunmei.system.api.vo.SysOrgVO; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.*; import java.util.List; @FeignClient(contextId = "remoteOrgService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteOrgFallbackFactory.class) public interface RemoteOrgService { /** * 通过用户名查询用户信息 * * @param source 请求来源 * @return 结果 */ @GetMapping("/org/list/nopage") R> getAllOrg(@RequestHeader(SecurityConstants.FROM_SOURCE) String source); @GetMapping("/dept/selectCheckSubOrgIdList") List selectCheckSubOrgIdList(@RequestParam("orgId") Long orgId, @RequestHeader(SecurityConstants.FROM_SOURCE) String source); @GetMapping("/dept/selectSysOrgById") SysOrg selectSysOrgById(@RequestParam("id") Long id, @RequestHeader(SecurityConstants.FROM_SOURCE) String source); /** * 查询第一级机构 * * @param source * @return */ @GetMapping("/org/selectSysOrgByParentId") List selectSysOrgByParentId(@RequestParam("id") Long id, @RequestHeader(SecurityConstants.FROM_SOURCE) String source); @GetMapping("/dept/get/{orgId}") SysOrg selectOrgById(@PathVariable("orgId") Long orgId, @RequestHeader(SecurityConstants.FROM_SOURCE) String source); @GetMapping("/dept/listByIds") R> listByIds(List ids, @RequestHeader(SecurityConstants.FROM_SOURCE) String source); @PostMapping("/dept/findListByOrgType") R> findListByOrgType(@RequestBody Integer execOrgType, @RequestHeader(SecurityConstants.FROM_SOURCE) String source); @PostMapping("/org/sync/batch") R batchSaveSyncOrg(@RequestBody List orgList, @RequestHeader(SecurityConstants.FROM_SOURCE) String source); @PostMapping("/dept/findListByOrgTypes") R> listByTypes(@RequestBody OrgListByTypesConditionEto eto); @PostMapping("/dept/listByParentIdAndType") List listByParentIdAndType(@RequestBody SysOrg sysOrg, @RequestHeader(SecurityConstants.FROM_SOURCE) String source); @GetMapping("/dept/top") SysOrg selectTopOrg(@RequestHeader(SecurityConstants.FROM_SOURCE) String source); @GetMapping("/dept/selectByOrgType/{orgType}") List selectByOrgType(@PathVariable("orgType") Integer orgType, @RequestHeader(SecurityConstants.FROM_SOURCE) String source); @GetMapping("/dept/selectByOrgPathAndOrgType/{orgPath}/{orgType}") List selectByOrgPathAndOrgType(@PathVariable("orgPath") String orgPath, @PathVariable("orgType") Integer orgType, @RequestHeader(SecurityConstants.FROM_SOURCE) String source); @PostMapping("/dept/selectOrgByIdList") List selectOrgByIdList(@RequestBody List orgList, @RequestHeader(SecurityConstants.FROM_SOURCE) String source); /** * 获取上级行社 * * @param orgList * @param source * @return */ @PostMapping("/dept/selectParentHs") List selectParentHs(@RequestBody List orgList, @RequestHeader(SecurityConstants.FROM_SOURCE) String source); /** * 获取下级所有行社 * * @param orgList * @param source * @return */ @GetMapping("/dept/selectChildHs/{orgId}") List selectChildHs(@PathVariable("orgId") Long orgId, @RequestHeader(SecurityConstants.FROM_SOURCE) String source); @GetMapping("/dept/getSysOrgByUserId/{userId}") SysOrg getSysOrgByUserId(@PathVariable("userId") Long userId, @RequestHeader(SecurityConstants.FROM_SOURCE) String source); /** * 获取机构及其上级机构的id列表 * * @param orgId * @return */ @GetMapping("/org/getUpOrgs/{orgId}") List getUpOrgs(@PathVariable("orgId") Long orgId); /** * @param source * @return */ @GetMapping("/org/list/findAllOrg") List findAllOrg(@RequestHeader(SecurityConstants.FROM_SOURCE) String source); /** * 获取机构及父级机构的名称 * * @param ids * @return */ @PostMapping("/org/getParentNames") R> getParentName(@RequestBody List ids, @RequestHeader(SecurityConstants.FROM_SOURCE) String source); /** * 根据机构ID查询机构信息 * * @param ids * @return */ @PostMapping("/dept/selectByOrgIdList") List selectByOrgIdList(@RequestBody List ids, @RequestHeader(SecurityConstants.FROM_SOURCE) String source); @PostMapping("/dept/selectOrgTypeByIdList") List selectOrgTypeByIdList(@RequestBody List ids, @RequestHeader(SecurityConstants.FROM_SOURCE) String source); @GetMapping("/extend/selectSysOrgExtendById") SysOrgExtend selectSysOrgExtendById(@RequestParam("orgId") Long orgId, @RequestHeader(SecurityConstants.FROM_SOURCE) String source); @GetMapping("/dept/findByOrgTypeAndParent") List findByOrgTypeAndParent(@RequestParam("orgType") Integer orgType, @RequestParam("path") String path, @RequestHeader(SecurityConstants.FROM_SOURCE) String source); @PostMapping("/dept/deptTree/hangshewhole") R> hangsheWholePathTree(@RequestBody Long orgId, @RequestHeader(SecurityConstants.FROM_SOURCE) String source); // @PostMapping("/dept/selectParentHs") // List selectParentHs(@RequestBody List orgList, @RequestHeader(SecurityConstants.FROM_SOURCE) String source); // 此接口需要获取当前登陆人信息,不可异步 @GetMapping("/dept/selectOrgTreeReq") OrgTreeResp getOrgTreeResp(@RequestParam("orgId") Long orgId,@RequestParam("checkSub") Boolean checkSub); }