Commit 8f0d78bc by 程裕兵

feat:cashier

parent d2401f67
......@@ -31,9 +31,10 @@ import org.springframework.stereotype.Service;
public class BrandToMerchantRpService extends
MapperRepoService<Long, BrandToMerchant, BrandToMerchantMapper> {
public BrandToMerchant getByBrandId(Long brandId) {
public BrandToMerchant getByBrandId(Long brandId, String channelNo) {
QueryWrapper<BrandToMerchant> wrapper = new QueryWrapper<>();
wrapper.eq(BrandToMerchant.BRAND_ID, brandId);
wrapper.eq(BrandToMerchant.CHANNEL_NO, channelNo);
return this.baseMapper.selectOne(wrapper);
}
......
......@@ -135,7 +135,7 @@ public class BrandMerchantServiceImpl implements BrandMerchantService {
@Override
public BrandMerchantVO getMerchant(Long brandId) {
BrandToMerchant relation = brandToMerchantRpService.getByBrandId(brandId);
BrandToMerchant relation = brandToMerchantRpService.getByBrandId(brandId, channel);
if (null == relation) {
return null;
}
......@@ -160,7 +160,7 @@ public class BrandMerchantServiceImpl implements BrandMerchantService {
@Override
public BrandMerchantBindXcxAppIdVO bindXcxAppId(Long brandId, String appId) {
BrandToMerchant relation = brandToMerchantRpService.getByBrandId(brandId);
BrandToMerchant relation = brandToMerchantRpService.getByBrandId(brandId, channel);
ConfigSubChannelVO vo = merchantRpcService.bindAppIdWxXcxOffline(channel, IdWorker.getIdStr(),
relation.getMerchantId(), appId);
......@@ -171,7 +171,7 @@ public class BrandMerchantServiceImpl implements BrandMerchantService {
@Override
public BrandMerchantBindXcxAppIdVO checkBindXcxAppId(Long brandId, String appId) {
BrandToMerchant relation = brandToMerchantRpService.getByBrandId(brandId);
BrandToMerchant relation = brandToMerchantRpService.getByBrandId(brandId, channel);
MerchantVO merchant = merchantRpcService.getByMerchantId(relation.getMerchantId());
return MerchantConvert.convertBrandBindWxAppIdApply(merchant.getSubChannelConfigs(), appId);
}
......@@ -179,7 +179,7 @@ public class BrandMerchantServiceImpl implements BrandMerchantService {
@Override
public BrandMerchantAuthSubChannelVO authSubChannel(Long brandId, SubChannelEnums subChannel,
SubChannelAuthTypeEnums authType) {
BrandToMerchant relation = brandToMerchantRpService.getByBrandId(brandId);
BrandToMerchant relation = brandToMerchantRpService.getByBrandId(brandId, channel);
AuthSubChannelVO vo = merchantRpcService.authSubChannel(channel, relation.getMerchantId(), subChannel,
authType);
......@@ -188,7 +188,7 @@ public class BrandMerchantServiceImpl implements BrandMerchantService {
@Override
public List<BrandMerchantAuthSubChannelVO> listAuthSubChannel(Long brandId) {
BrandToMerchant relation = brandToMerchantRpService.getByBrandId(brandId);
BrandToMerchant relation = brandToMerchantRpService.getByBrandId(brandId, channel);
MerchantVO merchant = merchantRpcService.getByMerchantId(relation.getMerchantId());
List<SubChannelAuthInfo> auths = merchant.getSubChannelAuths();
return Optional.ofNullable(auths).orElse(new ArrayList<>(1)).stream()
......@@ -203,7 +203,7 @@ public class BrandMerchantServiceImpl implements BrandMerchantService {
getDefaultBrandSubChannelInfo().getSubChannels());
if (OpenStateEnums.SUCCESS == applyToModify.getOpenState()) {
// 所有子通道全部开通成功
BrandToMerchant exist = brandToMerchantRpService.getByBrandId(apply.getBrandId());
BrandToMerchant exist = brandToMerchantRpService.getByBrandId(apply.getBrandId(), channel);
if (null == exist) {
brandToMerchantRpService.insert(MerchantConvert.convertMerchant(apply));
} else {
......
......@@ -26,6 +26,7 @@ import java.math.BigDecimal;
import java.util.List;
import javax.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
/**
......@@ -36,6 +37,9 @@ import org.springframework.stereotype.Service;
@Service
public class PayServiceImpl implements PayService {
@Value("${finance.brand.merchant.channel}")
private String channel;
@Resource
private BrandToMerchantRpService brandToMerchantRpService;
......@@ -54,7 +58,7 @@ public class PayServiceImpl implements PayService {
@Override
public PayVO merchantPay(BrandMerchantPayParams params) {
StudioVO studio = studioRpcService.getStudio(params.getStudioId());
BrandToMerchant relation = brandToMerchantRpService.getByBrandId(studio.getBrandId());
BrandToMerchant relation = brandToMerchantRpService.getByBrandId(studio.getBrandId(), channel);
MerchantVO merchant = merchantRpcService.getByMerchantId(relation.getMerchantId());
......
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