会员支付(试用) #59
@ -84,4 +84,10 @@ public interface PaidMemberOrderService {
|
|||||||
*/
|
*/
|
||||||
LocalDateTime getDeadLineDay(String cardName);
|
LocalDateTime getDeadLineDay(String cardName);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id获取对应的会员订单
|
||||||
|
*/
|
||||||
|
PaidMemberOrderDO getPaidMemeberOrder(Long id);
|
||||||
|
|
||||||
}
|
}
|
@ -4,6 +4,7 @@ import cn.iocoder.yudao.module.member.dal.dataobject.membercardtype.PaidMemberCa
|
|||||||
import cn.iocoder.yudao.module.member.dal.dataobject.user.PaidMemberUserDO;
|
import cn.iocoder.yudao.module.member.dal.dataobject.user.PaidMemberUserDO;
|
||||||
import cn.iocoder.yudao.module.member.service.membercardtype.PaidMemberCardTypeService;
|
import cn.iocoder.yudao.module.member.service.membercardtype.PaidMemberCardTypeService;
|
||||||
import cn.iocoder.yudao.module.member.service.user.PaidMemberUserService;
|
import cn.iocoder.yudao.module.member.service.user.PaidMemberUserService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
@ -32,6 +33,7 @@ import static cn.iocoder.yudao.module.member.enums.ErrorCodeConstants.*;
|
|||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
@Validated
|
@Validated
|
||||||
|
@Slf4j
|
||||||
public class PaidMemberOrderServiceImpl implements PaidMemberOrderService {
|
public class PaidMemberOrderServiceImpl implements PaidMemberOrderService {
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
@ -135,4 +137,14 @@ public class PaidMemberOrderServiceImpl implements PaidMemberOrderService {
|
|||||||
return deadlineDay;
|
return deadlineDay;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PaidMemberOrderDO getPaidMemeberOrder(Long id) {
|
||||||
|
PaidMemberOrderDO paidMemberOrderDO = paidMemberOrderMapper.selectById(id);
|
||||||
|
if (paidMemberOrderDO == null){
|
||||||
|
log.error("[getPaidMemeberOrder][会员支付订单记录不存在,会员支付订单记录 id({})]",id);
|
||||||
|
throw exception(PAID_MEMBER_ORDER_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
return paidMemberOrderDO;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -74,8 +74,15 @@ public class AppPaidMembeOrderController {
|
|||||||
MemberUserDO memberUserDO = userService1.getUser(getLoginUserId());
|
MemberUserDO memberUserDO = userService1.getUser(getLoginUserId());
|
||||||
PaidMemberUserSaveReqVO paidMemberUserSaveReqVO = new PaidMemberUserSaveReqVO();
|
PaidMemberUserSaveReqVO paidMemberUserSaveReqVO = new PaidMemberUserSaveReqVO();
|
||||||
// 判断当前用户是否选择过试用会员
|
// 判断当前用户是否选择过试用会员
|
||||||
if(memberUserDO.getActivate() == 0 && memberUserDO != null){
|
if(memberUserDO.getActivate() == 0 && memberUserDO != null && reqVO.getCardName().equals("试用")){
|
||||||
|
//试用会员
|
||||||
memberUserDO.setActivate(CommonStatusEnum.DISABLE.getStatus());
|
memberUserDO.setActivate(CommonStatusEnum.DISABLE.getStatus());
|
||||||
|
}else if(reqVO.getCardName().equals("永久")){
|
||||||
|
//永久会员
|
||||||
|
memberUserDO.setActivate(3);
|
||||||
|
}else {
|
||||||
|
//有效期会员
|
||||||
|
memberUserDO.setActivate(2);
|
||||||
}
|
}
|
||||||
// 若不是会员则往会员表插入数据
|
// 若不是会员则往会员表插入数据
|
||||||
if(memberUserService1.getMemberUser(memberUserDO.getId()) == null){
|
if(memberUserService1.getMemberUser(memberUserDO.getId()) == null){
|
||||||
|
@ -3,6 +3,8 @@ package cn.iocoder.yudao.module.pay.controller.app.member.vo;
|
|||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
@Schema(description = "用户 APP - 会员支付 Resp VO")
|
@Schema(description = "用户 APP - 会员支付 Resp VO")
|
||||||
@Data
|
@Data
|
||||||
public class AppPaidMemberOrderRespVO {
|
public class AppPaidMemberOrderRespVO {
|
||||||
@ -12,4 +14,7 @@ public class AppPaidMemberOrderRespVO {
|
|||||||
|
|
||||||
@Schema(description = "支付订单编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "o100")
|
@Schema(description = "支付订单编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "o100")
|
||||||
private Long payOrderId;
|
private Long payOrderId;
|
||||||
|
|
||||||
|
@Schema(description = "到期时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
private LocalDateTime cardExpirationTime;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user