jiangping
2024-07-15 055b75bc30aaceb1c73bcb823e8c5ef682891fde
server/service/src/main/java/com/doumee/biz/zbom/impl/ZbomCRMServiceImpl.java
@@ -77,7 +77,7 @@
            entity.setSource(CRMConstants.CRM_SOURCE.SOURCE_MP02);
            entity.setChannel(CRMConstants.CRM_SOURCE.SOURCE_MP02+"00");
        }
        entity.setOpenId(customerLog.getOpenid());
        entity.setOpenid(customerLog.getOpenid());
        entity.setDate(DateUtil.dateToString(customerLog.getCreateDate(),"yyyy/MM/dd HH:mm"));
        CrmCustomerPostRequest obj = new CrmCustomerPostRequest();
        obj.setCusInfo(new ArrayList<>());
@@ -110,7 +110,10 @@
        int status ;
        String crmInfo;
        String param = JSONObject.toJSONString(entity);
        CRMBaseResponse<List<CRMDaogouBindListResponse>> result = sendHttpRequest(CRMConstants.IntegerUrl.DAOGOU_BIND_LIST_URL,CRMConstants.IntegerName.DAOGOU_BIND_LIST_NAME,param);
        CRMBaseResponse<List<CRMDaogouBindListResponse>> result = sendHttpRequest(CRMConstants.IntegerUrl.DAOGOU_BIND_LIST_URL,
                CRMConstants.IntegerName.DAOGOU_BIND_LIST_NAME,
                param,
                new TypeReference<CRMBaseResponse<List<CRMDaogouBindListResponse>>>(){});
        return result;// 默认失败
    }
@@ -124,7 +127,10 @@
        int status ;
        String crmInfo;
        String param = JSONObject.toJSONString(entity);
        CRMBaseResponse<List<CRMCustomerListResponse>> result = sendHttpRequest(CRMConstants.IntegerUrl.CUS_BEFORE_PAGE_LIST_URL,CRMConstants.IntegerName.CUS_BEFORE_PAGE_LIST_NAME,param);
        CRMBaseResponse<List<CRMCustomerListResponse>> result = sendHttpRequest(CRMConstants.IntegerUrl.CUS_BEFORE_PAGE_LIST_URL
                ,CRMConstants.IntegerName.CUS_BEFORE_PAGE_LIST_NAME
                ,param
                ,new TypeReference<CRMBaseResponse<List<CRMCustomerListResponse>>>(){});
        return result;// 默认失败
    }
@@ -158,7 +164,7 @@
        }
        return  null;
    }
    public   <T> CRMBaseResponse<T> sendHttpRequest(String interfaceUrl,  String name,  String param){
    public   <T> CRMBaseResponse<T> sendHttpRequest(String interfaceUrl,  String name,  String param,TypeReference<CRMBaseResponse<T>> typeReference){
        log.info("【"+name+"】================开始===="+ JSONObject.toJSONString(param));
        String appKey = (String) redisTemplate.opsForValue().get(Constants.RedisKeys.ZBOM_CRM_API_KEY);
        String url = redisTemplate.opsForValue().get(Constants.RedisKeys.ZBOM_CRM_API_URL) + interfaceUrl ;
@@ -170,8 +176,6 @@
                url += "?timestamp=" + _t + "&sign=" + DigestUtils.md5Hex( _t + appKey);
                Map<String,String> headers = new HashMap<>();
                res = HttpsUtil.postJson(url,param);
                TypeReference typeReference =
                        new TypeReference<CRMBaseResponse<T>>(){};
                CRMBaseResponse<T>  result = JSONObject.parseObject(res, typeReference.getType());
                logResult(result,name);
                if(StringUtils.equals(result.getCode(),CRMConstants.CODE_SUCCESS)){