Commit 70906c72d3e9ec7a817992871da46e41dcf9213e

Authored by jiangjiazhi
1 parent 97c65b80fd

a

Showing 1 changed file with 2 additions and 2 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/TempFacade.java View file @ 70906c7
... ... @@ -23,6 +23,7 @@
23 23 import org.slf4j.Logger;
24 24 import org.slf4j.LoggerFactory;
25 25 import org.springframework.beans.factory.annotation.Autowired;
  26 +import org.springframework.data.domain.Sort;
26 27 import org.springframework.data.mongodb.core.MongoTemplate;
27 28 import org.springframework.data.mongodb.core.query.Criteria;
28 29 import org.springframework.data.mongodb.core.query.Query;
29 30  
... ... @@ -255,9 +256,8 @@
255 256  
256 257 public BaseResponse getTemp(String parentId) {
257 258 List<Map<String, Object>> restList = new ArrayList<>();
258   - List<TempModel> tempList = mongoTemplate.find(Query.query(Criteria.where("pid").is(parentId)), TempModel.class);
  259 + List<TempModel> tempList = mongoTemplate.find(Query.query(Criteria.where("pid").is(parentId)).with(new Sort(Sort.Direction.ASC, "modified")), TempModel.class);
259 260 if (CollectionUtils.isNotEmpty(tempList)) {
260   -
261 261 for (TempModel temp : tempList) {
262 262 if (temp != null && MapUtils.isNotEmpty(temp.getTempList())) {
263 263 LinkedHashMap<String, Double> tempList1 = temp.getTempList();