Commit 35d6bca5 authored by 韩桐桐's avatar 韩桐桐

fix(jg):代码回退

parent 68cffe70
...@@ -322,18 +322,23 @@ public class CommonServiceImpl implements ICommonService { ...@@ -322,18 +322,23 @@ public class CommonServiceImpl implements ICommonService {
@Override @Override
public List<EquipmentCategory> getEquipmentCategoryList(String code, String type) { public List<EquipmentCategory> getEquipmentCategoryList(String code, String type) {
if (StringUtils.isEmpty(code)) { List<EquipmentCategory> result = new ArrayList<>();
return Collections.emptyList();
}
LambdaQueryWrapper<EquipmentCategory> wrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<EquipmentCategory> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(EquipmentCategory::getCode, code); wrapper.eq(EquipmentCategory::getCode, code);
EquipmentCategory equipmentCategory = equipmentCategoryMapper.selectOne(wrapper); EquipmentCategory equipmentCategory = equipmentCategoryMapper.selectOne(wrapper);
if (equipmentCategory == null) { if (ObjectUtils.isEmpty(type)) {
return Collections.emptyList(); if (!ValidationUtil.isEmpty(equipmentCategory)) {
result.add(equipmentCategory);
}
} else {
LambdaQueryWrapper<EquipmentCategory> wrapper2 = new LambdaQueryWrapper<>();
wrapper2.eq(EquipmentCategory::getParentId, equipmentCategory.getId());
List<EquipmentCategory> equipmentCategories = equipmentCategoryMapper.selectList(wrapper2);
if (!ValidationUtil.isEmpty(equipmentCategories)) {
result = equipmentCategories;
}
} }
LambdaQueryWrapper<EquipmentCategory> wrapper2 = new LambdaQueryWrapper<>(); return result;
wrapper2.eq(!StringUtils.isEmpty(type), EquipmentCategory::getParentId, equipmentCategory.getId());
return equipmentCategoryMapper.selectList(wrapper2);
} }
@Override @Override
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment