|
@@ -107,7 +107,7 @@ public class DateReportsPushServiceImpl implements IDateReportsPushService {
|
|
|
JSONObject obj = new JSONObject();
|
|
JSONObject obj = new JSONObject();
|
|
|
obj.put("rank", String.valueOf(movie.get("rk")));
|
|
obj.put("rank", String.valueOf(movie.get("rk")));
|
|
|
obj.put("movieName", String.valueOf(movie.get("movie_name")));
|
|
obj.put("movieName", String.valueOf(movie.get("movie_name")));
|
|
|
- obj.put("endAmount", String.valueOf(movie.get("end_amount")));
|
|
|
|
|
|
|
+ obj.put("endAmount", String.valueOf(movie.get("share_end_amount")));
|
|
|
obj.put("realROI", String.valueOf(movie.get("real_roi")));
|
|
obj.put("realROI", String.valueOf(movie.get("real_roi")));
|
|
|
movieRankTable.add(obj);
|
|
movieRankTable.add(obj);
|
|
|
}
|
|
}
|
|
@@ -144,6 +144,13 @@ public class DateReportsPushServiceImpl implements IDateReportsPushService {
|
|
|
for (String userId : userIds) {
|
|
for (String userId : userIds) {
|
|
|
sendToFeishu(token, template_variable, userId);
|
|
sendToFeishu(token, template_variable, userId);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+// List<String> chatid = Arrays.asList(
|
|
|
|
|
+//// "oc_275f17aa4bf8fae649ef281a2b9250f6"
|
|
|
|
|
+// );
|
|
|
|
|
+// for (String chat : chatid) {
|
|
|
|
|
+// sendToChatGroup(token, template_variable, chat);
|
|
|
|
|
+// }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private void sendToFeishu(String token, JSONObject template_variable, String receive_id) {
|
|
private void sendToFeishu(String token, JSONObject template_variable, String receive_id) {
|
|
@@ -172,4 +179,31 @@ public class DateReportsPushServiceImpl implements IDateReportsPushService {
|
|
|
log.error("发送飞书消息失败", e);
|
|
log.error("发送飞书消息失败", e);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ private void sendToChatGroup(String token, JSONObject template_variable, String chatid) {
|
|
|
|
|
+ JSONObject content = new JSONObject();
|
|
|
|
|
+ JSONObject contentData = new JSONObject();
|
|
|
|
|
+ contentData.put("template_id",TEMPLATE_ID);
|
|
|
|
|
+ contentData.put("template_version_name", TEMPLATE_VERSION);
|
|
|
|
|
+ contentData.put("template_variable", template_variable);
|
|
|
|
|
+ content.put("type", "template");
|
|
|
|
|
+ content.put("data", contentData);
|
|
|
|
|
+
|
|
|
|
|
+ JSONObject request = new JSONObject();
|
|
|
|
|
+ request.put("receive_id", chatid);
|
|
|
|
|
+ request.put("msg_type", "interactive");
|
|
|
|
|
+ request.put("content", content.toJSONString());
|
|
|
|
|
+ //发送
|
|
|
|
|
+ try (CloseableHttpClient client = HttpClients.createDefault()){
|
|
|
|
|
+ HttpPost httpPost = new HttpPost("https://open.feishu.cn/open-apis/im/v1/messages?receive_id_type=chat_id");
|
|
|
|
|
+ httpPost.setHeader("Authorization", "Bearer "+token);
|
|
|
|
|
+ HttpEntity entity = new StringEntity(request.toJSONString(), "UTF-8");
|
|
|
|
|
+ httpPost.setEntity(entity);
|
|
|
|
|
+ httpPost.setHeader("Content-Type", "application/json; charset=utf-8");
|
|
|
|
|
+ CloseableHttpResponse respon = client.execute(httpPost);
|
|
|
|
|
+ System.out.println("发送结果: "+ EntityUtils.toString(respon.getEntity(), "UTF-8"));
|
|
|
|
|
+ }catch (IOException e){
|
|
|
|
|
+ log.error("发送飞书消息失败", e);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|