|
|
|
@ -24,6 +24,7 @@ import com.qniao.dam.domain.service.order.SubmitSiteActivityOrderDomainService; |
|
|
|
import com.qniao.dam.domian.aggregate.marriagebount.constant.MarriageBountyOrderPaymentStatusEnum; |
|
|
|
import com.qniao.dam.domian.aggregate.marriagebount.constant.MarriageBountyOrderStatusEnum; |
|
|
|
import com.qniao.dam.domian.aggregate.marriagebount.constant.MarriageBountyOrderVersion; |
|
|
|
import com.qniao.dam.domian.aggregate.marriagebount.constant.PublishIdentityTypeEnum; |
|
|
|
import com.qniao.dam.domian.aggregate.order.constant.OrderBelongingEnum; |
|
|
|
import com.qniao.dam.domian.aggregate.order.constant.OrderTypeEnum; |
|
|
|
import com.qniao.dam.domian.aggregate.product.constant.ProductSubCategoryEnum; |
|
|
|
@ -97,6 +98,9 @@ public class OrderApplicationService extends BaseApplicationService { |
|
|
|
@Value("${marriage_bounty_meeting_quantity:5}") |
|
|
|
private Integer marriageBountyMeetingQuantity; |
|
|
|
|
|
|
|
@Value("${default_marriage_bounty_matchmaker_id}") |
|
|
|
private Long defaultMarriageBountyMatchmakerId; |
|
|
|
|
|
|
|
/** |
|
|
|
* todo 库存校验 暂时不用考虑 |
|
|
|
* |
|
|
|
@ -199,11 +203,20 @@ public class OrderApplicationService extends BaseApplicationService { |
|
|
|
MarriageBountyOrder existMarriageBountyOrder = marriageBountyOrderQueryService.queryBy(order.getUserId(), order.getMiId(), |
|
|
|
MarriageBountyOrderStatusEnum.MATCHMAKING, MarriageBountyOrderPaymentStatusEnum.PAID); |
|
|
|
if (Objects.isNull(existMarriageBountyOrder)) { |
|
|
|
checkMinAmount(marriageBountyOrder,order); |
|
|
|
checkMinAmount(marriageBountyOrder, order); |
|
|
|
} |
|
|
|
//4. 设置订单号 |
|
|
|
order.setOrderCode(snowFlakeUtil.getSnowflakeOrderCode()); |
|
|
|
//5. 组装付款单信息 |
|
|
|
//5. 选择发榜服务红娘 |
|
|
|
if (PublishIdentityTypeEnum.GUEST.equals(marriageBountyOrder.getPublishType())) { |
|
|
|
//选择默认平台红娘 |
|
|
|
marriageBountyOrder.setMatchmakerId(defaultMarriageBountyMatchmakerId); |
|
|
|
} else { |
|
|
|
//红娘发榜 |
|
|
|
Matchmaker matchmaker = matchmakerQueryService.queryByUserId(marriageBountyOrder.getUserId()); |
|
|
|
marriageBountyOrder.setMatchmakerId(matchmaker.getId()); |
|
|
|
} |
|
|
|
//6. 组装付款单信息 |
|
|
|
PaymentOrder paymentOrder = makePaymentOrder(order); |
|
|
|
submitOrderDomainService.handle(order, paymentOrder); |
|
|
|
if (Objects.isNull(existMarriageBountyOrder)) { |
|
|
|
|