更改商品bug

This commit is contained in:
liuyingfang
2024-03-05 16:38:12 +08:00
parent 5463204fb5
commit c6744bc012
17 changed files with 72 additions and 56 deletions

View File

@@ -73,6 +73,17 @@ public class ListUtil {
return stringList;
}
public static List<Integer> stringChangeIntegerList(String listString){
// 使用Fastjson将JSON字符串转换为JSONArray对象
listString = listString.replaceAll("\"", "").replaceAll("\\[", "").replaceAll("\\]", "");
List<Integer> integerList = Stream.of(listString.split(","))
.map(Integer::valueOf)
.collect(Collectors.toList());
return integerList;
}
public static List<Integer> stringChangeIntegerList(List<String> listString){
// method1 创建一个Integer类型的集合循环遍历String类型的数组并把数据添加进集合