You've already forked FrameTour-BE
平台数据
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
package com.ycwl.basic.controller.pc;
|
package com.ycwl.basic.controller.pc;
|
||||||
|
|
||||||
import com.ycwl.basic.model.mobile.statistic.req.CommonQueryReq;
|
import com.ycwl.basic.model.mobile.statistic.req.CommonQueryReq;
|
||||||
|
import com.ycwl.basic.service.mobile.AppStatisticsService;
|
||||||
import com.ycwl.basic.service.pc.StatisticsService;
|
import com.ycwl.basic.service.pc.StatisticsService;
|
||||||
import com.ycwl.basic.utils.ApiResponse;
|
import com.ycwl.basic.utils.ApiResponse;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -20,6 +21,9 @@ public class StatisticsController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private StatisticsService statisticsService;
|
private StatisticsService statisticsService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private AppStatisticsService appStatisticsService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 智能获取扫码访问人数统计数据(自动选择粒度)
|
* 智能获取扫码访问人数统计数据(自动选择粒度)
|
||||||
* @param query 查询参数(包含景区ID、开始时间、结束时间)
|
* @param query 查询参数(包含景区ID、开始时间、结束时间)
|
||||||
@@ -29,4 +33,14 @@ public class StatisticsController {
|
|||||||
public ApiResponse<List<HashMap<String, String>>> getScanCodeMemberChart(@RequestBody CommonQueryReq query) {
|
public ApiResponse<List<HashMap<String, String>>> getScanCodeMemberChart(@RequestBody CommonQueryReq query) {
|
||||||
return ApiResponse.success(statisticsService.getScanCodeMemberChartAuto(query));
|
return ApiResponse.success(statisticsService.getScanCodeMemberChartAuto(query));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/one")
|
||||||
|
public ApiResponse getStatisticsOne(@RequestBody CommonQueryReq query) {
|
||||||
|
return appStatisticsService.oneStatistics(query);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/two")
|
||||||
|
public ApiResponse getStatisticsTwo(@RequestBody CommonQueryReq query) {
|
||||||
|
return appStatisticsService.twoStatistics(query);
|
||||||
|
}
|
||||||
}
|
}
|
@@ -264,7 +264,9 @@ public class AppStatisticsServiceImpl implements AppStatisticsService {
|
|||||||
vo.setPayOfOrderAmount(payOfOrderAmount.setScale(2, RoundingMode.HALF_UP));
|
vo.setPayOfOrderAmount(payOfOrderAmount.setScale(2, RoundingMode.HALF_UP));
|
||||||
vo.setRefundOfOrderNum(refundOfOrderNum);
|
vo.setRefundOfOrderNum(refundOfOrderNum);
|
||||||
vo.setRefundOfOrderAmount(refundOfOrderAmount.setScale(2, RoundingMode.HALF_UP));
|
vo.setRefundOfOrderAmount(refundOfOrderAmount.setScale(2, RoundingMode.HALF_UP));
|
||||||
|
if (query.getScenicId() != null) {
|
||||||
statisticsMapper.insertStat(query.getScenicId(), new Date(), vo);
|
statisticsMapper.insertStat(query.getScenicId(), new Date(), vo);
|
||||||
|
}
|
||||||
redisTemplate.opsForValue().set(redisKey, JacksonUtil.toJSONString(vo), 60, TimeUnit.SECONDS);
|
redisTemplate.opsForValue().set(redisKey, JacksonUtil.toJSONString(vo), 60, TimeUnit.SECONDS);
|
||||||
return ApiResponse.success(vo);
|
return ApiResponse.success(vo);
|
||||||
} finally {
|
} finally {
|
||||||
|
@@ -10,7 +10,10 @@
|
|||||||
select ifnull(sum(pay_price),0) as payPrice
|
select ifnull(sum(pay_price),0) as payPrice
|
||||||
from `order`
|
from `order`
|
||||||
where
|
where
|
||||||
(status = 1 or status = 2) and scenic_id = #{scenicId}
|
(status = 1 or status = 2)
|
||||||
|
<if test="scenicId != null">
|
||||||
|
and scenic_id = #{scenicId}
|
||||||
|
</if>
|
||||||
<if test="startTime!= null">
|
<if test="startTime!= null">
|
||||||
and pay_at >= #{startTime}
|
and pay_at >= #{startTime}
|
||||||
</if>
|
</if>
|
||||||
@@ -95,7 +98,10 @@
|
|||||||
FROM (
|
FROM (
|
||||||
select count(1) as count
|
select count(1) as count
|
||||||
from statistics
|
from statistics
|
||||||
where type=4 and scenic_id = #{scenicId}
|
where type=4
|
||||||
|
<if test="scenicId != null">
|
||||||
|
and scenic_id = #{scenicId}
|
||||||
|
</if>
|
||||||
<if test="startTime!= null">
|
<if test="startTime!= null">
|
||||||
and create_time >= #{startTime}
|
and create_time >= #{startTime}
|
||||||
</if>
|
</if>
|
||||||
@@ -111,7 +117,10 @@
|
|||||||
FROM (
|
FROM (
|
||||||
select count(1) as count
|
select count(1) as count
|
||||||
from statistics
|
from statistics
|
||||||
where type=3 and scenic_id = #{scenicId}
|
where type=3
|
||||||
|
<if test="scenicId != null">
|
||||||
|
and scenic_id = #{scenicId}
|
||||||
|
</if>
|
||||||
<if test="startTime!= null">
|
<if test="startTime!= null">
|
||||||
and create_time >= #{startTime}
|
and create_time >= #{startTime}
|
||||||
</if>
|
</if>
|
||||||
@@ -275,7 +284,10 @@
|
|||||||
select ifnull(sum(pay_price),0) as payPrice
|
select ifnull(sum(pay_price),0) as payPrice
|
||||||
from `order`
|
from `order`
|
||||||
where
|
where
|
||||||
refund_status = 1 and scenic_id = #{scenicId}
|
refund_status = 1
|
||||||
|
<if test="scenicId != null">
|
||||||
|
and scenic_id = #{scenicId}
|
||||||
|
</if>
|
||||||
<if test="startTime!= null">
|
<if test="startTime!= null">
|
||||||
and create_at >= #{startTime}
|
and create_at >= #{startTime}
|
||||||
</if>
|
</if>
|
||||||
@@ -315,8 +327,10 @@
|
|||||||
<select id="listStatByScenic" resultType="com.ycwl.basic.model.mobile.statistic.resp.AppStatisticsFunnelVO">
|
<select id="listStatByScenic" resultType="com.ycwl.basic.model.mobile.statistic.resp.AppStatisticsFunnelVO">
|
||||||
SELECT cs1 AS cameraShotOfMemberNum, v1 AS totalVisitorOfMemberNum, sv1 AS scanCodeVisitorOfMemberNum, u1 AS uploadFaceOfMemberNum, m1 AS pushOfMemberNum, gv1 AS completeVideoOfMemberNum, gv2 AS completeOfVideoNum, pv1 AS previewVideoOfMemberNum, pv2 AS previewOfVideoNum, cp1 AS clickOnPayOfMemberNum, o1 AS payOfMemberNum, o2 AS payOfOrderNum, o3 AS payOfOrderAmount, ro2 AS refundOfOrderNum, ro3 AS refundOfOrderAmount
|
SELECT cs1 AS cameraShotOfMemberNum, v1 AS totalVisitorOfMemberNum, sv1 AS scanCodeVisitorOfMemberNum, u1 AS uploadFaceOfMemberNum, m1 AS pushOfMemberNum, gv1 AS completeVideoOfMemberNum, gv2 AS completeOfVideoNum, pv1 AS previewVideoOfMemberNum, pv2 AS previewOfVideoNum, cp1 AS clickOnPayOfMemberNum, o1 AS payOfMemberNum, o2 AS payOfOrderNum, o3 AS payOfOrderAmount, ro2 AS refundOfOrderNum, ro3 AS refundOfOrderAmount
|
||||||
FROM scenic_stats
|
FROM scenic_stats
|
||||||
WHERE scenic_id = #{scenicId}
|
WHERE date BETWEEN #{startTime} AND #{endTime}
|
||||||
AND date BETWEEN #{startTime} AND #{endTime}
|
<if test="scenicId != null">
|
||||||
|
AND scenic_id = #{scenicId}
|
||||||
|
</if>
|
||||||
</select>
|
</select>
|
||||||
<select id="orderChartByDate" resultType="java.util.HashMap">
|
<select id="orderChartByDate" resultType="java.util.HashMap">
|
||||||
WITH RECURSIVE date_series AS (
|
WITH RECURSIVE date_series AS (
|
||||||
|
Reference in New Issue
Block a user