功能调整

This commit is contained in:
xy
2025-07-16 09:10:00 +08:00
parent d277eba5fb
commit a607437225
2 changed files with 12 additions and 4 deletions

View File

@@ -315,7 +315,7 @@ public class DataServiceImpl implements IDataService {
if (Objects.equals(last.getDataType(),0)) {
moduleVO.setModuleState(last.getStateDesc());
} else if (Objects.equals(last.getDataType(),1)) {
moduleVO.setModuleState(Objects.equals(last.getEventCode(),"Alm_Apf_ModDisConnect") ? "离线" : "运行");
moduleVO.setModuleState(channelState2(last.getEventCode()));
}
//如果模块掉线超过30分钟则续上数据
LocalDateTime givenTime = last.getTime();
@@ -429,11 +429,15 @@ public class DataServiceImpl implements IDataService {
}
public String channelState2(String code) {
String str;
String str = null;
if ("Alm_Apf_ModDisConnect".equals(code)) {
str = "离线";
} else {
} else if ("Alm_Apf_ModRunStop".equals(code) || "Alm_Apf_JT_stsLock".equals(code) ) {
str = "停止";
} else if ("Alm_Apf_ModRunRun".equals(code)) {
str = "运行";
} else if ("Alm_Apf_ModRunFault".equals(code)) {
str = "故障";
}
return str;
}

View File

@@ -91,7 +91,11 @@ public class StatisticsDataDataServiceImpl implements IStatisticsDataDataService
//获取装置
List<CsEquipmentDeliveryPO> equipmentDeliveryList = equipmentFeignClient.getAll().getData();
if (CollectionUtil.isNotEmpty(equipmentDeliveryList)) {
List<CsEquipmentDeliveryPO> processList = equipmentDeliveryList.stream().filter(item-> Objects.equals(item.getProcess(),param.getProcess())).collect(Collectors.toList());
List<CsEquipmentDeliveryPO> processList = Objects.isNull(param.getProcess())
? equipmentDeliveryList
: equipmentDeliveryList.stream()
.filter(item -> Objects.equals(item.getProcess(), param.getProcess()))
.collect(Collectors.toList());
if (CollectionUtil.isNotEmpty(processList)) {
//获取监测点集合
List<String> devList = processList.stream().map(CsEquipmentDeliveryPO::getId).collect(Collectors.toList());