|
|
@@ -41,7 +41,6 @@ import javax.servlet.http.HttpServletResponse;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.math.RoundingMode;
|
|
|
import java.util.ArrayList;
|
|
|
-import java.util.Date;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
import java.util.stream.Collectors;
|
|
|
@@ -385,14 +384,17 @@ public class StatisticsDataController {
|
|
|
* 获取每日平台订单折线数据
|
|
|
*/
|
|
|
@GetMapping("/get/plat/brokenLine")
|
|
|
- public Result<Map<Long, List<PlatOrderDonBrokenLineView>>> getPlatBrokenLine(Date firstDate) {
|
|
|
- if (firstDate == null) {
|
|
|
- firstDate = DateUtil.beginOfWeek(DateTime.now());
|
|
|
+ public Result<Map<Long, List<PlatOrderDonBrokenLineView>>> getPlatBrokenLine(Long firstDate, Long lastDate) {
|
|
|
+ String first = null;
|
|
|
+ String end = null;
|
|
|
+ if (firstDate != null) {
|
|
|
+ first = DateUtil.format(DateTime.of(firstDate), "yyyy-MM-dd");
|
|
|
+ }
|
|
|
+ if (lastDate != null) {
|
|
|
+ end = DateUtil.format(DateTime.of(lastDate), "yyyy-MM-dd");
|
|
|
}
|
|
|
- String date = DateUtil.format(firstDate, "yyyy-MM-dd");
|
|
|
List<PlatOrderDonBrokenLineView> views = beanSearcher.searchAll(PlatOrderDonBrokenLineView.class, MapUtils.builder()
|
|
|
- .field(PersonDistributeBrokenLineView::getDate, date).op(Operator.GreaterEqual)
|
|
|
- .put("status", String.format("od.status not in %s", Constant.noOrderAllStatus))
|
|
|
+ .field(PersonDistributeBrokenLineView::getDate, first, end).op(Operator.Between)
|
|
|
.orderBy(PersonDistributeBrokenLineView::getDate).asc()
|
|
|
.build());
|
|
|
Map<Long, List<PlatOrderDonBrokenLineView>> goodsMap = views.stream().collect(Collectors.groupingBy(PlatOrderDonBrokenLineView::getGoodsId));
|