Browse Source

#HZ100C修改

(cherry picked from commit 87a9a720b6)
zhongwei
yang_shj 1 year ago committed by haungxing
parent
commit
683fe8bfd6
  1. 6
      hzims-service/equipment/src/main/java/com/hnac/hzims/emParam/service/impl/ParamServiceImpl.java

6
hzims-service/equipment/src/main/java/com/hnac/hzims/emParam/service/impl/ParamServiceImpl.java

@ -70,17 +70,17 @@ public class ParamServiceImpl implements IParamService {
public List<ParamTreeVO> recall(String emCode,String stationCode) { public List<ParamTreeVO> recall(String emCode,String stationCode) {
List<ParamTreeVO> result = Lists.newArrayList(); List<ParamTreeVO> result = Lists.newArrayList();
// 获取设备物模型中是参数的属性 // 获取设备物模型中是参数的属性
Result<List<DeviceInstanceAttrVO>> paramDeviceAttrR = deviceDataClient.getIsParamDeviceAttr(emCode); R<List<DeviceInstanceAttrVO>> paramDeviceAttrR = deviceClient.getOnlineAttr(emCode);
Assert.isTrue(paramDeviceAttrR.isSuccess() && CollectionUtil.isNotEmpty(paramDeviceAttrR.getData()),() -> { Assert.isTrue(paramDeviceAttrR.isSuccess() && CollectionUtil.isNotEmpty(paramDeviceAttrR.getData()),() -> {
throw new ServiceException("获取设备实例物模型属性失败!"); throw new ServiceException("获取设备实例物模型属性失败!");
}); });
// 获取实时数据 // 获取实时数据
List<String> signageList = paramDeviceAttrR.getData().stream().map(DeviceInstanceAttrVO::getSignage).filter(StringUtil::isNotBlank).collect(Collectors.toList()); List<String> signageList = paramDeviceAttrR.getData().stream().filter(o->StringUtil.isNotBlank(o.getSignage()) && StringUtil.isNotBlank(o.getFacDeviceAttrId())).map(DeviceInstanceAttrVO::getSignage).collect(Collectors.toList());
Result<DeviceDataDTO> realDataR = deviceDataClient.getDeviceRealDataByCode(emCode, signageList); Result<DeviceDataDTO> realDataR = deviceDataClient.getDeviceRealDataByCode(emCode, signageList);
Assert.isTrue(realDataR.isSuccess(),() -> { Assert.isTrue(realDataR.isSuccess(),() -> {
throw new ServiceException("参数召回获取实时数据失败"); throw new ServiceException("参数召回获取实时数据失败");
}); });
Map<ParamGroupVO, List<ParamVO>> paramGroupVOListMap = paramDeviceAttrR.getData().stream().map(this::convert).collect(Collectors.groupingBy(p -> { Map<ParamGroupVO, List<ParamVO>> paramGroupVOListMap = paramDeviceAttrR.getData().stream().filter(o->StringUtil.isNotBlank(o.getFacDeviceAttrId())).map(this::convert).collect(Collectors.groupingBy(p -> {
ParamGroupVO paramGroupVO = new ParamGroupVO(); ParamGroupVO paramGroupVO = new ParamGroupVO();
paramGroupVO.setGroupId(String.valueOf(p.getModelClassifyId())); paramGroupVO.setGroupId(String.valueOf(p.getModelClassifyId()));
paramGroupVO.setGroupName(p.getModelClassifyName()); paramGroupVO.setGroupName(p.getModelClassifyName());

Loading…
Cancel
Save