xueyiming hace 6 meses
padre
commit
05e3a42fe5

+ 3 - 3
we-com-server/src/main/java/com/tzld/piaoquan/wecom/controller/TestController.java

@@ -103,15 +103,15 @@ public class TestController {
             return;
         }
         List<String> collect = userList.stream().map(User::getExternalUserId3rdParty).collect(Collectors.toList());
+        String s = collect.get(0);
         String weComAccessToken = accessTokenService.getWeComAccessToken();
         log.info("weComAccessToken={}", weComAccessToken);
         if (weComAccessToken == null) {
             return;
         }
-        String url = String.format("https://qyapi.weixin.qq.com/cgi-bin/batch/openuserid_to_userid?access_token=%s", weComAccessToken);
+        String url = String.format("https://qyapi.weixin.qq.com/cgi-bin/externalcontact/from_service_external_userid?access_token=%s", weComAccessToken);
         JSONObject jsonObject = new JSONObject();
-        JSONArray jsonArray = JSONArray.parseArray(JSON.toJSONString(collect));
-        jsonObject.put("open_userid_list", jsonArray);
+        jsonObject.put("external_userid", s);
         jsonObject.put("source_agentid", 1000009);
         String post = httpPoolClientDefault.post(url, jsonObject.toJSONString());
         log.info("getUserId={}", post);