|
|
|
@ -10,15 +10,20 @@ import com.hnac.hzims.fdp.entity.FdpFaultTableListEntity;
|
|
|
|
|
import com.hnac.hzims.fdp.service.IFdpListTableDataService; |
|
|
|
|
import com.hnac.hzims.fdp.util.HttpRequestUtil; |
|
|
|
|
import com.hnac.hzims.fdp.vo.FdpFaultTableDataVo; |
|
|
|
|
import com.hnac.hzims.operational.station.entity.StationEntity; |
|
|
|
|
import com.hnac.hzims.operational.station.feign.IStationClient; |
|
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
|
import org.springblade.core.tool.utils.CollectionUtil; |
|
|
|
|
import org.springblade.core.tool.utils.ObjectUtil; |
|
|
|
|
import org.springblade.core.tool.utils.StringUtil; |
|
|
|
|
import org.springframework.beans.factory.annotation.Value; |
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
|
|
import javax.xml.ws.WebServiceException; |
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
import java.util.HashMap; |
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.Map; |
|
|
|
@ -33,6 +38,8 @@ import java.util.Map;
|
|
|
|
|
@RequiredArgsConstructor |
|
|
|
|
@Slf4j |
|
|
|
|
public class FdpListTableDataServiceImpl implements IFdpListTableDataService { |
|
|
|
|
@Resource |
|
|
|
|
private IStationClient stationClient; |
|
|
|
|
@Value("${url.getNeoFaultPropertyList}") |
|
|
|
|
private String getNeoFaultPropertyList; |
|
|
|
|
@Value("${url.getNeoFaultTableData}") |
|
|
|
@ -42,6 +49,21 @@ public class FdpListTableDataServiceImpl implements IFdpListTableDataService {
|
|
|
|
|
Map<String,Object> params = new HashMap<>(); |
|
|
|
|
params.put("property",property); |
|
|
|
|
String result = HttpRequestUtil.postCall(params,getNeoFaultPropertyList,"POST"); |
|
|
|
|
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())){ |
|
|
|
|
for (String s : res.getData()) { |
|
|
|
|
R<StationEntity> stationEntityR = stationClient.getStationByCode(s); |
|
|
|
|
if (stationEntityR.isSuccess()&&ObjectUtil.isNotEmpty(stationEntityR.getData())){ |
|
|
|
|
StationEntity station = stationEntityR.getData(); |
|
|
|
|
list.add(station); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return R.data(list); |
|
|
|
|
} |
|
|
|
|
R<List<String>> res = JSONObject.parseObject(result, new TypeReference<R<List<String>>>() { |
|
|
|
|
}); |
|
|
|
|
return res; |
|
|
|
|