From 31cdc1723699dcf847eff4535716b3a0159bbf6e Mon Sep 17 00:00:00 2001 From: wangliwen Date: Wed, 13 Jul 2022 10:19:46 +0800 Subject: [PATCH 1/2] =?UTF-8?q?processForm/tabilityapplication/my=5Fpage?= =?UTF-8?q?=20=E6=8E=A5=E5=8F=A3=E6=91=84=E5=83=8F=E5=A4=B4=E7=89=B9?= =?UTF-8?q?=E6=AE=8A=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TAbilityApplicationController.java | 18 +++++++++++++++++- .../impl/TAbilityApplicationServiceImpl.java | 6 +++--- .../renren/service/impl/TokenServiceImpl.java | 2 +- 3 files changed, 21 insertions(+), 5 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 32887e74..42cf3b81 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 @@ -29,6 +29,7 @@ import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.jdbc.core.JdbcTemplate; @@ -82,6 +83,22 @@ 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()); return new Result>().ok(page); } @@ -139,7 +156,6 @@ public class TAbilityApplicationController { break; case TSINGTAO: { // 大数据局 camera = (List) resourceService.getApplyCameraList(Long.valueOf(tAbilityApplicationDTOList.get(0).getInstanceId())); -// camera = tAbilityApplicationDTOList.stream().filter(tAbilityApplicationDTO -> StringUtils.isNotEmpty(tAbilityApplicationDTO.getCameraList())).map(index_ -> jdbcTemplate.queryForObject("SELECT * FROM t_camera_channel WHERE idt_camera_channel = " + index_.getResourceId(), Map.class)).filter(index_ -> !index_.isEmpty()).collect(Collectors.toList()); } break; case BAOTOU: diff --git a/renren-admin/src/main/java/io/renren/modules/processForm/service/impl/TAbilityApplicationServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/processForm/service/impl/TAbilityApplicationServiceImpl.java index 9508fbd6..5af12153 100644 --- a/renren-admin/src/main/java/io/renren/modules/processForm/service/impl/TAbilityApplicationServiceImpl.java +++ b/renren-admin/src/main/java/io/renren/modules/processForm/service/impl/TAbilityApplicationServiceImpl.java @@ -32,11 +32,11 @@ public class TAbilityApplicationServiceImpl extends CrudServiceImpl null != params.get(index)).forEach(index -> { switch (index) { // case "abilityprocess_v2": - wrapper.select("DISTINCT apply_flag ,id ,`user` ,phone ,unit ,area ,system ,scene ,basis ,attachment ,instance_id ,user_id ,enclosure ,title ,application_system ,application_scene ,application_background ,effect_wish ,apply_number ,resource_owner_dept ,del_flag"); + wrapper.select("DISTINCT apply_flag ,instance_id"); wrapper.isNotNull(Boolean.valueOf(params.get("abilityprocess_v2").toString()), "apply_flag"); wrapper.isNotNull(Boolean.valueOf(params.get("abilityprocess_v2").toString()), "instance_id"); wrapper.groupBy(Boolean.valueOf(params.get("abilityprocess_v2").toString()), "apply_flag") - .groupBy("id"); + .groupBy("instance_id"); break; case "user_id": wrapper.eq(params.get("user_id") != null, "user_id", Long.valueOf(params.get("user_id").toString())); @@ -46,7 +46,7 @@ public class TAbilityApplicationServiceImpl extends CrudServiceImpl imp private final static int EXPIRE = 3600 * 12; @Override - @Cacheable(value = getByTokenKey, key = "#p1") + @Cacheable(value = getByTokenKey, key = "#p0") public TokenEntity getByToken(String token) { return baseDao.getByToken(token); } From 61ab58b70404a73a80e0767c4b4f5b553c83d33f Mon Sep 17 00:00:00 2001 From: wangliwen Date: Wed, 13 Jul 2022 10:47:21 +0800 Subject: [PATCH 2/2] =?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); }