修复产品名称不能为空的问题

This commit is contained in:
zhou-hao 2020-06-08 18:21:28 +08:00
parent a5d59bf73b
commit c842317d10
1 changed files with 4 additions and 1 deletions

View File

@ -369,9 +369,12 @@ public class DeviceInstanceController implements
.flatMap(DeviceProductOperator::getMetadata)
.map(metadata -> new DeviceWrapper(metadata.getTags()))
.defaultIfEmpty(DeviceWrapper.empty)
.zipWith(productService.findById(productId))
.flatMapMany(wrapper -> importExportService
.getInputStream(fileUrl)
.flatMapMany(inputStream -> ReactorExcel.read(inputStream, FileUtils.getExtension(fileUrl), wrapper)))
.flatMapMany(inputStream -> ReactorExcel.read(inputStream, FileUtils.getExtension(fileUrl), wrapper.getT1()))
.doOnNext(info -> info.setProductName(wrapper.getT2().getName()))
)
.map(info -> {
DeviceInstanceEntity entity = FastBeanCopier.copy(info, new DeviceInstanceEntity());
entity.setProductId(productId);