|
|
@@ -69,13 +69,7 @@ public class IotProductService {
|
|
|
iotProductVos.forEach(u -> {
|
|
|
Optional.ofNullable(userApi.queryUser(u.getCreateBy())).ifPresent(userCache -> u.setCreateByLabel(userCache.getName()));
|
|
|
Optional.ofNullable(userApi.queryUser(u.getUpdateBy())).ifPresent(userCache -> u.setUpdateByLabel(userCache.getName()));
|
|
|
- Optional.ofNullable(dictApi.query(DictType.AUTH_TYPE, String.valueOf(u.getAuthType()))).ifPresent(cache -> u.setAuthTypeLabel(cache.getLabel()));
|
|
|
Optional.ofNullable(dictApi.query(DictType.NODE_TYPE, String.valueOf(u.getNodeType()))).ifPresent(cache -> u.setNodeTypeLabel(cache.getLabel()));
|
|
|
- Optional.ofNullable(dictApi.query(DictType.NETWORK_TYPE, String.valueOf(u.getNetworkType()))).ifPresent(cache -> u.setNetworkTypeLabel(cache.getLabel()));
|
|
|
- Optional.ofNullable(dictApi.query(DictType.REPORT_PROTOCOL_TYPE, String.valueOf(u.getReportProtocol()))).ifPresent(cache -> u.setReportProtocolLabel(cache.getLabel()));
|
|
|
- Optional.ofNullable(dictApi.query(DictType.VENDORS_TYPE, String.valueOf(u.getVendors()))).ifPresent(cache -> u.setVendorsLabel(cache.getLabel()));
|
|
|
- Optional.ofNullable(dictApi.query(DictType.DATA_FORMAT_TYPE, String.valueOf(u.getDataFormat()))).ifPresent(cache -> u.setDataFormatLabel(cache.getLabel()));
|
|
|
-
|
|
|
});
|
|
|
return new PageRes<>(pageInfo, iotProductVos);
|
|
|
}
|
|
|
@@ -151,6 +145,14 @@ public class IotProductService {
|
|
|
}
|
|
|
IotProductDetailVo iotProductDetailVo = new IotProductDetailVo();
|
|
|
BeanUtils.copyProperties(iotProduct, iotProductDetailVo);
|
|
|
+ Optional.ofNullable(dictApi.query(DictType.AUTH_TYPE, String.valueOf(iotProductDetailVo.getAuthType()))).ifPresent(cache -> iotProductDetailVo.setAuthTypeLabel(cache.getLabel()));
|
|
|
+ Optional.ofNullable(dictApi.query(DictType.NODE_TYPE, String.valueOf(iotProductDetailVo.getNodeType()))).ifPresent(cache -> iotProductDetailVo.setNodeTypeLabel(cache.getLabel()));
|
|
|
+ Optional.ofNullable(dictApi.query(DictType.NETWORK_TYPE, String.valueOf(iotProductDetailVo.getNetworkType()))).ifPresent(cache -> iotProductDetailVo.setNetworkTypeLabel(cache.getLabel()));
|
|
|
+ Optional.ofNullable(dictApi.query(DictType.REPORT_PROTOCOL_TYPE, String.valueOf(iotProductDetailVo.getReportProtocol()))).ifPresent(cache -> iotProductDetailVo.setReportProtocolLabel(cache.getLabel()));
|
|
|
+ Optional.ofNullable(dictApi.query(DictType.VENDORS_TYPE, String.valueOf(iotProductDetailVo.getVendors()))).ifPresent(cache -> iotProductDetailVo.setVendorsLabel(cache.getLabel()));
|
|
|
+ Optional.ofNullable(dictApi.query(DictType.DATA_FORMAT_TYPE, String.valueOf(iotProductDetailVo.getDataFormat()))).ifPresent(cache -> iotProductDetailVo.setDataFormatLabel(cache.getLabel()));
|
|
|
+ Optional.ofNullable(userApi.queryUser(iotProductDetailVo.getCreateBy())).ifPresent(userCache -> iotProductDetailVo.setCreateByLabel(userCache.getName()));
|
|
|
+ Optional.ofNullable(userApi.queryUser(iotProductDetailVo.getUpdateBy())).ifPresent(userCache -> iotProductDetailVo.setUpdateByLabel(userCache.getName()));
|
|
|
return iotProductDetailVo;
|
|
|
}
|
|
|
|