From e53334611e8d51fb67e769cba898743f11dcf627 Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期五, 16 六月 2023 17:45:23 +0800
Subject: [PATCH] 患者管理相关接口,提交
---
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/DingTalkService.java | 34 +++++++++++++++++++++++++++++-----
1 files changed, 29 insertions(+), 5 deletions(-)
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/DingTalkService.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/DingTalkService.java
index 342afa6..d4a9326 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/DingTalkService.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/DingTalkService.java
@@ -10,7 +10,14 @@
import com.dingtalk.api.response.*;
import com.taobao.api.ApiException;
import org.apache.commons.lang3.StringUtils;
+import org.apache.poi.ss.usermodel.Cell;
+import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.Workbook;
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
+import java.io.FileOutputStream;
+import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
@@ -23,8 +30,7 @@
* @throws ApiException
*/
private static String getAccessToken() throws ApiException {
- DefaultDingTalkClient client =
- new DefaultDingTalkClient("https://oapi.dingtalk.com/gettoken");
+ DefaultDingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/gettoken");
OapiGettokenRequest request = new OapiGettokenRequest();
//Appkey
request.setAppkey("dingn8iip5ubj7clrrsv");
@@ -56,7 +62,7 @@
JSONArray jsonArray = new JSONArray(jsonObject.getJSONObject("result").getJSONArray("userid_list"));
// 灏咼SONArray杞负List鍒楄〃
String str = JSONObject.toJSONString(jsonArray);
- List<String> list = JSONObject.parseObject(str,List.class);
+ List<String> list = JSONObject.parseObject(str, List.class);
//鐢佃瘽鍙风爜鏁扮粍
// String[] split = mobile.split(",");
@@ -111,13 +117,31 @@
}
}
- public static void main(String[] args) throws ApiException {
+ public static void main(String[] args) throws ApiException, IOException {
// String appId = "wx1c5243d2337753f4";
// String appSecret = "84a2186a0d175e88345267c716516cd3";
// WeChatService weChatService = new WeChatService(appId, appSecret);
// weChatService.sendMessageToFollowers("浣犲湪璇村暐鍛紵锛燂紵锛�");
// // new com.smartor.controller.BaseSmsaccountController().sendMessageToFollowers("AIJSl-IF6M05NzaXofPYbT5wgSP3bWH7I9OBmvJqsaU","www.baidu.com");
- sendNotification("17607179857", "1", "2", "3");
+// sendNotification("17607179857", "1", "2", "3");
+ Workbook workbook = new XSSFWorkbook();
+ Sheet sheet = workbook.createSheet("Sheet1");
+ // 鍒涘缓琛屽拰鍗曞厓鏍硷紝骞惰缃崟鍏冩牸鐨勫��
+ Row row = sheet.createRow(0);
+ row.createCell(0).setCellValue("濮撳悕");
+ row.createCell(1).setCellValue("鎬у埆");
+ row.createCell(2).setCellValue("璇佷欢绫诲瀷");
+ row.createCell(3).setCellValue("鍑虹敓鏃ユ湡");
+ row.createCell(4).setCellValue("鏈汉鑱旂郴鏂瑰紡");
+ row.createCell(5).setCellValue("浜插睘鑱旂郴鏂瑰紡");
+ row.createCell(6).setCellValue("鎮h�呮爣绛�");
+ row.createCell(7).setCellValue("閿欒鍘熷洜");
+
+ // 淇濆瓨宸ヤ綔绨垮埌鏂囦欢
+ FileOutputStream outputStream = new FileOutputStream("example.xlsx");
+ workbook.write(outputStream);
+ outputStream.close();
+ workbook.close();
}
}
--
Gitblit v1.9.3