Quellcode durchsuchen

调研大模型传参的MORM调整

王苗苗 vor 7 Monaten
Ursprung
Commit
8af4031d4d

+ 25 - 2
slibra-admin/src/main/java/com/slibra/web/controller/business/GRPCController.java

@@ -384,13 +384,15 @@ public class GRPCController extends BaseController {
         PolicyReq policyReq = new PolicyReq();
         //2024年7月11日17:57:53 因为化验室的改了  但是 调用决策还得用原来的几个值
         String category = xinyiWarningRecord.getCategory();
-        if(ROBOT_XSY_1.getCode().equalsIgnoreCase(category) || ROBOT_XSY_2.getCode().equalsIgnoreCase(category)){
+        /*if(ROBOT_XSY_1.getCode().equalsIgnoreCase(category) || ROBOT_XSY_2.getCode().equalsIgnoreCase(category)){
             category = CS_ZD.getCode();
         } else if (ROBOT_ANDAN_1.getCode().equalsIgnoreCase(category) || ROBOT_ANDAN_2.getCode().equalsIgnoreCase(category)) {
             category = CS_AD.getCode();
         }else if (ROBOT_ECCZLSY.getCode().equalsIgnoreCase(category)) {
             category = CS_ZL.getCode();
-        }
+        }*/
+        //2024年08月25日15:40:31 处理数据映射,改成字母,但是显示的还是中文
+        category = this.parseCategory(category);
         policyReq.setNorm(category);
 //        policyReq.setNorm(chatReq.getCategory());//2024年7月12日16:23:24  因为有转义。。。
         policyReq.setFeedback(StringUtils.isBlank(feedback) ? null : JSON.parseObject(feedback, Map.class));
@@ -412,6 +414,27 @@ public class GRPCController extends BaseController {
         return JSON.toJSONString(policyReq, JSONWriter.Feature.WriteNulls);
     }
 
+
+    private String parseCategory(String category) {
+        switch (category) {
+            case "进水COD" : return "js_cod";
+            case "进水总磷" : return "js_tp";
+            case "进水总氮" : return "js_tn";
+            case "进水氨氮" : return "js_andan";
+            case "进水SS" : return "js_ss";
+            case "出水COD" : return "cs_cod";
+            case "出水总磷" : return "cs_tp";
+            case "出水总氮" : return "cs_tn";
+            case "出水氨氮" : return "cs_andan";
+            case "出水SS" : return "cs_ss";
+            case "#1好氧硝酸盐" : return "cs_tn_lxjc1";
+            case "#2好氧硝酸盐" : return "cs_tn_lxjc2";
+            case "出水氨氮连续检测" : return "cs_andan_lxjc1";
+            case "二沉池正磷酸盐" : return "cs_tp_lxjc";
+            default: throw new ServiceException("暂时不支持的类型");
+        }
+    }
+
     private void addChatRecord(ChatReq chatReq, String sessionId, int type, String warningId, String question, List<String> resultData) {
         chatReq.setSessionId(sessionId);
         chatReq.setType(type);//类型(0问答 1决策 2本地 3仿真预测)

+ 1 - 1
slibra-admin/src/main/resources/application-dev.yml

@@ -109,7 +109,7 @@ application:
 #默认走测试环境
 big-model:
   ip: 10.0.0.24
-  port: 27070
+  port: 37070
   temperature: 0.7
   topP: 0.7
 

+ 1 - 0
slibra-common/src/main/java/com/slibra/common/enums/BusinessEnum.java

@@ -58,6 +58,7 @@ public class BusinessEnum {
         ROBOT_ECCZLSY("二沉池正磷酸盐", "二沉池正磷酸盐"),
         ROBOT_ANDAN_1("#1氨氮", "#1氨氮"),
         ROBOT_ANDAN_2("#2氨氮", "#2氨氮"),
+        ROBOT_CS_AD("出水氨氮连续检测", "出水氨氮连续检测"),
 
         //2024年7月26日11:11:06 氨氮报警(两个池子)合成一个出水氨氮  CS_AD
 

+ 26 - 3
slibra-quartz/src/main/java/com/slibra/quartz/task/AsyncTask.java

@@ -17,6 +17,7 @@ import com.slibra.common.constant.MyConstants;
 import com.slibra.common.core.domain.DecisionReq;
 import com.slibra.common.core.domain.TXinyiDaily;
 import com.slibra.common.enums.BusinessEnum;
+import com.slibra.common.exception.ServiceException;
 import com.slibra.common.utils.DateUtils;
 import com.slibra.common.utils.LocalDateTimeUtil;
 import com.slibra.common.utils.StringUtils;
@@ -1388,13 +1389,15 @@ public class AsyncTask {
             PolicyReq policyReq = new PolicyReq();
             //2024年7月11日17:57:53 因为化验室的改了  但是 调用决策还得用原来的几个值
             String category = tXinyiWarningRecord.getCategory();
-            if(ROBOT_XSY_1.getCode().equalsIgnoreCase(category) || ROBOT_XSY_2.getCode().equalsIgnoreCase(category)){
+            /*if(ROBOT_XSY_1.getCode().equalsIgnoreCase(category) || ROBOT_XSY_2.getCode().equalsIgnoreCase(category)){
                 category = CS_ZD.getCode();
             } else if (ROBOT_ANDAN_1.getCode().equalsIgnoreCase(category) || ROBOT_ANDAN_2.getCode().equalsIgnoreCase(category)) {
                 category = CS_AD.getCode();
             }else if (ROBOT_ECCZLSY.getCode().equalsIgnoreCase(category)) {
                 category = CS_ZL.getCode();
-            }
+            }*/
+            //2024年08月25日15:40:31 处理数据映射,改成字母,但是显示的还是中文
+            category = this.parseCategory(category);
             policyReq.setNorm(category);
             HashMap<String, Object> hashMap = new HashMap<>();
             policyReq.setFeedback(hashMap);//不能传null
@@ -1471,6 +1474,26 @@ public class AsyncTask {
         }
     }
 
+    private String parseCategory(String category) {
+        switch (category) {
+            case "进水COD" : return "js_cod";
+            case "进水总磷" : return "js_tp";
+            case "进水总氮" : return "js_tn";
+            case "进水氨氮" : return "js_andan";
+            case "进水SS" : return "js_ss";
+            case "出水COD" : return "cs_cod";
+            case "出水总磷" : return "cs_tp";
+            case "出水总氮" : return "cs_tn";
+            case "出水氨氮" : return "cs_andan";
+            case "出水SS" : return "cs_ss";
+            case "#1好氧硝酸盐" : return "cs_tn_lxjc1";
+            case "#2好氧硝酸盐" : return "cs_tn_lxjc2";
+            case "出水氨氮连续检测" : return "cs_andan_lxjc1";
+            case "二沉池正磷酸盐" : return "cs_tp_lxjc";
+            default: throw new ServiceException("暂时不支持的类型");
+        }
+    }
+
 
     /**
      * 2024年7月11日10:32:49 生化报警的展示额外处理(因为涉及到很多的单位)
@@ -2115,7 +2138,7 @@ public class AsyncTask {
             BigDecimal anDan2 = no3Qyc2Jqr.add(nh32Jqr).subtract(no3Hlj2Jqr);
             if(!Objects.isNull(csadBzz)){
                 BigDecimal divide = anDan1.add(anDan2).divide(DECIMAL_2, INT_2, RoundingMode.HALF_UP);
-                handleXinYiWarningsRobot(csadBzz, divide, csadGkz, CS_AD.getCode(), tXinyiIndustry, normConfig);
+                handleXinYiWarningsRobot(csadBzz, divide, csadGkz, ROBOT_CS_AD.getCode(), tXinyiIndustry, normConfig);
             }
         }
     }