物资类型优化
This commit is contained in:
parent
3cbe0af7d3
commit
0b18bac4dd
|
|
@ -2,6 +2,7 @@ package com.bonus.material.ma.controller;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import javax.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
@ -78,11 +79,16 @@ public class TypeController extends BaseController {
|
||||||
for (Integer parentId : parentIds) {
|
for (Integer parentId : parentIds) {
|
||||||
maTypeVos.addAll(typeService.getListByParentId(parentId.longValue(), maTypeVo));
|
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())) {
|
if (BooleanUtils.isTrue(maTypeVo.getDisplayBindRelationship())) {
|
||||||
List<MaTypeVo> newMaTypeVos = typeService.getMyTypeAndBindUsers(maTypeVos);
|
List<MaTypeVo> finalMaTypeVos = typeService.getMyTypeAndBindUsers(updatedMaTypeVos);
|
||||||
return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, newMaTypeVos));
|
return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, finalMaTypeVos));
|
||||||
} else {
|
} else {
|
||||||
return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, maTypeVos));
|
return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, updatedMaTypeVos));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue