Commit 3134a5f3 authored by 李秀明's avatar 李秀明

fix: 备品备件装备定义列表过滤掉非消耗性设备

parent 876e4884
...@@ -355,7 +355,16 @@ public class EquipmentServiceImpl extends ServiceImpl<EquipmentMapper, Equipment ...@@ -355,7 +355,16 @@ public class EquipmentServiceImpl extends ServiceImpl<EquipmentMapper, Equipment
.collect(Collectors.groupingBy(EquipmentIndex::getEquipmentId)); .collect(Collectors.groupingBy(EquipmentIndex::getEquipmentId));
Map<Long, Unit> unitMap = iUnitService.list().stream().collect(Collectors.toMap(Unit::getId, t -> t)); Map<Long, Unit> unitMap = iUnitService.list().stream().collect(Collectors.toMap(Unit::getId, t -> t));
Map<Long, EquipmentCategory> categoryMap = equipmentCategoryMapper.selectList(null).stream().collect(Collectors.toMap(EquipmentCategory::getId, t -> t)); Map<Long, EquipmentCategory> categoryMap = equipmentCategoryMapper.selectList(null).stream().collect(Collectors.toMap(EquipmentCategory::getId, t -> t));
for (Equipment equipment : list) { for (int i = 0; i <list.size(); i++) {
Equipment equipment = list.get(i);
EquipmentCategory equipmentCategory = categoryMap.get(equipment.getCategoryId());
String categoryCode = equipment.getCode();
// 移除非消耗性设备
if (Objects.isNull(equipmentCategory) || !Objects.equals(equipmentCategory.getIndustryCode(), "2") || categoryCode.charAt(0) == '2' || categoryCode.charAt(0) == '9') {
list.remove(equipment);
i--;
continue;
}
List<EquipmentIndex> quotaList = equipmentIndexMap.get(equipment.getId().toString()); List<EquipmentIndex> quotaList = equipmentIndexMap.get(equipment.getId().toString());
List<EquProperty> properList = new ArrayList<EquProperty>(); List<EquProperty> properList = new ArrayList<EquProperty>();
if (CollUtil.isNotEmpty(quotaList)) { if (CollUtil.isNotEmpty(quotaList)) {
...@@ -371,7 +380,6 @@ public class EquipmentServiceImpl extends ServiceImpl<EquipmentMapper, Equipment ...@@ -371,7 +380,6 @@ public class EquipmentServiceImpl extends ServiceImpl<EquipmentMapper, Equipment
properList.add(equProperty); properList.add(equProperty);
} }
} }
EquipmentCategory equipmentCategory = categoryMap.get(equipment.getCategoryId());
if (ObjectUtils.isNotEmpty(equipmentCategory)) { if (ObjectUtils.isNotEmpty(equipmentCategory)) {
equipment.setEquipCategoryId(equipmentCategory.getId()); equipment.setEquipCategoryId(equipmentCategory.getId());
equipment.setEquipCategoryCode(equipmentCategory.getCode()); equipment.setEquipCategoryCode(equipmentCategory.getCode());
......
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