diff --git a/cash-service/market-service/src/main/java/com/czg/service/market/service/impl/DingService.java b/cash-service/market-service/src/main/java/com/czg/service/market/service/impl/DingService.java index 6f38f1033..5f5534989 100644 --- a/cash-service/market-service/src/main/java/com/czg/service/market/service/impl/DingService.java +++ b/cash-service/market-service/src/main/java/com/czg/service/market/service/impl/DingService.java @@ -177,16 +177,31 @@ public class DingService { status = "休息日"; } } - for (Object item : resultList) { + int notSignedCount = 0; + + for (int i = 0, resultListSize = resultList.size(); i < resultListSize; i++) { + Object item = resultList.get(i); + JSONObject jsonObject = (JSONObject) item; String timeResult = jsonObject.getString("time_result"); String checkType = jsonObject.getString("check_type"); + + if ("NotSigned".equals(timeResult)) { + notSignedCount++; + } + + if (notSignedCount >= 2) { + status = "旷工"; + break; + } + + if (i > 1 && !"正常".equals(status)) { + break; + } + + status = STATUS_MAP.get(timeResult); if (!"正常".equals(status)) { - status = STATUS_MAP.get(timeResult); - if(!"正常".equals(status)) { - status = ("OnDuty".equals(checkType) ? "上班" : "下班") + status; - break; - } + status = ("OnDuty".equals(checkType) ? "上班" : "下班") + status; } }