You've already forked FrameTour-BE
feat(device): 添加设备拍摄统计数据接口
- 新增设备拍摄统计功能,支持查询拍摄总数、拍摄人数、售出张数等统计信息 - 实现设备拍摄时间线功能,按5分钟分桶统计type=2的拍摄数量 - 添加SourceMapper的数据访问方法,包括getDeviceSourceStats和getDeviceSourceTimeline - 集成日期时间参数处理,支持自定义统计时间段 - 实现时间轴数据补零逻辑,确保时间线图表显示连续性 - 添加相应的响应对象DeviceSourceStatsVO和DeviceSourceTimelineVO
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
package com.ycwl.basic.model.pc.device.resp;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 设备拍摄统计 VO
|
||||
*/
|
||||
@Data
|
||||
public class DeviceSourceStatsVO {
|
||||
/** 拍摄总数(source type=2 记录数) */
|
||||
private Integer totalShots;
|
||||
/** 拍摄人数(关联的不同 face_id 数) */
|
||||
private Integer totalFaces;
|
||||
/** 售出张数(is_buy=1 的 member_source 记录数) */
|
||||
private Integer soldCount;
|
||||
/** 赠送张数(is_free=1 的 member_source 记录数) */
|
||||
private Integer freeCount;
|
||||
/** 售出人数(is_buy=1 的不同 face_id 数) */
|
||||
private Integer soldFaceCount;
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.ycwl.basic.model.pc.device.resp;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 设备拍摄时间线数据点(5 分钟一个桶)
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class DeviceSourceTimelineVO {
|
||||
/** 时间桶起始时刻 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
|
||||
private Date time;
|
||||
/** 该桶内 source type=2 的记录数 */
|
||||
private Integer count;
|
||||
}
|
||||
Reference in New Issue
Block a user