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)); } }