|
|
@@ -38,6 +38,7 @@ import com.usky.iot.domain.*;
|
|
|
import com.usky.common.security.utils.SecurityUtils;
|
|
|
import com.usky.iot.mapper.DmpDeviceInfoMapper;
|
|
|
import com.usky.iot.mapper.DmpProductAttributeMapper;
|
|
|
+import com.usky.iot.mapper.DmpProductInfoMapper;
|
|
|
import com.usky.iot.service.*;
|
|
|
import com.usky.iot.service.config.DeviceOperate;
|
|
|
import com.usky.iot.service.enums.TopicInfo;
|
|
|
@@ -106,7 +107,7 @@ public class DmpDeviceInfoServiceImpl extends AbstractCrudService<DmpDeviceInfoM
|
|
|
private DeviceOperate deviceOperate;
|
|
|
|
|
|
@Autowired
|
|
|
- private DmpProductInfoService dmpProductInfoService;
|
|
|
+ private DmpProductInfoMapper dmpProductInfoMapper;
|
|
|
|
|
|
@Autowired
|
|
|
private DmpDeviceTypeService dmpDeviceTypeService;
|
|
|
@@ -1255,17 +1256,16 @@ public class DmpDeviceInfoServiceImpl extends AbstractCrudService<DmpDeviceInfoM
|
|
|
if (CollectionUtil.isEmpty(productIds)) {
|
|
|
return Collections.emptyMap();
|
|
|
}
|
|
|
- LambdaQueryWrapper<DmpProductInfo> productQuery = Wrappers.lambdaQuery();
|
|
|
- productQuery.select(DmpProductInfo::getId, DmpProductInfo::getDeviceType)
|
|
|
- .in(DmpProductInfo::getId, productIds)
|
|
|
- .eq(DmpProductInfo::getDeleteFlag, 0);
|
|
|
- List<DmpProductInfo> products = dmpProductInfoService.list(productQuery);
|
|
|
+ List<Map<String, Object>> products = dmpProductInfoMapper.selectDeviceTypeByProductIds(productIds);
|
|
|
if (CollectionUtil.isEmpty(products)) {
|
|
|
return Collections.emptyMap();
|
|
|
}
|
|
|
|
|
|
Map<Integer, Integer> productDeviceTypeMap = products.stream()
|
|
|
- .collect(Collectors.toMap(DmpProductInfo::getId, DmpProductInfo::getDeviceType, (a, b) -> a));
|
|
|
+ .collect(Collectors.toMap(
|
|
|
+ map -> Integer.valueOf(map.get("id").toString()),
|
|
|
+ map -> Integer.valueOf(map.get("deviceType").toString()),
|
|
|
+ (a, b) -> a));
|
|
|
|
|
|
Set<String> typeCodes = productDeviceTypeMap.values().stream()
|
|
|
.filter(Objects::nonNull)
|