|
|
@@ -244,9 +244,10 @@ public class DistributeController {
|
|
|
|
|
|
/**
|
|
|
* 固定渠道平台分销详情 趋势图
|
|
|
+ * chain 默认1日 2周 3月
|
|
|
*/
|
|
|
@GetMapping("/get/distribute/plat/brokenLine/{sharedId}")
|
|
|
- public Result<BrokenLineObjView> getDsPlatBrokenLine(@PathVariable Long sharedId, Long firstDate, Long lastDate) {
|
|
|
+ public Result<BrokenLineObjView> getDsPlatBrokenLine(@PathVariable Long sharedId, Long firstDate, Long lastDate, @RequestParam(defaultValue = "1") Integer chain) {
|
|
|
String first = null;
|
|
|
String end = null;
|
|
|
if (firstDate != null) {
|
|
|
@@ -257,9 +258,16 @@ public class DistributeController {
|
|
|
}
|
|
|
BrokenLineObjView brokenLineObjView = Optional.ofNullable(orderDonMapper.selectDsPlatBrokenLineMoney(sharedId, first, end))
|
|
|
.orElse(new BrokenLineObjView());
|
|
|
+ String dateSqL = "date_format(od.created_time,'%Y-%m-%d')";
|
|
|
+ if (chain == 2) {
|
|
|
+ dateSqL = "DATE_FORMAT(created_time - INTERVAL (DAYOFWEEK(created_time) - 2) DAY, '%Y-%m-%d')";
|
|
|
+ } else if (chain == 3) {
|
|
|
+ dateSqL = "DATE_FORMAT(od.created_time, '%Y-%m')";
|
|
|
+ }
|
|
|
|
|
|
if (brokenLineObjView != null) {
|
|
|
List<DistributePlatOrderDonBrokenLineView> views = beanSearcher.searchAll(DistributePlatOrderDonBrokenLineView.class, MapUtils.flatBuilder(request.getParameterMap())
|
|
|
+ .put("date", dateSqL)
|
|
|
.field(DistributePlatOrderDonBrokenLineView::getDate, first, end).op(Operator.Between)
|
|
|
.put("sid", String.format("where shared_id = %s", sharedId))
|
|
|
.orderBy(DistributePlatOrderDonBrokenLineView::getDate).asc()
|