package com.hotent.uc.controller; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import com.hotent.base.controller.BaseController; import com.hotent.base.feign.PortalFeignService; import com.hotent.base.model.CommonResult; import com.hotent.base.query.PageList; import com.hotent.base.query.QueryFilter; import com.hotent.uc.exception.BaseException; import com.hotent.uc.model.UserRel; import com.hotent.uc.params.user.UserRelFilterObject; import com.hotent.uc.params.user.UserRelVo; import com.hotent.uc.params.user.UserVo; /** * 用户关系汇报线模块接口 * @author zhangxw * */ @RestController @RequestMapping("/api/userRel/v1/") @Api(tags="UserRelController") public class UserRelController extends BaseController { @Autowired PortalFeignService portalFeignService; /** * 查询用户关系定义 * @param filter * @return * @throws Exception */ @RequestMapping(value="userRels/getUserRelPage",method=RequestMethod.POST, produces = { "application/json; charset=utf-8" }) @ApiOperation(value = "获取用户关系定义列表(带分页信息)", httpMethod = "POST", notes = "获取用户关系定义列表") public PageList getUserRelPage(@ApiParam(name = "filter", value = "查询参数", required = true) @RequestBody QueryFilter filter) throws Exception{ // return userRelService.query(filter); throw new BaseException("uc-demo模块不需要实现该接口"); } /** * 查询用户关系定义 * @param filter * @return * @throws Exception */ @RequestMapping(value="userRels/getUserRelByTypeId",method=RequestMethod.GET, produces = { "application/json; charset=utf-8" }) @ApiOperation(value = "根据汇报线分类编码获取下属的所有汇报线", httpMethod = "GET", notes = "根据汇报线分类编码获取下属的所有汇报线") public List getUserRelByTypeId(@ApiParam(name = "typeId", value = "分类Id", required = true) @RequestParam String typeId) throws Exception{ // List list = userRelService.getUserRelByTypeId(typeId); // List rtnList = BeanUtils.listToTree(list); // return rtnList; throw new BaseException("uc-demo模块不需要实现该接口"); } /** * 查询用户关系定义 * @param filter * @return * @throws Exception */ @RequestMapping(value="userRels/getChildRelByAilas",method=RequestMethod.GET, produces = { "application/json; charset=utf-8" }) @ApiOperation(value = "根据汇报线别名获取其直接子节点", httpMethod = "GET", notes = "根据汇报线别名获取其直接子节点") public PageList getChildRelByAilas(@ApiParam(name = "alias", value = "查询参数", required = true) @RequestParam String alias) throws Exception{ // return userRelService.getChildRelByAilas(alias); throw new BaseException("uc-demo模块不需要实现该接口"); } /** * 添加用户关系定义 * @param userRelVo * @return * @throws Exception * */ @RequestMapping(value="userRel/addUserRel",method=RequestMethod.POST, produces = { "application/json; charset=utf-8" }) @ApiOperation(value = "添加用户关系定义", httpMethod = "POST", notes = "添加用户关系定义") public CommonResult addUserRel(@ApiParam(name="userRelVo",value="用户关系定义参数对象", required = true) @RequestBody List userRelVo) throws Exception{ // return userRelService.addUserRel(userRelVo); throw new BaseException("uc-demo模块不需要实现该接口"); } /** * 根据用户关系定义编码删除用户关系定义 * @param code * @return * @throws Exception */ @RequestMapping(value="userRel/deleteUserRel",method=RequestMethod.POST, produces = { "application/json; charset=utf-8" }) @ApiOperation(value = "根据用户关系定义编码删除用户关系定义", httpMethod = "POST", notes = "根据用户关系定义编码删除用户关系定义") public CommonResult deleteUserRel(@ApiParam(name="codes",value="用户关系定义编码", required = true) @RequestBody String codes) throws Exception{ // return userRelService.deleteUserRel(codes); throw new BaseException("uc-demo模块不需要实现该接口"); } /** * 更新用户关系定义 * @param userRelVo * @return * @throws Exception */ @RequestMapping(value="userRel/updateUserRel",method=RequestMethod.PUT, produces = { "application/json; charset=utf-8" }) @ApiOperation(value = "更新用户关系定义", httpMethod = "PUT", notes = "更新用户关系定义") public CommonResult updateUserRel(@ApiParam(name="userRelVo",value="用户关系定义参数对象", required = true) @RequestBody UserRelVo userRelVo) throws Exception{ // return userRelService.updateUserRel(userRelVo); throw new BaseException("uc-demo模块不需要实现该接口"); } /** * 获取用户关系定义信息 * @param code * @return * @throws Exception */ @RequestMapping(value="userRel/getUserRel",method=RequestMethod.GET, produces = { "application/json; charset=utf-8" }) @ApiOperation(value = "根据用户关系定义别名获取用户关系定义信息", httpMethod = "GET", notes = "获取用户关系定义信息") public UserRel getUserRel(@ApiParam(name="alias",value="用户关系定义别名", required = true) @RequestParam String alias) throws Exception{ //return userRelService.getByAlias(alias); throw new BaseException("uc-demo模块不需要实现该接口"); } /** * 获取直接上级用户 * @param userRelFilterObject * @return * @throws Exception * */ @RequestMapping(value="userRel/getSuperUser",method=RequestMethod.POST, produces = { "application/json; charset=utf-8" }) @ApiOperation(value = "获取直接上级用户", httpMethod = "POST", notes = "获取直接上级用户") public List getSuperUser(@ApiParam(name="userRelFilterObject",value="用户关系定义编码", required = true) @RequestBody UserRelFilterObject userRelFilterObject) throws Exception{ /*String typeId = userRelService.getRelTypeId(userRelFilterObject); List users = userRelService.getSuperUser(userRelFilterObject.getAccount() , typeId); return OrgUtil.convertToUserVoList(users);*/ throw new BaseException("uc-demo模块不需要实现该接口"); } /** * 获取所有上级用户 * @param userRelFilterObject * @return * @throws Exception * */ @RequestMapping(value="userRel/getAllSuperUser",method=RequestMethod.POST, produces = { "application/json; charset=utf-8" }) @ApiOperation(value = "获取所有上级用户", httpMethod = "POST", notes = "获取所有上级用户") public List getAllSuperUser(@ApiParam(name="userRelFilterObject",value="用户关系定义编码", required = true) @RequestBody UserRelFilterObject userRelFilterObject) throws Exception{ throw new BaseException("uc-demo模块不需要实现该接口"); } /** * 获取直接下级用户 * @param userRelFilterObject * @return * @throws Exception * */ @RequestMapping(value="userRel/getLowerUser",method=RequestMethod.POST, produces = { "application/json; charset=utf-8" }) @ApiOperation(value = "获取直接下级用户", httpMethod = "POST", notes = "获取直接下级用户") public List getLowerUser(@ApiParam(name="userRelFilterObject",value="用户关系定义编码", required = true) @RequestBody UserRelFilterObject userRelFilterObject) throws Exception{ throw new BaseException("uc-demo模块不需要实现该接口"); } /** * 获取所有下级用户 * @param userRelFilterObject * @return * @throws Exception * */ @RequestMapping(value="userRel/getAllLowerUser",method=RequestMethod.POST, produces = { "application/json; charset=utf-8" }) @ApiOperation(value = "获取所有下级用户", httpMethod = "POST", notes = "获取所有下级用户") public List getAllLowerUser(@ApiParam(name="userRelFilterObject",value="用户关系定义编码", required = true) @RequestBody UserRelFilterObject userRelFilterObject) throws Exception{ throw new BaseException("uc-demo模块不需要实现该接口"); } /** * 物理删除所有逻辑删除了的用户关系汇报线数据 * @return * @throws Exception */ @RequestMapping(value="userRel/deleteUserRelPhysical",method=RequestMethod.DELETE, produces = { "application/json; charset=utf-8" }) @ApiOperation(value = "物理删除所有逻辑删除了的用户关系汇报线数据", httpMethod = "DELETE", notes = "物理删除所有逻辑删除了的用户关系汇报线数据") public CommonResult deleteUserRelPhysical() throws Exception{ throw new BaseException("uc-demo模块不需要实现该接口"); } /** * 根据时间获取汇报线节点数据(数据同步) * @param btime * @param etime * @return * @throws Exception */ @RequestMapping(value="userRels/getUserRelByTime",method=RequestMethod.GET, produces = { "application/json; charset=utf-8" }) @ApiOperation(value = "根据时间获取汇报线节点数据(数据同步)", httpMethod = "GET", notes = "根据时间获取汇报线节点数据(数据同步)") public List getUserRelByTime(@ApiParam(name="btime",value="开始时间(格式:2018-01-01 12:00:00或2018-01-01)") @RequestParam(required=false) String btime,@ApiParam(name="etime",value="结束时间(格式:2018-02-01 12:00:00或2018-02-01)") @RequestParam(required=false) String etime) throws Exception{ throw new BaseException("uc-demo模块不需要实现该接口"); } /** * 更新汇报线节点所在树的位置 * @param request * @param response * @throws Exception void * @exception */ @RequestMapping(value="userRels/updateRelPos",method=RequestMethod.POST, produces = { "application/json; charset=utf-8" }) @ApiOperation(value = "更新汇报线节点所在树的位置", httpMethod = "POST", notes = "更新汇报线节点所在树的位置(树结构拖动保存)") public CommonResult updateRelPos(@ApiParam(name="relId",value="移动节点id", required = true) @RequestParam String relId,@ApiParam(name="parentId",value="移至(目标)节点id", required = true) @RequestParam String parentId) throws Exception { throw new BaseException("uc-demo模块不需要实现该接口"); } }