Jelajahi Sumber

上海梓柘信息服务有限公司

wanxc 1 bulan lalu
induk
melakukan
f15fb57f08

+ 61 - 0
src/main/java/com/tiangua/star/controller/SHXTMd5CallBackController.java

@@ -0,0 +1,61 @@
+package com.tiangua.star.controller;
+
+import com.alibaba.fastjson.JSONObject;
+import com.tiangua.star.service.CallBackService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+
+/**
+ * @author
+ * @description 本应用 +诚易融 需求开发上线一共两天
+ *              流程:诚易融定时任务扫,将api存在starl的http推送过来
+ *                  本应用使用http请求接受,获取数据,并对应星级,然后返回诚意融,不用mq 没有为什么
+  * @project loan-supermarket-parent
+ * @date 2025/3/21 10:45:49
+ */
+@RestController
+@RequestMapping(value = "/shxtmd5/callback")
+@Slf4j
+public class SHXTMd5CallBackController {
+
+    @Autowired
+    private CallBackService callBackService;
+
+    @PostMapping("/request")
+    public JSONObject request(@RequestBody JSONObject json) {
+        log.info("上海梓柘信息服务有限公司 get begin json{}",json);
+
+        if (json == null) {
+            log.info("上海梓柘信息服务有限公司解析回传数据为null");
+            JSONObject object = new JSONObject();
+            object.put("code", 1);
+            object.put("msg", "回传数据为空");
+            return object;
+        }
+        JSONObject jsonObject = callBackService.shxtrequest(json);
+        log.info("上海梓柘信息服务有限公司 get end");
+        return jsonObject;
+    }
+
+
+
+//    @PostMapping("/sendGetRequestHeiLongJiang")
+//    public void processInstitutionData() {
+//        String s1 = "99C0B3015254F583F3BF7C8430F328A5";
+//        String s2 = "8C32A04C7FED4B5EF9451CDB5D9DE770";
+//
+//        List<String> strings = new ArrayList<>();
+//        strings.add(s1);
+//        strings.add(s2);
+////
+////        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);
+//    }
+}

+ 2 - 0
src/main/java/com/tiangua/star/service/CallBackService.java

@@ -13,4 +13,6 @@ public interface CallBackService {
     void thirdProcessInstitutionData(List<ThirdStarDto> thirdStarDtos,Map<String, String> resultMap);
 
     JSONObject kydrequest(JSONObject json);
+
+    JSONObject shxtrequest(JSONObject json);
 }

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

@@ -518,6 +518,38 @@ public class CasllBackDataProcessor implements CallBackService {
         return jsonObject;
 
 }
+    @Override
+    public JSONObject shxtrequest(JSONObject json) {
+        List<CustomerFollowup> followupList = new ArrayList<>();
+        CustomerFollowup followup = new CustomerFollowup();
+        followup.setPhoneMd5(json.getString("phoneMd5"));
+        String businessId = "be0b75c85a71250523023253business";
+        followup.setBusiId(businessId);
+        followup.setProductBizId(4580);
+        followup.setFollowTime(new Date());
+        followup.setSourceType(3);
+        String star = json.getString("star");
+        if ("1".equals(star)) {
+            followup.setStarLevel(new BigDecimal(0));
+        } else if ("2".equals(star)) {
+            followup.setStarLevel(new BigDecimal(1));
+        }else if ("3".equals(star)) {
+            followup.setStarLevel(new BigDecimal(2));
+        }else if ("4".equals(star)) {
+            followup.setStarLevel(new BigDecimal(3));
+        }else if ("5".equals(star)) {
+            followup.setStarLevel(new BigDecimal(4));
+        }else if ("6".equals(star)) {
+            followup.setStarLevel(new BigDecimal(5));
+        }
+        followupList.add(followup);
+        handleMappedData(businessId,followupList);
+        JSONObject jsonObject = new JSONObject();
+        jsonObject.put("code",0);
+        jsonObject.put("msg","成功");
+        return jsonObject;
+
+    }
 
 
     private void sendGetRequestSXRKX(String productBizId,String busiId,String url,Map<String, String> resultMap){