|
|
@@ -29,6 +29,7 @@ import com.webflux.launchcommon.returnObj.Paged;
|
|
|
import com.webflux.launchcommon.returnObj.RStatus;
|
|
|
import com.webflux.launchcommon.utils.StringUtils;
|
|
|
import jakarta.annotation.Resource;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.poi.ss.usermodel.Cell;
|
|
|
import org.apache.poi.ss.usermodel.Row;
|
|
|
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
|
|
@@ -51,6 +52,7 @@ import java.util.*;
|
|
|
import java.util.concurrent.atomic.AtomicInteger;
|
|
|
import java.util.stream.Collectors;
|
|
|
@Service
|
|
|
+@Slf4j
|
|
|
public class MaterialManagementImpl implements MaterialManagementInterface {
|
|
|
@Resource
|
|
|
private SourceMaterialInterface sourceMaterialInterface;
|
|
|
@@ -547,12 +549,22 @@ public class MaterialManagementImpl implements MaterialManagementInterface {
|
|
|
return RStatus.success(booleanMono);
|
|
|
}
|
|
|
private Mono<RStatus<Boolean>> addAlbum(AlbumReq albumReq, String userName, String userId, List<AlbumItemReq> list) {
|
|
|
- Mono<Boolean> then = Flux.fromIterable(list).flatMap(item -> albumItemRepository
|
|
|
- .save(new AlbumItem(null, item.getUrl(), item.getStatus()))
|
|
|
- .flatMap(f->{
|
|
|
- return albumItemInterface.saveMysqlAndRedisCache(f)
|
|
|
- .onErrorResume(throwable -> Mono.error(new BaseException("cache-"+throwable.getMessage()+"--"+JSONUtil.toJsonStr(f))));
|
|
|
- }))
|
|
|
+ Mono<Boolean> then = Flux.fromIterable(list).flatMap(item ->
|
|
|
+ {
|
|
|
+ AlbumItem albumItem = new AlbumItem(null, item.getUrl(), item.getStatus());
|
|
|
+ return albumItemRepository.save(albumItem)
|
|
|
+ .flatMap(f->{
|
|
|
+ log.error(f.id()+"----------------");
|
|
|
+ return Mono.just(f);
|
|
|
+ })
|
|
|
+ // template.insert(new AlbumItem(null, item.getUrl(), item.getStatus()))
|
|
|
+ //albumItemRepository.save(new AlbumItem(null, item.getUrl(), item.getStatus()))
|
|
|
+ .flatMap(f->{
|
|
|
+ return albumItemInterface.saveMysqlAndRedisCache(f)
|
|
|
+ .onErrorResume(throwable -> Mono.error(new BaseException("cache-"+throwable.getMessage()+"--"+JSONUtil.toJsonStr(f))));
|
|
|
+ });
|
|
|
+ }
|
|
|
+ )
|
|
|
.collectList()
|
|
|
.switchIfEmpty(Mono.just(List.of()))
|
|
|
.flatMap(items -> {
|