附上官方文档链接供参考:https://developers.dingtalk.com/document/app/asynchronous-sending-of-enterprise-session-messages
接下来上代码,实测可用:(通知多人时,是将list数据转成了String字符串)
// 发送钉钉消息通知
dDComponent.sendMessage(receivers, "“事项已上传成功");
//发送钉消息通知管理员
String sql="select account_id from tbl_user_role_info a ,tbl_user_info b where a.user_id=b.user_id and a.role_id='admin'";
List<DDBean> list=jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(DDBean.class));
log.info("接收者list:"+list.size());
if (!CollectionUtils.isEmpty(list)){
StringBuilder sb = new StringBuilder();
String account_id = "";
for(int i=0;i<list.size();i++){
if(i<list.size()-1){