|
|
@@ -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");
|