Browse Source

代码优化

wangyu 6 years ago
parent
commit
ad6771d722

+ 1 - 4
icssman-service/src/main/java/com/diagbot/facade/ModuleInfoFacade.java

@@ -207,10 +207,7 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
                 .eq("return_type", 1)
                 .eq("return_type", 1)
                 .orderByDesc("order_no");
                 .orderByDesc("order_no");
         List<DictionaryInfo> dictionaryInfoList = dictionaryFacade.list(dictionaryInfoQueryWrapper);
         List<DictionaryInfo> dictionaryInfoList = dictionaryFacade.list(dictionaryInfoQueryWrapper);
-        Map<String, DictionaryInfo> dictionaryInfoMap = new HashMap<>();
-        for (DictionaryInfo dictionaryInfo : dictionaryInfoList) {
-            dictionaryInfoMap.put(dictionaryInfo.getVal(), dictionaryInfo);
-        }
+        Map<String, DictionaryInfo> dictionaryInfoMap = dictionaryInfoList.stream().collect(Collectors.toMap(DictionaryInfo::getVal,dictionaryInfo ->dictionaryInfo));
         //获取用户信息
         //获取用户信息
         RespDTO<Map<String, String>> respDTO = userServiceClient.getUserInfoByIds(ids);
         RespDTO<Map<String, String>> respDTO = userServiceClient.getUserInfoByIds(ids);
         if (respDTO == null || !CommonErrorCode.OK.getCode().equals(respDTO.code)) {
         if (respDTO == null || !CommonErrorCode.OK.getCode().equals(respDTO.code)) {