|
|
@@ -7,6 +7,7 @@ import com.usoftchina.qywx.sdk.MessageSdk;
|
|
|
import com.usoftchina.qywx.sdk.util.UrlUtils;
|
|
|
import org.junit.Test;
|
|
|
|
|
|
+import java.net.URLEncoder;
|
|
|
import java.util.*;
|
|
|
|
|
|
/**
|
|
|
@@ -49,4 +50,14 @@ public class MessageSdkTest extends BaseTest {
|
|
|
System.out.println(chatId);
|
|
|
sdk.sendChat("Uas", new SendChatReq(chatId).text("Hello World"));
|
|
|
}
|
|
|
+
|
|
|
+ @Test
|
|
|
+ public void sendProcessMessage() throws Exception {
|
|
|
+ String paramsStr = "{\"master\":\"N_USOFTSYS\",\"nodeId\":53840586,\"baseUrl\":\"" + URLEncoder.encode("http://erp.yitoa.com:8888/ERP/", "utf-8") + "\"}";
|
|
|
+ String msgUrl = UrlUtils.generateOAuthUrl("wwd42c39382ee6298e", "N_USOFTSYS", "Uas", "http://erp.yitoa.com:8888/ERP/",
|
|
|
+ "http://erp.yitoa.com:8888/office/api/authorize", "uas/approval/" + URLEncoder.encode(paramsStr, "utf-8"));
|
|
|
+ sdk.send("Uas", new SendMessageReq()
|
|
|
+ .textCard("应鹏的工作日报流程", "单据编号:2020020258", msgUrl, "查看详情")
|
|
|
+ .toUser("U0308"));
|
|
|
+ }
|
|
|
}
|