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

Commit b91d3235 authored by 胡佳晨's avatar 胡佳晨

订单 券相关逻辑 提交 未实现

parent 31b2caf1
-- 退款配置添加 --
ALTER TABLE kylin_performance_status ADD is_refund_poundage tinyint DEFAULT 0 COMMENT '是否有手续费';
ALTER TABLE kylin_performance_status ADD is_refund_voucher tinyint DEFAULT 0 COMMENT '是否退优惠券';
ALTER TABLE kylin_performance_status ADD is_refund_express tinyint DEFAULT 0 COMMENT '是否手续费';
-- 订单相关券逻辑添加 --
drop TABLE if exists `kylin_order_vouchers`;
CREATE TABLE `kylin_order_vouchers`
(
`mid` int NOT NULL AUTO_INCREMENT,
`order_voucher_id` varchar(255) NOT NULL DEFAULT '' COMMENT 'order_voucher_id',
`order_id` varchar(255) NOT NULL DEFAULT '' COMMENT '订单id',
`voucher_code` varchar(255) NOT NULL DEFAULT '' COMMENT '券code',
`voucher_type` tinyint NOT NULL DEFAULT '' COMMENT '券类别',
`voucher_price` decimal(8, 2) NOT NULL DEFAULT 0.0 COMMENT '券的优惠金额',
`created_at` datetime(3) NULL DEFAULT NULL COMMENT '创建时间',
`updated_at` datetime(3) NULL DEFAULT NULL COMMENT '修改时间',
KEY `kylin_order_vouchers_order_voucher_id_index` (`order_voucher_id`),
KEY `kylin_order_vouchers_order_id_index` (`order_id`),
KEY `kylin_order_vouchers_voucher_type_index` (`voucher_type`),
PRIMARY KEY (`mid`)
) ENGINE = InnoDB
DEFAULT CHARSET utf8mb4
COLLATE utf8mb4_unicode_ci COMMENT '订单券 关联表';
\ No newline at end of file
...@@ -61,4 +61,11 @@ public class PayOrderParam { ...@@ -61,4 +61,11 @@ public class PayOrderParam {
private String showUrl; private String showUrl;
@ApiModelProperty(value = "returnUrl") @ApiModelProperty(value = "returnUrl")
private String returnUrl; private String returnUrl;
@ApiModelProperty(value = "优惠券类型")
private String voucherType;
@ApiModelProperty(value = "优惠券码")
private String voucherCode;
@ApiModelProperty(value = "会员提前券码")
private String advanceCode;
} }
ALTER TABLE kylin_performance_status ADD is_refund_poundage tinyint DEFAULT 0 COMMENT '是否有手续费';
ALTER TABLE kylin_performance_status ADD is_refund_voucher tinyint DEFAULT 0 COMMENT '是否退优惠券';
ALTER TABLE kylin_performance_status ADD is_refund_express tinyint DEFAULT 0 COMMENT '是否手续费';
\ No newline at end of file
...@@ -47,6 +47,21 @@ public class DataUtils { ...@@ -47,6 +47,21 @@ public class DataUtils {
} }
} }
/**
* 修改兑换库存 并 返回修改后的数量
*
* @param ticketId 票id
* @param surplusGeneral 普通库存
* @return 普通剩余库存
*/
public int changeSurplusExchange(String ticketId, int surplusGeneral) {
if (surplusGeneral > 0) {
return (int) redisUtil.incr(KylinRedisConst.PERFORMANCES_INVENTORY + ticketId + ":" + KylinRedisConst.SURPLUS_EXCHANGE, surplusGeneral);
} else {
return (int) redisUtil.decr(KylinRedisConst.PERFORMANCES_INVENTORY + ticketId + ":" + KylinRedisConst.SURPLUS_EXCHANGE, Math.abs(surplusGeneral));
}
}
public void setOrderList(String userId, List<KylinOrderListVo> vo) { public void setOrderList(String userId, List<KylinOrderListVo> vo) {
redisUtil.set(KylinRedisConst.ORDER_LIST + userId, vo); redisUtil.set(KylinRedisConst.ORDER_LIST + userId, vo);
......
...@@ -118,6 +118,18 @@ public class OrderUtils { ...@@ -118,6 +118,18 @@ public class OrderUtils {
return ""; return "";
} }
//判断 操作 普通库存还是兑换库存
public int changeSurplus(boolean isPay ,String ticketId,int number){
int surplusGeneral;
if(isPay) {
surplusGeneral = dataUtils.changeSurplusGeneral(ticketId, number);
}else{
surplusGeneral = dataUtils.changeSurplusExchange(ticketId, number);
}
return surplusGeneral;
}
public boolean isMember(String uid) { public boolean isMember(String uid) {
// String resultData = HttpUtil.get("/adam/member/check/depth?uid=" + uid, null); // String resultData = HttpUtil.get("/adam/member/check/depth?uid=" + uid, null);
// AdamUserMemberVo vo = JsonUtils.fromJson(resultData, AdamUserMemberVo.class); // AdamUserMemberVo vo = JsonUtils.fromJson(resultData, AdamUserMemberVo.class);
......
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