|
|
|
@ -28,6 +28,7 @@ import com.qniao.dam.query.store.StoreQueryService; |
|
|
|
import com.qniao.dau.domain.aggregate.operationcenter.entity.OperationCenter; |
|
|
|
import com.qniao.dau.domain.aggregate.organization.entity.Organization; |
|
|
|
import com.qniao.dau.domain.aggregate.store.entity.Store; |
|
|
|
import com.qniao.dau.domian.aggregate.operationcenter.event.OperationCenterCreatedMQ; |
|
|
|
import com.qniao.dau.domian.aggregate.organization.constant.OrganizationTypeEnum; |
|
|
|
import com.qniao.dau.domian.aggregate.store.event.StoreCreatedMQ; |
|
|
|
import com.qniao.domain.BaseApplicationService; |
|
|
|
@ -72,6 +73,27 @@ public class RevenueRewardEventHandler extends BaseApplicationService { |
|
|
|
@Resource |
|
|
|
private FranchiseFeeProfitManagementQueryService franchiseFeeProfitManagementQueryService; |
|
|
|
|
|
|
|
@RabbitListener(bindings = @QueueBinding(value = @Queue(MqQueue.OPERATION_CENTER_CREATED), |
|
|
|
exchange = @Exchange(value = MqExchange.OPERATION_CENTER_CREATED, |
|
|
|
type = ExchangeTypes.FANOUT))) |
|
|
|
public void handle(OperationCenterCreatedMQ mq) { |
|
|
|
try { |
|
|
|
if (Objects.nonNull(mq.getFranchiseFee()) && mq.getFranchiseFee().compareTo(BigDecimal.ZERO) > 0) { |
|
|
|
//目前区域是非经营性质的 |
|
|
|
//非经营性质推荐 |
|
|
|
handleServiceProviderManagementFee(mq.getRecommendServiceProviderOrgId(), mq.getOperationCenterName(), mq.getFranchiseFee(), RewardTypeEnum.NON_OPERATING_RECOMMEND); |
|
|
|
} |
|
|
|
} catch (Exception e) { |
|
|
|
log.error("运营中心已创建事件处理异常", e); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* 门店创建 |
|
|
|
* |
|
|
|
* @param mq |
|
|
|
*/ |
|
|
|
@RabbitListener(bindings = @QueueBinding(value = @Queue(MqQueue.STORE_CREATED), |
|
|
|
exchange = @Exchange(value = MqExchange.STORE_CREATED, |
|
|
|
type = ExchangeTypes.FANOUT))) |
|
|
|
|