From bdbcae287c81069e309ed37344335a8d2a3a11a7 Mon Sep 17 00:00:00 2001 From: khy <2908249413@qq.com> Date: Mon, 21 Oct 2024 16:01:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=9A=E5=91=98=E6=94=AF=E4=BB=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../convert/order/PaidMemberOrderConvert.java | 3 +-- .../PaidMemberCardTypeService.java | 7 ------- .../PaidMemberCardTypeServiceImpl.java | 19 ------------------- .../service/order/PaidMemberOrderService.java | 2 +- .../order/PaidMemberOrderServiceImpl.java | 4 ++-- .../member/AppPaidMembeOrderController.java | 5 ++--- 6 files changed, 6 insertions(+), 34 deletions(-) diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/convert/order/PaidMemberOrderConvert.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/convert/order/PaidMemberOrderConvert.java index 7561fe4..0f868d1 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/convert/order/PaidMemberOrderConvert.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/convert/order/PaidMemberOrderConvert.java @@ -12,8 +12,7 @@ public interface PaidMemberOrderConvert { PaidMemberOrderConvert INSTANCE = Mappers.getMapper(PaidMemberOrderConvert.class); - PaidMemberOrderDO convert(Long uid, String cardName, Integer type, - String payChannel, BigDecimal price, LocalDateTime payTime, + PaidMemberOrderDO convert(Long uid, String cardName, Integer type, BigDecimal price, LocalDateTime payTime, String deadlineDay,LocalDateTime cardExpirationTime,BigDecimal originalPrice); } diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/membercardtype/PaidMemberCardTypeService.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/membercardtype/PaidMemberCardTypeService.java index 2a08986..e88559c 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/membercardtype/PaidMemberCardTypeService.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/membercardtype/PaidMemberCardTypeService.java @@ -62,13 +62,6 @@ public interface PaidMemberCardTypeService { */ List getCardTypeList (Integer activate); - /** - * 根据发起的订单type确定试用、有效期、永久的会员卡 - * @param type - * @return - */ - PaidMemberCardTypeDO selectMemberCardType(Integer type, BigDecimal price); - /** * 根据会员卡名查询 diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/membercardtype/PaidMemberCardTypeServiceImpl.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/membercardtype/PaidMemberCardTypeServiceImpl.java index e724a06..4f7fa3c 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/membercardtype/PaidMemberCardTypeServiceImpl.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/membercardtype/PaidMemberCardTypeServiceImpl.java @@ -92,25 +92,6 @@ public class PaidMemberCardTypeServiceImpl implements PaidMemberCardTypeService return list; } - @Override - public PaidMemberCardTypeDO selectMemberCardType(Integer type, BigDecimal price) { - PaidMemberCardTypeDO paidMemberCardTypeDO = new PaidMemberCardTypeDO(); - PaidMemberUserDO paidMemberUserDO = paidMemberUserService01.getMemberUser(getLoginUserId()); - if(type == 0){ - paidMemberCardTypeDO =cardMapper.selectOne(new LambdaQueryWrapperX() - .eqIfPresent(PaidMemberCardTypeDO::getName,"试用")); - } else if (type == 1 && paidMemberUserDO == null) { - paidMemberCardTypeDO =cardMapper.selectOne(new LambdaQueryWrapperX() - .eqIfPresent(PaidMemberCardTypeDO::getOriginalPrice,price)); - } else if (type == 1 && paidMemberUserDO != null) { - paidMemberCardTypeDO =cardMapper.selectOne(new LambdaQueryWrapperX() - .eqIfPresent(PaidMemberCardTypeDO::getSpecialPrice,price)); - } else if (type == 2) { - paidMemberCardTypeDO =cardMapper.selectOne(new LambdaQueryWrapperX() - .eqIfPresent(PaidMemberCardTypeDO::getName,"永久")); - } - return paidMemberCardTypeDO; - } @Override public PaidMemberCardTypeDO selectByName(String cardName) { diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/order/PaidMemberOrderService.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/order/PaidMemberOrderService.java index e3f0dce..93b6981 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/order/PaidMemberOrderService.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/order/PaidMemberOrderService.java @@ -61,7 +61,7 @@ public interface PaidMemberOrderService { * @return 编号 */ BigDecimal createMemberRecord(Long userId, Integer userType, String userIp, - BigDecimal price, Integer type); + Integer type,String cardName); /** * 创建付费会员订单 diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/order/PaidMemberOrderServiceImpl.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/order/PaidMemberOrderServiceImpl.java index 679e66b..96bec75 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/order/PaidMemberOrderServiceImpl.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/order/PaidMemberOrderServiceImpl.java @@ -87,14 +87,14 @@ public class PaidMemberOrderServiceImpl implements PaidMemberOrderService { @Override public BigDecimal createMemberRecord(Long userId, Integer userType, String userIp, - BigDecimal price, Integer type) { + Integer type, String cardName) { //定义一个支付金额 BigDecimal payPrice = null; BigDecimal gitBalance = BigDecimal.valueOf(0);//赠送余额,权益规则还未定 if(Objects.nonNull(type)){ PaidMemberUserDO paidMemberUserDO = paidMemberUserService.getMemberUser(getLoginUserId()); - PaidMemberCardTypeDO paidMemberCardTypeDO =typeService.selectMemberCardType(type,price); + PaidMemberCardTypeDO paidMemberCardTypeDO =typeService.selectByName(cardName); if(paidMemberCardTypeDO.getName().equals("试用")){ payPrice = paidMemberCardTypeDO.getOriginalPrice(); }else if (paidMemberUserDO != null){ diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/app/member/AppPaidMembeOrderController.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/app/member/AppPaidMembeOrderController.java index a2d87aa..d9818d8 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/app/member/AppPaidMembeOrderController.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/app/member/AppPaidMembeOrderController.java @@ -68,7 +68,6 @@ public class AppPaidMembeOrderController { private PaidMemberCardTypeService cardService; - @PostMapping("/create") @Operation(summary = "创建会员支付记录(发起支付)") public CommonResult createcard(@Valid @RequestBody AppPaidMemberOrderReqVO reqVO) { @@ -99,14 +98,14 @@ public class AppPaidMembeOrderController { //获得支付金额 BigDecimal payPrice = paidMemberOrderService1.createMemberRecord(getLoginUserId(), - getLoginUserType(),getClientIP(),reqVO.getPrice(),reqVO.getType()); + getLoginUserType(),getClientIP(),reqVO.getType(),reqVO.getCardName()); BigDecimal p = payPrice.multiply(new BigDecimal("100")); Integer payPriceInt = p.intValue(); BigDecimal originalPrice = cardService.selectByName(reqVO.getCardName()).getOriginalPrice(); // PayWalletDO walletDO = memberWalletService.getOrCreateWallet(getLoginUserId(),getLoginUserType()); //订单对象赋值 PaidMemberOrderDO paidMemberOrderDO = PaidMemberOrderConvert.INSTANCE.convert(getLoginUserId(), - reqVO.getCardName(),reqVO.getType(),reqVO.getPayChannel(),reqVO.getPrice(),payTime,deadlineDay,cardExpirationTime,originalPrice); + reqVO.getCardName(),reqVO.getType(),reqVO.getPrice(),payTime,deadlineDay,cardExpirationTime,originalPrice); paidMemberOrderService1.createOrder(paidMemberOrderDO); Long payOrderId = payOrderService01.createOrder(new PayOrderCreateReqDTO() .setAppId(1L).setUserIp(getClientIP())