SuiXxx 2024-09-29 16:03:03 +08:00
commit 7d7950e925
61 changed files with 707 additions and 102 deletions

View File

@ -1,26 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" <project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 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> <parent>
<groupId>com.muyu</groupId> <groupId>com.muyu</groupId>
<artifactId>cloud-server</artifactId> <artifactId>cloud-common</artifactId>
<version>3.6.3</version> <version>3.6.3</version>
<relativePath>../../pom.xml</relativePath>
</parent> </parent>
<groupId>com.muyu</groupId> <modelVersion>4.0.0</modelVersion>
<artifactId>cloud-common-swagger</artifactId> <artifactId>cloud-common-swagger</artifactId>
<description> <description>
cloud-common-swagger swagger2文档聚合 cloud-common-swagger swagger2文档聚合
</description> </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> <dependencies>
<!-- SpringBoot Web --> <!-- SpringBoot Web -->
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>

View File

@ -22,9 +22,9 @@ import java.util.function.Predicate;
/** /**
* @author * @author
* @packagecom.muyu.common.swagger.config * @package com.muyu.common.swagger.config
* @nameSwaggerAutoConfiguration * @name SwaggerAutoConfiguration
* @date2024/9/29 10:07 * @date 2024/9/29 10:07
*/ */
@Configuration @Configuration
@EnableSwagger2 @EnableSwagger2

View File

@ -12,7 +12,7 @@
<artifactId>cloud-modules-wechat</artifactId> <artifactId>cloud-modules-wechat</artifactId>
<description> <description>
cloud-modules-wechat 微信公众号 cloud-modules-wechat 微信公众号模块
</description> </description>
<properties> <properties>

View File

@ -29,6 +29,7 @@
<artifactId>cloud-modules</artifactId> <artifactId>cloud-modules</artifactId>
<packaging>pom</packaging> <packaging>pom</packaging>
<description> <description>
cloud-modules业务模块 cloud-modules业务模块
</description> </description>

View File

@ -33,6 +33,11 @@
<groupId>org.springframework.kafka</groupId> <groupId>org.springframework.kafka</groupId>
<artifactId>spring-kafka</artifactId> <artifactId>spring-kafka</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.apache.kafka</groupId>
<artifactId>kafka-clients</artifactId>
</dependency>
</dependencies> </dependencies>
<properties> <properties>

View File

@ -32,12 +32,6 @@
<artifactId>swagger-annotations</artifactId> <artifactId>swagger-annotations</artifactId>
<version>2.2.8</version> <version>2.2.8</version>
</dependency> </dependency>
<dependency>
<groupId>com.muyu.server</groupId>
<artifactId>saas-server</artifactId>
<version>3.6.3</version>
<scope>compile</scope>
</dependency>
</dependencies> </dependencies>
</project> </project>

View File

@ -6,6 +6,14 @@ import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
/**
*
* @Authorliuxinyue
* @Packagecom.sheep.message.domain
* @Projectcloud-server-c
* @nameMessageTemplateType
* @Date2024/9/18 21:01
*/
@Data @Data
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor

View File

@ -10,6 +10,7 @@ import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder; import lombok.experimental.SuperBuilder;
import java.io.Serializable; import java.io.Serializable;
/** /**
*
* @Authorliuxinyue * @Authorliuxinyue
* @Packagecom.sheep.message.domain * @Packagecom.sheep.message.domain
* @Projectcloud-server-c * @Projectcloud-server-c

View File

@ -9,6 +9,7 @@ import lombok.experimental.SuperBuilder;
import java.sql.Date; import java.sql.Date;
/** /**
*
* @Authorliuxinyue * @Authorliuxinyue
* @Packagecom.template.domain * @Packagecom.template.domain
* @Projectcloud-server * @Projectcloud-server

View File

@ -11,6 +11,7 @@ import lombok.experimental.SuperBuilder;
import java.io.Serializable; import java.io.Serializable;
/** /**
*
* @Authorliuxinyue * @Authorliuxinyue
* @Packagecom.sheep.message.domain * @Packagecom.sheep.message.domain
* @Projectcloud-server-c * @Projectcloud-server-c
@ -25,6 +26,7 @@ import java.io.Serializable;
@TableName(value = "message_template_type",autoResultMap = true) @TableName(value = "message_template_type",autoResultMap = true)
public class MessageTemplateType implements Serializable { public class MessageTemplateType implements Serializable {
/** /**
* *
*/ */

View File

@ -9,12 +9,21 @@ import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
/**
*
* @Authorliuxinyue
* @Packagecom.sheep.message.domain
* @Projectcloud-server-c
* @nameMessageTemplateType
* @Date2024/9/18 21:01
*/
@Data @Data
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@TableName(value = "sys_car",autoResultMap = true) @TableName(value = "sys_car",autoResultMap = true)
public class SysCar extends BaseEntity { public class SysCar extends BaseEntity {
@TableId(value = "id",type = IdType.AUTO) @TableId(value = "id",type = IdType.AUTO)
private Long id; private Long id;
private String carVin; private String carVin;

View File

@ -9,7 +9,7 @@ import lombok.*;
/** /**
* sys_car_enterprise * sys_car_enterprise
* @author YuanZiLong * @author
* @package com.muyu.breakdown.domain * @package com.muyu.breakdown.domain
* @name: SysCarEnterprise * @name: SysCarEnterprise
* @date: 2024/9/26 19:54 * @date: 2024/9/26 19:54

View File

@ -12,7 +12,7 @@ import org.apache.commons.lang3.builder.ToStringStyle;
/** /**
* sys_car_fault * sys_car_fault
* @author YuanZiLong * @author
* @package: com.muyu.breakdown.domain * @package: com.muyu.breakdown.domain
* @name: SysCarFault * @name: SysCarFault
* @date: 2024/9/20 10:56 * @date: 2024/9/20 10:56

View File

@ -12,7 +12,7 @@ import java.util.Date;
/** /**
* sys_car_fault_log * sys_car_fault_log
* @author YuanZiLong * @author
* @package: com.muyu.breakdown.domain * @package: com.muyu.breakdown.domain
* @name: SysCarFaultLog * @name: SysCarFaultLog
* @date: 2024/9/22 20:17 * @date: 2024/9/22 20:17

View File

@ -11,7 +11,7 @@ import java.util.Date;
/** /**
* sys_car_fault_message * sys_car_fault_message
* @author YuanZiLong * @author
* @package: com.muyu.breakdown.domain * @package: com.muyu.breakdown.domain
* @name: SysCarFaultMessage * @name: SysCarFaultMessage
* @date: 2024/9/22 11:57 * @date: 2024/9/22 11:57

View File

@ -10,6 +10,14 @@ import lombok.NoArgsConstructor;
import java.util.Date; import java.util.Date;
/**
*
* @Authorliuxinyue
* @Packagecom.sheep.message.domain
* @Projectcloud-server-c
* @nameMessageTemplateType
* @Date2024/9/18 21:01
*/
@Data @Data
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor

View File

@ -12,6 +12,7 @@ import lombok.experimental.SuperBuilder;
import java.util.Date; import java.util.Date;
/** /**
*
* @Authorliuxinyue * @Authorliuxinyue
* @Packagecom.template.domain * @Packagecom.template.domain
* @Projectcloud-server-c * @Projectcloud-server-c

View File

@ -0,0 +1,239 @@
package com.muyu.common.util;
import java.util.Collection;
import java.util.Collections;
/**
* kafka
* @author liuxinyue
* @Packagecom.muyu.common.util
* @nameKafkaCommonProperties
* @Date2024/9/29 12:26
*/
public class KafkaCommonProperties{
/**
* Kafka
*/
private String kafkaHost = "47.101.53.251:9092";
/**
* leader
*
* 0retry
* 1leaderlogfollower
* allleader-1
*/
private String ack = "all";
/**
*
*/
private Integer retryTimes = 1;
/**
* bytes16384bytes=16K
*/
private Integer batchSize = 16384;
/**
*
*/
private Integer lingerMs = 1;
/**
* 使bytes33554432bytes=32M.
*/
private Integer bufferMemory = 33554432;
/**
*
*/
private String keyEncoder = "org.apache.kafka.common.serialization.StringSerializer";
/**
*
*/
private String valueEncoder = "org.apache.kafka.common.serialization.StringSerializer";
/**
* topicID
*/
private String groupId = "my-group-id";
/**
* offset
*/
private String autoCommit = "true";
/**
* offsetenable.auto.committrue
*/
private String autoCommitIntervalMs = "1000";
/**
*
*/
private String keyDecoder = "org.apache.kafka.common.serialization.StringDeserializer";
/**
*
*/
private String valueDecoder = "org.apache.kafka.common.serialization.StringDeserializer";
/**
* offset
* earliesttopicoffset
* latestoffset
* noneoffset
*
*/
private String autoOffsetReset = "latest";
/**
* TOPIC
*/
private Collection<String> topic = Collections.singleton("my-topic");
public KafkaCommonProperties() {
}
public KafkaCommonProperties(String kafkaHost, String ack, Integer retryTimes, Integer batchSize, Integer lingerMs, Integer bufferMemory, String keyEncoder, String valueEncoder, String groupId, String autoCommit, String autoCommitIntervalMs, String keyDecoder, String valueDecoder, String autoOffsetReset, Collection<String> topic) {
this.kafkaHost = kafkaHost;
this.ack = ack;
this.retryTimes = retryTimes;
this.batchSize = batchSize;
this.lingerMs = lingerMs;
this.bufferMemory = bufferMemory;
this.keyEncoder = keyEncoder;
this.valueEncoder = valueEncoder;
this.groupId = groupId;
this.autoCommit = autoCommit;
this.autoCommitIntervalMs = autoCommitIntervalMs;
this.keyDecoder = keyDecoder;
this.valueDecoder = valueDecoder;
this.autoOffsetReset = autoOffsetReset;
this.topic = topic;
}
public String getKafkaHost() {
return kafkaHost;
}
public void setKafkaHost(String kafkaHost) {
this.kafkaHost = kafkaHost;
}
public String getAck() {
return ack;
}
public void setAck(String ack) {
this.ack = ack;
}
public Integer getRetryTimes() {
return retryTimes;
}
public void setRetryTimes(Integer retryTimes) {
this.retryTimes = retryTimes;
}
public Integer getBatchSize() {
return batchSize;
}
public void setBatchSize(Integer batchSize) {
this.batchSize = batchSize;
}
public Integer getLingerMs() {
return lingerMs;
}
public void setLingerMs(Integer lingerMs) {
this.lingerMs = lingerMs;
}
public Integer getBufferMemory() {
return bufferMemory;
}
public void setBufferMemory(Integer bufferMemory) {
this.bufferMemory = bufferMemory;
}
public String getKeyEncoder() {
return keyEncoder;
}
public void setKeyEncoder(String keyEncoder) {
this.keyEncoder = keyEncoder;
}
public String getValueEncoder() {
return valueEncoder;
}
public void setValueEncoder(String valueEncoder) {
this.valueEncoder = valueEncoder;
}
public String getGroupId() {
return groupId;
}
public void setGroupId(String groupId) {
this.groupId = groupId;
}
public String getAutoCommit() {
return autoCommit;
}
public void setAutoCommit(String autoCommit) {
this.autoCommit = autoCommit;
}
public String getAutoCommitIntervalMs() {
return autoCommitIntervalMs;
}
public void setAutoCommitIntervalMs(String autoCommitIntervalMs) {
this.autoCommitIntervalMs = autoCommitIntervalMs;
}
public String getKeyDecoder() {
return keyDecoder;
}
public void setKeyDecoder(String keyDecoder) {
this.keyDecoder = keyDecoder;
}
public String getValueDecoder() {
return valueDecoder;
}
public void setValueDecoder(String valueDecoder) {
this.valueDecoder = valueDecoder;
}
public String getAutoOffsetReset() {
return autoOffsetReset;
}
public void setAutoOffsetReset(String autoOffsetReset) {
this.autoOffsetReset = autoOffsetReset;
}
public Collection<String> getTopic() {
return topic;
}
public void setTopic(Collection<String> topic) {
this.topic = topic;
}
}

View File

@ -0,0 +1,64 @@
package com.muyu.common.util;
import org.apache.kafka.clients.producer.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Objects;
import java.util.Properties;
/**
* kafka
* @author liuxinyue
* @Packagecom.muyu.common.util
* @nameKafkaProducerTest
* @Date2024/9/29 12:27
*/
public class KafkaProducerTest {
private static final Logger logger = LoggerFactory.getLogger(KafkaProducerTest.class);
public static KafkaProducer<String, String> getDefaultKafkaProducer(KafkaCommonProperties kafkaCommonProperties) {
Properties properties = new Properties();
properties.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, kafkaCommonProperties.getKafkaHost());
properties.put(ProducerConfig.ACKS_CONFIG, kafkaCommonProperties.getAck());
properties.put(ProducerConfig.RETRIES_CONFIG, kafkaCommonProperties.getRetryTimes());
properties.put(ProducerConfig.BATCH_SIZE_CONFIG, kafkaCommonProperties.getBatchSize());
properties.put(ProducerConfig.LINGER_MS_CONFIG, kafkaCommonProperties.getLingerMs());
properties.put(ProducerConfig.BUFFER_MEMORY_CONFIG, kafkaCommonProperties.getBufferMemory());
properties.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, kafkaCommonProperties.getKeyEncoder());
properties.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, kafkaCommonProperties.getValueEncoder());
return new KafkaProducer<>(properties);
}
static class MyProducerCallback implements Callback {
@Override
public void onCompletion(RecordMetadata metadata, Exception exception) {
if (Objects.nonNull(exception)) {
logger.error(">>>>>>>>>>Producer生产消息异常", exception);
}
if (Objects.nonNull(metadata)) {
logger.info(">>>>>>>>>>Producer生产消息metadata{}partition:{}, offset{}", metadata, metadata.partition(), metadata.offset());
}
}
}
public static void main(String[] args) {
KafkaCommonProperties kafkaCommonProperties = new KafkaCommonProperties();
KafkaProducer<String, String> producer = getDefaultKafkaProducer(kafkaCommonProperties);
String message = "hello world ";
try {
for (int i = 0; i < 10; i++) {
// 异步写入数据
String topic = kafkaCommonProperties.getTopic().toArray()[0].toString();
ProducerRecord<String, String> producerRecord = new ProducerRecord<>(topic, message + i);
producer.send(producerRecord, new MyProducerCallback());
}
} catch (Exception ex) {
logger.error(">>>>>>>>生产数据异常:", ex);
throw new RuntimeException(ex);
} finally {
producer.close();
}
}
}

View File

@ -95,6 +95,7 @@
<version>1.3.2</version> <version>1.3.2</version>
</dependency> </dependency>
</dependencies> </dependencies>
<build> <build>

View File

@ -0,0 +1,54 @@
package com.muyu.server.config;
import org.apache.kafka.clients.consumer.KafkaConsumer;
import org.apache.kafka.common.serialization.Deserializer;
import org.apache.kafka.common.serialization.StringDeserializer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.util.HashMap;
import java.util.Map;
/**
*
* @author liuxinyue
* @Packagecom.muyu.mqtt.configure
* @Projectcloud-server
* @nameKafkaConsumerConfig
* @Date2024/9/28 23:42
*/
@Configuration
public class KafkaConsumerConfig {
@Bean
public KafkaConsumer kafkaConsumer() {
Map<String, Object> configs = new HashMap<>();
//kafka服务端的IP和端口,格式:(ip:port)
configs.put("bootstrap.servers", "47.101.53.251:9092");
//开启consumer的偏移量(offset)自动提交到Kafka
configs.put("enable.auto.commit", true);
//consumer的偏移量(offset) 自动提交的时间间隔,单位毫秒
configs.put("auto.commit.interval", 5000);
//在Kafka中没有初始化偏移量或者当前偏移量不存在情况
//earliest, 在偏移量无效的情况下, 自动重置为最早的偏移量
//latest, 在偏移量无效的情况下, 自动重置为最新的偏移量
//none, 在偏移量无效的情况下, 抛出异常.
configs.put("auto.offset.reset", "latest");
//请求阻塞的最大时间(毫秒)
configs.put("fetch.max.wait", 500);
//请求应答的最小字节数
configs.put("fetch.min.size", 1);
//心跳间隔时间(毫秒)
configs.put("heartbeat-interval", 3000);
//一次调用poll返回的最大记录条数
configs.put("max.poll.records", 500);
//指定消费组
configs.put("group.id", "kafka_grop");
//指定key使用的反序列化类
Deserializer keyDeserializer = new StringDeserializer();
//指定value使用的反序列化类
Deserializer valueDeserializer = new StringDeserializer();
//创建Kafka消费者
KafkaConsumer kafkaConsumer = new KafkaConsumer(configs, keyDeserializer, valueDeserializer);
return kafkaConsumer;
}
}

View File

