增加配置属性

This commit is contained in:
sxu 2024-12-10 10:53:48 +08:00
parent 7bca69e746
commit 9dc5902df3
1 changed files with 10 additions and 4 deletions

View File

@ -2,7 +2,6 @@ package com.bonus.material.ma.service.impl;
import com.bonus.common.core.utils.DateUtils;
import com.bonus.common.core.utils.StringUtils;
import com.bonus.material.device.domain.DevInfo;
import com.bonus.material.ma.mapper.MaTypeFileMapper;
import com.bonus.material.ma.mapper.MaTypeMapper;
import com.bonus.material.ma.service.ITypeService;
@ -210,6 +209,14 @@ public class MaTypeServiceImpl implements ITypeService {
@Override
public List<TreeSelect> getMaTypeList(String typeName, String parentId) {
List<MaType> maTypes = maTypeMapper.selectMaTypeTree(parentId);
//填充自定义属性
fillProperties(maTypes);
List<TreeSelect> treeSelectList = buildDeptTreeSelect(maTypes);
//如果没有查询到那么返回空
return treeSelectList;
}
private void fillProperties(List<MaType> maTypes) {
List<MaTypeProperty> maTypeProperties = maTypeMapper.selectMaTypePropertyNames();
Map<Long, List<MaTypeProperty>> maTypePropertiesMap = new HashMap<>();
if (!CollectionUtils.isEmpty(maTypeProperties)) {
@ -221,9 +228,6 @@ public class MaTypeServiceImpl implements ITypeService {
maType.setPropertyNames(tmpPropList.stream().map(o -> o.getPropertyName()).collect(Collectors.toList()));
}
}
List<TreeSelect> treeSelectList = buildDeptTreeSelect(maTypes);
//如果没有查询到那么返回空
return treeSelectList;
}
@Override
@ -373,6 +377,8 @@ public class MaTypeServiceImpl implements ITypeService {
@Override
public List<MaType> getEquipmentType(Long typeId, String typeName) {
List<MaType> maTypes = maTypeMapper.selectMaTypeList("");
//填充自定义属性
fillProperties(maTypes);
List<MaType> list = new ArrayList<>();
for (MaType maType : maTypes) {
if (maType.getParentId() == 0) {