From 498802bf47684b0379f803e60a655c5bd01a309e Mon Sep 17 00:00:00 2001 From: liyongxiang Date: Wed, 5 Mar 2025 18:18:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/example/demo/service/impl/BasicServiceImpl.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/demo/src/main/java/com/example/demo/service/impl/BasicServiceImpl.java b/demo/src/main/java/com/example/demo/service/impl/BasicServiceImpl.java index afea17d..6fd2438 100644 --- a/demo/src/main/java/com/example/demo/service/impl/BasicServiceImpl.java +++ b/demo/src/main/java/com/example/demo/service/impl/BasicServiceImpl.java @@ -1,5 +1,6 @@ package com.example.demo.service.impl; +import com.alibaba.fastjson.JSON; import com.example.demo.constant.EleConstant; import com.example.demo.constant.StaConstant; import com.example.demo.mapper.ElectricityBillMapper; @@ -30,12 +31,11 @@ public class BasicServiceImpl implements BasicService { Response response = new Response(); List bills = new ArrayList<>(); TypeAndQuery typeAndQuery = new TypeAndQuery(); - String type =new String(); - Integer querySymbol = new Integer(0); analysisKeyWord(keyWord,typeAndQuery); if (0 == typeAndQuery.getQuerySymbol()){ log.info("不支持的查询类型"); response.setSta(StaConstant.UNSUPPORTED_QUERY_TYPE); + response.setMessage("failed"); response.setData("暂时还不支持查询此类问题,您可以说查询电费或查询电量"); return response; } @@ -44,6 +44,7 @@ public class BasicServiceImpl implements BasicService { if (1 == typeAndQuery.getQuerySymbol()){ log.info("数据库查询电量!"); response.setSta(StaConstant.UNSUPPORTED_QUERY_TYPE); + response.setMessage("failed"); response.setData("电量查询暂未开放!"); return response; }else if (2 == typeAndQuery.getQuerySymbol()){ @@ -51,10 +52,12 @@ public class BasicServiceImpl implements BasicService { bills = electricityBillMapper.queryElectricityByDate(); dataAndView.setData(bills); response.setSta(StaConstant.SUCCESS); + response.setMessage("success"); response.setData(dataAndView); }else { log.info("暂时还没有此类查询!"); response.setSta(StaConstant.UNSUPPORTED_QUERY_TYPE); + response.setMessage("failed"); response.setData("暂时还不支持查询此类问题,您可以说查询电费或查询电量"); return response; }