物资类型优化

This commit is contained in:
sxu 2024-11-05 16:10:55 +08:00
parent 3cbe0af7d3
commit 0b18bac4dd
1 changed files with 9 additions and 3 deletions

View File

@ -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<MaTypeVo> updatedMaTypeVos = maTypeVos.stream()
.map(obj -> {
obj.setHouseId(maTypeVo.getHouseId());
return obj;
}).collect(Collectors.toList());
if (BooleanUtils.isTrue(maTypeVo.getDisplayBindRelationship())) {
List<MaTypeVo> newMaTypeVos = typeService.getMyTypeAndBindUsers(maTypeVos);
return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, newMaTypeVos));
List<MaTypeVo> 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));
}
}