@ -0,0 +1,49 @@
package com.muyu.server.config;
import org.apache.kafka.clients.producer.KafkaProducer;
import org.apache.kafka.common.serialization.Serializer;
import org.apache.kafka.common.serialization.StringSerializer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.util.HashMap;
import java.util.Map;
/**
*
* @author liuxinyue
* @Packagecom.muyu.mqtt.configure
* @Projectcloud-server
* @nameKafkaProviderConfig
* @Date2024/9/28 23:50
*/
@Configuration
public class KafkaProviderConfig {
@Bean
public KafkaProducer kafkaProducer() {
Map<String, Object> configs = new HashMap<>();
//#kafka服务端的IP和端口,格式:(ip:port)
configs.put("bootstrap.servers", "47.116.173.119:9092");
//客户端发送服务端失败的重试次数
configs.put("retries", 2);
//多个记录被发送到同一个分区时,生产者将尝试将记录一起批处理成更少的请求.
//此设置有助于提高客户端和服务器的性能,配置控制默认批量大小(以字节为单位)
configs.put("batch.size", 16384);
//生产者可用于缓冲等待发送到服务器的记录的总内存字节数(以字节为单位)
configs.put("buffer-memory", 33554432);
//生产者producer要求leader节点在考虑完成请求之前收到的确认数,用于控制发送记录在服务端的持久化
//acks=0,设置为0,则生产者producer将不会等待来自服务器的任何确认.该记录将立即添加到套接字(socket)缓冲区并视为已发送.在这种情况下,无法保证服务器已收到记录,并且重试配置(retries)将不会生效(因为客户端通常不会知道任何故障),每条记录返回的偏移量始终设置为-1.
//acks=1,设置为1,leader节点会把记录写入本地日志,不需要等待所有follower节点完全确认就会立即应答producer.在这种情况下,在follower节点复制前,leader节点确认记录后立即失败的话,记录将会丢失.
//acks=all,acks=-1,leader节点将等待所有同步复制副本完成再确认记录,这保证了只要至少有一个同步复制副本存活,记录就不会丢失.
configs.put("acks", "-1");
//指定key使用的序列化类
Serializer keySerializer = new StringSerializer();
//指定value使用的序列化类
Serializer valueSerializer = new StringSerializer();
//创建Kafka生产者
KafkaProducer kafkaProducer = new KafkaProducer(configs, keySerializer, valueSerializer);
return kafkaProducer;
}
}

View File

@ -1,4 +1,4 @@
package com.muyu.common.config; package com.muyu.server.config;
import cn.hutool.json.JSONObject; import cn.hutool.json.JSONObject;
import com.muyu.server.service.TemplateService; import com.muyu.server.service.TemplateService;
@ -10,7 +10,8 @@ import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct; import javax.annotation.PostConstruct;
/** /**
* @Authorliuxinyue *
* @author liuxinyue
* @Packagecom.muyu.mqtt.configure * @Packagecom.muyu.mqtt.configure
* @Projectcloud-server * @Projectcloud-server
* @nameMqttConfigure * @nameMqttConfigure
@ -29,7 +30,7 @@ public class MqttConfigure {
String topic = "vehicle"; String topic = "vehicle";
int qos = 2; int qos = 2;
String broker = "tcp://47.101.53.251:1883"; String broker = "tcp://47.101.53.251:1883";
String clientId = "hhhhhh"; String clientId = "测试mqtt";
try { try {
MqttClient sampleClient = new MqttClient(broker, clientId); MqttClient sampleClient = new MqttClient(broker, clientId);
MqttConnectOptions connOpts = new MqttConnectOptions(); MqttConnectOptions connOpts = new MqttConnectOptions();

View File

@ -10,7 +10,14 @@ import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.List; /**
*
* @author liuxingue
* @package com.muyu.server.controller
* @name CarTypeController
* @Date 2024/9/29 12:06
*/
@RestController @RestController

View File

@ -16,7 +16,8 @@ import java.util.List;
/** /**
* @Authorliuxinyue *
* @author liuxinyue
* @Packagecom.sheep.controller * @Packagecom.sheep.controller
* @Projectcloud-server-c * @Projectcloud-server-c
* @nameDataTypeController * @nameDataTypeController

View File

@ -18,14 +18,15 @@ import org.springframework.web.bind.annotation.*;
import java.util.List; import java.util.List;
/** /**
* @Authoryuping *
* @author yuping
* @Packagecom.muyu.fence.controller * @Packagecom.muyu.fence.controller
* @Projectcloud-server * @Projectcloud-server
* @nameFenceEtlController * @nameFenceEtlController
* @Date2024/9/17 16:28 * @Date2024/9/17 16:28
*/ */
@Log4j2 @Log4j2
@Tag(name = "电子围栏") @Tag(name = "电子围栏",description = "电子围栏")
@RestController @RestController
@RequestMapping("/fence") @RequestMapping("/fence")
@RequiredArgsConstructor @RequiredArgsConstructor
@ -36,21 +37,21 @@ public class ElectronicFenceController {
@PostMapping("/fenceArray") @PostMapping("/fenceArray")
@Operation(description = "查询所有可用的围栏") @Operation(summary = "查询所有可用的电子围栏",description = "查询所有可用的围栏")
public Result<List<ElectronicFenceResp>> fenceArray() { public Result<List<ElectronicFenceResp>> fenceArray() {
System.out.println("=====>" + "hgfvhgjy"); System.out.println("=====>" + "hgfvhgjy");
return Result.success(electronicFenceService.fenceArray()); return Result.success(electronicFenceService.fenceArray());
} }
@PostMapping("/fenceselectList") @PostMapping("/fenceselectList")
@Operation(description = "列表") @Operation(summary = "列表",description = "列表")
public Result<List<ElectronicFenceResp>> fenceselectList(@RequestBody ElectroicFenceListReq electroicFenceListReq) { public Result<List<ElectronicFenceResp>> fenceselectList(@RequestBody ElectroicFenceListReq electroicFenceListReq) {
System.out.println("=====>" + "hgfvhgjy"); System.out.println("=====>" + "hgfvhgjy");
return Result.success(electronicFenceService.fenceselectList(electroicFenceListReq)); return Result.success(electronicFenceService.fenceselectList(electroicFenceListReq));
} }
@PostMapping("/add") @PostMapping("/add")
@Operation(description = "添加") @Operation(summary = "添加电子围栏",description = "添加电子围栏")
public Result AddFence(@RequestBody ElectroicFenceAddReq electroicFenceAddReq) { public Result AddFence(@RequestBody ElectroicFenceAddReq electroicFenceAddReq) {
electronicFenceService.unquireFence(electroicFenceAddReq.getName()); electronicFenceService.unquireFence(electroicFenceAddReq.getName());
@ -60,7 +61,7 @@ public class ElectronicFenceController {
} }
@PostMapping("/upd/{id}") @PostMapping("/upd/{id}")
@Operation(description = "修改") @Operation(summary = "修改电子围栏",description = "修改电子围栏")
public Result UpdFence(@PathVariable("id") Long id, @RequestBody ElectroicFenceUpdReq electroicFenceUpdReq) { public Result UpdFence(@PathVariable("id") Long id, @RequestBody ElectroicFenceUpdReq electroicFenceUpdReq) {
electronicFenceService.updateById(ElectronicFence.buildByElectronicUpd(electroicFenceUpdReq, () -> id)); electronicFenceService.updateById(ElectronicFence.buildByElectronicUpd(electroicFenceUpdReq, () -> id));
@ -69,7 +70,7 @@ public class ElectronicFenceController {
} }
@PostMapping("/findElectronicByid/{id}") @PostMapping("/findElectronicByid/{id}")
@Operation(description = "通过id回显围栏信息") @Operation(summary = "通过Id回显电子围栏信息",description = "通过Id回显电子围栏")
public Result<ElectronicFence> findElectronicByid(@PathVariable("id") Long id) { public Result<ElectronicFence> findElectronicByid(@PathVariable("id") Long id) {
ElectronicFence electronicFence= electronicFenceService.findElectronicByid(id); ElectronicFence electronicFence= electronicFenceService.findElectronicByid(id);
@ -101,7 +102,7 @@ public class ElectronicFenceController {
} }
@PostMapping("/open/{id}") @PostMapping("/open/{id}")
@Operation(description = "开启围栏") @Operation(summary = "开启电子围栏",description = "开启电子围栏")
public Result openFence(@PathVariable("id") Long id) { public Result openFence(@PathVariable("id") Long id) {
electronicFenceService.openFence(id); electronicFenceService.openFence(id);
@ -110,7 +111,7 @@ public class ElectronicFenceController {
} }
@PostMapping("/close/{id}") @PostMapping("/close/{id}")
@Operation(description = "关闭围栏") @Operation(summary = "关闭电子围栏",description = "关闭电子围栏")
public Result closeFence(@PathVariable("id") Long id) { public Result closeFence(@PathVariable("id") Long id) {
electronicFenceService.closeFence(id); electronicFenceService.closeFence(id);
@ -119,7 +120,7 @@ public class ElectronicFenceController {
} }
@PostMapping("/setFenceWay") @PostMapping("/setFenceWay")
@Operation(description = "设置电子围栏的位置") @Operation(summary = "设置电子围栏的位置",description = "设置电子围栏的位置")
public Result setFenceWay(@RequestBody FenceWayReq fenceWayReq) { public Result setFenceWay(@RequestBody FenceWayReq fenceWayReq) {
Long id = fenceWayReq.getId(); Long id = fenceWayReq.getId();

View File

@ -20,7 +20,8 @@ import org.springframework.web.bind.annotation.*;
import java.util.List; import java.util.List;
/** /**
* @Authoryuping *
* @author yuping
* @Packagecom.muyu.fence.controller * @Packagecom.muyu.fence.controller
* @Projectcloud-server * @Projectcloud-server
* @nameFenceGroupController * @nameFenceGroupController
@ -30,7 +31,7 @@ import java.util.List;
@Log4j2 @Log4j2
@RestController @RestController
@RequestMapping("/group") @RequestMapping("/group")
@Tag(name = "围栏组") @Tag(name = "围栏组",description = "围栏组管理")
public class ElectronicFenceGroupController { public class ElectronicFenceGroupController {
@Autowired @Autowired
@ -41,6 +42,7 @@ public class ElectronicFenceGroupController {
@PostMapping("/selectGroupList") @PostMapping("/selectGroupList")
@Operation(summary = "围栏组列表",description = "围栏组列表")
public Result<List<GroupFenceListresp>> selectGroupList(@RequestBody ElectronicFenceGroupListReq req) { public Result<List<GroupFenceListresp>> selectGroupList(@RequestBody ElectronicFenceGroupListReq req) {
//查询所有的围栏组 //查询所有的围栏组
List<ElectronicFenceGroup> fenceListList = electronicFenceGroupService.selectGroupList(req); List<ElectronicFenceGroup> fenceListList = electronicFenceGroupService.selectGroupList(req);
@ -52,6 +54,7 @@ public class ElectronicFenceGroupController {
@Transactional @Transactional
@PostMapping("/addGroup") @PostMapping("/addGroup")
@Operation(summary = "添加围栏组",description = "添加围栏组")
public Result addGroup(@RequestBody ElectronicFenceGroupAddReq addReq) { public Result addGroup(@RequestBody ElectronicFenceGroupAddReq addReq) {
ElectronicFenceGroup electronicFenceGroup = ElectronicFenceGroup.buildByAdd(addReq); ElectronicFenceGroup electronicFenceGroup = ElectronicFenceGroup.buildByAdd(addReq);
@ -66,7 +69,7 @@ public class ElectronicFenceGroupController {
} }
@PostMapping("/findGroupByid/{id}") @PostMapping("/findGroupByid/{id}")
@Operation(description = "通过id回显围栏组信息") @Operation(summary = "通过id回显围栏组信息",description = "通过id回显围栏组信息")
public Result<ElectronicFenceGroupResp> findGroupByid(@PathVariable("id") Long id) { public Result<ElectronicFenceGroupResp> findGroupByid(@PathVariable("id") Long id) {
ElectronicFenceGroupResp fenceGroupResp = electronicFenceGroupService.findGroupByid(id); ElectronicFenceGroupResp fenceGroupResp = electronicFenceGroupService.findGroupByid(id);
@ -77,7 +80,7 @@ public class ElectronicFenceGroupController {
@Transactional @Transactional
@PostMapping("/updGroup/{id}") @PostMapping("/updGroup/{id}")
@Operation(description = "修改") @Operation(summary = "修改围栏组",description = "修改")
public Result UpdFence(@PathVariable("id") Long id, @RequestBody ElectronicFenceGroupUpdReq req) { public Result UpdFence(@PathVariable("id") Long id, @RequestBody ElectronicFenceGroupUpdReq req) {
electronicFenceGroupService.updateById(ElectronicFenceGroup.buildByUpd(req, () -> id)); electronicFenceGroupService.updateById(ElectronicFenceGroup.buildByUpd(req, () -> id));

View File

@ -9,7 +9,10 @@ import com.muyu.server.controller.form.InsertEnterprise;
import com.muyu.server.controller.form.SearchEnterpriseName; import com.muyu.server.controller.form.SearchEnterpriseName;
import com.muyu.server.controller.form.UpdateEnterprise; import com.muyu.server.controller.form.UpdateEnterprise;
import com.muyu.server.service.EnterpriseService; import com.muyu.server.service.EnterpriseService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid; import jakarta.validation.Valid;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -17,12 +20,16 @@ import java.util.HashMap;
import java.util.Map; import java.util.Map;
/** /**
* @Author YuPing *
* @author yuping
* @Description * @Description
* @Version 1.0 * @Version 1.0
* @Data 2024-09-26 20:24:05 * @Data 2024-09-26 20:24:05
*/ */
@RestController @RestController
@RequestMapping("/enterprise")
@Log4j2
@Tag(name = "企业运营管理",description = "企业运营管理")
public class EnterpriseController { public class EnterpriseController {
@Autowired @Autowired
@ -35,6 +42,7 @@ public class EnterpriseController {
* @return * @return
*/ */
@PostMapping("/selectEnterprise") @PostMapping("/selectEnterprise")
@Operation(summary = "查询分页企业信息",description = "查询分页企业信息")
public Result selectEnterprise(@RequestBody @Valid SearchEnterpriseName form) { public Result selectEnterprise(@RequestBody @Valid SearchEnterpriseName form) {
Integer page = form.getPage(); Integer page = form.getPage();
Integer length = form.getLength(); Integer length = form.getLength();
@ -55,6 +63,7 @@ public class EnterpriseController {
* @return * @return
*/ */
@PostMapping("/insert") @PostMapping("/insert")
@Operation(summary = "新增企业信息",description = "新增企业信息")
public Result insert(@RequestBody @Valid InsertEnterprise form){ public Result insert(@RequestBody @Valid InsertEnterprise form){
Enterprise enterprise = new Enterprise(); Enterprise enterprise = new Enterprise();
@ -73,6 +82,7 @@ public class EnterpriseController {
* @return * @return
*/ */
@GetMapping("/searchById") @GetMapping("/searchById")
@Operation(summary = "根据编号查询企业信息",description = "根据编号查询企业信息")
public Result searchById(@RequestParam("enterpriseId") Integer enterpriseId){ public Result searchById(@RequestParam("enterpriseId") Integer enterpriseId){
HashMap map = enterpriseService.searchById(enterpriseId); HashMap map = enterpriseService.searchById(enterpriseId);
return Result.success(map); return Result.success(map);
@ -85,6 +95,7 @@ public class EnterpriseController {
* @return * @return
*/ */
@PostMapping("/updateEnterEnterprise") @PostMapping("/updateEnterEnterprise")
@Operation(summary = "修改企业信息",description = "修改企业信息")
public Result updateEnterprise(@RequestBody @Valid UpdateEnterprise form){ public Result updateEnterprise(@RequestBody @Valid UpdateEnterprise form){
Enterprise enterprise = new Enterprise(); Enterprise enterprise = new Enterprise();
@ -104,6 +115,7 @@ public class EnterpriseController {
* @return * @return
*/ */
@PostMapping("/deleteByIds") @PostMapping("/deleteByIds")
@Operation(summary = "删除企业信息",description = "删除企业信息")
public Result deleteByIds(@RequestBody @Valid DeleteEnterpriseByIds form){ public Result deleteByIds(@RequestBody @Valid DeleteEnterpriseByIds form){
int rows = enterpriseService.deleteByIds(form.getIds()); int rows = enterpriseService.deleteByIds(form.getIds());
return Result.success(rows); return Result.success(rows);

View File

@ -13,7 +13,8 @@ import org.springframework.web.bind.annotation.*;
import java.util.List; import java.util.List;
/** /**
* @Authorliuxinyue *
* @author liuxinyue
* @Packagecom.sheep.message.controller * @Packagecom.sheep.message.controller
* @Projectcloud-server-c * @Projectcloud-server-c
* @nameMessageTemplateTypeController * @nameMessageTemplateTypeController

View File

@ -14,6 +14,13 @@ import org.springframework.web.bind.annotation.*;
import java.util.List; import java.util.List;
/**
*
* @author sx
* @Packagecom.template.controller
* @nameSysCarController
* @Date2024/9/20 12:12
*/
@RestController @RestController
@RequestMapping("/sysCar") @RequestMapping("/sysCar")
@AllArgsConstructor @AllArgsConstructor
@ -84,9 +91,10 @@ public class SysCarController {
* @return * @return
*/ */
@PostMapping("/findCarByVin") @PostMapping("/findCarByVin")
@Operation(summary = "根据VIN码查询车信息",description = "根据VIN码查询车信息") // @Operation(summary = "根据VIN码查询车信息",description = "根据VIN码查询车信息")
public Result<SysCar> findCarByVin(@RequestParam("carVin") String carVin){ public Result<SysCar> findCarByVin(@RequestParam("carVin") String carVin){
return Result.success(sysCarService.findCarByVin(carVin)); return Result.success(sysCarService.findCarByVin(carVin));
} }
} }

View File

@ -9,8 +9,11 @@ import com.muyu.common.domain.SysCarFault;
import com.muyu.common.security.annotation.RequiresPermissions; import com.muyu.common.security.annotation.RequiresPermissions;
import com.muyu.common.security.utils.SecurityUtils; import com.muyu.common.security.utils.SecurityUtils;
import com.muyu.server.service.SysCarFaultService; import com.muyu.server.service.SysCarFaultService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource; import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
import lombok.extern.log4j.Log4j2;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -18,24 +21,27 @@ import java.util.Arrays;
import java.util.List; import java.util.List;
/** /**
* *
* @author YuanZiLong * @author
* @package: com.muyu.breakdown.controller * @package: com.muyu.breakdown.controller
* @name: SysCarFaultController * @name: SysCarFaultController
* @date: 2024/9/20 11:00 * @date: 2024/9/20 11:00
*/ */
@RestController @RestController
@RequestMapping("/breakdown") @RequestMapping("/breakdown")
@Tag(name = "车辆故障码",description = "车辆故障码管理")
@Log4j2
public class SysCarFaultController extends BaseController public class SysCarFaultController extends BaseController
{ {
@Resource @Resource
private SysCarFaultService sysCarFaultService; private SysCarFaultService sysCarFaultService;
/** /**
* *
*/ */
@RequiresPermissions("breakdown:breakdown:list") @RequiresPermissions("breakdown:breakdown:list")
@GetMapping("/list") @GetMapping("/list")
@Operation(summary = "查询车辆故障码管理列表",description ="查询车辆故障码管理列表")
public Result<TableDataInfo<SysCarFault>> list(SysCarFault sysCarFault) public Result<TableDataInfo<SysCarFault>> list(SysCarFault sysCarFault)
{ {
startPage(); startPage();
@ -46,10 +52,11 @@ public class SysCarFaultController extends BaseController
/** /**
* *
*/ */
@RequiresPermissions("breakdown:breakdown:export") @RequiresPermissions("breakdown:breakdown:export")
@PostMapping("/export") @PostMapping("/export")
@Operation(summary = "导出车辆故障码管理列表",description = "导出车辆故障码管理列表")
public void export(HttpServletResponse response, SysCarFault sysCarFault) public void export(HttpServletResponse response, SysCarFault sysCarFault)
{ {
List<SysCarFault> list = sysCarFaultService.selectSysCarFaultList(sysCarFault); List<SysCarFault> list = sysCarFaultService.selectSysCarFaultList(sysCarFault);
@ -58,20 +65,22 @@ public class SysCarFaultController extends BaseController
} }
/** /**
* *
*/ */
@RequiresPermissions("breakdown:breakdown:query") @RequiresPermissions("breakdown:breakdown:query")
@GetMapping(value = "/{id}") @GetMapping(value = "/{id}")
@Operation(summary = "获取车辆故障码管理详细信息")
public Result<List<SysCarFault>> getInfo(@PathVariable("id") Long id) public Result<List<SysCarFault>> getInfo(@PathVariable("id") Long id)
{ {
return success(sysCarFaultService.selectSysCarFaultById(id)); return success(sysCarFaultService.selectSysCarFaultById(id));
} }
/** /**
* *
*/ */
@RequiresPermissions("breakdown:breakdown:add") @RequiresPermissions("breakdown:breakdown:add")
@PostMapping @PostMapping
@Operation(summary = "新增车辆故障码管理")
public Result<Integer> add( public Result<Integer> add(
@Validated @RequestBody SysCarFault sysCarFault) @Validated @RequestBody SysCarFault sysCarFault)
{ {
@ -80,18 +89,17 @@ public class SysCarFaultController extends BaseController
if (selectFaultByFaultCode!=null){ if (selectFaultByFaultCode!=null){
return error("新增车辆故障 ,故障码已存在"); return error("新增车辆故障 ,故障码已存在");
} }
sysCarFault.setCreateBy(SecurityUtils.getUsername()); sysCarFault.setCreateBy(SecurityUtils.getUsername());
return toAjax(sysCarFaultService.save(sysCarFault)); return toAjax(sysCarFaultService.save(sysCarFault));
} }
/** /**
* *
*/ */
@RequiresPermissions("breakdown:breakdown:edit") @RequiresPermissions("breakdown:breakdown:edit")
@PutMapping @PutMapping
@Operation(summary = "修改车辆故障码管理")
public Result<Integer> edit( public Result<Integer> edit(
@Validated @RequestBody SysCarFault sysCarFault) @Validated @RequestBody SysCarFault sysCarFault)
{ {
@ -101,10 +109,11 @@ public class SysCarFaultController extends BaseController
} }
/** /**
* *
*/ */
@RequiresPermissions("breakdown:breakdown:remove") @RequiresPermissions("breakdown:breakdown:remove")
@DeleteMapping("/{ids}") @DeleteMapping("/{ids}")
@Operation(summary = "删除车辆故障码管理")
public Result<Integer> remove(@PathVariable("ids") Long[] ids) public Result<Integer> remove(@PathVariable("ids") Long[] ids)
{ {
sysCarFaultService.removeBatchByIds(Arrays.asList(ids)); sysCarFaultService.removeBatchByIds(Arrays.asList(ids));
@ -112,21 +121,23 @@ public class SysCarFaultController extends BaseController
} }
/** /**
* *
* @param id * @param id
*/ */
@PutMapping("/enableWarningsById/{id}") @PutMapping("/enableWarningsById/{id}")
@Operation(summary = "启用故障码警告")
public void enableWarningsById(@PathVariable("id")Long id){ public void enableWarningsById(@PathVariable("id")Long id){
UpdateWrapper<SysCarFault> wrapper = new UpdateWrapper<>(); UpdateWrapper<SysCarFault> wrapper = new UpdateWrapper<>();
wrapper.eq("id",id); wrapper.eq("id",id);
wrapper.set("warn_status",0); wrapper.set("warn_status",0);
sysCarFaultService.update(wrapper); sysCarFaultService.update(wrapper);
} }
/** /**
* *
* @param id * @param id
*/ */
@PutMapping("/disableWarningsById/{id}") @PutMapping("/disableWarningsById/{id}")
@Operation(summary = "禁用故障码告警")
public void disableWarningsById(@PathVariable("id")Long id){ public void disableWarningsById(@PathVariable("id")Long id){
UpdateWrapper<SysCarFault> wrapper = new UpdateWrapper<>(); UpdateWrapper<SysCarFault> wrapper = new UpdateWrapper<>();
wrapper.eq("id",id); wrapper.eq("id",id);

View File

@ -7,7 +7,10 @@ import com.muyu.common.core.web.controller.BaseController;
import com.muyu.common.core.web.page.TableDataInfo; import com.muyu.common.core.web.page.TableDataInfo;
import com.muyu.common.domain.SysCarFaultLog; import com.muyu.common.domain.SysCarFaultLog;
import com.muyu.server.service.SysCarFaultLogService; import com.muyu.server.service.SysCarFaultLogService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -16,25 +19,39 @@ import java.util.List;
/** /**
* *
* @author YuanZiLong * @author
* @package: com.muyu.breakdown.controller * @package: com.muyu.breakdown.controller
* @name: SysCarFaultLogController * @name: SysCarFaultLogController
* @date: 2024/9/22 21:08 * @date: 2024/9/22 21:08
*/ */
@RestController @RestController
@RequestMapping("/log") @RequestMapping("/log")
@Tag(name = "车辆故障记录",description = "车辆故障记录管理")
@Log4j2
public class SysCarFaultLogController extends BaseController { public class SysCarFaultLogController extends BaseController {
@Autowired @Autowired
private SysCarFaultLogService service; private SysCarFaultLogService service;
/**
*
* @param sysCarFaultLog
* @return
*/
@PostMapping("/list") @PostMapping("/list")
@Operation(summary = "查询故障记录列表",description = "查询故障记录列表")
public Result<TableDataInfo<SysCarFaultLog>> list(@RequestBody SysCarFaultLog sysCarFaultLog){ public Result<TableDataInfo<SysCarFaultLog>> list(@RequestBody SysCarFaultLog sysCarFaultLog){
startPage(); startPage();
List<SysCarFaultLog> list = service.selectSysCarFaultLogList(sysCarFaultLog); List<SysCarFaultLog> list = service.selectSysCarFaultLogList(sysCarFaultLog);
return getDataTable(list); return getDataTable(list);
} }
/**
*
* @param sysCarFaultLog
* @return
*/
@PostMapping("/listStatusIgnore") @PostMapping("/listStatusIgnore")
@Operation(summary = "查询故障记录状态为忽略的数据列表",description = "查询故障记录状态为忽略的数据列表")
public Result<TableDataInfo<SysCarFaultLog>>listStatusIgnore(@RequestBody SysCarFaultLog sysCarFaultLog){ public Result<TableDataInfo<SysCarFaultLog>>listStatusIgnore(@RequestBody SysCarFaultLog sysCarFaultLog){
startPage(); startPage();
List<SysCarFaultLog> list = service.listStatusIgnore(sysCarFaultLog); List<SysCarFaultLog> list = service.listStatusIgnore(sysCarFaultLog);
@ -42,29 +59,51 @@ public class SysCarFaultLogController extends BaseController {
} }
/**
*
* @param sysCarFaultLog
* @return
*/
@PostMapping("/listStatusSolve") @PostMapping("/listStatusSolve")
@Operation(summary = "查询故障记录状态为已解决的数据列表",description = "查询故障记录状态为已解决的数据列表")
public Result<TableDataInfo<SysCarFaultLog>>listStatusSolve(@RequestBody SysCarFaultLog sysCarFaultLog){ public Result<TableDataInfo<SysCarFaultLog>>listStatusSolve(@RequestBody SysCarFaultLog sysCarFaultLog){
startPage(); startPage();
List<SysCarFaultLog> list = service.listStatusSolve(sysCarFaultLog); List<SysCarFaultLog> list = service.listStatusSolve(sysCarFaultLog);
return getDataTable(list); return getDataTable(list);
} }
/**
*
* @param sysCarFaultLog
* @return
*/
@PostMapping("/listStatusProcess") @PostMapping("/listStatusProcess")
@Operation(summary = "查询故障记录状态为处理中的数据列表",description = "查询故障记录状态为处理中的数据列表")
public Result<TableDataInfo<SysCarFaultLog>>listStatusProcess(@RequestBody SysCarFaultLog sysCarFaultLog){ public Result<TableDataInfo<SysCarFaultLog>>listStatusProcess(@RequestBody SysCarFaultLog sysCarFaultLog){
startPage(); startPage();
List<SysCarFaultLog> list = service.listStatusProcess(sysCarFaultLog); List<SysCarFaultLog> list = service.listStatusProcess(sysCarFaultLog);
return getDataTable(list); return getDataTable(list);
} }
/**
*
* @param sysCarFaultLog
* @return
*/
@PostMapping("/add") @PostMapping("/add")
@Operation(summary = "新增故障记录",description = "新增故障记录")
public Result<Integer> add(@RequestBody SysCarFaultLog sysCarFaultLog){ public Result<Integer> add(@RequestBody SysCarFaultLog sysCarFaultLog){
return toAjax(service.save(sysCarFaultLog)); return toAjax(service.save(sysCarFaultLog));
} }
/**
*
* @param response
* @param sysCarFaultLog
*/
@PostMapping("/export") @PostMapping("/export")
@Operation(summary = "导出故障记录",description = "导出故障记录")
public void export(HttpServletResponse response, SysCarFaultLog sysCarFaultLog){ public void export(HttpServletResponse response, SysCarFaultLog sysCarFaultLog){
List<SysCarFaultLog> list = service.selectSysCarFaultLogList(sysCarFaultLog); List<SysCarFaultLog> list = service.selectSysCarFaultLogList(sysCarFaultLog);
ExcelUtil<SysCarFaultLog> util = new ExcelUtil<SysCarFaultLog>(SysCarFaultLog.class); ExcelUtil<SysCarFaultLog> util = new ExcelUtil<SysCarFaultLog>(SysCarFaultLog.class);
@ -72,11 +111,12 @@ public class SysCarFaultLogController extends BaseController {
} }
/** /**
* *
* @param idsStr * @param idsStr
* @return * @return
*/ */
@PutMapping("/updateStatusById/{ids}") @PutMapping("/updateStatusById/{ids}")
@Operation(summary = "把处理中的数据修改为忽略",description = "把处理中的数据修改为忽略")
public Result updateStatusById(@PathVariable("ids")String idsStr){ public Result updateStatusById(@PathVariable("ids")String idsStr){
Long[] ids = Arrays.stream(idsStr.split(",")) Long[] ids = Arrays.stream(idsStr.split(","))
.map(Long::valueOf) .map(Long::valueOf)

View File

@ -6,6 +6,9 @@ import com.muyu.common.core.web.controller.BaseController;
import com.muyu.common.core.web.page.TableDataInfo; import com.muyu.common.core.web.page.TableDataInfo;
import com.muyu.common.domain.SysCarFaultMessage; import com.muyu.common.domain.SysCarFaultMessage;
import com.muyu.server.service.SysCarFaultMessageService; import com.muyu.server.service.SysCarFaultMessageService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -14,22 +17,25 @@ import java.util.List;
/** /**
* *
* @author YuanZiLong * @author
* @package: com.muyu.breakdown.controller * @package: com.muyu.breakdown.controller
* @name: SysCarFaultMessageController * @name: SysCarFaultMessageController
* @date: 2024/9/22 14:39 * @date: 2024/9/22 14:39
*/ */
@RestController @RestController
@RequestMapping("/message") @RequestMapping("/message")
@Log4j2
@Tag(name = "站内信",description = "站内信管理")
public class SysCarFaultMessageController extends BaseController { public class SysCarFaultMessageController extends BaseController {
@Autowired @Autowired
private SysCarFaultMessageService service; private SysCarFaultMessageService service;
/** /**
* *
* @return * @return
*/ */
@GetMapping("/list") @GetMapping("/list")
@Operation(summary = "查询所有站内信信息",description = "查询所有站内信信息")
public Result<TableDataInfo<SysCarFaultMessage>> list(){ public Result<TableDataInfo<SysCarFaultMessage>> list(){
startPage(); startPage();
List<SysCarFaultMessage> list = service.list(); List<SysCarFaultMessage> list = service.list();
@ -37,11 +43,12 @@ public class SysCarFaultMessageController extends BaseController {
} }
/** /**
* 1 *
* @return * @return
*/ */
@GetMapping("/listStatusOne") @GetMapping("/listStatusOne")
@Operation(summary ="查询状态为以解决的故障信息",description = "查询状态为已解决的故障信息")
public Result<TableDataInfo<SysCarFaultMessage>>listStatusOne(){ public Result<TableDataInfo<SysCarFaultMessage>>listStatusOne(){
startPage(); startPage();
List<SysCarFaultMessage> list = service.listStatusOnt(); List<SysCarFaultMessage> list = service.listStatusOnt();
@ -49,10 +56,11 @@ public class SysCarFaultMessageController extends BaseController {
} }
/** /**
* 2 *
* @return * @return
*/ */
@GetMapping("/listStatusTwo") @GetMapping("/listStatusTwo")
@Operation(summary = "查询状态为未读的信息",description = "查询状态为未读的信息")
public Result<TableDataInfo<SysCarFaultMessage>>listStatusTwo(){ public Result<TableDataInfo<SysCarFaultMessage>>listStatusTwo(){
startPage(); startPage();
List<SysCarFaultMessage> list = service.listStatusTwo(); List<SysCarFaultMessage> list = service.listStatusTwo();
@ -64,6 +72,7 @@ public class SysCarFaultMessageController extends BaseController {
* @return * @return
*/ */
@PutMapping("/updateStatusById/{id}") @PutMapping("/updateStatusById/{id}")
@Operation(summary = "修改未读站内信息为已读",description = "修改未读站内信息为已读")
public Result updateStatusById(@PathVariable("id")Long id){ public Result updateStatusById(@PathVariable("id")Long id){
UpdateWrapper<SysCarFaultMessage> wrapper = new UpdateWrapper<>(); UpdateWrapper<SysCarFaultMessage> wrapper = new UpdateWrapper<>();
wrapper.eq("id",id); wrapper.eq("id",id);

View File

@ -12,7 +12,13 @@ import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.List; /**
*
* @author liuxinyue
* @package: com.muyu.breakdown.controller
* @name: SysCarLogController
* @date: 2024/9/22 14:39
*/
@RestController @RestController
@RequestMapping("/sysCarLog") @RequestMapping("/sysCarLog")

View File

@ -6,6 +6,7 @@ import com.muyu.server.service.TemplateService;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.apache.iotdb.rpc.IoTDBConnectionException; import org.apache.iotdb.rpc.IoTDBConnectionException;
import org.apache.iotdb.rpc.StatementExecutionException; import org.apache.iotdb.rpc.StatementExecutionException;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -19,7 +20,8 @@ import java.util.List;
import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutionException;
/** /**
* @Authorliuxinyue *
* @author liuxinyue
* @Packagecom.template.controller * @Packagecom.template.controller
* @Projectcloud-server-c * @Projectcloud-server-c
* @nameTemplateController * @nameTemplateController
@ -29,6 +31,7 @@ import java.util.concurrent.ExecutionException;
@RequestMapping("/template") @RequestMapping("/template")
@AllArgsConstructor @AllArgsConstructor
@Tag(name = "报文模版管理",description = "报文模版管理") @Tag(name = "报文模版管理",description = "报文模版管理")
@Log4j2
public class TemplateController { public class TemplateController {
@Autowired @Autowired

View File

@ -3,20 +3,34 @@ package com.muyu.server.controller;
import com.muyu.common.core.domain.Result; import com.muyu.common.core.domain.Result;
import com.muyu.server.service.TemplateNeedService; import com.muyu.server.service.TemplateNeedService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
/**
*
* @author sx
* @Packagecom.template.controller
* @nametemplateNeed
* @Date2024/9/20 12:12
*/
@RestController @RestController
@RequestMapping("/templateNeed") @RequestMapping("/templateNeed")
@Tag(name = "查询报文模版",description = "查询报文模版")
@Log4j2
public class TemplateNeedController { public class TemplateNeedController {
@Autowired @Autowired
private TemplateNeedService templateNeedService; private TemplateNeedService templateNeedService;
@GetMapping("/selectByTemplateId/{templateId}") @GetMapping("/selectByTemplateId/{templateId}")
@Operation(summary = "根据模板ID查询报文模版",description = "根据模板ID查询报文模版")
public Result selectByTemplateId(@PathVariable("templateId") Long templateId){ public Result selectByTemplateId(@PathVariable("templateId") Long templateId){
return Result.success(templateNeedService.selectByTemplateId(templateId)); return Result.success(templateNeedService.selectByTemplateId(templateId));
} }

View File

@ -2,6 +2,9 @@ package com.muyu.server.controller;
import com.muyu.common.domain.WarnLogs; import com.muyu.common.domain.WarnLogs;
import com.muyu.server.service.WarnLogsService; import com.muyu.server.service.WarnLogsService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
@ -20,6 +23,8 @@ import com.muyu.common.core.domain.Result;
*/ */
@RestController @RestController
@RequestMapping("/logs") @RequestMapping("/logs")
@Tag(name = "预警日志",description = "预警日志管理")
@Log4j2
public class WarnLogsController extends BaseController public class WarnLogsController extends BaseController
{ {
@Autowired @Autowired
@ -29,6 +34,7 @@ public class WarnLogsController extends BaseController
* *
*/ */
@GetMapping("/selectWarnLogsList") @GetMapping("/selectWarnLogsList")
@Operation(summary = "预警日志列表",description = "预警日志列表")
public Result selectWarnLogsList(){ public Result selectWarnLogsList(){
return Result.success(warnLogsService.selectWarnLogsList()); return Result.success(warnLogsService.selectWarnLogsList());
} }
@ -38,6 +44,7 @@ public class WarnLogsController extends BaseController
* *
*/ */
@GetMapping(value = "selectWarnLogsById/{id}") @GetMapping(value = "selectWarnLogsById/{id}")
@Operation(summary = "根据ID查询预警日志信息",description = "根据ID查询预警日志信息")
public Result selectWarnLogsById(@PathVariable("id") Long id) public Result selectWarnLogsById(@PathVariable("id") Long id)
{ {
return success(warnLogsService.selectWarnLogsById(id)); return success(warnLogsService.selectWarnLogsById(id));
@ -47,6 +54,7 @@ public class WarnLogsController extends BaseController
* *
*/ */
@PostMapping("/addWarnLogs") @PostMapping("/addWarnLogs")
@Operation(summary = "新增预警日志",description = "新增预警日志")
public Result<Integer> addWarnLogs(@RequestBody WarnLogs warnLogs) public Result<Integer> addWarnLogs(@RequestBody WarnLogs warnLogs)
{ {
int i = warnLogsService.addWarnLogs(warnLogs); int i = warnLogsService.addWarnLogs(warnLogs);

View File

@ -6,6 +6,9 @@ import javax.annotation.Resource;
import com.muyu.common.domain.WarnRule; import com.muyu.common.domain.WarnRule;
import com.muyu.server.service.WarnRuleService; import com.muyu.server.service.WarnRuleService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.log4j.Log4j2;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.DeleteMapping;
@ -24,6 +27,8 @@ import com.muyu.common.core.domain.Result;
*/ */
@RestController @RestController
@RequestMapping("/rule") @RequestMapping("/rule")
@Tag(name = "预警规则管理",description = "预警规则管理")
@Log4j2
public class WarnRuleController extends BaseController public class WarnRuleController extends BaseController
{ {
@Resource @Resource
@ -33,6 +38,7 @@ public class WarnRuleController extends BaseController
* *
*/ */
@GetMapping("/selectWarnRuleRespList") @GetMapping("/selectWarnRuleRespList")
@Operation(summary = "预警规则列表",description = "预警规则列表")
public Result selectWarnRuleRespList() public Result selectWarnRuleRespList()
{ {
return Result.success(warnRuleService.selectWarnRuleRespList()); return Result.success(warnRuleService.selectWarnRuleRespList());
@ -43,6 +49,7 @@ public class WarnRuleController extends BaseController
*/ */
@GetMapping(value = "selectById/{id}") @GetMapping(value = "selectById/{id}")
@Operation(summary = "根据ID查询预警规则信息",description = "根据ID查询预警规则信息")
public Result<List<WarnRule>> selectById(@PathVariable("id") Long id) public Result<List<WarnRule>> selectById(@PathVariable("id") Long id)
{ {
return success(warnRuleService.selectWarnRuleById(id)); return success(warnRuleService.selectWarnRuleById(id));
@ -53,6 +60,7 @@ public class WarnRuleController extends BaseController
*/ */
@PostMapping("/addWarnRule") @PostMapping("/addWarnRule")
@Operation(summary = "新增预警规则",description = "新增预警规则")
public Result<Integer> addWarnRule(@RequestBody WarnRule warnRule) public Result<Integer> addWarnRule(@RequestBody WarnRule warnRule)
{ {
int i = warnRuleService.addWarnRule(warnRule); int i = warnRuleService.addWarnRule(warnRule);
@ -64,6 +72,7 @@ public class WarnRuleController extends BaseController
*/ */
@PostMapping("/updWarnRule") @PostMapping("/updWarnRule")
@Operation(summary = "修改预警规则",description = "修改预警规则")
public Result updWarnRule(@RequestBody WarnRule warnRule) public Result updWarnRule(@RequestBody WarnRule warnRule)
{ {
int i = warnRuleService.updWarnRule(warnRule); int i = warnRuleService.updWarnRule(warnRule);
@ -74,6 +83,7 @@ public class WarnRuleController extends BaseController
* *
*/ */
@DeleteMapping("/{ids}") @DeleteMapping("/{ids}")
@Operation(summary = "删除预警规则",description = "删除预警规则")
public Result remove(@PathVariable("ids") Long[] ids) public Result remove(@PathVariable("ids") Long[] ids)
{ {
warnRuleService.removeBatchByIds(Arrays.asList(ids)); warnRuleService.removeBatchByIds(Arrays.asList(ids));
@ -84,6 +94,7 @@ public class WarnRuleController extends BaseController
//根据策略ID查规则 //根据策略ID查规则
@GetMapping("/selectListByStrategyId/{strategyId}") @GetMapping("/selectListByStrategyId/{strategyId}")
@Operation(summary = "根据策略ID查询预警规则列表",description = "根据策略ID查询预警规则列表")
public Result selectListByStrategyId(@PathVariable("strategyId") Long strategyId){ public Result selectListByStrategyId(@PathVariable("strategyId") Long strategyId){
return Result.success(warnRuleService.selectListByStrategyId(strategyId)); return Result.success(warnRuleService.selectListByStrategyId(strategyId));
} }

View File

@ -4,7 +4,8 @@ import jakarta.validation.constraints.NotEmpty;
import lombok.Data; import lombok.Data;
/** /**
* @Author YuPing *
* @author yuping
* @Description * @Description
* @Version 1.0 * @Version 1.0
* @Data 2024-09-26 22:05:47 * @Data 2024-09-26 22:05:47

View File

@ -5,10 +5,11 @@ import jakarta.validation.constraints.NotNull;
import lombok.Data; import lombok.Data;
/** /**
* @Author YuPing *
* @Description * @author yuping
* @Version 1.0 * @package com.muyu.server.controller.form
* @Data 2024-09-26 21:16:06 * @name InsertEnterprise
* @Date 2024/9/29 12:06
*/ */
@Data @Data
public class InsertEnterprise { public class InsertEnterprise {

View File

@ -6,10 +6,11 @@ import lombok.Data;
import org.hibernate.validator.constraints.Range; import org.hibernate.validator.constraints.Range;
/** /**
* @Author YuPing *
* @Description * @author yuping
* @Version 1.0 * @package com.muyu.server.controller.form
* @Data 2024-09-26 20:48:33 * @name SearchEnterpriseName
* @Date 2024/9/29 12:06
*/ */
@Data @Data
public class SearchEnterpriseName { public class SearchEnterpriseName {

View File

@ -7,10 +7,11 @@ import jakarta.validation.constraints.Pattern;
import lombok.Data; import lombok.Data;
/** /**
* @Author YuPing *
* @Description * @author yuping
* @Version 1.0 * @package com.muyu.server.controller.form
* @Data 2024-09-26 21:22:05 * @name UpdateEnterprise
* @Date 2024/9/29 12:06
*/ */
@Data @Data
public class UpdateEnterprise { public class UpdateEnterprise {

View File

@ -9,6 +9,13 @@ import org.apache.ibatis.annotations.Select;
import java.util.List; import java.util.List;
/**
* Mapper
* @author sx
* @package com.muyu.server.mapper
* @name CarTypeMapper
* @Date 2024/9/29 12:06
*/
@Mapper @Mapper
public interface CarTypeMapper extends BaseMapper<CarType> { public interface CarTypeMapper extends BaseMapper<CarType> {

View File

@ -7,8 +7,8 @@ import org.apache.ibatis.annotations.Mapper;
import java.util.List; import java.util.List;
/** /**
* * Mapper
* @author YuanZiLong * @author
* @package com.muyu.breakdown.mapper * @package com.muyu.breakdown.mapper
* @name: SysCarFaultLogMapper * @name: SysCarFaultLogMapper
* @date: 2024/9/22 21:06 * @date: 2024/9/22 21:06

View File

@ -9,7 +9,7 @@ import java.util.List;
/** /**
* *
* @author YuanZiLong * @author
* @Package: com.muyu.breakdown.mapper * @Package: com.muyu.breakdown.mapper
* @Name: SysCarFaultMapper * @Name: SysCarFaultMapper
* @Date: 2024/9/20 10:57 * @Date: 2024/9/20 10:57

View File

@ -9,7 +9,7 @@ import java.util.List;
/** /**
* *
* @author YuanZiLong * @author
* @packer: com.muyu.breakdown.mapper * @packer: com.muyu.breakdown.mapper
* @name: SysCarFaultMessageMapper * @name: SysCarFaultMessageMapper
* @date: 2024/9/22 11:59 * @date: 2024/9/22 11:59

View File

@ -19,4 +19,8 @@ public interface SysCarMapper extends BaseMapper<SysCar> {
List<SysCarFaultLogVo> findFenceByCarVin(@Param("carVin") String carVin); List<SysCarFaultLogVo> findFenceByCarVin(@Param("carVin") String carVin);
SysCar findCarByVin(@Param("carVin") String carVin);
SysCar selectByCarVin(@Param("carVin") String carVin);
} }

View File

@ -9,10 +9,11 @@ import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
/** /**
* Mapper * Mapper
* * @author sx
* @author muyu * @package com.muyu.server.mapper
* @date 2024-09-20 * @name WarnLogsMapper
* @date 2024-09-29 12:21:09
*/ */
@Mapper @Mapper
public interface WarnLogsMapper extends BaseMapper<WarnLogs> { public interface WarnLogsMapper extends BaseMapper<WarnLogs> {

View File

@ -11,8 +11,9 @@ import java.util.List;
/** /**
* Mapper * Mapper
* * @author sx
* @author muyu * @package com.muyu.server.mapper
* @name WarnRuleMapper
* @date 2024-09-20 * @date 2024-09-20
*/ */
@Mapper @Mapper

View File

@ -12,8 +12,9 @@ import java.util.List;
/** /**
* Mapper * Mapper
*
* @author muyu * @author muyu
* @package com.muyu.server.mapper
* @name WarnStrategyMapper
* @date 2024-09-20 * @date 2024-09-20
*/ */
@Mapper @Mapper

View File

@ -7,7 +7,7 @@ import java.util.List;
/** /**
* *
* @author YuanZiLong * @author
* @package: com.muyu.breakdown.service * @package: com.muyu.breakdown.service
* @name: SysCarFaultLogService * @name: SysCarFaultLogService
* @date: 2024/9/22 21:07 * @date: 2024/9/22 21:07

View File

@ -7,7 +7,7 @@ import java.util.List;
/** /**
* *
* @author YuanZiLong * @author
* @package: com.muyu.breakdown.service * @package: com.muyu.breakdown.service
* @name: SysCarFaultMessageService * @name: SysCarFaultMessageService
* @date: 2024/9/22 14:35 * @date: 2024/9/22 14:35

View File

@ -7,7 +7,7 @@ import java.util.List;
/** /**
* *
* @author YuanZiLong * @author
* @package: com.muyu.breakdown.service * @package: com.muyu.breakdown.service
* @name : SysCarFaultService * @name : SysCarFaultService
* @date: 2024/9/20 10:57 * @date: 2024/9/20 10:57

View File

@ -22,4 +22,5 @@ public interface SysCarService {
SysCar findCarByVin(String carVin); SysCar findCarByVin(String carVin);
} }

View File

@ -11,7 +11,7 @@ import java.util.List;
/** /**
* *
* @author YuanZiLong * @author
* @package: com.muyu.breakdown.service.impl * @package: com.muyu.breakdown.service.impl
* @name: sysCarFaultLogServiceImpl * @name: sysCarFaultLogServiceImpl
* @date: 2024/9/22 21:07 * @date: 2024/9/22 21:07

View File

@ -12,7 +12,7 @@ import java.util.List;
/** /**
* *
* @author YuanZiLong * @author
* @package: com.muyu.breakdown.service.impl * @package: com.muyu.breakdown.service.impl
* @name: SysCarFaultMessageServiceImpl * @name: SysCarFaultMessageServiceImpl
* @date: 2024/9/22 14:36 * @date: 2024/9/22 14:36

View File

@ -14,7 +14,7 @@ import java.util.List;
/** /**
* *
* @author YuanZiLong * @author
* @package: com.muyu.breakdown.service.impl * @package: com.muyu.breakdown.service.impl
* @name: SysCarFaultServiceImpl * @name: SysCarFaultServiceImpl
* @date: 2024/9/20 10:58 * @date: 2024/9/20 10:58

View File

@ -1,5 +1,6 @@
package com.muyu.server.service.impl; package com.muyu.server.service.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.muyu.common.domain.SysCar; import com.muyu.common.domain.SysCar;
@ -13,6 +14,7 @@ import org.springframework.stereotype.Service;
import java.util.List; import java.util.List;
@DS("lizzDB")
@Service @Service
public class SysCarServiceImpl extends ServiceImpl<SysCarMapper, SysCar> implements SysCarService { public class SysCarServiceImpl extends ServiceImpl<SysCarMapper, SysCar> implements SysCarService {
@Autowired @Autowired
@ -51,7 +53,8 @@ public class SysCarServiceImpl extends ServiceImpl<SysCarMapper, SysCar> impleme
public SysCar findCarByVin(String carVin) { public SysCar findCarByVin(String carVin) {
QueryWrapper<SysCar> sysCarQueryWrapper = new QueryWrapper<>(); QueryWrapper<SysCar> sysCarQueryWrapper = new QueryWrapper<>();
sysCarQueryWrapper.eq("car_vin", carVin); sysCarQueryWrapper.eq("car_vin", carVin);
SysCar sysCar = sysCarMapper.selectOne(sysCarQueryWrapper); List<SysCar> sysCars = sysCarMapper.selectList(sysCarQueryWrapper);
return sysCar; return sysCars.isEmpty() ? null : sysCars.get(0);
} }
} }

View File

@ -66,6 +66,7 @@ public class TemplateServiceImpl extends ServiceImpl<TemplateMapper, Template> i
log.info("carVin码为:" + carVin); log.info("carVin码为:" + carVin);
//根据VIN码获取车辆信息 //根据VIN码获取车辆信息
SysCar carByVin = sysCarService.findCarByVin(carVin); SysCar carByVin = sysCarService.findCarByVin(carVin);
log.info("车辆信息为:" + carByVin);
//对应车辆所对应的报文模版 //对应车辆所对应的报文模版
Integer templateId = carByVin.getTemplateId(); Integer templateId = carByVin.getTemplateId();
@ -102,6 +103,7 @@ public class TemplateServiceImpl extends ServiceImpl<TemplateMapper, Template> i
jsonObject.put(messageTemplateType.getMessageField(), result.substring(startIndex, endIndex)); jsonObject.put(messageTemplateType.getMessageField(), result.substring(startIndex, endIndex));
} }
System.out.println("哈哈哈红红火火恍恍惚惚");
log.info("解析后的报文是:" + jsonObject); log.info("解析后的报文是:" + jsonObject);

View File

@ -74,4 +74,10 @@
WHERE WHERE
sys_car_fault_log.vin = #{carVin}; sys_car_fault_log.vin = #{carVin};
</select> </select>
<select id="findCarByVin" resultType="com.muyu.common.domain.SysCar">
select * from sys_car where car_vin=#{carVin}
</select>
<select id="selectByCarVin" resultType="com.muyu.common.domain.SysCar">
select * from sys_car where car_cin=#{carVin}
</select>
</mapper> </mapper>

View File

@ -278,6 +278,11 @@
<artifactId>cloud-common-saas</artifactId> <artifactId>cloud-common-saas</artifactId>
<version>${muyu.version}</version> <version>${muyu.version}</version>
</dependency> </dependency>
<dependency>
<groupId>com.muyu</groupId>
<artifactId>cloud-common-swagger</artifactId>
<version>${muyu.version}</version>
</dependency>
</dependencies> </dependencies>
</dependencyManagement> </dependencyManagement>