|
@@ -62,7 +62,6 @@ public class GoGenerateService {
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
throw new BaseException(e.getMessage() + "body:::" + body + ":::request:::" + temStr);
|
|
throw new BaseException(e.getMessage() + "body:::" + body + ":::request:::" + temStr);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public String goGenerateStr(String temStr) {
|
|
public String goGenerateStr(String temStr) {
|
|
@@ -646,8 +645,6 @@ public class GoGenerateService {
|
|
|
throw new BaseException("群封面素材为空");
|
|
throw new BaseException("群封面素材为空");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- //groupHeadUrl(群头像);groupTitle(群名称)
|
|
|
|
|
- StringBuilder stringBuilder = getStringBuilder(goRequest);
|
|
|
|
|
Optional<Item> first5 = goRequest.getItem().stream().filter(f1 -> "qrcode".equals(f1.getT())).findFirst();
|
|
Optional<Item> first5 = goRequest.getItem().stream().filter(f1 -> "qrcode".equals(f1.getT())).findFirst();
|
|
|
if (first5.isPresent()) {
|
|
if (first5.isPresent()) {
|
|
|
Item item = first5.get();
|
|
Item item = first5.get();
|
|
@@ -659,7 +656,7 @@ public class GoGenerateService {
|
|
|
JSONArray jsonArray = JSONUtil.parseArray(kefu);
|
|
JSONArray jsonArray = JSONUtil.parseArray(kefu);
|
|
|
if (!jsonArray.isEmpty()) {
|
|
if (!jsonArray.isEmpty()) {
|
|
|
String s = jsonArray.get(0, String.class);
|
|
String s = jsonArray.get(0, String.class);
|
|
|
- item.setV(s+stringBuilder);
|
|
|
|
|
|
|
+ item.setV(s);
|
|
|
item.setName("客服二维码");
|
|
item.setName("客服二维码");
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
@@ -670,7 +667,7 @@ public class GoGenerateService {
|
|
|
if ("".equals(t6)) {
|
|
if ("".equals(t6)) {
|
|
|
throw new BaseException("获取H5链接为空");
|
|
throw new BaseException("获取H5链接为空");
|
|
|
}
|
|
}
|
|
|
- item.setV(t6.toString()+stringBuilder);
|
|
|
|
|
|
|
+ item.setV(t6.toString());
|
|
|
item.setName("H5二维码");
|
|
item.setName("H5二维码");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -745,38 +742,40 @@ public class GoGenerateService {
|
|
|
throw new BaseException("文字素材为空");
|
|
throw new BaseException("文字素材为空");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- String s1 = JSONUtil.toJsonStr(goRequest);
|
|
|
|
|
- String ret = goGenerateStr(s1);
|
|
|
|
|
- String url = ret;
|
|
|
|
|
- JSONObject jsonObject1 = JSONUtil.parseObj(ret);
|
|
|
|
|
- if (jsonObject1.containsKey("code") && jsonObject1.get("code", Integer.class) == 0 && jsonObject1.containsKey("data")) {
|
|
|
|
|
- JSONObject data = jsonObject1.get("data", JSONObject.class);
|
|
|
|
|
- if (data.containsKey("Url")) {
|
|
|
|
|
- url = data.get("Url", String.class);
|
|
|
|
|
|
|
+ // Integer groupListDisplay = saveRequest.getGroupListDisplay();
|
|
|
|
|
+ QrcodeInfo stringBuilder = getQrcodeInfo(goRequest);
|
|
|
|
|
+ Mono<QrcodeInfo> qrcodeInfoMono =template.insert(stringBuilder)
|
|
|
|
|
+ .switchIfEmpty(Mono.error(new BaseException("插入异常返回结果为空")))
|
|
|
|
|
+ .onErrorResume(throwable -> Mono.error(new BaseException("插入QrcodeInfo异常::::" + throwable.getMessage())));
|
|
|
|
|
+ return Mono.zip(qrcodeInfoMono,Mono.just(goRequest)).flatMap(fff->{
|
|
|
|
|
+ GoRequest t21 = fff.getT2();
|
|
|
|
|
+ t21.getItem().stream().filter(f1 -> "qrcode".equals(f1.getT())).forEach(fe->{
|
|
|
|
|
+ if (Objects.nonNull(fe.getV())) {
|
|
|
|
|
+ String qrcode = fe.getV() + "&id=" + fff.getT1().id();
|
|
|
|
|
+ fe.setV(qrcode);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ String s1 = JSONUtil.toJsonStr(t21);
|
|
|
|
|
+ String ret = goGenerateStr(s1);
|
|
|
|
|
+ String url = ret;
|
|
|
|
|
+ JSONObject jsonObject1 = JSONUtil.parseObj(ret);
|
|
|
|
|
+ if (jsonObject1.containsKey("code") && jsonObject1.get("code", Integer.class) == 0 && jsonObject1.containsKey("data")) {
|
|
|
|
|
+ JSONObject data = jsonObject1.get("data", JSONObject.class);
|
|
|
|
|
+ if (data.containsKey("Url")) {
|
|
|
|
|
+ url = data.get("Url", String.class);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
- return Mono.just(url);
|
|
|
|
|
|
|
+ return Mono.just(url);
|
|
|
|
|
+ });
|
|
|
}).onErrorResume(throwable -> Mono.error(new Exception("saveAndUpdatePlanGenerateImage1 error:" + throwable.getMessage())));
|
|
}).onErrorResume(throwable -> Mono.error(new Exception("saveAndUpdatePlanGenerateImage1 error:" + throwable.getMessage())));
|
|
|
- ;
|
|
|
|
|
return stringMono;
|
|
return stringMono;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private StringBuilder getStringBuilder(GoRequest goRequest) {
|
|
|
|
|
|
|
+ private QrcodeInfo getQrcodeInfo(GoRequest goRequest) {
|
|
|
Optional<Item> first = goRequest.getItem().stream().filter(ff -> "cover".equals(ff.getT()) ).findFirst();
|
|
Optional<Item> first = goRequest.getItem().stream().filter(ff -> "cover".equals(ff.getT()) ).findFirst();
|
|
|
Optional<Item> first3 = goRequest.getItem().stream().filter(ff -> "title".equals(ff.getT())).findFirst();
|
|
Optional<Item> first3 = goRequest.getItem().stream().filter(ff -> "title".equals(ff.getT())).findFirst();
|
|
|
- StringBuilder stringBuilder = new StringBuilder("&groupHeadUrl=");
|
|
|
|
|
- stringBuilder.append(first.isPresent()?first.get().getV():"");
|
|
|
|
|
- stringBuilder.append("&groupTitle=");
|
|
|
|
|
- String encodedParam ="";
|
|
|
|
|
- if(first3.isPresent() &&Objects.nonNull(first3.get().getV())){
|
|
|
|
|
- try {
|
|
|
|
|
- encodedParam = URLEncoder.encode(first3.get().getV(), StandardCharsets.UTF_8.toString());
|
|
|
|
|
- }catch (Exception e){
|
|
|
|
|
- throw new BaseException("URLEncoder Error"+e.getMessage());
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- stringBuilder.append(first3.isPresent()?encodedParam:"");
|
|
|
|
|
- return stringBuilder;
|
|
|
|
|
|
|
+ QrcodeInfo qrcodeInfo = new QrcodeInfo(null,first.isPresent()?first.get().getV():"",first3.isPresent()?first3.get().getV():"");
|
|
|
|
|
+ return qrcodeInfo;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public Mono<StringBuilder> getImportDomain(PlanReq saveRequest) {
|
|
public Mono<StringBuilder> getImportDomain(PlanReq saveRequest) {
|