diff --git a/demo/src/main/java/com/example/demo/demos/web/controller/BasicController.java b/demo/src/main/java/com/example/demo/demos/web/controller/BasicController.java index ac0c4a9..9ff5b6c 100644 --- a/demo/src/main/java/com/example/demo/demos/web/controller/BasicController.java +++ b/demo/src/main/java/com/example/demo/demos/web/controller/BasicController.java @@ -25,6 +25,9 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.web.bind.annotation.*; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import java.util.Enumeration; import java.util.Map; /** @@ -48,9 +51,18 @@ public class BasicController { @PostMapping("/getElectricityInfo1") @ResponseBody public Object getElectricityInfo1(@RequestBody Map param) { - log.info("获取电费相1关信息入参:{}", JSON.toJSONString(param)); + log.info("获取电费相关1信息入参:{}", JSON.toJSONString(param)); Object response = basicService.getElectricityInfo1(param); - log.info("获取电费相1关信息响应:{}", JSON.toJSONString(response)); + log.info("获取电费相关1信息入参:{}", JSON.toJSONString(response)); + return response; + } + + @PostMapping("/getBindingInfo") + @ResponseBody + public Object getBindingInfo(HttpServletRequest request) { + log.info("获取绑定信息入参:token={},地区编码:{}", request.getHeader("x_auth_token"),request.getHeader("areaCode")); + Object response = basicService.getBindingInfo(); + log.info("获取绑定信息入参:{}", JSON.toJSONString(response)); return response; } diff --git a/demo/src/main/java/com/example/demo/mapper/ElecBillInfoMapper.java b/demo/src/main/java/com/example/demo/mapper/ElecBillInfoMapper.java new file mode 100644 index 0000000..a372ae6 --- /dev/null +++ b/demo/src/main/java/com/example/demo/mapper/ElecBillInfoMapper.java @@ -0,0 +1,13 @@ +package com.example.demo.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.example.demo.model.ElecBindInfo; +import com.example.demo.model.ElectricityBill; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +@Mapper +public interface ElecBillInfoMapper extends BaseMapper { + +} diff --git a/demo/src/main/java/com/example/demo/model/ElecBindInfo.java b/demo/src/main/java/com/example/demo/model/ElecBindInfo.java new file mode 100644 index 0000000..af6ee28 --- /dev/null +++ b/demo/src/main/java/com/example/demo/model/ElecBindInfo.java @@ -0,0 +1,21 @@ +package com.example.demo.model; + +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; +import org.springframework.stereotype.Component; + +@Data +@Component +public class ElecBindInfo { + + @TableId + private String id; + private String province; + private String city; + private String bindType; + private String elecNumber; + private String phone; + private String electricityAddress; + private String userNumber; + private String cityCode; +} diff --git a/demo/src/main/java/com/example/demo/service/BasicService.java b/demo/src/main/java/com/example/demo/service/BasicService.java index 7bd1d1e..48898f5 100644 --- a/demo/src/main/java/com/example/demo/service/BasicService.java +++ b/demo/src/main/java/com/example/demo/service/BasicService.java @@ -12,4 +12,6 @@ public interface BasicService { Response getElectricityInfo(Map param); Object getElectricityInfo1(Map param); + + Object getBindingInfo(); } 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 8abf160..c3c2a5f 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,13 +1,14 @@ package com.example.demo.service.impl; import com.alibaba.fastjson.JSON; +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.segments.MergeSegments; import com.example.demo.constant.EleConstant; import com.example.demo.constant.StaConstant; +import com.example.demo.mapper.ElecBillInfoMapper; import com.example.demo.mapper.ElectricityBillMapper; -import com.example.demo.model.DataAndView; -import com.example.demo.model.ElectricityBill; -import com.example.demo.model.Response; -import com.example.demo.model.TypeAndQuery; +import com.example.demo.model.*; import com.example.demo.service.BasicService; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; @@ -26,6 +27,9 @@ public class BasicServiceImpl implements BasicService { @Autowired ElectricityBillMapper electricityBillMapper; + @Autowired + ElecBillInfoMapper elecBillInfoMapper; + @Override public Response getElectricityInfo(Map param) { String keyWord = (String) param.get("kw"); @@ -88,6 +92,12 @@ public class BasicServiceImpl implements BasicService { return dataAndView; } + @Override + public Object getBindingInfo() { + QueryWrapper queryWrapper =new QueryWrapper<>(); + return elecBillInfoMapper.selectList(queryWrapper); + } + private void analysisKeyWord(String keyWord,TypeAndQuery typeAndQuery){ int querySymbol = 0; String type = EleConstant.LINE_TYPE_BG; diff --git a/demo/src/main/resources/application.properties b/demo/src/main/resources/application.properties index d284cb9..bc92381 100644 --- a/demo/src/main/resources/application.properties +++ b/demo/src/main/resources/application.properties @@ -2,9 +2,9 @@ server.port=9090 # DataSource configuration using HikariCP (default connection pool in Spring Boot) -spring.datasource.url=jdbc:mysql://120.78.126.4:5455/rag_flow?useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true +spring.datasource.url=jdbc:mysql://120.78.126.4:9200/elec?useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true spring.datasource.username=root -spring.datasource.password=infini_rag_flow +spring.datasource.password=AL@2025 spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver # HikariCP specific properties (optional) spring.datasource.hikari.maximum-pool-size=10 diff --git a/demo/src/main/resources/mapper/ElecBillInfoMapper.xml b/demo/src/main/resources/mapper/ElecBillInfoMapper.xml new file mode 100644 index 0000000..e7b85bf --- /dev/null +++ b/demo/src/main/resources/mapper/ElecBillInfoMapper.xml @@ -0,0 +1,6 @@ + + + + + +