| | |
| | | import cn.huge.base.common.exception.ClientException; |
| | | import cn.huge.base.common.exception.ServiceException; |
| | | import cn.huge.module.client.api.CustClient; |
| | | import cn.huge.module.cust.dto.CtUnitDTO; |
| | | import cn.huge.module.cust.dto.CtUserDTO; |
| | | import cn.huge.module.cust.dto.PaUserDTO; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 根据id查询组织信息 |
| | | * @url {ctx}/api/client/ctUnit/getUnitById |
| | | * @param unitId 组织编号 |
| | | * @return Object |
| | | */ |
| | | public CtUnitDTO getUnitById(String unitId){ |
| | | try{ |
| | | ReturnBO returnBo = custClient.getUnitById(unitId); |
| | | if (ReturnConsts.OK == returnBo.getCode()){ |
| | | CtUnitDTO ctUnitDTO = objectMapper.convertValue(returnBo.getData(), CtUnitDTO.class); |
| | | return ctUnitDTO; |
| | | }else{ |
| | | log.error("Client外服务接口[CustClientImpl.getUnitById]请求异常:" + returnBo.getMsg(), returnBo.getMsg()); |
| | | throw new ClientException("CustClientImpl.getUnitById", returnBo.getMsg()); |
| | | } |
| | | }catch (Exception e){ |
| | | log.error("service方法[CustClientImpl.getUnitById]调用异常:"+e, e); |
| | | throw new ServiceException("CustClientImpl.getUnitById", e); |
| | | } |
| | | } |
| | | |
| | | } |