| | |
| | | import cn.huge.module.client.api.CustClient; |
| | | import cn.huge.module.cust.dto.CtUserDTO; |
| | | import cn.huge.module.cust.dto.PaUserDTO; |
| | | import cn.huge.module.mediate.dto.WechatBindCaseDTO; |
| | | import cn.huge.module.sync.domain.target.TargetCtAccount; |
| | | import cn.huge.module.sync.domain.target.TargetCtUnit; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | |
| | | |
| | | /** |
| | | * 微服务调用-数据迁移-批量新增 |
| | | * @param targetCtUnitList 批量数据 |
| | | * @param targetTableList 批量数据 |
| | | * @return |
| | | */ |
| | | public CtUserDTO saveCtUnitList(List<TargetCtUnit> targetCtUnitList){ |
| | | public CtUserDTO saveTableList(List<TargetCtUnit> targetTableList){ |
| | | try{ |
| | | ReturnBO returnBo = custClient.saveCtUnitList(targetCtUnitList); |
| | | ReturnBO returnBo = custClient.saveTableList(targetTableList); |
| | | if (ReturnConsts.OK == returnBo.getCode()){ |
| | | CtUserDTO loginUser = objectMapper.convertValue(returnBo.getData(), CtUserDTO.class); |
| | | return loginUser; |
| | | }else{ |
| | | log.error("Client外服务接口[CustClientImpl.saveCtUnitList]请求异常:" + returnBo.getMsg(), returnBo.getMsg()); |
| | | throw new ClientException("CustClientImpl.saveCtUnitList", returnBo.getMsg()); |
| | | log.error("Client外服务接口[CustClientImpl.saveTableList]请求异常:" + returnBo.getMsg(), returnBo.getMsg()); |
| | | throw new ClientException("CustClientImpl.saveTableList", returnBo.getMsg()); |
| | | } |
| | | }catch (Exception e){ |
| | | log.error("service方法[CustClientImpl.saveCtUnitList]调用异常:"+e, e); |
| | | throw new ServiceException("CustClientImpl.saveCtUnitList", e); |
| | | log.error("service方法[CustClientImpl.saveTableList]调用异常:"+e, e); |
| | | throw new ServiceException("CustClientImpl.saveTableList", e); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 微服务调用-数据迁移-批量新增 |
| | | * @param targetTableList 批量数据 |
| | | * @return |
| | | */ |
| | | public CtUserDTO saveTableList1(List<TargetCtAccount> targetTableList){ |
| | | try{ |
| | | ReturnBO returnBo = custClient.saveTableList1(targetTableList); |
| | | if (ReturnConsts.OK == returnBo.getCode()){ |
| | | CtUserDTO loginUser = objectMapper.convertValue(returnBo.getData(), CtUserDTO.class); |
| | | return loginUser; |
| | | }else{ |
| | | log.error("Client外服务接口[CustClientImpl.saveTableList1]请求异常:" + returnBo.getMsg(), returnBo.getMsg()); |
| | | throw new ClientException("CustClientImpl.saveTableList1", returnBo.getMsg()); |
| | | } |
| | | }catch (Exception e){ |
| | | log.error("service方法[CustClientImpl.saveTableList1]调用异常:"+e, e); |
| | | throw new ServiceException("CustClientImpl.saveTableList1", e); |
| | | } |
| | | } |
| | | } |