Showing
1 changed file
with
1 additions
and
1 deletions
@@ -243,7 +243,7 @@ public class StorageService { | @@ -243,7 +243,7 @@ public class StorageService { | ||
243 | * 排序 : 尺码小 价格低 创建时间前 的排序越靠前 | 243 | * 排序 : 尺码小 价格低 创建时间前 的排序越靠前 |
244 | */ | 244 | */ |
245 | Collections.sort(result.getList(), (o1, o2) -> { | 245 | Collections.sort(result.getList(), (o1, o2) -> { |
246 | - Double compareSize = Double.parseDouble(o1.getSizeName() == null ? "0" : o1.getSizeName()) - Double.parseDouble(o2.getSizeName() == null ? "0" : o2.getSizeName()); | 246 | + int compareSize = (o1.getSizeName() == null || o2.getSizeName() == null) ? 0 : (o1.getSizeName().compareTo(o2.getSizeName())); |
247 | if (compareSize < 0) | 247 | if (compareSize < 0) |
248 | return -1; | 248 | return -1; |
249 | else if (compareSize > 0) | 249 | else if (compareSize > 0) |
-
Please register or login to post a comment