|
@@ -283,4 +283,44 @@ public class CpsBackLoginController {
|
|
|
List<GoodsDon> goodsDons = goodsDonMapper.getDistributeGoodsDetail(cpsUserId);
|
|
List<GoodsDon> goodsDons = goodsDonMapper.getDistributeGoodsDetail(cpsUserId);
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult(goodsDons);
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult(goodsDons);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 数据中心折线图
|
|
|
|
|
+ */
|
|
|
|
|
+ @GetMapping("/get/data/brokenLine")
|
|
|
|
|
+ public Result<CpsOrderDataStatisticsView> getDataBrokenLine(Long firstDate, Long lastDate) {
|
|
|
|
|
+ long cpsUserId = StpCpsManageUser.getLoginIdAsLong();
|
|
|
|
|
+ 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");
|
|
|
|
|
+ }
|
|
|
|
|
+ CpsOrderDataStatisticsView brokenLineObjView = Optional.ofNullable(userDistributeMapper.selectOrderBrokenLineMoney(cpsUserId, first, end))
|
|
|
|
|
+ .orElse(new CpsOrderDataStatisticsView());
|
|
|
|
|
+
|
|
|
|
|
+ if (brokenLineObjView != null) {
|
|
|
|
|
+ String timeSql = StrUtil.EMPTY;
|
|
|
|
|
+ if (firstDate != null) {
|
|
|
|
|
+ first = DateUtil.format(DateTime.of(firstDate), "yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
+ timeSql += String.format(" and o.created_time >= '%s'", first);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (lastDate != null) {
|
|
|
|
|
+ end = DateUtil.format(DateTime.of(lastDate), "yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
+ timeSql += String.format(" and o.created_time < '%s'", end);
|
|
|
|
|
+ }
|
|
|
|
|
+ MapBuilder builder = MapUtils.flatBuilder(request.getParameterMap());
|
|
|
|
|
+ builder.put("sharedId", String.format("shared_id = %s", cpsUserId));
|
|
|
|
|
+ if (StrUtil.isNotEmpty(timeSql)) {
|
|
|
|
|
+ builder.put("time", timeSql);
|
|
|
|
|
+ }
|
|
|
|
|
+ builder.put("sharedId", String.format("shared_id = %s", cpsUserId));
|
|
|
|
|
+ List<CpsOrderView> views = beanSearcher.searchAll(CpsOrderView.class,builder.build());
|
|
|
|
|
+ Map<Long, List<CpsOrderView>> goodsMap = views.stream().collect(Collectors.groupingBy(CpsOrderView::getGoodsId));
|
|
|
|
|
+ brokenLineObjView.setGoodsData(goodsMap);
|
|
|
|
|
+ }
|
|
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult(brokenLineObjView);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|