Commit 15762201 by 程裕兵

feat:添加半屏小程序

parent 9ec89f85
......@@ -8,6 +8,7 @@ import com.jiejing.fitness.finance.service.merchant.StudioMerchantService;
import com.jiejing.fitness.finance.service.pay.PayService;
import com.jiejing.fitness.finance.service.pay.RefundService;
import com.jiejing.paycenter.common.event.MerchantEvent;
import com.jiejing.paycenter.common.event.MerchantSubChannelEvent;
import com.jiejing.paycenter.common.event.PayEvent;
import com.jiejing.paycenter.common.event.RefundEvent;
import com.xiaomai.event.annotation.EventHandler;
......@@ -78,4 +79,15 @@ public class ListenerService {
}
}
@EventHandler(value = MerchantSubChannelEvent.class, binder = "biz-kafka", maxAttempts = MAX_RETRY)
public void merchantSubChannelEventCallback(MerchantSubChannelEvent event,
@Header(DELIVERY_ATTEMPT) int retryNum) {
try {
log.info("start process merchantSubChannelEventCallback event {}", JSON.toJSONString(event));
studioMerchantService.merchantSubChannelEventCallback(event);
} catch (Exception e) {
log.info("process merchantSubChannelEventCallback event fail {}", event.getId(), e);
}
}
}
......@@ -12,6 +12,7 @@ import com.jiejing.fitness.finance.service.merchant.params.PageStudioMerchantApp
import com.jiejing.paycenter.common.enums.merchant.SubChannelAuthTypeEnums;
import com.jiejing.paycenter.common.enums.merchant.SubChannelEnums;
import com.jiejing.paycenter.common.event.MerchantEvent;
import com.jiejing.paycenter.common.event.MerchantSubChannelEvent;
import java.util.List;
import java.util.Set;
......@@ -67,6 +68,13 @@ public interface StudioMerchantService {
void callback(MerchantEvent event);
/**
* 商户子渠道事件处理
*
* @param event 事件
*/
void merchantSubChannelEventCallback(MerchantSubChannelEvent event);
/**
* 获取场馆当前绑定的商户信息
*
* @param studioId 场馆ID
......
......@@ -44,6 +44,7 @@ import com.jiejing.message.enums.MsgChannelEnum;
import com.jiejing.message.event.SendCommonMsgEvent;
import com.jiejing.paycenter.api.merchant.request.ApplyMerchantRequest;
import com.jiejing.paycenter.common.enums.merchant.SubChannelOpenTypeEnums;
import com.jiejing.paycenter.common.event.MerchantSubChannelEvent;
import com.jiejing.paycenter.common.model.request.SubChannelConfigInfo;
import com.jiejing.paycenter.common.model.vo.AuthSubChannelVO;
import com.jiejing.paycenter.common.model.vo.ConfigSubChannelVO;
......@@ -224,6 +225,23 @@ public class StudioMerchantServiceImpl implements StudioMerchantService {
}
@Override
public void merchantSubChannelEventCallback(MerchantSubChannelEvent event) {
// 如果是特定的失败,则绑定半屏支付小程序
if (!OpenStateEnums.FAIL.getCode().equals(event.getState())) {
return;
}
if (!SubChannelConfigTypeEnums.WX_XCX_OFFLINE.getCode().equals(event.getConfigType())) {
return;
}
if (!SPECIAL_FAIL_LIST.contains(event.getFailMessage())) {
return;
}
StudioMerchantApply apply = studioMerchantApplyRpService.getLatestOneSuccessByMerchantId(
event.getMerchantId());
this.bindEmbeddedXcx(apply.getStudioId(), Lists.newArrayList(event.getAppId()));
}
@Override
public StudioMerchantVO getMerchant(Long studioId) {
PartyToMerchant relation = getRelation(studioId);
if (null == relation) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment