diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/NoticeController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/NoticeController.java index aab4a2db..52c9ab7e 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/NoticeController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/NoticeController.java @@ -102,25 +102,29 @@ public class NoticeController { CacheUtils.put(request.getPhone(), code); // 调用oppo的统计接口 try { - // 回调 - OppoCheck model = new OppoCheck(); - model.setDataType(2); - model.setTimestamp(System.currentTimeMillis()); - if(StringUtils.isNotEmpty(request.getImei())){ - model.setImei(encode(request.getImei().getBytes())); + if("oppo".equalsIgnoreCase(request.getFrom())){ + // 回调 + OppoCheck model = new OppoCheck(); + model.setDataType(2); + model.setTimestamp(System.currentTimeMillis()); + if(StringUtils.isNotEmpty(request.getImei())){ + model.setImei(encode(request.getImei().getBytes())); + } + if(StringUtils.isNotEmpty(request.getOaid())){ + model.setOuId(encode(request.getOaid().getBytes())); + } + String content = JSONObject.toJSONString(model) + model.getTimestamp() + "e0u6fnlag06lc3pl"; + log.info("请求的content加密前属性{}", content); + Map headerMap = new HashMap<>(); + headerMap.put("signature", Md5Utils.hash(content)); + headerMap.put("timestamp", String.valueOf(model.getTimestamp())); + headerMap.put("Content-Type", "application/json"); + log.info("请求https://api.ads.heytapmobi.com/api/uploadActiveData的属性{}", JSONObject.toJSONString(model)); + String s = HttpUtils.sendPost("https://api.ads.heytapmobi.com/api/uploadActiveData", JSONObject.toJSONString(model), headerMap); + log.info("请求https://api.ads.heytapmobi.com/api/uploadActiveData的响应{}", s); + }else { + log.info("短信请求接口入参:{}", request); } - if(StringUtils.isNotEmpty(request.getOaid())){ - model.setOuId(encode(request.getOaid().getBytes())); - } - String content = JSONObject.toJSONString(model) + model.getTimestamp() + "e0u6fnlag06lc3pl"; - log.info("请求的content加密前属性{}", content); - Map headerMap = new HashMap<>(); - headerMap.put("signature", Md5Utils.hash(content)); - headerMap.put("timestamp", String.valueOf(model.getTimestamp())); - headerMap.put("Content-Type", "application/json"); - log.info("请求https://api.ads.heytapmobi.com/api/uploadActiveData的属性{}", JSONObject.toJSONString(model)); - String s = HttpUtils.sendPost("https://api.ads.heytapmobi.com/api/uploadActiveData", JSONObject.toJSONString(model), headerMap); - log.info("请求https://api.ads.heytapmobi.com/api/uploadActiveData的响应{}", s); }catch (Exception e){ e.printStackTrace(); log.error("回调oppo报错:{}", e.getMessage()); @@ -134,6 +138,7 @@ public class NoticeController { ClewPhone model = new ClewPhone(); model.setPhone(request.getPhone()); model.setCreateTime(new Date()); + model.setRemark(request.getFrom()); clewPhoneService.insertClewPhone(model); } }catch (Exception e){ diff --git a/ruoyi-system/src/main/resources/mapper/system/ClewPhoneMapper.xml b/ruoyi-system/src/main/resources/mapper/system/ClewPhoneMapper.xml index 7b07f291..a44c21fa 100644 --- a/ruoyi-system/src/main/resources/mapper/system/ClewPhoneMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/ClewPhoneMapper.xml @@ -40,7 +40,7 @@ create_by, update_by, update_time, - remark, + remark #{phone}, @@ -48,7 +48,7 @@ #{createBy}, #{updateBy}, #{updateTime}, - #{remark}, + #{remark} @@ -61,7 +61,7 @@ create_by = #{createBy}, update_by = #{updateBy}, update_time = #{updateTime}, - remark = #{remark}, + remark = #{remark} where id = #{id}