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; + } + } + }