فهرست منبع

合肥裕之丰星级回传

wanxc 4 ماه پیش
والد
کامیت
afc6b3ff21

+ 3 - 1
src/main/java/com/tiangua/star/enmus/CommercialCallBackReadyEnum.java

@@ -26,7 +26,9 @@ public enum CommercialCallBackReadyEnum implements StringCodeable {
     Commercial_SXJLHJ2("4592","92ead8dc6ee0250527011912business","https://api.zhudaicms.com/api/stars_back.html?brand=1673&orgid=1568&d=1738894871"),//陕西聚隆汇金(二店)
     //Commercial_HLJJC("4542","88c430c8a939250513054555business","http://43.139.215.175/api/customer.callback/index"),//黑龙江省景琛信息咨询有限公司
     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_DAQN("4381", "445982746008128business", "http://47.113.122.223:8001/api/xiaoan/queryByUniqueId"),//大连青柠
+    Commercial_HFYZF("4598", "eea00c739c37250527052046business", "https://rxccrm.chkoala.com/api/xiaoan/queryByUniqueId");//合肥裕之丰
+
 
     private String code;
     private String busid;

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

@@ -309,7 +309,14 @@ public class CasllBackDataProcessor implements CallBackService {
                                 commercialCallBackReadyEnum.getBusid(),
                                 commercialCallBackReadyEnum.getUrl(),thirdStarDtos);
                         break;
-
+                    case Commercial_HFYZF:
+                        if (CollectionUtils.isEmpty(thirdStarDtos)) {
+                            return;
+                        }
+                        sendHeFei(commercialCallBackReadyEnum.getCode(),
+                                commercialCallBackReadyEnum.getBusid(),
+                                commercialCallBackReadyEnum.getUrl(),thirdStarDtos);
+                        break;
                 }
             }
         }
@@ -694,7 +701,55 @@ public class CasllBackDataProcessor implements CallBackService {
         log.info("busiId:{} 处理数据条:{}", busiId, list.size());
         handleMappedData(busiId,list);
     }
+    private void sendHeFei(String productBizId,String busiId,String url,List<ThirdStarDto> thirdStarDtos){
+        if (CollectionUtils.isEmpty(thirdStarDtos)) {
+            return;
+        }
+        List<CustomerFollowup> list = new ArrayList<>();
+        Map<String, String> map = new HashMap();
+        JSONObject response = null;
+        String joined = thirdStarDtos.stream()
+                .map(ThirdStarDto::getUniqueIdentify)
+                .collect(Collectors.joining(","));
+
+        map.put("app_id", "80");
+        map.put("timestamp", String.valueOf(System.currentTimeMillis()/1000));
+        map.put("unique_id", joined);
+        String sign = makeSign(map, "38b1924a86ca479c842953ff59f724be");
+        map.put("sign", sign);
+        log.info("【合肥裕之丰】请求前参数:{}",map);
+        String responseStr = HttpClientThreeUtil.post(url, JSON.toJSONString(map));
+        response = JSON.parseObject(responseStr);
+        log.info("【合肥裕之丰】响应数据:{}",response);
+        if (response.getInteger("code") == 200) {
+            JSONArray data = response.getJSONArray("data");
+
+            Map<String, ThirdStarDto> dtoMap = thirdStarDtos.stream()
+                    .collect(Collectors.toMap(ThirdStarDto::getUniqueIdentify, Function.identity(), (a, b) -> a));
+
+            for (int i = 0; i < data.size(); i++) {
+                JSONObject obj = data.getJSONObject(i);
+                String uniqueId = obj.getString("unique_id");
+                Integer star = obj.getInteger("star");
 
+                ThirdStarDto dto = dtoMap.get(uniqueId);
+                if (dto != null) {
+                    CustomerFollowup followup = new CustomerFollowup();
+                    followup.setStarLevel(new BigDecimal(star));
+                    followup.setPhoneMd5(dto.getPhoneMd5());
+                    followup.setBusiId(busiId);
+                    followup.setProductBizId(Integer.parseInt(productBizId));
+                    followup.setFollowTime(new Date());
+                    followup.setSourceType(3);
+                    list.add(followup);
+                } else {
+                    log.warn("未匹配到 unique_id={} 对应的 ThirdStarDto", uniqueId);
+                }
+            }
+        }
+        log.info("busiId:{} 处理数据条:{}", busiId, list.size());
+        handleMappedData(busiId,list);
+    }
     public static void main(String[] args) {
         Map<String, String> map = new HashMap();
         map.put("app_id", "45");