From 7d2626cfcc07ba2d9b9914050ff35e9eaa9f5424 Mon Sep 17 00:00:00 2001 From: buaixuexideshitongxue <2936013465@qq.com> Date: Thu, 2 Apr 2026 17:51:03 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E6=9F=A5=E8=AF=A2=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E5=AE=A1=E6=89=B9=E8=B6=85=E6=97=B6=E6=9D=A1=E4=BB=B6=E7=9A=84?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pojo/param/NegativeQueryParam.java | 4 +++ .../service/NegativeQueryService.java | 31 +++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/src/main/java/com/biutag/supervision/pojo/param/NegativeQueryParam.java b/src/main/java/com/biutag/supervision/pojo/param/NegativeQueryParam.java index 4569db6..a6cc988 100644 --- a/src/main/java/com/biutag/supervision/pojo/param/NegativeQueryParam.java +++ b/src/main/java/com/biutag/supervision/pojo/param/NegativeQueryParam.java @@ -117,6 +117,9 @@ public class NegativeQueryParam extends BasePage { @TableField("issuingDepartName") private String issuingDepartName; + @Schema(description = "审批超时状态集合: city_timeout/city_normal/branch_timeout/branch_normal") + private List approvalTimeoutStatus; + private UserAuth currentUser; @@ -135,6 +138,7 @@ public class NegativeQueryParam extends BasePage { target.setThreeLevelCode(this.threeLevelCode == null ? null : new ArrayList<>(this.threeLevelCode)); target.setProblemSourcesCode(this.problemSourcesCode == null ? null : new ArrayList<>(this.problemSourcesCode)); target.setInvolveDepartIds(this.involveDepartIds == null ? null : Set.copyOf(this.involveDepartIds)); + target.setApprovalTimeoutStatus(this.approvalTimeoutStatus == null ? null : new ArrayList<>(this.approvalTimeoutStatus)); return target; } diff --git a/src/main/java/com/biutag/supervision/service/NegativeQueryService.java b/src/main/java/com/biutag/supervision/service/NegativeQueryService.java index bd1f51c..e42a42a 100644 --- a/src/main/java/com/biutag/supervision/service/NegativeQueryService.java +++ b/src/main/java/com/biutag/supervision/service/NegativeQueryService.java @@ -204,6 +204,20 @@ public class NegativeQueryService { ); queryWrapper.in(Negative::getProcessingStatus,List.of("completed", "approval")); } + // 审批超时查询(支持多选) + if (CollectionUtil.isNotEmpty(param.getApprovalTimeoutStatus())) { + queryWrapper.and(wrapper -> { + List statuses = param.getApprovalTimeoutStatus(); + for (int i = 0; i < statuses.size(); i++) { + String status = statuses.get(i); + if (i == 0) { + wrapper.and(q -> buildTimeoutCondition(q, status)); + } else { + wrapper.or(q -> buildTimeoutCondition(q, status)); + } + } + }); + } // 排序 queryWrapper.orderBy("crtTime".equals(param.getOrderProp()), OrderEnum.ascending.name().equals(param.getOrder()), Negative::getCrtTime) .orderBy("discoveryTime".equals(param.getOrderProp()), OrderEnum.ascending.name().equals(param.getOrder()), Negative::getDiscoveryTime);; @@ -223,4 +237,21 @@ public class NegativeQueryService { return new Page().setRecords(list).setTotal(page.getTotal()); } + private void buildTimeoutCondition(LambdaQueryWrapper queryWrapper, String status) { + switch (status) { + case "city_timeout": + queryWrapper.gt(Negative::getFirstApproveTime, TimeUtil.SECONDS_OF_A_DAY); + break; + case "city_normal": + queryWrapper.le(Negative::getFirstApproveTime, TimeUtil.SECONDS_OF_A_DAY).or().isNull(Negative::getFirstApproveTime); + break; + case "branch_timeout": + queryWrapper.gt(Negative::getSecondApprovalTime, TimeUtil.SECONDS_OF_A_DAY); + break; + case "branch_normal": + queryWrapper.le(Negative::getSecondApprovalTime, TimeUtil.SECONDS_OF_A_DAY).or().isNull(Negative::getSecondApprovalTime); + break; + } + } + }