Commit 6b83b40b zshaohui

料盒操作页面,物料按创建时间进行倒序排列

1 个父辈 52d009e7
...@@ -41,6 +41,7 @@ import org.springframework.security.access.prepost.PreAuthorize; ...@@ -41,6 +41,7 @@ import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
@Slf4j @Slf4j
@RestController @RestController
...@@ -109,6 +110,11 @@ public class MaterialBoxController { ...@@ -109,6 +110,11 @@ public class MaterialBoxController {
// } // }
if(barcodeDto.getSubCodeList()==null){ if(barcodeDto.getSubCodeList()==null){
barcodeDto.setSubCodeList(new ArrayList<>()); barcodeDto.setSubCodeList(new ArrayList<>());
} else {
//按时间进行排序
List<BarcodeDto> subCodeList = barcodeDto.getSubCodeList();
subCodeList = subCodeList.stream().sorted(Comparator.comparing(BarcodeDto :: getCreateDate).reversed()).collect(Collectors.toList());
barcodeDto.setSubCodeList(subCodeList);
} }
return barcodeDto; return barcodeDto;
} }
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!