🎨 #3751 【企业微信】提交审批申请接口增加process参数以支持新版的审批流程信息
This commit is contained in:
@@ -95,4 +95,99 @@ public class WxCpOaApplyEventRequestTest {
|
||||
|
||||
assertThat(request.toJson()).isEqualTo(GsonParser.parse(json).toString());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test to json with process.
|
||||
*/
|
||||
@Test
|
||||
public void testToJsonWithProcess() {
|
||||
String json = "{\n" +
|
||||
" \"creator_userid\": \"WangXiaoMing\",\n" +
|
||||
" \"template_id\": \"3Tka1eD6v6JfzhDMqPd3aMkFdxqtJMc2ZRioeFXkaaa\",\n" +
|
||||
" \"use_template_approver\":0,\n" +
|
||||
" \"process\": {\n" +
|
||||
" \"node_list\": [\n" +
|
||||
" {\n" +
|
||||
" \"type\": 1,\n" +
|
||||
" \"apv_rel\": 2,\n" +
|
||||
" \"userid\": [\"WuJunJie\",\"WangXiaoMing\"]\n" +
|
||||
" },\n" +
|
||||
" {\n" +
|
||||
" \"type\": 1,\n" +
|
||||
" \"apv_rel\": 1,\n" +
|
||||
" \"userid\": [\"LiuXiaoGang\"]\n" +
|
||||
" },\n" +
|
||||
" {\n" +
|
||||
" \"type\": 2,\n" +
|
||||
" \"userid\": [\"ZhangSan\",\"LiSi\"]\n" +
|
||||
" }\n" +
|
||||
" ]\n" +
|
||||
" },\n" +
|
||||
" \"apply_data\": {\n" +
|
||||
" \"contents\": [\n" +
|
||||
" {\n" +
|
||||
" \"control\": \"Text\",\n" +
|
||||
" \"id\": \"Text-15111111111\",\n" +
|
||||
" \"value\": {\n" +
|
||||
" \"text\": \"文本填写的内容\"\n" +
|
||||
" }\n" +
|
||||
" }\n" +
|
||||
" ]\n" +
|
||||
" },\n" +
|
||||
" \"summary_list\": [\n" +
|
||||
" {\n" +
|
||||
" \"summary_info\": [{\n" +
|
||||
" \"text\": \"摘要第1行\",\n" +
|
||||
" \"lang\": \"zh_CN\"\n" +
|
||||
" }]\n" +
|
||||
" },\n" +
|
||||
" {\n" +
|
||||
" \"summary_info\": [{\n" +
|
||||
" \"text\": \"摘要第2行\",\n" +
|
||||
" \"lang\": \"zh_CN\"\n" +
|
||||
" }]\n" +
|
||||
" },\n" +
|
||||
" {\n" +
|
||||
" \"summary_info\": [{\n" +
|
||||
" \"text\": \"摘要第3行\",\n" +
|
||||
" \"lang\": \"zh_CN\"\n" +
|
||||
" }]\n" +
|
||||
" }\n" +
|
||||
" ]\n" +
|
||||
"}";
|
||||
|
||||
WxCpOaApplyEventRequest request = new WxCpOaApplyEventRequest();
|
||||
request.setCreatorUserId("WangXiaoMing")
|
||||
.setTemplateId("3Tka1eD6v6JfzhDMqPd3aMkFdxqtJMc2ZRioeFXkaaa")
|
||||
.setUseTemplateApprover(0)
|
||||
.setProcess(new WxCpOaApplyEventRequest.Process()
|
||||
.setNodeList(Arrays.asList(
|
||||
new WxCpOaApplyEventRequest.ProcessNode()
|
||||
.setType(1)
|
||||
.setApvRel(2)
|
||||
.setUserIds(new String[]{"WuJunJie", "WangXiaoMing"}),
|
||||
new WxCpOaApplyEventRequest.ProcessNode()
|
||||
.setType(1)
|
||||
.setApvRel(1)
|
||||
.setUserIds(new String[]{"LiuXiaoGang"}),
|
||||
new WxCpOaApplyEventRequest.ProcessNode()
|
||||
.setType(2)
|
||||
.setUserIds(new String[]{"ZhangSan", "LiSi"})
|
||||
)))
|
||||
.setApplyData(new WxCpOaApplyEventRequest.ApplyData()
|
||||
.setContents(Collections.singletonList(new ApplyDataContent()
|
||||
.setControl("Text").setId("Text-15111111111").setValue(new ContentValue().setText("文本填写的内容")))))
|
||||
.setSummaryList(Arrays.asList(new SummaryInfo()
|
||||
.setSummaryInfoData(Collections.singletonList(new SummaryInfo.SummaryInfoData().setLang("zh_CN").setText(
|
||||
"摘要第1行"))),
|
||||
new SummaryInfo()
|
||||
.setSummaryInfoData(Collections.singletonList(new SummaryInfo.SummaryInfoData().setLang("zh_CN").setText(
|
||||
"摘要第2行"))),
|
||||
new SummaryInfo()
|
||||
.setSummaryInfoData(Collections.singletonList(new SummaryInfo.SummaryInfoData().setLang("zh_CN").setText(
|
||||
"摘要第3行")))))
|
||||
;
|
||||
|
||||
assertThat(request.toJson()).isEqualTo(GsonParser.parse(json).toString());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user