|
|
|
@ -204,6 +204,20 @@ public class NegativeQueryService { |
|
|
|
); |
|
|
|
); |
|
|
|
queryWrapper.in(Negative::getProcessingStatus,List.of("completed", "approval")); |
|
|
|
queryWrapper.in(Negative::getProcessingStatus,List.of("completed", "approval")); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 审批超时查询(支持多选)
|
|
|
|
|
|
|
|
if (CollectionUtil.isNotEmpty(param.getApprovalTimeoutStatus())) { |
|
|
|
|
|
|
|
queryWrapper.and(wrapper -> { |
|
|
|
|
|
|
|
List<String> 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) |
|
|
|
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);; |
|
|
|
.orderBy("discoveryTime".equals(param.getOrderProp()), OrderEnum.ascending.name().equals(param.getOrder()), Negative::getDiscoveryTime);; |
|
|
|
@ -223,4 +237,21 @@ public class NegativeQueryService { |
|
|
|
return new Page<NegativeQueryVo>().setRecords(list).setTotal(page.getTotal()); |
|
|
|
return new Page<NegativeQueryVo>().setRecords(list).setTotal(page.getTotal()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void buildTimeoutCondition(LambdaQueryWrapper<Negative> 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; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|