Commit 600c723c by 程裕兵

feat:添加半屏小程序

parent 41fe69ff
...@@ -74,4 +74,13 @@ public class StudioEmbeddedXcxConvert { ...@@ -74,4 +74,13 @@ public class StudioEmbeddedXcxConvert {
.build()) .build())
.collect(Collectors.toList()); .collect(Collectors.toList());
} }
public static StudioEmbeddedXcxApply toInit(StudioEmbeddedXcxApply entity) {
StudioEmbeddedXcxApply toInit = new StudioEmbeddedXcxApply();
toInit.setId(entity.getId());
toInit.setState(EmbededXcxEnum.INIT.getCode());
toInit.setCreateTime(new Date());
toInit.setUpdateTime(new Date());
return toInit;
}
} }
...@@ -263,12 +263,17 @@ public class StudioMerchantServiceImpl implements StudioMerchantService { ...@@ -263,12 +263,17 @@ public class StudioMerchantServiceImpl implements StudioMerchantService {
Map<String, StudioEmbeddedXcxApply> existMap = studioEmbeddedXcxApplyRpService.mapByStudioIdAndAuthorizerAppId( Map<String, StudioEmbeddedXcxApply> existMap = studioEmbeddedXcxApplyRpService.mapByStudioIdAndAuthorizerAppId(
studioId, wxComponentAppId, systemXcxAppId, authorizerAppIds); studioId, wxComponentAppId, systemXcxAppId, authorizerAppIds);
authorizerAppIds.stream() authorizerAppIds.stream()
.filter(appId -> null == existMap.get(appId)) .filter(appId -> null == existMap.get(appId) || EmbededXcxEnum.isFail(existMap.get(appId).getState()))
.forEach(appId -> { .forEach(appId -> {
log.info("bind embedded xcx {}, {}", studioId, appId); log.info("bind embedded xcx {}, {}", studioId, appId);
StudioEmbeddedXcxApply entity = StudioEmbeddedXcxConvert.toEntity(studioId, wxComponentAppId,
systemXcxAppId, appId); StudioEmbeddedXcxApply entity = existMap.get(appId);
studioEmbeddedXcxApplyRpService.insert(entity); if (null == entity) {
entity = StudioEmbeddedXcxConvert.toEntity(studioId, wxComponentAppId, systemXcxAppId, appId);
studioEmbeddedXcxApplyRpService.insert(entity);
} else {
studioEmbeddedXcxApplyRpService.updateById(StudioEmbeddedXcxConvert.toInit(entity));
}
try { try {
JSONObject result = weXcxService.addEmbeddedXcx(wxComponentAppId, appId, systemXcxAppId, JSONObject result = weXcxService.addEmbeddedXcx(wxComponentAppId, appId, systemXcxAppId,
"申请半屏小程序"); "申请半屏小程序");
......
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