|
|
@ -22,7 +22,6 @@ import org.springframework.stereotype.Service; |
|
|
import java.util.*; |
|
|
import java.util.*; |
|
|
import java.util.function.Function; |
|
|
import java.util.function.Function; |
|
|
import java.util.stream.Collectors; |
|
|
import java.util.stream.Collectors; |
|
|
import java.util.stream.IntStream; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* @author SiYang |
|
|
* @author SiYang |
|
|
@ -172,6 +171,9 @@ public class StationScreenServiceImpl implements StationScreenService { |
|
|
public List<ScreenData> getScreenData() { |
|
|
public List<ScreenData> getScreenData() { |
|
|
List<StationSimpleDTO> stationList = stationInfoService.getSimpleListWithGunStatus(); |
|
|
List<StationSimpleDTO> stationList = stationInfoService.getSimpleListWithGunStatus(); |
|
|
List<String> stationIds = stationList.stream().map(StationSimpleDTO::getStationId).toList(); |
|
|
List<String> stationIds = stationList.stream().map(StationSimpleDTO::getStationId).toList(); |
|
|
|
|
|
|
|
|
|
|
|
List<IotThingEntityDTO> entityDTOList = thingEntityService.findEntityAllByCode(stationIds, UserContext.getRealTenantCode(), true); |
|
|
|
|
|
|
|
|
List<TsKvDTO> tskvList = |
|
|
List<TsKvDTO> tskvList = |
|
|
tsKvService.findTsKvByCodesAndAttrs( |
|
|
tsKvService.findTsKvByCodesAndAttrs( |
|
|
stationIds, |
|
|
stationIds, |
|
|
@ -180,6 +182,11 @@ public class StationScreenServiceImpl implements StationScreenService { |
|
|
System.currentTimeMillis(), |
|
|
System.currentTimeMillis(), |
|
|
true); |
|
|
true); |
|
|
List<StationMapData> mapDataList = StationMapData.assemble(stationList, tskvList); |
|
|
List<StationMapData> mapDataList = StationMapData.assemble(stationList, tskvList); |
|
|
return mapDataList.stream().map(StationMapData::toScreenData).collect(Collectors.toList()); |
|
|
|
|
|
|
|
|
List<ScreenData> collect = mapDataList.stream().map(StationMapData::toScreenData).toList(); |
|
|
|
|
|
for (ScreenData screenData : collect) { |
|
|
|
|
|
IotThingEntityDTO entityDTO = entityDTOList.stream().filter(e -> e.getCode().equals(screenData.getId().toString())).findFirst().orElse(null); |
|
|
|
|
|
screenData.setImg(entityDTO == null ? "" : entityDTO.getImg()); |
|
|
|
|
|
} |
|
|
|
|
|
return collect; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |