记得上下班打卡 | git大法好,push需谨慎

Commit 6bde6f9a authored by 姜秀龙's avatar 姜秀龙

feat(kylin): 演出订单支持粉丝俱乐部来源标记

- 入参 referrerApp、referrerUserId 同时传才写入 order_source,否则落库空串
- 列表/详情 VO 返回 referrerApp、referrerUserId,老数据兼容空串
- DDL: docu/order_referrer_kylin.sql
Co-authored-by: 's avatarCursor <cursoragent@cursor.com>
parent f8932630
-- 演出订单:粉丝俱乐部来源标记
ALTER TABLE kylin_order_tickets
ADD COLUMN referrer_user_id varchar(64) NOT NULL DEFAULT '' COMMENT '粉丝俱乐部侧用户id' AFTER order_source;
...@@ -66,4 +66,8 @@ public class PayOrderParam { ...@@ -66,4 +66,8 @@ public class PayOrderParam {
private AddressVo addressesVo; private AddressVo addressesVo;
@ApiModelProperty(value = "联系方式") @ApiModelProperty(value = "联系方式")
private String userMobile; private String userMobile;
@ApiModelProperty(value = "粉丝俱乐部来源标识,如DOUDOU之家;与 referrerUserId 同时传才打标")
private String referrerApp;
@ApiModelProperty(value = "粉丝俱乐部侧用户id")
private String referrerUserId;
} }
...@@ -45,7 +45,11 @@ public class KylinOrderTicketVo implements Serializable, Cloneable { ...@@ -45,7 +45,11 @@ public class KylinOrderTicketVo implements Serializable, Cloneable {
private String qrCode; private String qrCode;
@ApiModelProperty(position = 18, value = "下单方式") @ApiModelProperty(position = 18, value = "下单方式")
private String orderType; private String orderType;
@ApiModelProperty(position = 19, value = "下单版本") @ApiModelProperty(position = 19, value = "粉丝俱乐部来源标识")
private String referrerApp;
@ApiModelProperty(position = 19, value = "粉丝俱乐部侧用户id")
private String referrerUserId;
@ApiModelProperty(position = 20, value = "下单版本")
private String orderVersion; private String orderVersion;
@ApiModelProperty(position = 20, value = "数量") @ApiModelProperty(position = 20, value = "数量")
private Integer number; private Integer number;
...@@ -156,6 +160,8 @@ public class KylinOrderTicketVo implements Serializable, Cloneable { ...@@ -156,6 +160,8 @@ public class KylinOrderTicketVo implements Serializable, Cloneable {
public void setOrderTicket(KylinOrderTickets orderTicket) { public void setOrderTicket(KylinOrderTickets orderTicket) {
BeanUtils.copyProperties(orderTicket, this); BeanUtils.copyProperties(orderTicket, this);
this.referrerApp = orderTicket.getOrderSource() == null ? "" : orderTicket.getOrderSource();
this.referrerUserId = orderTicket.getReferrerUserId() == null ? "" : orderTicket.getReferrerUserId();
} }
public void setOrderTicketStatus(KylinOrderTicketStatus orderTicketStatus) { public void setOrderTicketStatus(KylinOrderTicketStatus orderTicketStatus) {
......
...@@ -49,6 +49,10 @@ public class KylinOrderListVo implements Serializable, Cloneable { ...@@ -49,6 +49,10 @@ public class KylinOrderListVo implements Serializable, Cloneable {
private Integer transferStatus; private Integer transferStatus;
@ApiModelProperty(value = "创建时间", example = "") @ApiModelProperty(value = "创建时间", example = "")
private String createdAt; private String createdAt;
@ApiModelProperty(value = "粉丝俱乐部来源标识")
private String referrerApp;
@ApiModelProperty(value = "粉丝俱乐部侧用户id")
private String referrerUserId;
private static final KylinOrderListVo obj = new KylinOrderListVo(); private static final KylinOrderListVo obj = new KylinOrderListVo();
...@@ -116,6 +120,8 @@ public class KylinOrderListVo implements Serializable, Cloneable { ...@@ -116,6 +120,8 @@ public class KylinOrderListVo implements Serializable, Cloneable {
} else { } else {
this.status = vo.getStatus(); this.status = vo.getStatus();
} }
this.referrerApp = vo.getReferrerApp() == null ? "" : vo.getReferrerApp();
this.referrerUserId = vo.getReferrerUserId() == null ? "" : vo.getReferrerUserId();
return this; return this;
} }
} }
package com.liquidnet.commons.lang.util;
import org.apache.commons.lang3.StringUtils;
/**
* 粉丝俱乐部订单来源打标:前端传 referrerApp + referrerUserId 则落库,否则写空串。
*/
public final class ReferrerOrderMarkUtil {
private ReferrerOrderMarkUtil() {
}
public static void apply(String referrerApp, String referrerUserId, ReferrerMarkTarget target) {
if (StringUtils.isNotBlank(referrerApp) && StringUtils.isNotBlank(referrerUserId)) {
target.setReferrer(referrerApp, referrerUserId);
} else {
target.setReferrer("", "");
}
}
public interface ReferrerMarkTarget {
void setReferrer(String referrerApp, String referrerUserId);
}
}
...@@ -78,6 +78,11 @@ public class KylinOrderTickets implements Serializable, Cloneable { ...@@ -78,6 +78,11 @@ public class KylinOrderTickets implements Serializable, Cloneable {
*/ */
private String orderSource; private String orderSource;
/**
* 粉丝俱乐部侧用户id
*/
private String referrerUserId;
/** /**
* 下单版本 * 下单版本
*/ */
...@@ -249,11 +254,14 @@ public class KylinOrderTickets implements Serializable, Cloneable { ...@@ -249,11 +254,14 @@ public class KylinOrderTickets implements Serializable, Cloneable {
* @return * @return
*/ */
public Object[] getAddObject(String ipAddress,String area,String areaProvince,String areaCity,String areaCounty) { public Object[] getAddObject(String ipAddress,String area,String areaProvince,String areaCity,String areaCounty) {
String safeOrderSource = orderSource == null ? "" : orderSource;
String safeReferrerUserId = referrerUserId == null ? "" : referrerUserId;
return new Object[]{ return new Object[]{
orderTicketsId, userId, userName, userMobile, performanceTitle, orderCode, qrCode, orderType, orderVersion, orderTicketsId, userId, userName, userMobile, performanceTitle, orderCode, qrCode, orderType, orderVersion,
safeOrderSource, safeReferrerUserId,
number, price, priceMember, priceTotal, priceVoucher, priceActual, priceExpress, priceRefund, refundNumber, number, price, priceMember, priceTotal, priceVoucher, priceActual, priceExpress, priceRefund, refundNumber,
payType, paymentType, timePay, expressContacts, expressAddress, expressPhone, couponType, getTicketType, payType, paymentType, timePay, expressContacts, expressAddress, expressPhone, couponType, getTicketType,
getTicketDescribe, payCountdownMinute, comment, createdAt, updatedAt, payCode,ipAddress,area,areaProvince,areaCity,areaCounty getTicketDescribe, payCountdownMinute, comment, createdAt, updatedAt, payCode, ipAddress, area, areaProvince, areaCity, areaCounty
}; };
} }
......
...@@ -4,7 +4,7 @@ kylin_lack_register.insert=INSERT INTO `kylin_lack_registers`(`lack_registers_id ...@@ -4,7 +4,7 @@ kylin_lack_register.insert=INSERT INTO `kylin_lack_registers`(`lack_registers_id
# ------------------------PV/UV---------------------------- # ------------------------PV/UV----------------------------
bi_ticket_access_records.insert=INSERT INTO `bi_ticket_access_records` ( `user_id`, `access_type`, `performance_id`, `order_id`, `order_code`,`ip_address`, `area`, `area_province`, `area_city`, `area_county`,`created_at`) VALUES (?,?,?,?,?,?,?,?,?,?,?); bi_ticket_access_records.insert=INSERT INTO `bi_ticket_access_records` ( `user_id`, `access_type`, `performance_id`, `order_id`, `order_code`,`ip_address`, `area`, `area_province`, `area_city`, `area_county`,`created_at`) VALUES (?,?,?,?,?,?,?,?,?,?,?);
# ------------------------\u521B\u5EFA\u8BA2\u5355---------------------------- # ------------------------\u521B\u5EFA\u8BA2\u5355----------------------------
kylin_order_ticket.add=INSERT INTO kylin_order_tickets(order_tickets_id,user_id,user_name,user_mobile,performance_title,order_code,qr_code,order_type,order_version,`number`,price,price_member,price_total,price_voucher,price_actual,price_express,price_refund,refund_number,pay_type,payment_type,time_pay,express_contacts,express_address,express_phone,coupon_type,get_ticket_type,get_ticket_describe,pay_countdown_minute,`comment`,created_at,updated_at,pay_code,ip_address,area,area_province,area_city,area_county)VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) kylin_order_ticket.add=INSERT INTO kylin_order_tickets(order_tickets_id,user_id,user_name,user_mobile,performance_title,order_code,qr_code,order_type,order_version,order_source,referrer_user_id,`number`,price,price_member,price_total,price_voucher,price_actual,price_express,price_refund,refund_number,pay_type,payment_type,time_pay,express_contacts,express_address,express_phone,coupon_type,get_ticket_type,get_ticket_describe,pay_countdown_minute,`comment`,created_at,updated_at,pay_code,ip_address,area,area_province,area_city,area_county)VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
kylin_order_ticket_relation.add=INSERT INTO kylin_order_ticket_relations(order_ticket_relations_id ,order_id ,transfer_id ,live_id ,agent_id ,is_member ,performance_id ,time_id ,ticket_id ,created_at ,updated_at,agent_status,agent_distributions,agent_id_master,agent_distributions_master)VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) kylin_order_ticket_relation.add=INSERT INTO kylin_order_ticket_relations(order_ticket_relations_id ,order_id ,transfer_id ,live_id ,agent_id ,is_member ,performance_id ,time_id ,ticket_id ,created_at ,updated_at,agent_status,agent_distributions,agent_id_master,agent_distributions_master)VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
kylin_order_ticket_status.add=INSERT INTO kylin_order_ticket_status(order_ticket_status_id ,order_id ,express_type ,is_student ,transfer_status ,`status` ,pay_status , produce_code, created_at ,updated_at)VALUES(?,?,?,?,?,?,?,?,?,?) kylin_order_ticket_status.add=INSERT INTO kylin_order_ticket_status(order_ticket_status_id ,order_id ,express_type ,is_student ,transfer_status ,`status` ,pay_status , produce_code, created_at ,updated_at)VALUES(?,?,?,?,?,?,?,?,?,?)
kylin_order_ticket_entities.add=INSERT INTO kylin_order_ticket_entities(order_ticket_entities_id ,order_id ,ticket_id ,user_id ,time_id ,performance_id ,enter_type ,enter_name ,enter_mobile,enter_id_code,`status`,sys_damai,check_client,is_payment,`comment`,created_at,updated_at)VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) kylin_order_ticket_entities.add=INSERT INTO kylin_order_ticket_entities(order_ticket_entities_id ,order_id ,ticket_id ,user_id ,time_id ,performance_id ,enter_type ,enter_name ,enter_mobile,enter_id_code,`status`,sys_damai,check_client,is_payment,`comment`,created_at,updated_at)VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
......
...@@ -498,6 +498,7 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ ...@@ -498,6 +498,7 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
orderTickets.setQrCode(""); orderTickets.setQrCode("");
orderTickets.setOrderType(source); orderTickets.setOrderType(source);
orderTickets.setOrderVersion(version); orderTickets.setOrderVersion(version);
applyReferrerMark(orderTickets, payOrderParam);
orderTickets.setNumber(payOrderParam.getNumber()); orderTickets.setNumber(payOrderParam.getNumber());
orderTickets.setPrice(ticketData.getPrice()); orderTickets.setPrice(ticketData.getPrice());
orderTickets.setPriceMember(ticketData.getMemberPrice()); orderTickets.setPriceMember(ticketData.getMemberPrice());
...@@ -1351,4 +1352,12 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ ...@@ -1351,4 +1352,12 @@ public class KylinOrderTicketsServiceImpl implements IKylinOrderTicketsOrderServ
return false; return false;
} }
} }
private void applyReferrerMark(KylinOrderTickets orderTickets, PayOrderParam payOrderParam) {
ReferrerOrderMarkUtil.apply(payOrderParam.getReferrerApp(), payOrderParam.getReferrerUserId(),
(referrerApp, referrerUserId) -> {
orderTickets.setOrderSource(referrerApp);
orderTickets.setReferrerUserId(referrerUserId);
});
}
} }
...@@ -4,7 +4,7 @@ kylin_lack_register.insert=INSERT INTO `kylin_lack_registers`(`lack_registers_id ...@@ -4,7 +4,7 @@ kylin_lack_register.insert=INSERT INTO `kylin_lack_registers`(`lack_registers_id
# ------------------------PV/UV---------------------------- # ------------------------PV/UV----------------------------
bi_ticket_access_records.insert=INSERT INTO `bi_ticket_access_records` ( `user_id`, `access_type`, `performance_id`, `order_id`, `order_code`,`ip_address`, `area`, `area_province`, `area_city`, `area_county`,`created_at`) VALUES (?,?,?,?,?,?,?,?,?,?,?); bi_ticket_access_records.insert=INSERT INTO `bi_ticket_access_records` ( `user_id`, `access_type`, `performance_id`, `order_id`, `order_code`,`ip_address`, `area`, `area_province`, `area_city`, `area_county`,`created_at`) VALUES (?,?,?,?,?,?,?,?,?,?,?);
# ------------------------\u521B\u5EFA\u8BA2\u5355---------------------------- # ------------------------\u521B\u5EFA\u8BA2\u5355----------------------------
kylin_order_ticket.add=INSERT INTO kylin_order_tickets(order_tickets_id,user_id,user_name,user_mobile,performance_title,order_code,qr_code,order_type,order_version,`number`,price,price_member,price_total,price_voucher,price_actual,price_express,price_refund,refund_number,pay_type,payment_type,time_pay,express_contacts,express_address,express_phone,coupon_type,get_ticket_type,get_ticket_describe,pay_countdown_minute,`comment`,created_at,updated_at,pay_code,ip_address,area,area_province,area_city,area_county)VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) kylin_order_ticket.add=INSERT INTO kylin_order_tickets(order_tickets_id,user_id,user_name,user_mobile,performance_title,order_code,qr_code,order_type,order_version,order_source,referrer_user_id,`number`,price,price_member,price_total,price_voucher,price_actual,price_express,price_refund,refund_number,pay_type,payment_type,time_pay,express_contacts,express_address,express_phone,coupon_type,get_ticket_type,get_ticket_describe,pay_countdown_minute,`comment`,created_at,updated_at,pay_code,ip_address,area,area_province,area_city,area_county)VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
kylin_order_ticket_relation.add=INSERT INTO kylin_order_ticket_relations(order_ticket_relations_id ,order_id ,transfer_id ,live_id ,agent_id ,is_member ,performance_id ,time_id ,ticket_id ,created_at ,updated_at,agent_status,agent_distributions,agent_id_master,agent_distributions_master)VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) kylin_order_ticket_relation.add=INSERT INTO kylin_order_ticket_relations(order_ticket_relations_id ,order_id ,transfer_id ,live_id ,agent_id ,is_member ,performance_id ,time_id ,ticket_id ,created_at ,updated_at,agent_status,agent_distributions,agent_id_master,agent_distributions_master)VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
kylin_order_ticket_status.add=INSERT INTO kylin_order_ticket_status(order_ticket_status_id ,order_id ,express_type ,is_student ,transfer_status ,`status` ,pay_status , produce_code ,created_at ,updated_at)VALUES(?,?,?,?,?,?,?,?,?,?) kylin_order_ticket_status.add=INSERT INTO kylin_order_ticket_status(order_ticket_status_id ,order_id ,express_type ,is_student ,transfer_status ,`status` ,pay_status , produce_code ,created_at ,updated_at)VALUES(?,?,?,?,?,?,?,?,?,?)
kylin_order_ticket_entities.add=INSERT INTO kylin_order_ticket_entities(order_ticket_entities_id ,order_id ,ticket_id ,user_id ,time_id ,performance_id ,enter_type ,enter_name ,enter_mobile,enter_id_code,`status`,sys_damai,check_client,is_payment,`comment`,created_at,updated_at)VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) kylin_order_ticket_entities.add=INSERT INTO kylin_order_ticket_entities(order_ticket_entities_id ,order_id ,ticket_id ,user_id ,time_id ,performance_id ,enter_type ,enter_name ,enter_mobile,enter_id_code,`status`,sys_damai,check_client,is_payment,`comment`,created_at,updated_at)VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
...@@ -30,7 +30,7 @@ kylin_order_refund_entities.overtimeRefund=INSERT INTO kylin_order_refund_entiti ...@@ -30,7 +30,7 @@ kylin_order_refund_entities.overtimeRefund=INSERT INTO kylin_order_refund_entiti
#-------- \u5546\u57CE ------- #-------- \u5546\u57CE -------
goblin.order.create.order_insert=INSERT INTO goblin_store_order (`master_order_code`,`order_id`,`store_id`,`store_name`,`order_code`,`user_id`,`user_name`,`user_mobile`,`price_total`,`pay_code`,`price_actual`,`price_refund`,`price_express`,`price_coupon`,`store_price_coupon`,`price_voucher`,`status`,`ucoupon_id`,`store_coupon_id`,`pay_type`,`device_from`,`source`,`version`,`is_member`,`order_type`,`write_off_code`,`pay_countdown_minute`,`ip_address`,`market_id`,`market_type`,`created_at`,`mix_id`,`mix_code`) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) goblin.order.create.order_insert=INSERT INTO goblin_store_order (`master_order_code`,`order_id`,`store_id`,`store_name`,`order_code`,`user_id`,`user_name`,`user_mobile`,`price_total`,`pay_code`,`price_actual`,`price_refund`,`price_express`,`price_coupon`,`store_price_coupon`,`price_voucher`,`status`,`ucoupon_id`,`store_coupon_id`,`pay_type`,`device_from`,`source`,`order_source`,`referrer_user_id`,`version`,`is_member`,`order_type`,`write_off_code`,`pay_countdown_minute`,`ip_address`,`market_id`,`market_type`,`created_at`,`mix_id`,`mix_code`) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
goblin.order.create.attr_insert=INSERT INTO goblin_order_attr (`order_attr_id`,`order_id`,`express_contacts`,`express_address`,`express_address_detail`,`express_phone`,`express_type`,`created_at`) VALUES (?,?,?,?,?,?,?,?) goblin.order.create.attr_insert=INSERT INTO goblin_order_attr (`order_attr_id`,`order_id`,`express_contacts`,`express_address`,`express_address_detail`,`express_phone`,`express_type`,`created_at`) VALUES (?,?,?,?,?,?,?,?)
goblin.order.create.sku_insert=INSERT INTO goblin_order_sku (`order_sku_id`,`order_id`,`spu_id`,`spu_name`,`spu_pic`,`sku_id`,`num`,`sku_price`,`sku_price_actual`,`sku_name`,`sku_no`,`sku_image`,`sku_specs`,`price_voucher`,`spu_erp_code`,`sku_erp_code`,`erp_type`,`erp_warehouse_no`,`erp_hosting`,`created_at`) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) goblin.order.create.sku_insert=INSERT INTO goblin_order_sku (`order_sku_id`,`order_id`,`spu_id`,`spu_name`,`spu_pic`,`sku_id`,`num`,`sku_price`,`sku_price_actual`,`sku_name`,`sku_no`,`sku_image`,`sku_specs`,`price_voucher`,`spu_erp_code`,`sku_erp_code`,`erp_type`,`erp_warehouse_no`,`erp_hosting`,`created_at`) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
goblin_order_sku_assoc.insert=INSERT INTO goblin_order_sku_assoc (order_sku_id,is_true_name,id_type,id_name,id_no,operator,created_at) VALUES (?,?,?,?,?,?,?) goblin_order_sku_assoc.insert=INSERT INTO goblin_order_sku_assoc (order_sku_id,is_true_name,id_type,id_name,id_no,operator,created_at) VALUES (?,?,?,?,?,?,?)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment