|
|
|
@ -40,10 +40,10 @@ import com.hnac.hzims.fdp.vo.*;
|
|
|
|
|
import com.hnac.hzims.fdp.wrapper.FdpMonitorWrapper; |
|
|
|
|
import com.hnac.hzims.monitor.dto.FdpMonitorBindingDTO; |
|
|
|
|
import com.hnac.hzims.monitor.utils.DateUtils; |
|
|
|
|
import com.hnac.hzims.util.HttpClientUtils; |
|
|
|
|
import com.hnac.hzims.util.pojo.HttpResponse; |
|
|
|
|
import com.hnac.hzims.operational.station.entity.StationEntity; |
|
|
|
|
import com.hnac.hzims.operational.station.feign.IStationClient; |
|
|
|
|
import com.hnac.hzims.util.HttpClientUtils; |
|
|
|
|
import com.hnac.hzims.util.pojo.HttpResponse; |
|
|
|
|
import com.hnac.hzinfo.datasearch.analyse.IAnalyseDataSearchClient; |
|
|
|
|
import com.hnac.hzinfo.datasearch.analyse.IAnalyseInstanceClient; |
|
|
|
|
import com.hnac.hzinfo.datasearch.analyse.domain.FieldsData; |
|
|
|
@ -54,7 +54,6 @@ import com.hnac.hzinfo.datasearch.analyse.vo.AnalyzeDataConditionVO;
|
|
|
|
|
import com.hnac.hzinfo.datasearch.analyse.vo.AnalyzeInstanceFieldVO; |
|
|
|
|
import com.hnac.hzinfo.datasearch.real.IRealDataSearchClient; |
|
|
|
|
import com.hnac.hzinfo.datasearch.real.po.RealDataSearchPO; |
|
|
|
|
|
|
|
|
|
import com.xxl.job.core.log.XxlJobLogger; |
|
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
@ -66,6 +65,7 @@ import org.springblade.core.mp.support.Query;
|
|
|
|
|
import org.springblade.core.secure.utils.AuthUtil; |
|
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
|
import org.springblade.core.tool.utils.*; |
|
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
|
import org.springframework.beans.factory.annotation.Value; |
|
|
|
|
import org.springframework.data.redis.core.RedisTemplate; |
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
@ -113,6 +113,9 @@ public class FdpMonitorServiceImpl extends BaseServiceImpl<FdpMonitorMapper, Fdp
|
|
|
|
|
@Value("${url.updateFaultState_All}") |
|
|
|
|
public String updateFaultStateAll; |
|
|
|
|
|
|
|
|
|
@Value("${url.getRealByFault}") |
|
|
|
|
public String getRealByFault; |
|
|
|
|
|
|
|
|
|
@Value("${hzims.equipment.fdp.fdpReturnValuePath}") |
|
|
|
|
public String fdpReturnValuePath; |
|
|
|
|
|
|
|
|
@ -805,8 +808,56 @@ public class FdpMonitorServiceImpl extends BaseServiceImpl<FdpMonitorMapper, Fdp
|
|
|
|
|
} |
|
|
|
|
return vo; |
|
|
|
|
} |
|
|
|
|
@Override |
|
|
|
|
public R dataBackV2(String faultId) { |
|
|
|
|
Map<String, Object> resultMap = new HashMap<>(); |
|
|
|
|
resultMap.put("faultId", faultId); |
|
|
|
|
String post = HttpRequestUtil.postCallObjectParam(resultMap, getRealByFault, "POST"); |
|
|
|
|
FdpHttpResponseVo fdpHttpResponseVo = JSONObject.parseObject(post, new TypeReference<FdpHttpResponseVo>() {}); |
|
|
|
|
if (1==fdpHttpResponseVo.getSuccess()) { |
|
|
|
|
if (Func.isNotEmpty(fdpHttpResponseVo.getData())) { |
|
|
|
|
List<FdpFaultRealDataVO> list = JSONObject.parseObject(fdpHttpResponseVo.getData(), new TypeReference<List<FdpFaultRealDataVO>>() {}); |
|
|
|
|
if (CollectionUtil.isEmpty(list)){ |
|
|
|
|
return R.success("暂无数据,请稍后重试"); |
|
|
|
|
} |
|
|
|
|
List<FdpFaultRealDataVO> res =new ArrayList<>(); |
|
|
|
|
for (FdpFaultRealDataVO fdpFaultRealDataVO : list) { |
|
|
|
|
if (null!=fdpFaultRealDataVO.getReal()){ |
|
|
|
|
for (int i = 0; i < fdpFaultRealDataVO.getReal().size(); i++ ) { |
|
|
|
|
FdpFaultRealDataVO dataVO=new FdpFaultRealDataVO(); |
|
|
|
|
BeanUtils.copyProperties(fdpFaultRealDataVO,dataVO); |
|
|
|
|
String real = fdpFaultRealDataVO.getReal().get(i); |
|
|
|
|
Date time = fdpFaultRealDataVO.getRealTime().get(i); |
|
|
|
|
dataVO.setReal(Arrays.asList(real)); |
|
|
|
|
dataVO.setRealTime(Arrays.asList(time)); |
|
|
|
|
res.add(dataVO); |
|
|
|
|
} |
|
|
|
|
}else { |
|
|
|
|
res.add(fdpFaultRealDataVO); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// JSONObject jsonParams = JSONObject.parseObject(fdpHttpResponseVo.getData());
|
|
|
|
|
// list=list.stream().map(s -> {
|
|
|
|
|
// if ("单".equals(s.getMulti())) {
|
|
|
|
|
// if (null == s.getReal()) {
|
|
|
|
|
// s.setReal(new ArrayList<>().toString());
|
|
|
|
|
// } else {
|
|
|
|
|
// String real = jsonParams.get("real").toString();
|
|
|
|
|
// s.setReal(Arrays.asList(Double.valueOf(real)).toString());
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// return s;
|
|
|
|
|
// }).collect(Collectors.toList());
|
|
|
|
|
return R.data(res); |
|
|
|
|
} |
|
|
|
|
return R.success("暂无数据,请稍后重试"); |
|
|
|
|
} |
|
|
|
|
return R.fail("智能诊断接口异常,请联系管理员"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//此接口已经弃用20230628
|
|
|
|
|
@Deprecated |
|
|
|
|
@Override |
|
|
|
|
public Map<String, Object> dataBack(String faultId) { |
|
|
|
|
//根据故障ID查询监测点列表
|
|
|
|
|