Commit 84970b15 by 程裕兵

feat:添加半屏小程序

parent 15762201
......@@ -36,40 +36,40 @@ import org.springframework.stereotype.Service;
public class StudioEmbeddedXcxApplyRpService extends
MapperRepoService<Long, StudioEmbeddedXcxApply, StudioEmbeddedXcxApplyMapper> {
public Map<String, StudioEmbeddedXcxApply> mapByStudioIdAndAuthorizerAppId(Long studioId,
String componentAppId, String systemXcxAppId, List<String> authorizerAppIds) {
return this.listByStudioIdAndAuthorizerAppId(studioId, componentAppId, systemXcxAppId, authorizerAppIds)
public Map<String, StudioEmbeddedXcxApply> mapByStudioIdAndAppId(Long studioId,
String componentAppId, String systemXcxAppId, List<String> appIds) {
return this.listByStudioIdAndAppId(studioId, componentAppId, systemXcxAppId, appIds)
.stream().collect(Collectors.toMap(StudioEmbeddedXcxApply::getAppId, e -> e));
}
public List<StudioEmbeddedXcxApply> listByStudioIdAndAuthorizerAppId(Long studioId, String componentAppId,
String systemXcxAppId, List<String> authorizerAppIds) {
public List<StudioEmbeddedXcxApply> listByStudioIdAndAppId(Long studioId, String componentAppId,
String systemXcxAppId, List<String> appIds) {
QueryWrapper<StudioEmbeddedXcxApply> wrapper = new QueryWrapper<>();
wrapper.eq(StudioEmbeddedXcxApply.STUDIO_ID, studioId);
wrapper.in(StudioEmbeddedXcxApply.COMPONENT_APP_ID, componentAppId);
wrapper.in(StudioEmbeddedXcxApply.APP_ID, systemXcxAppId);
wrapper.in(StudioEmbeddedXcxApply.AUTHORIZER_APP_ID, authorizerAppIds);
wrapper.eq(StudioEmbeddedXcxApply.COMPONENT_APP_ID, componentAppId);
wrapper.eq(StudioEmbeddedXcxApply.AUTHORIZER_APP_ID, systemXcxAppId);
wrapper.in(StudioEmbeddedXcxApply.APP_ID, appIds);
return Optional.ofNullable(this.baseMapper.selectList(wrapper)).orElse(new ArrayList<>(1));
}
public StudioEmbeddedXcxApply getByStudioIdAndAuthorizerAppId(Long studioId, String componentAppId,
String systemXcxAppId, String authorizerAppId) {
public StudioEmbeddedXcxApply getByStudioIdAndAppId(Long studioId, String componentAppId,
String systemXcxAppId, String appId) {
QueryWrapper<StudioEmbeddedXcxApply> wrapper = new QueryWrapper<>();
wrapper.eq(StudioEmbeddedXcxApply.STUDIO_ID, studioId);
wrapper.in(StudioEmbeddedXcxApply.COMPONENT_APP_ID, componentAppId);
wrapper.in(StudioEmbeddedXcxApply.APP_ID, systemXcxAppId);
wrapper.eq(StudioEmbeddedXcxApply.AUTHORIZER_APP_ID, authorizerAppId);
wrapper.eq(StudioEmbeddedXcxApply.COMPONENT_APP_ID, componentAppId);
wrapper.eq(StudioEmbeddedXcxApply.APP_ID, appId);
wrapper.eq(StudioEmbeddedXcxApply.AUTHORIZER_APP_ID, systemXcxAppId);
return Optional.ofNullable(this.baseMapper.selectList(wrapper))
.orElse(new ArrayList<>(1))
.stream().findFirst().orElse(null);
}
public List<StudioEmbeddedXcxApply> listByAuthorizerAppIds(String componentAppId, String systemXcxAppId,
List<String> authorizerAppIds) {
public List<StudioEmbeddedXcxApply> listByAppIds(String componentAppId, String systemXcxAppId,
List<String> appIds) {
QueryWrapper<StudioEmbeddedXcxApply> wrapper = new QueryWrapper<>();
wrapper.in(StudioEmbeddedXcxApply.COMPONENT_APP_ID, componentAppId);
wrapper.in(StudioEmbeddedXcxApply.APP_ID, systemXcxAppId);
wrapper.in(StudioEmbeddedXcxApply.AUTHORIZER_APP_ID, authorizerAppIds);
wrapper.eq(StudioEmbeddedXcxApply.COMPONENT_APP_ID, componentAppId);
wrapper.eq(StudioEmbeddedXcxApply.AUTHORIZER_APP_ID, systemXcxAppId);
wrapper.in(StudioEmbeddedXcxApply.APP_ID, appIds);
return Optional.ofNullable(this.baseMapper.selectList(wrapper)).orElse(new ArrayList<>(1));
}
}
......@@ -17,12 +17,12 @@ import java.util.stream.Collectors;
public class StudioEmbeddedXcxConvert {
public static StudioEmbeddedXcxApply toEntity(Long studioId, String componentAppId, String systemXcxAppId,
String authorizerAppId) {
String appId) {
StudioEmbeddedXcxApply record = new StudioEmbeddedXcxApply();
record.setId(IdWorker.getId());
record.setComponentAppId(componentAppId);
record.setAppId(systemXcxAppId);
record.setAuthorizerAppId(authorizerAppId);
record.setAuthorizerAppId(systemXcxAppId);
record.setAppId(appId);
record.setStudioId(studioId);
record.setState(EmbededXcxEnum.INIT.getCode());
record.setCreateTime(new Date());
......
......@@ -257,10 +257,10 @@ public class StudioMerchantServiceImpl implements StudioMerchantService {
}
@Override
public StudioEmbeddedXcxVO getEmbeddedXcx(Long studioId, String authorizerAppId) {
public StudioEmbeddedXcxVO getEmbeddedXcx(Long studioId, String appId) {
String systemAppId = this.listSystemXcxAppIds().stream().findFirst().orElse(null);
StudioEmbeddedXcxApply embeddedXcx = studioEmbeddedXcxApplyRpService.getByStudioIdAndAuthorizerAppId(
studioId, wxComponentAppId, systemAppId, authorizerAppId);
StudioEmbeddedXcxApply embeddedXcx = studioEmbeddedXcxApplyRpService.getByStudioIdAndAppId(
studioId, wxComponentAppId, systemAppId, appId);
if (null == embeddedXcx) {
return null;
}
......@@ -269,8 +269,8 @@ public class StudioMerchantServiceImpl implements StudioMerchantService {
@Async("financeThreadPool")
@Override
public void bindEmbeddedXcx(Long studioId, List<String> authorizerAppIds) {
if (CollectionUtil.isEmpty(authorizerAppIds)) {
public void bindEmbeddedXcx(Long studioId, List<String> appIds) {
if (CollectionUtil.isEmpty(appIds)) {
return;
}
String systemXcxAppId = this.listSystemXcxAppIds().stream().findFirst().orElse(null);
......@@ -278,9 +278,9 @@ public class StudioMerchantServiceImpl implements StudioMerchantService {
return;
}
Map<String, StudioEmbeddedXcxApply> existMap = studioEmbeddedXcxApplyRpService.mapByStudioIdAndAuthorizerAppId(
studioId, wxComponentAppId, systemXcxAppId, authorizerAppIds);
authorizerAppIds.stream()
Map<String, StudioEmbeddedXcxApply> existMap = studioEmbeddedXcxApplyRpService.mapByStudioIdAndAppId(
studioId, wxComponentAppId, systemXcxAppId, appIds);
appIds.stream()
.filter(appId -> null == existMap.get(appId) || EmbededXcxEnum.isFail(existMap.get(appId).getState()))
.forEach(appId -> {
log.info("bind embedded xcx {}, {}", studioId, appId);
......@@ -321,7 +321,7 @@ public class StudioMerchantServiceImpl implements StudioMerchantService {
return;
}
List<StudioEmbeddedXcxApply> applies = studioEmbeddedXcxApplyRpService.listByAuthorizerAppIds(
List<StudioEmbeddedXcxApply> applies = studioEmbeddedXcxApplyRpService.listByAppIds(
wxComponentAppId, systemAppId, list.stream().map(AuthXcxInfo::getAppId).collect(Collectors.toList()));
if (CollectionUtil.isEmpty(applies)) {
return;
......
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