Browse Source

fix 数据确认

32197351@qq.com 1 year ago
parent
commit
39f2858ce3

+ 5 - 3
itdmServer/module-iTDM/src/main/java/org/jeecg/modules/gongdandetail/service/impl/ItdmGongdanQuerenServiceImpl.java

@@ -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);
             }