From 370425f9db2e0e504b7b831fa99cbe001f152164 Mon Sep 17 00:00:00 2001 From: Derran Date: Sat, 28 Sep 2024 10:27:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=82=AC=E8=B5=8F=E6=8B=9B=E4=BA=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../marriagebounty/entity/MarriageBountyOrder.java | 12 +++++++++++- .../service/order/OrderApplicationService.java | 2 +- .../impl/MarriageBountyOrderQueryServiceImpl.java | 7 +------ 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/dating-agency-mall-entity/src/main/java/com/qniao/dam/domain/aggregate/marriagebounty/entity/MarriageBountyOrder.java b/dating-agency-mall-entity/src/main/java/com/qniao/dam/domain/aggregate/marriagebounty/entity/MarriageBountyOrder.java index 3e21514..6a22080 100644 --- a/dating-agency-mall-entity/src/main/java/com/qniao/dam/domain/aggregate/marriagebounty/entity/MarriageBountyOrder.java +++ b/dating-agency-mall-entity/src/main/java/com/qniao/dam/domain/aggregate/marriagebounty/entity/MarriageBountyOrder.java @@ -84,7 +84,7 @@ public class MarriageBountyOrder extends Entity { return meetingQuantity; } - public RewardTypeEnum getRewardType() { + public RewardTypeEnum getMinAmountType() { RewardTypeEnum rewardType = RewardTypeEnum.MARRIAGE_BOUNTY_MARRIAGE_MIN_AMOUNT; if (MarriageBountyOrderType.MEETING.equals(type)) { rewardType = RewardTypeEnum.MARRIAGE_BOUNTY_MEETING_MIN_AMOUNT; @@ -93,4 +93,14 @@ public class MarriageBountyOrder extends Entity { } return rewardType; } + + public RewardTypeEnum getValidityPeriodType() { + RewardTypeEnum rewardType = RewardTypeEnum.MARRIAGE_BOUNTY_MARRIAGE_VALIDITY_PERIOD; + if (MarriageBountyOrderType.MEETING.equals(type)) { + rewardType = RewardTypeEnum.MARRIAGE_BOUNTY_MEETING_VALIDITY_PERIOD; + } else if (MarriageBountyOrderType.DATING.equals(type)) { + rewardType = RewardTypeEnum.MARRIAGE_BOUNTY_DATING_VALIDITY_PERIOD; + } + return rewardType; + } } diff --git a/dating-agency-mall-server/src/main/java/com/qniao/dam/application/service/order/OrderApplicationService.java b/dating-agency-mall-server/src/main/java/com/qniao/dam/application/service/order/OrderApplicationService.java index 4f29f00..5764cb1 100644 --- a/dating-agency-mall-server/src/main/java/com/qniao/dam/application/service/order/OrderApplicationService.java +++ b/dating-agency-mall-server/src/main/java/com/qniao/dam/application/service/order/OrderApplicationService.java @@ -213,7 +213,7 @@ public class OrderApplicationService extends BaseApplicationService { } private void checkMinAmount(MarriageBountyOrder marriageBountyOrder, Order order) { - RewardTypeEnum rewardType = marriageBountyOrder.getRewardType(); + RewardTypeEnum rewardType = marriageBountyOrder.getMinAmountType(); RewardConfig rewardConfig = rewardConfigQueryService.queryByRewardType(rewardType); if (Objects.nonNull(rewardConfig) && new BigDecimal(rewardConfig.getValue()).compareTo(order.getSettlementAmount()) > 0) { throw new BizException("悬赏招亲发布最低" + rewardConfig.getValue() + "元"); diff --git a/dating-agency-mall-server/src/main/java/com/qniao/dam/query/marriagebounty/impl/MarriageBountyOrderQueryServiceImpl.java b/dating-agency-mall-server/src/main/java/com/qniao/dam/query/marriagebounty/impl/MarriageBountyOrderQueryServiceImpl.java index b108bb0..d74d270 100644 --- a/dating-agency-mall-server/src/main/java/com/qniao/dam/query/marriagebounty/impl/MarriageBountyOrderQueryServiceImpl.java +++ b/dating-agency-mall-server/src/main/java/com/qniao/dam/query/marriagebounty/impl/MarriageBountyOrderQueryServiceImpl.java @@ -6,8 +6,6 @@ import com.qniao.dam.domain.aggregate.marriagebounty.entity.MarriageBountyOrder; import com.qniao.dam.domain.aggregate.marriagebounty.entity.MarriageBountyOrderReward; import com.qniao.dam.domain.aggregate.marriagebounty.repository.MarriageBountyOrderRepository; import com.qniao.dam.domain.aggregate.marriagebounty.valueobj.MarriageBountyOrderRel; -import com.qniao.dam.domain.aggregate.product.entity.Product; -import com.qniao.dam.domain.aggregate.productspec.entity.ProductSpec; import com.qniao.dam.domain.aggregate.rewardconfig.entity.RewardConfig; import com.qniao.dam.domian.aggregate.marriagebount.constant.MarriageBountyOrderPaymentStatusEnum; import com.qniao.dam.domian.aggregate.marriagebount.constant.MarriageBountyOrderStatusEnum; @@ -18,8 +16,6 @@ import com.qniao.dam.infrastructure.persistent.dao.domain.MarriageBountyOrderDao import com.qniao.dam.infrastructure.persistent.dao.domain.MarriageBountyOrderRelDao; import com.qniao.dam.infrastructure.persistent.dao.domain.MarriageBountyOrderRewardDao; import com.qniao.dam.query.marriagebounty.MarriageBountyOrderQueryService; -import com.qniao.dam.query.ora.OrderRefundApplicationQueryService; -import com.qniao.dam.query.product.ProductQueryService; import com.qniao.dam.query.rewardconfig.RewardConfigQueryService; import com.qniao.framework.utils.TypeConvertUtils; import org.springframework.stereotype.Service; @@ -27,7 +23,6 @@ import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.math.BigDecimal; import java.time.LocalDateTime; -import java.util.List; import java.util.Objects; @Service @@ -86,7 +81,7 @@ public class MarriageBountyOrderQueryServiceImpl implements MarriageBountyOrderQ refundInfoVo.setRefundableResultGift(refundableResultGift); refundInfoVo.setRefundable(refundableMeetingFee.compareTo(BigDecimal.ZERO) > 0 || refundableResultGift.compareTo(BigDecimal.ZERO) > 0); //服务退款有效期校验 - RewardTypeEnum rewardType = marriageBountyOrder.getRewardType(); + RewardTypeEnum rewardType = marriageBountyOrder.getValidityPeriodType(); RewardConfig rewardConfig = rewardConfigQueryService.queryByRewardType(rewardType); if (Objects.nonNull(rewardConfig)&&LocalDateTime.now().isBefore(rewardConfig.getRefundableTime(marriageBountyOrder.getCreateTime()))) { refundInfoVo.setRefundable(false);