Merge remote-tracking branch 'origin/dev.yang' into dev
# Conflicts: # cloud-auth/src/main/resources/bootstrap.yml # cloud-modules/cloud-modules-system/src/main/resources/bootstrap.ymldev.carData
commit
54f0aee961
|
@ -5,8 +5,8 @@ server:
|
|||
# nacos线上地址
|
||||
nacos:
|
||||
addr: 159.75.188.178:8848
|
||||
user-name:
|
||||
password:
|
||||
user-name: nacos
|
||||
password: nacos
|
||||
namespace: eight
|
||||
# Spring
|
||||
spring:
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
<?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>
|
||||
<parent>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-common</artifactId>
|
||||
<version>3.6.3</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>cloud-common-cache</artifactId>
|
||||
|
||||
<description>
|
||||
cloud-modules-cache 缓存基准
|
||||
</description>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-common-redis</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
|
@ -0,0 +1,33 @@
|
|||
package com.muyu.common.cache;
|
||||
|
||||
import com.muyu.common.redis.service.RedisService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
/**
|
||||
* 抽象缓存层
|
||||
* @Author:yang
|
||||
* @Package:com.muyu.common
|
||||
* @Project:cloud-server-8
|
||||
* @name:CacheAbsBacis
|
||||
* @Date:2024/9/30 11:19
|
||||
*/
|
||||
public abstract class CacheAbsBasic<K,V> implements CacheBasic<K,V>{
|
||||
|
||||
@Autowired
|
||||
private RedisService redisService;
|
||||
|
||||
@Override
|
||||
public void put(K key, V value) {
|
||||
redisService.setCacheObject(encode(key),value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public V get(K key) {
|
||||
return redisService.getCacheObject(encode(key));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void remove(K key) {
|
||||
redisService.deleteObject(encode(key));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
package com.muyu.common.cache;
|
||||
|
||||
/**
|
||||
* 缓存基础
|
||||
* @Author:yang
|
||||
* @Package:com.muyu.common.cache
|
||||
* @Project:cloud-server-8
|
||||
* @name:CacheBasic
|
||||
* @Date:2024/9/30 11:41
|
||||
*/
|
||||
public interface CacheBasic<K,V> extends PrimaryKeyBasic<K>{
|
||||
|
||||
void put(K key,V value);
|
||||
|
||||
V get(K key);
|
||||
|
||||
void remove(K key);
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
package com.muyu.common.cache;
|
||||
|
||||
/**
|
||||
* 主键基础
|
||||
* @Author:yang
|
||||
* @Package:com.muyu.common.cache
|
||||
* @Project:cloud-server-8
|
||||
* @name:PrimaryKeyBasic
|
||||
* @Date:2024/9/30 11:35
|
||||
*/
|
||||
public interface PrimaryKeyBasic <K>{
|
||||
|
||||
/**
|
||||
* key 前缀
|
||||
* @return 前缀
|
||||
*/
|
||||
public String keyPre();
|
||||
/**
|
||||
* 编码
|
||||
* @param key 缓存键
|
||||
* @return 装修键
|
||||
*/
|
||||
public default String encode(K key){
|
||||
return key.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 解码key
|
||||
* @param key 编码Key
|
||||
* @return 解码后的Key
|
||||
*/
|
||||
public K decode(String key);
|
||||
|
||||
}
|
|
@ -22,7 +22,6 @@
|
|||
<module>cloud-common-rabbit</module>
|
||||
<module>cloud-common-saas</module>
|
||||
<module>cloud-common-wechat</module>
|
||||
<module>cloud-common-kafka</module>
|
||||
</modules>
|
||||
|
||||
<artifactId>cloud-common</artifactId>
|
||||
|
|
|
@ -4,7 +4,7 @@ server:
|
|||
|
||||
# nacos线上地址
|
||||
nacos:
|
||||
addr: 159.75.188.178:8848
|
||||
addr: 127.0.0.1:8848
|
||||
user-name: nacos
|
||||
password: nacos
|
||||
namespace: eight
|
||||
|
|
|
@ -0,0 +1,98 @@
|
|||
<?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>
|
||||
<parent>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-server</artifactId>
|
||||
<version>3.6.3</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
<artifactId>cloud-Saas-Service</artifactId>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
<!-- SpringCloud Alibaba Nacos Config -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||
</dependency>
|
||||
<!-- SpringCloud Alibaba Sentinel -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
|
||||
</dependency>
|
||||
<!-- SpringBoot Actuator -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>
|
||||
<!-- Mysql Connector -->
|
||||
<dependency>
|
||||
<groupId>com.mysql</groupId>
|
||||
<artifactId>mysql-connector-j</artifactId>
|
||||
</dependency>
|
||||
<!-- MuYu Common DataSource -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-common-datasource</artifactId>
|
||||
</dependency>
|
||||
<!-- MuYu Common DataScope -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-common-datascope</artifactId>
|
||||
</dependency>
|
||||
<!-- MuYu Common Log -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-common-api-doc</artifactId>
|
||||
</dependency>
|
||||
<!-- 接口模块 -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-electronic-common</artifactId>
|
||||
<version>3.6.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.pagehelper</groupId>
|
||||
<artifactId>pagehelper</artifactId>
|
||||
<version>6.0.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<finalName>clod-Saas-Service</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<!-- <!– 加入maven deploy插件,当在deploy时,忽略些model–> -->
|
||||
<!-- <plugin> -->
|
||||
<!-- <groupId>org.apache.maven.plugins</groupId> -->
|
||||
<!-- <artifactId>maven-deploy-plugin</artifactId> -->
|
||||
<!-- <version>3.1.1</version> -->
|
||||
<!-- <configuration> -->
|
||||
<!-- <skip>true</skip> -->
|
||||
<!-- </configuration> -->
|
||||
<!-- </plugin> -->
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
|
@ -0,0 +1,20 @@
|
|||
package com.muyu;
|
||||
|
||||
import com.muyu.common.security.annotation.EnableMyFeignClients;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
/**
|
||||
* @Author:杨闪闪
|
||||
* @Package:com.muyu.server.integration
|
||||
* @Project:cloud-integration
|
||||
* @name:Integration
|
||||
* @Date:2024/9/17 下午9:56
|
||||
*/
|
||||
@EnableMyFeignClients
|
||||
@SpringBootApplication
|
||||
public class SaasServiceApplication {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(SaasServiceApplication.class, args);
|
||||
}
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
|
|
@ -0,0 +1,2 @@
|
|||
Spring Boot Version: ${spring-boot.version}
|
||||
Spring Application Name: ${spring.application.name}
|
|
@ -0,0 +1,47 @@
|
|||
# Tomcat
|
||||
server:
|
||||
port: 9121
|
||||
|
||||
# nacos线上地址
|
||||
nacos:
|
||||
addr: 127.0.0.1:8848
|
||||
user-name: nacos
|
||||
password: nacos
|
||||
namespace: eight
|
||||
|
||||
# Spring
|
||||
spring:
|
||||
application:
|
||||
# 应用名称
|
||||
name: cloud-electronic
|
||||
profiles:
|
||||
# 环境配置
|
||||
active: dev
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: ${nacos.addr}
|
||||
# nacos用户名
|
||||
username: ${nacos.user-name}
|
||||
# nacos密码
|
||||
password: ${nacos.password}
|
||||
# 命名空间
|
||||
namespace: ${nacos.namespace}
|
||||
config:
|
||||
# 服务注册地址
|
||||
server-addr: ${nacos.addr}
|
||||
# nacos用户名
|
||||
username: ${nacos.user-name}
|
||||
# nacos密码
|
||||
password: ${nacos.password}
|
||||
# 命名空间
|
||||
namespace: ${nacos.namespace}
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
shared-configs:
|
||||
# 系统共享配置
|
||||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||
# 系统环境Config共享配置
|
||||
- application-config-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
|
@ -0,0 +1,74 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration scan="true" scanPeriod="60 seconds" debug="false">
|
||||
<!-- 日志存放路径 -->
|
||||
<property name="log.path" value="logs/cloud-electronic"/>
|
||||
<!-- 日志输出格式 -->
|
||||
<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}/info.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/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}/error.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/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>
|
||||
|
||||
<!-- 系统模块日志级别控制 -->
|
||||
<logger name="com.muyu" 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>
|
||||
</configuration>
|
|
@ -0,0 +1,81 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration scan="true" scanPeriod="60 seconds" debug="false">
|
||||
<!-- 日志存放路径 -->
|
||||
<property name="log.path" value="logs/cloud-electronic"/>
|
||||
<!-- 日志输出格式 -->
|
||||
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
|
||||
<property name="log.sky.pattern" value="%d{HH:mm:ss.SSS} %yellow([%tid]) [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
|
||||
|
||||
<!-- 控制台输出 -->
|
||||
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>${log.sky.pattern}</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- 系统日志输出 -->
|
||||
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/info.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/info.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
|
||||
<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}/error.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/error.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>ERROR</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<!-- 使用gRpc将日志发送到skywalking服务端 -->
|
||||
<appender name="GRPC_LOG" class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.log.GRPCLogClientAppender">
|
||||
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
|
||||
<layout class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.TraceIdPatternLogbackLayout">
|
||||
<Pattern>${log.sky.pattern}</Pattern>
|
||||
</layout>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- 系统模块日志级别控制 -->
|
||||
<logger name="com.muyu" level="info"/>
|
||||
<!-- Spring日志级别控制 -->
|
||||
<logger name="org.springframework" level="warn"/>
|
||||
|
||||
<root level="info">
|
||||
<appender-ref ref="GRPC_LOG"/>
|
||||
<appender-ref ref="console"/>
|
||||
</root>
|
||||
|
||||
<!--系统操作日志-->
|
||||
<root level="info">
|
||||
<appender-ref ref="file_info"/>
|
||||
<appender-ref ref="file_error"/>
|
||||
</root>
|
||||
</configuration>
|
|
@ -0,0 +1,81 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration scan="true" scanPeriod="60 seconds" debug="false">
|
||||
<!-- 日志存放路径 -->
|
||||
<property name="log.path" value="logs/cloud-electronic"/>
|
||||
<!-- 日志输出格式 -->
|
||||
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
|
||||
<property name="log.sky.pattern" value="%d{HH:mm:ss.SSS} %yellow([%tid]) [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
|
||||
|
||||
<!-- 控制台输出 -->
|
||||
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>${log.sky.pattern}</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- 系统日志输出 -->
|
||||
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/info.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/info.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
|
||||
<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}/error.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/error.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>ERROR</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<!-- 使用gRpc将日志发送到skywalking服务端 -->
|
||||
<appender name="GRPC_LOG" class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.log.GRPCLogClientAppender">
|
||||
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
|
||||
<layout class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.TraceIdPatternLogbackLayout">
|
||||
<Pattern>${log.sky.pattern}</Pattern>
|
||||
</layout>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- 系统模块日志级别控制 -->
|
||||
<logger name="com.muyu" level="info"/>
|
||||
<!-- Spring日志级别控制 -->
|
||||
<logger name="org.springframework" level="warn"/>
|
||||
|
||||
<root level="info">
|
||||
<appender-ref ref="GRPC_LOG"/>
|
||||
<appender-ref ref="console"/>
|
||||
</root>
|
||||
|
||||
<!--系统操作日志-->
|
||||
<root level="info">
|
||||
<appender-ref ref="file_info"/>
|
||||
<appender-ref ref="file_error"/>
|
||||
</root>
|
||||
</configuration>
|
|
@ -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.muyu.server.mapper.CarMiddleGroupMapper">
|
||||
|
||||
<select id="selectByIdList" resultType="com.muyu.domain.CarMiddleGroup">
|
||||
select
|
||||
*
|
||||
from
|
||||
car_middle_group
|
||||
where
|
||||
car_fence_id = #{carFenceId};
|
||||
</select>
|
||||
</mapper>
|
|
@ -0,0 +1,12 @@
|
|||
<?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.muyu.server.mapper.CarMiddleMapper">
|
||||
|
||||
<delete id="carDel">
|
||||
delete
|
||||
from car_middle
|
||||
where fence_group_id = #{id} and car_information_id = #{carId};
|
||||
</delete>
|
||||
</mapper>
|
|
@ -4,7 +4,7 @@ server:
|
|||
|
||||
# nacos线上地址
|
||||
nacos:
|
||||
addr: 159.75.188.178:8848
|
||||
addr: 127.0.0.1:8848
|
||||
user-name: nacos
|
||||
password: nacos
|
||||
namespace: eight
|
||||
|
|
|
@ -0,0 +1,39 @@
|
|||
<?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>
|
||||
<parent>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-modules-enterprise</artifactId>
|
||||
<version>3.6.3</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>cloud-modules-enterprise-cache</artifactId>
|
||||
<description>
|
||||
cloud-modules-enterprise-cache 缓存模块
|
||||
</description>
|
||||
<properties>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
<dependencies>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-common-cache</artifactId>
|
||||
<version>3.6.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-modules-enterprise-common</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-auth</artifactId>
|
||||
<version>3.6.3</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
|
@ -0,0 +1,27 @@
|
|||
package com.muyu.enterprise.cache.car;
|
||||
|
||||
import com.muyu.common.cache.CacheAbsBasic;
|
||||
import com.muyu.domain.CarInformation;
|
||||
import com.muyu.domain.req.CarInformationAddReq;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 添加车辆信息
|
||||
* @Author:yang
|
||||
* @Package:com.muyu.cache
|
||||
* @Project:cloud-server-8
|
||||
* @name:VehicleCacheService
|
||||
* @Date:2024/9/30 11:50
|
||||
*/
|
||||
public class VehicleCacheCarInformationAddService extends CacheAbsBasic<String, CarInformationAddReq> {
|
||||
@Override
|
||||
public String keyPre() {
|
||||
return "CarInformationAddReq:info:";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String decode(String key) {
|
||||
return key.replace("vehicle:info:","");
|
||||
}
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
package com.muyu.enterprise.cache.car;
|
||||
|
||||
import com.muyu.common.cache.CacheAbsBasic;
|
||||
import com.muyu.domain.req.CarInformationAddReq;
|
||||
import com.muyu.domain.resp.CarInformationResp;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 车辆基础信息列表缓存
|
||||
* @Author:yang
|
||||
* @Package:com.muyu.cache
|
||||
* @Project:cloud-server-8
|
||||
* @name:VehicleCacheService
|
||||
* @Date:2024/9/30 11:50
|
||||
*/
|
||||
public class VehicleCacheCarInformationFenceRespService extends CacheAbsBasic<String, List<CarInformationResp>> {
|
||||
@Override
|
||||
public String keyPre() {
|
||||
return "CarInformationFenceResp:info:";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String decode(String key) {
|
||||
return key.replace("vehicle:info:","");
|
||||
}
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
package com.muyu.enterprise.cache.car;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.muyu.common.cache.CacheAbsBasic;
|
||||
import com.muyu.domain.CarInformation;
|
||||
import com.muyu.domain.resp.CarInformationResp;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 分页查询车辆信息
|
||||
* @Author:yang
|
||||
* @Package:com.muyu.cache
|
||||
* @Project:cloud-server-8
|
||||
* @name:VehicleCacheService
|
||||
* @Date:2024/9/30 11:50
|
||||
*/
|
||||
public class VehicleCacheCarInformationRespService extends CacheAbsBasic<String, Page<CarInformationResp>> {
|
||||
@Override
|
||||
public String keyPre() {
|
||||
return "CarInformationResp:info:";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String decode(String key) {
|
||||
return key.replace("vehicle:info:","");
|
||||
}
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
package com.muyu.enterprise.cache.car;
|
||||
|
||||
import com.muyu.common.cache.CacheAbsBasic;
|
||||
import com.muyu.domain.CarInformation;
|
||||
import com.muyu.domain.resp.CarFenceGroupResp;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 查询车辆
|
||||
* @Author:yang
|
||||
* @Package:com.muyu.cache
|
||||
* @Project:cloud-server-8
|
||||
* @name:VehicleCacheService
|
||||
* @Date:2024/9/30 11:50
|
||||
*/
|
||||
public class VehicleCacheCarInformationService extends CacheAbsBasic<String, List<CarInformation>> {
|
||||
@Override
|
||||
public String keyPre() {
|
||||
return "CarInformation:info:";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String decode(String key) {
|
||||
return key.replace("vehicle:info:","");
|
||||
}
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
package com.muyu.enterprise.cache.car;
|
||||
|
||||
import com.muyu.common.cache.CacheAbsBasic;
|
||||
import com.muyu.domain.req.CarInformationAddReq;
|
||||
import com.muyu.domain.req.CarInformationUpdReq;
|
||||
|
||||
/**
|
||||
* 修改车辆信息
|
||||
* @Author:yang
|
||||
* @Package:com.muyu.cache
|
||||
* @Project:cloud-server-8
|
||||
* @name:VehicleCacheService
|
||||
* @Date:2024/9/30 11:50
|
||||
*/
|
||||
public class VehicleCacheCarInformationUpdService extends CacheAbsBasic<String, CarInformationUpdReq> {
|
||||
@Override
|
||||
public String keyPre() {
|
||||
return "CarInformationUpdReq:info:";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String decode(String key) {
|
||||
return key.replace("vehicle:info:","");
|
||||
}
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
package com.muyu.enterprise.cache.faultCode;
|
||||
|
||||
import com.muyu.common.cache.CacheAbsBasic;
|
||||
import com.muyu.domain.FaultCodeCache;
|
||||
import com.muyu.domain.req.CarInformationAddReq;
|
||||
import com.muyu.domain.req.FaultCodeAddReq;
|
||||
|
||||
/**
|
||||
* 添加车辆信息
|
||||
* @Author:yang
|
||||
* @Package:com.muyu.cache
|
||||
* @Project:cloud-server-8
|
||||
* @name:VehicleCacheService
|
||||
* @Date:2024/9/30 11:50
|
||||
*/
|
||||
public class VehicleCacheFaultCodeAddService extends CacheAbsBasic<String, FaultCodeCache> {
|
||||
@Override
|
||||
public String keyPre() {
|
||||
return "FaultCodeCache:info:";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String decode(String key) {
|
||||
return key.replace("vehicle:info:","");
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
com.muyu.enterprise.cache.car.VehicleCacheCarInformationService
|
||||
com.muyu.enterprise.cache.car.VehicleCacheCarInformationRespService
|
||||
com.muyu.enterprise.cache.car.VehicleCacheCarInformationAddService
|
||||
com.muyu.enterprise.cache.car.VehicleCacheCarInformationUpdService
|
||||
com.muyu.enterprise.cache.car.VehicleCacheCarInformationFenceRespService
|
||||
com.muyu.enterprise.cache.faultCode.VehicleCacheFaultCodeAddService
|
|
@ -15,8 +15,8 @@
|
|||
cloud-modules-enterprise-common 企业业务common
|
||||
</description>
|
||||
<properties>
|
||||
<maven.compiler.source>21</maven.compiler.source>
|
||||
<maven.compiler.target>21</maven.compiler.target>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
<dependencies>
|
||||
|
|
|
@ -71,8 +71,8 @@ public class CarInformation {
|
|||
/**
|
||||
* 车辆类型外键ID
|
||||
*/
|
||||
@Schema(title = "车辆类型外键ID", type = "Integer")
|
||||
private Integer carInformationType;
|
||||
// @Schema(title = "车辆类型外键ID", type = "Long")
|
||||
private Long carInformationType;
|
||||
/**
|
||||
* 车辆品牌
|
||||
*/
|
||||
|
@ -107,6 +107,13 @@ public class CarInformation {
|
|||
*/
|
||||
private Integer carInformationState;
|
||||
|
||||
/**
|
||||
* 车辆策略id
|
||||
*/
|
||||
private Integer carStrategyId;
|
||||
|
||||
|
||||
|
||||
public static CarInformation carInformationBuilder(CarInformation carInformation) {
|
||||
return CarInformation.builder()
|
||||
.carInformationId(carInformation.getCarInformationId())
|
||||
|
@ -147,4 +154,23 @@ public class CarInformation {
|
|||
.carInformationMotorModel(carInformation.getCarInformationMotorModel())
|
||||
.build();
|
||||
}
|
||||
|
||||
public static CarInformation carInformationListBuilder(CarInformation carInformation) {
|
||||
return CarInformation.builder()
|
||||
.carInformationId(carInformation.getCarInformationId())
|
||||
.carInformationVIN(carInformation.getCarInformationVIN())
|
||||
.carInformationLicensePlate(carInformation.getCarInformationLicensePlate())
|
||||
.carInformationBrand(carInformation.getCarInformationBrand())
|
||||
.carInformationColor(carInformation.getCarInformationColor())
|
||||
.carInformationDriver(carInformation.getCarInformationDriver())
|
||||
.carInformationMotorManufacturer(carInformation.getCarInformationMotorManufacturer())
|
||||
.carInformationMotorModel(carInformation.getCarInformationMotorModel())
|
||||
.carInformationBatteryManufacturer(carInformation.getCarInformationBatteryManufacturer())
|
||||
.carInformationBatteryModel(carInformation.getCarInformationBatteryModel())
|
||||
.carInformationFence(carInformation.getCarInformationFence())
|
||||
.carInformationType(carInformation.getCarInformationType())
|
||||
.carInformationMotorModel(carInformation.getCarInformationMotorModel())
|
||||
.carStrategyId(carInformation.getCarStrategyId())
|
||||
.build();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -85,7 +85,7 @@ public class FaultCode {
|
|||
|
||||
public static FaultCode addfaultcode(FaultCodeAddReq faultCodeAddReq){
|
||||
return FaultCode.builder()
|
||||
.faultcodeId(0)
|
||||
.faultcodeId(faultCodeAddReq.getFaultcodeId())
|
||||
.messageTypeId(faultCodeAddReq.getMessageTypeId())
|
||||
.faultcodeNumber(faultCodeAddReq.getFaultcodeNumber())
|
||||
.faultGroup(faultCodeAddReq.getFaultGroup())
|
||||
|
|
|
@ -0,0 +1,46 @@
|
|||
package com.muyu.domain;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 故障码,电子围栏,车辆,报文
|
||||
* @Author:yang
|
||||
* @Package:com.muyu.domain
|
||||
* @Project:cloud-server-8
|
||||
* @name:FaultCodeCache
|
||||
* @Date:2024/10/6 16:07
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@SuperBuilder
|
||||
@Tag(name = "故障码,电子围栏,车辆,报文")
|
||||
public class FaultCodeCache {
|
||||
|
||||
/**
|
||||
* 电子围栏信息
|
||||
*/
|
||||
private List<CarFence> carFences;
|
||||
|
||||
/**
|
||||
* 故障标签信息
|
||||
*/
|
||||
private WarnStrategy warnStrategies;
|
||||
|
||||
/**
|
||||
* 车辆信息
|
||||
*/
|
||||
public List<CarInformation> carInformation;
|
||||
|
||||
/**
|
||||
* 故障码信息
|
||||
*/
|
||||
private List<FaultCode> faultCode;
|
||||
|
||||
}
|
|
@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.annotation.TableId;
|
|||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.muyu.domain.req.FaultConditionAddReq;
|
||||
import com.muyu.domain.req.FaultConditionUpdReq;
|
||||
import com.muyu.domain.resp.FaultConditionTotalListResp;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
@ -39,7 +40,7 @@ public class FaultCondition {
|
|||
/**
|
||||
* 车辆类型Id
|
||||
*/
|
||||
private long carTypeId;
|
||||
private Long carTypeId;
|
||||
/**
|
||||
*故障名称Id
|
||||
*/
|
||||
|
@ -89,7 +90,11 @@ public class FaultCondition {
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static FaultCondition faultConditionBuilder(FaultCondition faultCondition) {
|
||||
return FaultCondition.builder()
|
||||
.carconditionId(faultCondition.getCarconditionId())
|
||||
.carTypeId(faultCondition.getCarTypeId())
|
||||
.messageTypeId(faultCondition.getMessageTypeId())
|
||||
.build();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -47,16 +47,22 @@ public class FaultLabel {
|
|||
private String messageTypeBelongs;
|
||||
|
||||
|
||||
public static FaultLabel addfaultLabel(FaultCodeAddReq faultCodeAddReq){
|
||||
public static FaultLabel addfaultLabel(FaultLabel faultLabel){
|
||||
return FaultLabel.builder()
|
||||
.messageTypeId(0)
|
||||
.messageTypeId(faultCodeAddReq.getMessageTypeId())
|
||||
.messageTypeCode(faultCodeAddReq.getMessageTypeCode())
|
||||
.messageTypeName(faultCodeAddReq.getMessageTypeName())
|
||||
.messageTypeBelongs(faultCodeAddReq.getMessageTypeBelongs())
|
||||
.messageTypeId(faultLabel.getMessageTypeId())
|
||||
.messageTypeCode(faultLabel.getMessageTypeCode())
|
||||
.messageTypeName(faultLabel.getMessageTypeName())
|
||||
.messageTypeBelongs(faultLabel.getMessageTypeBelongs())
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static FaultLabel selectFaultLabel(FaultLabel faultLabel) {
|
||||
return FaultLabel.builder()
|
||||
.messageTypeId(faultLabel.messageTypeId)
|
||||
.messageTypeCode(faultLabel.messageTypeCode)
|
||||
.messageTypeName(faultLabel.messageTypeName)
|
||||
.messageTypeBelongs(faultLabel.messageTypeBelongs)
|
||||
.build();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -78,7 +78,7 @@ public class CarInformationAddReq {
|
|||
/**
|
||||
* 车辆类型外键ID
|
||||
*/
|
||||
private Integer carInformationType;
|
||||
private Long carInformationType;
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -74,7 +74,7 @@ public class CarInformationUpdReq {
|
|||
* 车辆类型外键ID
|
||||
*/
|
||||
@Schema(title = "车辆类型外键ID", type = "Integer")
|
||||
private Integer carInformationType;
|
||||
private Long carInformationType;
|
||||
|
||||
/**
|
||||
* 是否重点车辆 (0否默认 1是 )
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package com.muyu.domain.req;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
@ -21,6 +23,10 @@ import lombok.experimental.SuperBuilder;
|
|||
@Builder
|
||||
public class FaultCodeAddReq {
|
||||
|
||||
/**
|
||||
*故障码Id
|
||||
*/
|
||||
private long faultcodeId;
|
||||
/**
|
||||
*故障名称Id
|
||||
*/
|
||||
|
|
|
@ -31,7 +31,7 @@ public class FaultConditionListResp {
|
|||
* 车辆类型Id
|
||||
*/
|
||||
private long carTypeId;
|
||||
/**
|
||||
/**
|
||||
*故障名称Id
|
||||
*/
|
||||
private long messageTypeId;
|
||||
|
|
|
@ -14,8 +14,8 @@
|
|||
cloud-modules-enterprise-server 企业业务服务
|
||||
</description>
|
||||
<properties>
|
||||
<maven.compiler.source>21</maven.compiler.source>
|
||||
<maven.compiler.target>21</maven.compiler.target>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
<dependencies>
|
||||
|
@ -44,10 +44,10 @@
|
|||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||
</dependency>
|
||||
<!--apache.kafka<-->
|
||||
<dependency>
|
||||
<groupId>org.apache.kafka</groupId>
|
||||
<artifactId>kafka-clients</artifactId>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-modules-carData</artifactId>
|
||||
<version>3.6.3</version>
|
||||
</dependency>
|
||||
<!-- SpringCloud Alibaba Sentinel -->
|
||||
<dependency>
|
||||
|
@ -101,7 +101,12 @@
|
|||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-common-kafka</artifactId>
|
||||
<artifactId>cloud-modules-carData</artifactId>
|
||||
<version>3.6.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-modules-enterprise-cache</artifactId>
|
||||
<version>3.6.3</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
|
|
@ -36,10 +36,10 @@ public class CarFenceClazzController {
|
|||
@PostMapping("/selectClazz")
|
||||
@Operation(summary = "查询数据",description = "查询数据")
|
||||
public Result<List<CarFenceClazz>> selectConnect(){
|
||||
|
||||
List<CarFenceClazz> connects = carFenceClazzService.list();
|
||||
log.info("查询数据成功");
|
||||
return Result.success(
|
||||
|
||||
connects, "操作成功"
|
||||
);
|
||||
}
|
||||
|
|
|
@ -44,6 +44,7 @@ public class CarFenceController {
|
|||
){
|
||||
Page<CarFenceResp> connects = carFenceService.selectCarFence(req);
|
||||
log.info("查询数据:"+ connects);
|
||||
|
||||
return Result.success(
|
||||
connects, "操作成功"
|
||||
);
|
||||
|
@ -58,13 +59,13 @@ public class CarFenceController {
|
|||
@Validated @RequestBody CarFence carFence
|
||||
){
|
||||
Boolean connects = carFenceService.addCarFence(carFence);
|
||||
log.info("shd");
|
||||
|
||||
log.info("shd");
|
||||
return connects?Result.success(
|
||||
null, "操作成功"
|
||||
):Result.success(
|
||||
null, "操作失败"
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -94,6 +95,7 @@ public class CarFenceController {
|
|||
@Validated @RequestBody FenceGroupReq req
|
||||
){
|
||||
Boolean connects = carFenceService.addFenceGroup(req);
|
||||
|
||||
return connects?Result.success(
|
||||
null, "操作成功"
|
||||
):Result.success(
|
||||
|
@ -138,6 +140,7 @@ public class CarFenceController {
|
|||
@PostMapping("/carGroupList")
|
||||
@Operation(summary = "查询车辆围栏组数据",description = "查询车辆围栏组信息")
|
||||
public Result<List<CarFenceGroupsResp>> carGroupList(@RequestBody CarFenceGroupReq req){
|
||||
|
||||
List<CarFenceGroupsResp> connects = carFenceService.carGroupList(req);
|
||||
return Result.success(
|
||||
connects, "操作成功"
|
||||
|
|
|
@ -36,7 +36,9 @@ public class CarFenceTypeController {
|
|||
@PostMapping("/selectType")
|
||||
@Operation(summary = "查询数据",description = "查询数据")
|
||||
public Result<List<CarFenceType>> selectConnect(){
|
||||
|
||||
List<CarFenceType> connects = carFenceTypeService.list();
|
||||
|
||||
return Result.success(
|
||||
connects, "操作成功"
|
||||
);
|
||||
|
|
|
@ -4,15 +4,19 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|||
import com.github.pagehelper.PageInfo;
|
||||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.domain.CarFenceType;
|
||||
import com.muyu.domain.CarInformation;
|
||||
import com.muyu.domain.req.CarInformationAddReq;
|
||||
import com.muyu.domain.req.CarInformationListReq;
|
||||
import com.muyu.domain.req.CarInformationUpdReq;
|
||||
import com.muyu.domain.resp.CarInformationResp;
|
||||
import com.muyu.enterprise.cache.car.*;
|
||||
import com.muyu.server.service.CarInformationService;
|
||||
import com.muyu.server.util.ObtainRootLogin;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
|
@ -30,6 +34,11 @@ import java.util.List;
|
|||
public class CarInformationController {
|
||||
@Resource
|
||||
private CarInformationService carInformationService;
|
||||
private VehicleCacheCarInformationService vehicleCacheCarInformationService;
|
||||
private VehicleCacheCarInformationRespService vehicleCacheCarInformationRespService;
|
||||
private VehicleCacheCarInformationAddService vehicleCacheCarInformationAddService;
|
||||
private VehicleCacheCarInformationUpdService vehicleCacheCarInformationUpdService;
|
||||
private VehicleCacheCarInformationFenceRespService vehicleCacheCarInformationFenceRespService;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -38,10 +47,20 @@ public class CarInformationController {
|
|||
@PostMapping("/selectCarInformation")
|
||||
@Operation(summary = "查询数据",description = "查询数据")
|
||||
public Result<List<CarInformation>> selectConnect(){
|
||||
List<CarInformation> carFenceRespPage = vehicleCacheCarInformationService
|
||||
.get(vehicleCacheCarInformationService
|
||||
.keyPre()+ ObtainRootLogin
|
||||
.obtain());
|
||||
if (CollectionUtils.isEmpty(carFenceRespPage)) {
|
||||
return Result.success(carFenceRespPage);
|
||||
}
|
||||
List<CarInformation> connects = carInformationService.list()
|
||||
.stream()
|
||||
.map(CarInformation::carInformationBuilder)
|
||||
.toList();
|
||||
vehicleCacheCarInformationService.put(
|
||||
vehicleCacheCarInformationService.keyPre()+ObtainRootLogin.obtain()
|
||||
,connects);
|
||||
return Result.success(
|
||||
connects, "操作成功"
|
||||
);
|
||||
|
@ -68,8 +87,19 @@ public class CarInformationController {
|
|||
@PostMapping("/selectCarInformationList")
|
||||
@Operation(summary = "企业车辆管理列表")
|
||||
public Result<Page<CarInformationResp>> selectCarInformationList(@Validated @RequestBody CarInformationListReq carInformationListReq) {
|
||||
|
||||
Page<CarInformationResp> carFenceRespPage = vehicleCacheCarInformationRespService
|
||||
.get(vehicleCacheCarInformationRespService
|
||||
.keyPre()+ ObtainRootLogin
|
||||
.obtain());
|
||||
if (CollectionUtils.isEmpty(carFenceRespPage.getRecords())) {
|
||||
return Result.success(carFenceRespPage);
|
||||
}
|
||||
Page<CarInformationResp> pageInfo = carInformationService.selectCarInformationList(carInformationListReq);
|
||||
log.info("企业车辆管理列表查询",carInformationListReq,pageInfo);
|
||||
vehicleCacheCarInformationRespService.put(
|
||||
vehicleCacheCarInformationRespService.keyPre()+ObtainRootLogin.obtain()
|
||||
,pageInfo);
|
||||
return Result.success(pageInfo);
|
||||
|
||||
}
|
||||
|
@ -83,6 +113,10 @@ public class CarInformationController {
|
|||
@PostMapping("/addCarInformation")
|
||||
@Operation(summary = "企业车辆添加管理")
|
||||
public Result addCarInformation(@Validated @RequestBody CarInformationAddReq carInformationAddReq){
|
||||
|
||||
vehicleCacheCarInformationAddService.put(
|
||||
vehicleCacheCarInformationAddService
|
||||
.keyPre()+ObtainRootLogin.obtain(), carInformationAddReq);
|
||||
return carInformationService.addCarInformation(carInformationAddReq)
|
||||
?Result.success("添加车辆成功")
|
||||
:Result.error(402,"添加车辆失败");
|
||||
|
@ -114,7 +148,9 @@ public class CarInformationController {
|
|||
public Result updateCarMessage(@Validated @RequestBody CarInformationUpdReq carInformationUpdReq){
|
||||
boolean updatecarInformation = carInformationService.updatecarInformation(carInformationUpdReq);
|
||||
log.info(updatecarInformation);
|
||||
System.out.println("我在这个里:"+updatecarInformation);
|
||||
vehicleCacheCarInformationUpdService.put(
|
||||
vehicleCacheCarInformationUpdService
|
||||
.keyPre()+ObtainRootLogin.obtain(), carInformationUpdReq);
|
||||
if(updatecarInformation)
|
||||
{
|
||||
return Result.success(carInformationUpdReq,"修改成功");
|
||||
|
@ -133,7 +169,17 @@ public class CarInformationController {
|
|||
@GetMapping("/selectCarInformationIdAndLicensePlate")
|
||||
@Operation(summary = "查询企业车辆 carInformationID 和 carInformationLicensePlate")
|
||||
public Result<List<CarInformationResp>> selectCarInformationIdAndLicensePlate(){
|
||||
List<CarInformationResp> carFenceRespPage = vehicleCacheCarInformationFenceRespService
|
||||
.get(vehicleCacheCarInformationFenceRespService
|
||||
.keyPre()+ ObtainRootLogin
|
||||
.obtain());
|
||||
if (CollectionUtils.isEmpty(carFenceRespPage)) {
|
||||
return Result.success(carFenceRespPage);
|
||||
}
|
||||
List<CarInformationResp> carInformations = carInformationService.selectBycarInformationIDAndLicensePlate();
|
||||
vehicleCacheCarInformationFenceRespService.put(
|
||||
vehicleCacheCarInformationFenceRespService.keyPre()+ObtainRootLogin.obtain()
|
||||
,carInformations);
|
||||
return Result.success(carInformations);
|
||||
}
|
||||
|
||||
|
|
|
@ -31,6 +31,7 @@ public class CarMessageController {
|
|||
@PostMapping("/selectCarMessageList")
|
||||
@Operation(summary = "报文模板展示列表")
|
||||
public Result<List<CarMessage>> selectCarMessageList(){
|
||||
|
||||
List<CarMessage> carMessages = carMessageService.selectCarMessageList();
|
||||
return Result.success(carMessages);
|
||||
}
|
||||
|
@ -42,10 +43,8 @@ public class CarMessageController {
|
|||
@PostMapping("/insertCarMessage")
|
||||
@Operation(summary = "添加报文信息")
|
||||
public Result<Integer> insertCarMessage(@Validated @RequestBody CarMessage carMessage){
|
||||
|
||||
int inserted = carMessageService.insertCarMessage(carMessage);
|
||||
if (inserted>0){
|
||||
return Result.success(200,"添加成功");
|
||||
}
|
||||
return Result.error(402,"添加失败");
|
||||
}
|
||||
|
||||
|
@ -57,6 +56,7 @@ public class CarMessageController {
|
|||
@Operation(summary = "删除报文信息")
|
||||
public Result<Integer> delectByCarMessageId(@RequestParam(name = "carMessageId") Integer carMessageId){
|
||||
int deleteByCarMessageId = carMessageService.delectByCarMessageId(carMessageId);
|
||||
|
||||
if (deleteByCarMessageId>0){
|
||||
return Result.success(200,"删除成功");
|
||||
}
|
||||
|
@ -69,6 +69,7 @@ public class CarMessageController {
|
|||
@PostMapping("/updateCarMessage")
|
||||
@Operation(summary = "修改报文信息")
|
||||
public Result<Integer> updateCarMessage(@Validated @RequestBody CarMessage carMessage){
|
||||
|
||||
int updateCarMessage = carMessageService.updateCarMessage(carMessage);
|
||||
if(updateCarMessage>0)
|
||||
{
|
||||
|
|
|
@ -13,6 +13,8 @@ import org.springframework.web.bind.annotation.RequestBody;
|
|||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 车辆电子围栏添加中间表控制层
|
||||
* @Author:yang
|
||||
|
|
|
@ -2,6 +2,7 @@ package com.muyu.server.controller;
|
|||
|
||||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.domain.CarType;
|
||||
import com.muyu.server.service.CarTypeService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -9,6 +10,8 @@ import org.springframework.web.bind.annotation.PostMapping;
|
|||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 车辆类型控制层
|
||||
* @Author:weiran
|
||||
|
@ -33,6 +36,9 @@ public class CarTypeController {
|
|||
@PostMapping("/list")
|
||||
@Operation(summary = "车辆类型",description = "车辆类型信息")
|
||||
public Result carTypeList(){
|
||||
return Result.success(carTypeService.selectcarType());
|
||||
|
||||
List<CarType> data = carTypeService.selectcarType();
|
||||
|
||||
return Result.success(data);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@ import com.muyu.domain.req.FaultCodeUpdReq;
|
|||
import com.muyu.domain.resp.FaultCodeTotalListResp;
|
||||
import com.muyu.server.service.FaultCodeService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
@ -24,12 +25,14 @@ import org.springframework.web.bind.annotation.*;
|
|||
|
||||
@RestController
|
||||
@RequestMapping("/faultcode")
|
||||
@Tag(name = "车辆故障码控制层",description = "从故障信息表中查询数据")
|
||||
public class FaultCodeController {
|
||||
|
||||
@Autowired
|
||||
private FaultCodeService faultCodeService;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 故障码展示(故障码联查)
|
||||
* @param faultCodeListReq
|
||||
|
@ -38,7 +41,8 @@ public class FaultCodeController {
|
|||
@PostMapping("/faultcodelist")
|
||||
@Operation(summary = "故障码列表(多)",description = "展示故障码信息")
|
||||
public Result<FaultCodeTotalListResp> selectfaultcodelist(@Validated @RequestBody FaultCodeListReq faultCodeListReq){
|
||||
return Result.success(faultCodeService.selectfaultcodelist(faultCodeListReq));
|
||||
FaultCodeTotalListResp selectfaultcodelist = faultCodeService.selectfaultcodelist(faultCodeListReq);
|
||||
return Result.success(selectfaultcodelist,"操作成功");
|
||||
}
|
||||
|
||||
|
||||
|
@ -50,6 +54,7 @@ public class FaultCodeController {
|
|||
@PostMapping("/faultcodeadd")
|
||||
@Operation(summary = "新增故障码",description = "新增故障码信息")
|
||||
public Result insertfaultcode(@Validated @RequestBody FaultCodeAddReq faultCodeAddReq){
|
||||
|
||||
faultCodeService.insert(faultCodeAddReq);
|
||||
return Result.success(null,"新增成功");
|
||||
}
|
||||
|
|
|
@ -6,9 +6,9 @@ import com.muyu.domain.FaultCondition;
|
|||
import com.muyu.domain.req.FaultConditionAddReq;
|
||||
import com.muyu.domain.req.FaultConditionListReq;
|
||||
import com.muyu.domain.req.FaultConditionUpdReq;
|
||||
import com.muyu.domain.resp.FaultConditionTotalListResp;
|
||||
import com.muyu.server.service.FaultConditionService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
@ -40,7 +40,9 @@ public class FaultConditionController {
|
|||
@PostMapping("/list")
|
||||
@Operation(summary = "故障规则列表展示",description = "故障规则列表展示")
|
||||
public Result getfaultrulelist(@RequestBody @Validated FaultConditionListReq faultConditionListReq){
|
||||
return Result.success(faultConditionService.getfaultrulelist(faultConditionListReq));
|
||||
|
||||
FaultConditionTotalListResp getfaultrulelist = faultConditionService.getfaultrulelist(faultConditionListReq);
|
||||
return Result.success(getfaultrulelist,"操作成功");
|
||||
}
|
||||
|
||||
|
||||
|
@ -57,7 +59,7 @@ public class FaultConditionController {
|
|||
if (faultConditionList.size()>0){
|
||||
return Result.error("此车辆类型已存在所对应的故障规则,无需重新制定,可在原规则上进行修改");
|
||||
}
|
||||
faultConditionService.save(FaultCondition.faultConditionadd(faultConditionAddReq));
|
||||
faultConditionService.saveFaultCondition(FaultCondition.faultConditionadd(faultConditionAddReq));
|
||||
return Result.success(null,"规则制定成功");
|
||||
}
|
||||
|
||||
|
|
|
@ -49,4 +49,9 @@ public interface CarFenceService extends IService<CarFence> {
|
|||
* 查询车辆围栏组信息
|
||||
*/
|
||||
List<CarFenceGroupsResp> carGroupList(CarFenceGroupReq req);
|
||||
|
||||
/**
|
||||
* 查询车辆围栏信息
|
||||
*/
|
||||
List<CarFence> CarFenceList(Integer carInformationFence);
|
||||
}
|
||||
|
|
|
@ -68,4 +68,9 @@ public interface CarInformationService extends IService<CarInformation> {
|
|||
*/
|
||||
List<CarInformationResp> selectBycarInformationIDAndLicensePlate();
|
||||
|
||||
/**
|
||||
* chaxunCar
|
||||
* @param faulttypeId
|
||||
*/
|
||||
List<CarInformation> selectCarInformation(Long faulttypeId);
|
||||
}
|
||||
|
|
|
@ -8,6 +8,8 @@ import com.muyu.domain.req.FaultCodeListReq;
|
|||
import com.muyu.domain.req.FaultCodeUpdReq;
|
||||
import com.muyu.domain.resp.FaultCodeTotalListResp;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 车辆故障码业务层
|
||||
|
@ -50,4 +52,10 @@ public interface FaultCodeService extends IService<FaultCode> {
|
|||
* @return
|
||||
*/
|
||||
void del(Integer messageTypeId);
|
||||
|
||||
/**
|
||||
* 故障码展示(故障码联查)
|
||||
* @return
|
||||
*/
|
||||
List<FaultCode> faultCodeList(long messageTypeId);
|
||||
}
|
||||
|
|
|
@ -32,4 +32,12 @@ public interface FaultConditionService extends IService<FaultCondition> {
|
|||
* @return
|
||||
*/
|
||||
List<FaultCondition> selectBytypeAndlabel(FaultConditionAddReq faultConditionAddReq);
|
||||
|
||||
void saveFaultCondition(FaultCondition faultCondition);
|
||||
|
||||
/**
|
||||
* 故障规则查询
|
||||
* @return
|
||||
*/
|
||||
List<FaultCondition> saveFaultConditionList();
|
||||
}
|
||||
|
|
|
@ -31,10 +31,10 @@ public interface FaultLabelService extends IService<FaultLabel> {
|
|||
|
||||
/**
|
||||
* 添加故障项表
|
||||
* @param faultCodeAddReq
|
||||
* @param faultLabel
|
||||
* @return
|
||||
*/
|
||||
Integer insertfaultlabel(FaultCodeAddReq faultCodeAddReq);
|
||||
Integer insertfaultlabel(FaultLabel faultLabel);
|
||||
|
||||
/**
|
||||
* 删除对应的故障名称表信息
|
||||
|
@ -42,4 +42,5 @@ public interface FaultLabelService extends IService<FaultLabel> {
|
|||
* @return
|
||||
*/
|
||||
Integer delfaultlabel(Integer messageTypeId);
|
||||
|
||||
}
|
||||
|
|
|
@ -316,4 +316,12 @@ public class CarFenceServiceImpl
|
|||
});
|
||||
return fenceGroupList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CarFence> CarFenceList(Integer carInformationFence) {
|
||||
return this.list(new LambdaQueryWrapper<CarFence>().eq(CarFence::getId,carInformationFence))
|
||||
.stream()
|
||||
.map(CarFence::carFenceBuild)
|
||||
.toList();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.muyu.server.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
|
@ -149,4 +150,14 @@ public class CarInformationServiceImpl
|
|||
return carInformationResps;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CarInformation> selectCarInformation(Long faulttypeId) {
|
||||
List<CarInformation> list = this.list(new LambdaQueryWrapper<CarInformation>()
|
||||
.eq(CarInformation::getCarInformationType, faulttypeId))
|
||||
.stream()
|
||||
.map(CarInformation::carInformationListBuilder)
|
||||
.toList();
|
||||
return list;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -5,20 +5,25 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import com.muyu.common.core.utils.StringUtils;
|
||||
import com.muyu.domain.FaultCode;
|
||||
import com.muyu.domain.FaultLabel;
|
||||
import com.muyu.domain.*;
|
||||
import com.muyu.domain.req.FaultCodeAddReq;
|
||||
import com.muyu.domain.req.FaultCodeListReq;
|
||||
import com.muyu.domain.req.FaultCodeUpdReq;
|
||||
import com.muyu.domain.resp.FaultCodeListResp;
|
||||
import com.muyu.domain.resp.FaultCodeTotalListResp;
|
||||
import com.muyu.domain.resp.FaultConditionListResp;
|
||||
import com.muyu.enterprise.cache.faultCode.VehicleCacheFaultCodeAddService;
|
||||
import com.muyu.server.mapper.FaultCodeMapper;
|
||||
import com.muyu.server.service.CarFenceService;
|
||||
import com.muyu.server.service.CarInformationService;
|
||||
import com.muyu.server.service.FaultCodeService;
|
||||
import com.muyu.server.service.FaultLabelService;
|
||||
import com.muyu.server.util.ObtainRootLogin;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
@ -30,12 +35,13 @@ import java.util.List;
|
|||
* @Date:2024/9/17 14:53
|
||||
*/
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class FaultCodeServiceImpl extends ServiceImpl<FaultCodeMapper, FaultCode> implements FaultCodeService {
|
||||
@Autowired
|
||||
private FaultCodeMapper faultCodeMapper;
|
||||
@Autowired
|
||||
private FaultLabelService faultLabelService;
|
||||
|
||||
private final FaultCodeMapper faultCodeMapper;
|
||||
private final FaultLabelService faultLabelService;
|
||||
private final CarInformationService carInformationService;
|
||||
private final CarFenceService carFenceService;
|
||||
|
||||
/**
|
||||
* 故障码展示(故障码联查)
|
||||
|
@ -92,8 +98,13 @@ public class FaultCodeServiceImpl extends ServiceImpl<FaultCodeMapper, FaultCode
|
|||
}
|
||||
|
||||
if (faultLabel==null && faultCode==null){
|
||||
|
||||
//添加故障项表
|
||||
faultLabelService.insertfaultlabel(faultCodeAddReq);
|
||||
FaultLabel faultLabel1 = new FaultLabel();
|
||||
faultLabel1.setMessageTypeName(faultCodeAddReq.getMessageTypeName());
|
||||
faultLabel1.setMessageTypeCode(faultCodeAddReq.getMessageTypeCode());
|
||||
faultLabel1.setMessageTypeBelongs(faultCodeAddReq.getMessageTypeBelongs());
|
||||
faultLabelService.insertfaultlabel(faultLabel1);
|
||||
//添加故障码表
|
||||
faultCodeMapper.insert(FaultCode.addfaultcode(faultCodeAddReq));
|
||||
}
|
||||
|
@ -120,10 +131,24 @@ public class FaultCodeServiceImpl extends ServiceImpl<FaultCodeMapper, FaultCode
|
|||
public void del(Integer messageTypeId) {
|
||||
// 使用LambdaQueryWrapper来构建查询条件
|
||||
LambdaQueryWrapper<FaultCode> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(FaultCode::getMessageTypeId, messageTypeId); // 假设FaultCode实体类中有一个getMessageTypeId方法
|
||||
// 假设FaultCode实体类中有一个getMessageTypeId方法
|
||||
queryWrapper.eq(FaultCode::getMessageTypeId, messageTypeId);
|
||||
//删除故障码表信息
|
||||
faultCodeMapper.delete(queryWrapper);
|
||||
//删除对应的故障名称表信息
|
||||
faultLabelService.delfaultlabel(messageTypeId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 故障码展示(故障码联查)
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<FaultCode> faultCodeList(long messageTypeId) {
|
||||
return this.list(new LambdaQueryWrapper<FaultCode>()
|
||||
.eq(FaultCode::getMessageTypeId,messageTypeId))
|
||||
.stream()
|
||||
.map(FaultCode::faultCodeBuilder)
|
||||
.toList();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,10 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import com.muyu.domain.CarType;
|
||||
import com.muyu.domain.FaultCode;
|
||||
import com.muyu.domain.FaultCondition;
|
||||
import com.muyu.domain.FaultLabel;
|
||||
import com.muyu.domain.*;
|
||||
import com.muyu.domain.req.FaultConditionAddReq;
|
||||
import com.muyu.domain.req.FaultConditionListReq;
|
||||
import com.muyu.domain.resp.FaultConditionListResp;
|
||||
|
@ -15,9 +12,11 @@ import com.muyu.domain.resp.FaultConditionTotalListResp;
|
|||
import com.muyu.domain.resp.FaultLogListResp;
|
||||
import com.muyu.server.mapper.FaultConditionMapper;
|
||||
import com.muyu.server.service.FaultConditionService;
|
||||
import com.muyu.server.util.ObtainRootLogin;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
@ -30,7 +29,9 @@ import java.util.List;
|
|||
*/
|
||||
|
||||
@Service
|
||||
public class FaultConditionServiceImpl extends ServiceImpl<FaultConditionMapper, FaultCondition> implements FaultConditionService {
|
||||
public class FaultConditionServiceImpl
|
||||
extends ServiceImpl<FaultConditionMapper, FaultCondition>
|
||||
implements FaultConditionService {
|
||||
|
||||
@Autowired
|
||||
private FaultConditionMapper faultConditionMapper;
|
||||
|
@ -83,4 +84,42 @@ public class FaultConditionServiceImpl extends ServiceImpl<FaultConditionMapper,
|
|||
List<FaultCondition> list = this.list(queryWrapper);
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveFaultCondition(FaultCondition faultCondition) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FaultCondition> saveFaultConditionList() {
|
||||
return this.list().stream().map(FaultCondition::faultConditionBuilder).toList();
|
||||
}
|
||||
|
||||
// private void faultCache(long messageTypeId, Long faulttypeId,String faultcodeNumber) {
|
||||
// FaultCodeCache faultCodeCache = new FaultCodeCache();
|
||||
//
|
||||
// //添加故障标签
|
||||
// faultCodeCache.getFaultLabels().addAll(faultLabelService.selectFaultCode(messageTypeId));
|
||||
//
|
||||
// //添加车辆
|
||||
// List<CarInformation> carInformationList = carInformationService.selectCarInformation(faulttypeId);
|
||||
// faultCodeCache.getCarInformation().addAll(carInformationList);
|
||||
//
|
||||
// //添加故障码
|
||||
// faultCodeCache.getFaultCode().addAll(this.list(new LambdaQueryWrapper<FaultCode>()
|
||||
// .eq(FaultCode::getFaultcodeNumber, faultcodeNumber))
|
||||
// .stream().map(FaultCode::faultCodeBuilder)
|
||||
// .toList());
|
||||
//
|
||||
// //添加围栏
|
||||
// ArrayList<CarFence> carFences1 = new ArrayList<>();
|
||||
// carInformationList.forEach(carInformation -> {
|
||||
// CarFence carFence = carFenceService.selectCarFenceList(carInformation.getCarInformationFence());
|
||||
// carFences1.add(carFence);
|
||||
// });
|
||||
// faultCodeCache.getCarFences().addAll(carFences1);
|
||||
// vehicleCacheFaultCodeAddService.put(vehicleCacheFaultCodeAddService.keyPre()
|
||||
// + ObtainRootLogin.obtain()
|
||||
// , faultCodeCache);
|
||||
// }
|
||||
}
|
||||
|
|
|
@ -56,12 +56,12 @@ public class FaultLabelServiceImpl extends ServiceImpl<FaultLabelMapper, FaultLa
|
|||
|
||||
/**
|
||||
* 添加故障项表
|
||||
* @param faultCodeAddReq
|
||||
* @param faultLabel
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Integer insertfaultlabel(FaultCodeAddReq faultCodeAddReq) {
|
||||
return faultLabelMapper.insert(FaultLabel.addfaultLabel(faultCodeAddReq));
|
||||
public Integer insertfaultlabel(FaultLabel faultLabel) {
|
||||
return this.save(faultLabel)?1:0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -73,7 +73,9 @@ public class FaultLabelServiceImpl extends ServiceImpl<FaultLabelMapper, FaultLa
|
|||
public Integer delfaultlabel(Integer messageTypeId) {
|
||||
// 使用LambdaQueryWrapper来构建查询条件
|
||||
LambdaQueryWrapper<FaultLabel> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(FaultLabel::getMessageTypeId, messageTypeId); // 假设FaultCode实体类中有一个getMessageTypeId方法
|
||||
// 假设FaultCode实体类中有一个getMessageTypeId方法
|
||||
queryWrapper.eq(FaultLabel::getMessageTypeId, messageTypeId);
|
||||
return faultLabelMapper.delete(queryWrapper);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -54,7 +54,7 @@ public class FaultRuleServiceImpl extends ServiceImpl<FaultRuleMapper, CarFaultR
|
|||
new LambdaQueryWrapper<CarInformation>()
|
||||
.eq(CarInformation::getCarInformationVIN, carFaultRule.getVin()));
|
||||
//根据车辆类型,查询表获取对应的类型的故障规则
|
||||
Integer carInformationType = null;
|
||||
Long carInformationType = null;
|
||||
for (CarInformation carInformation : carInformationList) {
|
||||
carInformationType= carInformation.getCarInformationType();
|
||||
}
|
||||
|
|
|
@ -0,0 +1,32 @@
|
|||
package com.muyu.server.util;
|
||||
|
||||
import com.muyu.common.security.utils.SecurityUtils;
|
||||
import com.muyu.common.system.domain.LoginUser;
|
||||
import com.muyu.common.system.domain.SysUser;
|
||||
import com.muyu.domain.CarFenceClazz;
|
||||
import com.thoughtworks.xstream.annotations.XStreamAlias;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
* @Author:yang
|
||||
* @Package:com.muyu.server.util
|
||||
* @Project:cloud-server-8
|
||||
* @name:ObtainRootLogin
|
||||
* @Date:2024/10/2 16:46
|
||||
*/
|
||||
public class ObtainRootLogin {
|
||||
|
||||
public static String obtain(){
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
|
||||
SysUser sysUser = loginUser.getSysUser();
|
||||
|
||||
return sysUser.getDatabaseName();
|
||||
};
|
||||
}
|
|
@ -0,0 +1,60 @@
|
|||
package com.muyu.server.util;
|
||||
|
||||
import com.muyu.common.core.utils.StringUtils;
|
||||
import com.muyu.domain.*;
|
||||
import com.muyu.enterprise.cache.faultCode.VehicleCacheFaultCodeAddService;
|
||||
import com.muyu.server.service.*;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.boot.ApplicationArguments;
|
||||
import org.springframework.boot.ApplicationRunner;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.AbstractList;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:yang
|
||||
* @Package:com.muyu.server.util
|
||||
* @Project:cloud-server-8
|
||||
* @name:RunCarCondition
|
||||
* @Date:2024/10/7 19:43
|
||||
*/
|
||||
@Component
|
||||
@AllArgsConstructor
|
||||
public class RunCarCondition implements ApplicationRunner {
|
||||
|
||||
private final VehicleCacheFaultCodeAddService vehicleCacheFaultCodeAddService;
|
||||
private final FaultConditionService faultConditionService;
|
||||
private final CarInformationService carInformationService;
|
||||
private final CarFenceService carFenceService;
|
||||
private final WarnStrategyService warnStrategyService;
|
||||
private final FaultCodeService faultCodeService;
|
||||
|
||||
@Override
|
||||
public void run(ApplicationArguments args) throws Exception {
|
||||
List<FaultCondition> list = faultConditionService.saveFaultConditionList();
|
||||
list.forEach(faultCondition -> {
|
||||
List<CarInformation> carInformationList = carInformationService.selectCarInformation(faultCondition.getCarTypeId());
|
||||
carInformationList.forEach(carInformation -> {
|
||||
FaultCodeCache faultCodeCache = new FaultCodeCache();
|
||||
if (StringUtils.isNotNull(carInformation.getCarInformationFence())){
|
||||
faultCodeCache.setCarFences(carFenceService.CarFenceList(carInformation.getCarInformationFence()));
|
||||
}
|
||||
if (StringUtils.isNotNull(carInformation.getCarInformationState())) {
|
||||
faultCodeCache.setWarnStrategies(warnStrategyService
|
||||
.selectWarnStrategyById(Long.valueOf(carInformation.getCarInformationState())));
|
||||
}
|
||||
if (StringUtils.isNotNull(faultCondition.getMessageTypeId())) {
|
||||
faultCodeCache.setFaultCode(faultCodeService.faultCodeList(faultCondition.getMessageTypeId()));
|
||||
}
|
||||
ArrayList<CarInformation> carInformations = new ArrayList<>();
|
||||
carInformations.add(carInformation);
|
||||
faultCodeCache.setCarInformation(carInformations);
|
||||
vehicleCacheFaultCodeAddService.put(vehicleCacheFaultCodeAddService
|
||||
.keyPre()+carInformation
|
||||
.getCarInformationVIN(), faultCodeCache);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
|
@ -4,7 +4,7 @@ server:
|
|||
|
||||
# nacos线上地址
|
||||
nacos:
|
||||
addr: 159.75.188.178:8848
|
||||
addr: 127.0.0.1:8848
|
||||
user-name: nacos
|
||||
password: nacos
|
||||
namespace: psr
|
||||
|
|
|
@ -16,13 +16,14 @@
|
|||
<modules>
|
||||
<module>cloud-modules-enterprise-common</module>
|
||||
<module>cloud-modules-enterprise-server</module>
|
||||
<module>cloud-modules-enterprise-cache</module>
|
||||
</modules>
|
||||
|
||||
<artifactId>cloud-modules-enterprise</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<properties>
|
||||
<maven.compiler.source>21</maven.compiler.source>
|
||||
<maven.compiler.target>21</maven.compiler.target>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ server:
|
|||
|
||||
# nacos线上地址
|
||||
nacos:
|
||||
addr: 159.75.188.178:8848
|
||||
addr: 127.0.0.1:8848
|
||||
user-name: nacos
|
||||
password: nacos
|
||||
namespace: eight
|
||||
|
|
|
@ -4,7 +4,7 @@ server:
|
|||
|
||||
# nacos线上地址
|
||||
nacos:
|
||||
addr: 159.75.188.178:8848
|
||||
addr: 127.0.0.1:8848
|
||||
user-name: nacos
|
||||
password: nacos
|
||||
namespace: eight
|
||||
|
|
|
@ -5,8 +5,8 @@ server:
|
|||
# nacos线上地址
|
||||
nacos:
|
||||
addr: 159.75.188.178:8848
|
||||
user-name:
|
||||
password:
|
||||
user-name: nacos
|
||||
password: nacos
|
||||
namespace: eight
|
||||
# SPRING_AMQP_DESERIALIZATION_TRUST_ALL=true spring.amqp.deserialization.trust.all
|
||||
# Spring
|
||||
|
|
|
@ -4,7 +4,7 @@ server:
|
|||
|
||||
# nacos线上地址
|
||||
nacos:
|
||||
addr: 159.75.188.178:8848
|
||||
addr: 127.0.0.1:8848
|
||||
user-name: nacos
|
||||
password: nacos
|
||||
namespace: eight
|
||||
|
|
Loading…
Reference in New Issue