|
@@ -28,27 +28,18 @@ import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
|
|
|
*/
|
|
|
public class WXCpOaUtil {
|
|
|
|
|
|
- public static List<WxCpCheckinData> getCheckinData(Date startTime, Date endTime, List<String> userIdList) {
|
|
|
- // 打卡类型。1:上下班打卡;2:外出打卡;3:全部打卡
|
|
|
- try {
|
|
|
- return oaService.getCheckinData(3, startTime, endTime, userIdList);
|
|
|
- } catch (WxErrorException e) {
|
|
|
- e.printStackTrace();
|
|
|
- return Lists.newArrayList();
|
|
|
- }
|
|
|
+ public static List<WxCpCheckinData> getCheckinData(Date startTime, Date endTime, List<String> userIdList)
|
|
|
+ throws WxErrorException {
|
|
|
+ return oaService.getCheckinData(3, startTime, endTime, userIdList);
|
|
|
}
|
|
|
|
|
|
- public static List<WxCpCheckinOption> getCheckinOption(List<Date> datetimes, List<String> userIdList) {
|
|
|
- try {
|
|
|
- List<WxCpCheckinOption> result = Lists.newArrayList();
|
|
|
- for (Date datetime : datetimes) {
|
|
|
- oaService.getCheckinOption(datetime, userIdList).stream().forEach(option -> result.add(option));
|
|
|
- }
|
|
|
- return result;
|
|
|
- } catch (WxErrorException e) {
|
|
|
- e.printStackTrace();
|
|
|
- return Lists.newArrayList();
|
|
|
+ public static List<WxCpCheckinOption> getCheckinOption(List<Date> datetimes, List<String> userIdList)
|
|
|
+ throws WxErrorException {
|
|
|
+ List<WxCpCheckinOption> result = Lists.newArrayList();
|
|
|
+ for (Date datetime : datetimes) {
|
|
|
+ oaService.getCheckinOption(datetime, userIdList).stream().forEach(option -> result.add(option));
|
|
|
}
|
|
|
+ return result;
|
|
|
}
|
|
|
|
|
|
public static List<WxCpApprovalInfo> getAllApprovalInfo(Date startTime, Date endTime) throws WxErrorException {
|
|
@@ -102,5 +93,8 @@ public class WXCpOaUtil {
|
|
|
public static void main(String[] args) throws Exception {
|
|
|
System.out.println(getApprovalDetailList(DateUtil.sdfTime.parse("2020-04-01 00:00:00"),
|
|
|
DateUtil.sdfTime.parse("2020-04-01 23:59:59")));
|
|
|
+
|
|
|
+ System.out.println(getCheckinData(DateUtil.sdfTime.parse("2020-10-16 00:00:00"),
|
|
|
+ DateUtil.sdfTime.parse("2020-10-16 23:59:59"), Lists.newArrayList("1007")));
|
|
|
}
|
|
|
}
|