|
|
@@ -12,6 +12,7 @@ import cn.hutool.json.JSONUtil;
|
|
|
import com.webflux.launchadmin.config.BaseContextHandler;
|
|
|
import com.webflux.launchadmin.global.BaseException;
|
|
|
import com.webflux.launchadmin.mysql.controller.planNew.req.AudioRequest;
|
|
|
+import com.webflux.launchadmin.mysql.controller.planNew.req.PlanReq;
|
|
|
import com.webflux.launchadmin.mysql.controller.planNew.req.PosterRequest;
|
|
|
import com.webflux.launchadmin.mysql.controller.planNew.req.ServiceGroupSettingItemRequest;
|
|
|
import com.webflux.launchadmin.mysql.controller.planNew.res.PosterRes;
|
|
|
@@ -126,6 +127,7 @@ public class GoGenerateService {
|
|
|
|
|
|
public Mono<String> getStringMonoOut(GoRequest goRequest, Mono<List<StringBuilder>> stringBuilderMono,
|
|
|
Mono<List<Image>> bgImage, Mono<List<Image>> fmImage, Mono<List<Material>> text,Mono<List<Image>> fm1) {
|
|
|
+
|
|
|
Mono<String> stringMono = Mono.zip(bgImage, fmImage, text, stringBuilderMono,fm1).flatMap(f -> {
|
|
|
List<StringBuilder> t4 = f.getT4();
|
|
|
|
|
|
@@ -135,6 +137,7 @@ public class GoGenerateService {
|
|
|
//封面
|
|
|
goRequest.getItem().stream().filter(ff -> "cover".equals(ff.getT()) && ff.getIsRandom()).findFirst()
|
|
|
.ifPresent(item -> item.setV(f.getT5().get(RandomUtil.randomInt(0, f.getT5().size())).image()));
|
|
|
+
|
|
|
//图片
|
|
|
Optional.ofNullable(f.getT2().get(RandomUtil.randomInt(0, f.getT2().size()))).ifPresent(image -> goRequest.getItem().stream()
|
|
|
.filter(ff -> "image".equals(ff.getT()) && ff.getIsRandom() )
|
|
|
@@ -160,8 +163,8 @@ public class GoGenerateService {
|
|
|
* @return
|
|
|
*/
|
|
|
|
|
|
- public Mono<String> saveAndUpdatePlanGenerateImage0(GoRequest goRequest,Mono<List<StringBuilder>> stringBuilderMono, ServiceGroupSettingItemRequest qsSetting ){
|
|
|
- return saveAndUpdatePlanGenerateImage1(goRequest, stringBuilderMono, getBgImage(), getFmImageLists0(), getTextLists(),getImageType1(), qsSetting);
|
|
|
+ public Mono<String> saveAndUpdatePlanGenerateImage0(GoRequest goRequest, Mono<List<StringBuilder>> stringBuilderMono, ServiceGroupSettingItemRequest qsSetting, PlanReq saveRequest ){
|
|
|
+ return saveAndUpdatePlanGenerateImage1(goRequest, stringBuilderMono, getBgImage(), getFmImageLists0(), getTextLists(),getImageType1(), qsSetting, saveRequest);
|
|
|
}
|
|
|
/**
|
|
|
* 计划保存修改生成图片
|
|
|
@@ -175,8 +178,9 @@ public class GoGenerateService {
|
|
|
*/
|
|
|
public Mono<String> saveAndUpdatePlanGenerateImage1(GoRequest goRequest, Mono<List<StringBuilder>> stringBuilderMono,
|
|
|
Mono<List<Image>> bgImage, Mono<List<Image>> fmImage, Mono<List<Material>> text,Mono<List<Image>> fm1,
|
|
|
- ServiceGroupSettingItemRequest qsSetting) {
|
|
|
- Mono<String> stringMono = Mono.zip(bgImage, fmImage, text, stringBuilderMono,fm1).flatMap(f -> {
|
|
|
+ ServiceGroupSettingItemRequest qsSetting,PlanReq saveRequest) {
|
|
|
+
|
|
|
+ Mono<String> stringMono = Mono.zip(bgImage, fmImage, text, stringBuilderMono,fm1,getStringBuilderMono(saveRequest.getPlanNewId())).flatMap(f -> {
|
|
|
List<StringBuilder> t4 = f.getT4();
|
|
|
|
|
|
Optional<Image> first = f.getT1().stream().findFirst();
|
|
|
@@ -197,8 +201,13 @@ public class GoGenerateService {
|
|
|
if (!jsonArray.isEmpty()) {
|
|
|
String s = jsonArray.get(0, String.class);
|
|
|
item.setV(s);
|
|
|
+ item.setName("客服二维码");
|
|
|
}
|
|
|
}
|
|
|
+ }else if(Objects.nonNull(qsSetting.getStatus()) && qsSetting.getStatus()==0) {
|
|
|
+ StringBuilder t6 = f.getT6();
|
|
|
+ item.setV(t6.toString());
|
|
|
+ item.setName("H5二维码");
|
|
|
}
|
|
|
}
|
|
|
//图片
|
|
|
@@ -227,6 +236,32 @@ public class GoGenerateService {
|
|
|
return stringMono;
|
|
|
}
|
|
|
|
|
|
+ public Mono<StringBuilder> getStringBuilderMono(Long planNewId) {
|
|
|
+ Mono<StringBuilder> stringBuilderMono1 = template.selectOne(Query.query(Criteria.where("plan_new_id").is(planNewId)), PlanNew.class)
|
|
|
+ .flatMap(f9 -> Mono.zip(Mono.just(f9), template.select(Query.query(Criteria.where("group_type_id").is(f9.groupId())
|
|
|
+ .and("status").is(1).and("type").is(1)), DomainSelect.class)
|
|
|
+ .collectList()
|
|
|
+ .switchIfEmpty(Mono.just(List.of())), (a, b) -> {
|
|
|
+ StringBuilder stringBuilder = new StringBuilder();
|
|
|
+ if (Objects.isNull(b) || b.isEmpty()) {
|
|
|
+ stringBuilder.append("生成计划链接 匹配域名为空");
|
|
|
+ } else {
|
|
|
+ DomainSelect domainSelect = b.get(RandomUtil.randomInt(0, b.size()));
|
|
|
+ stringBuilder.append("http://");
|
|
|
+ stringBuilder.append(get6Str());
|
|
|
+ stringBuilder.append(".");
|
|
|
+ stringBuilder.append(domainSelect.domain());
|
|
|
+ stringBuilder.append("/index.html?code=");
|
|
|
+ stringBuilder.append(a.code());
|
|
|
+ stringBuilder.append("&sk=");
|
|
|
+ stringBuilder.append(IdUtil.fastSimpleUUID());
|
|
|
+ }
|
|
|
+ return stringBuilder;
|
|
|
+ })
|
|
|
+ );
|
|
|
+ return stringBuilderMono1;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
private Mono<String> getStringMono(GoRequest goRequest, Mono<List<StringBuilder>> stringBuilderMono,
|
|
|
Mono<List<Image>> bgImage, Mono<List<Image>> fmImage, Mono<List<Material>> text,Mono<List<Image>> fm1) {
|