package com.hotent.base.feign;

import cn.hutool.json.JSONObject;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.ArrayNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.hotent.base.conf.DecryptingFeignConfig;
import com.hotent.base.entity.URIEntity;
import com.hotent.base.feign.impl.UCFeignServiceFactory;
import com.hotent.base.model.CommonResult;
import com.hotent.base.query.QueryFilter;
import com.hotent.uc.api.model.Group;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * 
 * @author liyg
 *
 */
@FeignClient(name="eip-uc",fallbackFactory=UCFeignServiceFactory.class, configuration= DecryptingFeignConfig.class, primary = false)
public interface UCFeignService {

	/**
	 * 根据用户账号获取用户userDetail信息 包含角色信息
	 * @param account
	 * @return
	 */
	@RequestMapping(value="/api/user/v1/user/loadUserByUsername",method=RequestMethod.POST)
	public JsonNode loadUserByUsername(@RequestParam(value="account",required=true) String account);

	@RequestMapping(value="/api/user/v1/user/loadCustomerUserByUsername",method=RequestMethod.POST)
	public JsonNode loadCustomerUserByUsername(@RequestParam(value="account",required=true) String account);


	/**
	 * 根据用户id获取用户userDetail信息 包含角色信息
	 */
	@RequestMapping(value="/api/user/v1/user/loadUserByUserId",method=RequestMethod.GET)
	public CommonResult<JsonNode> loadUserByUserId( @RequestParam(value="userId",required=true) String userId);

	@RequestMapping(value="/api/user/v1/users/getAllUser",method=RequestMethod.GET)
	public JsonNode getAllUser();

	@RequestMapping(value="/api/user/v1/users/getAllUser",method=RequestMethod.GET)
	public ArrayNode getAllUserByList();

	@RequestMapping(value="/api/user/v1/users/getAllUserListByFilter",method=RequestMethod.POST)
	public ArrayNode getAllUserListByFilter(@RequestBody QueryFilter queryFilter);

	/**
	 * 根据用户id获取用户信息 不包含角色信息
	 */
	@RequestMapping(value="/api/user/v1/user/getUserById",method=RequestMethod.GET)
	public CommonResult<JsonNode> getUserById( @RequestParam(value="userId",required=true) String userId);

	/**
	 * 获取用户信息
	 * @param account
	 * @return
	 * @throws Exception
	 */
	@RequestMapping(value="/api/user/v1/user/getUser",method=RequestMethod.GET)
	public JsonNode getUser(@RequestParam(value="account",required=true) String account, @RequestParam(value="userNumber",required=false) String userNumber);

	/**
	 * 根据多个用户账号获取用户信息(以逗号隔开)
	 */
	@RequestMapping(value="/api/user/v1/user/getUserByAccounts",method=RequestMethod.GET)
	public ArrayNode getUserByAccounts(@RequestParam(value="accounts",required=true) String accounts);  

	/**
	 * 获取所有组织人员（带分页信息）
	 * @param queryFilter
	 * @return
	 * @throws Exception
	 */
	@RequestMapping(value="/api/user/v1/users/getAllOrgUsers",method=RequestMethod.POST)
	public ObjectNode getAllOrgUsers(@RequestBody QueryFilter queryFilter);

	/**
	 * 获取所有组织人员（带分页信息）
	 * @param orgId
	 * @return
	 * @throws Exception
	 */
	@RequestMapping(value="/api/user/v1/getAllUserByOrgId",method=RequestMethod.GET)
	public ArrayNode getAllOrgUsersByOrgId(@RequestParam(value="orgId",required=true) String orgId);


	/**
	 * 获取所有组织人员（带分页信息） 方法
	 * @param queryFilter
	 * @return
	 * @throws Exception
	 */
	@RequestMapping(value="/api/user/v1/users/getUserListMapByRoleCode",method=RequestMethod.POST)
	public ObjectNode getUserListMapByRoleCode(@RequestBody QueryFilter queryFilter);


	/**
	 * 获取角色（多个）中的用户
	 * @param json
	 * @return
	 * @throws Exception
	 */
	@RequestMapping(value="/api/role/v1/role/getUsersByRoleCode",method=RequestMethod.POST)
	public ArrayNode getUsersByRoleCode( @RequestBody String codes);

	/**
	 * 获取角色ids（多个）中的用户
	 */
	@RequestMapping(value="/api/role/v1/role/getRoleByIds",method=RequestMethod.GET)
	public ArrayNode getRoleByIds(@RequestParam(value="ids",required=true) String ids);

	/**
	 * 获取角色ids（多个）中的用户
	 */
	@RequestMapping(value="/api/role/v1/role/getRoleByIdsAndExtOrgId",method=RequestMethod.GET)
	public ArrayNode getRoleByIdsAndExtOrgId(@RequestParam(value="ids",required=true) String ids,
											 @RequestParam(value="orgId",required=true) String orgId);

	/**
	 * 通过岗位编码获取用户
	 * @param postCode
	 * @return
	 * @throws Exception
	 */
	@RequestMapping(value="/api/user/v1/users/getUserByPost",method=RequestMethod.GET)
	public ArrayNode getUserByPost( @RequestParam(value="postCode",required=true) String postCode);

	/**
	 * 获取职务（多个）下的所有人员
	 * @param json
	 * @return
	 * @throws Exception
	 */
	@RequestMapping(value="/api/job/v1/jobUser/getUsersByJob",method=RequestMethod.GET, produces = {
	"application/json; charset=utf-8" })
	@ApiOperation(value = "获取职务（多个）下的所有人员", httpMethod = "GET", notes = "获取职务下的所有人员")
	public ArrayNode getUsersByJob(@RequestParam(value="codes",required=true) String codes);

	/**
	 * 根据email查询用户信息
	 * @param email
	 * @return
	 */
	@RequestMapping(value="/api/user/v1/user/getUserByEmail",method=RequestMethod.GET)
	public ArrayNode getUserByEmail(@RequestParam(value="email",required=true) String email);


	/** List<OrgUser> orgUsers = orgUserManager.getChargesByOrgId(id,isMain);
	 *根据组织ID获取组织的负责人组织关系
	 * @param orgId
	 * @return
	 */
	@RequestMapping(value="/api/org/v1/orgUsers/getChargesByOrgId",method=RequestMethod.GET)
	public List<ObjectNode> getChargesByOrgId(@RequestParam(value="orgId",required=true) String orgId,@RequestParam(value="isMain",required=true)boolean isMain);

	/** Org org =  orgManager.get(orgId);
	 * 根据组织id或code获取组织
	 * @return
	 */
	@RequestMapping(value="/api/org/v1/org/get",method=RequestMethod.GET)
	public ObjectNode getOrgByIdOrCode(@RequestParam(value="id",required=true) String orgId);
	
	/**
	 * 根据组织id获取组织
	 * @param orgId
	 * @return
	 */
	@RequestMapping(value="/api/org/v1/org/getOrgById",method=RequestMethod.GET)
	public ObjectNode getOrgById(@RequestParam(value="id",required=true) String orgId);

	/**
	 * 根据组织id获取组织信息
	 * @param ids
	 */
	@RequestMapping(value="/api/org/v1/org/getOrgByIds",method=RequestMethod.GET)
	public ArrayNode getOrgByIds(@RequestParam(value="ids",required=true) String ids);

	@RequestMapping(value="/api/org/v1/org/getOrgByIdsAndCurOrgId",method=RequestMethod.GET)
	public ArrayNode getOrgByIdsAndCurOrgId(@RequestParam(value="ids",required=true) String ids,
											@RequestParam(value="orgId",required=true) String orgId);

	/**
	 * 根据角色id或编码获取角色
	 * @return
	 */
	@RequestMapping(value="/api/role/v1/role/getRole",method=RequestMethod.GET)
	public CommonResult<ObjectNode> getRoleByIdOrCode(@RequestParam(value="code",required=true) String code);

	/**
	 * 根据岗位id或编码获取岗位
	 * @return
	 */
	@RequestMapping(value="/api/org/v1/orgPost/getOrgPost",method=RequestMethod.GET)
	public CommonResult<ObjectNode> getPostByIdOrCode(@RequestParam(value="postCode",required=true) String code);

	/**
	 * 根据职务id或编码获取职务(返回CommonResult<?>)
	 * @return
	 */
	@RequestMapping(value="/api/job/v1/job/getOrgJob",method=RequestMethod.GET)
	public CommonResult<ObjectNode> getJobByOrgCode(@RequestParam(value="code",required=true) String code);

	/**
	 * 根据职务id或编码获取职务
	 * @return
	 */
	@RequestMapping(value="/api/job/v1/job/getJob",method=RequestMethod.GET)
	public ObjectNode getJobByIdOrCode(@RequestParam(value="code",required=true) String code);

	/**
	 * OrgUser orgUser = orgUserManager.getOrgUserMaster(ContextUtil.getCurrentUserId());
	 * 获取当前用户的主部门
	 */
	@RequestMapping(value="/api/org/v1/org/getSupOrgByCurrMain",method=RequestMethod.GET)
	public ObjectNode getOrgUserMaster(@RequestParam(value="userId",required=true)String userId,@RequestParam(value="demId",required=true)String demId);

	/**
	 * 根据id或别名获取系统分类
	 *
	 */
	@RequestMapping(value="/biz/sysType/v1/getJson",method=RequestMethod.GET)
	public ObjectNode getSysTypeByIdOrKey(@RequestParam(value="userId",required=true)String id);

	/**
	 * List<SysUserRel> sysUserRels = sysUserRelManager.getSuperUser(userId, level, sysType.get("id").asText());
	 * 根據分類編碼和用戶賬號獲取匯報線
	 */

	@RequestMapping(value="/api/userRel/v1/userRel/getSuperUser",method=RequestMethod.POST)
	public List<ObjectNode> getSuperUser(@RequestBody(required=true)ObjectNode obj);

	/**
	 * List<Role> listRole= roleManager.getAll();
	 */
	@RequestMapping(value="/api/role/v1/roles/getAll",method=RequestMethod.GET)
	public List<ObjectNode> getAllRole();

	/**
	 * List<Role> listRole = roleManager.getListByUserId(userId);
	 * 根據用戶賬號獲取角色
	 */
	@RequestMapping(value="/api/role/v1/role/getRolesByUser",method=RequestMethod.GET)
	public List<ObjectNode> getRoleListByAccount(@RequestParam(value="account",required=true)String account);

	/**
	 * 獲取用戶默認維度下的主組織
	 * Org org = orgManager.getMainGroup(ContextUtil.getCurrentUser().getUserId());
	 */
//	@Cacheable(value = CacheKeyConst.EIP_UC_USER_MAIN_ORG, key="#p0", shortExpire = true)
	@RequestMapping(value="/api/org/v1/org/getMainGroup",method=RequestMethod.GET)
	public ObjectNode getMainGroup(@RequestParam(value="userId",required=true)String userId);

	/**
	 * List<OrgRel> orgRels = orgRelManager.getListByUserId(ContextUtil.getCurrentUser().getUserId());
	 * 獲取當前用戶所有崗位
	 */
	@RequestMapping(value="/api/org/v1/orgPost/getOrgPostByUserAccount",method=RequestMethod.GET)
	public List<ObjectNode> getPosListByAccount(@RequestParam(value="account",required=true)String account);

	@RequestMapping(value="/api/org/v1/org/getParentMainOrg",method=RequestMethod.GET)
	public Map<String,ObjectNode> getParentMainOrg(@RequestParam(value="userId", required=true) String userId);


	/**
	 * 获取当前用户的组织布局管理权限
	 */
	@RequestMapping(value="/api/orgAuth/v1/orgAuths/getCurrentUserAuthOrgLayout",method=RequestMethod.GET)
	public ArrayNode getCurrentUserAuthOrgLayout(@RequestParam(value="userId", required=true) String userId);

