1
0
mirror of synced 2025-12-23 18:48:00 +08:00

🆕 #2201【企业微信】 增加获取打卡记录日报、获取打卡记录月报、获取打卡人员排班信息接口

This commit is contained in:
longliveh
2021-07-13 09:59:31 +08:00
committed by GitHub
parent 69b9ec0068
commit 2d2cf39f1c
7 changed files with 927 additions and 9 deletions

View File

@@ -1,11 +1,15 @@
package me.chanjar.weixin.cp.api.impl;
import com.google.gson.Gson;
import com.google.gson.JsonObject;
import com.google.gson.reflect.TypeToken;
import com.google.inject.Inject;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.common.util.json.GsonParser;
import me.chanjar.weixin.cp.api.ApiTestModule;
import me.chanjar.weixin.cp.api.WxCpService;
import me.chanjar.weixin.cp.bean.oa.*;
import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.testng.annotations.Guice;
import org.testng.annotations.Test;
@@ -47,6 +51,48 @@ public class WxCpOaServiceImplTest {
}
@Test
public void testGetCheckinDayData() throws ParseException, WxErrorException {
Date startTime = DateFormatUtils.ISO_8601_EXTENDED_DATE_FORMAT.parse("2021-07-01");
Date endTime = DateFormatUtils.ISO_8601_EXTENDED_DATE_FORMAT.parse("2021-07-31");
List<WxCpCheckinDayData> results = wxService.getOaService()
.getCheckinDayData(startTime, endTime, Lists.newArrayList("12003648"));
assertThat(results).isNotNull();
System.out.println("results ");
System.out.println(gson.toJson(results));
}
@Test
public void testGetCheckinMonthData() throws ParseException, WxErrorException {
Date startTime = DateFormatUtils.ISO_8601_EXTENDED_DATE_FORMAT.parse("2021-07-01");
Date endTime = DateFormatUtils.ISO_8601_EXTENDED_DATE_FORMAT.parse("2021-07-31");
List<WxCpCheckinMonthData> results = wxService.getOaService()
.getCheckinMonthData(startTime, endTime, Lists.newArrayList("12003648"));
assertThat(results).isNotNull();
System.out.println("results ");
System.out.println(gson.toJson(results));
}
@Test
public void testGetCheckinScheduleData() throws ParseException, WxErrorException {
Date startTime = DateFormatUtils.ISO_8601_EXTENDED_DATE_FORMAT.parse("2021-07-01");
Date endTime = DateFormatUtils.ISO_8601_EXTENDED_DATE_FORMAT.parse("2021-07-31");
WxCpCheckinSchedule results = wxService.getOaService()
.getCheckinScheduleList(startTime, endTime, Lists.newArrayList("12003648"));
assertThat(results).isNotNull();
System.out.println("results ");
System.out.println(gson.toJson(results));
}
@Test
public void testGetCheckinOption() throws WxErrorException {