Commit 8f0d78bc by 程裕兵

feat:cashier

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