钉钉考勤
This commit is contained in:
@@ -169,14 +169,24 @@ public class DingService {
|
|||||||
OapiAttendanceGetupdatedataResponse rsp = client.execute(req, getToken(key, secret, shopId));
|
OapiAttendanceGetupdatedataResponse rsp = client.execute(req, getToken(key, secret, shopId));
|
||||||
System.out.println(rsp.getBody());
|
System.out.println(rsp.getBody());
|
||||||
JSONArray resultList = JSONObject.parseObject(rsp.getBody()).getJSONObject("result").getJSONArray("attendance_result_list");
|
JSONArray resultList = JSONObject.parseObject(rsp.getBody()).getJSONObject("result").getJSONArray("attendance_result_list");
|
||||||
|
|
||||||
if (resultList.isEmpty()) {
|
if (resultList.isEmpty()) {
|
||||||
|
if (DateUtil.date(date).toLocalDateTime().toLocalDate().compareTo(DateUtil.date().toLocalDateTime().toLocalDate()) == 0) {
|
||||||
|
status = "未打卡";
|
||||||
|
}else {
|
||||||
status = "休息日";
|
status = "休息日";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
for (Object item : resultList) {
|
for (Object item : resultList) {
|
||||||
JSONObject jsonObject = (JSONObject) item;
|
JSONObject jsonObject = (JSONObject) item;
|
||||||
String timeResult = jsonObject.getString("time_result");
|
String timeResult = jsonObject.getString("time_result");
|
||||||
|
String checkType = jsonObject.getString("check_type");
|
||||||
if (!"正常".equals(status)) {
|
if (!"正常".equals(status)) {
|
||||||
status = STATUS_MAP.get(timeResult);
|
status = STATUS_MAP.get(timeResult);
|
||||||
|
if(!"正常".equals(status)) {
|
||||||
|
status = ("OnDuty".equals(checkType) ? "上班" : "下班") + status;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user