|
|
@@ -3,6 +3,7 @@ package com.goafanti.order.controller;
|
|
|
|
|
|
|
|
|
import java.io.IOException;
|
|
|
+import java.util.Comparator;
|
|
|
import java.util.List;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
@@ -640,7 +641,15 @@ public class AdminNewOrderApiController extends CertifyApiController {
|
|
|
*/
|
|
|
@RequestMapping(value = "/statisticsList", method = RequestMethod.GET)
|
|
|
public Result statisticsList(InputStatistics in){
|
|
|
- return res().data(orderNewService.statisticsList(in));
|
|
|
+ List<OutStatisticsList> result = orderNewService.statisticsList(in);
|
|
|
+ if (in.getSort()==null||in.getSort()==0){
|
|
|
+ result.sort(Comparator.comparing(OutStatisticsList::getTotal).reversed());
|
|
|
+ }else if (in.getSort()==1){
|
|
|
+ result.sort(Comparator.comparing(OutStatisticsList::getQuantity).reversed());
|
|
|
+ } else {
|
|
|
+ result.sort(Comparator.comparing(OutStatisticsList::getCounts).reversed());
|
|
|
+ }
|
|
|
+ return res().data(result);
|
|
|
}
|
|
|
|
|
|
/**
|