Explorar o código

错误提示优化

wangmiaomiao hai 11 meses
pai
achega
7d1a5ffe49

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

@@ -267,11 +267,11 @@ public class GRPCController extends BaseController {
         //请求参数
         Integer module = chatReq.getModule();//来自那个模块
         Date reportDate = chatReq.getReportDate();//如果传过值来了 代表的是工单类型的问答
-        if(!Objects.isNull(reportDate) && module != 1){
+        if(Objects.isNull(reportDate) && module == 1){//工单 必须要输入日期
             //智能工单需要传入一个时间的参数
             try {
                 outputStream = response.getOutputStream();
-                outputStream.write(CHAT_ERROR_MSG.getBytes());
+                outputStream.write(CHAT_GONGDAN_1_ERROR_MSG.getBytes());
                 outputStream.flush();
             } catch (IOException e) {
                 throw new RuntimeException(e);
@@ -296,7 +296,7 @@ public class GRPCController extends BaseController {
                 //没有查询到数据
                 try {
                     outputStream = response.getOutputStream();
-                    outputStream.write(CHAT_GONGDAN_ERROR_MSG.getBytes());
+                    outputStream.write(CHAT_GONGDAN_2_ERROR_MSG.getBytes());
                     outputStream.flush();
                 } catch (IOException e) {
                     throw new RuntimeException(e);

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

@@ -73,8 +73,8 @@ public class MyConstants {
 
 
 
-    public static final String CHAT_ERROR_MSG = "请求参数与智慧工单需要类型不一致,请检查";
-    public static final String CHAT_GONGDAN_ERROR_MSG = "输入的日期,没有查询到当天或者前一天的日报数据";
+    public static final String CHAT_GONGDAN_1_ERROR_MSG = "智能工单问答必须要选择一个日期";
+    public static final String CHAT_GONGDAN_2_ERROR_MSG = "很抱歉,当前日期指标没有数据,请查证后再试";
 
     public static final String GONGDAN_TITLE = "请生成#{0}智能工单分析报告";