| | |
| | | @Service |
| | | public interface ZbomCRMService { |
| | | |
| | | int dealCustomerLogData(CustomerLog customerLog); |
| | | void dealCustomerLogData(CustomerLog customerLog); |
| | | String zbomEncode(String str); |
| | | String getCrmGoUrl(String userName,Integer type); |
| | | |
| | |
| | | */ |
| | | @Override |
| | | @Async |
| | | public int dealCustomerLogData(CustomerLog customerLog){ |
| | | public void dealCustomerLogData(CustomerLog customerLog){ |
| | | CrmCustomerInfoRequest entity = new CrmCustomerInfoRequest(); |
| | | entity.setId(customerLog.getId()); |
| | | entity.setName(customerLog.getName()); |
| | |
| | | .set(CustomerLog::getCrmStatus,Constants.ONE ) |
| | | .set(CustomerLog::getCrmInfo,crmInfo ) |
| | | .set(CustomerLog::getCrmDate,new Date() ));// 更新状态 |
| | | return status;// 默认失败 |
| | | } |
| | | /** |
| | | * 获取导购绑定列表 |
| | |
| | | /** |
| | | * 记录列表 |
| | | */ |
| | | @JsonAlias(value = {"data","records","userFavoriteList","userBehaviorList","customerFavoritesList"}) |
| | | @JsonAlias( {"data","records","userFavoriteList","userBehaviorList","customerFavoritesList"}) |
| | | private List<T> records; |
| | | /** |
| | | * 当前页 |
| | | */ |
| | | @JsonAlias(value = {"pageCount","pageNum"}) |
| | | @JsonAlias( {"pageCount","pageNum"}) |
| | | private String pageNum; |
| | | /** |
| | | * 每页条数 |
| | | */ |
| | | @JsonAlias(value = {"pageSize",}) |
| | | @JsonAlias( {"pageSize",}) |
| | | private String pageSize; |
| | | /** |
| | | * 总数 |
| | | */ |
| | | @JsonAlias(value = {"totalCount","total"}) |
| | | @JsonAlias( {"totalCount","total"}) |
| | | private String total; |
| | | } |
| | |
| | | boolean hasMore = true; |
| | | int currentNum = 0; |
| | | Date cdate = new Date(); |
| | | List<CRMDaogouBindListResponse> allList = new ArrayList<>(); |
| | | while (hasMore){ |
| | | try { |
| | | request.setPage(request.getPage()+1); |
| | | currentNum += currentNum; |
| | | CRMBaseResponse<List<CRMDaogouBindListResponse>> response = zbomCRMService.getDaogouBindList(request); |
| | | if(response==null |
| | | || !StringUtils.equals(response.getCode(), CRMConstants.CODE_SUCCESS) |
| | | || response.getData() ==null |
| | | || response.getData().size() ==0){ |
| | | hasMore = false; |
| | | allList.addAll(response.getData()); |
| | | currentNum += response.getTotal(); |
| | | } |
| | | if(currentNum >= response.getTotal()){ |
| | | hasMore = false; |
| | | } |
| | | dealSyncDataBiz(cdate,response.getData()); |
| | | }catch (Exception e){ |
| | | hasMore = false; |
| | | } |
| | | } |
| | | dealSyncDataBiz(cdate,allList); |
| | | } |
| | | |
| | | private void dealSyncDataBiz(Date date,List<CRMDaogouBindListResponse> list) { |
| | |
| | | |
| | | @Autowired |
| | | private UsersService usersService; |
| | | @Autowired |
| | | private ZbomCRMService zbomCRMService; |
| | | |
| | | @Autowired |
| | | private CustomerUserService customerUserService; |
| | |
| | | public ApiResponse saveRenovationCalculator(@RequestBody RenovationCalculatorDTO renovationCalculatorDTO) { |
| | | renovationCalculatorDTO.setMemberId(getMemberId()); |
| | | CustomerLog customerLog =customerService.saveRenovationCalculator(renovationCalculatorDTO); |
| | | // zbomCRMService.dealCustomerLogData(customerLog); |
| | | zbomCRMService.dealCustomerLogData(customerLog); |
| | | return ApiResponse.success("操作成功"); |
| | | } |
| | | |
| | |
| | | public ApiResponse saveFreeCustomizationApply(@RequestBody FreeCustomizationDTO freeCustomizationDTO) { |
| | | freeCustomizationDTO.setMemberId(getMemberId()); |
| | | CustomerLog customerLog = customerService.saveFreeCustomizationApply(freeCustomizationDTO); |
| | | // zbomCRMService.dealCustomerLogData(customerLog); |
| | | zbomCRMService.dealCustomerLogData(customerLog); |
| | | return ApiResponse.success("操作成功"); |
| | | } |
| | | |