| | |
| | | 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.alibaba.fastjson.JSON; |
| | |
| | | throw new ServiceException("CustClientImpl.paClientGetUserAll", e); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 当事人-获取登录用户 |
| | | * @param userId 用户编号 |
| | | * @return |
| | | */ |
| | | public CtUnitDTO getUnitByUserId(String userId){ |
| | | try{ |
| | | ReturnBO returnBo = custClient.getUnitByUserId(userId); |
| | | if (ReturnConsts.OK == returnBo.getCode()){ |
| | | CtUnitDTO loginUser = objectMapper.convertValue(returnBo.getData(), CtUnitDTO.class); |
| | | return loginUser; |
| | | }else{ |
| | | log.error("Client外服务接口[CustClientImpl.getUnitByUserId]请求异常:" + returnBo.getMsg(), returnBo.getMsg()); |
| | | throw new ClientException("CustClientImpl.getUnitByUserId", returnBo.getMsg()); |
| | | } |
| | | }catch (Exception e){ |
| | | log.error("service方法[CustClientImpl.getUnitByUserId]调用异常:"+e, e); |
| | | throw new ServiceException("CustClientImpl.getUnitByUserId", e); |
| | | } |
| | | } |
| | | } |