From a361ea8ffa118d22826971d623811c8d53a14a47 Mon Sep 17 00:00:00 2001 From: haungxing <1203316822@qq.com> Date: Fri, 21 Jul 2023 08:43:56 +0800 Subject: [PATCH] =?UTF-8?q?#=20=E6=A0=B9=E6=8D=AE=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E5=B7=A1=E6=A3=80=E9=A1=B9=E7=9B=AE/?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E6=8E=A5=E5=8F=A3=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/hnac/hzinfo/inspect/obj/services/ProjectService.java | 2 +- .../hzinfo/inspect/obj/services/impl/ProjectServiceImpl.java | 9 ++------- .../java/com/hnac/hzinfo/inspect/obj/web/ProjectController.java | 2 +- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/services/ProjectService.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/services/ProjectService.java index 2a35f1e..48d1c54 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/services/ProjectService.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/services/ProjectService.java @@ -48,5 +48,5 @@ public interface ProjectService extends BaseService{ * @param emCodes 设备编号(逗号分隔) * @return Map key-emCode value-projectVO */ - Map getProjectAndContentByEmCodes(String emCodes); + List getProjectAndContentByEmCodes(String emCodes); } diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/services/impl/ProjectServiceImpl.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/services/impl/ProjectServiceImpl.java index ab8b620..18b78ca 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/services/impl/ProjectServiceImpl.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/services/impl/ProjectServiceImpl.java @@ -133,15 +133,10 @@ public class ProjectServiceImpl extends BaseServiceImpl getProjectAndContentByEmCodes(String emCodes) { + public List getProjectAndContentByEmCodes(String emCodes) { Query query = new Query(); query.setCurrent(1); query.setSize(-1); - Map result = new HashMap<>(); - Stream.of(emCodes.split(",")).forEach(emCode -> { - ProjectVO project = this.getProjectAndContentByEmCode(emCode,new ContentDTO(),query); - result.put(emCode,project); - }); - return result; + return Stream.of(emCodes.split(",")).map(emCode -> this.getProjectAndContentByEmCode(emCode, new ContentDTO(), query)).collect(Collectors.toList()); } } diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/web/ProjectController.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/web/ProjectController.java index 5962c07..be62bfc 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/web/ProjectController.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/web/ProjectController.java @@ -165,7 +165,7 @@ public class ProjectController { @GetMapping("/getProjectAndContentByEmCodes") @ApiOperation(value = "根据多个设备编号(逗号分隔)获取项目以及内容列表(分页展示)") @ApiOperationSupport(order = 8) - public R> getProjectAndContentByEmCodes(@RequestParam String emCodes) { + public R> getProjectAndContentByEmCodes(@RequestParam String emCodes) { return R.data(projectService.getProjectAndContentByEmCodes(emCodes)); } }