From d521574abceb2f5939af69e20aa264d5c4c4a884 Mon Sep 17 00:00:00 2001 From: hanrenchun Date: Mon, 9 Jun 2025 23:41:38 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ApprovalProcessController.java | 19 +++++++++++++------ .../controller/gwglLogController.java | 2 +- 2 files changed, 14 insertions(+), 7 deletions(-) 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 af14d09..dcb033b 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 @@ -55,9 +55,9 @@ public class ApprovalProcessController extends BaseController { } } - if (approvalProcess.getProcessTitle() != null) { - queryWrapper.like("process_title", approvalProcess.getProcessTitle()) - .or().like("submitter_name", approvalProcess.getProcessTitle()); + if (approvalProcess.getProcessTitles() != null) { + queryWrapper.like("process_title", approvalProcess.getProcessTitles()) + .or().like("submitter_name", approvalProcess.getProcessTitles()); } if (approvalProcess.getSubmitterId() != null) { @@ -81,6 +81,9 @@ public class ApprovalProcessController extends BaseController { process.setApprovalStatus(1); } } + else { + continue; + } }else { continue; } @@ -99,6 +102,8 @@ public class ApprovalProcessController extends BaseController { } else { process.setApprovalStatus(1); } + }else { + continue; } }else { continue; @@ -118,6 +123,8 @@ public class ApprovalProcessController extends BaseController { } else { process.setApprovalStatus(1); } + }else { + continue; } }else { continue; @@ -212,9 +219,9 @@ public class ApprovalProcessController extends BaseController { queryWrapper.ge("create_time", System.currentTimeMillis() - 30 * 24 * 60 * 60 * 1000L); } } - if (approvalProcess.getProcessTitle() != null) { - queryWrapper.like("process_title", approvalProcess.getProcessTitle()) - .or().like("submitter_name", approvalProcess.getProcessTitle()); + if (approvalProcess.getProcessTitles() != null) { + queryWrapper.like("process_title", approvalProcess.getProcessTitles()) + .or().like("submitter_name", approvalProcess.getProcessTitles()); } queryWrapper.eq("submitter_id", getLoginUser().getUserId()); List list = approvalsProcessService.list(queryWrapper); diff --git a/gather-app/src/main/java/com/ruoyi/business/controller/gwglLogController.java b/gather-app/src/main/java/com/ruoyi/business/controller/gwglLogController.java index 2363ace..b1eeb7e 100644 --- a/gather-app/src/main/java/com/ruoyi/business/controller/gwglLogController.java +++ b/gather-app/src/main/java/com/ruoyi/business/controller/gwglLogController.java @@ -31,7 +31,7 @@ public class gwglLogController extends BaseController { public TableDataInfo query(@RequestBody gwglLog gwglLog){ startPage(); QueryWrapper queryWrapper = new QueryWrapper<>(gwglLog); - queryWrapper.orderByDesc("create_time"); +// queryWrapper.orderByDesc("create_time"); return getDataTable(gwglLogService.list(queryWrapper)); } From aaaaf826fda187ae29cae4dc678ab312e98ddecf Mon Sep 17 00:00:00 2001 From: hanrenchun Date: Mon, 9 Jun 2025 23:51:30 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ApprovalProcessController.java | 76 +++++++++---------- 1 file changed, 36 insertions(+), 40 deletions(-) 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;