	/**
	 * 获取用户所属组织
	 */
	@RequestMapping(value = "/api/org/v1/orgs/getOrgListByUserId", method = RequestMethod.GET)
	public ArrayNode getOrgListByUserId(@RequestParam(value="userId",required=true) String userId);


	/**
	 * 根据职务编码、组织编码获取对应人员
	 * @param redDefCode
	 * @param orgCode
	 * @return
	 */
	@RequestMapping(value = "/api/user/v1/users/getByJobCodeAndOrgCode", method = RequestMethod.GET)
	public List<ObjectNode> getByOrgRelDefCode(@RequestParam(value="jobCode", required=true)String jobCode,@RequestParam(value="orgCode", required=true) String orgCode);

	/**
	 * 根据岗位编码、组织编码获取对应人员
	 * @param redDefCode
	 * @param orgCode
	 * @return
	 */
	@RequestMapping(value = "/api/user/v1/users/getByPostCodeAndOrgCode", method = RequestMethod.GET)
	public List<ObjectNode> getByOrgRelCode(@RequestParam(value="postCode", required=true)String postCode, @RequestParam(value="orgCode", required=true)String orgCode);

	/**
	 * 获取用户主组织
	 */
	@RequestMapping(value = "/api/org/v1/org/getMainGroup", method = RequestMethod.GET)
	public ObjectNode getMainGroup(@RequestParam(value="userId",required=true) String userId,@RequestParam(value="demId",required=true) String demId);

	/**
	 * 获取组织（主）负责人
	 * @param userId 用户id
	 * @param isMain 是否主组织
	 * @param isCurrent 是否上级
	 * @return
	 */
	@RequestMapping(value = "/api/user/v1/users/getCharges", method = RequestMethod.GET)
	public JsonNode getCharges(@RequestParam(value="userId",required=true) String userId,@RequestParam(value="isMain") Boolean isMain,@RequestParam(value="isP") Boolean isP);

	/**
	 * 获取用户所有职务
	 */
	@RequestMapping(value = "/api/org/v1/orgJobs/getJobsByUserId", method = RequestMethod.GET)
	public JsonNode getJobsByUserId(@RequestParam(value="userId",required=true) String userId);

	/**
	 * 判断当前用户主部门是否有上级
	 */
	@RequestMapping(value = "/api/org/v1/org/isSupOrgByCurrMain", method = RequestMethod.GET)
	public boolean isSupOrgByCurrMain(@RequestParam(value="userId",required=true) String userId,@RequestParam(value="demId",required=true) String demId,@RequestParam(value="level",required=true)Integer level);

	/**
	 * 通过组织中的下属设置获取上级人员
	 */
	@RequestMapping(value = "/api/user/v1/users/getSuperiorFromUnder", method = RequestMethod.GET)
	public ArrayNode getSuperFromUnder(@RequestParam(value="userId",required=true) String userId,@RequestParam(value="demId",required=false) String demId);

	/**
	 * 获取发起人指定级别组织的负责人
	 * @param userId
	 * @param level  2
	 * @param isMainCharge true/false
	 * @return
	 */
	@RequestMapping(value = "/api/org/v1/orgusers/getCustomLevelCharge", method = RequestMethod.GET)
	public ArrayNode getCustomLevelCharge(@RequestParam(value="userId",required=true) String userId,@RequestParam(value="level",required=true)  String level,@RequestParam(value="isMainCharge",required=true)  boolean isMainCharge);

	/**
	 * 获取发起人指定级别组织的指定岗位的用户
	 * @param userId
	 * @param level
	 * @param postCode
	 * @return
	 */
	@RequestMapping(value = "/api/org/v1/orgusers/getCustomLevelPost", method = RequestMethod.GET)
	public  Set<ObjectNode> getCustomLevelPost(@RequestParam(value="userId",required=true) String userId,@RequestParam(value="level",required=true)  String level,@RequestParam(value="postCode",required=true)  String postCode); 

	/**
	 * 获取发起人指定级别组织的指定职务的用户
	 * @param userId
	 * @param level
	 * @param postCode
	 * @return
	 */
	@RequestMapping(value = "/api/org/v1/orgusers/getCustomLevelJob", method = RequestMethod.GET)
	public  Set<ObjectNode> getCustomLevelJob(@RequestParam(value="userId",required=true) String userId,@RequestParam(value="level",required=true)  String level,@RequestParam(value="jobCode",required=true)  String jobCode);

	/**
	 * 获取发起人组织的指定扩展参数值
	 * @param userId
	 * @param param
	 * @return
	 */
	@RequestMapping(value = "/api/org/v1/orgusers/getStartOrgParam", method = RequestMethod.GET)
	public String getStartOrgParam(@RequestParam(value="userId",required=true) String userId,@RequestParam(value="param",required=true)  String param);

	/**
	 * 通过用户ID和参数代码获取用户参数
	 * @param userId
	 * @param code
	 * @return
	 */
	@RequestMapping(value = "/api/params/v1/userParam/getUserParamsById", method = RequestMethod.GET)
	public ObjectNode getUserParamsById(@RequestParam(value="userId",required=true) String userId, @RequestParam(value="code",required=true) String code);

	/**
	 * 通过组织ID和参数代码获取组织参数
	 * @param orgId
	 * @param code
	 * @return
	 */
	@RequestMapping(value = "/api/params/v1/orgParam/getOrgParamsById", method = RequestMethod.GET)
	public ObjectNode getOrgParamsById(@RequestParam(value="orgId",required=true) String orgId, @RequestParam(value="code",required=true) String code);

	/**
	 * 根据id或者账号串获取用户
	 */
	@RequestMapping(value = "/api/user/v1/users/postUserByIds", method = RequestMethod.POST)
	public ArrayNode getUserByIdsOrAccounts(@RequestBody(required=false)String ids);

