钉钉考勤

This commit is contained in:
张松
2025-12-03 11:48:42 +08:00
parent 3076f913dd
commit 9086e806d7

View File

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