Browse Source

fix: 运行月报数据查询数据格式调整

zhongwei
haungxing 3 months ago
parent
commit
3e55baa1e8
  1. 3
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/constants/FuncRouteEnum.java
  2. 4
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/schedule/RunReportAnalyseSchedule.java

3
hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/constants/FuncRouteEnum.java

@ -24,7 +24,8 @@ public enum FuncRouteEnum {
SHOW_PARAM("result_record","设备参数查询", FunctionConstants.TypeEnum.PARAMS), SHOW_PARAM("result_record","设备参数查询", FunctionConstants.TypeEnum.PARAMS),
CHOOSE_YC("choose_yc","选择遥测数据",FunctionConstants.TypeEnum.CHOOSE), CHOOSE_YC("choose_yc","选择遥测数据",FunctionConstants.TypeEnum.CHOOSE),
HISTORY_DATA("history_data","查询历史数据",FunctionConstants.TypeEnum.CHART), HISTORY_DATA("history_data","查询历史数据",FunctionConstants.TypeEnum.CHART),
CONTROL_DEVICE("control_device","设备控制",FunctionConstants.TypeEnum.PARAMS) CONTROL_DEVICE("control_device","设备控制",FunctionConstants.TypeEnum.PARAMS),
SHOW_DATA("show_data","智能分析",FunctionConstants.TypeEnum.PARAMS)
; ;
@Getter @Getter
private String func; private String func;

4
hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/schedule/RunReportAnalyseSchedule.java

@ -45,11 +45,11 @@ public class RunReportAnalyseSchedule {
if(Func.isNotEmpty(answerVOS)) { if(Func.isNotEmpty(answerVOS)) {
AnswerVO answerVO = answerVOS.get(0); AnswerVO answerVO = answerVOS.get(0);
if(answerVO.getRunning() == 0) { if(answerVO.getRunning() == 0) {
log.info("运行月报分析结果为:" + answerVO.getAnswer()); log.info("运行月报分析结果为:" + JSON.toJSONString(answerVO));
JSONObject message = new JSONObject(); JSONObject message = new JSONObject();
message.put("stationCode", analyseObject.getString("stationCode")); message.put("stationCode", analyseObject.getString("stationCode"));
message.put("month", analyseObject.getString("month")); message.put("month", analyseObject.getString("month"));
message.put("result", answerVO.getAnswer()); message.put("result", JSONObject.parseObject(JSON.toJSONString(answerVO.getExtras()[0])).getString("data"));
// 获取到问答答案,存入消息中 // 获取到问答答案,存入消息中
mqttSender.sendToMqtt(MqttTopicConstants.RUN_REPORT_ANALYSE_RESULT,JSON.toJSONString(message)); mqttSender.sendToMqtt(MqttTopicConstants.RUN_REPORT_ANALYSE_RESULT,JSON.toJSONString(message));
redisTemplate.opsForList().remove(RedisKeyConstants.RUN_REPORT_SESSION_ID,1,analyse); redisTemplate.opsForList().remove(RedisKeyConstants.RUN_REPORT_SESSION_ID,1,analyse);

Loading…
Cancel
Save