mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-06-28 13:16:19 +08:00
🐛 #2208【企业微信】 获取打卡人员排班信息接口修复返回结果类结构
This commit is contained in:
parent
72205bbf16
commit
d3730b361d
@ -165,7 +165,7 @@ public interface WxCpOaService {
|
|||||||
* @return 排班表信息
|
* @return 排班表信息
|
||||||
* @throws WxErrorException the wx error exception
|
* @throws WxErrorException the wx error exception
|
||||||
*/
|
*/
|
||||||
WxCpCheckinSchedule getCheckinScheduleList(Date startTime, Date endTime, List<String> userIdList) throws WxErrorException;
|
List<WxCpCheckinSchedule> getCheckinScheduleList(Date startTime, Date endTime, List<String> userIdList) throws WxErrorException;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -285,7 +285,7 @@ public class WxCpOaServiceImpl implements WxCpOaService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public WxCpCheckinSchedule getCheckinScheduleList(Date startTime, Date endTime, List<String> userIdList) throws WxErrorException {
|
public List<WxCpCheckinSchedule> getCheckinScheduleList(Date startTime, Date endTime, List<String> userIdList) throws WxErrorException {
|
||||||
if (startTime == null || endTime == null) {
|
if (startTime == null || endTime == null) {
|
||||||
throw new WxRuntimeException("starttime and endtime can't be null");
|
throw new WxRuntimeException("starttime and endtime can't be null");
|
||||||
}
|
}
|
||||||
@ -298,9 +298,6 @@ public class WxCpOaServiceImpl implements WxCpOaService {
|
|||||||
long endTimestamp = endTime.getTime() / 1000L;
|
long endTimestamp = endTime.getTime() / 1000L;
|
||||||
long startTimestamp = startTime.getTime() / 1000L;
|
long startTimestamp = startTime.getTime() / 1000L;
|
||||||
|
|
||||||
if (endTimestamp - startTimestamp < 0 || endTimestamp - startTimestamp >= MONTH_SECONDS) {
|
|
||||||
throw new WxRuntimeException("获取记录时间跨度不超过一个月");
|
|
||||||
}
|
|
||||||
|
|
||||||
JsonObject jsonObject = new JsonObject();
|
JsonObject jsonObject = new JsonObject();
|
||||||
JsonArray jsonArray = new JsonArray();
|
JsonArray jsonArray = new JsonArray();
|
||||||
@ -318,8 +315,8 @@ public class WxCpOaServiceImpl implements WxCpOaService {
|
|||||||
JsonObject tmpJson = GsonParser.parse(responseContent);
|
JsonObject tmpJson = GsonParser.parse(responseContent);
|
||||||
return WxCpGsonBuilder.create()
|
return WxCpGsonBuilder.create()
|
||||||
.fromJson(
|
.fromJson(
|
||||||
tmpJson,
|
tmpJson.get("schedule_list"),
|
||||||
new TypeToken<WxCpCheckinSchedule>() {
|
new TypeToken<List<WxCpCheckinSchedule>>() {
|
||||||
}.getType()
|
}.getType()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -13,17 +13,8 @@ import java.util.List;
|
|||||||
@Data
|
@Data
|
||||||
public class WxCpCheckinSchedule implements Serializable {
|
public class WxCpCheckinSchedule implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 5399197385827384108L;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* schedule_list 排班表信息
|
|
||||||
*/
|
|
||||||
@SerializedName("schedule_list")
|
|
||||||
private List<UserScheduleInfo> scheduleList;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
public class UserScheduleInfo implements Serializable {
|
|
||||||
private static final long serialVersionUID = 5515056962298169806L;
|
private static final long serialVersionUID = 5515056962298169806L;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* userid 打卡人员userid
|
* userid 打卡人员userid
|
||||||
*/
|
*/
|
||||||
@ -64,7 +55,7 @@ public class WxCpCheckinSchedule implements Serializable {
|
|||||||
private List<Schedule> scheduleList;
|
private List<Schedule> scheduleList;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class Schedule implements Serializable{
|
public class Schedule implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 8344153237512495728L;
|
private static final long serialVersionUID = 8344153237512495728L;
|
||||||
|
|
||||||
@ -139,6 +130,5 @@ public class WxCpCheckinSchedule implements Serializable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -85,7 +85,7 @@ public class WxCpOaServiceImplTest {
|
|||||||
Date startTime = DateFormatUtils.ISO_8601_EXTENDED_DATE_FORMAT.parse("2021-07-01");
|
Date startTime = DateFormatUtils.ISO_8601_EXTENDED_DATE_FORMAT.parse("2021-07-01");
|
||||||
Date endTime = DateFormatUtils.ISO_8601_EXTENDED_DATE_FORMAT.parse("2021-07-31");
|
Date endTime = DateFormatUtils.ISO_8601_EXTENDED_DATE_FORMAT.parse("2021-07-31");
|
||||||
|
|
||||||
WxCpCheckinSchedule results = wxService.getOaService()
|
List<WxCpCheckinSchedule> results = wxService.getOaService()
|
||||||
.getCheckinScheduleList(startTime, endTime, Lists.newArrayList("12003648"));
|
.getCheckinScheduleList(startTime, endTime, Lists.newArrayList("12003648"));
|
||||||
|
|
||||||
assertThat(results).isNotNull();
|
assertThat(results).isNotNull();
|
||||||
|
Loading…
Reference in New Issue
Block a user