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

Commit 2ea4f9fe authored by jiangxiulong's avatar jiangxiulong

下单&兑换:订单增加字段ex_code和list_id

parent b156e423
......@@ -61,6 +61,12 @@ public class GoblinNftOrderVo implements Serializable, Cloneable {
@ApiModelProperty(value = "用户手机号")
private String userMobile;
@ApiModelProperty(value = "分批购ID")
private String listId;
@ApiModelProperty(value = "兑换码")
private String exCode;
@ApiModelProperty(value = "应付金额")
private BigDecimal priceTotal;
......@@ -150,6 +156,8 @@ public class GoblinNftOrderVo implements Serializable, Cloneable {
this.setUserId(source.getUserId());
this.setUserName(source.getUserName());
this.setUserMobile(source.getUserMobile());
this.setListId(source.getListId());
this.setExCode(source.getExCode());
this.setPriceTotal(source.getPriceTotal());
this.setPriceCoupon(source.getPriceCoupon());
this.setStorePriceCoupon(source.getStorePriceCoupon());
......
......@@ -85,6 +85,16 @@ public class GoblinNftOrder implements Serializable, Cloneable {
*/
private String userMobile;
/**
* 分批购ID
*/
private String listId;
/**
* 兑换码
*/
private String exCode;
/**
* 应付金额
*/
......
USE dev_ln_scene;
ALTER TABLE goblin_nft_order ADD list_id VARCHAR(64) NOT NULL DEFAULT '' COMMENT '分批购ID' after user_mobile;
ALTER TABLE goblin_nft_order ADD ex_code VARCHAR(64) NOT NULL DEFAULT '' COMMENT '兑换码' after list_id;
\ No newline at end of file
......@@ -215,14 +215,14 @@ public class GoblinNftOrderServiceImpl implements IGoblinNftOrderService {
// 下单数据
int orderType1 = GoblinStatusConst.NftStatus.ORDER_TYPE_1.getValue();
GoblinNftOrder nftOrder = order(payParam, skuVo.getStoreId(), uid, spuId, number, orderId, orderCode, totalPrice, voucherPrice, storeVoucherPrice, boxSkuId, skuVo.getName() + " " + skuVo.getSubtitle(), orderType1);
GoblinNftOrder nftOrder = order(payParam, skuVo.getStoreId(), uid, spuId, number, orderId, orderCode, totalPrice, voucherPrice, storeVoucherPrice, boxSkuId, skuVo.getName() + " " + skuVo.getSubtitle(), orderType1, listId, "");
if (null == nftOrder) {
nftOrderUtils.backSkuCountAndStock(listId, uid, stockSkuId, skuId, number);
return ResponseDto.failure("下单失败~");
}
// 下单唤起支付
GoblinNftPayResultVo nftPayResultVo = payOrder(nftOrder, uid, payParam, skuVo.getProductId());
GoblinNftPayResultVo nftPayResultVo = payOrder(nftOrder, payParam, skuVo.getProductId());
if (null == nftPayResultVo) {
nftOrderUtils.backSkuCountAndStock(listId, uid, stockSkuId, skuId, number);
return ResponseDto.failure("下单失败啦~");
......@@ -349,7 +349,7 @@ public class GoblinNftOrderServiceImpl implements IGoblinNftOrderService {
GoblinNftOrderPayParam payParam, String storeId, String uid, String spuId, int number,
String orderId, String orderCode,
BigDecimal totalPrice, BigDecimal voucherPrice, BigDecimal storeVoucherPrice, String boxSkuId, String skuTitle
, int orderType
, int orderType, String listId, String exCode
) {
try {
LocalDateTime now = LocalDateTime.now();
......@@ -362,6 +362,8 @@ public class GoblinNftOrderServiceImpl implements IGoblinNftOrderService {
GoblinStoreInfoVo storeInfoVo = goblinRedisUtils.getStoreInfoVo(storeId);
String storeName = storeInfoVo.getStoreName();
listId = (null == listId) ? "" : listId;
// 生成订单
GoblinNftOrder nftOrder = GoblinNftOrder.getNew();
nftOrder.setOrderId(orderId);
......@@ -381,6 +383,8 @@ public class GoblinNftOrderServiceImpl implements IGoblinNftOrderService {
nftOrder.setUserName(StringUtils.defaultString(((String) token.get(CurrentUtil.TOKEN_NICKNAME)), ""));
nftOrder.setUserMobile(StringUtils.defaultString(((String) token.get(CurrentUtil.TOKEN_MOBILE)), ""));
}
nftOrder.setListId(listId);
nftOrder.setExCode(exCode);
nftOrder.setPriceTotal(totalPrice);
nftOrder.setPriceCoupon(voucherPrice);
nftOrder.setStorePriceCoupon(storeVoucherPrice);
......@@ -410,7 +414,7 @@ public class GoblinNftOrderServiceImpl implements IGoblinNftOrderService {
}
}
private GoblinNftPayResultVo payOrder(GoblinNftOrder nftOrder, String uid, GoblinNftOrderPayParam payParam, String productId) {
private GoblinNftPayResultVo payOrder(GoblinNftOrder nftOrder, GoblinNftOrderPayParam payParam, String productId) {
try {
// 是否免费
boolean isFree = false;
......@@ -490,7 +494,7 @@ public class GoblinNftOrderServiceImpl implements IGoblinNftOrderService {
nftOrder.getNum(), nftOrder.getStoreId(), nftOrder.getStoreName(), nftOrder.getOrderCode(), nftOrder.getUserId(), nftOrder.getUserName(), nftOrder.getUserMobile(), nftOrder.getPriceTotal(), nftOrder.getPriceCoupon(),
nftOrder.getStorePriceCoupon(), nftOrder.getPriceRedEnvelope(), nftOrder.getPriceVoucher(), nftOrder.getPriceActual(), nftOrder.getUcouponId(), nftOrder.getStoreCouponId(), nftOrder.getRedEnvelopeCode(), nftOrder.getStatus(), nftOrder.getSource(),
nftOrder.getOrderType(), nftOrder.getPayType(), nftOrder.getDeviceFrom(), nftOrder.getVersion(), nftOrder.getPayCountdownMinute(), nftOrder.getIpAddress(), nftOrder.getCreatedAt(), nftOrder.getPayCode(),
nftOrder.getSkuTitle()
nftOrder.getSkuTitle(), nftOrder.getListId(), nftOrder.getExCode()
});
// 订单vo
......@@ -855,7 +859,7 @@ public class GoblinNftOrderServiceImpl implements IGoblinNftOrderService {
BigDecimal totalPrice = BigDecimal.ZERO;
String boxSkuId = goblinNftExCodeVo.getBoxSkuId();
GoblinGoodsSkuInfoVo skuVo = goblinRedisUtils.getGoodsSkuInfoVo(goblinNftExCodeVo.getSkuId());
GoblinNftOrder nftOrder = order(payParam, goblinNftExCodeVo.getStoreId(), uid, goblinNftExCodeVo.getSpuId(), 1, orderId, orderCode, totalPrice, totalPrice, totalPrice, null == boxSkuId ? "" : boxSkuId, skuVo.getName() + " " + skuVo.getSubtitle(), orderType);
GoblinNftOrder nftOrder = order(payParam, goblinNftExCodeVo.getStoreId(), uid, goblinNftExCodeVo.getSpuId(), 1, orderId, orderCode, totalPrice, totalPrice, totalPrice, null == boxSkuId ? "" : boxSkuId, skuVo.getName() + " " + skuVo.getSubtitle(), orderType, "", code);
if (null == nftOrder) {
return ResponseDto.failure("兑换失败~");
}
......@@ -880,7 +884,7 @@ public class GoblinNftOrderServiceImpl implements IGoblinNftOrderService {
nftOrder.getNum(), nftOrder.getStoreId(), nftOrder.getStoreName(), nftOrder.getOrderCode(), nftOrder.getUserId(), nftOrder.getUserName(), nftOrder.getUserMobile(), nftOrder.getPriceTotal(), nftOrder.getPriceCoupon(),
nftOrder.getStorePriceCoupon(), nftOrder.getPriceRedEnvelope(), nftOrder.getPriceVoucher(), nftOrder.getPriceActual(), nftOrder.getUcouponId(), nftOrder.getStoreCouponId(), nftOrder.getRedEnvelopeCode(), orderVo.getStatus(), nftOrder.getSource(),
nftOrder.getOrderType(), orderVo.getPayType(), nftOrder.getDeviceFrom(), nftOrder.getVersion(), nftOrder.getPayCountdownMinute(), nftOrder.getIpAddress(), nftOrder.getCreatedAt(), orderVo.getPayCode(),
nftOrder.getSkuTitle()
nftOrder.getSkuTitle(), nftOrder.getListId(), nftOrder.getExCode()
});
String sqlData = SqlMapping.gets(sqls, sqlDataCode, sqlDataOrder);
queueUtils.sendMsgByRedis(MQConst.GoblinQueue.GOBLIN_NFT_ORDER.getKey(), sqlData);
......
......@@ -47,7 +47,7 @@ goblin_order.store.refundLog=INSERT INTO goblin_back_order_log (`back_order_log_
goblin_order.store.backOrder=INSERT INTO goblin_back_order (`back_order_id`,`back_code`,`order_id`,`order_code`,`store_id`,`user_id`,`sku_id_nums`,`type`,`reason`,`describes`,`real_back_price`,`status`,`created_at`,`audit_at`,`error_reason`) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
#-------- NFT -------
goblin_nft_order.insert=INSERT INTO goblin_nft_order (`order_id`,`spu_id`,`sku_id`,`box_sku_id`,`num`,`store_id`,`store_name`,`order_code`,`user_id`,`user_name`,`user_mobile`,`price_total`,`price_coupon`,`store_price_coupon`,`price_red_envelope`,`price_voucher`,`price_actual`,`ucoupon_id`,`store_coupon_id`,`red_envelope_code`,`status`,`source`,`order_type`,`pay_type`,`device_from`,`version`,`pay_countdown_minute`,`ip_address`,`created_at`,`pay_code`,sku_title) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
goblin_nft_order.insert=INSERT INTO goblin_nft_order (`order_id`,`spu_id`,`sku_id`,`box_sku_id`,`num`,`store_id`,`store_name`,`order_code`,`user_id`,`user_name`,`user_mobile`,`price_total`,`price_coupon`,`store_price_coupon`,`price_red_envelope`,`price_voucher`,`price_actual`,`ucoupon_id`,`store_coupon_id`,`red_envelope_code`,`status`,`source`,`order_type`,`pay_type`,`device_from`,`version`,`pay_countdown_minute`,`ip_address`,`created_at`,`pay_code`,sku_title,list_id,ex_code) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
goblin_nft_order.update.pay=UPDATE goblin_nft_order SET payment_type = ?, payment_id=?, pay_code = ?, pay_time = ?, status = ?, updated_at = ? WHERE order_id = ? and (updated_at <= ? or created_at = ? or updated_at is null)
goblin_nft_order.update.refund=UPDATE goblin_nft_order SET status = ?, updated_at = ? WHERE order_id = ? and (updated_at <= ? or created_at = ? or updated_at is null)
goblin_nft_order_refund.insert=INSERT INTO goblin_nft_order_refund (`order_refund_id`,`refund_code`,`order_id`,`order_code`,`store_id`,`user_id`,`price`,`status`,`error_reason`,`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