From ee3bcbafe4c18320ee1e50faf7340e370b9e76f3 Mon Sep 17 00:00:00 2001 From: ty <1577900710@qq.com> Date: Tue, 6 Feb 2024 16:22:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=99=BA=E8=83=BD=E8=AF=8A?= =?UTF-8?q?=E6=96=AD=E5=88=97=E8=A1=A8=E9=A1=B5=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fdp/controller/FdpListTableDataController.java | 3 +++ .../service/impl/FdpListTableDataServiceImpl.java | 22 ++++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/controller/FdpListTableDataController.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/controller/FdpListTableDataController.java index 98a173b..a8b2bc1 100644 --- a/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/controller/FdpListTableDataController.java +++ b/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; /** * 分页 diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpListTableDataServiceImpl.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpListTableDataServiceImpl.java index a4a03ad..03eb3c1 100644 --- a/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpListTableDataServiceImpl.java +++ b/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 params = new HashMap<>(); params.put("property",property); String result = HttpRequestUtil.postCall(params,getNeoFaultPropertyList,"POST"); + if ("STATION".equals(property)){ + List list=new ArrayList<>(); + R> res = JSONObject.parseObject(result, new TypeReference>>() { + }); + if (res.isSuccess()&& CollectionUtil.isNotEmpty(res.getData())){ + for (String s : res.getData()) { + R stationEntityR = stationClient.getStationByCode(s); + if (stationEntityR.isSuccess()&&ObjectUtil.isNotEmpty(stationEntityR.getData())){ + StationEntity station = stationEntityR.getData(); + list.add(station); + } + } + } + return R.data(list); + } R> res = JSONObject.parseObject(result, new TypeReference>>() { }); return res;