diff --git a/gather-app/src/main/java/com/ruoyi/business/controller/ApprovalProcessController.java b/gather-app/src/main/java/com/ruoyi/business/controller/ApprovalProcessController.java index dcb033b..6bfbb73 100644 --- a/gather-app/src/main/java/com/ruoyi/business/controller/ApprovalProcessController.java +++ b/gather-app/src/main/java/com/ruoyi/business/controller/ApprovalProcessController.java @@ -67,64 +67,60 @@ public class ApprovalProcessController extends BaseController { List newList = new ArrayList<>(); for (ApprovalProcess process : list) { if (process.getMatterType() == 2) { - gwglLog one = gwglLogService.lambdaQuery() + List list1 = gwglLogService.lambdaQuery() .eq(gwglLog::getUuid, process.getUuid()) - .orderByDesc(gwglLog::getCreateTime) - .last("LIMIT 1") - .one(); - if (one != null) { - if ((one.getCheckUserId() != null && one.getCheckUserId().equals(getUserId().toString())) - || (one.getChecker() != null && one.getChecker().equals(getNickname()))) { - if (one.getCheckState() == 0) { - process.setApprovalStatus(0); - } else { - process.setApprovalStatus(1); + .orderByAsc(gwglLog::getCreateTime).list(); + if (list1 != null && !list1.isEmpty()) { + for (gwglLog gwglLog : list1) { + if ((gwglLog.getCheckUserId() != null && gwglLog.getCheckUserId().equals(getUserId().toString())) + || (gwglLog.getChecker() != null && gwglLog.getChecker().equals(getNickname()))) { + if (gwglLog.getCheckState() == 0) { + process.setApprovalStatus(0); + break; + } else { + process.setApprovalStatus(1); + } } } - else { - continue; - } }else { continue; } } if (process.getMatterType() == 3) { - gwglLog one = gwglLogService.lambdaQuery() + List list1 = gwglLogService.lambdaQuery() .eq(gwglLog::getApplyNo, process.getApprovalNo()) - .orderByDesc(gwglLog::getCreateTime) - .last("LIMIT 1") - .one(); - if (one != null) { - if ((one.getCheckUserId() != null && one.getCheckUserId().equals(getUserId().toString())) - || (one.getChecker() != null && one.getChecker().equals(getNickname()))) { - if (one.getCheckState() == 0) { - process.setApprovalStatus(0); - } else { - process.setApprovalStatus(1); + .orderByAsc(gwglLog::getCreateTime).list(); + if (list1 != null && !list1.isEmpty()) { + for (gwglLog gwglLog : list1) { + if ((gwglLog.getCheckUserId() != null && gwglLog.getCheckUserId().equals(getUserId().toString())) + || (gwglLog.getChecker() != null && gwglLog.getChecker().equals(getNickname()))) { + if (gwglLog.getCheckState() == 0) { + process.setApprovalStatus(0); + break; + } else { + process.setApprovalStatus(1); + } } - }else { - continue; } }else { continue; } } if (process.getMatterType() == 4) { - gwglLog one = gwglLogService.lambdaQuery() + List list1 = gwglLogService.lambdaQuery() .eq(gwglLog::getApplyNo, process.getApprovalNo()) - .orderByDesc(gwglLog::getCreateTime) - .last("LIMIT 1") - .one(); - if (one != null) { - if ((one.getCheckUserId() != null && one.getCheckUserId().equals(getUserId().toString())) - || (one.getChecker() != null && one.getChecker().equals(getNickname()))) { - if (one.getCheckState() == 0) { - process.setApprovalStatus(0); - } else { - process.setApprovalStatus(1); + .orderByAsc(gwglLog::getCreateTime).list(); + if (list1 != null && !list1.isEmpty()) { + for (gwglLog gwglLog : list1) { + if ((gwglLog.getCheckUserId() != null && gwglLog.getCheckUserId().equals(getUserId().toString())) + || (gwglLog.getChecker() != null && gwglLog.getChecker().equals(getNickname()))) { + if (gwglLog.getCheckState() == 0) { + process.setApprovalStatus(0); + break; + } else { + process.setApprovalStatus(1); + } } - }else { - continue; } }else { continue;