Browse Source

Merge remote-tracking branch 'origin/master'

zhongwei
yang_shj 8 months ago
parent
commit
8791a2740f
  1. 36
      hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpListTableDataServiceImpl.java

36
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; private String getNeoFaultPropertyList;
@Value("${url.getNeoFaultTableData}") @Value("${url.getNeoFaultTableData}")
private String getNeoFaultTableData; private String getNeoFaultTableData;
@Override @Override
public R getProperty(String property) { public R getProperty(String property) {
Map<String,Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
params.put("property",property); params.put("property", property);
String result = HttpRequestUtil.postCall(params,getNeoFaultPropertyList,"POST"); Long startMillis=System.currentTimeMillis();
if ("STATION".equals(property)){ String result = HttpRequestUtil.postCall(params, getNeoFaultPropertyList, "POST");
List<StationEntity> list=new ArrayList<>(); 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>>>() { R<List<String>> res = JSONObject.parseObject(result, new TypeReference<R<List<String>>>() {
}); });
if (res.isSuccess()&& CollectionUtil.isNotEmpty(res.getData())){ 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()) { for (String s : res.getData()) {
R<StationEntity> stationEntityR = stationClient.getStationByCode(s); for (StationEntity station : listAll.getData()) {
if (stationEntityR.isSuccess()&&ObjectUtil.isNotEmpty(stationEntityR.getData())){ if (station.getCode().equals(s)) {
StationEntity station = stationEntityR.getData();
list.add(station); list.add(station);
} }
} }
} }
}
}
log.info("fdp查询站点列表项:耗时:"+(System.currentTimeMillis()-endMillis)+"ms");
return R.data(list); return R.data(list);
} }
R<List<String>> res = JSONObject.parseObject(result, new TypeReference<R<List<String>>>() { R<List<String>> res = JSONObject.parseObject(result, new TypeReference<R<List<String>>>() {
@ -72,9 +80,9 @@ public class FdpListTableDataServiceImpl implements IFdpListTableDataService {
@Override @Override
public R getListByProperty(FDPFaultListInfoDTO req) { public R getListByProperty(FDPFaultListInfoDTO req) {
IPage<FdpFaultTableListEntity> page = new Page<>(); IPage<FdpFaultTableListEntity> page = new Page<>();
req.setPageIndex(req.getPageIndex()-1); req.setPageIndex(req.getPageIndex() - 1);
page.setSize(req.getPageSize()); page.setSize(req.getPageSize());
page.setCurrent(req.getPageIndex()+1); page.setCurrent(req.getPageIndex() + 1);
req.setDisplay(1); req.setDisplay(1);
req.setIsRoot(0); req.setIsRoot(0);
req.setOrderBy("NAME"); req.setOrderBy("NAME");
@ -83,11 +91,11 @@ public class FdpListTableDataServiceImpl implements IFdpListTableDataService {
if (StringUtil.isNotBlank(result)) { if (StringUtil.isNotBlank(result)) {
R<FdpFaultTableDataVo> fdpFaultHistoryDataVoR = JSONObject.parseObject(result, new TypeReference<R<FdpFaultTableDataVo>>() { R<FdpFaultTableDataVo> fdpFaultHistoryDataVoR = JSONObject.parseObject(result, new TypeReference<R<FdpFaultTableDataVo>>() {
}); });
if (!fdpFaultHistoryDataVoR.isSuccess()){ if (!fdpFaultHistoryDataVoR.isSuccess()) {
throw new WebServiceException("请求失败,请紧急联系管理员!!!"); throw new WebServiceException("请求失败,请紧急联系管理员!!!");
} }
if (fdpFaultHistoryDataVoR.isSuccess()&&ObjectUtil.isNotEmpty(fdpFaultHistoryDataVoR.getData()) if (fdpFaultHistoryDataVoR.isSuccess() && ObjectUtil.isNotEmpty(fdpFaultHistoryDataVoR.getData())
&&ObjectUtil.isNotEmpty(fdpFaultHistoryDataVoR.getData().getList())){ && ObjectUtil.isNotEmpty(fdpFaultHistoryDataVoR.getData().getList())) {
List<FdpFaultTableListEntity> list = fdpFaultHistoryDataVoR.getData().getList(); List<FdpFaultTableListEntity> list = fdpFaultHistoryDataVoR.getData().getList();
page.setTotal(fdpFaultHistoryDataVoR.getData().getTotalCount()); page.setTotal(fdpFaultHistoryDataVoR.getData().getTotalCount());
page.setRecords(list); page.setRecords(list);

Loading…
Cancel
Save