第一次提交

main
吴顺杰 1 week ago
commit 1a39a51aaa

38
.gitignore vendored

@ -0,0 +1,38 @@
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/
### IntelliJ IDEA ###
.idea/modules.xml
.idea/jarRepositories.xml
.idea/compiler.xml
.idea/libraries/
*.iws
*.iml
*.ipr
### Eclipse ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/
### VS Code ###
.vscode/
### Mac OS ###
.DS_Store

@ -0,0 +1,147 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.ykMap</groupId>
<artifactId>ykMap</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring-boot.version>2.7.6</spring-boot.version>
<druid.version>1.2.23</druid.version>
</properties>
<dependencies>
<!-- SpringBoot 拦截器 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId>
</dependency>
<!--postgresql-->
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.6.0</version>
</dependency>
<!-- 阿里数据库连接池 -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
<version>${druid.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
<version>8.2.0</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<!-- https://mvnrepository.com/artifact/com.baomidou/mybatis-plus-boot-starter -->
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
<version>3.5.5</version>
</dependency>
<dependency>
<groupId>com.github.xiaoymin</groupId>
<artifactId>knife4j-openapi2-spring-boot-starter</artifactId>
<version>4.4.0</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/cn.hutool/hutool-all -->
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>5.8.25</version>
</dependency>
<dependency>
<groupId>com.alibaba.fastjson2</groupId>
<artifactId>fastjson2</artifactId>
<version>2.0.41</version>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>${spring-boot.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<repositories>
<repository>
<id>public</id>
<name>aliyun nexus</name>
<url>https://maven.aliyun.com/repository/public</url>
<releases>
<enabled>true</enabled>
</releases>
</repository>
</repositories>
<build>
<!--打包成jar包时的名字-->
<finalName>ykMap</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring-boot.version}</version>
<configuration>
<mainClass>com.ykMap.YkMapApplication</mainClass>
</configuration>
<executions>
<execution>
<id>repackage</id>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

@ -0,0 +1,23 @@
package com.ykMap;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
/**
* @author wu
* @since 2024/2/26 10:24
*/
@SpringBootApplication
@MapperScan("com.ykMap.mapper")
@EnableAsync
@EnableScheduling
public class YkMapApplication {
public static void main(String[] args) {
SpringApplication.run(YkMapApplication.class, args);
}
}

@ -0,0 +1,29 @@
package com.ykMap.base.annotation;
import com.ykMap.base.enums.DataSourceType;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
*
* <p>
*
*
* @author ruoyi
*/
@Target({ElementType.METHOD, ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Inherited
public @interface DataSource {
/**
*
*/
public DataSourceType value() default DataSourceType.MASTER;
}

@ -0,0 +1,63 @@
package com.ykMap.base.aspectj;
import cn.hutool.core.bean.BeanUtil;
import com.ykMap.base.annotation.DataSource;
import com.ykMap.base.datasource.DynamicDataSourceContextHolder;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.aspectj.lang.reflect.MethodSignature;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.core.annotation.AnnotationUtils;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import java.util.Objects;
/**
*
*
* @author ruoyi
*/
@Aspect
@Order(1)
@Component
public class DataSourceAspect {
protected Logger logger = LoggerFactory.getLogger(getClass());
@Pointcut("@annotation(com.ykMap.base.annotation.DataSource)" + "|| @within(com.ykMap.base.annotation.DataSource)")
public void dsPointCut() {
}
@Around("dsPointCut()")
public Object around(ProceedingJoinPoint point) throws Throwable {
DataSource dataSource = getDataSource(point);
if (BeanUtil.isNotEmpty(dataSource)) {
DynamicDataSourceContextHolder.setDataSourceType(dataSource.value().name());
}
try {
return point.proceed();
} finally {
// 销毁数据源 在执行方法之后
DynamicDataSourceContextHolder.clearDataSourceType();
}
}
/**
*
*/
public DataSource getDataSource(ProceedingJoinPoint point) {
MethodSignature signature = (MethodSignature) point.getSignature();
DataSource dataSource = AnnotationUtils.findAnnotation(signature.getMethod(), DataSource.class);
if (Objects.nonNull(dataSource)) {
return dataSource;
}
return AnnotationUtils.findAnnotation(signature.getDeclaringType(), DataSource.class);
}
}

@ -0,0 +1,31 @@
package com.ykMap.base.config;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import java.util.TimeZone;
/**
*
*
* @author ruoyi
*/
@Configuration
// 表示通过aop框架暴露该代理对象,AopContext能够访问
@EnableAspectJAutoProxy(exposeProxy = true)
// 指定要扫描的Mapper类的包的路径
@MapperScan("com.ykMap.**.mapper")
public class ApplicationConfig
{
/**
*
*/
@Bean
public Jackson2ObjectMapperBuilderCustomizer jacksonObjectMapperCustomization()
{
return jacksonObjectMapperBuilder -> jacksonObjectMapperBuilder.timeZone(TimeZone.getDefault());
}
}

@ -0,0 +1,116 @@
package com.ykMap.base.config;
import com.alibaba.druid.pool.DruidDataSource;
import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceBuilder;
import com.alibaba.druid.spring.boot.autoconfigure.properties.DruidStatProperties;
import com.alibaba.druid.util.Utils;
import com.ykMap.base.config.properties.DruidProperties;
import com.ykMap.base.datasource.DynamicDataSource;
import com.ykMap.base.enums.DataSourceType;
import com.ykMap.utils.spring.SpringUtils;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.sql.DataSource;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
/**
* druid
*
* @author ruoyi
*/
@Configuration
public class DruidConfig {
@Bean
@ConfigurationProperties("spring.datasource.druid.master")
public DataSource masterDataSource(DruidProperties druidProperties) {
DruidDataSource dataSource = DruidDataSourceBuilder.create().build();
return druidProperties.dataSource(dataSource);
}
@Bean
@ConfigurationProperties("spring.datasource.druid.slave")
@ConditionalOnProperty(prefix = "spring.datasource.druid.slave", name = "enabled", havingValue = "true")
public DataSource slaveDataSource(DruidProperties druidProperties) {
DruidDataSource dataSource = DruidDataSourceBuilder.create().build();
return druidProperties.dataSource(dataSource);
}
@Bean(name = "dynamicDataSource")
@Primary
public DynamicDataSource dataSource(DataSource masterDataSource) {
Map<Object, Object> targetDataSources = new HashMap<>();
targetDataSources.put(DataSourceType.MASTER.name(), masterDataSource);
setDataSource(targetDataSources, DataSourceType.SLAVE.name(), "slaveDataSource");
return new DynamicDataSource(masterDataSource, targetDataSources);
}
/**
*
*
* @param targetDataSources
* @param sourceName
* @param beanName bean
*/
public void setDataSource(Map<Object, Object> targetDataSources, String sourceName, String beanName) {
try {
DataSource dataSource = SpringUtils.getBean(beanName);
targetDataSources.put(sourceName, dataSource);
} catch (Exception e) {
}
}
/**
* 广
*/
@SuppressWarnings({"rawtypes", "unchecked"})
@Bean
@ConditionalOnProperty(name = "spring.datasource.druid.statViewServlet.enabled", havingValue = "true")
public FilterRegistrationBean removeDruidFilterRegistrationBean(DruidStatProperties properties) {
// 获取web监控页面的参数
DruidStatProperties.StatViewServlet config = properties.getStatViewServlet();
// 提取common.js的配置路径
String pattern = config.getUrlPattern() != null ? config.getUrlPattern() : "/druid/*";
String commonJsPattern = pattern.replaceAll("\\*", "js/common.js");
final String filePath = "support/http/resources/js/common.js";
// 创建filter进行过滤
Filter filter = new Filter() {
@Override
public void init(javax.servlet.FilterConfig filterConfig) throws ServletException {
}
@Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
throws IOException, ServletException {
chain.doFilter(request, response);
// 重置缓冲区,响应头不会被重置
response.resetBuffer();
// 获取common.js
String text = Utils.readFromResource(filePath);
// 正则替换banner, 除去底部的广告信息
text = text.replaceAll("<a.*?banner\"></a><br/>", "");
text = text.replaceAll("powered.*?shrek.wang</a>", "");
response.getWriter().write(text);
}
@Override
public void destroy() {
}
};
FilterRegistrationBean registrationBean = new FilterRegistrationBean();
registrationBean.setFilter(filter);
registrationBean.addUrlPatterns(commonJsPattern);
return registrationBean;
}
}

@ -0,0 +1,89 @@
package com.ykMap.base.config.properties;
import com.alibaba.druid.pool.DruidDataSource;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
/**
* druid
*
* @author ruoyi
*/
@Configuration
public class DruidProperties
{
@Value("${spring.datasource.druid.initialSize}")
private int initialSize;
@Value("${spring.datasource.druid.minIdle}")
private int minIdle;
@Value("${spring.datasource.druid.maxActive}")
private int maxActive;
@Value("${spring.datasource.druid.maxWait}")
private int maxWait;
@Value("${spring.datasource.druid.connectTimeout}")
private int connectTimeout;
@Value("${spring.datasource.druid.socketTimeout}")
private int socketTimeout;
@Value("${spring.datasource.druid.timeBetweenEvictionRunsMillis}")
private int timeBetweenEvictionRunsMillis;
@Value("${spring.datasource.druid.minEvictableIdleTimeMillis}")
private int minEvictableIdleTimeMillis;
@Value("${spring.datasource.druid.maxEvictableIdleTimeMillis}")
private int maxEvictableIdleTimeMillis;
@Value("${spring.datasource.druid.validationQuery}")
private String validationQuery;
@Value("${spring.datasource.druid.testWhileIdle}")
private boolean testWhileIdle;
@Value("${spring.datasource.druid.testOnBorrow}")
private boolean testOnBorrow;
@Value("${spring.datasource.druid.testOnReturn}")
private boolean testOnReturn;
public DruidDataSource dataSource(DruidDataSource datasource)
{
/** 配置初始化大小、最小、最大 */
datasource.setInitialSize(initialSize);
datasource.setMaxActive(maxActive);
datasource.setMinIdle(minIdle);
/** 配置获取连接等待超时的时间 */
datasource.setMaxWait(maxWait);
/** 配置驱动连接超时时间,检测数据库建立连接的超时时间,单位是毫秒 */
datasource.setConnectTimeout(connectTimeout);
/** 配置网络超时时间,等待数据库操作完成的网络超时时间,单位是毫秒 */
datasource.setSocketTimeout(socketTimeout);
/** 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 */
datasource.setTimeBetweenEvictionRunsMillis(timeBetweenEvictionRunsMillis);
/** 配置一个连接在池中最小、最大生存的时间,单位是毫秒 */
datasource.setMinEvictableIdleTimeMillis(minEvictableIdleTimeMillis);
datasource.setMaxEvictableIdleTimeMillis(maxEvictableIdleTimeMillis);
/**
* sqlselect 'x'validationQuerynulltestOnBorrowtestOnReturntestWhileIdle
*/
datasource.setValidationQuery(validationQuery);
/** 建议配置为true不影响性能并且保证安全性。申请连接的时候检测如果空闲时间大于timeBetweenEvictionRunsMillis执行validationQuery检测连接是否有效。 */
datasource.setTestWhileIdle(testWhileIdle);
/** 申请连接时执行validationQuery检测连接是否有效做了这个配置会降低性能。 */
datasource.setTestOnBorrow(testOnBorrow);
/** 归还连接时执行validationQuery检测连接是否有效做了这个配置会降低性能。 */
datasource.setTestOnReturn(testOnReturn);
return datasource;
}
}

@ -0,0 +1,93 @@
package com.ykMap.base.constant;
/**
*
*
* @author ruoyi
*/
public class HttpStatus {
/**
*
*/
public static final int SUCCESS = 200;
/**
*
*/
public static final int CREATED = 201;
/**
*
*/
public static final int ACCEPTED = 202;
/**
*
*/
public static final int NO_CONTENT = 204;
/**
*
*/
public static final int MOVED_PERM = 301;
/**
*
*/
public static final int SEE_OTHER = 303;
/**
*
*/
public static final int NOT_MODIFIED = 304;
/**
*
*/
public static final int BAD_REQUEST = 400;
/**
*
*/
public static final int UNAUTHORIZED = 401;
/**
* 访
*/
public static final int FORBIDDEN = 403;
/**
*
*/
public static final int NOT_FOUND = 404;
/**
* http
*/
public static final int BAD_METHOD = 405;
/**
*
*/
public static final int CONFLICT = 409;
/**
*
*/
public static final int UNSUPPORTED_TYPE = 415;
/**
*
*/
public static final int ERROR = 500;
/**
*
*/
public static final int NOT_IMPLEMENTED = 501;
/**
*
*/
public static final int WARN = 601;
}

@ -0,0 +1,78 @@
package com.ykMap.base.controller;
import com.ykMap.base.domain.AjaxResult;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* web
*
* @author ruoyi
*/
public class BaseController {
protected final Logger logger = LoggerFactory.getLogger(this.getClass());
/**
*
*/
public AjaxResult success() {
return AjaxResult.success();
}
/**
*
*/
public AjaxResult error() {
return AjaxResult.error();
}
/**
*
*/
public AjaxResult success(String message) {
return AjaxResult.success(message);
}
/**
*
*/
public AjaxResult success(Object data) {
return AjaxResult.success(data);
}
/**
*
*/
public AjaxResult error(String message) {
return AjaxResult.error(message);
}
/**
*
*/
public AjaxResult warn(String message) {
return AjaxResult.warn(message);
}
/**
*
*
* @param rows
* @return
*/
protected AjaxResult toAjax(int rows) {
return rows > 0 ? AjaxResult.success() : AjaxResult.error();
}
/**
*
*
* @param result
* @return
*/
protected AjaxResult toAjax(boolean result) {
return result ? success() : error();
}
}

@ -0,0 +1,24 @@
package com.ykMap.base.datasource;
import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource;
import javax.sql.DataSource;
import java.util.Map;
/**
*
*
* @author ruoyi
*/
public class DynamicDataSource extends AbstractRoutingDataSource {
public DynamicDataSource(DataSource defaultTargetDataSource, Map<Object, Object> targetDataSources) {
super.setDefaultTargetDataSource(defaultTargetDataSource);
super.setTargetDataSources(targetDataSources);
super.afterPropertiesSet();
}
@Override
protected Object determineCurrentLookupKey() {
return DynamicDataSourceContextHolder.getDataSourceType();
}
}

@ -0,0 +1,41 @@
package com.ykMap.base.datasource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
*
*
* @author ruoyi
*/
public class DynamicDataSourceContextHolder {
public static final Logger log = LoggerFactory.getLogger(DynamicDataSourceContextHolder.class);
/**
* 使ThreadLocalThreadLocal使线
* 线线
*/
private static final ThreadLocal<String> CONTEXT_HOLDER = new ThreadLocal<>();
/**
*
*/
public static String getDataSourceType() {
return CONTEXT_HOLDER.get();
}
/**
*
*/
public static void setDataSourceType(String dsType) {
log.info("切换到{}数据源", dsType);
CONTEXT_HOLDER.set(dsType);
}
/**
*
*/
public static void clearDataSourceType() {
CONTEXT_HOLDER.remove();
}
}

@ -0,0 +1,202 @@
package com.ykMap.base.domain;
import cn.hutool.core.bean.BeanUtil;
import com.ykMap.base.constant.HttpStatus;
import java.util.HashMap;
import java.util.Objects;
/**
*
*
* @author ruoyi
*/
public class AjaxResult extends HashMap<String, Object> {
/**
*
*/
public static final String CODE_TAG = "code";
/**
*
*/
public static final String MSG_TAG = "msg";
/**
*
*/
public static final String DATA_TAG = "data";
private static final long serialVersionUID = 1L;
/**
* AjaxResult 使
*/
public AjaxResult() {
}
/**
* AjaxResult
*
* @param code
* @param msg
*/
public AjaxResult(int code, String msg) {
super.put(CODE_TAG, code);
super.put(MSG_TAG, msg);
}
/**
* AjaxResult
*
* @param code
* @param msg
* @param data
*/
public AjaxResult(int code, String msg, Object data) {
super.put(CODE_TAG, code);
super.put(MSG_TAG, msg);
if (BeanUtil.isNotEmpty(data)) {
super.put(DATA_TAG, data);
}
}
/**
*
*
* @return
*/
public static AjaxResult success() {
return AjaxResult.success("操作成功");
}
/**
*
*
* @return
*/
public static AjaxResult success(Object data) {
return AjaxResult.success("操作成功", data);
}
/**
*
*
* @param msg
* @return
*/
public static AjaxResult success(String msg) {
return AjaxResult.success(msg, null);
}
/**
*
*
* @param msg
* @param data
* @return
*/
public static AjaxResult success(String msg, Object data) {
return new AjaxResult(HttpStatus.SUCCESS, msg, data);
}
/**
*
*
* @param msg
* @return
*/
public static AjaxResult warn(String msg) {
return AjaxResult.warn(msg, null);
}
/**
*
*
* @param msg
* @param data
* @return
*/
public static AjaxResult warn(String msg, Object data) {
return new AjaxResult(HttpStatus.WARN, msg, data);
}
/**
*
*
* @return
*/
public static AjaxResult error() {
return AjaxResult.error("操作失败");
}
/**
*
*
* @param msg
* @return
*/
public static AjaxResult error(String msg) {
return AjaxResult.error(msg, null);
}
/**
*
*
* @param msg
* @param data
* @return
*/
public static AjaxResult error(String msg, Object data) {
return new AjaxResult(HttpStatus.ERROR, msg, data);
}
/**
*
*
* @param code
* @param msg
* @return
*/
public static AjaxResult error(int code, String msg) {
return new AjaxResult(code, msg, null);
}
/**
*
*
* @return
*/
public boolean isSuccess() {
return Objects.equals(HttpStatus.SUCCESS, this.get(CODE_TAG));
}
/**
*
*
* @return
*/
public boolean isWarn() {
return Objects.equals(HttpStatus.WARN, this.get(CODE_TAG));
}
/**
*
*
* @return
*/
public boolean isError() {
return Objects.equals(HttpStatus.ERROR, this.get(CODE_TAG));
}
/**
* 便
*
* @param key
* @param value
* @return
*/
@Override
public AjaxResult put(String key, Object value) {
super.put(key, value);
return this;
}
}

@ -0,0 +1,19 @@
package com.ykMap.base.enums;
/**
*
*
* @author ruoyi
*/
public enum DataSourceType
{
/**
*
*/
MASTER,
/**
*
*/
SLAVE
}

@ -0,0 +1,90 @@
package com.ykMap.controller;
import com.ykMap.base.annotation.DataSource;
import com.ykMap.base.controller.BaseController;
import com.ykMap.base.domain.AjaxResult;
import com.ykMap.base.enums.DataSourceType;
import com.ykMap.entity.response.EquipResponse;
import com.ykMap.entity.response.GetCarIdInfoResponse;
import com.ykMap.entity.response.ItemsResponse;
import com.ykMap.entity.response.LineTemplateResponse;
import com.ykMap.entity.response.SearchCityCountResponse;
import com.ykMap.entity.response.SearchCityResponse;
import com.ykMap.entity.response.SelectLineInfoResponse;
import com.ykMap.entity.response.UserInfoResponse;
import com.ykMap.service.LineService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
/**
* 线
*
* @author du
* @since 2024/8/14 10:40
*/
@RestController
@RequestMapping("/ykmap/line")
@Api(tags = "大屏线路接口")
public class LineController extends BaseController {
@Resource
private LineService lineService;
@ApiOperation(value = "根据车辆id查询线路,装备,人员,标的物", response = GetCarIdInfoResponse.class)
@GetMapping("/getCarIdInfo/{id}")
public AjaxResult getCarIdInfo(@PathVariable String id) {
return success(lineService.getCarIdInfo(id));
}
@ApiOperation(value = "任务明细弹窗线路信息", response = SelectLineInfoResponse.class)
@GetMapping("/selectLineInfo/{id}")
public AjaxResult selectLineInfo(@PathVariable String id) {
return success(lineService.selectLineInfo(id));
}
@ApiOperation(value = "任务明细弹窗装备信息", response = EquipResponse.class)
@GetMapping("/equip/{id}")
public AjaxResult equip(@PathVariable String id) {
return success(lineService.equip(id));
}
@ApiOperation(value = "任务明细弹窗人员信息", response = UserInfoResponse.class)
@GetMapping("/userInfo/{id}")
public AjaxResult userInfo(@PathVariable String id) {
return success(lineService.userInfo(id));
}
@ApiOperation(value = "任务明细弹窗标的物信息", response = ItemsResponse.class)
@GetMapping("/items/{id}")
public AjaxResult items(@PathVariable String id) {
return success(lineService.items(id));
}
@ApiOperation(value = "线路模板具体信息", response = LineTemplateResponse.class)
@GetMapping("/lineTemplate")
@DataSource(value = DataSourceType.SLAVE)
public AjaxResult lineTemplate(String area) {
return success(lineService.lineTemplate(area));
}
@ApiOperation(value = "业务已覆盖省份清单", response = SearchCityResponse.class)
@GetMapping("/searchCity")
@DataSource(value = DataSourceType.SLAVE)
public AjaxResult searchCity() {
return success(lineService.searchCity());
}
@ApiOperation(value = "业务已覆盖省份个数", response = SearchCityCountResponse.class)
@GetMapping("/searchCityCount")
@DataSource(value = DataSourceType.SLAVE)
public AjaxResult searchCityCount() {
return success(lineService.searchCityCount());
}
}

@ -0,0 +1,103 @@
package com.ykMap.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ykMap.base.annotation.DataSource;
import com.ykMap.base.controller.BaseController;
import com.ykMap.base.domain.AjaxResult;
import com.ykMap.base.enums.DataSourceType;
import com.ykMap.entity.Yxlgl;
import com.ykMap.entity.request.YxlglRequest;
import com.ykMap.service.YxlglService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.io.Serializable;
/**
* 线exl_operation_line_data
*
* @author du
* @since 2024/8/13 9:56
*/
@RestController
@RequestMapping("/ykmap/xlgl")
@Api(tags = "【营运管理部门】:线路管理数据")
@DataSource(value = DataSourceType.SLAVE)
public class YxlglController extends BaseController {
/**
*
*/
@Resource
private YxlglService yxlglService;
/**
*
*
* @param page
* @param yxlglRequest
* @return
*/
@ApiOperation(value = "分页查询所有数据", response = Yxlgl.class)
@GetMapping
public AjaxResult selectAll(Page<Yxlgl> page, YxlglRequest yxlglRequest) {
return success(yxlglService.page(page, yxlglRequest));
}
/**
*
*
* @param id
* @return
*/
@ApiOperation(value = "通过主键查询单条数据", response = Yxlgl.class)
@GetMapping("{id}")
public AjaxResult selectOne(@PathVariable Serializable id) {
return success(yxlglService.getById(id));
}
/**
*
*
* @param xlgl
* @return
*/
@ApiOperation(value = "新增数据")
@PostMapping
public AjaxResult insert(@RequestBody Yxlgl xlgl) {
return success(yxlglService.save(xlgl));
}
/**
*
*
* @param xlgl
* @return
*/
@ApiOperation(value = "修改数据")
@PostMapping("/edit")
public AjaxResult update(@RequestBody Yxlgl xlgl) {
return success(yxlglService.updateById(xlgl));
}
/**
*
*
* @param id
* @return
*/
@ApiOperation(value = "删除数据")
@GetMapping("/delete/{id}")
public AjaxResult delete(@PathVariable Long id) {
return success(yxlglService.removeById(id));
}
}

@ -0,0 +1,101 @@
package com.ykMap.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ykMap.base.annotation.DataSource;
import com.ykMap.base.controller.BaseController;
import com.ykMap.base.domain.AjaxResult;
import com.ykMap.base.enums.DataSourceType;
import com.ykMap.entity.Yywtz;
import com.ykMap.service.YywtzService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.io.Serializable;
/**
* exl_operation_expansion_data
*
* @author du
* @since 2024/8/13 9:56
*/
@RestController
@RequestMapping("/ykmap/ywtz")
@Api(tags = "【营运管理部门】:业务拓展数据")
@DataSource(value = DataSourceType.SLAVE)
public class YywtzController extends BaseController {
/**
*
*/
@Resource
private YywtzService yywtzService;
/**
*
*
* @param page
* @return
*/
@ApiOperation(value = "分页查询所有数据", response = Yywtz.class)
@GetMapping
public AjaxResult selectAll(Page<Yywtz> page) {
return success(yywtzService.page(page));
}
/**
*
*
* @param id
* @return
*/
@ApiOperation(value = "通过主键查询单条数据", response = Yywtz.class)
@GetMapping("{id}")
public AjaxResult selectOne(@PathVariable Serializable id) {
return success(yywtzService.getById(id));
}
/**
*
*
* @param xlgl
* @return
*/
@ApiOperation(value = "新增数据")
@PostMapping
public AjaxResult insert(@RequestBody Yywtz xlgl) {
return success(yywtzService.save(xlgl));
}
/**
*
*
* @param xlgl
* @return
*/
@ApiOperation(value = "修改数据")
@PostMapping("/edit")
public AjaxResult update(@RequestBody Yywtz xlgl) {
return success(yywtzService.updateById(xlgl));
}
/**
*
*
* @param id
* @return
*/
@ApiOperation(value = "删除数据")
@GetMapping("/delete/{id}")
public AjaxResult delete(@PathVariable Long id) {
return success(yywtzService.removeById(id));
}
}

@ -0,0 +1,101 @@
package com.ykMap.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ykMap.base.annotation.DataSource;
import com.ykMap.base.controller.BaseController;
import com.ykMap.base.domain.AjaxResult;
import com.ykMap.base.enums.DataSourceType;
import com.ykMap.entity.Yywzl;
import com.ykMap.service.YywzlService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.io.Serializable;
/**
* exl_operation_overview_data_route
*
* @author du
* @since 2024/8/13 9:56
*/
@RestController
@RequestMapping("/ykmap/ywzl")
@Api(tags = "【营运管理部门】:业务总览数据")
@DataSource(value = DataSourceType.SLAVE)
public class YywzlController extends BaseController {
/**
*
*/
@Resource
private YywzlService yywzlService;
/**
*
*
* @param page
* @return
*/
@ApiOperation(value = "分页查询所有数据", response = Yywzl.class)
@GetMapping
public AjaxResult selectAll(Page<Yywzl> page) {
return success(yywzlService.page(page));
}
/**
*
*
* @param id
* @return
*/
@ApiOperation(value = "通过主键查询单条数据", response = Yywzl.class)
@GetMapping("{id}")
public AjaxResult selectOne(@PathVariable Serializable id) {
return success(yywzlService.getById(id));
}
/**
*
*
* @param xlgl
* @return
*/
@ApiOperation(value = "新增数据")
@PostMapping
public AjaxResult insert(@RequestBody Yywzl xlgl) {
return success(yywzlService.save(xlgl));
}
/**
*
*
* @param xlgl
* @return
*/
@ApiOperation(value = "修改数据")
@PostMapping("/edit")
public AjaxResult update(@RequestBody Yywzl xlgl) {
return success(yywzlService.updateById(xlgl));
}
/**
*
*
* @param id
* @return
*/
@ApiOperation(value = "删除数据")
@GetMapping("/delete/{id}")
public AjaxResult delete(@PathVariable Long id) {
return success(yywzlService.removeById(id));
}
}

@ -0,0 +1,92 @@
package com.ykMap.entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDate;
import java.time.LocalDateTime;
/**
* 线exl_operation_line_data
*
* @author du
* @since 2024/8/13 9:49
*/
@Data
@ApiModel("线路管理数据")
@TableName(value = "exl_operation_line_data")
public class Yxlgl {
/**
* id
*/
@TableId
@ApiModelProperty("id")
private String id;
/**
* id
*/
@ApiModelProperty("创建id")
private Integer creatorId;
/**
* id
*/
@ApiModelProperty("更新id")
private Integer updaterId;
/**
*
*/
@ApiModelProperty("更新时间")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime updateTime;
/**
*
*/
@ApiModelProperty("创建时间")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime createTime;
/**
* 线:
*/
@ApiModelProperty("线路类型:工作日、周六、周日")
private String lineType;
/**
* 线
*/
@ApiModelProperty("营运网点线路条数(条)")
private Integer networkLineNum;
/**
* 线
*/
@ApiModelProperty("营运无网点线路条数(条)")
private Integer noNetworkLineNum;
/**
* 线
*/
@ApiModelProperty("维护线路条数(条)")
private Integer maintenanceLineNum;
/**
*
*/
@ApiModelProperty("数据时间(月份),时间戳")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private LocalDate dataTime;
}

@ -0,0 +1,72 @@
package com.ykMap.entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDate;
import java.time.LocalDateTime;
/**
* exl_operation_expansion_data
* @author du
* @since 2024/8/14 10:33
*/
@Data
@ApiModel("业务总览数据")
@TableName(value = "exl_operation_expansion_data")
public class Yywtz {
/**
* id
*/
@TableId
@ApiModelProperty("id")
private String id;
/**
* id
*/
@ApiModelProperty("创建id")
private Integer creatorId;
/**
* id
*/
@ApiModelProperty("更新id")
private Integer updaterId;
/**
*
*/
@ApiModelProperty("更新时间")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime updateTime;
/**
*
*/
@ApiModelProperty("创建时间")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime createTime;
/**
*
*/
@ApiModelProperty("业务已覆盖省份名称")
private String provinceName;
/**
*
*/
@ApiModelProperty("数据时间(月份),时间戳")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private LocalDate dataTime;
}

@ -0,0 +1,82 @@
package com.ykMap.entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDate;
import java.time.LocalDateTime;
/**
* exl_operation_overview_data_route
* @author du
* @since 2024/8/14 10:17
*/
@Data
@ApiModel("业务总览数据")
@TableName(value = "exl_operation_overview_data_route")
public class Yywzl {
/**
* id
*/
@TableId
@ApiModelProperty("id")
private String id;
/**
* id
*/
@ApiModelProperty("创建id")
private Integer creatorId;
/**
* id
*/
@ApiModelProperty("更新id")
private Integer updaterId;
/**
*
*/
@ApiModelProperty("更新时间")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime updateTime;
/**
*
*/
@ApiModelProperty("创建时间")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime createTime;
/**
* :
*/
@ApiModelProperty("区镇:吴中区、吴江区、虎丘区、姑苏区、工业园区、相城区")
private String area;
/**
* 线
*/
@ApiModelProperty("线路总条数(条)")
private Integer lineTotalNum;
/**
*
*/
@ApiModelProperty("数据时间(月份),时间戳")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private LocalDate dataTime;
}

@ -0,0 +1,21 @@
package com.ykMap.entity.request;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* 线exl_operation_line_data
* @author du
* @since 2024/8/14 9:01
*/
@Data
@ApiModel("线路管理数据")
public class YxlglRequest {
/**
* 线:
*/
@ApiModelProperty("线路类型:工作日、周六、周日")
private String lineType;
}

@ -0,0 +1,27 @@
package com.ykMap.entity.response;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
*
* @author du
* @since 2024/8/14 11:06
*/
@Data
@ApiModel("任务装备返回体")
public class EquipResponse {
/**
*
*/
@ApiModelProperty("装备名称")
private String thingType;
/**
*
*/
@ApiModelProperty("装备类型")
private String type;
}

@ -0,0 +1,40 @@
package com.ykMap.entity.response;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* id线,,,
* @author du
* @since 2024/8/15 9:29
*/
@Data
public class GetCarIdInfoResponse {
/**
* 线
*/
@ApiModelProperty("线路类型")
private String lineType;
/**
*
*/
@ApiModelProperty("装备信息")
private List<EquipResponse> zbList;
/**
*
*/
@ApiModelProperty("人员信息")
private List<UserInfoResponse> userList;
/**
*
*/
@ApiModelProperty("标的物")
private ItemsResponse bdwInfo;
}

@ -0,0 +1,18 @@
package com.ykMap.entity.response;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
*
* @author du
* @since 2024/8/14 11:18
*/
@Data
@ApiModel("标的物信息返回体")
public class ItemsResponse {
@ApiModelProperty("数量")
private Integer count;
}

@ -0,0 +1,58 @@
package com.ykMap.entity.response;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
/**
* 线
*
* @author du
* @since 2024/8/14 15:09
*/
@Data
@ApiModel("线路模板具体信息返回体")
public class LineTemplateResponse {
/**
*
*/
@ApiModelProperty("区域")
private String area;
/**
* 线
*/
@ApiModelProperty("线路总数")
private Integer LineTotalNum;
/**
*
*/
@ApiModelProperty("营业网点总数")
private Integer outletsTotalNum;
/**
*
*/
@ApiModelProperty("上门收款点总数")
private Integer paymentPointNum;
/**
* ATM
*/
@ApiModelProperty("ATM机总数")
private Integer atmTotalNum;
/**
*
*/
@ApiModelProperty("创建时间")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime dataTime;
}

@ -0,0 +1,21 @@
package com.ykMap.entity.response;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
*
* @author du
* @since 2024/8/14 17:08
*/
@Data
@ApiModel("业务已覆盖省份清单数量")
public class SearchCityCountResponse {
/**
*
*/
@ApiModelProperty("个数")
private Integer count;
}

@ -0,0 +1,33 @@
package com.ykMap.entity.response;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
/**
*
* @author du
* @since 2024/8/14 16:04
*/
@Data
@ApiModel("业务已覆盖省份清单")
public class SearchCityResponse {
/**
*
*/
@ApiModelProperty("省份")
private String city;
/**
*
*/
@ApiModelProperty("创建时间")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime dataTime;
}

@ -0,0 +1,28 @@
package com.ykMap.entity.response;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* 线
* @author du
* @since 2024/8/14 10:51
*/
@Data
@ApiModel("线路信息返回体")
public class SelectLineInfoResponse {
/**
*
*/
@ApiModelProperty("任务名称")
private String name;
/**
*
*/
@ApiModelProperty("任务类型")
private String type;
}

@ -0,0 +1,33 @@
package com.ykMap.entity.response;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
*
* @author du
* @since 2024/8/14 11:10
*/
@Data
@ApiModel("人员信息返回体")
public class UserInfoResponse {
/**
*
*/
@ApiModelProperty("人员信息")
private String ename;
/**
*
*/
@ApiModelProperty("职位名称")
private String name;
/**
*
*/
@ApiModelProperty("排序")
private Integer orderNum;
}

@ -0,0 +1,61 @@
package com.ykMap.mapper;
import com.ykMap.entity.response.EquipResponse;
import com.ykMap.entity.response.ItemsResponse;
import com.ykMap.entity.response.LineTemplateResponse;
import com.ykMap.entity.response.SearchCityCountResponse;
import com.ykMap.entity.response.SearchCityResponse;
import com.ykMap.entity.response.SelectLineInfoResponse;
import com.ykMap.entity.response.UserInfoResponse;
import org.apache.ibatis.annotations.Param;
import java.time.LocalDate;
import java.util.List;
/**
* 线
*
* @author du
* @since 2024/8/13 9:49
*/
public interface LineMapper{
/**
* 线
*/
SelectLineInfoResponse selectLineInfo(String id);
/**
*
*/
List<EquipResponse> equip(String id);
/**
*
*/
List<UserInfoResponse> userInfo(String id);
/**
*
*/
ItemsResponse items(String id);
/**
* 线
*/
List<LineTemplateResponse> lineTemplate(@Param("area") String area,@Param("a1") LocalDate a1, @Param("a2")LocalDate a2);
/**
*
*/
List<SearchCityResponse> searchCity(@Param("a1") LocalDate a1, @Param("a2")LocalDate a2);
/**
*
*/
SearchCityCountResponse searchCityCount(@Param("a1") LocalDate a1, @Param("a2")LocalDate a2);
String getByCarId(String id);
}

@ -0,0 +1,25 @@
package com.ykMap.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ykMap.entity.Yxlgl;
import com.ykMap.entity.request.YxlglRequest;
import org.apache.ibatis.annotations.Param;
/**
* 线exl_operation_line_data
*
* @author du
* @since 2024/8/13 9:49
*/
public interface YxlglMapper extends BaseMapper<Yxlgl> {
/**
*
*
* @param page
* @param yxlglRequest
* @return
*/
Page<Yxlgl> page(Page<Yxlgl> page,@Param("req") YxlglRequest yxlglRequest);
}

@ -0,0 +1,22 @@
package com.ykMap.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ykMap.entity.Yywtz;
/**
* exl_operation_expansion_data
*
* @author du
* @since 2024/8/13 9:49
*/
public interface YywtzMapper extends BaseMapper<Yywtz> {
/**
*
*
* @param page
* @return
*/
Page<Yywtz> page(Page<Yywtz> page);
}

@ -0,0 +1,22 @@
package com.ykMap.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ykMap.entity.Yywzl;
/**
* exl_operation_overview_data_route
*
* @author du
* @since 2024/8/13 9:49
*/
public interface YywzlMapper extends BaseMapper<Yywzl> {
/**
*
*
* @param page
* @return
*/
Page<Yywzl> page(Page<Yywzl> page);
}

@ -0,0 +1,62 @@
package com.ykMap.service;
import com.ykMap.entity.response.EquipResponse;
import com.ykMap.entity.response.GetCarIdInfoResponse;
import com.ykMap.entity.response.ItemsResponse;
import com.ykMap.entity.response.LineTemplateResponse;
import com.ykMap.entity.response.SearchCityCountResponse;
import com.ykMap.entity.response.SearchCityResponse;
import com.ykMap.entity.response.SelectLineInfoResponse;
import com.ykMap.entity.response.UserInfoResponse;
import java.util.List;
/**
* 线
* @author du
* @since 2024/8/14 10:43
*/
public interface LineService {
/**
* 线
*/
SelectLineInfoResponse selectLineInfo(String id);
/**
*
*/
List<EquipResponse> equip(String id);
/**
*
*/
List<UserInfoResponse> userInfo(String id);
/**
*
*/
ItemsResponse items(String id);
/**
* 线
*/
List<LineTemplateResponse> lineTemplate(String area);
/**
*
*/
List<SearchCityResponse> searchCity();
/**
*
*/
SearchCityCountResponse searchCityCount();
/**
* id线,,,
*/
GetCarIdInfoResponse getCarIdInfo(String id);
}

@ -0,0 +1,25 @@
package com.ykMap.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ykMap.entity.Yxlgl;
import com.ykMap.entity.request.YxlglRequest;
/**
* 线exl_operation_line_data
*
* @author du
* @since 2024/8/13 9:49
*/
public interface YxlglService extends IService<Yxlgl> {
/**
*
*
* @param page
* @param yxlglRequest
* @return
*/
Page<Yxlgl> page(Page<Yxlgl> page, YxlglRequest yxlglRequest);
}

@ -0,0 +1,23 @@
package com.ykMap.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ykMap.entity.Yywtz;
/**
* exl_operation_expansion_data
*
* @author du
* @since 2024/8/13 9:49
*/
public interface YywtzService extends IService<Yywtz> {
/**
*
*
* @param page
* @return
*/
Page<Yywtz> page(Page<Yywtz> page);
}

@ -0,0 +1,23 @@
package com.ykMap.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ykMap.entity.Yywzl;
/**
* exl_operation_overview_data_route
*
* @author du
* @since 2024/8/13 9:49
*/
public interface YywzlService extends IService<Yywzl> {
/**
*
*
* @param page
* @return
*/
Page<Yywzl> page(Page<Yywzl> page);
}

@ -0,0 +1,132 @@
package com.ykMap.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.ykMap.entity.response.EquipResponse;
import com.ykMap.entity.response.GetCarIdInfoResponse;
import com.ykMap.entity.response.ItemsResponse;
import com.ykMap.entity.response.LineTemplateResponse;
import com.ykMap.entity.response.SearchCityCountResponse;
import com.ykMap.entity.response.SearchCityResponse;
import com.ykMap.entity.response.SelectLineInfoResponse;
import com.ykMap.entity.response.UserInfoResponse;
import com.ykMap.mapper.LineMapper;
import com.ykMap.service.LineService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.time.LocalDate;
import java.util.List;
/**
* 线
*
* @author du
* @since 2024/8/14 10:44
*/
@Service
public class LineServiceImpl implements LineService {
@Resource
private LineMapper lineMapper;
/**
* 线
*/
@Override
public SelectLineInfoResponse selectLineInfo(String id) {
return lineMapper.selectLineInfo(id);
}
/**
*
*/
@Override
public List<EquipResponse> equip(String id) {
return lineMapper.equip(id);
}
/**
*
*/
@Override
public List<UserInfoResponse> userInfo(String id) {
return lineMapper.userInfo(id);
}
/**
*
*/
@Override
public ItemsResponse items(String id) {
return lineMapper.items(id);
}
/**
* 线
*/
@Override
public List<LineTemplateResponse> lineTemplate(String area) {
LocalDate now = LocalDate.now();
if (now.getDayOfMonth() < 26) {
LocalDate a1 = now.minusMonths(2).withDayOfMonth(26);
LocalDate a2 = now.minusMonths(1).withDayOfMonth(25);
return lineMapper.lineTemplate(area, a1, a2);
} else {
LocalDate a1 = now.minusMonths(1).withDayOfMonth(26);
LocalDate a2 = now.withDayOfMonth(25);
return lineMapper.lineTemplate(area, a1, a2);
}
}
/**
*
*/
@Override
public List<SearchCityResponse> searchCity() {
LocalDate now = LocalDate.now();
if (now.getDayOfMonth() < 26) {
LocalDate a1 = now.minusMonths(2).withDayOfMonth(26);
LocalDate a2 = now.minusMonths(1).withDayOfMonth(25);
return lineMapper.searchCity(a1, a2);
} else {
LocalDate a1 = now.minusMonths(1).withDayOfMonth(26);
LocalDate a2 = now.withDayOfMonth(25);
return lineMapper.searchCity(a1, a2);
}
}
/**
*
*/
@Override
public SearchCityCountResponse searchCityCount() {
LocalDate now = LocalDate.now();
if (now.getDayOfMonth() < 26) {
LocalDate a1 = now.minusMonths(2).withDayOfMonth(26);
LocalDate a2 = now.minusMonths(1).withDayOfMonth(25);
return lineMapper.searchCityCount(a1, a2);
} else {
LocalDate a1 = now.minusMonths(1).withDayOfMonth(26);
LocalDate a2 = now.withDayOfMonth(25);
return lineMapper.searchCityCount(a1, a2);
}
}
/**
* id线,,,
*/
@Override
public GetCarIdInfoResponse getCarIdInfo(String id) {
//获取该车辆的任务id
String bcs = lineMapper.getByCarId(id);
GetCarIdInfoResponse res = new GetCarIdInfoResponse();
res.setZbList(lineMapper.equip(bcs));
res.setUserList(lineMapper.userInfo(bcs));
res.setBdwInfo(lineMapper.items(bcs));
SelectLineInfoResponse se = lineMapper.selectLineInfo(bcs);
if (BeanUtil.isNotEmpty(se)) {
res.setLineType(se.getType());
}
return res;
}
}

@ -0,0 +1,31 @@
package com.ykMap.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ykMap.entity.Yxlgl;
import com.ykMap.entity.request.YxlglRequest;
import com.ykMap.mapper.YxlglMapper;
import com.ykMap.service.YxlglService;
import org.springframework.stereotype.Service;
/**
* 线exl_operation_line_data
*
* @author du
* @since 2024/5/13 9:58
*/
@Service
public class YxlglServiceImpl extends ServiceImpl<YxlglMapper, Yxlgl> implements YxlglService {
/**
*
*
* @param page
* @param yxlglRequest
* @return
*/
@Override
public Page<Yxlgl> page(Page<Yxlgl> page, YxlglRequest yxlglRequest) {
return baseMapper.page(page,yxlglRequest);
}
}

@ -0,0 +1,29 @@
package com.ykMap.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ykMap.entity.Yywtz;
import com.ykMap.mapper.YywtzMapper;
import com.ykMap.service.YywtzService;
import org.springframework.stereotype.Service;
/**
* exl_operation_expansion_data
*
* @author du
* @since 2024/5/13 9:58
*/
@Service
public class YywtzServiceImpl extends ServiceImpl<YywtzMapper, Yywtz> implements YywtzService {
/**
*
*
* @param page
* @return
*/
@Override
public Page<Yywtz> page(Page<Yywtz> page) {
return baseMapper.page(page);
}
}

@ -0,0 +1,29 @@
package com.ykMap.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ykMap.entity.Yywzl;
import com.ykMap.mapper.YywzlMapper;
import com.ykMap.service.YywzlService;
import org.springframework.stereotype.Service;
/**
* exl_operation_overview_data_route
*
* @author du
* @since 2024/5/13 9:58
*/
@Service
public class YywzlServiceImpl extends ServiceImpl<YywzlMapper, Yywzl> implements YywzlService {
/**
*
*
* @param page
* @return
*/
@Override
public Page<Yywzl> page(Page<Yywzl> page) {
return baseMapper.page(page);
}
}

@ -0,0 +1,140 @@
package com.ykMap.utils.spring;
import org.springframework.aop.framework.AopContext;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;
/**
* spring 便springbean
*
* @author ruoyi
*/
@Component
public final class SpringUtils implements BeanFactoryPostProcessor, ApplicationContextAware {
/**
* Spring
*/
private static ConfigurableListableBeanFactory beanFactory;
private static ApplicationContext applicationContext;
/**
*
*
* @param name
* @return Object bean
* @throws BeansException
*/
@SuppressWarnings("unchecked")
public static <T> T getBean(String name) throws BeansException {
return (T) beanFactory.getBean(name);
}
/**
* requiredType
*
* @param clz
* @return
* @throws BeansException
*/
public static <T> T getBean(Class<T> clz) throws BeansException {
T result = (T) beanFactory.getBean(clz);
return result;
}
/**
* BeanFactorybeantrue
*
* @param name
* @return boolean
*/
public static boolean containsBean(String name) {
return beanFactory.containsBean(name);
}
/**
* beansingletonprototype beanNoSuchBeanDefinitionException
*
* @param name
* @return boolean
* @throws NoSuchBeanDefinitionException
*/
public static boolean isSingleton(String name) throws NoSuchBeanDefinitionException {
return beanFactory.isSingleton(name);
}
/**
* @param name
* @return Class
* @throws NoSuchBeanDefinitionException
*/
public static Class<?> getType(String name) throws NoSuchBeanDefinitionException {
return beanFactory.getType(name);
}
/**
* beanbean
*
* @param name
* @return
* @throws NoSuchBeanDefinitionException
*/
public static String[] getAliases(String name) throws NoSuchBeanDefinitionException {
return beanFactory.getAliases(name);
}
/**
* aop
*
* @param invoker
* @return
*/
@SuppressWarnings("unchecked")
public static <T> T getAopProxy(T invoker) {
return (T) AopContext.currentProxy();
}
/**
* null
*
* @return
*/
public static String[] getActiveProfiles() {
return applicationContext.getEnvironment().getActiveProfiles();
}
/**
*
*
* @return
*/
public static String getActiveProfile() {
final String[] activeProfiles = getActiveProfiles();
return activeProfiles.length > 0 ? activeProfiles[0] : null;
}
/**
*
*
* @param key key
* @return
*/
public static String getRequiredProperty(String key) {
return applicationContext.getEnvironment().getRequiredProperty(key);
}
@Override
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
SpringUtils.beanFactory = beanFactory;
}
@Override
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
SpringUtils.applicationContext = applicationContext;
}
}

@ -0,0 +1,64 @@
# 数据源配置
spring:
datasource:
type: com.alibaba.druid.pool.DruidDataSource
druid:
# 主库数据源
master:
driverClassName: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://39.101.188.84:3307/yk_map?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root
password: Admin123@
# 从库数据源
slave:
# 从数据源开关/默认关闭
driverClassName: org.postgresql.Driver
enabled: true
url: jdbc:postgresql://39.101.188.84:5432/yk_map
username: postgres
password: adminadmin
# 配置检测连接是否有效
validationQuery: SELECT 1
# 初始连接数
initialSize: 5
# 最小连接池数量
minIdle: 10
# 最大连接池数量
maxActive: 20
# 配置获取连接等待超时的时间
maxWait: 60000
# 配置连接超时时间
connectTimeout: 30000
# 配置网络超时时间
socketTimeout: 60000
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
timeBetweenEvictionRunsMillis: 60000
# 配置一个连接在池中最小生存的时间,单位是毫秒
minEvictableIdleTimeMillis: 300000
# 配置一个连接在池中最大生存的时间,单位是毫秒
maxEvictableIdleTimeMillis: 900000
# 配置检测连接是否有效
validationQuery: SELECT 1 FROM DUAL
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
webStatFilter:
enabled: true
statViewServlet:
enabled: true
# 设置白名单,不填则允许所有访问
allow:
url-pattern: /druid/*
# 控制台管理用户名和密码
login-username: ruoyi
login-password: 123456
filter:
stat:
enabled: true
# 慢SQL记录
log-slow-sql: true
slow-sql-millis: 1000
merge-sql: true
wall:
config:
multi-statement-allow: true

@ -0,0 +1,64 @@
# 数据源配置
spring:
datasource:
type: com.alibaba.druid.pool.DruidDataSource
druid:
# 主库数据源
master:
driverClassName: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://192.168.0.177:3306/finance_security?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: readuser
password: Ctsy@1234
# 从库数据源
slave:
# 从数据源开关/默认关闭
driverClassName: org.postgresql.Driver
enabled: true
url: jdbc:postgresql://192.168.0.84:5432/ctsy_data
username: szctsy
password: 1hblsqt@!Wingconn#
# 配置检测连接是否有效
validationQuery: SELECT 1
# 初始连接数
initialSize: 5
# 最小连接池数量
minIdle: 10
# 最大连接池数量
maxActive: 20
# 配置获取连接等待超时的时间
maxWait: 60000
# 配置连接超时时间
connectTimeout: 30000
# 配置网络超时时间
socketTimeout: 60000
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
timeBetweenEvictionRunsMillis: 60000
# 配置一个连接在池中最小生存的时间,单位是毫秒
minEvictableIdleTimeMillis: 300000
# 配置一个连接在池中最大生存的时间,单位是毫秒
maxEvictableIdleTimeMillis: 900000
# 配置检测连接是否有效
validationQuery: SELECT 1 FROM DUAL
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
webStatFilter:
enabled: true
statViewServlet:
enabled: true
# 设置白名单,不填则允许所有访问
allow:
url-pattern: /druid/*
# 控制台管理用户名和密码
login-username: ruoyi
login-password: 123456
filter:
stat:
enabled: true
# 慢SQL记录
log-slow-sql: true
slow-sql-millis: 1000
merge-sql: true
wall:
config:
multi-statement-allow: true

@ -0,0 +1,90 @@
# 开发环境配置
server:
# 服务器的HTTP端口默认为8080
port: 9066
servlet:
# 应用的访问路径
context-path: /
tomcat:
# tomcat的URI编码
uri-encoding: UTF-8
# 连接数满后的排队数默认为100
accept-count: 1000
threads:
# tomcat最大线程数默认为200
max: 800
# Tomcat启动初始化的线程数默认值10
min-spare: 100
# 日志配置
logging:
level:
com.ykMap: debug
org.springframework: warn
# Spring配置
spring:
profiles:
active: prod
# 文件上传
servlet:
multipart:
# 单个文件大小
max-file-size: 10MB
# 设置总上传的文件大小
max-request-size: 20MB
# 服务模块
devtools:
restart:
# 热部署开关
enabled: false
# redis 配置
redis:
# 地址
host: localhost
# 端口默认为6379
port: 6379
# 数据库索引
database: 0
# 密码
password:
# 连接超时时间
timeout: 10s
lettuce:
pool:
# 连接池中的最小空闲连接
min-idle: 0
# 连接池中的最大空闲连接
max-idle: 8
# 连接池的最大数据库连接数
max-active: 8
# #连接池最大阻塞等待时间(使用负值表示没有限制)
max-wait: -1ms
# mybatis-plus配置
mybatis-plus:
# 搜索指定包别名
typeAliasesPackage: com.ykMap.**.domain,com.ykMap.**.entity,
# 配置mapper的扫描找到所有的mapper.xml映射文件
mapperLocations: classpath*:mapper/**/*Mapper.xml
# 加载全局的配置文件
configLocation: classpath:mybatis/mybatis-config.xml
# PageHelper分页插件
pagehelper:
helperDialect: mysql
supportMethodsArguments: true
params: count=countSql
knife4j:
# production: true
enable: true
# 防止XSS攻击
xss:
# 过滤开关
enabled: true
# 排除链接(多个用逗号分隔)
excludes: /system/notice
# 匹配链接
urlPatterns: /system/*,/monitor/*,/tool/*

@ -0,0 +1,75 @@
<?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.ykMap.mapper.LineMapper">
<select id="selectLineInfo" resultType="com.ykMap.entity.response.SelectLineInfoResponse">
select name, case when name like '%维护%' then '维护线路' else '押运线路' end as type
from task_mission
where id = #{id}
</select>
<select id="equip" resultType="com.ykMap.entity.response.EquipResponse">
select thing_type,
case when thing_type= '车辆' then concat(right(vehicle_info, CHARACTER_LENGTH(vehicle_info)-POSITION('-' in vehicle_info)),' (',left(vehicle_info,POSITION('-' in vehicle_info)-1),')')
when thing_type= '枪支' then concat(thing_info,' (',c3.model,')')
when thing_type= '弹夹' then concat(thing_info) end as type
from task_mission_thing a1
left join thing_gun c3 on a1.thing_id = c3.thing_id
where task_mission_id = #{id}
and a1.is_delete='0'
and a1.thing_type != 'PDA'
and a1.is_change = 0 -- 是否交换 1是 0否对应任务应急
</select>
<select id="userInfo" resultType="com.ykMap.entity.response.UserInfoResponse">
select substr(a1.employee_info,7,6) as ename, b2.name, b2.order_num
from task_mission_employee a1
left join task_position b2 on a1.task_position_id = b2.id and b2.is_delete='0' and b2.state='1'
where a1.is_delete='0'
and a1.task_mission_id=#{id}
and a1.is_change = 0 -- 是否交换 1是 0否
order by b2.order_num
</select>
<select id="items" resultType="com.ykMap.entity.response.ItemsResponse">
select count(bank_thing_id) as count
from task_mission_package
where task_mission_id = #{id}
and is_delete =0 and state = '正常'
</select>
<select id="lineTemplate" resultType="com.ykMap.entity.response.LineTemplateResponse">
select outlets_total_num, payment_point_num, line_total_num, atm_total_num, area, data_time
from ysk_ywbmwjdr.operation_overview_data
WHERE data_time >= #{a1}
and data_time &lt; #{a2}
union
(select sum(atm_total_num) as atmNum,
sum(payment_point_num) as skdNum,
sum(line_total_num) as lineNum,
sum(outlets_total_num) as yywdzs,
null as area,
null as data_time
from ysk_ywbmwjdr.operation_overview_data
WHERE create_time >= #{a1}
and create_time &lt; #{a2})
</select>
<select id="searchCity" resultType="com.ykMap.entity.response.SearchCityResponse">
SELECT
provinceName AS city,
dataTime
FROM
ysk_ywbmwjdr.operation_expansion_data
WHERE
dataTime >= #{a1} and dataTime &lt; #{a2}
</select>
<select id="searchCityCount" resultType="com.ykMap.entity.response.SearchCityCountResponse">
SELECT count(*) AS count
FROM ysk_ywbmwjdr.operation_expansion_data
WHERE dataTime >= #{a1}
and dataTime &lt; #{a2}
</select>
<select id="getByCarId" resultType="java.lang.String">
select task_mission_id
from task_mission_thing where vehicle_id = #{id}
</select>
</mapper>

@ -0,0 +1,15 @@
<?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.ykMap.mapper.YxlglMapper">
<select id="page" resultType="com.ykMap.entity.Yxlgl">
select *
from zyk_yygl_xlgl.exl_operation_line_data
<where>
<if test="req.lineType != null and req.lineType != '' ">
and line_type like concat('%',#{req.lineType},'%')
</if>
</where>
</select>
</mapper>

@ -0,0 +1,10 @@
<?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.ykMap.mapper.YywtzMapper">
<select id="page" resultType="com.ykMap.entity.Yywtz">
select *
from zyk_yygl_ywtz.exl_operation_expansion_data
</select>
</mapper>

@ -0,0 +1,10 @@
<?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.ykMap.mapper.YywzlMapper">
<select id="page" resultType="com.ykMap.entity.Yywzl">
select *
from zyk_yygl_xlgl.exl_operation_overview_data_route
</select>
</mapper>

@ -0,0 +1,93 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<!-- 日志存放路径 -->
<property name="log.path" value="/home/logs/ykMap"/>
<!-- 日志输出格式 -->
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
<!-- 控制台输出 -->
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
</appender>
<!-- 系统日志输出 -->
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/sys-info.log</file>
<!-- 循环政策:基于时间创建日志文件 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 日志文件名格式 -->
<fileNamePattern>${log.path}/sys-info.%d{yyyy-MM-dd}.log</fileNamePattern>
<!-- 日志最大的历史 60天 -->
<maxHistory>60</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<!-- 过滤的级别 -->
<level>INFO</level>
<!-- 匹配时的操作:接收(记录) -->
<onMatch>ACCEPT</onMatch>
<!-- 不匹配时的操作:拒绝(不记录) -->
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/sys-error.log</file>
<!-- 循环政策:基于时间创建日志文件 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 日志文件名格式 -->
<fileNamePattern>${log.path}/sys-error.%d{yyyy-MM-dd}.log</fileNamePattern>
<!-- 日志最大的历史 60天 -->
<maxHistory>60</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<!-- 过滤的级别 -->
<level>ERROR</level>
<!-- 匹配时的操作:接收(记录) -->
<onMatch>ACCEPT</onMatch>
<!-- 不匹配时的操作:拒绝(不记录) -->
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- 用户访问日志输出 -->
<appender name="sys-user" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/sys-user.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 按天回滚 daily -->
<fileNamePattern>${log.path}/sys-user.%d{yyyy-MM-dd}.log</fileNamePattern>
<!-- 日志最大的历史 60天 -->
<maxHistory>60</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
</appender>
<!-- 系统模块日志级别控制 -->
<logger name="com.ruoyi" level="info"/>
<!-- Spring日志级别控制 -->
<logger name="org.springframework" level="warn"/>
<root level="info">
<appender-ref ref="console"/>
</root>
<!--系统操作日志-->
<root level="info">
<appender-ref ref="file_info"/>
<appender-ref ref="file_error"/>
</root>
<!--系统用户操作日志-->
<logger name="sys-user" level="info">
<appender-ref ref="sys-user"/>
</logger>
</configuration>

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
<!-- 全局参数 -->
<settings>
<!-- 使全局的映射器启用或禁用缓存 -->
<setting name="cacheEnabled" value="true" />
<!-- 允许JDBC 支持自动生成主键 -->
<setting name="useGeneratedKeys" value="true" />
<!-- 配置默认的执行器.SIMPLE就是普通执行器;REUSE执行器会重用预处理语句(prepared statements);BATCH执行器将重用语句并执行批量更新 -->
<setting name="defaultExecutorType" value="SIMPLE" />
<!-- 指定 MyBatis 所用日志的具体实现 -->
<setting name="logImpl" value="SLF4J" />
<!-- 使用驼峰命名法转换字段 -->
<!-- <setting name="mapUnderscoreToCamelCase" value="true"/> -->
</settings>
</configuration>
Loading…
Cancel
Save