Explorar o código

唐山硕鑫科技有限公司,广州维安信息咨询有限公司

wanxc hai 4 meses
pai
achega
bce6bd1e91

+ 2 - 0
src/main/java/com/tiangua/star/enmus/CommercialCallBackReadyEnum.java

@@ -28,6 +28,8 @@ public enum CommercialCallBackReadyEnum implements StringCodeable {
     Commercial_HS("4712","8e6d4dc0a320250624051228business","https://api.zhudaicms.com/api/stars_back.html?brand=1557&orgid=263&d=1721981038&v=2"),//弘盛信息咨询有限公司
     Commercial_JXJJG("4514","2f81bca076f6250509032146business","http://8.153.166.121:8800/api/customer/customerStarBack"),//4514江西聚金阁&讯速邦掩码撞库
     Commercial_DAQN("4381", "445982746008128business", "http://47.113.122.223:8001/api/xiaoan/queryByUniqueId"),//大连青柠
+    Commercial_GZWA("4355", "198546fcf18b250331014900business", "https://gw.rongxk.cn/crm/api/channel/queryCustomerGrade"),//广州维安信息咨询有限公司
+    Commercial_TSSX("4714", "0243832a0b96250625014129business", "https://gw.rongxk.cn/crm/api/channel/queryCustomerGrade"),//唐山硕鑫科技有限公司
     Commercial_HFYZF("4598", "eea00c739c37250527052046business", "https://rxccrm.chkoala.com/api/xiaoan/queryByUniqueId");//合肥裕之丰
 
 

+ 79 - 1
src/main/java/com/tiangua/star/service/impl/CasllBackDataProcessor.java

@@ -74,7 +74,28 @@ public class CasllBackDataProcessor implements CallBackService {
                         sendGetRequest(CommercialCallBackReadyEnum.Commercial_ONE.getCode(),
                                 CommercialCallBackReadyEnum.Commercial_ONE.getBusid(),commercialCallBackReadyEnum.getUrl(),md5List);
                         break;
-
+                    case Commercial_GZWA://广州维安信息咨询有限公司
+                        List<String> md5ListGZWA = callBackMap.get(productBizId);
+                        log.info("开始处理机构id:{},广州维安信息咨询有限公司 当日订单数:{},条数:{}", productBizId,md5ListGZWA,md5ListGZWA.size());
+                        if (CollectionUtils.isEmpty(md5ListGZWA)) {
+                            return;
+                        }
+                        String channelType="21160";
+                        String accessKey="4A79FD90-DA94-4D4B-AECD-BC48CD418970";
+                        sendGetRequestGZWA(commercialCallBackReadyEnum.getCode(),
+                                commercialCallBackReadyEnum.getBusid(),commercialCallBackReadyEnum.getUrl(),channelType,accessKey,"弘盛信息咨询有限公司",md5ListGZWA);
+                        break;
+                    case Commercial_TSSX://唐山硕鑫科技有限公司
+                        List<String> md5ListTSSX = callBackMap.get(productBizId);
+                        log.info("开始处理机构id:{},唐山硕鑫科技有限公司 当日订单数:{},条数:{}", productBizId,md5ListTSSX,md5ListTSSX.size());
+                        if (CollectionUtils.isEmpty(md5ListTSSX)) {
+                            return;
+                        }
+                        String channelTypeTSSX="21540";
+                        String accessKeyTSSX="5D3842E0-7A2E-4077-8985-16F9782A0950";
+                        sendGetRequestGZWA(commercialCallBackReadyEnum.getCode(),
+                                commercialCallBackReadyEnum.getBusid(),commercialCallBackReadyEnum.getUrl(),channelTypeTSSX,accessKeyTSSX,"弘盛信息咨询有限公司",md5ListTSSX);
+                        break;
                     case Commercial_HS://弘盛信息咨询有限公司
                         List<String> md5ListHS = callBackMap.get(productBizId);
                         log.info("开始处理机构id:{},弘盛信息咨询有限公司 当日订单数:{},条数:{}", productBizId,md5ListHS,md5ListHS.size());
@@ -627,7 +648,64 @@ public class CasllBackDataProcessor implements CallBackService {
 //        handleMappedData(busiId,followupList);
 //
 //    }
+    //融享客通用
+    private void sendGetRequestGZWA(String productBizId,String busiId,String url,String companyName,String channelType,String accessKey,List<String> md5ListGZWA){
+
+        JSONObject object = new JSONObject();
+        object.put("accessKey",accessKey);
+        object.put("channelType", channelType);
+        object.put("phoneMd5List", md5ListGZWA);
+        String jsonString = JSON.toJSONString(object);
+        String responseStr = HttpClientThreeUtil.post(url, jsonString);
+        JSONObject response = JSON.parseObject(responseStr);
+        String code = response.getString("code");
+        if (!"200".equals(code)) {
+            log.info("busiId:{},companyName {},24h返回数据错误: {},{}" ,busiId,companyName,
+                    response.getString("msg"),response.getString("code"));
+            return;
+        }
+
+        JSONArray dataArray = response.getJSONArray("data");
+        List<CustomerFollowup> followupList = new ArrayList<>();
 
+        // 遍历 data 数组,创建实体对象并设置对应字段
+        for (int i = 0; i < dataArray.size(); i++) {
+            JSONObject obj = dataArray.getJSONObject(i);
+            CustomerFollowup followup = new CustomerFollowup();
+            followup.setBusiId(busiId);
+            followup.setProductBizId(Integer.parseInt(productBizId));
+            followup.setPhoneMd5(obj.getString("phoneMd5"));
+            String star = obj.getString("grade");
+            if (StringUtils.isEmpty(star)) {
+                log.info("busiId:{} companyName {}, mobile_md5{} 没有填星级:", busiId, companyName ,followup.getPhoneMd5());
+                continue;
+            } else {
+                if ("0".equals(star)) {
+                    followup.setStarLevel(new BigDecimal(0));
+                } else if ("10".equals(star)) {
+                    followup.setStarLevel(new BigDecimal(1));
+                }else if ("20".equals(star)) {
+                    followup.setStarLevel(new BigDecimal(2));
+                }else if ("30".equals(star)) {
+                    followup.setStarLevel(new BigDecimal(3));
+                }else if ("40".equals(star)) {
+                    followup.setStarLevel(new BigDecimal(4));
+                }else if ("50".equals(star)) {
+                    followup.setStarLevel(new BigDecimal(5));
+                }
+            }
+            followup.setSourceType(3);
+            followup.setFollowTime(new Date());
+            followupList.add(followup);
+        }
+        if (CollectionUtils.isEmpty(followupList)) {
+            log.info("busiId:{} companyName:{},没有24h星级数据", busiId,companyName);
+            return;
+        }
+        log.info("busiId:{} companyName:{} 处理数据条:{}", busiId, companyName,followupList.size());
+        handleMappedData(busiId,followupList);
+
+    }
     //https://api.zhudaicms.com/ 通用
     private void sendGetRequestHz(String productBizId,String busiId,String url,String companyName){
         String responseStr = HttpClientThreeUtil.get(url,null);