4 changed files with 68 additions and 13 deletions
Split View
Diff Options
-
31dating-agency-mall-constant/src/main/java/com/qniao/dam/domian/aggregate/rewardconfig/constant/RewardTypeEnum.java
-
46dating-agency-mall-server/src/main/java/com/qniao/dam/application/handler/revenuereward/RevenueRewardEventHandler.java
-
2dating-agency-mall-server/src/main/java/com/qniao/dam/infrastructure/constant/MqExchange.java
-
2dating-agency-mall-server/src/main/java/com/qniao/dam/infrastructure/constant/MqQueue.java
@ -0,0 +1,46 @@ |
|||
package com.qniao.dam.application.handler.revenuereward; |
|||
|
|||
import com.qniao.dam.infrastructure.constant.MqExchange; |
|||
import com.qniao.dam.infrastructure.constant.MqQueue; |
|||
import com.qniao.dam.query.rewardconfig.RewardConfigQueryService; |
|||
import com.qniao.dau.domian.aggregate.store.event.StoreCreatedMQ; |
|||
import com.qniao.domain.BaseApplicationService; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.amqp.core.ExchangeTypes; |
|||
import org.springframework.amqp.rabbit.annotation.Exchange; |
|||
import org.springframework.amqp.rabbit.annotation.Queue; |
|||
import org.springframework.amqp.rabbit.annotation.QueueBinding; |
|||
import org.springframework.amqp.rabbit.annotation.RabbitListener; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
import javax.annotation.Resource; |
|||
import java.math.BigDecimal; |
|||
import java.util.Objects; |
|||
|
|||
@Component |
|||
@Slf4j |
|||
public class RevenueRewardEventHandler extends BaseApplicationService { |
|||
|
|||
@Resource |
|||
private RewardConfigQueryService rewardConfigQueryService; |
|||
|
|||
@RabbitListener(bindings = @QueueBinding(value = @Queue(MqQueue.STORE_CREATED), |
|||
exchange = @Exchange(value = MqExchange.STORE_CREATED, |
|||
type = ExchangeTypes.FANOUT))) |
|||
public void handle(StoreCreatedMQ mq) { |
|||
try { |
|||
if (Objects.nonNull(mq.getFranchiseFee()) && mq.getFranchiseFee().compareTo(BigDecimal.ZERO) > 0) { |
|||
if (mq.getOperationCenterOrgId().equals(mq.getRecommendServiceProviderOrgId())) { |
|||
//经营性质推荐 |
|||
//推荐服务商回本前 100%获得 |
|||
//推荐服务商回本后 先提取50%,剩余20需要被推荐服务商回本50%后才能提取 |
|||
} else { |
|||
//非经营性质推荐 |
|||
//推荐服务商直接拿取20%,被推荐服务商回本后获得1%管道收益 |
|||
} |
|||
} |
|||
} catch (Exception e) { |
|||
log.error("门店已创建事件处理异常", e); |
|||
} |
|||
} |
|||
} |
|||
Write
Preview
Loading…
Cancel
Save