Browse Source

优化智能诊断列表页查询速度

zhongwei
ty 8 months ago
parent
commit
2ff1e14ce5
  1. 14
      hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpListTableDataServiceImpl.java

14
hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpListTableDataServiceImpl.java

@ -44,24 +44,32 @@ public class FdpListTableDataServiceImpl implements IFdpListTableDataService {
private String getNeoFaultPropertyList;
@Value("${url.getNeoFaultTableData}")
private String getNeoFaultTableData;
@Override
public R getProperty(String property) {
Map<String, Object> params = new HashMap<>();
params.put("property", property);
Long startMillis=System.currentTimeMillis();
String result = HttpRequestUtil.postCall(params, getNeoFaultPropertyList, "POST");
log.info("fdp查询列表项"+property+"耗时:"+(System.currentTimeMillis()-startMillis)+"ms");
Long endMillis=System.currentTimeMillis();
if ("STATION".equals(property)) {
List<StationEntity> list = new ArrayList<>();
R<List<String>> res = JSONObject.parseObject(result, new TypeReference<R<List<String>>>() {
});
if (res.isSuccess() && CollectionUtil.isNotEmpty(res.getData())) {
R<List<StationEntity>> listAll = stationClient.getListAll();
if (listAll.isSuccess() && ObjectUtil.isNotEmpty(listAll.getData())) {
for (String s : res.getData()) {
R<StationEntity> stationEntityR = stationClient.getStationByCode(s);
if (stationEntityR.isSuccess()&&ObjectUtil.isNotEmpty(stationEntityR.getData())){
StationEntity station = stationEntityR.getData();
for (StationEntity station : listAll.getData()) {
if (station.getCode().equals(s)) {
list.add(station);
}
}
}
}
}
log.info("fdp查询站点列表项:耗时:"+(System.currentTimeMillis()-endMillis)+"ms");
return R.data(list);
}
R<List<String>> res = JSONObject.parseObject(result, new TypeReference<R<List<String>>>() {

Loading…
Cancel
Save