Procházet zdrojové kódy

佛山市格鑫信息服务有限公司

wanxc před 2 týdny
rodič
revize
805d1dcbca

+ 9 - 5
src/main/java/com/tiangua/star/controller/Md5CallBackController.java

@@ -16,11 +16,14 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
 import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.stream.Collectors;
 
 
+
+
 /**
  * @author
  * @description 本应用 +诚易融 需求开发上线一共两天
@@ -80,16 +83,17 @@ public class Md5CallBackController {
 
 //    @PostMapping("/sendGetRequestHeiLongJiang")
 //    public void processInstitutionData() {
-//        String s1 = "99C0B3015254F583F3BF7C8430F328A5";
-//        String s2 = "8C32A04C7FED4B5EF9451CDB5D9DE770";
+//        String s1 = "1086f3fa73726a1cd0abe7fefbc8c2e2";
+//        String s2 = "b77b199f01c41c1f9c8d84317cb9b802";
 //
 //        List<String> strings = new ArrayList<>();
-//        strings.add(s1);
-//        strings.add(s2);
+//        strings.add(s1.toUpperCase());
+//        strings.add(s2.toUpperCase());
+//        Map<String, String> resultMap = new HashMap<>();
 ////
 ////        String md5ListStr = [A4DAB7668AACAC1D134C1F37351689B2, AD7DE46FF63D14586BDB2960F8DFADA3, 830A6BF59D2BD7CC9BF348968F339679, BB0827AA0A5488D9888A9AB5F91EC1D9, 5DC81C7B49DF99B9EFD6AE60930684C3, 3FA262C2228781E91693FD1E491AD992, 2AA2F6D980D3AA1A99BC2668E6D17DF2, 5EF5B85D827A0D8DAF4F2F58492EAEF2, 5642D0403C64E28A35A458DD51D1835C, B042388F090D43BD65BF8041A077D498, 17E7DC0697D9778AC8CF3E34C1473A02, 19799C273D2A4AB61C83D032CAD58077, 6AD4F0A0B434BADD714008D993CCEB09, 1DC1BD9F6701A9D89E188A1215F644F0, 4350DEA1CE1875F7F307FA5D9BCD532A, 87E365716EC2308152C63EB815461794, 577DF2744FD39D6A8B62EE51E709ED33, 088249775E8CEB938D3FB8B0F24C0142];
 ////        strings.add(md5ListStr);
 //        //sendGetRequestCQYXJ("4516","bff040093fee250512093334business","https://gw.rongxk.com/crm/api/channel/queryCustomerGrade",strings,"1D4C6329-399F-42CA-AC0C-236E0B048AD0",21540);
-//        sendGetRequestGZWA("4618", "a2f5cc8171d6250604105336business", "https://gw.rongxk.cn/crm/api/channel/queryCustomerGrade","苏州荣聚鑫科技有限公司","21540","8AF3F228-913D-4430-883A-2CEA88D8657E",strings);
+//        sendGetRequestFSGX("4502","6ac71df9f07d250507043310business","http://www.fsgxxi.com/api/task/getCheckr","佛山市格鑫信息服务有限公司",strings,resultMap);
 //    }
 }

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

@@ -45,6 +45,7 @@ public enum CommercialCallBackReadyEnum implements StringCodeable {
     Commercial_GZXX("4504", "3058badbe272250507060325business", "https://gw.rongxk.cn/crm/api/channel/queryCustomerGrade"),//广州星象信息科技有限公司
     Commercial_YBDSHY("4672", "f11b39f57671250617035916business", "https://gw.rongxk.cn/crm/api/channel/queryCustomerGrade"),//延边鼎晟合盈企业管理有限公司
     Commercial_HNJS("4879","584c550f633a251017054419business","http://122.114.55.45:9501/openapi/customer/return"),//海南谨昇信息服务有限公司
+    Commercial_FSGX("4502","6ac71df9f07d250507043310business","http://www.fsgxxi.com/api/task/getCheckr"),//佛山市格鑫信息服务有限公司
     Commercial_HFYZF("4598", "eea00c739c37250527052046business", "https://rxccrm.chkoala.com/api/xiaoan/queryByUniqueId");//合肥裕之丰
 
 

+ 124 - 0
src/main/java/com/tiangua/star/service/impl/CasllBackDataProcessor.java

@@ -196,6 +196,16 @@ public class CasllBackDataProcessor implements CallBackService {
                         sendGetRequestGZWA(commercialCallBackReadyEnum.getCode(),
                                 commercialCallBackReadyEnum.getBusid(),commercialCallBackReadyEnum.getUrl(),channelTypeYBDSHY,accessKeyYBDSHY,"延边鼎晟合盈企业管理有限公司",md5ListYBDSHY,resultMap);
                         break;
+                    case Commercial_FSGX://佛山市格鑫信息服务有限公司
+                        List<String> md5ListFSGX = callBackMap.get(productBizId);
+                        log.info("开始处理机构id:{},佛山市格鑫信息服务有限公司 当日订单数:{},条数:{}", productBizId,md5ListFSGX,md5ListFSGX.size());
+                        if (CollectionUtils.isEmpty(md5ListFSGX)) {
+                            return;
+                        }
+                        sendGetRequestFSGX(commercialCallBackReadyEnum.getCode(),
+                                commercialCallBackReadyEnum.getBusid(),commercialCallBackReadyEnum.getUrl(),"佛山市格鑫信息服务有限公司",md5ListFSGX,resultMap);
+                        break;
+
                     case Commercial_XNLJKJ://西宁蓝鲸优享科技有限公司
                         List<String> md5ListXNLJKJ = callBackMap.get(productBizId);
                         log.info("开始处理机构id:{},西宁蓝鲸优享科技有限公司 当日订单数:{},条数:{}", productBizId,md5ListXNLJKJ,md5ListXNLJKJ.size());
@@ -1380,6 +1390,120 @@ public class CasllBackDataProcessor implements CallBackService {
         handleMappedData(busiId,followupList);
 
     }
+    private  void sendGetRequestFSGX(String productBizId,String busiId,String url,String companyName,List<String> md5ListFSGX,Map<String, String> resultMap){
+
+        JSONObject jsonObjects = new JSONObject();
+        jsonObjects.put("mobiles", md5ListFSGX);
+        String responseStr = HttpClientThreeUtil.post(url,jsonObjects.toJSONString());
+        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<>();
+        String s = resultMap.get(busiId);
+        JSONObject jsonObject = JSON.parseObject(s);
+        // 遍历 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));
+
+            // 提取 mobile 字段(替换原 md5mobile)
+            String mobileMd5 = obj.getString("mobile");
+            followup.setPhoneMd5(mobileMd5);
+
+            // 提取 rank 字段(替换原 stars)
+            String rank = obj.getString("rank"); // 注意:rank可能为数字或null,用getString兼容
+            if (StringUtils.isBlank(rank) || "null".equals(rank)) {
+                log.info("busiId:{} companyName {} mobile_md5{} 没有填星级:", busiId, companyName, mobileMd5);
+                continue;
+            } else {
+                if (StringUtils.isEmpty(s)) {
+                    // 直接使用rank作为星级(处理数字或null转换)
+                    if ("0".equals(rank)) {
+                        followup.setStarLevel(new BigDecimal(0));
+                    } else if ("1".equals(rank)) {
+                        followup.setStarLevel(new BigDecimal(1));
+                    }else if ("2".equals(rank)) {
+                        followup.setStarLevel(new BigDecimal(2));
+                    }else if ("3".equals(rank)) {
+                        followup.setStarLevel(new BigDecimal(3));
+                    }else if ("4".equals(rank)) {
+                        followup.setStarLevel(new BigDecimal(4));
+                    }else if ("5".equals(rank)) {
+                        followup.setStarLevel(new BigDecimal(5));
+                    }else if ("6".equals(rank)) {
+                        followup.setStarLevel(new BigDecimal(0));
+                    }else if ("7".equals(rank)) {
+                        followup.setStarLevel(new BigDecimal(2));
+                    }
+                   // followup.setStarLevel(new BigDecimal(rank));
+                } else {
+                    try {
+                        Map<String, String> starMap = JSON.parseObject(jsonObject.toString(), Map.class);
+                        String level = starMap.get(rank);
+                        if (StringUtils.isEmpty(level)) {
+                            if ("0".equals(rank)) {
+                                followup.setStarLevel(new BigDecimal(0));
+                            } else if ("1".equals(rank)) {
+                                followup.setStarLevel(new BigDecimal(1));
+                            }else if ("2".equals(rank)) {
+                                followup.setStarLevel(new BigDecimal(2));
+                            }else if ("3".equals(rank)) {
+                                followup.setStarLevel(new BigDecimal(3));
+                            }else if ("4".equals(rank)) {
+                                followup.setStarLevel(new BigDecimal(4));
+                            }else if ("5".equals(rank)) {
+                                followup.setStarLevel(new BigDecimal(5));
+                            }else if ("6".equals(rank)) {
+                                followup.setStarLevel(new BigDecimal(0));
+                            }else if ("7".equals(rank)) {
+                                followup.setStarLevel(new BigDecimal(2));
+                            }
+                        }else {
+                            followup.setStarLevel(new BigDecimal(level));
+                        }
+                    }catch (Exception e){
+                        if ("0".equals(rank)) {
+                            followup.setStarLevel(new BigDecimal(0));
+                        } else if ("1".equals(rank)) {
+                            followup.setStarLevel(new BigDecimal(1));
+                        }else if ("2".equals(rank)) {
+                            followup.setStarLevel(new BigDecimal(2));
+                        }else if ("3".equals(rank)) {
+                            followup.setStarLevel(new BigDecimal(3));
+                        }else if ("4".equals(rank)) {
+                            followup.setStarLevel(new BigDecimal(4));
+                        }else if ("5".equals(rank)) {
+                            followup.setStarLevel(new BigDecimal(5));
+                        }else if ("6".equals(rank)) {
+                            followup.setStarLevel(new BigDecimal(0));
+                        }else if ("7".equals(rank)) {
+                            followup.setStarLevel(new BigDecimal(2));
+                        }
+                    }
+                }
+            }
+            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,Map<String, String> resultMap){
         String responseStr = HttpClientThreeUtil.get(url,null);