feat(api): 增加营销系统枚举类型映射及导出数据转换支持
- 新增MarketingSettlementType、MarketingPeriodType、MarketingSendMethod、MarketingRechargeType枚举映射 - 在导出接口中根据数据源区分结算方式,支持YMT和营销系统不同枚举转换 - 增加plan.send_method、code_batch.period_type和code_batch.recharge_type字段的枚举值转换 - 优化导出数据中相关字段的可读性,便于理解和使用枚举标签展示
This commit is contained in:
parent
2ed9a0ce55
commit
326eec184f
|
|
@ -1158,12 +1158,45 @@ func transformRow(ds string, fields []string, vals []string) []string {
|
||||||
}
|
}
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
// activity.settlement_type - 结算类型
|
// activity.settlement_type / plan.settlement_type - 结算方式
|
||||||
if f == "activity.settlement_type" || f == "plan.settlement_type" {
|
if f == "activity.settlement_type" || f == "plan.settlement_type" {
|
||||||
if n := parseIntVal(v); n >= 0 {
|
if n := parseIntVal(v); n >= 0 {
|
||||||
|
if ds == "ymt" {
|
||||||
if label, ok := constants.YMTSettlementType[n]; ok {
|
if label, ok := constants.YMTSettlementType[n]; ok {
|
||||||
vals[i] = label
|
vals[i] = label
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
if label, ok := constants.MarketingSettlementType[n]; ok {
|
||||||
|
vals[i] = label
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
// plan.send_method - 发放方式
|
||||||
|
if f == "plan.send_method" {
|
||||||
|
if n := parseIntVal(v); n >= 0 {
|
||||||
|
if label, ok := constants.MarketingSendMethod[n]; ok {
|
||||||
|
vals[i] = label
|
||||||
|
}
|
||||||
|
}
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
// code_batch.period_type - 周期类型
|
||||||
|
if f == "code_batch.period_type" {
|
||||||
|
if n := parseIntVal(v); n >= 0 {
|
||||||
|
if label, ok := constants.MarketingPeriodType[n]; ok {
|
||||||
|
vals[i] = label
|
||||||
|
}
|
||||||
|
}
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
// code_batch.recharge_type - 充值类型
|
||||||
|
if f == "code_batch.recharge_type" {
|
||||||
|
if n := parseIntVal(v); n >= 0 {
|
||||||
|
if label, ok := constants.MarketingRechargeType[n]; ok {
|
||||||
|
vals[i] = label
|
||||||
|
}
|
||||||
}
|
}
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -88,6 +88,39 @@ var YMTSettlementType = map[int]string{
|
||||||
4: "核销结算",
|
4: "核销结算",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// MarketingSettlementType 营销系统结算方式映射
|
||||||
|
var MarketingSettlementType = map[int]string{
|
||||||
|
1: "发放结算",
|
||||||
|
2: "打开结算",
|
||||||
|
3: "打开成功结算",
|
||||||
|
4: "领取结算",
|
||||||
|
5: "领取成功结算",
|
||||||
|
6: "使用结算",
|
||||||
|
7: "使用成功结算",
|
||||||
|
8: "官方绑定结算",
|
||||||
|
9: "官方核销结算",
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarketingPeriodType 营销系统周期类型映射
|
||||||
|
var MarketingPeriodType = map[int]string{
|
||||||
|
1: "不设置",
|
||||||
|
2: "自动发放",
|
||||||
|
3: "手动领取",
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarketingSendMethod 营销系统发放方式映射
|
||||||
|
var MarketingSendMethod = map[int]string{
|
||||||
|
0: "",
|
||||||
|
1: "邮件发放",
|
||||||
|
2: "API调用",
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarketingRechargeType 营销系统充值类型映射
|
||||||
|
var MarketingRechargeType = map[int]string{
|
||||||
|
1: "单个商品充值",
|
||||||
|
2: "组合商品充值",
|
||||||
|
}
|
||||||
|
|
||||||
// ==================== 通用枚举 ====================
|
// ==================== 通用枚举 ====================
|
||||||
|
|
||||||
// ThirdPartyType 第三方类型映射
|
// ThirdPartyType 第三方类型映射
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue