From 61ab58b70404a73a80e0767c4b4f5b553c83d33f Mon Sep 17 00:00:00 2001 From: wangliwen Date: Wed, 13 Jul 2022 10:47:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E6=A1=88=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TAbilityApplicationController.java | 38 +++++++++++-------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/renren-admin/src/main/java/io/renren/modules/processForm/controller/TAbilityApplicationController.java b/renren-admin/src/main/java/io/renren/modules/processForm/controller/TAbilityApplicationController.java index 42cf3b81..49f0ed7e 100644 --- a/renren-admin/src/main/java/io/renren/modules/processForm/controller/TAbilityApplicationController.java +++ b/renren-admin/src/main/java/io/renren/modules/processForm/controller/TAbilityApplicationController.java @@ -83,22 +83,28 @@ public class TAbilityApplicationController { params.put("abilityprocess_v2", Boolean.TRUE); // 是否根据流程 abilityprocess_v2 来分页 params.put("user_id", user == null ? null : user.getId()); PageData page = tAbilityApplicationService.page(params); - page.getList().stream().map(index -> { - List dtos = - tAbilityApplicationService.getByInstanceId(index.getInstanceId()); - if (!dtos.isEmpty()) { - dtos.stream() - .limit(1l) - .forEach(dto -> { - BeanUtils.copyProperties(dto, index); - if (StringUtils.isNotEmpty(index.getCameraList())) { - index.setSystem("申请摄像头列表:" + index.getSystem() + " 等,共" + dtos.size() + "个"); - return; - } - }); - } - return index; - }).collect(Collectors.toList()); + List list = + page.getList().stream().map(index -> { + List dtos = + tAbilityApplicationService.getByInstanceId(index.getInstanceId()); + if (!dtos.isEmpty()) { + dtos.stream() + .limit(1l) + .forEach(dto -> { + BeanUtils.copyProperties(dto, index); + if (StringUtils.isNotEmpty(index.getCameraList())) { + if (dtos.size() > 1) { + index.setSystem("视频资源申请:(" + index.getSystem() + " 等" + dtos.size() + "个摄像头)"); + } else { + index.setSystem("视频资源申请:" + index.getSystem()); + } + return; + } + }); + } + return index; + }).collect(Collectors.toList()); + page.setList(list); return new Result>().ok(page); }