Commit 0d28e5a2 by 张富康

feat(order): 添加订单控制器REST接口并实现客户建档功能

- 集成企微群信息查询并处理中文参数编码
- 添加群成员信息查询接口
- 实现URL参数UTF-8编码转换防止乱码
1 parent 7c030c43
...@@ -206,14 +206,22 @@ public class GoodsOrderController { ...@@ -206,14 +206,22 @@ public class GoodsOrderController {
String botId = OrePropertyConfigurer.getProperty("dj.customer.botId", String.class,"ee79dee25ce24003b5d14d8235240bc2"); String botId = OrePropertyConfigurer.getProperty("dj.customer.botId", String.class,"ee79dee25ce24003b5d14d8235240bc2");
String baseUrl = OrePropertyConfigurer.getProperty("dj.customer.groupUrl", String.class,"http://yjy.dev.glsx.com.cn/imhub/api/core/contacts"); String baseUrl = OrePropertyConfigurer.getProperty("dj.customer.groupUrl", String.class,"http://yjy.dev.glsx.com.cn/imhub/api/core/contacts");
String channel = OrePropertyConfigurer.getProperty("dj.customer.channel", String.class,"yjy_ww"); String channel = OrePropertyConfigurer.getProperty("dj.customer.channel", String.class,"yjy_ww");
String name;
try {
name = URLEncoder.encode(request.getCustomerGroupParam(), "UTF-8");
} catch (UnsupportedEncodingException e) {
log.error("name编码失败");
return RopResponse.success(null);
}
String url = baseUrl + String url = baseUrl +
"?channel=" + channel + "?channel=" + channel +
"&bot_id=" + botId + "&bot_id=" + botId +
"&contact_type=ww_group_external" + "&contact_type=ww_group_external" +
"&contact_name=" + request.getCustomerGroupParam() + "&contact_name=" + name +
"&limit=10000" + "&limit=10000" +
"&offset=0"; "&offset=0";
String result = HttpUtil.get(url); String result = HttpUtil.get(url);
log.info("群信息查询结果:{}", result);
ContactListDTO resultDTO = JSONUtil.toBean(result, ContactListDTO.class); ContactListDTO resultDTO = JSONUtil.toBean(result, ContactListDTO.class);
if (ObjectUtil.isNotEmpty(resultDTO)) { if (ObjectUtil.isNotEmpty(resultDTO)) {
List<ContactDTO> contacts = resultDTO.getContacts(); List<ContactDTO> contacts = resultDTO.getContacts();
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!