Merge remote-tracking branch 'origin/master'

This commit is contained in:
jjLv 2024-10-28 17:03:29 +08:00
commit 1ba4f57e96
2 changed files with 5 additions and 15 deletions

View File

@ -26,6 +26,8 @@ public class Type extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 类型ID */
@Excel(name = "类型ID")
@ApiModelProperty(value = "类型ID")
private Long typeId;
/** 类型名称 */

View File

@ -347,20 +347,6 @@ public class TypeServiceImpl implements ITypeService {
maTypeMap.put(treeSelect.getId(), treeSelect);
}
// 3.遍历所有配置关联
// for (WhHouseSet whHouseSet : whHouseSets) {
// // --- 数据校验 ----
// if (whHouseSet == null || whHouseSet.getTypeId() == null) { continue; }
// // 构造函数定义0级Tree对象
// TreeSelect thisTree = new TreeSelect(whHouseSet.getHouseId(),whHouseSet.getHouseName(),0,null);
// // 从Map中直接获取对应的1级节点
// TreeSelect oneLevelTree = maTypeMap.get(whHouseSet.getTypeId());
// // 转换为集合存入0级Tree对象中
// thisTree.setChildren(oneLevelTree != null ? Collections.singletonList(oneLevelTree) : null);
// // 最后把0级Tree对象存入Result结果集合返回给前端
// treeSelectResultList.add(thisTree);
// }
// 3.遍历所有配置关联
Map<Long, List<WhHouseSet>> groupedById = whHouseSets.stream().collect(Collectors.groupingBy(WhHouseSet::getHouseId));
groupedById.forEach((id, itemList) -> {
@ -369,7 +355,9 @@ public class TypeServiceImpl implements ITypeService {
for (WhHouseSet whHouseSet : itemList) {
if (whHouseSet == null || whHouseSet.getTypeId() == null) { continue; }
TreeSelect oneLevelTree = maTypeMap.get(whHouseSet.getTypeId());
children.add(oneLevelTree != null ? oneLevelTree : null);
if (oneLevelTree != null) {
children.add(oneLevelTree);
}
}
thisTree.setChildren(children);
treeSelectResultList.add(thisTree);