	/**
	 * 获取子组织
	 * @return
	 */
	@RequestMapping(value="/api/org/v1/orgs/getByParentId",method=RequestMethod.GET)
	public List<ObjectNode> getChildOrg(@RequestParam(value="parentId",required=true) String parentId);

	/**
	 * 获取子组织（只获取底下一层子组织）
	 * @return
	 */
	@RequestMapping(value="/api/org/v1/orgs/getOrgsByparentId",method=RequestMethod.GET)
	public List<ObjectNode> getOrgsByparentId(@RequestParam(value="parentId",required=true) String parentId);

	/**
	 * 根据用户id组获取主组织路径
	 */
	@RequestMapping(value = "/api/org/v1/org/getPathNames", method = RequestMethod.POST)
	public List<Map<String, String>> getPathNames(@RequestParam(value="userIds",required=true) List<String>  userIds);

	/**
	 * 根据用户id获取用户所在部门负责人
	 * @param json
	 * @return
	 * @throws Exception
	 */
	@RequestMapping(value="/api/user/v1/user/getDepHeader",method=RequestMethod.GET)
	public ArrayNode getDepHeader(@RequestParam(value="userId",required=false) String userId,@RequestParam(value="isMain",required=false) Boolean isMain);


	/**
	 * 根据部门id获取部门负责人
	 * @param json
	 * @return
	 * @throws Exception
	 */
	@RequestMapping(value="/api/user/v1/user/getDepHeaderByOrg",method=RequestMethod.GET)
	public ArrayNode getDepHeaderByOrg(@RequestParam(value="orgId",required=true) String orgId,@RequestParam(value="isMain",required=true) Boolean isMain);


	/**
	 * 根据用户id获取其相关用户组id
	 * @param userId
	 * @return
	 */
	@RequestMapping(value="/api/user/v1/user/getGroupsByUidAndType",method=RequestMethod.GET)
	public  List<Group>  getGroupsByUidAndType(@RequestParam(value="userId",required=true) String userId , @RequestParam(value="type",required=true) String type);


	/**
	 * 获取子组织ids
	 */
	@RequestMapping(value="/api/org/v1/org/getChildrenIds",method=RequestMethod.POST)
	public Map<String, Set<String>> getChildrenIds(@RequestParam(value="ids",required=true) Map<String,String> ids);

	/**
	 * 查询用户组织关系
	 * @param queryFilter
	 * @return
	 * @throws Exception
	 */
	@RequestMapping(value="/api/user/v1/user/queryOrgUserRel",method=RequestMethod.POST)
	public List queryOrgUserRel(@RequestBody QueryFilter queryFilter);

	/**
	 * 模糊查询用户列表
	 */
	@RequestMapping(value="/api/user/v1/users/getUserByNameaAndEmal",method=RequestMethod.GET)
	public List<ObjectNode> getUserByNameaAndEmal(@RequestParam(value="query",required=true) String query);

	/**
	 * 结算节点人员
	 */
	@RequestMapping(value = "/api/user/v1/users/calculateNodeUser", method = RequestMethod.POST)
	public Map<String, Object> calculateNodeUser(@RequestBody(required=true) Map<String, Object> result);

	/**
	 * 根据维度获取组织
	 * @param demId
	 * @return
	 */
	@RequestMapping(value="/api/org/v1/org/getOrgListByDemId",method=RequestMethod.GET)
	public List<ObjectNode> getOrgListByDemId(@RequestParam(value="demId",required=true) String demId);

	/**
	 * 根据微信公众号openId获取用户信息
	 * @param openId
	 * @return
	 */
	@RequestMapping(value="/api/user/v1/user/getUserByOpenId",method=RequestMethod.GET)
	public CommonResult<JsonNode> getUserByOpenId(@RequestParam(value="openId",required=true) String openId);


	/**
	 * 根据微信小程序openid获取用户信息
	 * @param openId
	 * @return
	 */
	@RequestMapping(value="/api/user/v1/user/getUserByMpOpenId",method=RequestMethod.GET)
	public JsonNode getUserByMpOpenId(@RequestParam(value="openId",required=true) String openId);
	
	/**
	 * 根据传入的用户id集合，获取用户的权限集合
	 */
	@RequestMapping(value = "/api/user/v1/user/getUserRightMapByIds", method = RequestMethod.GET)
	public Map<String, Map<String, String>> getUserRightMapByIds(@RequestParam(value="ids",required=false) String ids);

	/**
	 * 获取默认维度信息
	 * @param json
	 * @return
	 * @throws Exception
	 */
	@RequestMapping(value="/api/demension/v1/dem/getDefaultDem",method=RequestMethod.GET)
	public ObjectNode getDefaultDem();

	/**
	 * 获取用户的主岗位(优先获取默认维度的主岗位、主组织，没有时获取其他维度主岗位、主组织)
	 * @param userId
	 * @return
	 */
	@RequestMapping(value="/api/org/v1/org/getMainPostOrOrgByUserId",method=RequestMethod.GET)
	public ObjectNode getMainPostOrOrgByUserId(@RequestParam(value="userId",required=true) String userId);

	/**
	 * 获取用户的主岗位组织关系
	 * @param userId
	 * @param demId
	 * @return
	 */
	@RequestMapping(value="/api/org/v1/org/getSupOrgByCurrMain",method=RequestMethod.GET)
	public ObjectNode getSupOrgByCurrMain(@RequestParam(value="userId",required=true) String userId,@RequestParam(value="demId",required=true) String demId);

	/**
	 * 获取所有维度列表
	 * @param filter
	 * @return
	 * @throws Exception
	 */
	@RequestMapping(value="/api/demension/v1/dems/getAll",method=RequestMethod.GET)
	public List<ObjectNode> getAllDems();

	/**
	 * 根据用户账号获取用户组织岗位相关信息
	 * @param account
	 * @return
	 */
	@RequestMapping(value = "/api/user/v1/user/getDetailByAccountOrId", method = RequestMethod.POST)
	public Map<String, Object> getDetailByAccountOrId(@RequestBody ObjectNode accountOrIdVo);
	//HJ对外开放接口token获取用户信息
	@RequestMapping(value = "/api/user/v1/getDetail", method = RequestMethod.POST)
	public CommonResult getDetail(@RequestParam(value = "name", required = true) String name);

	/**
	 * 根据多个用户id获取用户信息(以逗号隔开)
	 */
	@RequestMapping(value="/api/user/v1/user/getUserByIds",method=RequestMethod.GET)
	public ArrayNode getUserByIds(@RequestParam(value="ids",required=true) String ids);

	@RequestMapping(value="/api/user/v1/user/getUserByIdsAndExtOrgId",method=RequestMethod.GET)
	public ArrayNode getUserByIdsAndExtOrgId(@RequestParam(value="ids",required=true) String ids,
											 @RequestParam(value="orgId",required=true) String orgId);
	/**
	 * 将第三方通讯录组织框架拉取至本系统
	 * @return
	 */
	@RequestMapping(value="/api/org/v1/org/addOrgFromExterUni",method=RequestMethod.POST)
	public CommonResult<String> addOrgFromExterUni(@RequestBody ObjectNode org);

	/**
	 * 根据手机号获取用户
	 * @return
	 */
	@RequestMapping(value="/api/user/v1/user/getUserByMobile",method=RequestMethod.GET)
	CommonResult<JsonNode> getUserByMobile(@RequestParam(value="mobile",required=true)String mobile);

	/**
	 * 根据dn获取用户
	 * @return
	 */
	@RequestMapping(value="/api/user/v1/user/getUserByUkeyDn",method=RequestMethod.GET)
	CommonResult<JsonNode> getUserByUkeyDn(@RequestParam(value="ukeyDn",required=true)String ukeyDn);

	/**
	 * 根据idcard获取用户
	 * @return
	 */
	@RequestMapping(value="/api/user/v1/user/getUserByIdCard",method=RequestMethod.GET)
	CommonResult<JsonNode> getUserByIdCard(@RequestParam(value="idCard",required=true)String idCard);

	/**
	 * 根据身份证或Jjgzh获取用户
	 * @return
	 */
	@RequestMapping(value="/api/user/v1/user/getUserByIdCardOrJjgzh",method=RequestMethod.GET)
	CommonResult<JsonNode> getUserByIdCardOrJjgzh(@RequestParam(value="idCard",required=true)String idCard);

	/**
	 * 将第三方通讯录成员拉取至本系统
	 * @return
	 */
	@RequestMapping(value="/api/user/v1/user/addUserFromExterUni",method=RequestMethod.POST)
	public JsonNode addUserFromExterUni(@RequestBody ObjectNode newUser);

	/**
	 * 组织批量加入用户
	 * @return
	 */
	@RequestMapping(value="/api/org/v1/orgUsers/addUsersForOrg",method=RequestMethod.POST)
	public CommonResult<String> addUsersForOrg( @RequestParam(value="orgCode",required=true) String orgCode, @RequestParam(value="accounts",required=true) String accounts);

	/**
	 * 根据签署任务信息获取审批用户的姓名，账号， 主部门等信息
	 * @param customSignDatas
	 * @return
	 */
	@RequestMapping(value = "/api/user/v1/user/getUserInfoBySignData", method = RequestMethod.POST)
	public ArrayNode getUserInfoBySignData(@RequestBody ArrayNode customSignDatas) throws Exception;

	/**
	 * 根据租户id获取其被禁用菜单别名
	 * @param tenantId
	 * @return
	 * @throws Exception 
	 */
	@RequestMapping(value="/uc/tenantIgnoreMenu/v1/getIgnoreMenuCodes",method=RequestMethod.GET)
	public List<String> getIgnoreMenuCodes(@RequestParam(value="tenantId",required=true) String tenantId) throws Exception;

	/**
	 * 通过租户ID获取租户信息
	 * @param id
	 * @return
	 */
	@RequestMapping(value="/uc/tenantManage/v1/getJson",method=RequestMethod.GET)
	public JsonNode getTenantById(@RequestParam(value="id", required=true) String id);

	/**
	 * 获取当前用户填制单位
	 * @param demId
	 * @return
	 * @throws Exception 
	 */
	@RequestMapping(value="/api/org/v1/org/getFillOrg",method=RequestMethod.GET)
	public CommonResult<Object> getFillOrg(@RequestParam(value="demId",required=false) String demId,@RequestParam(value="grade",required=false) String grade) throws Exception;



	/**
	 * 根据下属id和维度id获取上级
	 * @param json
	 * @return
	 * @throws Exception
	 */
	@RequestMapping(value="/api/user/v1/user/superior",method=RequestMethod.GET)
	public JsonNode getSuperior(@RequestParam("underId") String underId, @RequestParam("demId") String demId);

	/**
	 * <pre>
	 * 获取人员的上级岗位
	 * 1、先查找主岗位的上级岗位
	 * 2、无主岗位查其他岗位，其他岗位只有一个时，查找该岗位的上级岗位，
	 * 其他岗位为多个时，抛出异常
	 * </pre>
	 * @param userId
	 * @return
	 */
	@RequestMapping(value="/api/org/v1/org/getSuperiorPost",method=RequestMethod.GET)
	public JsonNode getSuperiorPost(@RequestParam("userId")String userId);
	/**
	 * 创建用户
	 * @param userPolymer
	 * @return
	 * @throws Exception
	 */
	@RequestMapping(value = "/api/user/v1/user/saveUser", method = RequestMethod.POST)
	public CommonResult<String> saveUserPolymer(@RequestBody String userPolymer) throws Exception;

	@RequestMapping(value="/uc/shiftRule/v1/computeSendDate", method = RequestMethod.GET)
	public Long computeSendDate(@RequestParam(value="userId") String userId, @RequestParam(value="minute") long minute) throws Exception;

	@RequestMapping(value="/uc/shiftRule/v1/computeDuration", method = RequestMethod.POST)
	public Long computeDuration(@RequestParam(value="userId") String userId, @RequestBody ObjectNode objectNode) throws Exception;

