| | |
| | | return ReturnFailUtils.getRepInfo(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 查询用户所在的单位信息 |
| | | * @url {ctx}/api/client/ctUnit/getUnitByUserId |
| | | * @param userId 用户编号 |
| | | * @return Object |
| | | */ |
| | | @GetMapping("/getUnitByUserId") |
| | | public Object getUnitByUserId(@RequestParam(value = "userId") String userId) { |
| | | try { |
| | | CtUser ctUser = ctUserService.getById(userId); |
| | | CtUnit ctUnit = service.getById(ctUser.getUnitId()); |
| | | if (ObjectUtils.isNotEmpty(ctUnit)){ |
| | | CtUnitDTO ctUnitDTO = new CtUnitDTO(); |
| | | BeanUtils.copyProperties(ctUnit, ctUnitDTO); |
| | | return ReturnSucUtils.getRepInfo(ctUnitDTO); |
| | | }else { |
| | | return ReturnFailUtils.getRepInfo("查询组织不存在!"); |
| | | } |
| | | } catch (Exception e) { |
| | | return ReturnFailUtils.getRepInfo(); |
| | | } |
| | | } |
| | | } |