Browse Source

fix:返回前端响应对象extras添加funcCode

zhongwei
haungxing 7 months ago
parent
commit
c9026a3f80
  1. 2
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/configuration/BigModelInvokeUrl.java
  2. 2
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/IInteractiveService.java
  3. 1
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/ExtraResolveStrategyService.java
  4. 9
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/InteractiveServiceImpl.java
  5. 1
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/JumpRouteJoinStrategy.java
  6. 1
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/ParamStrategy.java
  7. 21
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/schedule/InteractiveSchedule.java
  8. 2
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/schedule/XxlJobHandlerConstant.java

2
hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/configuration/BigModelInvokeUrl.java

@ -23,6 +23,8 @@ public class BigModelInvokeUrl {
private String updateVideo; private String updateVideo;
private String updateFault;
private String updateCanvas; private String updateCanvas;
} }

2
hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/IInteractiveService.java

@ -26,6 +26,8 @@ public interface IInteractiveService {
Boolean updateCanvas(Map<String,Object> request); Boolean updateCanvas(Map<String,Object> request);
void updateFault(Map<String,Object> request);
List<AnswerVO> getAnswerBySessionIds(String sessionIds); List<AnswerVO> getAnswerBySessionIds(String sessionIds);
Boolean authentication(String stationId, String userId, String funcCode); Boolean authentication(String stationId, String userId, String funcCode);

1
hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/ExtraResolveStrategyService.java

@ -64,6 +64,7 @@ public class ExtraResolveStrategyService {
params.put("fdpDeviceName",data.getString("device_name")); params.put("fdpDeviceName",data.getString("device_name"));
params.put("fdpOrd",data.getString("ord")); params.put("fdpOrd",data.getString("ord"));
result.setParams(params); result.setParams(params);
result.setFuncCode(FuncRouteEnum.DIAGNOSE.getFuncCode());
result.setType(FunctionConstants.TypeEnum.PARAMS.getType()); result.setType(FunctionConstants.TypeEnum.PARAMS.getType());
return result; return result;
} }

9
hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/InteractiveServiceImpl.java

@ -162,6 +162,15 @@ public class InteractiveServiceImpl implements IInteractiveService {
} }
@Override @Override
public void updateFault(Map<String, Object> request) {
HttpResponse response = HttpRequest.post(fdpHost + bigModelInvokeUrl.getUpdateFault())
.body(JSON.toJSONString(request)).execute();
Assert.isTrue(response.getStatus() == HttpServletResponse.SC_OK, () -> {
throw new ServiceException("远程调用大模型【更新故障列表】接口失败!");
});
}
@Override
public List<AnswerVO> getAnswerBySessionIds(String sessionIds) { public List<AnswerVO> getAnswerBySessionIds(String sessionIds) {
Map<String,Object> params = new HashMap<>(); Map<String,Object> params = new HashMap<>();
params.put("ids",Func.toStrList(",",sessionIds).toArray()); params.put("ids",Func.toStrList(",",sessionIds).toArray());

1
hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/JumpRouteJoinStrategy.java

@ -47,6 +47,7 @@ public class JumpRouteJoinStrategy {
// 跳转页面逻辑 // 跳转页面逻辑
ExtraVO extraVO = new ExtraVO(); ExtraVO extraVO = new ExtraVO();
extraVO.setImmediatelyJump(true); extraVO.setImmediatelyJump(true);
extraVO.setFuncCode(FuncRouteEnum.OPEN_SCADA.getFuncCode());
Map<String, String> params = this.scadaResolve(args); Map<String, String> params = this.scadaResolve(args);
// 根据hz3000画面版本获取path // 根据hz3000画面版本获取path
Integer picResource = Integer.valueOf(params.get("picResource")); Integer picResource = Integer.valueOf(params.get("picResource"));

1
hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/ParamStrategy.java

@ -55,6 +55,7 @@ public class ParamStrategy {
if(videoR.isSuccess()) { if(videoR.isSuccess()) {
StationVideoTypeEntity video = videoR.getData(); StationVideoTypeEntity video = videoR.getData();
extraVO.setType(FunctionConstants.TypeEnum.PARAMS.getType()); extraVO.setType(FunctionConstants.TypeEnum.PARAMS.getType());
extraVO.setFuncCode(FuncRouteEnum.OPEN_VIDEO.getFuncCode());
Map<String,Object> params = new HashMap<>(); Map<String,Object> params = new HashMap<>();
params.put("name", video.getName()); params.put("name", video.getName());
params.put("videoHost", video.getVideoHost()); params.put("videoHost", video.getVideoHost());

21
hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/schedule/InteractiveSchedule.java

@ -192,4 +192,25 @@ public class InteractiveSchedule {
Boolean status = interactiveService.updateCanvas(param); Boolean status = interactiveService.updateCanvas(param);
return ReturnT.SUCCESS; return ReturnT.SUCCESS;
} }
//@XxlJob(SYNCHRONOUS_FAULT_INSTRUCT) String params
@Scheduled(cron = "0/10 * * * * ?")
public ReturnT synchronousFaultInstruct() {
Map<String,Object> request = new HashMap<>(2);
// 获取站点列表
R<List<StationEntity>> stationsR = stationClient.list(new StationEntity());
if(!stationsR.isSuccess() || CollectionUtil.isEmpty(stationsR.getData())) {
XxlJobLogger.log("获取站点列表失败!");
return ReturnT.FAIL;
}
List<UpdateStationVO> updateStationList = stationsR.getData().stream().map(station -> {
UpdateStationVO stationVO = new UpdateStationVO();
stationVO.setId(station.getCode());
stationVO.setName(station.getName());
return stationVO;
}).collect(Collectors.toList());
request.put("stations", updateStationList);
interactiveService.updateFault(request);
return ReturnT.SUCCESS;
}
} }

2
hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/schedule/XxlJobHandlerConstant.java

@ -9,6 +9,8 @@ public interface XxlJobHandlerConstant {
/**获取问答结果**/ /**获取问答结果**/
String GET_INTERACTIVE_RESULT = "getInteractiveResult"; String GET_INTERACTIVE_RESULT = "getInteractiveResult";
String SYNCHRONOUS_FAULT_INSTRUCT = "synchronousFaultInstruct";
/**同步视频指令**/ /**同步视频指令**/
String SYNCHRONOUS_VIDEO_INSTRUCT = "synchronousVideoInstruct"; String SYNCHRONOUS_VIDEO_INSTRUCT = "synchronousVideoInstruct";

Loading…
Cancel
Save