feat(标准解读流程): 子解读多人分发完善
This commit is contained in:
+5
-11
@@ -22,10 +22,7 @@ import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -154,17 +151,14 @@ public class FlowUtility {
|
||||
* @return 返回一个新的Map,其中所有值为List类型的元素都被转换为以逗号分隔的字符串。
|
||||
*/
|
||||
public static Map<String, Object> listToString(Map<String, Object> map) {
|
||||
// 使用Stream API对原始Map进行处理
|
||||
Map<String, Object> stringObjectHashMap = map.entrySet().stream().map(v -> {
|
||||
// 检查当前元素的值是否为List类型
|
||||
Map<String, Object> stringObjectHashMap = new HashMap<>(map);
|
||||
stringObjectHashMap = stringObjectHashMap.entrySet().stream().map(v -> {
|
||||
if (v.getValue() instanceof List) {
|
||||
// 将List类型的值转换为以逗号分隔的字符串
|
||||
v.setValue(String.join(",", (List<String>) v.getValue()));
|
||||
List<String> list = (List<String>)v.getValue();
|
||||
v.setValue(String.join(",", list));
|
||||
}
|
||||
// 返回转换后的Map.Entry对象
|
||||
return v;
|
||||
}).collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
|
||||
// 返回转换后的Map
|
||||
return stringObjectHashMap;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user