在订单妥投时发放奖励
This commit is contained in:
parent
9e8baf1baf
commit
11bea6afc0
@ -90,6 +90,9 @@ public class ApiConstants {
|
||||
public static final String get = "get";
|
||||
public static String NOT_SIGN_RECEIPT = "not_sign_receipt";
|
||||
public static String SIGN_RECEIPT = "sign_receipt";
|
||||
public static String SET_TOKEN = "setToken";
|
||||
|
||||
public static final String token_activity = "token_activity";
|
||||
|
||||
/**
|
||||
* 定时任务状态
|
||||
|
||||
@ -1,16 +1,16 @@
|
||||
package com.heyu.api.data.entity.vv;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import com.lz.mybatis.plugin.annotations.AS;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.Date;import java.util.Date;
|
||||
/**
|
||||
*活动
|
||||
* @author quyixiao
|
||||
* @since 2025-10-25
|
||||
* @since 2025-11-20
|
||||
*/
|
||||
|
||||
@Data
|
||||
@ -21,14 +21,14 @@ private static final long serialVersionUID = 1L;
|
||||
public final static String CLASS_NAME ="com.heyu.api.data.entity.vv.VvActivityEntity:";
|
||||
|
||||
public final static String all = CLASS_NAME + "*";
|
||||
public final static String id_ = CLASS_NAME + "id"; //
|
||||
public final static String is_delete = CLASS_NAME + "is_delete"; // 是否删除:0 否 1 删除
|
||||
public final static String create_time = CLASS_NAME + "create_time"; // 创建时间
|
||||
public final static String modify_time = CLASS_NAME + "modify_time"; // 修改时间
|
||||
public final static String activity_name = CLASS_NAME + "activity_name"; // 活动名称
|
||||
public final static String activity_award_count = CLASS_NAME + "activity_award_count"; // 活动奖励数次
|
||||
public final static String award_amount = CLASS_NAME + "award_amount"; // 奖励金额
|
||||
public final static String create_timestamp = CLASS_NAME + "create_timestamp"; // 创建时间戳
|
||||
public final static String id_ = CLASS_NAME + "id"; //
|
||||
public final static String is_delete = CLASS_NAME + "is_delete"; // 是否删除:0 否 1 删除
|
||||
public final static String create_time = CLASS_NAME + "create_time"; // 创建时间
|
||||
public final static String modify_time = CLASS_NAME + "modify_time"; // 修改时间
|
||||
public final static String activity_name = CLASS_NAME + "activity_name"; // 活动名称
|
||||
public final static String award_amount = CLASS_NAME + "award_amount"; // 奖励金额
|
||||
public final static String create_timestamp = CLASS_NAME + "create_timestamp"; // 创建时间戳
|
||||
public final static String discount_amount = CLASS_NAME + "discount_amount"; // 折扣金额
|
||||
//
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
@ -40,12 +40,12 @@ private static final long serialVersionUID = 1L;
|
||||
private Date modifyTime;
|
||||
//活动名称
|
||||
private String activityName;
|
||||
//活动奖励数次
|
||||
private Integer activityAwardCount;
|
||||
//奖励金额
|
||||
private BigDecimal awardAmount;
|
||||
//创建时间戳
|
||||
private Long createTimestamp;
|
||||
//折扣金额
|
||||
private BigDecimal discountAmount;
|
||||
/**
|
||||
*
|
||||
* @return
|
||||
@ -121,21 +121,6 @@ private static final long serialVersionUID = 1L;
|
||||
this.activityName = activityName;
|
||||
}
|
||||
|
||||
/**
|
||||
* 活动奖励数次
|
||||
* @return
|
||||
*/
|
||||
public Integer getActivityAwardCount() {
|
||||
return activityAwardCount;
|
||||
}
|
||||
/**
|
||||
* 活动奖励数次
|
||||
* @param activityAwardCount
|
||||
*/
|
||||
public void setActivityAwardCount(Integer activityAwardCount) {
|
||||
this.activityAwardCount = activityAwardCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* 奖励金额
|
||||
* @return
|
||||
@ -166,6 +151,21 @@ private static final long serialVersionUID = 1L;
|
||||
this.createTimestamp = createTimestamp;
|
||||
}
|
||||
|
||||
/**
|
||||
* 折扣金额
|
||||
* @return
|
||||
*/
|
||||
public BigDecimal getDiscountAmount() {
|
||||
return discountAmount;
|
||||
}
|
||||
/**
|
||||
* 折扣金额
|
||||
* @param discountAmount
|
||||
*/
|
||||
public void setDiscountAmount(BigDecimal discountAmount) {
|
||||
this.discountAmount = discountAmount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "VvActivityEntity{" +
|
||||
@ -174,9 +174,9 @@ private static final long serialVersionUID = 1L;
|
||||
",createTime=" + createTime +
|
||||
",modifyTime=" + modifyTime +
|
||||
",activityName=" + activityName +
|
||||
",activityAwardCount=" + activityAwardCount +
|
||||
",awardAmount=" + awardAmount +
|
||||
",createTimestamp=" + createTimestamp +
|
||||
",discountAmount=" + discountAmount +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
@ -10,7 +10,7 @@ import java.util.Date;import java.util.Date;
|
||||
/**
|
||||
*购物车
|
||||
* @author quyixiao
|
||||
* @since 2025-11-17
|
||||
* @since 2025-11-20
|
||||
*/
|
||||
|
||||
@Data
|
||||
@ -25,29 +25,34 @@ private static final long serialVersionUID = 1L;
|
||||
public final static String is_delete = CLASS_NAME + "is_delete"; // 是否删除:0 否 1 删除
|
||||
public final static String create_time = CLASS_NAME + "create_time"; // 创建时间
|
||||
public final static String modify_time = CLASS_NAME + "modify_time"; // 修改时间
|
||||
public final static String sale_price = CLASS_NAME + "sale_price"; // 单价
|
||||
public final static String create_timestamp = CLASS_NAME + "create_timestamp"; // 创建时间
|
||||
public final static String modify_timestamp = CLASS_NAME + "modify_timestamp"; // 修改时间
|
||||
public final static String num_ = CLASS_NAME + "num"; // 数量
|
||||
public final static String status_ = CLASS_NAME + "status"; // create:订单创建,wait_pay:待支付,支付完成,待发货:wait_shipping,买家申请取消订单:apply_cancel, 买家关闭订单:close,已发货,运送中:shipping,已投递,比如入到快递柜:shipped,同意签收:agree_sign_receipt,拒绝签收:reject_sign_receipt,包裹返回:package_return,包裹卖家签收:package_seller_sign_receipt,已妥投:delivered,退款:refund,删除:delete
|
||||
public final static String sale_price = CLASS_NAME + "sale_price"; // 单价
|
||||
public final static String trade_order_id = CLASS_NAME + "trade_order_id"; // 订单号
|
||||
public final static String refund_amount = CLASS_NAME + "refund_amount"; // 退款金额
|
||||
public final static String track_number = CLASS_NAME + "track_number"; // 包裹追踪号
|
||||
public final static String refund_amount = CLASS_NAME + "refund_amount"; // 退款金额
|
||||
public final static String refund_count = CLASS_NAME + "refund_count"; // 退货数量
|
||||
public final static String product_id = CLASS_NAME + "product_id"; // 商品id
|
||||
public final static String product_name = CLASS_NAME + "product_name"; // 商品名称
|
||||
public final static String sku_info = CLASS_NAME + "sku_info"; // sku信息json
|
||||
public final static String product_main_image_url = CLASS_NAME + "product_main_image_url"; // 商品主图
|
||||
public final static String sku_id = CLASS_NAME + "sku_id"; // skuid
|
||||
public final static String sku_image_url = CLASS_NAME + "sku_image_url"; // sku图片
|
||||
public final static String sku_id = CLASS_NAME + "sku_id"; // skuid
|
||||
public final static String comment_id = CLASS_NAME + "comment_id"; // 评论 id
|
||||
public final static String delivered_type = CLASS_NAME + "delivered_type"; // 1 买家手动确认收货, 2 系统自动确认收货
|
||||
public final static String settle_status = CLASS_NAME + "settle_status"; // 0 未结算,1 已经结算
|
||||
public final static String gmt_settle = CLASS_NAME + "gmt_settle"; // 结算时间
|
||||
public final static String seller_id = CLASS_NAME + "seller_id"; // 卖家id
|
||||
public final static String status_ = CLASS_NAME + "status"; // create:订单创建,wait_pay:待支付,支付完成,待发货:wait_shipping,买家申请取消订单:apply_cancel, 买家关闭订单:close,已发货,运送中:shipping,已投递,比如入到快递柜:shipped,同意签收:agree_sign_receipt,拒绝签收:reject_sign_receipt,包裹返回:package_return,包裹卖家签收:package_seller_sign_receipt,已妥投:delivered,退款:refund,删除:delete
|
||||
public final static String settle_status = CLASS_NAME + "settle_status"; // 0 未结算,1 已经结算
|
||||
public final static String reverse_status = CLASS_NAME + "reverse_status"; // 逆向状态。
|
||||
public final static String seller_id = CLASS_NAME + "seller_id"; // 卖家id
|
||||
public final static String origin_price = CLASS_NAME + "origin_price"; // 成本价格
|
||||
public final static String profit_amount = CLASS_NAME + "profit_amount"; // 这笔子单获得利益
|
||||
public final static String origin_price = CLASS_NAME + "origin_price"; // 原来价格
|
||||
public final static String create_timestamp = CLASS_NAME + "create_timestamp"; // 创建时间
|
||||
public final static String modify_timestamp = CLASS_NAME + "modify_timestamp"; // 修改时间
|
||||
public final static String promotion_price = CLASS_NAME + "promotion_price"; // 当时促销价
|
||||
public final static String shipping_amount = CLASS_NAME + "shipping_amount"; // 运费
|
||||
public final static String award_amount = CLASS_NAME + "award_amount"; // 奖励金额
|
||||
public final static String pay_amount = CLASS_NAME + "pay_amount"; // 实付金额
|
||||
public final static String discount_amount = CLASS_NAME + "discount_amount"; // 优惠金额
|
||||
public final static String buyer_id = CLASS_NAME + "buyer_id"; // 订单id
|
||||
public final static String buyer_phone = CLASS_NAME + "buyer_phone"; // 买家手机号
|
||||
public final static String buyer_name = CLASS_NAME + "buyer_name"; // 买家名称
|
||||
@ -59,15 +64,10 @@ private static final long serialVersionUID = 1L;
|
||||
public final static String buyer_detail_address = CLASS_NAME + "buyer_detail_address"; // 买家详细地址
|
||||
public final static String seller_name = CLASS_NAME + "seller_name"; // 卖家名称
|
||||
public final static String batch_num = CLASS_NAME + "batch_num"; // 批次数量
|
||||
public final static String shipping_amount = CLASS_NAME + "shipping_amount"; // 运费
|
||||
public final static String promotion_price = CLASS_NAME + "promotion_price"; // 当时促销价
|
||||
public final static String state_ = CLASS_NAME + "state"; // 快递单当前状态,默认为0在途,1揽收,2疑难,3签收,4退签,5派件,8清关,14拒签等10个基础物流状态,如需要返回高级物流状态,请参考 resultv2 传值
|
||||
public final static String app_name = CLASS_NAME + "app_name"; // goudezhao
|
||||
public final static String channel_ = CLASS_NAME + "channel"; // 渠道来源,如抖音,等
|
||||
public final static String promoter_id = CLASS_NAME + "promoter_id"; // 推广者id
|
||||
public final static String award_amount = CLASS_NAME + "award_amount"; // 奖励金额
|
||||
public final static String activity_id = CLASS_NAME + "activity_id"; // 活动id
|
||||
public final static String activity_award_count = CLASS_NAME + "activity_award_count"; // 这次活动的奖励次数
|
||||
public final static String transaction_id = CLASS_NAME + "transaction_id"; // 支付事务id
|
||||
public final static String pay_type = CLASS_NAME + "pay_type"; // 支付方式,weixin
|
||||
public final static String prepay_id = CLASS_NAME + "prepay_id"; // 预支付id
|
||||
@ -77,23 +77,23 @@ private static final long serialVersionUID = 1L;
|
||||
public final static String gmt_pay = CLASS_NAME + "gmt_pay"; // 支付时间
|
||||
public final static String gmt_cancel = CLASS_NAME + "gmt_cancel"; // 订单取消时间
|
||||
public final static String cancel_user = CLASS_NAME + "cancel_user"; // 订单取消用户
|
||||
public final static String cancel_reason = CLASS_NAME + "cancel_reason"; // 取消原因
|
||||
public final static String gmt_to_shipping = CLASS_NAME + "gmt_to_shipping"; // 打包时间
|
||||
public final static String shipping_user = CLASS_NAME + "shipping_user"; // shipping的用户
|
||||
public final static String cancel_reason = CLASS_NAME + "cancel_reason"; // 取消原因
|
||||
public final static String shipped_user = CLASS_NAME + "shipped_user"; // shipped的用户
|
||||
public final static String gmt_delivered = CLASS_NAME + "gmt_delivered"; // 妥投时间
|
||||
public final static String delivered_user = CLASS_NAME + "delivered_user"; // delivered的用户
|
||||
public final static String gmt_close = CLASS_NAME + "gmt_close"; // 订单关闭时间
|
||||
public final static String close_user = CLASS_NAME + "close_user"; // 关闭订单的用户
|
||||
public final static String close_reason = CLASS_NAME + "close_reason"; // 关闭原因
|
||||
public final static String gmt_un_shipping = CLASS_NAME + "gmt_un_shipping"; // 重新打包的时间
|
||||
public final static String un_shipping_user = CLASS_NAME + "un_shipping_user"; // 不打包用户
|
||||
public final static String gmt_shipped = CLASS_NAME + "gmt_shipped"; // 是否已经签收
|
||||
public final static String un_shipping_reason = CLASS_NAME + "un_shipping_reason"; // 发货回退原因
|
||||
public final static String gmt_shipped = CLASS_NAME + "gmt_shipped"; // 是否已经签收
|
||||
public final static String shipped_user = CLASS_NAME + "shipped_user"; // shipped的用户
|
||||
public final static String gmt_reject_sign_receipt = CLASS_NAME + "gmt_reject_sign_receipt"; // 拒绝签收时间
|
||||
public final static String reject_sign_receipt_reason = CLASS_NAME + "reject_sign_receipt_reason"; // 拒绝签收原因
|
||||
public final static String reject_sign_receipt_features = CLASS_NAME + "reject_sign_receipt_features"; // 拒绝签收的信息
|
||||
public final static String close_reason = CLASS_NAME + "close_reason"; // 关闭原因
|
||||
public final static String pay_amount = CLASS_NAME + "pay_amount"; // 实付金额
|
||||
public final static String activity_info = CLASS_NAME + "activity_info"; // 活动信息
|
||||
//
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
@ -103,18 +103,20 @@ private static final long serialVersionUID = 1L;
|
||||
private Date createTime;
|
||||
//修改时间
|
||||
private Date modifyTime;
|
||||
//单价
|
||||
private BigDecimal salePrice;
|
||||
//创建时间
|
||||
private Long createTimestamp;
|
||||
//修改时间
|
||||
private Long modifyTimestamp;
|
||||
//数量
|
||||
private Integer num;
|
||||
//create:订单创建,wait_pay:待支付,支付完成,待发货:wait_shipping,买家申请取消订单:apply_cancel, 买家关闭订单:close,已发货,运送中:shipping,已投递,比如入到快递柜:shipped,同意签收:agree_sign_receipt,拒绝签收:reject_sign_receipt,包裹返回:package_return,包裹卖家签收:package_seller_sign_receipt,已妥投:delivered,退款:refund,删除:delete
|
||||
private String status;
|
||||
//单价
|
||||
private BigDecimal salePrice;
|
||||
//订单号
|
||||
private Long tradeOrderId;
|
||||
//退款金额
|
||||
private BigDecimal refundAmount;
|
||||
//包裹追踪号
|
||||
private String trackNumber;
|
||||
//退款金额
|
||||
private BigDecimal refundAmount;
|
||||
//退货数量
|
||||
private Integer refundCount;
|
||||
//商品id
|
||||
@ -125,30 +127,38 @@ private static final long serialVersionUID = 1L;
|
||||
private String skuInfo;
|
||||
//商品主图
|
||||
private String productMainImageUrl;
|
||||
//skuid
|
||||
private Long skuId;
|
||||
//sku图片
|
||||
private String skuImageUrl;
|
||||
//skuid
|
||||
private Long skuId;
|
||||
//评论 id
|
||||
private Long commentId;
|
||||
//1 买家手动确认收货, 2 系统自动确认收货
|
||||
private Integer deliveredType;
|
||||
//0 未结算,1 已经结算
|
||||
private Integer settleStatus;
|
||||
//结算时间
|
||||
private Date gmtSettle;
|
||||
//卖家id
|
||||
private Long sellerId;
|
||||
//create:订单创建,wait_pay:待支付,支付完成,待发货:wait_shipping,买家申请取消订单:apply_cancel, 买家关闭订单:close,已发货,运送中:shipping,已投递,比如入到快递柜:shipped,同意签收:agree_sign_receipt,拒绝签收:reject_sign_receipt,包裹返回:package_return,包裹卖家签收:package_seller_sign_receipt,已妥投:delivered,退款:refund,删除:delete
|
||||
private String status;
|
||||
//0 未结算,1 已经结算
|
||||
private Integer settleStatus;
|
||||
//逆向状态。
|
||||
private String reverseStatus;
|
||||
//卖家id
|
||||
private Long sellerId;
|
||||
//成本价格
|
||||
private BigDecimal originPrice;
|
||||
//这笔子单获得利益
|
||||
private BigDecimal profitAmount;
|
||||
//原来价格
|
||||
private BigDecimal originPrice;
|
||||
//创建时间
|
||||
private Long createTimestamp;
|
||||
//修改时间
|
||||
private Long modifyTimestamp;
|
||||
//当时促销价
|
||||
private BigDecimal promotionPrice;
|
||||
//运费
|
||||
private BigDecimal shippingAmount;
|
||||
//奖励金额
|
||||
private BigDecimal awardAmount;
|
||||
//实付金额
|
||||
private BigDecimal payAmount;
|
||||
//优惠金额
|
||||
private BigDecimal discountAmount;
|
||||
//订单id
|
||||
private Long buyerId;
|
||||
//买家手机号
|
||||
@ -171,10 +181,6 @@ private static final long serialVersionUID = 1L;
|
||||
private String sellerName;
|
||||
//批次数量
|
||||
private Integer batchNum;
|
||||
//运费
|
||||
private BigDecimal shippingAmount;
|
||||
//当时促销价
|
||||
private BigDecimal promotionPrice;
|
||||
//快递单当前状态,默认为0在途,1揽收,2疑难,3签收,4退签,5派件,8清关,14拒签等10个基础物流状态,如需要返回高级物流状态,请参考 resultv2 传值
|
||||
private String state;
|
||||
//goudezhao
|
||||
@ -183,12 +189,6 @@ private static final long serialVersionUID = 1L;
|
||||
private String channel;
|
||||
//推广者id
|
||||
private String promoterId;
|
||||
//奖励金额
|
||||
private BigDecimal awardAmount;
|
||||
//活动id
|
||||
private Long activityId;
|
||||
//这次活动的奖励次数
|
||||
private Integer activityAwardCount;
|
||||
//支付事务id
|
||||
private String transactionId;
|
||||
//支付方式,weixin
|
||||
@ -207,14 +207,12 @@ private static final long serialVersionUID = 1L;
|
||||
private Date gmtCancel;
|
||||
//订单取消用户
|
||||
private String cancelUser;
|
||||
//取消原因
|
||||
private String cancelReason;
|
||||
//打包时间
|
||||
private Date gmtToShipping;
|
||||
//shipping的用户
|
||||
private String shippingUser;
|
||||
//取消原因
|
||||
private String cancelReason;
|
||||
//shipped的用户
|
||||
private String shippedUser;
|
||||
//妥投时间
|
||||
private Date gmtDelivered;
|
||||
//delivered的用户
|
||||
@ -223,24 +221,26 @@ private static final long serialVersionUID = 1L;
|
||||
private Date gmtClose;
|
||||
//关闭订单的用户
|
||||
private String closeUser;
|
||||
//关闭原因
|
||||
private String closeReason;
|
||||
//重新打包的时间
|
||||
private Date gmtUnShipping;
|
||||
//不打包用户
|
||||
private String unShippingUser;
|
||||
//是否已经签收
|
||||
private Date gmtShipped;
|
||||
//发货回退原因
|
||||
private String unShippingReason;
|
||||
//是否已经签收
|
||||
private Date gmtShipped;
|
||||
//shipped的用户
|
||||
private String shippedUser;
|
||||
//拒绝签收时间
|
||||
private Date gmtRejectSignReceipt;
|
||||
//拒绝签收原因
|
||||
private String rejectSignReceiptReason;
|
||||
//拒绝签收的信息
|
||||
private String rejectSignReceiptFeatures;
|
||||
//关闭原因
|
||||
private String closeReason;
|
||||
//实付金额
|
||||
private BigDecimal payAmount;
|
||||
//活动信息
|
||||
private String activityInfo;
|
||||
/**
|
||||
*
|
||||
* @return
|
||||
@ -302,18 +302,33 @@ private static final long serialVersionUID = 1L;
|
||||
}
|
||||
|
||||
/**
|
||||
* 单价
|
||||
* 创建时间
|
||||
* @return
|
||||
*/
|
||||
public BigDecimal getSalePrice() {
|
||||
return salePrice;
|
||||
public Long getCreateTimestamp() {
|
||||
return createTimestamp;
|
||||
}
|
||||
/**
|
||||
* 单价
|
||||
* @param salePrice
|
||||
* 创建时间
|
||||
* @param createTimestamp
|
||||
*/
|
||||
public void setSalePrice(BigDecimal salePrice) {
|
||||
this.salePrice = salePrice;
|
||||
public void setCreateTimestamp(Long createTimestamp) {
|
||||
this.createTimestamp = createTimestamp;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
* @return
|
||||
*/
|
||||
public Long getModifyTimestamp() {
|
||||
return modifyTimestamp;
|
||||
}
|
||||
/**
|
||||
* 修改时间
|
||||
* @param modifyTimestamp
|
||||
*/
|
||||
public void setModifyTimestamp(Long modifyTimestamp) {
|
||||
this.modifyTimestamp = modifyTimestamp;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -332,18 +347,18 @@ private static final long serialVersionUID = 1L;
|
||||
}
|
||||
|
||||
/**
|
||||
* create:订单创建,wait_pay:待支付,支付完成,待发货:wait_shipping,买家申请取消订单:apply_cancel, 买家关闭订单:close,已发货,运送中:shipping,已投递,比如入到快递柜:shipped,同意签收:agree_sign_receipt,拒绝签收:reject_sign_receipt,包裹返回:package_return,包裹卖家签收:package_seller_sign_receipt,已妥投:delivered,退款:refund,删除:delete
|
||||
* 单价
|
||||
* @return
|
||||
*/
|
||||
public String getStatus() {
|
||||
return status;
|
||||
public BigDecimal getSalePrice() {
|
||||
return salePrice;
|
||||
}
|
||||
/**
|
||||
* create:订单创建,wait_pay:待支付,支付完成,待发货:wait_shipping,买家申请取消订单:apply_cancel, 买家关闭订单:close,已发货,运送中:shipping,已投递,比如入到快递柜:shipped,同意签收:agree_sign_receipt,拒绝签收:reject_sign_receipt,包裹返回:package_return,包裹卖家签收:package_seller_sign_receipt,已妥投:delivered,退款:refund,删除:delete
|
||||
* @param status
|
||||
* 单价
|
||||
* @param salePrice
|
||||
*/
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
public void setSalePrice(BigDecimal salePrice) {
|
||||
this.salePrice = salePrice;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -361,21 +376,6 @@ private static final long serialVersionUID = 1L;
|
||||
this.tradeOrderId = tradeOrderId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 退款金额
|
||||
* @return
|
||||
*/
|
||||
public BigDecimal getRefundAmount() {
|
||||
return refundAmount;
|
||||
}
|
||||
/**
|
||||
* 退款金额
|
||||
* @param refundAmount
|
||||
*/
|
||||
public void setRefundAmount(BigDecimal refundAmount) {
|
||||
this.refundAmount = refundAmount;
|
||||
}
|
||||
|
||||
/**
|
||||
* 包裹追踪号
|
||||
* @return
|
||||
@ -391,6 +391,21 @@ private static final long serialVersionUID = 1L;
|
||||
this.trackNumber = trackNumber;
|
||||
}
|
||||
|
||||
/**
|
||||
* 退款金额
|
||||
* @return
|
||||
*/
|
||||
public BigDecimal getRefundAmount() {
|
||||
return refundAmount;
|
||||
}
|
||||
/**
|
||||
* 退款金额
|
||||
* @param refundAmount
|
||||
*/
|
||||
public void setRefundAmount(BigDecimal refundAmount) {
|
||||
this.refundAmount = refundAmount;
|
||||
}
|
||||
|
||||
/**
|
||||
* 退货数量
|
||||
* @return
|
||||
@ -466,21 +481,6 @@ private static final long serialVersionUID = 1L;
|
||||
this.productMainImageUrl = productMainImageUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* skuid
|
||||
* @return
|
||||
*/
|
||||
public Long getSkuId() {
|
||||
return skuId;
|
||||
}
|
||||
/**
|
||||
* skuid
|
||||
* @param skuId
|
||||
*/
|
||||
public void setSkuId(Long skuId) {
|
||||
this.skuId = skuId;
|
||||
}
|
||||
|
||||
/**
|
||||
* sku图片
|
||||
* @return
|
||||
@ -496,6 +496,21 @@ private static final long serialVersionUID = 1L;
|
||||
this.skuImageUrl = skuImageUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* skuid
|
||||
* @return
|
||||
*/
|
||||
public Long getSkuId() {
|
||||
return skuId;
|
||||
}
|
||||
/**
|
||||
* skuid
|
||||
* @param skuId
|
||||
*/
|
||||
public void setSkuId(Long skuId) {
|
||||
this.skuId = skuId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 评论 id
|
||||
* @return
|
||||
@ -526,21 +541,6 @@ private static final long serialVersionUID = 1L;
|
||||
this.deliveredType = deliveredType;
|
||||
}
|
||||
|
||||
/**
|
||||
* 0 未结算,1 已经结算
|
||||
* @return
|
||||
*/
|
||||
public Integer getSettleStatus() {
|
||||
return settleStatus;
|
||||
}
|
||||
/**
|
||||
* 0 未结算,1 已经结算
|
||||
* @param settleStatus
|
||||
*/
|
||||
public void setSettleStatus(Integer settleStatus) {
|
||||
this.settleStatus = settleStatus;
|
||||
}
|
||||
|
||||
/**
|
||||
* 结算时间
|
||||
* @return
|
||||
@ -557,18 +557,33 @@ private static final long serialVersionUID = 1L;
|
||||
}
|
||||
|
||||
/**
|
||||
* 卖家id
|
||||
* create:订单创建,wait_pay:待支付,支付完成,待发货:wait_shipping,买家申请取消订单:apply_cancel, 买家关闭订单:close,已发货,运送中:shipping,已投递,比如入到快递柜:shipped,同意签收:agree_sign_receipt,拒绝签收:reject_sign_receipt,包裹返回:package_return,包裹卖家签收:package_seller_sign_receipt,已妥投:delivered,退款:refund,删除:delete
|
||||
* @return
|
||||
*/
|
||||
public Long getSellerId() {
|
||||
return sellerId;
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
/**
|
||||
* 卖家id
|
||||
* @param sellerId
|
||||
* create:订单创建,wait_pay:待支付,支付完成,待发货:wait_shipping,买家申请取消订单:apply_cancel, 买家关闭订单:close,已发货,运送中:shipping,已投递,比如入到快递柜:shipped,同意签收:agree_sign_receipt,拒绝签收:reject_sign_receipt,包裹返回:package_return,包裹卖家签收:package_seller_sign_receipt,已妥投:delivered,退款:refund,删除:delete
|
||||
* @param status
|
||||
*/
|
||||
public void setSellerId(Long sellerId) {
|
||||
this.sellerId = sellerId;
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
/**
|
||||
* 0 未结算,1 已经结算
|
||||
* @return
|
||||
*/
|
||||
public Integer getSettleStatus() {
|
||||
return settleStatus;
|
||||
}
|
||||
/**
|
||||
* 0 未结算,1 已经结算
|
||||
* @param settleStatus
|
||||
*/
|
||||
public void setSettleStatus(Integer settleStatus) {
|
||||
this.settleStatus = settleStatus;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -586,6 +601,36 @@ private static final long serialVersionUID = 1L;
|
||||
this.reverseStatus = reverseStatus;
|
||||
}
|
||||
|
||||
/**
|
||||
* 卖家id
|
||||
* @return
|
||||
*/
|
||||
public Long getSellerId() {
|
||||
return sellerId;
|
||||
}
|
||||
/**
|
||||
* 卖家id
|
||||
* @param sellerId
|
||||
*/
|
||||
public void setSellerId(Long sellerId) {
|
||||
this.sellerId = sellerId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 成本价格
|
||||
* @return
|
||||
*/
|
||||
public BigDecimal getOriginPrice() {
|
||||
return originPrice;
|
||||
}
|
||||
/**
|
||||
* 成本价格
|
||||
* @param originPrice
|
||||
*/
|
||||
public void setOriginPrice(BigDecimal originPrice) {
|
||||
this.originPrice = originPrice;
|
||||
}
|
||||
|
||||
/**
|
||||
* 这笔子单获得利益
|
||||
* @return
|
||||
@ -602,48 +647,78 @@ private static final long serialVersionUID = 1L;
|
||||
}
|
||||
|
||||
/**
|
||||
* 原来价格
|
||||
* 当时促销价
|
||||
* @return
|
||||
*/
|
||||
public BigDecimal getOriginPrice() {
|
||||
return originPrice;
|
||||
public BigDecimal getPromotionPrice() {
|
||||
return promotionPrice;
|
||||
}
|
||||
/**
|
||||
* 原来价格
|
||||
* @param originPrice
|
||||
* 当时促销价
|
||||
* @param promotionPrice
|
||||
*/
|
||||
public void setOriginPrice(BigDecimal originPrice) {
|
||||
this.originPrice = originPrice;
|
||||
public void setPromotionPrice(BigDecimal promotionPrice) {
|
||||
this.promotionPrice = promotionPrice;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
* 运费
|
||||
* @return
|
||||
*/
|
||||
public Long getCreateTimestamp() {
|
||||
return createTimestamp;
|
||||
public BigDecimal getShippingAmount() {
|
||||
return shippingAmount;
|
||||
}
|
||||
/**
|
||||
* 创建时间
|
||||
* @param createTimestamp
|
||||
* 运费
|
||||
* @param shippingAmount
|
||||
*/
|
||||
public void setCreateTimestamp(Long createTimestamp) {
|
||||
this.createTimestamp = createTimestamp;
|
||||
public void setShippingAmount(BigDecimal shippingAmount) {
|
||||
this.shippingAmount = shippingAmount;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
* 奖励金额
|
||||
* @return
|
||||
*/
|
||||
public Long getModifyTimestamp() {
|
||||
return modifyTimestamp;
|
||||
public BigDecimal getAwardAmount() {
|
||||
return awardAmount;
|
||||
}
|
||||
/**
|
||||
* 修改时间
|
||||
* @param modifyTimestamp
|
||||
* 奖励金额
|
||||
* @param awardAmount
|
||||
*/
|
||||
public void setModifyTimestamp(Long modifyTimestamp) {
|
||||
this.modifyTimestamp = modifyTimestamp;
|
||||
public void setAwardAmount(BigDecimal awardAmount) {
|
||||
this.awardAmount = awardAmount;
|
||||
}
|
||||
|
||||
/**
|
||||
* 实付金额
|
||||
* @return
|
||||
*/
|
||||
public BigDecimal getPayAmount() {
|
||||
return payAmount;
|
||||
}
|
||||
/**
|
||||
* 实付金额
|
||||
* @param payAmount
|
||||
*/
|
||||
public void setPayAmount(BigDecimal payAmount) {
|
||||
this.payAmount = payAmount;
|
||||
}
|
||||
|
||||
/**
|
||||
* 优惠金额
|
||||
* @return
|
||||
*/
|
||||
public BigDecimal getDiscountAmount() {
|
||||
return discountAmount;
|
||||
}
|
||||
/**
|
||||
* 优惠金额
|
||||
* @param discountAmount
|
||||
*/
|
||||
public void setDiscountAmount(BigDecimal discountAmount) {
|
||||
this.discountAmount = discountAmount;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -811,36 +886,6 @@ private static final long serialVersionUID = 1L;
|
||||
this.batchNum = batchNum;
|
||||
}
|
||||
|
||||
/**
|
||||
* 运费
|
||||
* @return
|
||||
*/
|
||||
public BigDecimal getShippingAmount() {
|
||||
return shippingAmount;
|
||||
}
|
||||
/**
|
||||
* 运费
|
||||
* @param shippingAmount
|
||||
*/
|
||||
public void setShippingAmount(BigDecimal shippingAmount) {
|
||||
this.shippingAmount = shippingAmount;
|
||||
}
|
||||
|
||||
/**
|
||||
* 当时促销价
|
||||
* @return
|
||||
*/
|
||||
public BigDecimal getPromotionPrice() {
|
||||
return promotionPrice;
|
||||
}
|
||||
/**
|
||||
* 当时促销价
|
||||
* @param promotionPrice
|
||||
*/
|
||||
public void setPromotionPrice(BigDecimal promotionPrice) {
|
||||
this.promotionPrice = promotionPrice;
|
||||
}
|
||||
|
||||
/**
|
||||
* 快递单当前状态,默认为0在途,1揽收,2疑难,3签收,4退签,5派件,8清关,14拒签等10个基础物流状态,如需要返回高级物流状态,请参考 resultv2 传值
|
||||
* @return
|
||||
@ -901,51 +946,6 @@ private static final long serialVersionUID = 1L;
|
||||
this.promoterId = promoterId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 奖励金额
|
||||
* @return
|
||||
*/
|
||||
public BigDecimal getAwardAmount() {
|
||||
return awardAmount;
|
||||
}
|
||||
/**
|
||||
* 奖励金额
|
||||
* @param awardAmount
|
||||
*/
|
||||
public void setAwardAmount(BigDecimal awardAmount) {
|
||||
this.awardAmount = awardAmount;
|
||||
}
|
||||
|
||||
/**
|
||||
* 活动id
|
||||
* @return
|
||||
*/
|
||||
public Long getActivityId() {
|
||||
return activityId;
|
||||
}
|
||||
/**
|
||||
* 活动id
|
||||
* @param activityId
|
||||
*/
|
||||
public void setActivityId(Long activityId) {
|
||||
this.activityId = activityId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 这次活动的奖励次数
|
||||
* @return
|
||||
*/
|
||||
public Integer getActivityAwardCount() {
|
||||
return activityAwardCount;
|
||||
}
|
||||
/**
|
||||
* 这次活动的奖励次数
|
||||
* @param activityAwardCount
|
||||
*/
|
||||
public void setActivityAwardCount(Integer activityAwardCount) {
|
||||
this.activityAwardCount = activityAwardCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* 支付事务id
|
||||
* @return
|
||||
@ -1081,6 +1081,21 @@ private static final long serialVersionUID = 1L;
|
||||
this.cancelUser = cancelUser;
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消原因
|
||||
* @return
|
||||
*/
|
||||
public String getCancelReason() {
|
||||
return cancelReason;
|
||||
}
|
||||
/**
|
||||
* 取消原因
|
||||
* @param cancelReason
|
||||
*/
|
||||
public void setCancelReason(String cancelReason) {
|
||||
this.cancelReason = cancelReason;
|
||||
}
|
||||
|
||||
/**
|
||||
* 打包时间
|
||||
* @return
|
||||
@ -1111,36 +1126,6 @@ private static final long serialVersionUID = 1L;
|
||||
this.shippingUser = shippingUser;
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消原因
|
||||
* @return
|
||||
*/
|
||||
public String getCancelReason() {
|
||||
return cancelReason;
|
||||
}
|
||||
/**
|
||||
* 取消原因
|
||||
* @param cancelReason
|
||||
*/
|
||||
public void setCancelReason(String cancelReason) {
|
||||
this.cancelReason = cancelReason;
|
||||
}
|
||||
|
||||
/**
|
||||
* shipped的用户
|
||||
* @return
|
||||
*/
|
||||
public String getShippedUser() {
|
||||
return shippedUser;
|
||||
}
|
||||
/**
|
||||
* shipped的用户
|
||||
* @param shippedUser
|
||||
*/
|
||||
public void setShippedUser(String shippedUser) {
|
||||
this.shippedUser = shippedUser;
|
||||
}
|
||||
|
||||
/**
|
||||
* 妥投时间
|
||||
* @return
|
||||
@ -1201,6 +1186,21 @@ private static final long serialVersionUID = 1L;
|
||||
this.closeUser = closeUser;
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭原因
|
||||
* @return
|
||||
*/
|
||||
public String getCloseReason() {
|
||||
return closeReason;
|
||||
}
|
||||
/**
|
||||
* 关闭原因
|
||||
* @param closeReason
|
||||
*/
|
||||
public void setCloseReason(String closeReason) {
|
||||
this.closeReason = closeReason;
|
||||
}
|
||||
|
||||
/**
|
||||
* 重新打包的时间
|
||||
* @return
|
||||
@ -1231,6 +1231,21 @@ private static final long serialVersionUID = 1L;
|
||||
this.unShippingUser = unShippingUser;
|
||||
}
|
||||
|
||||
/**
|
||||
* 发货回退原因
|
||||
* @return
|
||||
*/
|
||||
public String getUnShippingReason() {
|
||||
return unShippingReason;
|
||||
}
|
||||
/**
|
||||
* 发货回退原因
|
||||
* @param unShippingReason
|
||||
*/
|
||||
public void setUnShippingReason(String unShippingReason) {
|
||||
this.unShippingReason = unShippingReason;
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否已经签收
|
||||
* @return
|
||||
@ -1247,18 +1262,18 @@ private static final long serialVersionUID = 1L;
|
||||
}
|
||||
|
||||
/**
|
||||
* 发货回退原因
|
||||
* shipped的用户
|
||||
* @return
|
||||
*/
|
||||
public String getUnShippingReason() {
|
||||
return unShippingReason;
|
||||
public String getShippedUser() {
|
||||
return shippedUser;
|
||||
}
|
||||
/**
|
||||
* 发货回退原因
|
||||
* @param unShippingReason
|
||||
* shipped的用户
|
||||
* @param shippedUser
|
||||
*/
|
||||
public void setUnShippingReason(String unShippingReason) {
|
||||
this.unShippingReason = unShippingReason;
|
||||
public void setShippedUser(String shippedUser) {
|
||||
this.shippedUser = shippedUser;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1307,33 +1322,18 @@ private static final long serialVersionUID = 1L;
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭原因
|
||||
* 活动信息
|
||||
* @return
|
||||
*/
|
||||
public String getCloseReason() {
|
||||
return closeReason;
|
||||
public String getActivityInfo() {
|
||||
return activityInfo;
|
||||
}
|
||||
/**
|
||||
* 关闭原因
|
||||
* @param closeReason
|
||||
* 活动信息
|
||||
* @param activityInfo
|
||||
*/
|
||||
public void setCloseReason(String closeReason) {
|
||||
this.closeReason = closeReason;
|
||||
}
|
||||
|
||||
/**
|
||||
* 实付金额
|
||||
* @return
|
||||
*/
|
||||
public BigDecimal getPayAmount() {
|
||||
return payAmount;
|
||||
}
|
||||
/**
|
||||
* 实付金额
|
||||
* @param payAmount
|
||||
*/
|
||||
public void setPayAmount(BigDecimal payAmount) {
|
||||
this.payAmount = payAmount;
|
||||
public void setActivityInfo(String activityInfo) {
|
||||
this.activityInfo = activityInfo;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -1343,29 +1343,34 @@ private static final long serialVersionUID = 1L;
|
||||
",isDelete=" + isDelete +
|
||||
",createTime=" + createTime +
|
||||
",modifyTime=" + modifyTime +
|
||||
",salePrice=" + salePrice +
|
||||
",createTimestamp=" + createTimestamp +
|
||||
",modifyTimestamp=" + modifyTimestamp +
|
||||
",num=" + num +
|
||||
",status=" + status +
|
||||
",salePrice=" + salePrice +
|
||||
",tradeOrderId=" + tradeOrderId +
|
||||
",refundAmount=" + refundAmount +
|
||||
",trackNumber=" + trackNumber +
|
||||
",refundAmount=" + refundAmount +
|
||||
",refundCount=" + refundCount +
|
||||
",productId=" + productId +
|
||||
",productName=" + productName +
|
||||
",skuInfo=" + skuInfo +
|
||||
",productMainImageUrl=" + productMainImageUrl +
|
||||
",skuId=" + skuId +
|
||||
",skuImageUrl=" + skuImageUrl +
|
||||
",skuId=" + skuId +
|
||||
",commentId=" + commentId +
|
||||
",deliveredType=" + deliveredType +
|
||||
",settleStatus=" + settleStatus +
|
||||
",gmtSettle=" + gmtSettle +
|
||||
",sellerId=" + sellerId +
|
||||
",status=" + status +
|
||||
",settleStatus=" + settleStatus +
|
||||
",reverseStatus=" + reverseStatus +
|
||||
",profitAmount=" + profitAmount +
|
||||
",sellerId=" + sellerId +
|
||||
",originPrice=" + originPrice +
|
||||
",createTimestamp=" + createTimestamp +
|
||||
",modifyTimestamp=" + modifyTimestamp +
|
||||
",profitAmount=" + profitAmount +
|
||||
",promotionPrice=" + promotionPrice +
|
||||
",shippingAmount=" + shippingAmount +
|
||||
",awardAmount=" + awardAmount +
|
||||
",payAmount=" + payAmount +
|
||||
",discountAmount=" + discountAmount +
|
||||
",buyerId=" + buyerId +
|
||||
",buyerPhone=" + buyerPhone +
|
||||
",buyerName=" + buyerName +
|
||||
@ -1377,15 +1382,10 @@ private static final long serialVersionUID = 1L;
|
||||
",buyerDetailAddress=" + buyerDetailAddress +
|
||||
",sellerName=" + sellerName +
|
||||
",batchNum=" + batchNum +
|
||||
",shippingAmount=" + shippingAmount +
|
||||
",promotionPrice=" + promotionPrice +
|
||||
",state=" + state +
|
||||
",appName=" + appName +
|
||||
",channel=" + channel +
|
||||
",promoterId=" + promoterId +
|
||||
",awardAmount=" + awardAmount +
|
||||
",activityId=" + activityId +
|
||||
",activityAwardCount=" + activityAwardCount +
|
||||
",transactionId=" + transactionId +
|
||||
",payType=" + payType +
|
||||
",prepayId=" + prepayId +
|
||||
@ -1395,23 +1395,23 @@ private static final long serialVersionUID = 1L;
|
||||
",gmtPay=" + gmtPay +
|
||||
",gmtCancel=" + gmtCancel +
|
||||
",cancelUser=" + cancelUser +
|
||||
",cancelReason=" + cancelReason +
|
||||
",gmtToShipping=" + gmtToShipping +
|
||||
",shippingUser=" + shippingUser +
|
||||
",cancelReason=" + cancelReason +
|
||||
",shippedUser=" + shippedUser +
|
||||
",gmtDelivered=" + gmtDelivered +
|
||||
",deliveredUser=" + deliveredUser +
|
||||
",gmtClose=" + gmtClose +
|
||||
",closeUser=" + closeUser +
|
||||
",closeReason=" + closeReason +
|
||||
",gmtUnShipping=" + gmtUnShipping +
|
||||
",unShippingUser=" + unShippingUser +
|
||||
",gmtShipped=" + gmtShipped +
|
||||
",unShippingReason=" + unShippingReason +
|
||||
",gmtShipped=" + gmtShipped +
|
||||
",shippedUser=" + shippedUser +
|
||||
",gmtRejectSignReceipt=" + gmtRejectSignReceipt +
|
||||
",rejectSignReceiptReason=" + rejectSignReceiptReason +
|
||||
",rejectSignReceiptFeatures=" + rejectSignReceiptFeatures +
|
||||
",closeReason=" + closeReason +
|
||||
",payAmount=" + payAmount +
|
||||
",activityInfo=" + activityInfo +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
@ -7,12 +7,29 @@ import lombok.Data;
|
||||
public class AppBaseRequest {
|
||||
|
||||
|
||||
|
||||
/***
|
||||
* token
|
||||
*/
|
||||
private Integer pageNum = 1 ;
|
||||
|
||||
|
||||
/***
|
||||
* token
|
||||
*/
|
||||
private Integer pageSize = 10 ;
|
||||
|
||||
/***
|
||||
* token
|
||||
*/
|
||||
private String token;
|
||||
|
||||
public String getToken() {
|
||||
return token;
|
||||
}
|
||||
|
||||
public void setToken(String token) {
|
||||
this.token = token;
|
||||
}
|
||||
|
||||
/***
|
||||
* 买家id,当前登录的买家id
|
||||
|
||||
@ -53,11 +53,13 @@ public class ReverseOrderServiceImpl implements ReverseOrderService {
|
||||
vvReverseOrderEntity.setStatus(appliyReverseRequest.getStatus());
|
||||
|
||||
BigDecimal realRefundAmount = appliyReverseRequest.getRefundAmount() == null
|
||||
? SanUtils.sum(vvTradeOrderLineEntityList, VvTradeOrderLineEntity::getPromotionPrice)
|
||||
? SanUtils.sum(vvTradeOrderLineEntityList, VvTradeOrderLineEntity::getPayAmount)
|
||||
: appliyReverseRequest.getRefundAmount();
|
||||
|
||||
// 设置退款金额
|
||||
vvReverseOrderEntity.setRefundAmount(realRefundAmount);
|
||||
BigDecimal originRefundAmount = SanUtils.sum(vvTradeOrderLineEntityList, VvTradeOrderLineEntity::getPromotionPrice); // 本来应该退款金额
|
||||
|
||||
BigDecimal originRefundAmount = SanUtils.sum(vvTradeOrderLineEntityList, VvTradeOrderLineEntity::getPayAmount); // 本来应该退款金额
|
||||
if (realRefundAmount.compareTo(originRefundAmount) > 0) {
|
||||
log.info("createReverseOrder realRefundAmount not 大于 originRefundAmount,realRefundAmount:{},originRefundAmount:{}",realRefundAmount,originRefundAmount);
|
||||
return R.error("退款金额不能大于原来金额");
|
||||
@ -83,23 +85,26 @@ public class ReverseOrderServiceImpl implements ReverseOrderService {
|
||||
vvReverseOrderLineEntity.setTradeOrderId(vvTradeOrderEntity.getId());
|
||||
vvReverseOrderLineEntity.setTradeOrderLineId(tradeOrderLineId);
|
||||
if (appliyReverseRequest.getRefundAmount() == null) {
|
||||
vvReverseOrderLineEntity.setRefundAmount(vvTradeOrderLineEntity.getPromotionPrice());
|
||||
vvReverseOrderLineEntity.setRefundAmount(vvTradeOrderLineEntity.getPayAmount());
|
||||
} else {
|
||||
if (i == tradeOrderLineIds.size() - 1) {
|
||||
BigDecimal lastRefundAmount = BigDecimalUtil.subtract(realRefundAmount, preSum);
|
||||
vvReverseOrderLineEntity.setRefundAmount(lastRefundAmount);
|
||||
} else {
|
||||
BigDecimal allPrice = BigDecimalUtil.multiply(vvTradeOrderLineEntity.getPromotionPrice(), realRefundAmount);
|
||||
BigDecimal subLineRefundAmount = BigDecimalUtil.divide(allPrice, originRefundAmount);
|
||||
BigDecimal subLineRefundAmount = BigDecimalUtil.multiply(vvTradeOrderLineEntity.getPayAmount(),
|
||||
BigDecimalUtil.divide(realRefundAmount, originRefundAmount));
|
||||
|
||||
preSum = preSum.add(subLineRefundAmount);
|
||||
vvReverseOrderLineEntity.setRefundAmount(subLineRefundAmount);
|
||||
}
|
||||
}
|
||||
|
||||
vvReverseOrderLineEntity.setSellerId(vvTradeOrderLineEntity.getSellerId());
|
||||
vvReverseOrderLineEntity.setSellerName(vvTradeOrderLineEntity.getSellerName());
|
||||
vvReverseOrderLineEntity.setProductId(vvTradeOrderLineEntity.getProductId());
|
||||
vvReverseOrderLineEntity.setProductName(vvTradeOrderLineEntity.getProductName());
|
||||
vvReverseOrderLineEntity.setSkuImageUrl(vvTradeOrderLineEntity.getSkuImageUrl());
|
||||
|
||||
// 保存逆向子单
|
||||
vvReverseOrderLineDao.insertVvReverseOrderLine(vvReverseOrderLineEntity);
|
||||
|
||||
|
||||
@ -135,6 +135,17 @@ public class SanUtils {
|
||||
return list;
|
||||
}
|
||||
|
||||
public static void getClassDeclaredMethods(Class entityType, List<Method> methods) {
|
||||
if (entityType == Object.class) {
|
||||
return;
|
||||
}
|
||||
Method method[] = entityType.getDeclaredMethods();
|
||||
for (Method method1 : method) {
|
||||
methods.add(method1);
|
||||
}
|
||||
getClassDeclaredMethods(entityType.getSuperclass(), methods);
|
||||
}
|
||||
|
||||
public static <T, R, V> Map<R, List<V>> groupByFiled2MapList(List<V> values, LBiFunction0<T, R> function) {
|
||||
if (CollectionUtils.isEmpty(values)) {
|
||||
return new LinkedHashMap<>();
|
||||
|
||||
@ -3,11 +3,11 @@ package com.heyu.api.data.utils;
|
||||
public class TokenUtils {
|
||||
|
||||
|
||||
public static String generateToken(Long id) {
|
||||
public static String generateToken(String id) {
|
||||
return MD5Utils.encode(System.currentTimeMillis() + "" + id );
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println(generateToken(1L));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -49,7 +49,7 @@ public class MysqlMain_update {
|
||||
List<TablesBean> list = new ArrayList<TablesBean>();
|
||||
|
||||
|
||||
list.add(new TablesBean("vv_seller"));
|
||||
list.add(new TablesBean("vv_trade_order_line"));
|
||||
|
||||
|
||||
|
||||
|
||||
@ -1,11 +1,12 @@
|
||||
package com.heyu.api.alibaba.request.mm;
|
||||
|
||||
|
||||
import com.heyu.api.data.service.impl.AppBaseRequest;
|
||||
import com.heyu.api.data.utils.AesUtil;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class VvAnonymousUserLoginRequest {
|
||||
public class VvAnonymousUserLoginRequest extends AppBaseRequest {
|
||||
|
||||
|
||||
/***
|
||||
|
||||
@ -0,0 +1,27 @@
|
||||
package com.heyu.api.alibaba.request.mm.order;
|
||||
|
||||
import com.heyu.api.data.entity.vv.VvActivityEntity;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class VvActivityDTO extends VvActivityEntity {
|
||||
|
||||
|
||||
/***
|
||||
* 过期时间
|
||||
*/
|
||||
private Long activityExpiredTime;
|
||||
|
||||
|
||||
|
||||
/***
|
||||
* 推广者id
|
||||
*/
|
||||
private String promoterId ;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,24 @@
|
||||
package com.heyu.api.alibaba.request.vv;
|
||||
|
||||
|
||||
import com.heyu.api.data.service.impl.AppBaseRequest;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class AppActivityRequest extends AppBaseRequest {
|
||||
|
||||
|
||||
/***
|
||||
* 活动id
|
||||
*/
|
||||
private Long activityId ;
|
||||
|
||||
|
||||
|
||||
/***
|
||||
* 推广者id
|
||||
*/
|
||||
private String promoterId ;
|
||||
|
||||
|
||||
}
|
||||
@ -1,9 +1,10 @@
|
||||
package com.heyu.api.alibaba.request.vv;
|
||||
|
||||
import com.heyu.api.data.service.impl.AppBaseRequest;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class AppUserLoginRequest {
|
||||
public class AppUserLoginRequest extends AppBaseRequest {
|
||||
|
||||
/***
|
||||
* 微信code
|
||||
|
||||
@ -107,13 +107,12 @@ public class ZhenZhenLogAop {
|
||||
Object[] argArrs = point.getArgs();
|
||||
if (uri.startsWith(ApiConstants.APP_URI_START)) {
|
||||
token = attributes.getRequest().getHeader(ApiConstants.APP_TOKEN);
|
||||
|
||||
// 参数封装
|
||||
if (argArrs != null && argArrs.length > 0) {
|
||||
for (Object argArr : argArrs) {
|
||||
argArr.getClass().getDeclaredMethods();
|
||||
List<Method> methods = new ArrayList<>();
|
||||
getClassDeclaredMethods(argArr.getClass(), methods);
|
||||
SanUtils.getClassDeclaredMethods(argArr.getClass(), methods);
|
||||
for (Method m : methods) {
|
||||
if (ApiConstants.GET_BUYER_ID.equalsIgnoreCase(m.getName())) {
|
||||
m.setAccessible(true);
|
||||
@ -132,10 +131,10 @@ public class ZhenZhenLogAop {
|
||||
}
|
||||
}
|
||||
for (Method m : methods) {
|
||||
//if("buyerId".equalsIgnoreCase(mName)) {
|
||||
// m.setAccessible(true);
|
||||
// m.invoke(argArr, new Object[]{buyerId});
|
||||
//}
|
||||
if (ApiConstants.SET_TOKEN.equalsIgnoreCase(m.getName())) {
|
||||
m.setAccessible(true);
|
||||
m.invoke(argArr, new Object[]{token});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -155,7 +154,7 @@ public class ZhenZhenLogAop {
|
||||
for (Object argArr : argArrs) {
|
||||
argArr.getClass().getDeclaredMethods();
|
||||
List<Method> methods = new ArrayList<>();
|
||||
getClassDeclaredMethods(argArr.getClass(), methods);
|
||||
SanUtils.getClassDeclaredMethods(argArr.getClass(), methods);
|
||||
for (Method m : methods) {
|
||||
if (ApiConstants.SET_USER_NAME.equalsIgnoreCase(m.getName())) {
|
||||
m.setAccessible(true);
|
||||
@ -196,6 +195,7 @@ public class ZhenZhenLogAop {
|
||||
if (object == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (object instanceof List) {
|
||||
List list = (List) object;
|
||||
for (Object o : list) {
|
||||
@ -216,7 +216,7 @@ public class ZhenZhenLogAop {
|
||||
return;
|
||||
} else {
|
||||
List<Method> methods = new ArrayList<>();
|
||||
getClassDeclaredMethods(object.getClass(), methods);
|
||||
SanUtils.getClassDeclaredMethods(object.getClass(), methods);
|
||||
Map<String, Method> methodMap = new HashMap<>();
|
||||
for (Method method : methods) {
|
||||
methodMap.put(method.getName(), method);
|
||||
@ -256,16 +256,7 @@ public class ZhenZhenLogAop {
|
||||
}
|
||||
}
|
||||
|
||||
public static void getClassDeclaredMethods(Class entityType, List<Method> methods) {
|
||||
if (entityType == Object.class) {
|
||||
return;
|
||||
}
|
||||
Method method[] = entityType.getDeclaredMethods();
|
||||
for (Method method1 : method) {
|
||||
methods.add(method1);
|
||||
}
|
||||
getClassDeclaredMethods(entityType.getSuperclass(), methods);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void printLog(Object result, String args, String ip, String className, String methodName,
|
||||
@ -294,9 +285,9 @@ public class ZhenZhenLogAop {
|
||||
describe
|
||||
)
|
||||
));
|
||||
|
||||
}
|
||||
|
||||
|
||||
private String recordRequestLog(Object[] argArrs, String uri) {
|
||||
String mediaType = "";
|
||||
String args = null;
|
||||
|
||||
@ -0,0 +1,63 @@
|
||||
package com.heyu.api.controller.vv;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.heyu.api.alibaba.request.mm.order.VvActivityDTO;
|
||||
import com.heyu.api.alibaba.request.vv.AppActivityRequest;
|
||||
import com.heyu.api.common.annotation.AppLogin;
|
||||
import com.heyu.api.common.annotation.Describe;
|
||||
import com.heyu.api.data.constants.ApiConstants;
|
||||
import com.heyu.api.data.dao.vv.VvActivityDao;
|
||||
import com.heyu.api.data.entity.vv.VvActivityEntity;
|
||||
import com.heyu.api.data.utils.DateUtils;
|
||||
import com.heyu.api.data.utils.R;
|
||||
import com.heyu.api.data.utils.RedisUtils;
|
||||
import com.heyu.api.data.utils.StringUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/app/activity")
|
||||
@AppLogin
|
||||
public class AppActivityController {
|
||||
|
||||
@Autowired
|
||||
private RedisUtils redisUtils;
|
||||
|
||||
@Autowired
|
||||
private VvActivityDao vvActivityDao;
|
||||
|
||||
/***
|
||||
* 列表
|
||||
* /app/buyer/info
|
||||
*/
|
||||
@Describe("访问推广链接")
|
||||
@RequestMapping("/info")
|
||||
public R list(@RequestBody AppActivityRequest request) {
|
||||
Long activityId = request.getActivityId();
|
||||
if (request.getActivityId() == null) {
|
||||
activityId = 1L;
|
||||
}
|
||||
VvActivityEntity vvActivityEntity = vvActivityDao.selectVvActivityById(activityId);
|
||||
if (StringUtils.isNotEmpty(request.getToken())) {
|
||||
VvActivityDTO vvActivityDTO = new VvActivityDTO();
|
||||
BeanUtils.copyProperties(vvActivityEntity, vvActivityDTO);
|
||||
Date endTime = DateUtils.addMinutes(new Date(), 30);
|
||||
vvActivityDTO.setActivityExpiredTime(endTime.getTime());
|
||||
vvActivityDTO.setPromoterId(request.getPromoterId());
|
||||
redisUtils.set(ApiConstants.token_activity + request.getToken(), JSON.toJSONString(vvActivityDTO), RedisUtils.thirty_minute);
|
||||
return R.ok().setData(vvActivityEntity);
|
||||
}
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -41,7 +41,6 @@ public class AppBuyerAddressManagerController {
|
||||
@Describe("买家地址列表")
|
||||
@RequestMapping("/list")
|
||||
public R list(@RequestBody AppBuyerAddressRequest appBuyerAddressRequest) {
|
||||
|
||||
PPageUtils pageUtils = PPageUtils.startPage(appBuyerAddressRequest.getPageNum(), appBuyerAddressRequest.getPageSize())
|
||||
.doSelect(new ISelect() {
|
||||
@Override
|
||||
|
||||
@ -2,13 +2,16 @@ package com.heyu.api.controller.vv;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.heyu.api.alibaba.request.mm.order.AppCloseDTO;
|
||||
import com.heyu.api.alibaba.request.mm.order.AppDeliveredDTO;
|
||||
import com.heyu.api.alibaba.request.mm.order.VvActivityDTO;
|
||||
import com.heyu.api.alibaba.request.mm.order.resp.*;
|
||||
import com.heyu.api.alibaba.request.vv.AppOrderRequest;
|
||||
import com.heyu.api.common.annotation.AppLogin;
|
||||
import com.heyu.api.common.annotation.Describe;
|
||||
import com.heyu.api.data.constants.ApiConstants;
|
||||
import com.heyu.api.data.dao.vv.*;
|
||||
import com.heyu.api.data.dto.WeiXinPayDelayDTO;
|
||||
import com.heyu.api.data.entity.vv.*;
|
||||
@ -106,6 +109,9 @@ public class AppOrderController {
|
||||
@Autowired
|
||||
private VvPackageService vvPackageService;
|
||||
|
||||
@Autowired
|
||||
private RedisUtils redisUtils;
|
||||
|
||||
|
||||
/***
|
||||
* https://api.1024api.com/api-interface/app/order/list
|
||||
@ -148,7 +154,7 @@ public class AppOrderController {
|
||||
|
||||
List<VVOrderListResp> vvOrderListResps = vvTradeOrderConvertService.convertTradeOrderLineResp(tradeOrderEntities, vvTradeOrderLineEntities, true);
|
||||
|
||||
List<AppPackageDTO> appPackageDTOList = vvTradeOrderConvertService.buildAppPackageDTO(vvOrderListResps);
|
||||
List<AppPackageDTO> appPackageDTOList = vvTradeOrderConvertService.buildAppPackageDTO(vvOrderListResps);
|
||||
|
||||
return R.ok().setData(appPackageDTOList);
|
||||
}
|
||||
@ -166,7 +172,7 @@ public class AppOrderController {
|
||||
List<String> trackNumbers = SanUtils.field2Set2List(vvTradeOrderLineEntities, VvTradeOrderLineEntity::getTrackNumber);
|
||||
if (CollectionUtils.isNotEmpty(trackNumbers)) {
|
||||
for (String trackNumber : trackNumbers) {
|
||||
vvPackageService.selectVvKuaidiAndUpdateData(trackNumber, RoleEnums.user.getRole(),true);
|
||||
vvPackageService.selectVvKuaidiAndUpdateData(trackNumber, RoleEnums.user.getRole(), true);
|
||||
}
|
||||
}
|
||||
|
||||
@ -208,19 +214,26 @@ public class AppOrderController {
|
||||
|
||||
Map<Long, List<VvSkuPropertyValueEntity>> vvSkuPropertyValueMap = SanUtils.groupByFiled2MapList(vvSkuPropertyValueList, VvSkuPropertyValueEntity::getSkuId);
|
||||
|
||||
List<Long> productIdList = SanUtils.field2Set2List(vvSkuEntities,VvSkuEntity::getProductId);
|
||||
List<Long> productIdList = SanUtils.field2Set2List(vvSkuEntities, VvSkuEntity::getProductId);
|
||||
List<VvProductEntity> vvProductList = vvProductDao.selectVvProductByProductIds(productIdList);
|
||||
|
||||
Map<Long, VvProductEntity> vvProductMap = SanUtils.groupByFiled2Map(vvProductList,VvProductEntity::getId);
|
||||
Map<Long, VvProductEntity> vvProductMap = SanUtils.groupByFiled2Map(vvProductList, VvProductEntity::getId);
|
||||
VvBuyerAddressEntity vvBuyerAddress = vvBuyerAddressDao.selectVvBuyerAddressById(vvOrderRequest.getBuyerAddressId());
|
||||
|
||||
|
||||
List<VvProductPropertyEntity> vvProductPropertyEntities = vvProductPropertyDao.selectVvProductPropertyByProductIdList(productIdList);
|
||||
Map<Long,List<VvProductPropertyEntity>> vvProductPropertyMap = SanUtils.groupByFiled2MapList(vvProductPropertyEntities,VvProductPropertyEntity::getProductId);
|
||||
Map<Long, List<VvProductPropertyEntity>> vvProductPropertyMap = SanUtils.groupByFiled2MapList(vvProductPropertyEntities, VvProductPropertyEntity::getProductId);
|
||||
String activityInfo = redisUtils.get(ApiConstants.token_activity + vvOrderRequest.getToken());
|
||||
|
||||
VvActivityDTO vvActivityDTO =null;
|
||||
if (StringUtils.isNotEmpty(activityInfo)) {
|
||||
vvActivityDTO = JSONObject.parseObject(activityInfo, VvActivityDTO.class);
|
||||
}
|
||||
|
||||
Integer batchNum = SanUtils.sum(vvOrderRequest.getVvTradeOrderLineDTOList(),VvTradeOrderLineDTO::getNum );
|
||||
|
||||
for (VvTradeOrderLineDTO vvTradeOrderLineDTO : vvOrderRequest.getVvTradeOrderLineDTOList()) {
|
||||
VvSkuEntity vvSkuEntity = skuEntityMap.get(vvTradeOrderLineDTO.getSkuId());
|
||||
|
||||
List<VvSkuPropertyValueEntity> vvSkuPropertyValueEntities = vvSkuPropertyValueMap.get(vvTradeOrderLineDTO.getSkuId());
|
||||
VvProductEntity vvProduct = vvProductMap.get(vvSkuEntity.getProductId());
|
||||
List<PropertyNameValue> propertyNameValues = new ArrayList<>();
|
||||
@ -262,8 +275,18 @@ public class AppOrderController {
|
||||
vvTradeOrderLineEntity.setStatus(OrderStatusEnums.create.getStatus());
|
||||
vvTradeOrderLineEntity.setBuyerId(vvOrderRequest.getBuyerId());
|
||||
vvTradeOrderLineEntity.setBuyerAddressId(vvOrderRequest.getBuyerAddressId());
|
||||
vvTradeOrderLineEntity.setBatchNum(vvTradeOrderLineDTO.getNum());
|
||||
vvTradeOrderLineEntity.setPayAmount(vvSkuEntity.getPromotionPrice());
|
||||
vvTradeOrderLineEntity.setBatchNum(batchNum); // sku 对应的笔数
|
||||
|
||||
// 支付金额默认是促销价格
|
||||
BigDecimal payAmount = vvSkuEntity.getPromotionPrice();
|
||||
if (vvActivityDTO != null) {
|
||||
vvTradeOrderLineEntity.setAwardAmount(vvActivityDTO.getAwardAmount());
|
||||
vvTradeOrderLineEntity.setDiscountAmount(vvActivityDTO.getDiscountAmount());
|
||||
payAmount = BigDecimalUtil.subtract(vvSkuEntity.getPromotionPrice(), vvActivityDTO.getDiscountAmount());
|
||||
}
|
||||
|
||||
vvTradeOrderLineEntity.setPayAmount(payAmount);
|
||||
vvTradeOrderLineEntity.setActivityInfo(activityInfo);
|
||||
vvTradeOrderLineEntityList.add(vvTradeOrderLineEntity);
|
||||
}
|
||||
}
|
||||
@ -293,7 +316,9 @@ public class AppOrderController {
|
||||
vvTradeOrderEntity.setCreateTimestamp(System.currentTimeMillis());
|
||||
vvTradeOrderEntity.setModifyTimestamp(System.currentTimeMillis());
|
||||
vvTradeOrderEntity.setBuyerAddressId(vvOrderRequest.getBuyerAddressId());
|
||||
|
||||
BigDecimal tradePayAmount = SanUtils.sum(vvTradeOrderLineEntityList, VvTradeOrderLineEntity::getPayAmount);
|
||||
|
||||
vvTradeOrderEntity.setPayAmount(tradePayAmount);
|
||||
|
||||
vvTradeOrderDao.insertVvTradeOrder(vvTradeOrderEntity);
|
||||
@ -328,16 +353,16 @@ public class AppOrderController {
|
||||
}
|
||||
|
||||
// 发送订单关单的消息
|
||||
Date currentTime= new Date();
|
||||
Date after30 = DateUtils.addMinutes(currentTime,30);
|
||||
Date currentTime = new Date();
|
||||
Date after30 = DateUtils.addMinutes(currentTime, 30);
|
||||
Integer second = DateUtils.betweenSecond(currentTime, after30);
|
||||
WeiXinPayDelayDTO weiXinPayDelayDTO = new WeiXinPayDelayDTO();
|
||||
weiXinPayDelayDTO.setSendTime(DateUtils.formatDate(currentTime, com.heyu.api.data.utils.DateUtils.YYYY_MM_DD_HH_MM_SS));
|
||||
weiXinPayDelayDTO.setDelayTime(DateUtils.formatDate(after30, com.heyu.api.data.utils.DateUtils.YYYY_MM_DD_HH_MM_SS));
|
||||
weiXinPayDelayDTO.setType(DelayTypeEnums.weixinPayClose.getType());
|
||||
weiXinPayDelayDTO.setRole( RoleEnums.user.getRole());
|
||||
|
||||
weiXinPayDelayDTO.setRole(RoleEnums.user.getRole());
|
||||
weiXinPayDelayDTO.setTradeOrderId(vvTradeOrderEntity.getId());
|
||||
|
||||
rabbitTemplate.convertAndSend(delayExchangeName, "", JSON.toJSONString(weiXinPayDelayDTO), message -> {
|
||||
message.getMessageProperties().setDeliveryMode(MessageDeliveryMode.PERSISTENT);
|
||||
message.getMessageProperties().setDelay((second) * 1000); // 毫秒为单位,指定此消息的延时时长 ,+ 1 尽量保证机器人跑完了,再发送消息
|
||||
@ -373,7 +398,7 @@ public class AppOrderController {
|
||||
public R add(@RequestBody VvTradeOrderDeleteDTO vvOrderRequest) {
|
||||
List<VvTradeOrderLineEntity> vvTradeOrderLineEntityList = null;
|
||||
if (StringUtils.isNotEmpty(vvOrderRequest.getTrackNumber())) {
|
||||
vvTradeOrderLineEntityList = vvTradeOrderLineDao.selectVvTradeOrderLineByTrackNumberBuyerId(vvOrderRequest.getTrackNumber(),vvOrderRequest.getBuyerId());
|
||||
vvTradeOrderLineEntityList = vvTradeOrderLineDao.selectVvTradeOrderLineByTrackNumberBuyerId(vvOrderRequest.getTrackNumber(), vvOrderRequest.getBuyerId());
|
||||
}
|
||||
if (vvOrderRequest.getTradeOrderId() != null) {
|
||||
vvTradeOrderLineEntityList = vvTradeOrderLineDao.selectVvTradeOrderLineByTradeOrderIdBuyerId(vvOrderRequest.getTradeOrderId(), vvOrderRequest.getBuyerId());
|
||||
@ -417,7 +442,7 @@ public class AppOrderController {
|
||||
vvTradeOrderConvertService.addOrderLineStatusLog(vvTradeOrderLineEntity.getId(),
|
||||
ReverseStatusEnums.buyer_apply_cancel,
|
||||
request.getBuyerId() + ""
|
||||
,request.getReason()
|
||||
, request.getReason()
|
||||
);
|
||||
}
|
||||
return R.ok();
|
||||
@ -462,7 +487,7 @@ public class AppOrderController {
|
||||
|
||||
for (VvTradeOrderLineEntity tradeOrderLineEntity : vvTradeOrderLineEntityList) {
|
||||
if (AbstractOrderAction.checkFailed(tradeOrderLineEntity, true, ActionEnums.App_Delivered)) {
|
||||
return R.error("订单状态不对,status:" + tradeOrderLineEntity.getStatus());
|
||||
return R.error("订单状态不对,status:" + tradeOrderLineEntity.getStatus());
|
||||
}
|
||||
}
|
||||
|
||||
@ -512,6 +537,4 @@ public class AppOrderController {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.heyu.api.alibaba.request.mm.VvAnonymousUserLoginRequest;
|
||||
import com.heyu.api.alibaba.request.mm.VvAppLoginRequest;
|
||||
import com.heyu.api.alibaba.request.mm.order.VvActivityDTO;
|
||||
import com.heyu.api.alibaba.request.vv.AppUserLoginRequest;
|
||||
import com.heyu.api.common.annotation.Describe;
|
||||
import com.heyu.api.data.constants.ApiConstants;
|
||||
@ -13,6 +14,7 @@ import com.heyu.api.data.dto.BuyerDTO;
|
||||
import com.heyu.api.data.dto.WeiChatLoginDTO;
|
||||
import com.heyu.api.data.entity.vv.VvBuyerEntity;
|
||||
import com.heyu.api.data.enums.UserLoginFlagEnums;
|
||||
import com.heyu.api.data.service.impl.AppBaseRequest;
|
||||
import com.heyu.api.data.utils.*;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -46,7 +48,6 @@ public class AppUserLoginController {
|
||||
if (weiChatLoginDTO == null) {
|
||||
return R.error("code 失效");
|
||||
}
|
||||
|
||||
VvBuyerEntity target = vvBuyerDao.selectVvBuyerOpenId(weiChatLoginDTO.getOpenid());
|
||||
if (target == null) {
|
||||
target = new VvBuyerEntity();
|
||||
@ -56,11 +57,12 @@ public class AppUserLoginController {
|
||||
}
|
||||
|
||||
target.setSessionKey(weiChatLoginDTO.getSessionKey());
|
||||
|
||||
vvBuyerDao.insertOrUpdateVvBuyer(target);
|
||||
|
||||
// 默认24 小时
|
||||
BuyerDTO buyerDTO = buildBuyerLoginInfoCacheRedisDB(target, RedisUtils.DEFAULT_EXPIRE);
|
||||
|
||||
BuyerDTO buyerDTO = buildBuyerLoginInfoCacheRedisDB(target, RedisUtils.DEFAULT_EXPIRE, null);
|
||||
replaceActivityInfo(request, "/app/user/login");
|
||||
return R.ok().put("buyer", buyerDTO);
|
||||
}
|
||||
|
||||
@ -71,19 +73,19 @@ public class AppUserLoginController {
|
||||
public R anonymousLogin(@RequestBody VvAnonymousUserLoginRequest request) {
|
||||
String deviceId = request.getDeviceId();
|
||||
String value = AesUtil.decrypt(deviceId, ApiConstants.AnonymousUserLogin_aes_password);
|
||||
|
||||
if (StringUtils.isBlank(value) || !value.startsWith(ApiConstants.AnonymousUserLogin_pre)) {
|
||||
log.info("anonymous value:{}", JSON.toJSONString(request));
|
||||
return R.error("设备号不对");
|
||||
}
|
||||
|
||||
Random random = new Random(100000000L);
|
||||
String token = TokenUtils.generateToken(random.nextLong());
|
||||
|
||||
VvBuyerEntity target = new VvBuyerEntity();
|
||||
target.setIsTest(UserLoginFlagEnums.anonymous_user.getFlag());
|
||||
target.setId(random.nextLong());
|
||||
BuyerDTO buyerDTO = buildBuyerLoginInfoCacheRedisDB(target, RedisUtils.thirty_minute, request.getDeviceId());
|
||||
|
||||
replaceActivityInfo(request, "/app/user/anonymous/login");
|
||||
|
||||
BuyerDTO buyerDTO = buildBuyerLoginInfoCacheRedisDB(target, RedisUtils.thirty_minute);
|
||||
return R.ok().put("buyer", buyerDTO);
|
||||
}
|
||||
|
||||
@ -96,17 +98,33 @@ public class AppUserLoginController {
|
||||
if (vvBuyerEntity == null) {
|
||||
return R.error("你不是内部用户");
|
||||
}
|
||||
VvBuyerEntity target = vvBuyerDao.selectVvBuyerInfo(request.getTargetBuyer(),
|
||||
|
||||
VvBuyerEntity target = vvBuyerDao.selectVvBuyerInfo(
|
||||
request.getTargetBuyer(),
|
||||
request.getTargetBuyer(),
|
||||
request.getTargetBuyer());
|
||||
|
||||
|
||||
// 默认24 小时
|
||||
BuyerDTO buyerDTO = buildBuyerLoginInfoCacheRedisDB(target, RedisUtils.DEFAULT_EXPIRE);
|
||||
BuyerDTO buyerDTO = buildBuyerLoginInfoCacheRedisDB(target, RedisUtils.DEFAULT_EXPIRE, null);
|
||||
replaceActivityInfo(request, "/app/user/target/login");
|
||||
return R.ok().put("buyer", buyerDTO);
|
||||
}
|
||||
|
||||
public BuyerDTO buildBuyerLoginInfoCacheRedisDB(VvBuyerEntity target, Long expireTime) {
|
||||
|
||||
public void replaceActivityInfo(AppBaseRequest request, String uri) {
|
||||
String activityTokenInfo = redisUtils.get(ApiConstants.token_activity + request.getToken());
|
||||
if (StringUtils.isNotEmpty(activityTokenInfo)) {
|
||||
log.info("replaceActivityInfo uri :{}, activityTokenInfo:{}", uri, activityTokenInfo);
|
||||
VvActivityDTO vvActivityDTO = JSONObject.parseObject(activityTokenInfo, VvActivityDTO.class);
|
||||
Long activityExpiredTime = (vvActivityDTO.getActivityExpiredTime() - System.currentTimeMillis()) / 1000;
|
||||
if (activityExpiredTime > 0) {
|
||||
redisUtils.set(ApiConstants.token_activity + request.getToken(), JSON.toJSONString(vvActivityDTO), activityExpiredTime);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public BuyerDTO buildBuyerLoginInfoCacheRedisDB(VvBuyerEntity target, Long expireTime, String deviceId) {
|
||||
BuyerDTO buyerDTO = new BuyerDTO();
|
||||
buyerDTO.setBuyerId(target.getId());
|
||||
buyerDTO.setBuyerName(target.getBuyerName());
|
||||
@ -114,7 +132,8 @@ public class AppUserLoginController {
|
||||
buyerDTO.setAvatar(target.getAvatar());
|
||||
buyerDTO.setBuyerPhone(target.getBuyerPhone());
|
||||
buyerDTO.setBuyerWeixin(target.getBuyerWeixin());
|
||||
String token = TokenUtils.generateToken(target.getId());
|
||||
|
||||
String token = TokenUtils.generateToken(target.getId() + deviceId);
|
||||
redisUtils.set(token, JSON.toJSONString(buyerDTO), expireTime);
|
||||
buyerDTO.setToken(token);
|
||||
return buyerDTO;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user