Commit 600c723c by 程裕兵

feat:添加半屏小程序

parent 41fe69ff
......@@ -74,4 +74,13 @@ public class StudioEmbeddedXcxConvert {
.build())
.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 {
Map<String, StudioEmbeddedXcxApply> existMap = studioEmbeddedXcxApplyRpService.mapByStudioIdAndAuthorizerAppId(
studioId, wxComponentAppId, systemXcxAppId, authorizerAppIds);
authorizerAppIds.stream()
.filter(appId -> null == existMap.get(appId))
.filter(appId -> null == existMap.get(appId) || EmbededXcxEnum.isFail(existMap.get(appId).getState()))
.forEach(appId -> {
log.info("bind embedded xcx {}, {}", studioId, appId);
StudioEmbeddedXcxApply entity = StudioEmbeddedXcxConvert.toEntity(studioId, wxComponentAppId,
systemXcxAppId, appId);
StudioEmbeddedXcxApply entity = existMap.get(appId);
if (null == entity) {
entity = StudioEmbeddedXcxConvert.toEntity(studioId, wxComponentAppId, systemXcxAppId, appId);
studioEmbeddedXcxApplyRpService.insert(entity);
} else {
studioEmbeddedXcxApplyRpService.updateById(StudioEmbeddedXcxConvert.toInit(entity));
}
try {
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