更新最新代码

This commit is contained in:
WL 2025-03-17 17:41:00 +08:00
parent 60c33535e8
commit dd71b05dbb
7 changed files with 72 additions and 8 deletions

View File

@ -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<String,Object> 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;
}

View File

@ -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<ElecBindInfo> {
}

View File

@ -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;
}

View File

@ -12,4 +12,6 @@ public interface BasicService {
Response getElectricityInfo(Map<String,Object> param);
Object getElectricityInfo1(Map<String,Object> param);
Object getBindingInfo();
}

View File

@ -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<String, Object> param) {
String keyWord = (String) param.get("kw");
@ -88,6 +92,12 @@ public class BasicServiceImpl implements BasicService {
return dataAndView;
}
@Override
public Object getBindingInfo() {
QueryWrapper<ElecBindInfo> queryWrapper =new QueryWrapper<>();
return elecBillInfoMapper.selectList(queryWrapper);
}
private void analysisKeyWord(String keyWord,TypeAndQuery typeAndQuery){
int querySymbol = 0;
String type = EleConstant.LINE_TYPE_BG;

View File

@ -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

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.example.demo.mapper.ElecBillInfoMapper">
</mapper>