فهرست منبع

生成简报的提示词优化 小数调整 增加日期

wangmiaomiao 9 ماه پیش
والد
کامیت
905e9ca56d

+ 1 - 1
slibra-common/src/main/java/com/slibra/common/constant/MyConstants.java

@@ -88,7 +88,7 @@ public class MyConstants {
 
 
     public static final String SHORT_REPORT_BEGIN = "作为一个工艺分析师,请生成一份#{0}分析报告,根据我提供的详细数据,输出一份详细的分析报告。报告需数据准确、分析深入,建议具体可行,以便为水务管理和决策提供支持。报告分为三部分:\n" +
-            "1、进出水水质指标表格呈现,下面分析水质数据指标超标情况分析。\n" +
+            "1、进水、出水分别按照如下格式显示:日期:指标项-数值,再分析水质数据指标超标情况分析。\n" +
             "2、显示超标准值数据情况,并对比近七天数据,分析数据趋势 \n" +
             "3、提出针对性的改善建议,包括优化处理工艺点,对于超标的数据推送解决方案,每项调整点不要太概括,一定要给出具体调整数据。";
 

+ 24 - 23
slibra-quartz/src/main/java/com/slibra/quartz/task/RyTask.java

@@ -15,6 +15,7 @@ import com.slibra.business.req.DecisionReq;
 import com.slibra.business.res.ChartBasic;
 import com.slibra.business.res.ShowValueChartBasic;
 import com.slibra.business.service.ITXinyiForecastComparisonService;
+import com.slibra.common.DecimalUtils;
 import com.slibra.common.constant.MyConstants;
 import com.slibra.common.enums.BusinessEnum;
 import com.slibra.common.enums.DataSourceType;
@@ -2039,32 +2040,32 @@ public class RyTask
         String originStr = SHORT_REPORT_BEGIN.replace("#{0}", yesterdayData.getTestDate());
         StringBuilder sb = new StringBuilder(originStr);
         for (TXinyiDaily dailyTwoRecord : dailyTwoRecords) {
-            sb.append("进水:");
-            sb.append("进水COD").append(dailyTwoRecord.getJsCod()).append("mg/L");
-            sb.append("进水总氮").append(dailyTwoRecord.getJsTn()).append("mg/L");
-            sb.append("进水总磷").append(dailyTwoRecord.getJsTp()).append("mg/L");
-            sb.append("进水氨氮").append(dailyTwoRecord.getJsNh3()).append("mg/L");
-            sb.append("进水SS").append(dailyTwoRecord.getJsSs()).append("mg/L");
-            sb.append("进水水量").append(dailyTwoRecord.getJSL()).append("m³/d").append(";");
+            sb.append(formateDateStr(dailyTwoRecord.getTestDate())).append("进水:");
+            sb.append("进水COD").append(DecimalUtils.getAbsAndScale(dailyTwoRecord.getJsCod(), 2)).append("mg/L");
+            sb.append("进水总氮").append(DecimalUtils.getAbsAndScale(dailyTwoRecord.getJsTn(), 2)).append("mg/L");
+            sb.append("进水总磷").append(DecimalUtils.getAbsAndScale(dailyTwoRecord.getJsTp(), 2)).append("mg/L");
+            sb.append("进水氨氮").append(DecimalUtils.getAbsAndScale(dailyTwoRecord.getJsNh3(), 2)).append("mg/L");
+            sb.append("进水SS").append(DecimalUtils.getAbsAndScale(dailyTwoRecord.getJsSs(), 2)).append("mg/L");
+            sb.append("进水水量").append(DecimalUtils.getAbsAndScale(dailyTwoRecord.getJSL(), 2)).append("m³/d").append(";");
             sb.append("出水:");
-            sb.append("出水COD").append(dailyTwoRecord.getCsCod()).append("mg/L");
-            sb.append("出水总氮").append(dailyTwoRecord.getCsTn()).append("mg/L");
-            sb.append("出水总磷").append(dailyTwoRecord.getCsTp()).append("mg/L");
-            sb.append("出水氨氮").append(dailyTwoRecord.getCsNh3()).append("mg/L");
-            sb.append("出水SS").append(dailyTwoRecord.getCsSs()).append("mg/L");
-            sb.append("出水水量").append(dailyTwoRecord.getCSL()).append("m³/d").append("。");
+            sb.append("出水COD").append(DecimalUtils.getAbsAndScale(dailyTwoRecord.getCsCod(), 2)).append("mg/L");
+            sb.append("出水总氮").append(DecimalUtils.getAbsAndScale(dailyTwoRecord.getCsTn(), 2)).append("mg/L");
+            sb.append("出水总磷").append(DecimalUtils.getAbsAndScale(dailyTwoRecord.getCsTp(), 2)).append("mg/L");
+            sb.append("出水氨氮").append(DecimalUtils.getAbsAndScale(dailyTwoRecord.getCsNh3(), 2)).append("mg/L");
+            sb.append("出水SS").append(DecimalUtils.getAbsAndScale(dailyTwoRecord.getCsSs(), 2)).append("mg/L");
+            sb.append("出水水量").append(DecimalUtils.getAbsAndScale(dailyTwoRecord.getCSL(), 2)).append("m³/d").append("。\n");
         }
         sb.append(SHORT_REPORT_END);
-        sb.append("进水COD:").append(normConfig.getJscodSjz()).append("mg/L");
-        sb.append("进水总氮:").append(normConfig.getJszdSjz()).append("mg/L");
-        sb.append("进水总磷:").append(normConfig.getJszlSjz()).append("mg/L");
-        sb.append("进水氨氮:").append(normConfig.getJsadSjz()).append("mg/L");
-        sb.append("进水SS:").append(normConfig.getJsssSjz()).append("mg/L");
-        sb.append("出水COD:").append(normConfig.getCscodBzz()).append("mg/L");
-        sb.append("出水总氮:").append(normConfig.getCszzBzz()).append("mg/L");
-        sb.append("出水总磷:").append(normConfig.getCszlBzz()).append("mg/L");
-        sb.append("出水氨氮:").append(normConfig.getCsadBzz()).append("mg/L");
-        sb.append("出水SS:").append(normConfig.getCsssBzz()).append("mg/L").append("。");
+        sb.append("进水COD:").append(DecimalUtils.getAbsAndScale(normConfig.getJscodSjz(), 2)).append("mg/L");
+        sb.append("进水总氮:").append(DecimalUtils.getAbsAndScale(normConfig.getJszdSjz(), 2)).append("mg/L");
+        sb.append("进水总磷:").append(DecimalUtils.getAbsAndScale(normConfig.getJszlSjz(), 2)).append("mg/L");
+        sb.append("进水氨氮:").append(DecimalUtils.getAbsAndScale(normConfig.getJsadSjz(), 2)).append("mg/L");
+        sb.append("进水SS:").append(DecimalUtils.getAbsAndScale(normConfig.getJsssSjz(), 2)).append("mg/L");
+        sb.append("出水COD:").append(DecimalUtils.getAbsAndScale(normConfig.getCscodBzz(), 2)).append("mg/L");
+        sb.append("出水总氮:").append(DecimalUtils.getAbsAndScale(normConfig.getCszzBzz(), 2)).append("mg/L");
+        sb.append("出水总磷:").append(DecimalUtils.getAbsAndScale(normConfig.getCszlBzz(), 2)).append("mg/L");
+        sb.append("出水氨氮:").append(DecimalUtils.getAbsAndScale(normConfig.getCsadBzz(), 2)).append("mg/L");
+        sb.append("出水SS:").append(DecimalUtils.getAbsAndScale(normConfig.getCsssBzz(), 2)).append("mg/L").append("。");
         return sb.toString();
     }