Browse Source

修改智能诊断列表页接口

zhongwei
ty 12 months ago
parent
commit
ee3bcbafe4
  1. 3
      hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/controller/FdpListTableDataController.java
  2. 22
      hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpListTableDataServiceImpl.java

3
hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/controller/FdpListTableDataController.java

@ -14,6 +14,8 @@ import org.springblade.core.log.annotation.ApiLog;
import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
/**
* 故障诊断任务表
@ -27,6 +29,7 @@ import org.springframework.web.bind.annotation.*;
@Api(tags = "故障诊断任务表")
public class FdpListTableDataController extends BladeController {
@Resource
private final IFdpListTableDataService service;
/**
* 分页

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

@ -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;

Loading…
Cancel
Save