实现“支付订单金额、预览_支付转化率、扫码_付费用户转化率”和“支付订单数、现场订单数、推送订单数统计”

This commit is contained in:
longbinbin
2024-12-12 15:39:53 +08:00
parent 405b48d9d3
commit ba4c339660
14 changed files with 555 additions and 53 deletions

View File

@ -0,0 +1,75 @@
package com.ycwl.basic.enums;
import java.util.HashMap;
import java.util.Map;
public enum StatisticEnum {
SCAN_THE_CODE_TO_ENTER(0,"扫码进入"),
UPLOAD_FACE(1,"上传人脸"),
PREVIEWING_VIDEO(2,"预览视频"),
ON_SITE_PAYMENT(3,"现场支付"),
POST_PAYMENT(4,"事后支付"),
REFUND(5,"退款"),
AGREE_TO_PUSH(6,"同意推送"),
REFUSE_PUSH_NOTIFICATIONS(7,"拒绝推送"),
DOWNLOAD(8,"下载"),
CLICK_ON_PAYMENT(9,"点击支付、购买"),
;
public static final Map<Integer, StatisticEnum> cacheMap;
static {
cacheMap = new HashMap<>(StatisticEnum.values().length);
for (StatisticEnum value : StatisticEnum.values()) {
cacheMap.put(value.code, value);
}
}
public static final Map<String, StatisticEnum> valueMap;
static {
valueMap = new HashMap<>(StatisticEnum.values().length);
for (StatisticEnum value : StatisticEnum.values()) {
valueMap.put(value.value, value);
}
}
public final Integer code;
private final String value;
StatisticEnum(Integer code, String value) {
this.code = code;
this.value = value;
}
/**
* 获取value值
*/
public static String getValue(Integer noticeMethod) {
if (noticeMethod == null) {
return null;
}
StatisticEnum statisticEnum = cacheMap.get(noticeMethod);
if (statisticEnum == null) {
return null;
}
return statisticEnum.value;
}
/**
* 获取code值
*/
public static Integer getCode(String noticeMethod) {
if (noticeMethod == null) {
return -1;
}
StatisticEnum statisticEnum = valueMap.get(noticeMethod);
if (statisticEnum == null) {
return -1;
}
return statisticEnum.code;
}
}