Commit 1de1fc98 authored by 廖旭伟's avatar 廖旭伟

设备导入时根据产品名称写入产品id

parent e23ed62e
...@@ -619,6 +619,19 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D ...@@ -619,6 +619,19 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D
entity.setPlatformName(platformEntity.getPlatformName()); entity.setPlatformName(platformEntity.getPlatformName());
} }
} }
}else if (!ObjectUtils.isEmpty(entity.getProductName())) {
ProductEntity productEntity = productService.selectOne(new ProductQuery().productName(entity.getProductName()));
if (!ObjectUtils.isEmpty(productEntity)) {
entity.setProductId(productEntity.getId());
entity.setProductCode(productEntity.getProductCode());
//根据产品查询平台
if (!ObjectUtils.isEmpty(productEntity.getPlatformId())) {
PlatformEntity platformEntity = platformService.getCache(productEntity.getPlatformId().toString());
entity.setPlatformId(platformEntity.getId());
entity.setPlatformCode(platformEntity.getPlatformSn());
entity.setPlatformName(platformEntity.getPlatformName());
}
}
} }
if (!ObjectUtils.isEmpty(entity.getPlatformCode())) { if (!ObjectUtils.isEmpty(entity.getPlatformCode())) {
PlatformEntity platformEntity = platformService.selectOne(new PlatformQuery().platformSn(entity.getPlatformCode())); PlatformEntity platformEntity = platformService.selectOne(new PlatformQuery().platformSn(entity.getPlatformCode()));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment