|
@@ -22,6 +22,7 @@ import java.text.ParseException;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
|
import java.util.function.Supplier;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* @Description: 工单detail
|
|
@@ -166,13 +167,14 @@ public class ItdmGongdanQuerenServiceImpl extends ServiceImpl<ItdmGongdanDetailM
|
|
|
|
|
|
List<Map<String, String>> mapList = new ArrayList<>();
|
|
|
|
|
|
- for (ItdmGongdanDetail i : list) {
|
|
|
- ItdmDevice itdmDevice = itdmDeviceMapper.selectById(i.getShijiShebeiId());
|
|
|
+ for (String i : list.stream().map(ItdmGongdanDetail::getShijiShebeiId).distinct().collect(Collectors.toList())) {
|
|
|
+
|
|
|
+ ItdmDevice itdmDevice = itdmDeviceMapper.selectById(i);
|
|
|
|
|
|
if (itdmDevice != null) {
|
|
|
Map<String, String> map = new HashMap<>();
|
|
|
|
|
|
- map.put("type", i.getShijiShebeiId());
|
|
|
+ map.put("type", i);
|
|
|
map.put("name", itdmDevice.getDeviceName());
|
|
|
mapList.add(map);
|
|
|
}
|