	/**
	 * 获取租户邮件服务器配置
	 * @return
	 */
	@RequestMapping(value="/uc/tenantMailServer/v1/getByCurrent",method=RequestMethod.GET)
	public ObjectNode getTenantMailServiceInfo(@RequestParam(value="tenantId",required=false) String tenantId);

	@RequestMapping(value="/api/org/v1/orgParam/getParamById",method=RequestMethod.GET)
	public String getParamKey( @RequestParam(value="orgId",required=true) String orgId, @RequestParam(value="alias",required=true) String alias);

	@RequestMapping(value="/api/org/v1/orgParam/isOrgHasParamKey",method=RequestMethod.GET)
	public boolean isOrgHasParamKey( @RequestParam(value="orgId",required=true) String orgId, @RequestParam(value="alias",required=true) String alias);

	@RequestMapping(value="/api/org/v1/orgParam/hasOrgParamKey",method=RequestMethod.GET)
	public boolean hasOrgParamKey( @RequestParam(value="grade",required=true) String grade,@RequestParam(value="userId",required=true) String userId, @RequestParam(value="alias",required=true) String alias);

	@RequestMapping(value = "/uc/userUnite/v1/updateUserUnite", method = RequestMethod.POST)
	public CommonResult<String> updateUserUnite(@RequestBody ObjectNode userUnite);

	/**
	 * 获取还没进行企业微信同步的用户
	 * @return
	 */
	@RequestMapping(value="/api/user/v1/users/getUsersNotYetSyncWxWork",method=RequestMethod.GET)
	public JsonNode getUsersNotYetSyncWxWork();

	/**
	 * 根据微信通讯录的userid获取用户与外部通讯录关系
	 * @param wxWorkId
	 * @return
	 */
	@RequestMapping(value = "/uc/userUnite/v1/getUserUniteByWxWorkId", method = RequestMethod.GET)
	public JsonNode getUserUniteByWxWorkId(@RequestParam(value="wxWorkId",required=true) String wxWorkId);

	/**
	 * 根据微信通讯录的userid获取绑定的用户的用户信息
	 * @param wxWorkId
	 * @return
	 */
	@RequestMapping(value = "/api/user/v1/getUserByWxWorkId", method = RequestMethod.GET)
	public JsonNode getUserByWxWorkId(@RequestParam(value="wxWorkId",required=true) String wxWorkId);


	/**
	 * 获取还没进行钉钉同步的用户
	 * @return
	 */
	@RequestMapping(value="/api/user/v1/users/getUsersNotYetSyncDingtalk",method=RequestMethod.GET)
	public ArrayNode getUsersNotYetSyncDingtalk();
	/**
	 * 根据钉钉通讯录的userid获取绑定的用户的用户信息
	 * @param dingtalkId
	 * @return
	 */
	@RequestMapping(value = "/api/user/v1/getUserByDingtalkId", method = RequestMethod.GET)
	public JsonNode getUserByDingtalkId(@RequestParam(value="dingtalkId",required=true) String dingtalkId);
	
	/**
	 * 根据userIds获取钉钉ids
	 * @return
	 */
	@RequestMapping(value="/uc/userUnite/v1/getDingtalkIdsByUserIds",method=RequestMethod.GET)
	public String getDingtalkIdsByUserIds(@RequestParam(value="userIds",required=true) String userIds);
	/**
	 * 根据userIds获取企业微信ids
	 * @return
	 */
	@RequestMapping(value="/uc/userUnite/v1/getWxWorkIdsByUserIds",method=RequestMethod.GET)
	public String getWxWorkIdsByUserIds(@RequestParam(value="userIds",required=true) String userIds);
	/**
	 * 根据userIds获取openIds
	 * @return
	 */
	@RequestMapping(value="/uc/userUnite/v1/getOpenIdsByUserIds",method=RequestMethod.GET)
	public String getOpenIdsByUserIds(@RequestParam(value="userIds",required=true) String userIds);

	/**
	 * 
	 * @param params
	 * @return
	 */
	@RequestMapping(value="/uc/matrix/v1/getUsers",method=RequestMethod.POST)
	public ArrayNode getMatrixRoleUsers(@RequestBody Map<String,Object> params);
	@RequestMapping(value="/uc/matrix/v1/getByCode",method=RequestMethod.GET)
	public JsonNode getMatrixByCode(@RequestParam(value="code", required=true) String code);

    @RequestMapping(value="/uc/matrix/v1/getMatrixInTypeIds",method=RequestMethod.POST)
    public ArrayNode getMatrixInTypeIds(@RequestParam(value="typeIds", required=true) List<String> typeIds);


    @RequestMapping(value="/uc/matrixProcRelation/v1/batchHandle",method=RequestMethod.POST)
	public CommonResult<String> batchHandleMatrixProcRelation(@RequestBody(required=true) ObjectNode relationObjNode);

	@RequestMapping(value="/uc/matrixProcRelation/v1/removeByProcDefKey",method=RequestMethod.POST)
	public CommonResult<String> removeMatrixProcRelationByProcDefKey(@RequestParam(value="procDefKey", required=true) String procDefKey);

	
	/**
	 * 根据条件获取矩阵指定角色的用户
	 * @param params
	 * @return
	 */
	@RequestMapping(value="/uc/matrix/v1/getRoleUserByConditions",method=RequestMethod.POST)
	public ArrayNode getRoleUserByConditions(@RequestBody(required=true)ObjectNode obj);

	@RequestMapping(value="/api/user/v1/users/getByCompanyRole",method=RequestMethod.GET)
	public List<ObjectNode> getByCompanyRole(@RequestParam(value="company", required=true) String company,@RequestParam(value="role", required=true) String role);

	@RequestMapping(value="/api/user/v1/users/getLeaderStep",method=RequestMethod.GET)
	public List<ObjectNode> getLeaderStep(@RequestParam(value="userId", required=true) String userId,@RequestParam(value="grade", required=true) Integer grade,@RequestParam(value="res", required=true) boolean res);

	@RequestMapping(value="/api/user/v1/users/getFgUsers",method=RequestMethod.GET)
	public List<ObjectNode> getFgUsers(@RequestParam(value="orgId",required=true) String orgId, @RequestParam(value="orgParam",required=true) String orgParam, @RequestParam(value="userParam",required=true) String userParam);

	@RequestMapping(value = "/api/user/v1/users/getLeaderStepByOrgId",method = RequestMethod.GET)
	public List<ObjectNode> getLeaderStepByOrgId(@RequestParam(value = "orgId",required=true) String orgId, @RequestParam(value = "grade", required = true)Integer grade);
	
	@RequestMapping(value="/uc/electronicSeal/v1/saveSignatureBatch",method=RequestMethod.POST)
	public CommonResult<String> saveSignatureBatch(@RequestBody ObjectNode signatureData);

	/**
	 * 根据多个组织id获取组织(以逗号隔开)
	 */
	@RequestMapping(value="/api/org/v1/org/getOrgsByIds",method=RequestMethod.GET)
	public ArrayNode getOrgsByIds(@RequestParam(value="ids",required=true) String ids);

	/**
	 * 根据多个组织code获取组织(以逗号隔开)
	 */
	@RequestMapping(value="/api/org/v1/org/getOrgsByCodes",method=RequestMethod.GET)
	public ArrayNode getOrgsByCodes(@RequestParam(value="codes",required=true) String codes);

	/**
	 * 批量更新或创建用户-来自企微钉钉通讯录的数据
	 * @param userlist
	 */
	@RequestMapping(value="/api/user/v1/user/batchUpdateUsersFromExterUni",method=RequestMethod.POST)
	public void batchUpdateUsersFromExterUni(@RequestParam(value = "type",required=true) String type,@RequestBody JsonNode userlist);

	@RequestMapping(value="/uc/electronicSeal/v1/getSealByUserId/{userId}",method=RequestMethod.GET)
	public JsonNode getSealByUserId(@PathVariable("userId") String userId);

    @RequestMapping(value="/base/common/getMicroURIEntity",method=RequestMethod.GET)
    public Set<URIEntity> getMicroURIEntity();

	/**
	 * 用户登陆日志记录
	 * @param account
	 * @param loginType
	 * @return
	 */
	@RequestMapping(value = "/uc/loginLog/v1/loginLog", method = RequestMethod.GET)
	public CommonResult<String> loginLog(@RequestParam(value="account",required=true) String account,@RequestParam(value="loginType",required=true) String loginType);
	/**
	 * 生成扫码登录二维码
	 * @return
	 */
	@RequestMapping(value="/uc/scanLogin/v1/productQrCode",method=RequestMethod.GET)
	public String productQrCode(@RequestParam(value="type",required=true) String type);

	/**
	 * 钉钉扫码回调地址
	 * @return
	 */
	@RequestMapping(value="/uc/scanLogin/v1/dingAuthByCode",method=RequestMethod.GET)
	public JsonNode dingAuthByCode(@RequestParam(value="code",required=true) String code);

	/**
	 * 更新扫码结果接口
	 * @return
	 */
	@RequestMapping(value="/uc/scanLogin/v1/updateScanLoginInfo",method=RequestMethod.GET)
	public String updateScanLoginInfo(@RequestParam(value="scanId",required=true) String scanId,@RequestParam(value="userId",required=true) String userId);
	/**
	 * 获取扫码结果 ，拿到用户信息接口
	 * @return
	 */
	@RequestMapping(value="/uc/scanLogin/v1/queryScanLoginInfo",method=RequestMethod.GET)
	public JsonNode queryScanLoginInfo(@RequestParam(value="busId",required=true) String busId);

	/**
	 * 获取扫码结果 ，拿到用户信息接口
	 * @return
	 */
	@RequestMapping(value="/uc/orgDing/v1/dingApi/getDingPushData",method=RequestMethod.POST)
	public JsonNode getDingPushData(@RequestParam(value = "msg_signature", required = false) String msg_signature,
									@RequestParam(value = "timestamp", required = false) String timeStamp,
									@RequestParam(value = "nonce", required = false) String nonce,
									@RequestBody(required = false) JSONObject json);

	/**
	 * 发送手机号验证码
	 * @return
	 */
	@RequestMapping(value="/uc/shortMsg/v1/sendMsgYzmCode",method=RequestMethod.POST)
	public JsonNode sendMsgYzmCode(@RequestParam(value="mobile",required=true) String mobile,@RequestParam(value="use",required=true) String use);


	/**
	 * 发送手机号验证码
	 * @return
	 */
	@RequestMapping(value="/uc/shortMsg/v1/sendMsgYzmCodeExtUser",method=RequestMethod.POST)
	public JsonNode sendMsgYzmCodeExtUser(@RequestParam(value="mobile",required=true) String mobile,@RequestParam(value="use",required=true) String use);

	/**
	 * 发送手机号验证码
	 * @return
	 */
	@RequestMapping(value="/uc/shortMsg/v1/codeYzmLogin",method=RequestMethod.POST)
	public JsonNode msgYzmLogin(@RequestParam(value="mobile",required=true) String mobile,@RequestParam(value="code",required=true) String code
			,@RequestParam(value="use",required=true) String use);


	/**
	 * 手机号验证码校验
	 * @return
	 */
	@RequestMapping(value="/uc/shortMsg/v1/verifyPhoneCodeByRegister",method=RequestMethod.POST)
	public JsonNode verifyPhoneCodeByRegister(@RequestParam(value="mobile",required=true) String mobile,@RequestParam(value="code",required=true) String code
			,@RequestParam(value="use",required=true) String use);

	/**
	 * 验证码登录成功移除验证码
	 * @return
	 */
	@RequestMapping(value="/uc/shortMsg/v1/removeMsgYzmCode",method=RequestMethod.POST)
	public JsonNode removeMsgYzmCode(@RequestParam(value="mobile",required=true) String mobile,@RequestParam(value="use",required=true) String use);

