1
0
mirror of synced 2025-12-24 02:57:55 +08:00

🆕 #2689【企业微信】增加获取用户填写答案的接口

This commit is contained in:
0katekate0
2022-06-10 14:38:25 +08:00
committed by GitHub
parent 508d053ed3
commit bb8c82d25c
5 changed files with 144 additions and 0 deletions

View File

@@ -4,6 +4,7 @@ import lombok.extern.slf4j.Slf4j;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.cp.api.impl.WxCpServiceImpl;
import me.chanjar.weixin.cp.bean.school.health.WxCpGetHealthReportStat;
import me.chanjar.weixin.cp.bean.school.health.WxCpGetReportAnswer;
import me.chanjar.weixin.cp.bean.school.health.WxCpGetReportJobIds;
import me.chanjar.weixin.cp.bean.school.health.WxCpGetReportJobInfo;
import me.chanjar.weixin.cp.config.WxCpConfigStorage;
@@ -39,6 +40,18 @@ public class WxCpSchoolHealthTest {
String currDate = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
// Test
String reportAnswerStr = "{\"errcode\":0,\"errmsg\":\"ok\",\"answers\":[{\"id_type\":1,\"userid\":\"userid2\",\"report_time\":123456789,\"report_values\":[{\"question_id\":1,\"single_choice\":2},{\"question_id\":2,\"text\":\"广东省广州市\"},{\"question_id\":3,\"multi_choice\":[1,3]},{\"question_id\":4,\"fileid\":[\"XXXXXXX\"]}]},{\"id_type\":2,\"student_userid\":\"student_userid1\",\"parent_userid\":\"parent_userid1\",\"report_time\":123456789,\"report_values\":[{\"question_id\":1,\"single_choice\":1},{\"question_id\":2,\"text\":\"广东省深圳市\"},{\"question_id\":3,\"multi_choice\":[1,2,3]},{\"question_id\":4,\"fileid\":[\"XXXXXXX\"]}]}]}";
WxCpGetReportAnswer getReportAnswer = WxCpGetReportAnswer.fromJson(reportAnswerStr);
log.info("获取对应的getReportAnswer{}", getReportAnswer.toJson());
/**
* 获取用户填写答案
* https://developer.work.weixin.qq.com/document/path/93679
*/
WxCpGetReportAnswer reportAnswer = cpService.getSchoolHealthService().getReportAnswer("xxxx", currDate, null, null);
log.info("返回的reportAnswer为{}", reportAnswer.toJson());
/**
* 获取健康上报任务ID列表
* https://developer.work.weixin.qq.com/document/path/93677