|
@@ -40,12 +40,8 @@ public class WxCpOaServiceImpl implements WxCpOaService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public List<WxCpCheckinData> getCheckinData(Integer openCheckinDataType, Date startTime, Date endTime,
|
|
|
+ public List<WxCpCheckinData> getCheckinData(Integer openCheckinDataType, @NonNull Date startTime, @NonNull Date endTime,
|
|
|
List<String> userIdList) throws WxErrorException {
|
|
|
- if (startTime == null || endTime == null) {
|
|
|
- throw new WxRuntimeException("starttime and endtime can't be null");
|
|
|
- }
|
|
|
-
|
|
|
if (userIdList == null || userIdList.size() > USER_IDS_LIMIT) {
|
|
|
throw new WxRuntimeException("用户列表不能为空,不超过 " + USER_IDS_LIMIT + " 个,若用户超过 " + USER_IDS_LIMIT + " 个,请分批获取");
|
|
|
}
|
|
@@ -73,20 +69,14 @@ public class WxCpOaServiceImpl implements WxCpOaService {
|
|
|
final String url = this.mainService.getWxCpConfigStorage().getApiUrl(GET_CHECKIN_DATA);
|
|
|
String responseContent = this.mainService.post(url, jsonObject.toString());
|
|
|
JsonObject tmpJson = GsonParser.parse(responseContent);
|
|
|
- return WxCpGsonBuilder.create()
|
|
|
- .fromJson(
|
|
|
- tmpJson.get("checkindata"),
|
|
|
- new TypeToken<List<WxCpCheckinData>>() {
|
|
|
- }.getType()
|
|
|
- );
|
|
|
+ return WxCpGsonBuilder.create().fromJson(tmpJson.get("checkindata"),
|
|
|
+ new TypeToken<List<WxCpCheckinData>>() {
|
|
|
+ }.getType()
|
|
|
+ );
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public List<WxCpCheckinOption> getCheckinOption(Date datetime, List<String> userIdList) throws WxErrorException {
|
|
|
- if (datetime == null) {
|
|
|
- throw new WxRuntimeException("datetime can't be null");
|
|
|
- }
|
|
|
-
|
|
|
+ public List<WxCpCheckinOption> getCheckinOption(@NonNull Date datetime, List<String> userIdList) throws WxErrorException {
|
|
|
if (userIdList == null || userIdList.size() > USER_IDS_LIMIT) {
|
|
|
throw new WxRuntimeException("用户列表不能为空,不超过 " + USER_IDS_LIMIT + " 个,若用户超过 " + USER_IDS_LIMIT + " 个,请分批获取");
|
|
|
}
|
|
@@ -104,34 +94,29 @@ public class WxCpOaServiceImpl implements WxCpOaService {
|
|
|
String responseContent = this.mainService.post(url, jsonObject.toString());
|
|
|
JsonObject tmpJson = GsonParser.parse(responseContent);
|
|
|
|
|
|
- return WxCpGsonBuilder.create()
|
|
|
- .fromJson(
|
|
|
- tmpJson.get("info"),
|
|
|
- new TypeToken<List<WxCpCheckinOption>>() {
|
|
|
- }.getType()
|
|
|
- );
|
|
|
+ return WxCpGsonBuilder.create().fromJson(tmpJson.get("info"),
|
|
|
+ new TypeToken<List<WxCpCheckinOption>>() {
|
|
|
+ }.getType()
|
|
|
+ );
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public List<WxCpCropCheckinOption> getCropCheckinOption() throws WxErrorException {
|
|
|
-
|
|
|
JsonObject jsonObject = new JsonObject();
|
|
|
final String url = this.mainService.getWxCpConfigStorage().getApiUrl(GET_CORP_CHECKIN_OPTION);
|
|
|
String responseContent = this.mainService.post(url, jsonObject.toString());
|
|
|
JsonObject tmpJson = GsonParser.parse(responseContent);
|
|
|
|
|
|
- return WxCpGsonBuilder.create()
|
|
|
- .fromJson(
|
|
|
- tmpJson.get("group"),
|
|
|
- new TypeToken<List<WxCpCropCheckinOption>>() {
|
|
|
- }.getType()
|
|
|
- );
|
|
|
+ return WxCpGsonBuilder.create().fromJson(tmpJson.get("group"),
|
|
|
+ new TypeToken<List<WxCpCropCheckinOption>>() {
|
|
|
+ }.getType()
|
|
|
+ );
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public WxCpApprovalInfo getApprovalInfo(@NonNull Date startTime, @NonNull Date endTime,
|
|
|
- Integer cursor, Integer size, List<WxCpApprovalInfoQueryFilter> filters) throws WxErrorException {
|
|
|
-
|
|
|
+ Integer cursor, Integer size, List<WxCpApprovalInfoQueryFilter> filters)
|
|
|
+ throws WxErrorException {
|
|
|
if (cursor == null) {
|
|
|
cursor = 0;
|
|
|
}
|
|
@@ -171,7 +156,6 @@ public class WxCpOaServiceImpl implements WxCpOaService {
|
|
|
|
|
|
@Override
|
|
|
public WxCpApprovalDetailResult getApprovalDetail(@NonNull String spNo) throws WxErrorException {
|
|
|
-
|
|
|
JsonObject jsonObject = new JsonObject();
|
|
|
jsonObject.addProperty("sp_no", spNo);
|
|
|
|
|
@@ -198,7 +182,6 @@ public class WxCpOaServiceImpl implements WxCpOaService {
|
|
|
jsonObject.addProperty("limit", limit);
|
|
|
|
|
|
if (startTime != null && endTime != null) {
|
|
|
-
|
|
|
long endtimestamp = endTime.getTime() / 1000L;
|
|
|
long starttimestamp = startTime.getTime() / 1000L;
|
|
|
|
|
@@ -230,12 +213,8 @@ public class WxCpOaServiceImpl implements WxCpOaService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public List<WxCpCheckinDayData> getCheckinDayData(Date startTime, Date endTime, List<String> userIdList) throws WxErrorException {
|
|
|
-
|
|
|
- if (startTime == null || endTime == null) {
|
|
|
- throw new WxRuntimeException("starttime and endtime can't be null");
|
|
|
- }
|
|
|
-
|
|
|
+ public List<WxCpCheckinDayData> getCheckinDayData(@NonNull Date startTime, @NonNull Date endTime, List<String> userIdList)
|
|
|
+ throws WxErrorException {
|
|
|
if (userIdList == null || userIdList.size() > USER_IDS_LIMIT) {
|
|
|
throw new WxRuntimeException("用户列表不能为空,不超过 " + USER_IDS_LIMIT + " 个,若用户超过 " + USER_IDS_LIMIT + " 个,请分批获取");
|
|
|
}
|
|
@@ -257,20 +236,15 @@ public class WxCpOaServiceImpl implements WxCpOaService {
|
|
|
final String url = this.mainService.getWxCpConfigStorage().getApiUrl(GET_CHECKIN_DAY_DATA);
|
|
|
String responseContent = this.mainService.post(url, jsonObject.toString());
|
|
|
JsonObject tmpJson = GsonParser.parse(responseContent);
|
|
|
- return WxCpGsonBuilder.create()
|
|
|
- .fromJson(
|
|
|
- tmpJson.get("datas"),
|
|
|
- new TypeToken<List<WxCpCheckinDayData>>() {
|
|
|
- }.getType()
|
|
|
- );
|
|
|
+ return WxCpGsonBuilder.create().fromJson(tmpJson.get("datas"),
|
|
|
+ new TypeToken<List<WxCpCheckinDayData>>() {
|
|
|
+ }.getType()
|
|
|
+ );
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public List<WxCpCheckinMonthData> getCheckinMonthData(Date startTime, Date endTime, List<String> userIdList) throws WxErrorException {
|
|
|
- if (startTime == null || endTime == null) {
|
|
|
- throw new WxRuntimeException("starttime and endtime can't be null");
|
|
|
- }
|
|
|
-
|
|
|
+ public List<WxCpCheckinMonthData> getCheckinMonthData(@NonNull Date startTime, @NonNull Date endTime, List<String> userIdList)
|
|
|
+ throws WxErrorException {
|
|
|
if (userIdList == null || userIdList.size() > USER_IDS_LIMIT) {
|
|
|
throw new WxRuntimeException("用户列表不能为空,不超过 " + USER_IDS_LIMIT + " 个,若用户超过 " + USER_IDS_LIMIT + " 个,请分批获取");
|
|
|
}
|
|
@@ -292,25 +266,19 @@ public class WxCpOaServiceImpl implements WxCpOaService {
|
|
|
final String url = this.mainService.getWxCpConfigStorage().getApiUrl(GET_CHECKIN_MONTH_DATA);
|
|
|
String responseContent = this.mainService.post(url, jsonObject.toString());
|
|
|
JsonObject tmpJson = GsonParser.parse(responseContent);
|
|
|
- return WxCpGsonBuilder.create()
|
|
|
- .fromJson(
|
|
|
- tmpJson.get("datas"),
|
|
|
- new TypeToken<List<WxCpCheckinMonthData>>() {
|
|
|
- }.getType()
|
|
|
- );
|
|
|
+ return WxCpGsonBuilder.create().fromJson(tmpJson.get("datas"),
|
|
|
+ new TypeToken<List<WxCpCheckinMonthData>>() {
|
|
|
+ }.getType()
|
|
|
+ );
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public List<WxCpCheckinSchedule> getCheckinScheduleList(Date startTime, Date endTime, List<String> userIdList) throws WxErrorException {
|
|
|
- if (startTime == null || endTime == null) {
|
|
|
- throw new WxRuntimeException("starttime and endtime can't be null");
|
|
|
- }
|
|
|
-
|
|
|
+ public List<WxCpCheckinSchedule> getCheckinScheduleList(@NonNull Date startTime, @NonNull Date endTime, List<String> userIdList)
|
|
|
+ throws WxErrorException {
|
|
|
if (userIdList == null || userIdList.size() > USER_IDS_LIMIT) {
|
|
|
throw new WxRuntimeException("用户列表不能为空,不超过 " + USER_IDS_LIMIT + " 个,若用户超过 " + USER_IDS_LIMIT + " 个,请分批获取");
|
|
|
}
|
|
|
|
|
|
-
|
|
|
long endTimestamp = endTime.getTime() / 1000L;
|
|
|
long startTimestamp = startTime.getTime() / 1000L;
|
|
|
|
|
@@ -329,12 +297,10 @@ public class WxCpOaServiceImpl implements WxCpOaService {
|
|
|
final String url = this.mainService.getWxCpConfigStorage().getApiUrl(GET_CHECKIN_SCHEDULE_DATA);
|
|
|
String responseContent = this.mainService.post(url, jsonObject.toString());
|
|
|
JsonObject tmpJson = GsonParser.parse(responseContent);
|
|
|
- return WxCpGsonBuilder.create()
|
|
|
- .fromJson(
|
|
|
- tmpJson.get("schedule_list"),
|
|
|
- new TypeToken<List<WxCpCheckinSchedule>>() {
|
|
|
- }.getType()
|
|
|
- );
|
|
|
+ return WxCpGsonBuilder.create().fromJson(tmpJson.get("schedule_list"),
|
|
|
+ new TypeToken<List<WxCpCheckinSchedule>>() {
|
|
|
+ }.getType()
|
|
|
+ );
|
|
|
}
|
|
|
|
|
|
@Override
|