Commit a7375e59 by 程裕兵

Merge branch 'feature/mini-pay' into release/rc

parents 7b72bda1 62815b70
......@@ -36,26 +36,23 @@ import org.springframework.stereotype.Service;
public class StudioEmbeddedXcxApplyRpService extends
MapperRepoService<Long, StudioEmbeddedXcxApply, StudioEmbeddedXcxApplyMapper> {
public Map<String, StudioEmbeddedXcxApply> mapByStudioIdAndAppId(Long studioId,
String componentAppId, String embeddedAppId, List<String> appIds) {
return this.listByStudioIdAndAppId(studioId, componentAppId, embeddedAppId, appIds)
public Map<String, StudioEmbeddedXcxApply> mapByAppId(String componentAppId, String embeddedAppId,
List<String> appIds) {
return this.listByAppId(componentAppId, embeddedAppId, appIds)
.stream().collect(Collectors.toMap(StudioEmbeddedXcxApply::getAuthorizerAppId, e -> e));
}
public List<StudioEmbeddedXcxApply> listByStudioIdAndAppId(Long studioId, String componentAppId,
String embeddedAppId, List<String> appIds) {
public List<StudioEmbeddedXcxApply> listByAppId(String componentAppId, String embeddedAppId,
List<String> appIds) {
QueryWrapper<StudioEmbeddedXcxApply> wrapper = new QueryWrapper<>();
wrapper.eq(StudioEmbeddedXcxApply.STUDIO_ID, studioId);
wrapper.eq(StudioEmbeddedXcxApply.COMPONENT_APP_ID, componentAppId);
wrapper.eq(StudioEmbeddedXcxApply.EMBEDDED_APP_ID, embeddedAppId);
wrapper.in(StudioEmbeddedXcxApply.AUTHORIZER_APP_ID, appIds);
return Optional.ofNullable(this.baseMapper.selectList(wrapper)).orElse(new ArrayList<>(1));
}
public StudioEmbeddedXcxApply getByStudioIdAndAppId(Long studioId, String componentAppId,
String embeddedAppId, String appId) {
public StudioEmbeddedXcxApply getByAppId(String componentAppId, String embeddedAppId, String appId) {
QueryWrapper<StudioEmbeddedXcxApply> wrapper = new QueryWrapper<>();
wrapper.eq(StudioEmbeddedXcxApply.STUDIO_ID, studioId);
wrapper.eq(StudioEmbeddedXcxApply.COMPONENT_APP_ID, componentAppId);
wrapper.eq(StudioEmbeddedXcxApply.EMBEDDED_APP_ID, embeddedAppId);
wrapper.eq(StudioEmbeddedXcxApply.AUTHORIZER_APP_ID, appId);
......
......@@ -267,8 +267,8 @@ public class StudioMerchantServiceImpl implements StudioMerchantService {
@Override
public StudioEmbeddedXcxVO getEmbeddedXcx(Long studioId, String appId) {
StudioEmbeddedXcxApply embeddedXcx = studioEmbeddedXcxApplyRpService.getByStudioIdAndAppId(
studioId, wxComponentAppId, embeddedAppId, appId);
StudioEmbeddedXcxApply embeddedXcx = studioEmbeddedXcxApplyRpService.getByAppId(wxComponentAppId,
embeddedAppId, appId);
if (null == embeddedXcx) {
return null;
}
......@@ -281,8 +281,8 @@ public class StudioMerchantServiceImpl implements StudioMerchantService {
return;
}
Map<String, StudioEmbeddedXcxApply> existMap = studioEmbeddedXcxApplyRpService.mapByStudioIdAndAppId(
studioId, wxComponentAppId, embeddedAppId, appIds);
Map<String, StudioEmbeddedXcxApply> existMap = studioEmbeddedXcxApplyRpService.mapByAppId(
wxComponentAppId, embeddedAppId, appIds);
appIds.stream()
.filter(appId -> null == existMap.get(appId) || EmbededXcxEnum.isFail(existMap.get(appId).getState()))
.forEach(appId -> {
......
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