Commit c54932a8 authored by jiaheming's avatar jiaheming

update channel vip add privilege

parent c91429db
......@@ -95,6 +95,7 @@ public class PayService {
eventChannel.publish(OnsEventType.ORDER_PAY_SUCCESS_OTHER, param);
break;
case VIP:
case CHANNEL_VIP:
if (CommodityOfVipTypeEnum.VIP_OF_YEAR.getCode().equals(Integer.valueOf(commodityDto.getAttachKey()))) {
userPrivilegeDs.addUserMxMember(order.getPassport(), CommodityOfVipTypeEnum.VIP_OF_YEAR.getDays(),
param.getOrderSn(), param.getTransactionSn());
......@@ -140,6 +141,7 @@ public class PayService {
eventChannel.publish(OnsEventType.ORDER_REFUND_SUCCESS, param);
break;
case VIP:
case CHANNEL_VIP:
String transactionSn = param.getTransactionSn();
Transaction trans = transactionService.getByOrderSnAndStatusAndType(orderSn,
TransactionStatus.CREATE_REFUND, TransactionType.REFUND);
......
......@@ -29,18 +29,17 @@ public class RefundService {
CommodityDto commodity = commodityDs.getCommodityById(order.getCommodityId());
CommodityTypeEnum commodityType = CommodityTypeEnum.getByCode(commodity.getCommodityType());
switch (commodityType) {
case CAMP: {
case CAMP:
Long attachId = Long.parseLong(commodity.getAttachId());
programMemberDs.cancelUserPrivilege(attachId, order);
break;
}
case VIP: {
case VIP:
case CHANNEL_VIP:
CommodityOfVipTypeEnum vipType = CommodityOfVipTypeEnum.getByCode(Integer.parseInt(commodity.getAttachKey()));
if (vipType != null) {
userPrivilegeDs.removeUserMxMember(order.getPassport(), vipType.getDays(), order.getOrderSn(), transactionSn);
}
break;
}
default: {
throw new ServiceException("商品信息不正确,取消权益失败");
}
......
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