	/**
	 * 忘记密码_重新设置密码功能
	 */
	@RequestMapping(value="/uc/shortMsg/v1/forgotPwd",method=RequestMethod.POST)
	public JsonNode forgotPwd(@RequestParam(value="account",required=true) String account, @RequestParam(value="mobile",required=true) String mobile,
							  @RequestParam(value="validateCode",required=true) String validateCode, @RequestParam(value="newPsw",required=true) String newPsw,
							  @RequestParam(value="reNewPsw",required=true) String reNewPsw);

	/**
	 * 获取三方用户信息
	 * @param customKey
	 * @return
	 */
	@RequestMapping(value="/api/custom/v1/loadCustomByCustomKey",method=RequestMethod.POST)
	public JsonNode loadCustomByCustomKey(@RequestParam(value="customKey",required=true) String customKey);


	/**
	 * 根据组织id获取组织钉钉参数配置
	 * @return
	 */
	@RequestMapping(value="/uc/org/v1/orgExtSetting/get",method=RequestMethod.GET)
	public JsonNode getOrgExtSetting(@RequestParam(value="orgId",required=true) String orgId);

	/**
	 * 根据组织id获取组织钉钉参数配置
	 * @return
	 */
	@RequestMapping(value="/uc/org/v1/orgExtSetting/getOrgExtSettingByCorpId",method=RequestMethod.GET)
	public JsonNode getOrgExtSettingByCorpId(@RequestParam(value="corpId",required=true) String corpId);

	/**
	 * 根据用户id获取用户钉钉用户信息
	 * @return
	 */
	@RequestMapping(value="/uc/orgExtUser/v1/dingApi/queryExtUserInfoByUserId",method=RequestMethod.GET)
	public JsonNode queryExtUserInfoByUserId(@RequestParam(value="userId",required=true) String userId);


	/**
	 * 根据orgId获取钉钉组织的apiToken
	 * @return
	 */
	@RequestMapping(value="/uc/orgDing/v1/dingApi/getDingToken",method=RequestMethod.GET)
	public JsonNode getDingToken(@RequestParam(value="orgId",required=true) String orgId,@RequestParam(value="tokenType",required=true) String tokenType);
	/**
	 * 获取钉钉用户unionId
	 * @return
	 */
	@RequestMapping(value="/uc/orgDing/v1/dingApi/getDingUserUnionId",method=RequestMethod.GET)
	public JsonNode getDingUserUnionId(@RequestParam(value="orgId",required=true) String orgId,@RequestParam(value="dingUserId",required=true) String dingUserId);

	/**
	 * 更新钉钉待办任务状态
	 * @return
	 */
	@RequestMapping(value="/uc/orgDing/v1/dingApi/updateDingToDoTaskState",method=RequestMethod.GET)
	public JsonNode updateDingToDoTaskState(@RequestParam(value="taskId",required=true) String taskId);

	/**
	 * 指纹登录验证设备id
	 * @return
	 */
	@RequestMapping(value="/api/user/v1/getUserForFingerPrint",method=RequestMethod.GET)
	public JsonNode fingerPrintLogin(@RequestParam(value="type",required=true) String type
			,@RequestParam(value="loginValue",required=true) String loginValue
			,@RequestParam(value="deviceId",required=true) String deviceId);


	/**
	 * 发送钉钉待办
	 * @return
	 */
	@RequestMapping(value="/uc/orgDing/v1/dingApi/sendDingTodoTask",method=RequestMethod.GET)
	public JsonNode sendDingTodoTask(@RequestParam(value="userId",required=true) String userId
			,@RequestParam(value="todoId",required=true) String todoId
			,@RequestParam(value="title",required=true) String title
			,@RequestParam(value="isPushType",required=true) String isPushType);


	/**
	 * 发送钉钉待办
	 * @return
	 */
	@RequestMapping(value="/uc/orgDing/v1/dingApi/sendDingMessage",method=RequestMethod.POST)
	public JsonNode sendDingMessage(@ApiParam(name="exportObject",value="发送钉钉工作通知",required=true) @RequestBody JSONObject exportObject);

	/**
	 * 通过组织id 查询授权应用id
	 */
	@RequestMapping(value="/api/orgAuthExt/v1/queryExtAuthAppIdByOrgIds",method=RequestMethod.POST)
	public String queryExtAuthAppIdByOrgIds(@RequestParam(value="authType",required=true) String authType, @RequestParam(value="orgIds",required=true) String orgIds);


	/**
	 * 获取用户的组织和部门信息
	 */
	@RequestMapping(value="/api/org/v1/getUserOrgAndDept",method=RequestMethod.GET)
	public CommonResult<JsonNode> getUserOrgAndDept( @RequestParam(value="userId",required=true) String userId);

	/**
	 * 获取移动端欢迎页数据
	 * @return
	 */
	@RequestMapping(value="/uc/welcomePage/getWelcomePageData",method=RequestMethod.GET)
	public JsonNode getWelcomeData(@RequestParam(value="orgId",required=true) String orgId);


	/**
	 * 执行zabbix定时任务测试
	 * @return
	 */
	@RequestMapping(value="/uc/zabbix/productZabbixAlertList",method=RequestMethod.GET)
	public JsonNode productZabbixAlertList();

	/**
	 * 通过wx的openId获取用户信息
	 * @return
	 */
	@RequestMapping(value="/api/user/v1/getUserInfoByOpenId",method=RequestMethod.GET)
	public JsonNode getUserInfoByOpenId(@RequestParam(value="wxOpenId",required=true) String wxOpenId);

	/**
	 * 保存用户的wxopenId
	 * @return
	 */
	@RequestMapping(value="/api/user/v1/user/saveUserOpenId",method=RequestMethod.GET)
	public JsonNode saveUserOpenId(@RequestParam(value="openId",required=true) String openId,@RequestParam(value="userId",required=true) String userId);




}
