From 0b18bac4dd809857f705ce96deea35d0f39fb6dc Mon Sep 17 00:00:00 2001 From: sxu <602087911@qq.com> Date: Tue, 5 Nov 2024 16:10:55 +0800 Subject: [PATCH] =?UTF-8?q?=E7=89=A9=E8=B5=84=E7=B1=BB=E5=9E=8B=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bonus/material/ma/controller/TypeController.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/controller/TypeController.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/controller/TypeController.java index 010f89ff..01f022de 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/controller/TypeController.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/controller/TypeController.java @@ -2,6 +2,7 @@ package com.bonus.material.ma.controller; import java.util.ArrayList; import java.util.List; +import java.util.stream.Collectors; import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; import javax.validation.constraints.NotNull; @@ -78,11 +79,16 @@ public class TypeController extends BaseController { for (Integer parentId : parentIds) { maTypeVos.addAll(typeService.getListByParentId(parentId.longValue(), maTypeVo)); } + List updatedMaTypeVos = maTypeVos.stream() + .map(obj -> { + obj.setHouseId(maTypeVo.getHouseId()); + return obj; + }).collect(Collectors.toList()); if (BooleanUtils.isTrue(maTypeVo.getDisplayBindRelationship())) { - List newMaTypeVos = typeService.getMyTypeAndBindUsers(maTypeVos); - return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, newMaTypeVos)); + List finalMaTypeVos = typeService.getMyTypeAndBindUsers(updatedMaTypeVos); + return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, finalMaTypeVos)); } else { - return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, maTypeVos)); + return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, updatedMaTypeVos)); } }