Commit 62815b70 by 程裕兵

feat:添加半屏小程序

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