|
@@ -396,9 +396,10 @@ public class RyTask
|
|
|
* @param normConfig
|
|
|
* @param date
|
|
|
* @param yjHour
|
|
|
+ * @param nowDate
|
|
|
* @return
|
|
|
*/
|
|
|
- private String buildShowValueWithCharts(TXinyiWarningRecord tXinyiWarningRecord, TXinyiIndustry tXinyiIndustry, TXinyiNormConfig normConfig, List<ChartBasic> chartsDataList, String date, String yjHour) {
|
|
|
+ private String buildShowValueWithCharts(TXinyiWarningRecord tXinyiWarningRecord, TXinyiIndustry tXinyiIndustry, TXinyiNormConfig normConfig, List<ChartBasic> chartsDataList, String date, String yjHour, Date nowDate) {
|
|
|
JSONObject result = new JSONObject();
|
|
|
// JSONObject basic = new JSONObject();
|
|
|
Integer status = tXinyiWarningRecord.getStatus();
|
|
@@ -418,7 +419,7 @@ public class RyTask
|
|
|
//通用的
|
|
|
// showValueBasic.setA(tXinyiWarningRecord.getReason());
|
|
|
//2024年6月23日17:01:30 预警时间改成当前时间
|
|
|
- showValueChartBasic.setB(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM ,DateUtils.getNowDate()));
|
|
|
+ showValueChartBasic.setB(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM, nowDate));
|
|
|
showValueChartBasic.setC(date + " " + yjHour);//预计超标时间
|
|
|
showValueChartBasic.setD(tXinyiWarningRecord.getWarningVal());//改成现在值 不是报警时候的值(在发现存在告警记录的时候更新)
|
|
|
showValueChartBasic.setE(tXinyiWarningRecord.getForecastVal());//改成预测值 不是报警时候的值(在发现存在告警记录的时候更新)
|
|
@@ -1162,6 +1163,8 @@ public class RyTask
|
|
|
}
|
|
|
}
|
|
|
}else{//有告警信息
|
|
|
+ //2024年6月27日10:45:49 列表的预警时间和showval里的预警时间保持一致(用同一个,否则可能有一分钟左右的误差)
|
|
|
+ Date nowDate = DateUtils.getNowDate();
|
|
|
if(CollectionUtils.isEmpty(tXinyiWarningRecords)){//之前没有告警记录
|
|
|
//保存到数据库中
|
|
|
this.xinyiWarningRecordMapper.insertTXinyiWarningRecord(tXinyiWarningRecord);
|
|
@@ -1170,7 +1173,7 @@ public class RyTask
|
|
|
this.addChatRecordByDeviceErr(tXinyiWarningRecord, tXinyiIndustry, normConfig);
|
|
|
}else {
|
|
|
//继续调用大模型prompt
|
|
|
- this.askBigModelForYC(tXinyiWarningRecord, tXinyiIndustry, normConfig, chartsDataList, date, yjHour);
|
|
|
+ this.askBigModelForYC(tXinyiWarningRecord, tXinyiIndustry, normConfig, chartsDataList, date, yjHour, nowDate);
|
|
|
}
|
|
|
}else{
|
|
|
log.info("{}:之前已经有过告警记录了,且还是继续报警,无需重复添加报警,但是决策仍然要调用", category);
|
|
@@ -1183,19 +1186,19 @@ public class RyTask
|
|
|
xinyiWarningRecord.setForecastVal(tXinyiWarningRecord.getForecastVal());
|
|
|
xinyiWarningRecord.setWarningVal(currentVal);
|
|
|
xinyiWarningRecord.setTime(tXinyiWarningRecord.getTime());
|
|
|
- xinyiWarningRecord.setUpdateTime(DateUtils.getNowDate());
|
|
|
+ xinyiWarningRecord.setUpdateTime(nowDate);
|
|
|
xinyiWarningRecord.setUpdateBy(WARNING_DEFAULT_CREATE);
|
|
|
//更新数据库
|
|
|
this.xinyiWarningRecordMapper.updateTXinyiWarningRecord(xinyiWarningRecord);
|
|
|
//继续调用决策
|
|
|
- this.askBigModelForYC(xinyiWarningRecord, tXinyiIndustry, normConfig, chartsDataList, date, yjHour);
|
|
|
+ this.askBigModelForYC(xinyiWarningRecord, tXinyiIndustry, normConfig, chartsDataList, date, yjHour, nowDate);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private void askBigModelForYC(TXinyiWarningRecord xinyiWarningRecord, TXinyiIndustry tXinyiIndustry, TXinyiNormConfig normConfig, List<ChartBasic> chartsDataList, String date, String yjHour) {
|
|
|
+ private void askBigModelForYC(TXinyiWarningRecord xinyiWarningRecord, TXinyiIndustry tXinyiIndustry, TXinyiNormConfig normConfig, List<ChartBasic> chartsDataList, String date, String yjHour, Date nowDate) {
|
|
|
log.info("预测进入了后台接口调⽤⼤模型获取问答结果处理(预测)");
|
|
|
StringBuilder sb = new StringBuilder();
|
|
|
String sessionId = IdUtils.simpleUUID();
|
|
@@ -1242,7 +1245,7 @@ public class RyTask
|
|
|
chatReq.setSessionId(sessionId);
|
|
|
chatReq.setType(1);//0问答 1决策 2本地 3仿真预测 预测报警这里也算是决策 仿真预测是在调用仿真那里使用的
|
|
|
chatReq.setModule(3);//0专家问答 1智能工单 2智能体助手 3告警 4简报
|
|
|
- String showVal = this.buildShowValueWithCharts(xinyiWarningRecord, tXinyiIndustry, normConfig, chartsDataList, date, yjHour);
|
|
|
+ String showVal = this.buildShowValueWithCharts(xinyiWarningRecord, tXinyiIndustry, normConfig, chartsDataList, date, yjHour, nowDate);
|
|
|
chatReq.setShowVal(showVal);
|
|
|
chatReq.setQuestion(shWarningPrompt);
|
|
|
chatReq.setAnswer(sb.toString());
|