|
|
@@ -149,11 +149,18 @@ public class GoGenerateService {
|
|
|
return template.select(Query.query(Criteria.where("type").is(6).and("deleted_at").isNull()), Material.class)
|
|
|
.collectList();
|
|
|
}
|
|
|
- private Mono<List<Material>> getTextListsTitleH5(Long groupTypeId) {
|
|
|
- return template.select(Query.query(Criteria.where("type").is(6)
|
|
|
- .and("group_type_id").is(groupTypeId)
|
|
|
- .and("deleted_at").isNull()), Material.class)
|
|
|
- .collectList();
|
|
|
+ private Mono<List<Material>> getTextListsTitleH5(GoRequest goRequest) {
|
|
|
+
|
|
|
+ Optional<Item> first = goRequest.getItem().stream().filter(ft -> "title".equals(ft.getT())).findFirst();
|
|
|
+ if (first.isPresent() && Objects.nonNull(first.get().getGroupTypeIdSc())) {
|
|
|
+ return template.select(Query.query(Criteria.where("type").is(6)
|
|
|
+ .and("group_type_id").is(first.get().getGroupTypeIdSc())
|
|
|
+ .and("deleted_at").isNull()), Material.class)
|
|
|
+ .collectList();
|
|
|
+ }else {
|
|
|
+ return Mono.just(List.of(getMaterialNull()));
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
private Mono<List<Material>> getTextListsTitleSaveOrUpdatePlan(GoRequest goRequest) {
|
|
|
Optional<Item> first = goRequest.getItem().stream().filter(ft -> "title".equals(ft.getT())).findFirst();
|
|
|
@@ -205,7 +212,29 @@ public class GoGenerateService {
|
|
|
// }else {
|
|
|
// groupId=0L;
|
|
|
// }
|
|
|
- return getStringMonoOut(goRequest, stringBuilderMono, getBgImageYx(), getFmImageListsYx(groupId), getTextListsYx(groupId),getImageTypeYx(groupId),getTextListsTitleH5(groupId));
|
|
|
+
|
|
|
+ Optional<Item> firstImage = goRequest.getItem().stream().filter(ft -> "image".equals(ft.getT())).findFirst();
|
|
|
+ Long imageGroupId=0L;
|
|
|
+ if (firstImage.isPresent() && Objects.nonNull(firstImage.get().getGroupTypeIdSc())) {
|
|
|
+ imageGroupId=firstImage.get().getGroupTypeIdSc();
|
|
|
+ }
|
|
|
+ Optional<Item> firstImage1 = goRequest.getItem().stream().filter(ft -> "text".equals(ft.getT())).findFirst();
|
|
|
+ Long imageGroupId1=0L;
|
|
|
+ if (firstImage1.isPresent() && Objects.nonNull(firstImage1.get().getGroupTypeIdSc())) {
|
|
|
+ imageGroupId1=firstImage1.get().getGroupTypeIdSc();
|
|
|
+ }
|
|
|
+ Optional<Item> firstImage2 = goRequest.getItem().stream().filter(ft -> "cover".equals(ft.getT())).findFirst();
|
|
|
+ Long imageGroupId2=0L;
|
|
|
+ if (firstImage2.isPresent() && Objects.nonNull(firstImage2.get().getGroupTypeIdSc())) {
|
|
|
+ imageGroupId2=firstImage2.get().getGroupTypeIdSc();
|
|
|
+ }
|
|
|
+ return getStringMonoOut(goRequest,
|
|
|
+ stringBuilderMono,
|
|
|
+ getBgImageYx(),
|
|
|
+ getFmImageListsYx(imageGroupId),
|
|
|
+ getTextListsYx(imageGroupId1),
|
|
|
+ getImageTypeYx(imageGroupId2),
|
|
|
+ getTextListsTitleH5(goRequest));
|
|
|
}
|
|
|
|
|
|
public Mono<String> getOutTemPosterQs(GoRequest goRequest,Mono<List<StringBuilder>> stringBuilderMono, Long groupId){
|
|
|
@@ -216,13 +245,28 @@ public class GoGenerateService {
|
|
|
// }else {
|
|
|
// groupId=0L;
|
|
|
// }
|
|
|
+ Optional<Item> firstImage = goRequest.getItem().stream().filter(ft -> "image".equals(ft.getT())).findFirst();
|
|
|
+ Long imageGroupId=0L;
|
|
|
+ if (firstImage.isPresent() && Objects.nonNull(firstImage.get().getGroupTypeIdSc())) {
|
|
|
+ imageGroupId=firstImage.get().getGroupTypeIdSc();
|
|
|
+ }
|
|
|
+ Optional<Item> firstImage1 = goRequest.getItem().stream().filter(ft -> "text".equals(ft.getT())).findFirst();
|
|
|
+ Long imageGroupId1=0L;
|
|
|
+ if (firstImage1.isPresent() && Objects.nonNull(firstImage1.get().getGroupTypeIdSc())) {
|
|
|
+ imageGroupId1=firstImage1.get().getGroupTypeIdSc();
|
|
|
+ }
|
|
|
+ Optional<Item> firstImage2 = goRequest.getItem().stream().filter(ft -> "cover".equals(ft.getT())).findFirst();
|
|
|
+ Long imageGroupId2=0L;
|
|
|
+ if (firstImage2.isPresent() && Objects.nonNull(firstImage2.get().getGroupTypeIdSc())) {
|
|
|
+ imageGroupId2=firstImage2.get().getGroupTypeIdSc();
|
|
|
+ }
|
|
|
return getStringMonoOut(goRequest,
|
|
|
stringBuilderMono,
|
|
|
getBgImageQs(),
|
|
|
- getFmImageListsQs(groupId),
|
|
|
- getTextListsQs(groupId),
|
|
|
- getImageTypeQs(groupId),
|
|
|
- getTextListsTitleH5(groupId));
|
|
|
+ getFmImageListsQs(imageGroupId),
|
|
|
+ getTextListsQs(imageGroupId1),
|
|
|
+ getImageTypeQs(imageGroupId2),
|
|
|
+ getTextListsTitleH5(goRequest));
|
|
|
}
|
|
|
private Mono<List<Image>> getBgImageQs() {
|
|
|
return template.select(Query.query(Criteria.where("type").is(2).and("group_type").is(2).and("deleted_at").isNull()), Image.class).collectList();
|
|
|
@@ -250,14 +294,17 @@ public class GoGenerateService {
|
|
|
|
|
|
|
|
|
private Mono<List<Material>> getTextListsYx(Long id) {
|
|
|
- return template.select(Query.query(Criteria.where("type").is(14) .and("group_type_id").is(id)
|
|
|
+ return template.select(Query.query(Criteria.where("type").is(14)
|
|
|
+ .and("group_type_id").is(id)
|
|
|
.and("group_type").is(1).and("deleted_at").isNull()), Material.class).collectList();
|
|
|
}
|
|
|
private Mono<List<Image>> getBgImageYx() {
|
|
|
return template.select(Query.query(Criteria.where("type").is(2).and("group_type").is(1).and("deleted_at").isNull()), Image.class).collectList();
|
|
|
}
|
|
|
private Mono<List<Image>> getFmImageListsYx(Long id) {
|
|
|
- return template.select(Query.query(Criteria.where("type").is(10) .and("group_type_id").is(id).and("group_type").is(1).and("deleted_at").isNull()), Image.class).collectList();
|
|
|
+ return template.select(Query.query(Criteria.where("type").is(10)
|
|
|
+ .and("group_type_id").is(id).and("group_type")
|
|
|
+ .is(1).and("deleted_at").isNull()), Image.class).collectList();
|
|
|
}
|
|
|
private Mono<List<Image>> getImageTypeYx(Long id){
|
|
|
return template.select(Query.query(Criteria.where("type").is(1) .and("group_type_id").is(id).and("group_type").is(1).and("deleted_at").isNull()), Image.class).collectList();
|