| | |
| | | package cn.huge.module.ctuser.controller.client; |
| | | |
| | | import cn.huge.base.common.utils.ObjectUtils; |
| | | import cn.huge.base.common.utils.ReturnFailUtils; |
| | | import cn.huge.base.common.utils.ReturnSucUtils; |
| | | import cn.huge.module.ctuser.domain.po.CtUnit; |
| | | import cn.huge.module.ctuser.domain.po.CtUser; |
| | | import cn.huge.module.ctuser.service.CtUnitService; |
| | | import cn.huge.module.ctuser.service.CtUserService; |
| | | import cn.huge.module.cust.dto.CtUnitDTO; |
| | | import cn.huge.module.cust.dto.CtUserDTO; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | return ReturnFailUtils.getRepInfo(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 根据id查询组织信息 |
| | | * @url {ctx}/api/client/ctUnit/getUnitById |
| | | * @param unitId 组织编号 |
| | | * @return Object |
| | | */ |
| | | @GetMapping("/getUnitById") |
| | | public Object getUnitById(@RequestParam(value = "unitId") String unitId) { |
| | | try { |
| | | CtUnit ctUnit = service.getById(unitId); |
| | | 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(); |
| | | } |
| | | } |
| | | } |