Merge branch 'dev' of https://gitea.qinmian.online/six-vehicle/cloud-server into dev.vehicleGateway
# Conflicts: # pom.xmldev.vehicleGateway
commit
b9529234e9
|
@ -1,7 +1,7 @@
|
|||
package com.muyu.auth.controller;
|
||||
|
||||
import com.muyu.auth.form.LoginBody;
|
||||
import com.muyu.auth.form.RegisterBody;
|
||||
import com.muyu.common.system.domain.form.LoginBody;
|
||||
import com.muyu.common.system.domain.form.RegisterBody;
|
||||
import com.muyu.auth.service.SysLoginService;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.utils.JwtUtils;
|
||||
|
@ -66,7 +66,7 @@ public class TokenController {
|
|||
@PostMapping("register")
|
||||
public Result<?> register (@RequestBody RegisterBody registerBody) {
|
||||
// 用户注册
|
||||
sysLoginService.register(registerBody.getUsername(), registerBody.getPassword());
|
||||
sysLoginService.register(registerBody);
|
||||
return Result.success();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
package com.muyu.auth.form;
|
||||
|
||||
/**
|
||||
* 用户注册对象
|
||||
*
|
||||
* @author muyu
|
||||
*/
|
||||
public class RegisterBody extends LoginBody {
|
||||
|
||||
}
|
|
@ -1,5 +1,6 @@
|
|||
package com.muyu.auth.service;
|
||||
|
||||
import com.muyu.common.system.domain.form.RegisterBody;
|
||||
import com.muyu.common.core.constant.CacheConstants;
|
||||
import com.muyu.common.core.constant.Constants;
|
||||
import com.muyu.common.core.constant.SecurityConstants;
|
||||
|
@ -98,7 +99,22 @@ public class SysLoginService {
|
|||
/**
|
||||
* 注册
|
||||
*/
|
||||
public void register (String username, String password) {
|
||||
public void register (RegisterBody registerBody) {
|
||||
//获取用户名密码
|
||||
String username = registerBody.getUsername();
|
||||
String password = registerBody.getPassword();
|
||||
if(StringUtils.isEmpty(registerBody.getEntName())) {
|
||||
throw new ServiceException("企业名称不能为空");
|
||||
}
|
||||
if(StringUtils.isEmpty(registerBody.getLeader())) {
|
||||
throw new ServiceException("负责人不能为空");
|
||||
}
|
||||
if(StringUtils.isBlank(registerBody.getPhone())) {
|
||||
throw new ServiceException("手机号不能为空");
|
||||
}
|
||||
if(StringUtils.isBlank(registerBody.getEmail())) {
|
||||
throw new ServiceException("邮箱不能为空");
|
||||
}
|
||||
// 用户名或密码为空 错误
|
||||
if (StringUtils.isAnyBlank(username, password)) {
|
||||
throw new ServiceException("用户/密码必须填写");
|
||||
|
@ -117,7 +133,7 @@ public class SysLoginService {
|
|||
sysUser.setUserName(username);
|
||||
sysUser.setNickName(username);
|
||||
sysUser.setPassword(SecurityUtils.encryptPassword(password));
|
||||
Result<?> registerResult = remoteUserService.registerUserInfo(sysUser, SecurityConstants.INNER);
|
||||
Result<?> registerResult = remoteUserService.registerUserInfo(registerBody, SecurityConstants.INNER);
|
||||
|
||||
if (Result.FAIL == registerResult.getCode()) {
|
||||
throw new ServiceException(registerResult.getMsg());
|
||||
|
|
|
@ -7,7 +7,7 @@ nacos:
|
|||
addr: 106.15.136.7:8848
|
||||
user-name: nacos
|
||||
password: nacos
|
||||
namespace: lyb
|
||||
namespace: dev
|
||||
# Spring
|
||||
spring:
|
||||
application:
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
package com.muyu.common.core.constant;
|
||||
|
||||
/**
|
||||
* kafka常量信息
|
||||
* @Author:李庆帅
|
||||
* @Package:com.muyu.common.core.constant
|
||||
* @Project:cloud-server
|
||||
* @name:KafkaConstants
|
||||
* @Date:2024/9/29 16:41
|
||||
*/
|
||||
public class KafkaConstants {
|
||||
|
||||
/**
|
||||
* 协议解析报文传递数据(队列名称)
|
||||
*/
|
||||
public final static String MESSAGE_PARSING = "MessageParsing";
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
package com.muyu.common.core.constant;
|
||||
|
||||
/**
|
||||
* redis常量信息
|
||||
* @Author:李庆帅
|
||||
* @Package:com.muyu.common.core.constant
|
||||
* @Project:cloud-server
|
||||
* @name:RedisConstants
|
||||
* @Date:2024/9/29 17:28
|
||||
*/
|
||||
public class RedisConstants {
|
||||
|
||||
/**
|
||||
* redisKey(协议解析报文传递)
|
||||
*/
|
||||
public final static String MESSAGE_TEMPLATE = "messageTemplate";
|
||||
}
|
|
@ -20,4 +20,8 @@ public class ServiceNameConstants {
|
|||
* 文件服务的serviceid
|
||||
*/
|
||||
public static final String FILE_SERVICE = "cloud-file";
|
||||
/**
|
||||
* 企业平台服务的serviceid
|
||||
*/
|
||||
public static final String ENTERPRISE_SERVICE = "cloud-enterprise";
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@ public class BaseEntity implements Serializable {
|
|||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private String createTime;
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新者
|
||||
|
@ -58,7 +58,7 @@ public class BaseEntity implements Serializable {
|
|||
*/
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private String updateTime;
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
|
|
|
@ -0,0 +1,37 @@
|
|||
<?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-kafka</artifactId>
|
||||
|
||||
<description>
|
||||
cloud-common-kafka
|
||||
</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-core</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- kafka客户端 -->
|
||||
<dependency>
|
||||
<groupId>org.apache.kafka</groupId>
|
||||
<artifactId>kafka-clients</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
|
@ -0,0 +1,102 @@
|
|||
package com.muyu.common.kafka.config;
|
||||
|
||||
import com.muyu.common.core.text.StrFormatter;
|
||||
import com.muyu.common.kafka.constant.KafkaConfigConstants;
|
||||
import org.apache.kafka.clients.consumer.KafkaConsumer;
|
||||
import org.apache.kafka.common.serialization.Deserializer;
|
||||
import org.apache.kafka.common.serialization.StringDeserializer;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import java.util.HashMap;
|
||||
|
||||
/**
|
||||
* @Author: zi run
|
||||
* @Date 2024/9/28 20:32
|
||||
* @Description Kafka消费者配置
|
||||
*/
|
||||
@Configuration
|
||||
public class KafkaConsumerConfig {
|
||||
|
||||
/**
|
||||
* 服务端IP
|
||||
*/
|
||||
@Value("${kafka.consumer.bootstrap-servers-ip}")
|
||||
private String bootstrapServersIP;
|
||||
|
||||
/**
|
||||
* 服务端口号
|
||||
*/
|
||||
@Value("${kafka.consumer.bootstrap-servers-port}")
|
||||
private String bootstrapServersPort;
|
||||
|
||||
/**
|
||||
* 开启消费者偏移量
|
||||
*/
|
||||
@Value("${kafka.consumer.enable-auto-commit}")
|
||||
private Boolean enableAutoCommit;
|
||||
|
||||
/**
|
||||
* 自动提交时间间隔
|
||||
*/
|
||||
@Value("${kafka.consumer.auto-commit-interval}")
|
||||
private Integer autoCommitInterval;
|
||||
|
||||
/**
|
||||
* 自动重置偏移量
|
||||
*/
|
||||
@Value("${kafka.consumer.auto-offset-reset}")
|
||||
private String autoOffsetReset;
|
||||
|
||||
/**
|
||||
* 请求阻塞的最大时间
|
||||
*/
|
||||
@Value("${kafka.consumer.fetch-max-wait}")
|
||||
private Integer fetchMaxWait;
|
||||
|
||||
/**
|
||||
* 请求应答的最小字节数
|
||||
*/
|
||||
@Value("${kafka.consumer.fetch-min-size}")
|
||||
private Integer fetchMinSize;
|
||||
|
||||
/**
|
||||
* 心跳间隔时间
|
||||
*/
|
||||
@Value("${kafka.consumer.heartbeat-interval}")
|
||||
private Integer heartbeatInterval;
|
||||
|
||||
/**
|
||||
* 一次调用poll返回的最大记录条数
|
||||
*/
|
||||
@Value("${kafka.consumer.max-poll-records}")
|
||||
private Integer maxPollRecords;
|
||||
|
||||
/**
|
||||
* 指定消费组
|
||||
*/
|
||||
@Value("${kafka.consumer.group-id}")
|
||||
private String groupId;
|
||||
|
||||
/**
|
||||
* Kafka消费者初始化配置
|
||||
* @return Kafka消费者实例
|
||||
*/
|
||||
@Bean
|
||||
public KafkaConsumer<String, String> kafkaConsumer() {
|
||||
HashMap<String, Object> configs = new HashMap<>();
|
||||
configs.put(KafkaConfigConstants.BOOTSTRAP_SERVERS,
|
||||
StrFormatter.format("{}:{}", bootstrapServersIP, bootstrapServersPort));
|
||||
configs.put(KafkaConfigConstants.ENABLE_AUTO_COMMIT, enableAutoCommit);
|
||||
configs.put(KafkaConfigConstants.AUTO_COMMIT_INTERVAL, autoCommitInterval);
|
||||
configs.put(KafkaConfigConstants.AUTO_OFFSET_RESET, autoOffsetReset);
|
||||
configs.put(KafkaConfigConstants.FETCH_MAX_WAIT, fetchMaxWait);
|
||||
configs.put(KafkaConfigConstants.FETCH_MIN_SIZE, fetchMinSize);
|
||||
configs.put(KafkaConfigConstants.HEARTBEAT_INTERVAL, heartbeatInterval);
|
||||
configs.put(KafkaConfigConstants.MAX_POLL_RECORDS, maxPollRecords);
|
||||
configs.put(KafkaConfigConstants.GROUP_ID, groupId);
|
||||
Deserializer<String> keyDeserializer = new StringDeserializer();
|
||||
Deserializer<String> valueDeserializer = new StringDeserializer();
|
||||
return new KafkaConsumer<>(configs, keyDeserializer, valueDeserializer);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,74 @@
|
|||
package com.muyu.common.kafka.config;
|
||||
|
||||
import com.muyu.common.core.text.StrFormatter;
|
||||
import com.muyu.common.kafka.constant.KafkaConfigConstants;
|
||||
import org.apache.kafka.clients.producer.KafkaProducer;
|
||||
import org.apache.kafka.common.serialization.Serializer;
|
||||
import org.apache.kafka.common.serialization.StringSerializer;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import java.util.HashMap;
|
||||
|
||||
/**
|
||||
* @Author: zi run
|
||||
* @Date 2024/9/28 16:35
|
||||
* @Description Kafka生产者配置
|
||||
*/
|
||||
@Configuration
|
||||
public class KafkaProducerConfig {
|
||||
|
||||
/**
|
||||
* 服务端IP
|
||||
*/
|
||||
@Value("${kafka.producer.bootstrap-servers-ip}")
|
||||
private String bootstrapServersIP;
|
||||
|
||||
/**
|
||||
* 服务端口号
|
||||
*/
|
||||
@Value("${kafka.producer.bootstrap-servers-port}")
|
||||
private String bootstrapServersPort;
|
||||
|
||||
/**
|
||||
* 重试次数
|
||||
*/
|
||||
@Value("${kafka.producer.retries}")
|
||||
private Integer retries;
|
||||
|
||||
/**
|
||||
* 默认批量大小
|
||||
*/
|
||||
@Value("${kafka.producer.batch-size}")
|
||||
private Integer batchSize;
|
||||
|
||||
/**
|
||||
* 总内存字节数
|
||||
*/
|
||||
@Value("${kafka.producer.buffer-memory}")
|
||||
private Integer bufferMemory;
|
||||
|
||||
/**
|
||||
* 偏移量
|
||||
*/
|
||||
@Value("${kafka.producer.acks}")
|
||||
private String acks;
|
||||
|
||||
/**
|
||||
* Kafka生产者初始化配置
|
||||
* @return kafka生产者实例
|
||||
*/
|
||||
@Bean
|
||||
public KafkaProducer<String, String> kafkaProducer() {
|
||||
HashMap<String, Object> configs = new HashMap<>();
|
||||
configs.put(KafkaConfigConstants.BOOTSTRAP_SERVERS,
|
||||
StrFormatter.format("{}:{}", bootstrapServersIP, bootstrapServersPort));
|
||||
configs.put(KafkaConfigConstants.RETRIES, retries);
|
||||
configs.put(KafkaConfigConstants.BATCH_SIZE, batchSize);
|
||||
configs.put(KafkaConfigConstants.BUFFER_MEMORY, bufferMemory);
|
||||
configs.put(KafkaConfigConstants.ACKS, acks);
|
||||
Serializer<String> keySerializer = new StringSerializer();
|
||||
Serializer<String> valueSerializer = new StringSerializer();
|
||||
return new KafkaProducer<>(configs, keySerializer, valueSerializer);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,74 @@
|
|||
package com.muyu.common.kafka.constant;
|
||||
|
||||
/**
|
||||
* @Author: zi run
|
||||
* @Date 2024/9/28 20:07
|
||||
* @Description Kafka配置通用常量
|
||||
*/
|
||||
public class KafkaConfigConstants {
|
||||
|
||||
/**
|
||||
* 服务端ip+端口号
|
||||
*/
|
||||
public static final String BOOTSTRAP_SERVERS = "bootstrap.servers";
|
||||
|
||||
/**
|
||||
* 重试次数
|
||||
*/
|
||||
public static final String RETRIES = "retries";
|
||||
|
||||
/**
|
||||
* 默认批量大小
|
||||
*/
|
||||
public static final String BATCH_SIZE = "batch.size";
|
||||
|
||||
/**
|
||||
* 总内存字节数
|
||||
*/
|
||||
public static final String BUFFER_MEMORY = "buffer-memory";
|
||||
|
||||
/**
|
||||
* 偏移量
|
||||
*/
|
||||
public static final String ACKS = "acks";
|
||||
|
||||
/**
|
||||
* 开启消费者偏移量
|
||||
*/
|
||||
public static final String ENABLE_AUTO_COMMIT = "enable.auto.commit";
|
||||
|
||||
/**
|
||||
* 自动提交时间间隔
|
||||
*/
|
||||
public static final String AUTO_COMMIT_INTERVAL = "auto.commit.interval";
|
||||
|
||||
/**
|
||||
* 自动重置偏移量
|
||||
*/
|
||||
public static final String AUTO_OFFSET_RESET = "auto.offset.reset";
|
||||
|
||||
/**
|
||||
* 请求阻塞的最大时间
|
||||
*/
|
||||
public static final String FETCH_MAX_WAIT = "fetch.max.wait";
|
||||
|
||||
/**
|
||||
* 请求应答的最小字节数
|
||||
*/
|
||||
public static final String FETCH_MIN_SIZE = "fetch.min.size";
|
||||
|
||||
/**
|
||||
* 心跳间隔时间
|
||||
*/
|
||||
public static final String HEARTBEAT_INTERVAL = "heartbeat-interval";
|
||||
|
||||
/**
|
||||
* 一次调用poll返回的最大记录条数
|
||||
*/
|
||||
public static final String MAX_POLL_RECORDS = "max.poll.records";
|
||||
|
||||
/**
|
||||
* 指定消费组
|
||||
*/
|
||||
public static final String GROUP_ID = "group.id";
|
||||
}
|
|
@ -0,0 +1,2 @@
|
|||
com.muyu.common.kafka.config.KafkaProducerConfig
|
||||
com.muyu.common.kafka.config.KafkaConsumerConfig
|
|
@ -64,6 +64,11 @@ public class SysDept extends BaseEntity {
|
|||
*/
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* 企业ID
|
||||
*/
|
||||
private Long entId;
|
||||
|
||||
/**
|
||||
* 部门状态:0正常,1停用
|
||||
*/
|
||||
|
|
|
@ -11,6 +11,7 @@ import lombok.NoArgsConstructor;
|
|||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
/**
|
||||
* 企业表
|
||||
* @Author: zi run
|
||||
* @Date 2024/9/25 22:38
|
||||
* @Description 企业表
|
||||
|
@ -19,7 +20,7 @@ import lombok.experimental.SuperBuilder;
|
|||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@TableName(value = "sys_ent")
|
||||
@TableName(value = "sys_ent", autoResultMap = true)
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class SysEnt extends BaseEntity {
|
||||
|
||||
|
@ -40,9 +41,9 @@ public class SysEnt extends BaseEntity {
|
|||
private String leader;
|
||||
|
||||
/**
|
||||
* 手机号码
|
||||
* 联系电话
|
||||
*/
|
||||
private String phoneNumber;
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 邮箱
|
||||
|
@ -53,4 +54,8 @@ public class SysEnt extends BaseEntity {
|
|||
* 企业编码
|
||||
*/
|
||||
private String entCode;
|
||||
/**
|
||||
* 企业状态
|
||||
*/
|
||||
private Integer entStatus;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package com.muyu.auth.form;
|
||||
package com.muyu.common.system.domain.form;
|
||||
|
||||
/**
|
||||
* 用户登录对象
|
|
@ -0,0 +1,36 @@
|
|||
package com.muyu.common.system.domain.form;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
/**
|
||||
* 用户注册对象
|
||||
*
|
||||
* @author muyu
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class RegisterBody extends LoginBody {
|
||||
|
||||
/**
|
||||
* 企业名称
|
||||
*/
|
||||
private String entName;
|
||||
|
||||
/**
|
||||
* 负责人
|
||||
*/
|
||||
private String leader;
|
||||
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
private String email;
|
||||
}
|
|
@ -4,6 +4,7 @@ import com.muyu.common.core.constant.SecurityConstants;
|
|||
import com.muyu.common.core.constant.ServiceNameConstants;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.system.domain.SysUser;
|
||||
import com.muyu.common.system.domain.form.RegisterBody;
|
||||
import com.muyu.common.system.remote.factory.RemoteUserFallbackFactory;
|
||||
import com.muyu.common.system.domain.LoginUser;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
|
@ -38,7 +39,7 @@ public interface RemoteUserService {
|
|||
* @return 结果
|
||||
*/
|
||||
@PostMapping("/user/register")
|
||||
public Result<Boolean> registerUserInfo (@RequestBody SysUser sysUser, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
||||
public Result<Boolean> registerUserInfo (@RequestBody RegisterBody registerBody, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
||||
|
||||
/**
|
||||
* 获取企业信息
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.muyu.common.system.remote.factory;
|
||||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.system.domain.form.RegisterBody;
|
||||
import com.muyu.common.system.remote.RemoteUserService;
|
||||
import com.muyu.common.system.domain.SysUser;
|
||||
import com.muyu.common.system.domain.LoginUser;
|
||||
|
@ -30,7 +31,7 @@ public class RemoteUserFallbackFactory implements FallbackFactory<RemoteUserServ
|
|||
}
|
||||
|
||||
@Override
|
||||
public Result<Boolean> registerUserInfo (SysUser sysUser, String source) {
|
||||
public Result<Boolean> registerUserInfo (RegisterBody registerBody, String source) {
|
||||
return Result.error("注册用户失败:" + throwable.getMessage());
|
||||
}
|
||||
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
<module>cloud-common-system</module>
|
||||
<module>cloud-common-xxl</module>
|
||||
<module>cloud-common-rabbit</module>
|
||||
<module>cloud-common-kafka</module>
|
||||
</modules>
|
||||
|
||||
<artifactId>cloud-common</artifactId>
|
||||
|
|
|
@ -7,7 +7,7 @@ nacos:
|
|||
addr: 106.15.136.7:8848
|
||||
user-name: nacos
|
||||
password: nacos
|
||||
namespace: lyb
|
||||
namespace: dev
|
||||
|
||||
# Spring
|
||||
spring:
|
||||
|
|
|
@ -24,10 +24,22 @@
|
|||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-common-core</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!--swagger3maven依赖-->
|
||||
<dependency>
|
||||
<groupId>io.swagger.core.v3</groupId>
|
||||
<artifactId>swagger-annotations-jakarta</artifactId>
|
||||
</dependency>
|
||||
<!--mqttv3依赖-->
|
||||
<dependency>
|
||||
<groupId>org.eclipse.paho</groupId>
|
||||
<artifactId>org.eclipse.paho.client.mqttv3</artifactId>
|
||||
<version>1.2.2</version>
|
||||
</dependency>
|
||||
<!--mqtt依赖-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.integration</groupId>
|
||||
<artifactId>spring-integration-mqtt</artifactId>
|
||||
<version>6.2.5</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
</project>
|
||||
|
|
|
@ -3,16 +3,24 @@ package com.muyu.enterprise.domain;
|
|||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 企业表--实体类
|
||||
* @ClassName CarCompany
|
||||
* @Description 企业表
|
||||
* @author MingWei.Zong
|
||||
* @Date 2024/9/28 16:52
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
@TableName(value = "t_company")
|
||||
@TableName(value = "car_company")
|
||||
@Tag(name = "企业表")
|
||||
public class CarCompany {
|
||||
/**
|
||||
* 企业表
|
||||
|
|
|
@ -0,0 +1,48 @@
|
|||
package com.muyu.enterprise.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 车辆配置表--实体类
|
||||
* @ClassName CarConfig
|
||||
* @Description 车辆配置表
|
||||
* @author MingWei.Zong
|
||||
* @Date 2024/9/28 16:52
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
@Tag(name = "车辆配置表")
|
||||
@TableName(value = "car_config")
|
||||
public class CarConfig {
|
||||
/**
|
||||
* 车辆配置类
|
||||
*/
|
||||
@TableId(value = "config_id",type = IdType.AUTO)
|
||||
private Long configId;
|
||||
/**
|
||||
* 车辆配置 1.电动 2.纯油 3.混动
|
||||
*/
|
||||
private String configName;
|
||||
/**
|
||||
* 能源类型
|
||||
*/
|
||||
private String energyType;
|
||||
/**
|
||||
* 档的类型 1.手动 2.自动
|
||||
*/
|
||||
private Integer gearType;
|
||||
/**
|
||||
* 报文id
|
||||
*/
|
||||
private Integer companyId;
|
||||
|
||||
}
|
|
@ -5,19 +5,27 @@ import com.baomidou.mybatisplus.annotation.TableId;
|
|||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.muyu.common.core.annotation.Excel;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 车辆表--实体类
|
||||
* @ClassName CarManage
|
||||
* @Description 车辆表
|
||||
* @author MingWei.Zong
|
||||
* @Date 2024/9/28 16:52
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Tag(name = "车辆表")
|
||||
@Builder
|
||||
@TableName(value = "t_car")
|
||||
public class SysCar {
|
||||
@TableName(value = "car_manage",autoResultMap = true)
|
||||
public class CarManage {
|
||||
/**
|
||||
* 车辆表
|
||||
*/
|
||||
|
@ -30,7 +38,7 @@ public class SysCar {
|
|||
/**
|
||||
* 车牌号
|
||||
*/
|
||||
private String carCoed;
|
||||
private String carCode;
|
||||
/**
|
||||
* 车牌颜色 1.白色 2.绿色 3.黑色 4.银色 5.红色
|
||||
*/
|
||||
|
@ -40,21 +48,13 @@ public class SysCar {
|
|||
*/
|
||||
private String carVin;
|
||||
/**
|
||||
* 车主
|
||||
* 驾驶员
|
||||
*/
|
||||
private Long userId;
|
||||
private long userId;
|
||||
/**
|
||||
* 车辆配置
|
||||
*/
|
||||
private Long typeId;
|
||||
|
||||
/** 车辆品牌 */
|
||||
@Excel(name = "车辆品牌")
|
||||
private String carBrand;
|
||||
|
||||
/** 车辆型号 */
|
||||
@Excel(name = "车辆型号")
|
||||
private String carModel;
|
||||
private long configId;
|
||||
/**
|
||||
* 年审日期
|
||||
*/
|
||||
|
@ -73,7 +73,7 @@ public class SysCar {
|
|||
/**
|
||||
* 在线状态 1.无信号 2.行驶中 3.已停止
|
||||
*/
|
||||
private Integer carStatus;
|
||||
private Integer carStayus;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
|
@ -83,16 +83,32 @@ public class SysCar {
|
|||
* 当前档位
|
||||
*/
|
||||
private Integer carGears;
|
||||
|
||||
/**
|
||||
* 车辆品牌
|
||||
*/
|
||||
private String carModel;
|
||||
/**
|
||||
* 车辆型号
|
||||
*/
|
||||
private String cardDrand;
|
||||
|
||||
/** 最后一次连线时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "最后一次连线时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "最后一次连线时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date carLastJoinTime;
|
||||
|
||||
/** 最后一次离线时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "最后一次离线时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "最后一次离线时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date carLastOfflineTime;
|
||||
|
||||
/**
|
||||
* 汽车所属企业id
|
||||
*/
|
||||
private Long companyId;
|
||||
/**
|
||||
* 车辆类型 1.轿车 2.跑车 3.越野 4.客车 5.公交 6.其他
|
||||
*/
|
||||
private Integer carType;
|
||||
|
||||
}
|
|
@ -1,5 +1,7 @@
|
|||
package com.muyu.enterprise.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
|
@ -8,22 +10,24 @@ import lombok.Data;
|
|||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 报文表--实体类
|
||||
* @ClassName CarMessage
|
||||
* @Description 描述
|
||||
* @Author YiBo.Liu
|
||||
* @Date 2024/9/22 22:24
|
||||
* @Description 报文表
|
||||
* @author MingWei.Zong
|
||||
* @Date 2024/9/28 16:52
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Tag(name = "报文表")
|
||||
@TableName(value = "t_car_message")
|
||||
@TableName(value = "car_message")
|
||||
public class CarMessage {
|
||||
|
||||
/**
|
||||
* 报文表
|
||||
*/
|
||||
@TableId(value = "message_id" ,type = IdType.AUTO)
|
||||
private Long messageId;
|
||||
/**
|
||||
* 车辆报文类别
|
||||
|
|
|
@ -3,16 +3,24 @@ package com.muyu.enterprise.domain;
|
|||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 报文类型表--实体类
|
||||
* @ClassName CarMessageType
|
||||
* @Description 报文类型表
|
||||
* @author MingWei.Zong
|
||||
* @Date 2024/9/28 16:52
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
@TableName(value = "t_message_type")
|
||||
@TableName(value = "car_message_type")
|
||||
@Tag(name = "报文类型表")
|
||||
public class CarMessageType {
|
||||
/**
|
||||
* 报文
|
||||
|
|
|
@ -3,16 +3,24 @@ package com.muyu.enterprise.domain;
|
|||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 报文模版表--实体类
|
||||
* @ClassName CarTemplate
|
||||
* @Description 报文模版表
|
||||
* @author MingWei.Zong
|
||||
* @Date 2024/9/28 16:52
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
@TableName(value = "t_template")
|
||||
@TableName(value = "car_template")
|
||||
@Tag(name = "报文模版表")
|
||||
public class CarTemplate {
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package com.muyu.enterprise.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
|
@ -8,22 +10,24 @@ import lombok.Data;
|
|||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 车辆类型表--实体类
|
||||
* @ClassName CarType
|
||||
* @Description 描述
|
||||
* @Author YiBo.Liu
|
||||
* @Date 2024/9/22 16:53
|
||||
* @Description 车辆类型表
|
||||
* @author YiBo.Liu
|
||||
* @Date 2024/9/28 16:52
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Tag(name = "车辆类型表")
|
||||
@TableName(value = "t_car_type")
|
||||
@TableName(value = "car_type")
|
||||
public class CarType {
|
||||
|
||||
/**
|
||||
* 车辆类型id
|
||||
*/
|
||||
@TableId(value = "car_type_id",type = IdType.AUTO)
|
||||
private Integer carTypeId;
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,24 +1,32 @@
|
|||
package com.muyu.enterprise.domain;
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 故障日志
|
||||
* @Author: chenruijia
|
||||
* @Date 2024/9/28 12.23
|
||||
* @Description FaultLog:故障日志
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@TableName(value = "fault_log",autoResultMap = true)
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Tag(name = "故障日志")
|
||||
public class FaultLog extends BaseEntity {
|
||||
/**
|
||||
* 日志ID
|
||||
|
|
|
@ -3,8 +3,8 @@ package com.muyu.enterprise.domain;
|
|||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
@ -13,11 +13,18 @@ import org.springframework.format.annotation.DateTimeFormat;
|
|||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 站内信
|
||||
* @Author: chenruijia
|
||||
* @Date 2024/9/28 12.23
|
||||
* @Description FaultMessage:站内信
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@TableName(value = "fault_message",autoResultMap = true)
|
||||
@Tag(name = "站内信")
|
||||
public class FaultMessage {
|
||||
/**
|
||||
* 站内信ID
|
||||
|
|
|
@ -1,34 +0,0 @@
|
|||
package com.muyu.enterprise.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@TableName(value = "fault_notify",autoResultMap = true)
|
||||
public class FaultNotify {
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@TableId(value = "fault_notify_id", type= IdType.AUTO)
|
||||
@Schema(defaultValue = "ID",type = "Long",description = "ID")
|
||||
private Long faultNotifyId;
|
||||
/**
|
||||
* 通知方
|
||||
*/
|
||||
@Schema(defaultValue = "通知方",type = "String",description = "通知方")
|
||||
private String faultNotifyParty;
|
||||
/**
|
||||
* 联系方式
|
||||
*/
|
||||
@Schema(defaultValue = "联系方式",type = "String",description = "联系方式")
|
||||
private String faultNotifyManner;
|
||||
}
|
|
@ -5,17 +5,23 @@ import com.baomidou.mybatisplus.annotation.TableId;
|
|||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
/**
|
||||
* 故障等级
|
||||
* @Author: chenruijia
|
||||
* @Date 2024/9/28 12.23
|
||||
* @Description FaultSeverity:故障等级
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@TableName(value = "fault_severity",autoResultMap = true)
|
||||
@Tag(name = "故障等级")
|
||||
public class FaultSeverity extends BaseEntity {
|
||||
/**
|
||||
* 等级ID
|
||||
|
|
|
@ -3,18 +3,24 @@ package com.muyu.enterprise.domain;
|
|||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
/**
|
||||
* 故障类型
|
||||
* @Author: chenruijia
|
||||
* @Date 2024/9/28 12.23
|
||||
* @Description FaultType:故障类型
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@TableName(value = "fault_type",autoResultMap = true)
|
||||
@Tag(name = "故障类型")
|
||||
public class FaultType{
|
||||
/**
|
||||
* 故障类型ID
|
||||
|
|
|
@ -5,15 +5,22 @@ import com.baomidou.mybatisplus.annotation.TableId;
|
|||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.*;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
/**
|
||||
* 故障规则
|
||||
* @Author: chenruijia
|
||||
* @Date 2024/9/28 12.23
|
||||
* @Description FaultrRule:故障规则
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@TableName(value = "fault_rule",autoResultMap = true)
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Tag(name = "故障规则")
|
||||
public class FaultrRule extends BaseEntity {
|
||||
/**
|
||||
* 故障规则ID
|
||||
|
|
|
@ -5,15 +5,26 @@ import com.baomidou.mybatisplus.annotation.TableId;
|
|||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.*;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
/**
|
||||
* 故障表
|
||||
* @Author: chenruijia
|
||||
* @Date 2024/9/28 12.23
|
||||
* @Description SysCarFault:故障表
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@TableName(value = "sys_car_fault", autoResultMap = true)
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Tag(name = "故障表")
|
||||
public class SysCarFault extends BaseEntity {
|
||||
/**
|
||||
* 自增主键
|
||||
|
|
|
@ -7,6 +7,7 @@ import lombok.Data;
|
|||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
* @ClassName Template
|
||||
* @Description 描述
|
||||
* @Author YiBo.Liu
|
||||
|
|
|
@ -9,6 +9,7 @@ import lombok.Data;
|
|||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 测试用户实体类
|
||||
* @Author: zi run
|
||||
* @Date 2024/9/21 0:07
|
||||
* @Description 测试用户实体类
|
||||
|
|
|
@ -0,0 +1,59 @@
|
|||
package com.muyu.enterprise.domain.car;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import com.muyu.enterprise.domain.req.car.MessageTemplateAddReq;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
/**
|
||||
* 报文模版实体类
|
||||
* @Author:李庆帅
|
||||
* @Package:com.muyu.car.domain
|
||||
* @Project:cloud-server
|
||||
* @name:MessageTemplate
|
||||
* @Date:2024/9/26 20:27
|
||||
* @Description: 报文模版
|
||||
*/
|
||||
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@TableName(value = "message_template", autoResultMap = true)
|
||||
public class MessageTemplate extends BaseEntity
|
||||
{
|
||||
/**
|
||||
* 报文模版主键
|
||||
*/
|
||||
@TableId(value = "message_template_id", type = IdType.AUTO)
|
||||
private String messageTemplateId;
|
||||
|
||||
/**
|
||||
* 报文模版名称
|
||||
*/
|
||||
private String messageTemplateName;
|
||||
|
||||
/**
|
||||
* 报文模版描述
|
||||
*/
|
||||
private String messageTemplateDescribe;
|
||||
|
||||
/**
|
||||
* 报文模版添加数据转换
|
||||
* @param messageTemplateAddReq
|
||||
* @return
|
||||
*/
|
||||
public static MessageTemplate addBuild(MessageTemplateAddReq messageTemplateAddReq){
|
||||
return MessageTemplate.builder()
|
||||
.messageTemplateName(messageTemplateAddReq.getMessageTemplateName())
|
||||
.messageTemplateDescribe(messageTemplateAddReq.getMessageTemplateDescribe())
|
||||
.build();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,83 @@
|
|||
package com.muyu.enterprise.domain.car;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import com.muyu.enterprise.domain.req.car.MessageValueAddReq;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
/**
|
||||
* @Author:李庆帅
|
||||
* @Package:com.muyu.car.domain
|
||||
* @Project:cloud-server
|
||||
* @name:MessageValue
|
||||
* @Date:2024/9/26 20:29
|
||||
*
|
||||
* 报文类型对象 message_type
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* 报文类型实体类
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@TableName(value = "message_value", autoResultMap = true)
|
||||
public class MessageValue extends BaseEntity
|
||||
{
|
||||
/**
|
||||
* 报文数据主键
|
||||
*/
|
||||
@TableId(value = "message_id", type = IdType.AUTO)
|
||||
private Long messageId;
|
||||
|
||||
/**
|
||||
* 模版主键
|
||||
*/
|
||||
private Long templateId;
|
||||
|
||||
/**
|
||||
* 报文类别
|
||||
*/
|
||||
private String messageType;
|
||||
|
||||
/**
|
||||
* 报文编码
|
||||
*/
|
||||
private String messageCode;
|
||||
|
||||
/**
|
||||
* 报文标签
|
||||
*/
|
||||
private String messageLabel;
|
||||
|
||||
/**
|
||||
* 起始下标
|
||||
*/
|
||||
private Integer messageStartIndex;
|
||||
|
||||
/**
|
||||
* 终止下标
|
||||
*/
|
||||
private Integer messageEndIndex;
|
||||
|
||||
public static MessageValue addBuild(MessageValueAddReq messageValueAddReq){
|
||||
return MessageValue.builder()
|
||||
.templateId(messageValueAddReq.getTemplateId())
|
||||
.messageType(messageValueAddReq.getMessageType())
|
||||
.messageCode(messageValueAddReq.getMessageCode())
|
||||
.messageLabel(messageValueAddReq.getMessageLabel())
|
||||
.messageStartIndex(messageValueAddReq.getMessageStartIndex())
|
||||
.messageEndIndex(messageValueAddReq.getMessageEndIndex())
|
||||
.build();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,145 @@
|
|||
package com.muyu.enterprise.domain.car;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.muyu.common.core.annotation.Excel;
|
||||
import com.muyu.common.core.annotation.Excel.ColumnType;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import com.muyu.enterprise.domain.req.car.VehicleAddReq;
|
||||
import com.muyu.enterprise.domain.req.car.VehicleUpdReq;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
|
||||
/**
|
||||
* 车辆信息实体类
|
||||
* @Author:李庆帅
|
||||
* @Package:com.muyu.car.domain
|
||||
* @Project:cloud-server
|
||||
* @name:Vehicle
|
||||
* @Date:2024/9/26 20:30
|
||||
* @Description: 车辆信息实体类
|
||||
*/
|
||||
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName(value = "vehicle", autoResultMap = true)
|
||||
public class Vehicle extends BaseEntity
|
||||
{
|
||||
/**
|
||||
* 车辆主键
|
||||
*/
|
||||
@Excel(name = "车辆主键", cellType = ColumnType.NUMERIC)
|
||||
@TableId(value = "vehicle_id", type = IdType.AUTO)
|
||||
private Long vehicleId;
|
||||
|
||||
/**
|
||||
* 车牌号
|
||||
*/
|
||||
@Excel(name = "车牌号")
|
||||
private String licenceNumber;
|
||||
|
||||
/**
|
||||
* 车辆颜色
|
||||
*/
|
||||
@Excel(name = "车辆颜色")
|
||||
private String vehicleColor;
|
||||
|
||||
/**
|
||||
* 车辆VIN
|
||||
*/
|
||||
@Excel(name = "车辆VIN")
|
||||
private String vehicleVin;
|
||||
|
||||
/**
|
||||
* 车辆类型外键
|
||||
*/
|
||||
@Excel(name = "车辆类型外键")
|
||||
private Long vehicleTypeId;
|
||||
|
||||
/**
|
||||
* 车辆品牌
|
||||
*/
|
||||
@Excel(name = "车辆品牌")
|
||||
private String vehicleBrand;
|
||||
|
||||
/**
|
||||
* 车辆型号
|
||||
*/
|
||||
@Excel(name = "车辆型号")
|
||||
private String vehicleModel;
|
||||
|
||||
/**
|
||||
* 车辆行驶证
|
||||
*/
|
||||
@Excel(name = "车辆行驶证")
|
||||
private String vehicleLicense;
|
||||
|
||||
/**
|
||||
* 行驶证到期日期
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date vehicleLicenseDueDate;
|
||||
|
||||
/**
|
||||
* 车辆状态
|
||||
*/
|
||||
@Excel(name = "车辆状态")
|
||||
private String vehicleStatus;
|
||||
|
||||
/**
|
||||
* 车辆所属企业外键
|
||||
*/
|
||||
private Long companyId;
|
||||
|
||||
/**
|
||||
* 电子围栏外键
|
||||
*/
|
||||
private Integer fenceGroupId;
|
||||
|
||||
public static Vehicle addBuild(VehicleAddReq vehicleAddReq){
|
||||
return Vehicle.builder()
|
||||
.licenceNumber(vehicleAddReq.getLicenceNumber())
|
||||
.vehicleColor(vehicleAddReq.getVehicleColor())
|
||||
.vehicleVin(vehicleAddReq.getVehicleVin())
|
||||
.vehicleTypeId(vehicleAddReq.getVehicleTypeId())
|
||||
.vehicleBrand(vehicleAddReq.getVehicleBrand())
|
||||
.vehicleModel(vehicleAddReq.getVehicleModel())
|
||||
.vehicleLicense(vehicleAddReq.getVehicleLicense())
|
||||
.vehicleLicenseDueDate(vehicleAddReq.getVehicleLicenseDueDate())
|
||||
.vehicleStatus(vehicleAddReq.getVehicleStatus())
|
||||
.companyId(vehicleAddReq.getCompanyId())
|
||||
.fenceGroupId(vehicleAddReq.getFenceGroupId())
|
||||
.build();
|
||||
}
|
||||
|
||||
public static Vehicle updBuild(VehicleUpdReq vehicleUpdReq, Supplier<Long> idSupplier){
|
||||
return Vehicle.builder()
|
||||
.vehicleId(idSupplier.get())
|
||||
.licenceNumber(vehicleUpdReq.getLicenceNumber())
|
||||
.vehicleColor(vehicleUpdReq.getVehicleColor())
|
||||
.vehicleVin(vehicleUpdReq.getVehicleVin())
|
||||
.vehicleTypeId(vehicleUpdReq.getVehicleTypeId())
|
||||
.vehicleBrand(vehicleUpdReq.getVehicleBrand())
|
||||
.vehicleModel(vehicleUpdReq.getVehicleModel())
|
||||
.vehicleLicense(vehicleUpdReq.getVehicleLicense())
|
||||
.vehicleLicenseDueDate(vehicleUpdReq.getVehicleLicenseDueDate())
|
||||
.vehicleStatus(vehicleUpdReq.getVehicleStatus())
|
||||
.companyId(vehicleUpdReq.getCompanyId())
|
||||
.fenceGroupId(vehicleUpdReq.getFenceGroupId())
|
||||
.build();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,50 @@
|
|||
package com.muyu.enterprise.domain.car;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.muyu.common.core.annotation.Excel;
|
||||
import com.muyu.common.core.annotation.Excel.ColumnType;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import lombok.*;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
/**
|
||||
* 车辆类型实体类
|
||||
* @Author:李庆帅
|
||||
* @Package:com.muyu.car.domain
|
||||
* @Project:cloud-server
|
||||
* @name:VehicleType
|
||||
* @Date:2024/9/26 20:31
|
||||
* @Description: 车辆类型实体类
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@TableName(value = "vehicle_type", autoResultMap = true)
|
||||
public class VehicleType
|
||||
{
|
||||
/**
|
||||
* 车辆类型主键
|
||||
*/
|
||||
|
||||
@TableId(value = "vehicle_type_id", type = IdType.AUTO)
|
||||
private Long vehicleTypeId;
|
||||
|
||||
/**
|
||||
* 车辆类型名称
|
||||
*/
|
||||
private String vehicleTypeName;
|
||||
|
||||
/**
|
||||
* 报文模版外键
|
||||
*/
|
||||
private Long messageTemplateId;
|
||||
|
||||
}
|
|
@ -0,0 +1,127 @@
|
|||
package com.muyu.enterprise.domain.dateBase;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import com.muyu.enterprise.domain.req.ElectroicFenceAddReq;
|
||||
import com.muyu.enterprise.domain.req.ElectroicFenceUpdReq;
|
||||
import com.muyu.enterprise.domain.resp.ElectronicFenceResp;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
|
||||
/**
|
||||
* @Author:李庆帅
|
||||
* @Package:com.muyu.fence.domain
|
||||
* @Project:cloud-server
|
||||
* @name:ElectronicFence
|
||||
* @Date:2024/9/17 16:34
|
||||
*/
|
||||
|
||||
/**
|
||||
* 电子围栏实体类
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@SuperBuilder
|
||||
@TableName(value = "electronic_fence",autoResultMap = true)
|
||||
public class ElectronicFence extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@TableId(value = "id",type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 围栏名称
|
||||
*/
|
||||
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 围栏类型
|
||||
*/
|
||||
|
||||
private String fenceType;
|
||||
|
||||
/**
|
||||
*经纬度信息
|
||||
*/
|
||||
|
||||
private String longitudeLatitude;
|
||||
|
||||
/**
|
||||
* 电子围栏状态(正常,停用)
|
||||
*/
|
||||
|
||||
private String status;
|
||||
|
||||
// /**
|
||||
// * 电子围栏的开始时间
|
||||
// */
|
||||
//
|
||||
// private Date startTime;
|
||||
// /**
|
||||
// * 电子围栏的结束时间
|
||||
// */
|
||||
// private Date endTime;
|
||||
|
||||
/**
|
||||
* 描述信息
|
||||
*/
|
||||
|
||||
private String fenceDesc;
|
||||
|
||||
public static ElectronicFenceResp bullerResp(ElectronicFence electronicFence){
|
||||
|
||||
return ElectronicFenceResp.builder()
|
||||
.id(electronicFence.getId())
|
||||
.name(electronicFence.getName())
|
||||
.status(electronicFence.getStatus())
|
||||
.fenceType(electronicFence.getFenceType())
|
||||
.longitudeLatitude(electronicFence.getLongitudeLatitude())
|
||||
.desc(electronicFence.getFenceDesc())
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
public static ElectronicFence buildElectroicAdd(ElectroicFenceAddReq electroicFenceAddReq){
|
||||
|
||||
return ElectronicFence.builder()
|
||||
.name(electroicFenceAddReq.getName())
|
||||
.fenceDesc(electroicFenceAddReq.getFenceDesc())
|
||||
.status(electroicFenceAddReq.getStatus())
|
||||
.longitudeLatitude(electroicFenceAddReq.getLongitudeLatitude())
|
||||
.fenceType(electroicFenceAddReq.getFenceType())
|
||||
.build();
|
||||
|
||||
|
||||
}
|
||||
|
||||
public static ElectronicFence buildByElectronicUpd(ElectroicFenceUpdReq electroicFenceUpdReq, Supplier<Long> longSupplier){
|
||||
|
||||
return ElectronicFence.builder()
|
||||
.id(longSupplier.get())
|
||||
.name(electroicFenceUpdReq.getName())
|
||||
.status(electroicFenceUpdReq.getStatus())
|
||||
.fenceDesc(electroicFenceUpdReq.getFenceDesc())
|
||||
.longitudeLatitude(electroicFenceUpdReq.getLongitudeLatitude())
|
||||
.build();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,118 @@
|
|||
package com.muyu.enterprise.domain.dateBase;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import com.muyu.enterprise.domain.req.ElectronicFenceGroupAddReq;
|
||||
import com.muyu.enterprise.domain.req.ElectronicFenceGroupUpdReq;
|
||||
import com.muyu.enterprise.domain.resp.ElectronicFenceGroupResp;
|
||||
import com.muyu.enterprise.domain.resp.GroupFenceListresp;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
|
||||
/**
|
||||
* @Author:李庆帅
|
||||
* @Package:com.muyu.fence.domain
|
||||
* @Project:cloud-server
|
||||
* @name:ElectronicFenceGroup
|
||||
* @Date:2024/9/18 11:14
|
||||
*/
|
||||
|
||||
/**
|
||||
* 围栏组实体类
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@SuperBuilder
|
||||
@TableName(value = "electronic_fence_group",autoResultMap = true)
|
||||
public class ElectronicFenceGroup extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "id",type = IdType.AUTO)
|
||||
private Long id;
|
||||
/**
|
||||
* 围栏组优先级
|
||||
*/
|
||||
private Integer priority;
|
||||
/**
|
||||
* 围栏组名称
|
||||
*/
|
||||
private String groupName;
|
||||
/**
|
||||
* 围栏组类型
|
||||
*/
|
||||
private String groupType;
|
||||
|
||||
/**
|
||||
* 启用状态
|
||||
*/
|
||||
private String status;
|
||||
|
||||
|
||||
public static GroupFenceListresp buildGroupFence(ElectronicFenceGroup electronicFenceGroup){
|
||||
|
||||
return GroupFenceListresp.builder()
|
||||
.id(electronicFenceGroup.getId())
|
||||
.groupName(electronicFenceGroup.groupName)
|
||||
.priority(electronicFenceGroup.getPriority())
|
||||
.status(electronicFenceGroup.getStatus())
|
||||
.groupType(electronicFenceGroup.groupType)
|
||||
.build();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public static ElectronicFenceGroupResp buildElectronicFenceGroupResp (ElectronicFenceGroup electronicFenceGroup){
|
||||
|
||||
return ElectronicFenceGroupResp.builder()
|
||||
.id(electronicFenceGroup.getId())
|
||||
.groupName(electronicFenceGroup.groupName)
|
||||
.priority(electronicFenceGroup.getPriority())
|
||||
.status(electronicFenceGroup.getStatus())
|
||||
.groupType(electronicFenceGroup.groupType)
|
||||
.build();
|
||||
|
||||
}
|
||||
|
||||
public static ElectronicFenceGroup buildByAdd(ElectronicFenceGroupAddReq addReq){
|
||||
|
||||
|
||||
return ElectronicFenceGroup.builder()
|
||||
.groupName(addReq.getGroupName())
|
||||
.groupType(addReq.getGroupType())
|
||||
.status(addReq.getStatus())
|
||||
.priority(addReq.getPriority())
|
||||
.build();
|
||||
|
||||
}
|
||||
|
||||
public static ElectronicFenceGroup buildByUpd(ElectronicFenceGroupUpdReq updReq, Supplier<Long> ids){
|
||||
|
||||
|
||||
return ElectronicFenceGroup.builder()
|
||||
.id(ids.get())
|
||||
.groupName(updReq.getGroupName())
|
||||
.groupType(updReq.getGroupType())
|
||||
.status(updReq.getStatus())
|
||||
.priority(updReq.getPriority())
|
||||
.build();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
package com.muyu.enterprise.domain.dateBase;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @Author:李庆帅
|
||||
* @Package:com.muyu.fence.domain
|
||||
* @Project:cloud-server
|
||||
* @name:FenceGroupMid
|
||||
* @Date:2024/9/19 21:01
|
||||
*/
|
||||
|
||||
/**
|
||||
* 链表实体类
|
||||
*/
|
||||
@Tag(name = "围栏组连接表")
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@TableName(value = "fence_group_mid",autoResultMap = true)
|
||||
public class FenceGroupMid {
|
||||
|
||||
/**
|
||||
* 中间表的自增
|
||||
*/
|
||||
@TableId(value = "id",type = IdType.AUTO)
|
||||
private Long id;
|
||||
private Long groupId;
|
||||
private Long fenceId;
|
||||
}
|
|
@ -0,0 +1,78 @@
|
|||
package com.muyu.enterprise.domain.req;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Author:李庆帅
|
||||
* @Package:com.muyu.fence.domain.req
|
||||
* @Project:cloud-server
|
||||
* @name:ElectroicAdd
|
||||
* @Date:2024/9/17 20:53
|
||||
*/
|
||||
|
||||
/**
|
||||
* 电子围栏添加请求对象
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class ElectroicFenceAddReq {
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@TableId(value = "id",type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 围栏名称
|
||||
*/
|
||||
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 围栏类型(驶入,驶出)
|
||||
*/
|
||||
|
||||
private String fenceType;
|
||||
|
||||
/**
|
||||
*经纬度信息
|
||||
*/
|
||||
|
||||
private String longitudeLatitude;
|
||||
|
||||
/**
|
||||
* 电子围栏状态(正常,停用)
|
||||
*/
|
||||
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 描述信息
|
||||
*/
|
||||
|
||||
private String fenceDesc;
|
||||
|
||||
/**
|
||||
* 电子围栏的开始时间
|
||||
*/
|
||||
|
||||
private Date startTime;
|
||||
/**
|
||||
* 电子围栏的结束时间
|
||||
*/
|
||||
private Date endTime;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,68 @@
|
|||
package com.muyu.enterprise.domain.req;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Author:李庆帅
|
||||
* @Package:com.muyu.fence.domain.req
|
||||
* @Project:cloud-server
|
||||
* @name:ElectroicFenceReq
|
||||
* @Date:2024/9/17 20:04
|
||||
*/
|
||||
/**
|
||||
* 电子围栏列表请求对象
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class ElectroicFenceListReq {
|
||||
|
||||
/**
|
||||
* 围栏名称
|
||||
*/
|
||||
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 围栏类型(驶入,驶出)
|
||||
*/
|
||||
|
||||
private String fenceType;
|
||||
|
||||
/**
|
||||
*经纬度信息
|
||||
*/
|
||||
|
||||
private String longitudeLatitude;
|
||||
|
||||
/**
|
||||
* 电子围栏状态(正常,停用)
|
||||
*/
|
||||
|
||||
private String status;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 电子围栏的开始时间
|
||||
*/
|
||||
|
||||
private Date startTime;
|
||||
/**
|
||||
* 电子围栏的结束时间
|
||||
*/
|
||||
private Date endTime;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,73 @@
|
|||
package com.muyu.enterprise.domain.req;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @Author:李庆帅
|
||||
* @Package:com.muyu.fence.domain.req
|
||||
* @Project:cloud-server
|
||||
* @name:ElectroicFenceUpdReq
|
||||
* @Date:2024/9/17 21:03
|
||||
*/
|
||||
/**
|
||||
* 电子围栏修改请求对象
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class ElectroicFenceUpdReq {
|
||||
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 围栏名称
|
||||
*/
|
||||
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 围栏类型(驶入,驶出)
|
||||
*/
|
||||
|
||||
private String fenceType;
|
||||
|
||||
/**
|
||||
*经纬度信息
|
||||
*/
|
||||
|
||||
private String longitudeLatitude;
|
||||
|
||||
/**
|
||||
* 电子围栏状态(正常,停用)
|
||||
*/
|
||||
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 描述信息
|
||||
*/
|
||||
|
||||
private String fenceDesc;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,64 @@
|
|||
package com.muyu.enterprise.domain.req;
|
||||
|
||||
import com.muyu.enterprise.domain.resp.ElectronicFenceResp;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:李庆帅
|
||||
* @Package:com.muyu.fence.domain.req
|
||||
* @Project:cloud-server
|
||||
* @name:ElectronicFenceGroupAddReq
|
||||
* @Date:2024/9/20 19:14
|
||||
*/
|
||||
|
||||
/**
|
||||
* 围栏组添加请求对象
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class ElectronicFenceGroupAddReq {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 围栏组优先级
|
||||
*/
|
||||
private Integer priority;
|
||||
/**
|
||||
* 围栏组名称
|
||||
*/
|
||||
private String groupName;
|
||||
/**
|
||||
* 围栏组类型
|
||||
*/
|
||||
private String groupType;
|
||||
|
||||
/**
|
||||
* 启用状态
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 选中围栏
|
||||
*/
|
||||
|
||||
List<ElectronicFenceResp> electronicFenceRespList;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,59 @@
|
|||
package com.muyu.enterprise.domain.req;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @Author:李庆帅
|
||||
* @Package:com.muyu.fence.domain.req
|
||||
* @Project:cloud-server
|
||||
* @name:ElectronicFenceGroupListReq
|
||||
* @Date:2024/9/20 16:06
|
||||
*/
|
||||
/**
|
||||
* 围栏组列表请求对象
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class ElectronicFenceGroupListReq {
|
||||
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "id",type = IdType.AUTO)
|
||||
private Long id;
|
||||
/**
|
||||
* 围栏组优先级
|
||||
*/
|
||||
private Integer priority;
|
||||
/**
|
||||
* 围栏组名称
|
||||
*/
|
||||
private String groupName;
|
||||
/**
|
||||
* 围栏组类型
|
||||
*/
|
||||
private String groupType;
|
||||
|
||||
/**
|
||||
* 启用状态
|
||||
*/
|
||||
private String status;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,69 @@
|
|||
package com.muyu.enterprise.domain.req;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.muyu.enterprise.domain.resp.ElectronicFenceResp;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:李庆帅
|
||||
* @Package:com.muyu.fence.domain.req
|
||||
* @Project:cloud-server
|
||||
* @name:ElectronicFenceGroupAddReq
|
||||
* @Date:2024/9/20 19:14
|
||||
*/
|
||||
/**
|
||||
* 围栏组修改请求对象
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class ElectronicFenceGroupUpdReq {
|
||||
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "id",type = IdType.AUTO)
|
||||
private Long id;
|
||||
/**
|
||||
* 围栏组优先级
|
||||
*/
|
||||
private Integer priority;
|
||||
/**
|
||||
* 围栏组名称
|
||||
*/
|
||||
private String groupName;
|
||||
/**
|
||||
* 围栏组类型
|
||||
*/
|
||||
private String groupType;
|
||||
|
||||
/**
|
||||
* 启用状态
|
||||
*/
|
||||
private String status;
|
||||
|
||||
|
||||
/**
|
||||
* 选中围栏
|
||||
*/
|
||||
List<ElectronicFenceResp> electronicFenceRespList;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
package com.muyu.enterprise.domain.req;
|
||||
|
||||
import com.muyu.enterprise.domain.resp.ElectronicFenceResp;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:李庆帅
|
||||
* @Package:com.muyu.fence.domain.req
|
||||
* @Project:cloud-server
|
||||
* @name:FenceAndGroupBoundReq
|
||||
* @Date:2024/9/21 9:05
|
||||
*/
|
||||
|
||||
/**
|
||||
* 链表请求对象
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Tag(name = "用于绑定围栏和围栏组的请求")
|
||||
public class FenceAndGroupBoundReq {
|
||||
/**
|
||||
* 围栏组的主键
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 选中的围栏
|
||||
*/
|
||||
|
||||
private List<ElectronicFenceResp> electronicFenceRespList;
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
package com.muyu.enterprise.domain.req;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @Author:李庆帅
|
||||
* @Package:com.muyu.fence.domain
|
||||
* @Project:cloud-server
|
||||
* @name:FenceWay
|
||||
* @Date:2024/9/20 9:27
|
||||
*/
|
||||
|
||||
/**
|
||||
* 电子围栏位置请求对象
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class FenceWayReq {
|
||||
private Long id;
|
||||
private String longitudeLatitude;
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
package com.muyu.enterprise.domain.req.car;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 报文模版添加参数请求对象
|
||||
* @Author:李庆帅
|
||||
* @Package:com.muyu.car.domain.req
|
||||
* @Project:cloud-server
|
||||
* @name:MessageTemplateAddReq
|
||||
* @Date:2024/9/26 20:34
|
||||
* @Description: 报文模版添加参数
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Tag(name = "新增报文模版请求参数", description = "根据入参进行报文模版的添加")
|
||||
public class MessageTemplateAddReq
|
||||
{
|
||||
/**
|
||||
* 报文模版名称
|
||||
*/
|
||||
private String messageTemplateName;
|
||||
|
||||
/**
|
||||
* 报文模版描述
|
||||
*/
|
||||
private String messageTemplateDescribe;
|
||||
|
||||
}
|
|
@ -0,0 +1,55 @@
|
|||
package com.muyu.enterprise.domain.req.car;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 报文类型参数添加请求对象
|
||||
* @Author:李庆帅
|
||||
* @Package:com.muyu.car.domain.req
|
||||
* @Project:cloud-server
|
||||
* @name:MessageValueAddReq
|
||||
* @Date:2024/9/26 20:35
|
||||
* @Description: 报文类型参数
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Tag(name = "新增报文数据请求参数", description = "根据入参进行报文数据的添加")
|
||||
public class MessageValueAddReq
|
||||
{
|
||||
/**
|
||||
* 模版主键
|
||||
*/
|
||||
private Long templateId;
|
||||
|
||||
/**
|
||||
* 报文类别
|
||||
*/
|
||||
private String messageType;
|
||||
|
||||
/**
|
||||
* 报文编码
|
||||
*/
|
||||
private String messageCode;
|
||||
|
||||
/**
|
||||
* 报文标签
|
||||
*/
|
||||
private String messageLabel;
|
||||
|
||||
/**
|
||||
* 起始下标
|
||||
*/
|
||||
private Integer messageStartIndex;
|
||||
|
||||
/**
|
||||
* 终止下标
|
||||
*/
|
||||
private Integer messageEndIndex;
|
||||
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
package com.muyu.enterprise.domain.req.car;
|
||||
|
||||
|
||||
import com.muyu.common.core.annotation.Excel;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
|
||||
/**
|
||||
* 报文类型列表参数请求对象
|
||||
* @Author:李庆帅
|
||||
* @Package:com.muyu.car.domain.req
|
||||
* @Project:cloud-server
|
||||
* @name:MessageValueReq
|
||||
* @Date:2024/9/26 20:39
|
||||
* @Description: 报文类型列表参数
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Tag(name = "报文数据请求参数", description = "根据入参进行报文数据的查询")
|
||||
public class MessageValueReq
|
||||
{
|
||||
/** 报文模版主键 */
|
||||
@Schema(title = "报文模版主键", type = "Long", defaultValue = "1", description = "报文模版主键")
|
||||
private Long messageTemplateId;
|
||||
|
||||
/** 报文分类 */
|
||||
@Schema(title = "报文分类", type = "String", defaultValue = "basics", description = "报文分类")
|
||||
private String messageType;
|
||||
|
||||
}
|
|
@ -0,0 +1,101 @@
|
|||
package com.muyu.enterprise.domain.req.car;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.muyu.common.core.annotation.Excel;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 新增车辆参数请求对象
|
||||
* @Author:李庆帅
|
||||
* @Package:com.muyu.car.domain.req
|
||||
* @Project:cloud-server
|
||||
* @name:VehicleAddReq
|
||||
* @Date:2024/9/26 20:39
|
||||
* @Description: 新增车辆参数
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Tag(name = "录入车辆请求参数", description = "根据入参进行车辆管理的添加")
|
||||
public class VehicleAddReq
|
||||
{
|
||||
/**
|
||||
* 车牌号
|
||||
*/
|
||||
@NotEmpty(message = "车牌号不可为空")
|
||||
@Schema(title = "车牌号", type = "String", defaultValue = "冀A93827", description = "车牌号")
|
||||
private String licenceNumber;
|
||||
|
||||
/**
|
||||
* 车辆颜色
|
||||
*/
|
||||
@Schema(title = "车辆颜色", type = "String", defaultValue = "RED", description = "车牌颜色")
|
||||
private String vehicleColor;
|
||||
|
||||
/**
|
||||
* 车辆VIN
|
||||
*/
|
||||
@Schema(title = "车辆VIN", type = "String", defaultValue = "LDC913L2240606423", description = "车辆VIN")
|
||||
private String vehicleVin;
|
||||
|
||||
/**
|
||||
* 车辆类型外键
|
||||
*/
|
||||
@Schema(title = "车辆类型", type = "BigInt", defaultValue = "1", description = "车辆类型")
|
||||
private Long vehicleTypeId;
|
||||
|
||||
/**
|
||||
* 车辆品牌
|
||||
*/
|
||||
@Schema(title = "车辆品牌", type = "String", defaultValue = "1", description = "车辆品牌")
|
||||
private String vehicleBrand;
|
||||
|
||||
/**
|
||||
* 车辆型号
|
||||
*/
|
||||
@Schema(title = "车辆型号", type = "String", defaultValue = "1", description = "车辆型号")
|
||||
private String vehicleModel;
|
||||
|
||||
/**
|
||||
* 车辆行驶证
|
||||
*/
|
||||
@Schema(title = "车辆行驶证", type = "String", defaultValue = "111111", description = "车辆行驶证")
|
||||
private String vehicleLicense;
|
||||
|
||||
/**
|
||||
* 行驶证到期日期
|
||||
*/
|
||||
@Schema(title = "行驶证到期日期", type = "Date", defaultValue = "2024-01-01 00:00:00", description = "行驶证到期日期")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date vehicleLicenseDueDate;
|
||||
|
||||
/**
|
||||
* 车辆状态
|
||||
*/
|
||||
@Schema(title = "车辆状态", type = "String", defaultValue = "OFFLINE", description = "车辆状态")
|
||||
private String vehicleStatus;
|
||||
|
||||
/**
|
||||
* 车辆所属企业外键
|
||||
*/
|
||||
@Schema(title = "车辆所属企业外键", type = "BigInt", defaultValue = "1", description = "车辆所属企业外键")
|
||||
private Long companyId;
|
||||
|
||||
/**
|
||||
* 电子围栏外键
|
||||
*/
|
||||
@Schema(title = "电子围栏外键", type = "Integer", defaultValue = "1", description = "电子围栏外键")
|
||||
private Integer fenceGroupId;
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
package com.muyu.enterprise.domain.req.car;
|
||||
|
||||
//import com.muyu.common.core.domain.req.PageReq;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 车辆管理查询条件请求对象
|
||||
* @Author:李庆帅
|
||||
* @Package:com.muyu.car.domain.req
|
||||
* @Project:cloud-server
|
||||
* @name:VehicleManageReq
|
||||
* @Date:2024/9/26 20:41
|
||||
* @Description: 车辆管理查询条件实体类
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Tag(name = "车辆管理查询条件", description = "负责车辆查询条件的实体类")
|
||||
public class VehicleManageReq
|
||||
{
|
||||
/**
|
||||
* 车牌号
|
||||
*/
|
||||
@Schema(type = "String", defaultValue = "冀A93827", description = "车牌号")
|
||||
private String licenceNumber;
|
||||
|
||||
/**
|
||||
* 车辆VIN
|
||||
*/
|
||||
@Schema(type = "String", defaultValue = "LDC913L2240606423", description = "车辆VIN")
|
||||
private String vehicleVin;
|
||||
|
||||
/**
|
||||
* 车辆状态
|
||||
*/
|
||||
@Schema(type = "String", defaultValue = "", description = "车辆状态")
|
||||
private String vehicleStatus;
|
||||
|
||||
}
|
|
@ -0,0 +1,100 @@
|
|||
package com.muyu.enterprise.domain.req.car;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.muyu.common.core.annotation.Excel;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 修改车辆信息参数请求对象
|
||||
* @Author:李庆帅
|
||||
* @Package:com.muyu.car.domain.req
|
||||
* @Project:cloud-server
|
||||
* @name:VehicleUpdReq
|
||||
* @Date:2024/9/26 20:57
|
||||
* @Description: 修改车辆信息参数
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Tag(name = "修改车辆信息参数", description = "根据入参信息修改车辆信息")
|
||||
public class VehicleUpdReq
|
||||
{
|
||||
/**
|
||||
* 车牌号
|
||||
*/
|
||||
@NotEmpty(message = "车牌号不可为空")
|
||||
@Schema(title = "车牌号", type = "String", defaultValue = "冀A93827", description = "车牌号")
|
||||
private String licenceNumber;
|
||||
|
||||
/**
|
||||
* 车辆颜色
|
||||
*/
|
||||
@Schema(title = "车牌颜色", type = "String", defaultValue = "RED", description = "车牌颜色")
|
||||
private String vehicleColor;
|
||||
|
||||
/**
|
||||
* 车辆VIN
|
||||
*/
|
||||
@Schema(title = "车辆VIN", type = "String", defaultValue = "LDC913L2240606423", description = "车辆VIN")
|
||||
private String vehicleVin;
|
||||
|
||||
/**
|
||||
* 车辆类型外键
|
||||
*/
|
||||
@Schema(title = "车辆类型", type = "BigInt", defaultValue = "1", description = "车辆类型")
|
||||
private Long vehicleTypeId;
|
||||
|
||||
/**
|
||||
* 车辆品牌
|
||||
*/
|
||||
@Schema(title = "车辆品牌", type = "String", defaultValue = "1", description = "车辆品牌")
|
||||
private String vehicleBrand;
|
||||
|
||||
/**
|
||||
* 车辆型号
|
||||
*/
|
||||
@Schema(title = "车辆型号", type = "String", defaultValue = "1", description = "车辆型号")
|
||||
private String vehicleModel;
|
||||
|
||||
/**
|
||||
* 车辆行驶证
|
||||
*/
|
||||
@Schema(title = "车辆行驶证", type = "String", defaultValue = "111111", description = "车辆行驶证")
|
||||
private String vehicleLicense;
|
||||
|
||||
/**
|
||||
* 行驶证到期日期
|
||||
*/
|
||||
@Schema(title = "行驶证到期日期", type = "Date", defaultValue = "2024-01-01 00:00:00", description = "行驶证到期日期")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date vehicleLicenseDueDate;
|
||||
|
||||
/**
|
||||
* 车辆状态
|
||||
*/
|
||||
@Schema(title = "车辆状态", type = "String", defaultValue = "OFFLINE", description = "车辆状态")
|
||||
private String vehicleStatus;
|
||||
|
||||
/**
|
||||
* 车辆所属企业外键
|
||||
*/
|
||||
@Schema(title = "车辆所属企业外键", type = "BigInt", defaultValue = "1", description = "车辆所属企业外键")
|
||||
private Long companyId;
|
||||
|
||||
/**
|
||||
* 电子围栏外键
|
||||
*/
|
||||
@Schema(title = "电子围栏外键", type = "Integer", defaultValue = "1", description = "电子围栏外键")
|
||||
private Integer fenceGroupId;
|
||||
|
||||
}
|
|
@ -0,0 +1,64 @@
|
|||
package com.muyu.enterprise.domain.resp;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:李庆帅
|
||||
* @Package:com.muyu.fence.domain.resp
|
||||
* @Project:cloud-server
|
||||
* @name:ElectronicFenceGroupResp
|
||||
* @Date:2024/9/22 10:22
|
||||
*/
|
||||
|
||||
/**
|
||||
* 回显围栏组及绑定的电子围栏响应对象
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Tag(name = "回显围栏组及绑定的电子围栏")
|
||||
public class ElectronicFenceGroupResp {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "id",type = IdType.AUTO)
|
||||
private Long id;
|
||||
/**
|
||||
* 围栏组优先级
|
||||
*/
|
||||
private Integer priority;
|
||||
/**
|
||||
* 围栏组名称
|
||||
*/
|
||||
private String groupName;
|
||||
/**
|
||||
* 围栏组类型
|
||||
*/
|
||||
private String groupType;
|
||||
|
||||
/**
|
||||
* 启用状态
|
||||
*/
|
||||
private String status;
|
||||
|
||||
|
||||
/**
|
||||
* 绑定的电子围栏
|
||||
*/
|
||||
List<ElectronicFenceResp> electronicFenceRespList;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,71 @@
|
|||
package com.muyu.enterprise.domain.resp;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @Author:李庆帅
|
||||
* @Package:com.muyu.fence.domain
|
||||
* @Project:cloud-server
|
||||
* @name:ElectronicFence
|
||||
* @Date:2024/9/17 16:34
|
||||
*/
|
||||
|
||||
/**
|
||||
* 电子围栏列表响应对象
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class ElectronicFenceResp {
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 围栏名称
|
||||
*/
|
||||
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 围栏类型(驶入,驶出)
|
||||
*/
|
||||
|
||||
private String fenceType;
|
||||
|
||||
/**
|
||||
*经纬度信息
|
||||
*/
|
||||
|
||||
private String longitudeLatitude;
|
||||
|
||||
/**
|
||||
* 电子围栏状态(正常,停用)
|
||||
*/
|
||||
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 描述信息
|
||||
*/
|
||||
|
||||
private String desc;
|
||||
|
||||
//private String groupType;
|
||||
//
|
||||
//private int priority;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,57 @@
|
|||
package com.muyu.enterprise.domain.resp;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @Author:李庆帅
|
||||
* @Package:com.muyu.fence.domain.req
|
||||
* @Project:cloud-server
|
||||
* @name:GroupFenceListresp
|
||||
* @Date:2024/9/20 9:04
|
||||
* 围栏组列表
|
||||
*/
|
||||
|
||||
/**
|
||||
* 围栏组列表响应对象
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Tag(name = "围栏组列表")
|
||||
public class GroupFenceListresp {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "id",type = IdType.AUTO)
|
||||
private Long id;
|
||||
/**
|
||||
* 围栏组优先级
|
||||
*/
|
||||
private Integer priority;
|
||||
/**
|
||||
* 围栏组名称
|
||||
*/
|
||||
private String groupName;
|
||||
/**
|
||||
* 围栏组类型
|
||||
*/
|
||||
private String groupType;
|
||||
|
||||
/**
|
||||
* 启用状态
|
||||
*/
|
||||
private String status;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,56 @@
|
|||
package com.muyu.enterprise.domain.resp.car;
|
||||
|
||||
|
||||
import com.muyu.enterprise.domain.car.MessageTemplate;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 报文模版响应数据响应对象
|
||||
* @Author:李庆帅
|
||||
* @Package:com.muyu.car.domain.resp
|
||||
* @Project:cloud-server
|
||||
* @name:MessageTemplateListResp
|
||||
* @Date:2024/9/26 20:32
|
||||
* @Description: 报文模版响应数据
|
||||
*/
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Tag(name = "报文模版列表", description = "负责报文模版管理列表的相应数据")
|
||||
public class MessageTemplateListResp
|
||||
{
|
||||
/**
|
||||
* 报文模版主键
|
||||
*/
|
||||
private String messageTemplateId;
|
||||
|
||||
/**
|
||||
* 报文模版名称
|
||||
*/
|
||||
private String messageTemplateName;
|
||||
|
||||
/**
|
||||
* 报文模版描述
|
||||
*/
|
||||
private String messageTemplateDescribe;
|
||||
|
||||
/**
|
||||
* 数据库对象构建为返回结果对象
|
||||
* @param messageTemplate
|
||||
* @return
|
||||
*/
|
||||
public static MessageTemplateListResp messageTemplateBuild(MessageTemplate messageTemplate) {
|
||||
return MessageTemplateListResp.builder()
|
||||
.messageTemplateId(messageTemplate.getMessageTemplateId())
|
||||
.messageTemplateName(messageTemplate.getMessageTemplateName())
|
||||
.messageTemplateDescribe(messageTemplate.getMessageTemplateDescribe())
|
||||
.build();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,68 @@
|
|||
package com.muyu.enterprise.domain.resp.car;
|
||||
|
||||
|
||||
import com.muyu.enterprise.domain.car.MessageValue;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 报文数据响应数据响应对象
|
||||
* @Author:李庆帅
|
||||
* @Package:com.muyu.car.domain.resp
|
||||
* @Project:cloud-server
|
||||
* @name:MessageValueListResp
|
||||
* @Date:2024/9/26 20:33
|
||||
* @Description: 报文数据响应数据
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Tag(name = "报文数据列表", description = "负责报文数据管理列表的相应数据")
|
||||
public class MessageValueListResp
|
||||
{
|
||||
/**
|
||||
* 报文数据主键
|
||||
*/
|
||||
private Long messageId;
|
||||
|
||||
/**
|
||||
* 报文类别
|
||||
*/
|
||||
private String messageType;
|
||||
|
||||
/**
|
||||
* 报文编码
|
||||
*/
|
||||
private String messageCode;
|
||||
|
||||
/**
|
||||
* 报文标签
|
||||
*/
|
||||
private String messageLabel;
|
||||
|
||||
/**
|
||||
* 起始下标
|
||||
*/
|
||||
private Integer messageStartIndex;
|
||||
|
||||
/**
|
||||
* 终止下标
|
||||
*/
|
||||
private Integer messageEndIndex;
|
||||
|
||||
public static MessageValueListResp valueBuild(MessageValue messageValue){
|
||||
return MessageValueListResp.builder()
|
||||
.messageId(messageValue.getMessageId())
|
||||
.messageType(messageValue.getMessageType())
|
||||
.messageCode(messageValue.getMessageCode())
|
||||
.messageLabel(messageValue.getMessageLabel())
|
||||
.messageStartIndex(messageValue.getMessageStartIndex())
|
||||
.messageEndIndex(messageValue.getMessageEndIndex())
|
||||
.build();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,75 @@
|
|||
package com.muyu.enterprise.domain.resp.car;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
|
||||
/**
|
||||
* 车辆管理列表响应对象
|
||||
* @Author:李庆帅
|
||||
* @Package:com.muyu.car.domain.resp
|
||||
* @Project:cloud-server
|
||||
* @name:VehicleManageResp
|
||||
* @Date:2024/9/26 20:33
|
||||
* 车辆管理列表
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
@Tag(name = "车辆管理列表",description = "负责车辆管理列表的相应数据")
|
||||
public class VehicleManageResp
|
||||
{
|
||||
/**
|
||||
* 车辆主键
|
||||
*/
|
||||
@Schema(type = "Long",defaultValue = "1",description = "车辆主键")
|
||||
private Long vehicleId;
|
||||
|
||||
/**
|
||||
* 车牌号
|
||||
*/
|
||||
@Schema(type = "String", defaultValue = "冀A93827", description = "车牌号")
|
||||
private String licenceNumber;
|
||||
|
||||
/**
|
||||
* 车辆颜色
|
||||
*/
|
||||
@Schema(type = "String", defaultValue = "", description = "车辆颜色")
|
||||
private String vehicleColor;
|
||||
|
||||
/**
|
||||
* 车辆VIN
|
||||
*/
|
||||
@Schema(type = "String", defaultValue = "LDC913L2240606423", description = "车辆VIN")
|
||||
private String vehicleVin;
|
||||
|
||||
/**
|
||||
* 车辆类型
|
||||
*/
|
||||
@Schema(type = "Long", defaultValue = "新能源", description = "车辆类型")
|
||||
private String vehicleTypeName;
|
||||
|
||||
/**
|
||||
* 车辆品牌
|
||||
*/
|
||||
@Schema(title = "车辆品牌", type = "String", defaultValue = "1", description = "车辆品牌")
|
||||
private String vehicleBrand;
|
||||
|
||||
/**
|
||||
* 车辆型号
|
||||
*/
|
||||
@Schema(title = "车辆型号", type = "String", defaultValue = "1", description = "车辆型号")
|
||||
private String vehicleModel;
|
||||
|
||||
/**
|
||||
* 车辆状态
|
||||
*/
|
||||
@Schema(type = "String", defaultValue = "", description = "车辆状态")
|
||||
private String vehicleStatus;
|
||||
|
||||
}
|
|
@ -0,0 +1,75 @@
|
|||
package com.muyu.enterprise.domain.utils;
|
||||
|
||||
/**
|
||||
* @Author:李庆帅
|
||||
* @Package:com.muyu.fence.domain
|
||||
* @Project:cloud-server
|
||||
* @name:ElectricFenceModel
|
||||
* @Date:2024/9/17 17:27
|
||||
*/
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 电子围栏规则计算模型
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class ElectricFenceModel implements Comparable<ElectricFenceModel> {
|
||||
//车架号
|
||||
private String vin = "";
|
||||
//电子围栏结果表UUID
|
||||
private Long uuid = -999999L;
|
||||
//上次状态 0 里面 1 外面
|
||||
private int lastStatus = -999999;
|
||||
//当前状态 0 里面 1 外面
|
||||
private int nowStatus = -999999;
|
||||
//位置时间 yyyy-MM-dd HH:mm:ss
|
||||
private String gpsTime = "";
|
||||
//位置纬度--
|
||||
private Double lat = -999999D;
|
||||
//位置经度--
|
||||
private Double lng = -999999D;
|
||||
//电子围栏ID
|
||||
private int eleId = -999999;
|
||||
//电子围栏名称
|
||||
private String eleName = "";
|
||||
//中心点地址
|
||||
private String address = "";
|
||||
//中心点纬度
|
||||
private Double latitude;
|
||||
//中心点经度
|
||||
private Double longitude = -999999D;
|
||||
//电子围栏半径
|
||||
private Float radius = -999999F;
|
||||
//出围栏时间
|
||||
private String outEleTime = null;
|
||||
//进围栏时间
|
||||
private String inEleTime = null;
|
||||
//是否在mysql结果表中
|
||||
private Boolean inMysql = false;
|
||||
//状态报警 0:出围栏 1:进围栏
|
||||
private int statusAlarm = -999999;
|
||||
//报警信息
|
||||
private String statusAlarmMsg = "";
|
||||
//终端时间
|
||||
private String terminalTime = "";
|
||||
// 扩展字段 终端时间
|
||||
private Long terminalTimestamp = -999999L;
|
||||
|
||||
@Override
|
||||
public int compareTo(ElectricFenceModel o) {
|
||||
if(this.getTerminalTimestamp() > o.getTerminalTimestamp()){
|
||||
return 1;
|
||||
}
|
||||
else if(this.getTerminalTimestamp() < o.getTerminalTimestamp()){
|
||||
return -1;
|
||||
}else{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
package com.muyu.enterprise.domain.utils;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Author:李庆帅
|
||||
* @Package:com.muyu.fence.domain
|
||||
* @Project:cloud-server
|
||||
* @name:ElectricFenceResultTmp
|
||||
* @Date:2024/9/17 17:57
|
||||
*/
|
||||
/**
|
||||
* 电子围栏转换临时对象
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class ElectricFenceResultTmp {
|
||||
//电子围栏id
|
||||
private int id;
|
||||
//电子围栏名称
|
||||
private String name;
|
||||
//电子围栏中心地址
|
||||
private String address;
|
||||
//电子围栏半径
|
||||
private float radius;
|
||||
//电子围栏中心点的经度
|
||||
private double longitude;
|
||||
//电子围栏中心点的维度
|
||||
private double latitude;
|
||||
//电子围栏的开始时间
|
||||
private Date startTime;
|
||||
//电子围栏的结束时间
|
||||
private Date endTime;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ElectricFenceResultTmp{" +
|
||||
"id=" + id +
|
||||
", name='" + name + '\'' +
|
||||
", address='" + address + '\'' +
|
||||
", radius=" + radius +
|
||||
", longitude=" + longitude +
|
||||
", latitude=" + latitude +
|
||||
", startTime=" + startTime +
|
||||
", endTime=" + endTime +
|
||||
'}';
|
||||
}
|
||||
}
|
|
@ -0,0 +1,54 @@
|
|||
package com.muyu.enterprise.domain.utils;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Author:李庆帅
|
||||
* @Package:com.muyu.fence.domain
|
||||
* @Project:cloud-server
|
||||
* @name:ElectronicFenceResult
|
||||
* @Date:2024/9/17 17:43
|
||||
*/
|
||||
|
||||
/**
|
||||
* 电子围栏分析结果数据结构
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class ElectronicFenceResult {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* 车辆唯一标识
|
||||
*/
|
||||
private String vin;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String inTime;
|
||||
private String outTime;
|
||||
/**
|
||||
* gps定位时间
|
||||
*/
|
||||
private Date gpsTime;
|
||||
|
||||
private Double lat;
|
||||
private Double lng;
|
||||
private Integer eleId;
|
||||
private String eleName;
|
||||
private String address;
|
||||
private Double latitude;
|
||||
private Double longitude;
|
||||
private Double radius;
|
||||
private String terminalTime;
|
||||
private Date processTime;
|
||||
}
|
|
@ -0,0 +1,63 @@
|
|||
package com.muyu.enterprise.domain.utils;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
/**
|
||||
* 电子围栏经纬度工具类
|
||||
* @Author:李庆帅
|
||||
* @Package:com.muyu.fence.domain
|
||||
* @Project:cloud-server
|
||||
* @name:ElectronicFenceSetting
|
||||
* @Date:2024/9/17 16:47
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@TableName(value = "electronic_fence_setting",autoResultMap = true)
|
||||
public class ElectronicFenceSetting {
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@TableId(value = "id",type = IdType.AUTO)
|
||||
private String id;
|
||||
/**
|
||||
* 电子围栏名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 电子围栏中心地址
|
||||
*/
|
||||
private String address;
|
||||
/**
|
||||
* 电子围栏半径
|
||||
*/
|
||||
private String radius;
|
||||
/**
|
||||
* 电子围栏中心点经度
|
||||
*/
|
||||
private String longitude;
|
||||
/**
|
||||
* 电子围栏围栏中心点维度
|
||||
*/
|
||||
private String latitude;
|
||||
/**
|
||||
* 电子围栏的开始时间
|
||||
*/
|
||||
private String startTime;
|
||||
/**
|
||||
* 电子围栏的结束时间
|
||||
*/
|
||||
private String endTime;
|
||||
/**
|
||||
* 电子围栏的状态(开启,关闭)
|
||||
*/
|
||||
private String status;
|
||||
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
package com.muyu.enterprise.domain.utils;
|
||||
|
||||
/**
|
||||
* 报文分割工具类
|
||||
* @Author:李庆帅
|
||||
* @Package:com.muyu.car.utils
|
||||
* @Project:cloud-server
|
||||
* @name:VehicleConstant
|
||||
* @Date:2024/9/26 20:26
|
||||
*/
|
||||
public class VehicleConstant
|
||||
{
|
||||
/**
|
||||
* 分包符
|
||||
*/
|
||||
public static final String DATA_PACK_SEPARATOR = "#$&";
|
||||
|
||||
/**
|
||||
* 报文起始位
|
||||
*/
|
||||
public static final String MSG_START = "7E";
|
||||
|
||||
/**
|
||||
* 报文结束位
|
||||
*/
|
||||
public static final String MSG_END = "7E";
|
||||
|
||||
}
|
|
@ -22,6 +22,12 @@
|
|||
</description>
|
||||
|
||||
<dependencies>
|
||||
<!-- mybatis-plus-join依赖 -->
|
||||
<dependency>
|
||||
<groupId>com.github.yulichang</groupId>
|
||||
<artifactId>mybatis-plus-join-boot-starter</artifactId>
|
||||
<version>1.4.11</version>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos -->
|
||||
<dependency>
|
||||
|
@ -110,6 +116,13 @@
|
|||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-modules-enterprise-common</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- MyBatisPlus - 依赖包 -->
|
||||
<dependency>
|
||||
<groupId>com.github.yulichang</groupId>
|
||||
<artifactId>mybatis-plus-join</artifactId>
|
||||
<version>1.4.13</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
@ -129,4 +142,4 @@
|
|||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
</project>
|
|
@ -6,7 +6,7 @@ import org.springframework.boot.SpringApplication;
|
|||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
/**
|
||||
* 系统模块
|
||||
* 企业平台微服务启动类
|
||||
*
|
||||
* @author muyu
|
||||
*/
|
||||
|
@ -16,5 +16,26 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|||
public class CloudEnterpriseApplication {
|
||||
public static void main (String[] args) {
|
||||
SpringApplication.run(CloudEnterpriseApplication.class, args);
|
||||
}
|
||||
System.out.println(" _ooOoo_\n" +
|
||||
" o8888888o\n" +
|
||||
" 88\" . \"88\n" +
|
||||
" (| -_- |)\n" +
|
||||
" O\\ = /O\n" +
|
||||
" ____/`---'\\____\n" +
|
||||
" .' \\\\| |// `.\n" +
|
||||
" / \\\\||| : |||// \\\n" +
|
||||
" / _||||| -:- |||||- \\\n" +
|
||||
" | | \\\\\\ - /// | |\n" +
|
||||
" | \\_| ''\\---/'' | |\n" +
|
||||
" \\ .-\\__ `-` ___/-. /\n" +
|
||||
" ___`. .' /--.--\\ `. . __\n" +
|
||||
" .\"\" '< `.___\\_<|>_/___.' >'\"\".\n" +
|
||||
" | | : `- \\`.;`\\ _ /`;.`/ - ` : | |\n" +
|
||||
" \\ \\ `-. \\_ __\\ /__ _/ .-` / /\n" +
|
||||
" ======`-.____`-.___\\_____/___.-`____.-'======\n" +
|
||||
" `=---='\n" +
|
||||
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
|
||||
" // 佛祖保佑 永不宕机 永无BUG //");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,74 @@
|
|||
package com.muyu.enterprise.MQTT;
|
||||
|
||||
import com.alibaba.nacos.api.remote.PushCallBack;
|
||||
import org.eclipse.paho.client.mqttv3.MqttClient;
|
||||
import org.eclipse.paho.client.mqttv3.MqttConnectOptions;
|
||||
import org.eclipse.paho.client.mqttv3.MqttTopic;
|
||||
import org.eclipse.paho.client.mqttv3.persist.MemoryPersistence;
|
||||
|
||||
/**
|
||||
* 模拟一个客户端接收消息
|
||||
* @Author:李庆帅
|
||||
* @Package:com.muyu.enterprise.MQTT
|
||||
* @Project:cloud-server
|
||||
* @name:ClientMQTT
|
||||
* @Date:2024/9/28 12:11
|
||||
*/
|
||||
public class ClientMQTT {
|
||||
//String topic = "vehicle";
|
||||
// String content = "Message from MqttPublishSample";
|
||||
// int qos = 2;
|
||||
// String broker = "tcp://106.15.136.7:1883";
|
||||
// String clientId = "JavaSample";
|
||||
//MQTT代理服务器地址
|
||||
public static final String HOST="tcp://106.15.136.7:1883";
|
||||
public static final String TOPIC1="pos_message_all";
|
||||
private static final String clientId="12345678";
|
||||
private MqttClient client;
|
||||
private MqttConnectOptions options;
|
||||
private String userName="mqtt"; //非必须
|
||||
private String passWord="mqtt"; //非必须
|
||||
|
||||
private void start(){
|
||||
try{
|
||||
// host为主机名,clientid即连接MQTT的客户端ID,一般以唯一标识符表示,MemoryPersistence设置clientid的保存形式,默认为以内存保存
|
||||
client= new MqttClient(HOST,clientId,new MemoryPersistence());
|
||||
// MQTT的连接设置
|
||||
options=new MqttConnectOptions();
|
||||
// 设置是否清空session,这里如果设置为false表示服务器会保留客户端的连接记录,设置为true表示每次连接到服务器都以新的身份连接
|
||||
options.setCleanSession(false);
|
||||
// 设置连接的用户名
|
||||
options.setUserName(userName);
|
||||
// 设置连接的密码
|
||||
options.setPassword(passWord.toCharArray());
|
||||
// 设置超时时间 单位为秒
|
||||
options.setConnectionTimeout(10);
|
||||
// 设置会话心跳时间 单位为秒 服务器会每隔1.5*20秒的时间向客户端发送个消息判断客户端是否在线,但这个方法并没有重连的机制
|
||||
options.setKeepAliveInterval(20);
|
||||
//设置断开后重新连接
|
||||
options.setAutomaticReconnect(true);
|
||||
// 设置回调
|
||||
client.setCallback(new PushCallback());
|
||||
MqttTopic topic = client.getTopic(TOPIC1);
|
||||
//setWill方法,如果项目中需要知道客户端是否掉线可以调用该方法。设置最终端口的通知消息
|
||||
//遗嘱
|
||||
options.setWill(topic,"close".getBytes(),1,true);
|
||||
client.connect(options);
|
||||
//订阅消息
|
||||
int[] Qos = {1} ; //0:最多一次 、1:最少一次 、2:只有一次
|
||||
String[] topics1 = {TOPIC1};
|
||||
client.subscribe(topics1,Qos);
|
||||
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args){
|
||||
ClientMQTT clientMQTT = new ClientMQTT();
|
||||
clientMQTT.start();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,69 @@
|
|||
package com.muyu.enterprise.MQTT;
|
||||
|
||||
/**
|
||||
* @Author:李庆帅
|
||||
* @Package:com.muyu.enterprise.MQTT
|
||||
* @Project:cloud-server
|
||||
* @name:MQTTReceiveCallback
|
||||
* @Date:2024/9/27 22:21
|
||||
*/
|
||||
|
||||
import org.eclipse.paho.client.mqttv3.IMqttDeliveryToken;
|
||||
import org.eclipse.paho.client.mqttv3.MqttCallback;
|
||||
import org.eclipse.paho.client.mqttv3.MqttMessage;
|
||||
|
||||
/**
|
||||
* 发布消息的回调类
|
||||
*
|
||||
* 必须实现MqttCallback的接口并实现对应的相关接口方法CallBack 类将实现 MqttCallBack。
|
||||
* 每个客户机标识都需要一个回调实例。在此示例中,构造函数传递客户机标识以另存为实例数据。
|
||||
* 在回调中,将它用来标识已经启动了该回调的哪个实例。
|
||||
* 必须在回调类中实现三个方法:
|
||||
*
|
||||
* (1):public void messageArrived(MqttTopic topic, MqttMessage message)接收已经预订的发布。
|
||||
*
|
||||
* (2):public void connectionLost(Throwable cause)在断开连接时调用。
|
||||
*
|
||||
* (3):public void deliveryComplete(MqttDeliveryToken token))
|
||||
* 接收到已经发布的 QoS 1 或 QoS 2 消息的传递令牌时调用。
|
||||
* 由 MqttClient.connect 激活此回调。
|
||||
*
|
||||
*/
|
||||
public class MQTTReceiveCallback implements MqttCallback {
|
||||
// @Override
|
||||
// public void connectionLost(Throwable throwable) {
|
||||
// //连接丢失后,一般在这里面进行重连
|
||||
// System.out.println("连接断开,可以做重连");
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void messageArrived(String topic, MqttMessage message) throws Exception {
|
||||
// //subscribe后得到的消息会执行到这里面
|
||||
// System.out.println("接收消息主题:"+topic);
|
||||
// System.out.println("接收消息Qos:"+message.getQos());
|
||||
// System.out.println("接收消息内容:"+new String(message.getPayload()));
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void deliveryComplete(IMqttDeliveryToken token) {
|
||||
// System.out.println("deliveryComplete----------"+token.isComplete());
|
||||
// }
|
||||
@Override
|
||||
public void connectionLost(Throwable throwable){
|
||||
//连接丢失后,一般在这里面进行重连
|
||||
System.out.println("连接断开,可以做重连");
|
||||
}
|
||||
@Override
|
||||
public void messageArrived(String topic, MqttMessage mqttMessage) throws Exception {
|
||||
//subscribe后得到的消息会执行到这面
|
||||
System.out.println("接收消息主题:"+topic);
|
||||
System.out.println("接收消息Qos:"+mqttMessage.getQos());
|
||||
System.out.println("接收消息内容:"+new String(mqttMessage.getPayload()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deliveryComplete(IMqttDeliveryToken iMqttDeliveryToken) {
|
||||
System.out.println("deliveryComplete---------"+iMqttDeliveryToken.isComplete());
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,187 @@
|
|||
package com.muyu.enterprise.MQTT;
|
||||
|
||||
|
||||
import org.eclipse.paho.client.mqttv3.*;
|
||||
import org.eclipse.paho.client.mqttv3.persist.MemoryPersistence;
|
||||
|
||||
/**
|
||||
* 客户端类
|
||||
* @Author:李庆帅
|
||||
* @Package:com.muyu.enterprise.mqtt
|
||||
* @Project:cloud-server
|
||||
* @name:MyMqttClient
|
||||
* @Date:2024/9/27 22:20
|
||||
*/
|
||||
public class MyMqttClient {
|
||||
|
||||
public static MqttClient mqttClient =null;
|
||||
private static MemoryPersistence memoryPersistence=null;
|
||||
private static MqttConnectOptions mqttConectOptions=null;
|
||||
private static String ClinentName=""; //待填 将在服务端出现的名字
|
||||
private static String IP=""; //待填 服务器IP
|
||||
|
||||
|
||||
public static void main(String[] args) {
|
||||
start(ClinentName);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static void start(String clientId){
|
||||
//初始化连接设置对象
|
||||
mqttConectOptions=new MqttConnectOptions();
|
||||
//设置是否清空session,这里如果设置为false表示服务器会保留客户端的连接记录,
|
||||
//这里设置为true表示每次连接到服务器都以新的身份连接
|
||||
mqttConectOptions.setCleanSession(true);
|
||||
//设置连接超时时间,单位是秒
|
||||
mqttConectOptions.setConnectionTimeout(10);
|
||||
//设置持久化方式
|
||||
memoryPersistence=new MemoryPersistence();
|
||||
if(null!=clientId){
|
||||
try{
|
||||
mqttClient =new MqttClient("tcp://"+IP+":1883", clientId,memoryPersistence);
|
||||
} catch (Exception e) {
|
||||
// TODO 自动生成的捕获块
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
System.out.println("连接状态:"+mqttClient.isConnected());
|
||||
//设置连接和回调
|
||||
if(null!=mqttClient){
|
||||
if(!mqttClient.isConnected()){
|
||||
//创建回调函数对象
|
||||
MQTTReceiveCallback MQTTReceiveCallback = new MQTTReceiveCallback();
|
||||
//客户端添加回调函数
|
||||
mqttClient.setCallback(MQTTReceiveCallback);
|
||||
//创建连接
|
||||
try{
|
||||
System.out.println("创建连接");
|
||||
mqttClient.connect(mqttConectOptions);
|
||||
} catch (Exception e) {
|
||||
// TODO 自动生成的捕获块
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}else {
|
||||
System.out.println("mqttClient为空");
|
||||
}
|
||||
System.out.println("连接状态"+mqttClient.isConnected());
|
||||
}
|
||||
// 关闭连接
|
||||
public void closeConnect(){
|
||||
//关闭储存方式
|
||||
if(null!=memoryPersistence){
|
||||
try{
|
||||
memoryPersistence.close();
|
||||
} catch (Exception e) {
|
||||
// TODO 自动生成的捕获块
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}else {
|
||||
System.out.println("memoryPersistence为空");
|
||||
}
|
||||
|
||||
if(null!=mqttClient){
|
||||
if(mqttClient.isConnected()){
|
||||
try{
|
||||
mqttClient.disconnect();
|
||||
mqttClient.close();
|
||||
} catch (Exception e) {
|
||||
// TODO 自动生成的捕获块
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}else {
|
||||
System.out.println("mqttClient未连接");
|
||||
}
|
||||
}else {
|
||||
System.out.println("mqttClient为空");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//发布消息
|
||||
public static void publishMessage(String pubTopic,String message,int qos){
|
||||
if(null!=mqttClient && mqttClient.isConnected()){
|
||||
System.out.println("发布消息"+mqttClient.isConnected());
|
||||
System.out.println("id"+mqttClient.isConnected());
|
||||
MqttMessage mqttMessage = new MqttMessage();
|
||||
mqttMessage.setQos(qos);
|
||||
|
||||
MqttTopic topic = mqttClient.getTopic(pubTopic);
|
||||
|
||||
if(null!=topic){
|
||||
try{
|
||||
MqttDeliveryToken publish = topic.publish(mqttMessage);
|
||||
if(!publish.isComplete()){
|
||||
System.out.println("消息发布成功");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// TODO 自动生成的捕获块
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//重新连接
|
||||
public static void reConnect(){
|
||||
if(null!=mqttClient&&mqttClient.isConnected()){
|
||||
if(!mqttClient.isConnected()){
|
||||
if(null!=mqttConectOptions){
|
||||
try{
|
||||
mqttClient.connect(mqttConectOptions);
|
||||
} catch (Exception e) {
|
||||
// TODO 自动生成的捕获块
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}else {
|
||||
System.out.println("mqttConnectOptions为空");
|
||||
}
|
||||
}else {
|
||||
System.out.println("mqttClient为空或已连接");
|
||||
}
|
||||
}else {
|
||||
start(ClinentName);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//订阅主题
|
||||
public static void suvTopic(String topic){
|
||||
if(null!=mqttClient && mqttClient.isConnected()){
|
||||
try{
|
||||
mqttClient.subscribe(topic,1);
|
||||
} catch (MqttException e) {
|
||||
// TODO 自动生成的捕获块
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}else {
|
||||
System.out.println("mqttClient出错");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//清空主题
|
||||
public void cleanTopic(String topic){
|
||||
if(null!=mqttClient && mqttClient.isConnected()){
|
||||
try{
|
||||
mqttClient.subscribe(topic);
|
||||
} catch (Exception e) {
|
||||
// TODO 自动生成的捕获块
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}else {
|
||||
System.out.println("mqttClient出错");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,52 @@
|
|||
package com.muyu.enterprise.MQTT;
|
||||
|
||||
/**
|
||||
* 发布消息的回调类
|
||||
* @Author:李庆帅
|
||||
* @Package:com.muyu.enterprise.MQTT
|
||||
* @Project:cloud-server
|
||||
* @name:PushCallback
|
||||
* @Date:2024/9/28 14:35
|
||||
*/
|
||||
|
||||
import org.eclipse.paho.client.mqttv3.IMqttDeliveryToken;
|
||||
import org.eclipse.paho.client.mqttv3.MqttCallback;
|
||||
import org.eclipse.paho.client.mqttv3.MqttMessage;
|
||||
|
||||
/**
|
||||
* 发布消息的回调类
|
||||
*
|
||||
* 必须实现MqttCallback的接口并实现对应的相关接口方法CallBack 类将实现 MqttCallBack。
|
||||
* 每个客户机标识都需要一个回调实例。在此示例中,构造函数传递客户机标识以另存为实例数据。
|
||||
* 在回调中,将它用来标识已经启动了该回调的哪个实例。
|
||||
* 必须在回调类中实现三个方法:
|
||||
*
|
||||
* public void messageArrived(MqttTopic topic, MqttMessage message)接收已经预订的发布。
|
||||
*
|
||||
* public void connectionLost(Throwable cause)在断开连接时调用。
|
||||
*
|
||||
* public void deliveryComplete(MqttDeliveryToken token))
|
||||
* 接收到已经发布的 QoS 1 或 QoS 2 消息的传递令牌时调用。
|
||||
* 由 MqttClient.connect 激活此回调。
|
||||
*
|
||||
*/
|
||||
public class PushCallback implements MqttCallback {
|
||||
@Override
|
||||
public void connectionLost(Throwable throwable) {
|
||||
// 连接丢失后,一般在这里面进行重连
|
||||
System.out.println("连接断开,可以做重连");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void messageArrived(String topic, MqttMessage mqttMessage) throws Exception {
|
||||
// subscribe后得到的消息会执行到这里面
|
||||
System.out.println("接收消息主题 : " + topic);
|
||||
System.out.println("接收消息Qos : " + mqttMessage.getQos());
|
||||
System.out.println("接收消息内容 : " + new String(mqttMessage.getPayload()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deliveryComplete(IMqttDeliveryToken iMqttDeliveryToken) {
|
||||
System.out.println("deliveryComplete---------" + iMqttDeliveryToken.isComplete());
|
||||
}
|
||||
}
|
|
@ -0,0 +1,113 @@
|
|||
package com.muyu.enterprise.MQTT;
|
||||
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.eclipse.paho.client.mqttv3.*;
|
||||
import org.eclipse.paho.client.mqttv3.persist.MemoryPersistence;
|
||||
|
||||
/**
|
||||
* 这是发送消息的服务端
|
||||
* 服务器向多个客户端推送主题,即不同客户端可向服务器订阅相同主题
|
||||
* @Author:李庆帅
|
||||
* @Package:com.muyu.enterprise.MQTT
|
||||
* @Project:cloud-server
|
||||
* @name:ServerMQTT
|
||||
* @Date:2024/9/28 14:32
|
||||
*/
|
||||
@Log4j2
|
||||
public class ServerMQTT {
|
||||
|
||||
//tcp://MQTT安装的服务器地址:MQTT定义的端口号
|
||||
public static final String HOST = "tcp://127.0.0.1:1883";
|
||||
//定义一个主题
|
||||
public static final String TOPIC = "pos_message_all";
|
||||
//定义MQTT的ID,可以在MQTT服务配置中指定
|
||||
private static final String clientId = "server11";
|
||||
|
||||
private MqttClient client;
|
||||
private static MqttTopic topic11;
|
||||
|
||||
// private String userName = "mqtt"; //非必须
|
||||
// private String passWord = "mqtt"; //非必须
|
||||
|
||||
private static MqttMessage message;
|
||||
|
||||
/**
|
||||
* 构造方法
|
||||
* @throws MqttException
|
||||
*/
|
||||
public ServerMQTT() throws MqttException {
|
||||
// MemoryPersistence设置clientid的保存形式,默认为以内存保存
|
||||
client=new MqttClient(HOST, clientId,new MemoryPersistence());
|
||||
connect();
|
||||
}
|
||||
|
||||
/**
|
||||
* 用来连接服务器
|
||||
*/
|
||||
private void connect()
|
||||
{
|
||||
MqttConnectOptions options = new MqttConnectOptions();
|
||||
options.setCleanSession(false);
|
||||
// options.setUserName(userName);
|
||||
// options.setPassword(passWord.toCharArray());
|
||||
// 设置超时时间
|
||||
options.setConnectionTimeout(10);
|
||||
// 设置会话心跳时间
|
||||
options.setKeepAliveInterval(20);
|
||||
try{
|
||||
client.setCallback(new PushCallback());
|
||||
client.connect(options);
|
||||
topic11 = client.getTopic(TOPIC);
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param topic
|
||||
* @param message
|
||||
* @throws MqttException
|
||||
*/
|
||||
public static void publish(MqttTopic topic , MqttMessage message) throws MqttPersistenceException,MqttException{
|
||||
MqttDeliveryToken token= topic.publish(message);
|
||||
|
||||
token.waitForCompletion();
|
||||
System.out.println("消息已完全发布!"+token.isComplete());
|
||||
log.info("消息已完全发布!"+token.isComplete());
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param clieId
|
||||
* @param msg
|
||||
* @throws Exception
|
||||
*/
|
||||
public static void sendMessage(String clieId,String msg)throws Exception{
|
||||
ServerMQTT server = new ServerMQTT();
|
||||
server.message = new MqttMessage();
|
||||
server.message.setQos(1); //保证消息能到达一次
|
||||
server.message.setRetained(true);
|
||||
String str="{\"clienId\":\""+clieId+"\",\"msg\":\""+msg+"\"}";
|
||||
try{
|
||||
publish(server.topic11 , server.message);
|
||||
//断开连接
|
||||
// server.client.disconnect();
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
sendMessage("123444","哈哈哈");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
package com.muyu.enterprise.controller;
|
||||
|
||||
import com.muyu.enterprise.domain.CarCompany;
|
||||
import com.muyu.enterprise.service.CarCompanyService;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.web.controller.BaseController;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 车辆企业--控制层
|
||||
* @ClassName CarCompanyController
|
||||
* @Description 车辆企业 Controller 层
|
||||
* @author MingWei.Zong
|
||||
* @Date 2024/9/28 16:52
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/company")
|
||||
@Tag(name = "CarCompanyController", description = "企业表")
|
||||
public class CarCompanyController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private CarCompanyService sysCarCompanyService;
|
||||
|
||||
/**
|
||||
* 查询企业表
|
||||
*/
|
||||
@PostMapping("selectCompany")
|
||||
public Result<List<CarCompany>> selectCompany(){
|
||||
return Result.success(sysCarCompanyService.list());
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过ID查询企业
|
||||
*/
|
||||
@PostMapping("selectCompanyByCompanyId")
|
||||
public Result<CarCompany> selectCompanyByCompanyId(@RequestParam("companyId") Long companyId){
|
||||
return Result.success(sysCarCompanyService.getById(companyId));
|
||||
}
|
||||
|
||||
}
|
|
@ -1,10 +1,13 @@
|
|||
package com.muyu.enterprise.controller;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import com.muyu.common.core.utils.StringUtils;
|
||||
import com.muyu.enterprise.domain.CarManage;
|
||||
import com.muyu.enterprise.domain.dto.CarDTO;
|
||||
import com.muyu.enterprise.domain.vo.CarVO;
|
||||
import com.muyu.enterprise.service.SysCarCompanyService;
|
||||
import com.muyu.enterprise.service.SysCarService;
|
||||
import com.muyu.enterprise.service.CarCompanyService;
|
||||
import com.muyu.enterprise.service.CarManageService;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.web.controller.BaseController;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
|
@ -17,19 +20,22 @@ import org.springframework.web.bind.annotation.*;
|
|||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 参数配置 信息操作处理
|
||||
*
|
||||
* @author muyu
|
||||
* 车辆管理--控制层
|
||||
* @ClassName CarManageController
|
||||
* @Description 车辆管理 Controller 层
|
||||
* @author MingWei.Zong
|
||||
* @Date 2024/9/28 16:52
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/manage")
|
||||
@Tag(name = "SysCarController", description = "系统参数配置")
|
||||
public class SysCarController extends BaseController {
|
||||
@RequestMapping("/carManage")
|
||||
@Tag(name = "CarManageController", description = "车辆管理")
|
||||
public class CarManageController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private SysCarCompanyService sysCarCompanyService;
|
||||
private CarCompanyService sysCarCompanyService;
|
||||
@Autowired
|
||||
private SysCarService sysCarService;
|
||||
private CarManageService sysCarService;
|
||||
|
||||
|
||||
/**
|
||||
* 车辆列表2
|
||||
|
@ -37,7 +43,7 @@ public class SysCarController extends BaseController {
|
|||
* @return
|
||||
*/
|
||||
@PostMapping("CarListShow")
|
||||
public Result<List<CarVO>> CarListShow(@RequestBody CarDTO carDTO){
|
||||
public Result<List<CarManage>> CarListShow(@RequestBody CarDTO carDTO){
|
||||
return Result.success(sysCarService.CarListShow(carDTO));
|
||||
}
|
||||
|
||||
|
@ -46,22 +52,22 @@ public class SysCarController extends BaseController {
|
|||
* @param carId
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("CarListShowByCarId")
|
||||
public Result<List<CarVO>> CarListShowByCarId(@RequestParam("carId") Long carId){
|
||||
return Result.success(sysCarService.CarListShowByCarId(carId));
|
||||
@PostMapping("CarManageShowByCarId")
|
||||
public Result CarManageShowByCarId(@RequestParam("carId") Long carId){
|
||||
return Result.success(sysCarService.getById(carId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 车辆列表1
|
||||
* @param carVO
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("CarList")
|
||||
@Operation(summary = "查询列表",description = "车辆管理列表")
|
||||
public Result<TableDataInfo<CarVO>> CarList(@RequestBody CarVO carVO){
|
||||
startPage();
|
||||
return getDataTable(sysCarService.carList(carVO));
|
||||
}
|
||||
// /**
|
||||
// * 车辆列表1
|
||||
// * @param carVO
|
||||
// * @return
|
||||
// */
|
||||
// @PostMapping("CarList")
|
||||
// @Operation(summary = "查询列表",description = "车辆管理列表")
|
||||
// public Result<TableDataInfo<CarManage>> CarList(@RequestBody CarVO carVO){
|
||||
// startPage();
|
||||
// return getDataTable(sysCarService.carList(carVO));
|
||||
// }
|
||||
|
||||
|
||||
/**
|
||||
|
@ -70,14 +76,14 @@ public class SysCarController extends BaseController {
|
|||
* @return
|
||||
*/
|
||||
@PostMapping("insertCar")
|
||||
public Result insertCar(@RequestBody CarVO carVO){
|
||||
public Result insertCar(@RequestBody CarManage carVO){
|
||||
String key = RandomUtil.randomNumbers(9);
|
||||
// 随机生成车架号
|
||||
carVO.setCarFrame(key);
|
||||
// 随机生成VIN码
|
||||
String key2 = RandomUtil.randomNumbers(17);
|
||||
carVO.setCarVin(key2);
|
||||
sysCarService.insertCar(carVO);
|
||||
sysCarService.save(carVO);
|
||||
return Result.success("车辆添加成功");
|
||||
}
|
||||
|
||||
|
@ -88,7 +94,7 @@ public class SysCarController extends BaseController {
|
|||
* @return
|
||||
*/
|
||||
@PostMapping("updataCar")
|
||||
public Result updataCar(@RequestBody CarVO carVO){
|
||||
public Result updataCar(@RequestBody CarManage carVO){
|
||||
//
|
||||
carVO.setUserId(SecurityUtils.getUserId());
|
||||
sysCarService.updateById(carVO);
|
||||
|
@ -102,7 +108,7 @@ public class SysCarController extends BaseController {
|
|||
*/
|
||||
@PostMapping("deleteCar")
|
||||
public Result deleteCar(@RequestParam("ids") List<Long> ids){
|
||||
sysCarService.deleteCar(ids);
|
||||
sysCarService.removeBatchByIds(ids);
|
||||
return Result.success("车辆删除成功");
|
||||
}
|
||||
|
|
@ -2,28 +2,37 @@ package com.muyu.enterprise.controller;
|
|||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.web.controller.BaseController;
|
||||
import com.muyu.enterprise.domain.CarMessage;
|
||||
import com.muyu.enterprise.service.CarMessageService;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
* @ClassName CarMessageController
|
||||
* @Description 描述
|
||||
* @Author YiBo.Liu
|
||||
* @Date 2024/9/22 22:28
|
||||
* 车辆报文--控制层
|
||||
* @ClassName carMessageController
|
||||
* @Description 车辆类型 Controller 层
|
||||
* @author MingWei.Zong
|
||||
* @Date 2024/9/28 16:52
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/carMessage")
|
||||
public class CarMessageController {
|
||||
@Tag(name = "报文",description = "报文模块")
|
||||
public class CarMessageController extends BaseController {
|
||||
@Autowired
|
||||
private CarMessageService carMessageService;
|
||||
private CarMessageService sysCarMessageService;
|
||||
|
||||
/**
|
||||
* 查询所有报文信息
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("selectMessageShow")
|
||||
public List<CarMessage> selectMessageShow(@RequestParam("templateId") Long templateId){
|
||||
return sysCarMessageService.selectMessageShow(templateId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据报文模板id查询报文
|
||||
|
@ -32,8 +41,46 @@ public class CarMessageController {
|
|||
*/
|
||||
@GetMapping("/selectByTemplateId")
|
||||
private Result<List<CarMessage>> selectByTemplateId(@RequestParam("templateId") Integer templateId) {
|
||||
return Result.success(carMessageService.list
|
||||
(new LambdaQueryWrapper<CarMessage>().eq(CarMessage::getTemplateId, templateId)));
|
||||
return Result.success(sysCarMessageService.list
|
||||
(new LambdaQueryWrapper<CarMessage>().eq(CarMessage::getTemplateId, templateId)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询报文信息
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("selectMessageByMessageId")
|
||||
public CarMessage selectMessageByMessageId(@RequestParam("messageId") Long messageId){
|
||||
return sysCarMessageService.selectMessageByMessageId(messageId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加报文信息
|
||||
* @return carMessage
|
||||
*/
|
||||
@PostMapping("insertMessage")
|
||||
public Result insertMessage(@RequestBody CarMessage carMessage){
|
||||
sysCarMessageService.save(carMessage);
|
||||
return Result.success("添加成功");
|
||||
}
|
||||
/**
|
||||
* 修改报文信息
|
||||
* @return carMessage
|
||||
*/
|
||||
@PostMapping("updataMessage")
|
||||
public Result updataMessage(@RequestBody CarMessage carMessage){
|
||||
sysCarMessageService.updateById(carMessage);
|
||||
return Result.success("修改成功");
|
||||
}
|
||||
/**
|
||||
* 删除报文信息
|
||||
* @return carMessage
|
||||
*/
|
||||
@PostMapping("deleteMessage")
|
||||
public Result deleteMessage(@RequestParam("ids") List<Long> ids){
|
||||
sysCarMessageService.removeBatchByIds(ids);
|
||||
return Result.success("删除成功");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,91 @@
|
|||
package com.muyu.enterprise.controller;
|
||||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.utils.StringUtils;
|
||||
import com.muyu.common.core.web.controller.BaseController;
|
||||
import com.muyu.common.security.utils.SecurityUtils;
|
||||
import com.muyu.enterprise.domain.CarMessageType;
|
||||
import com.muyu.enterprise.service.CarMessageTypeService;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 报文类型--控制层
|
||||
* @ClassName CarMessageTypeController
|
||||
* @Description 报文类型 Controller 层
|
||||
* @author MingWei.Zong
|
||||
* @Date 2024/9/28 16:52
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("carMessageType")
|
||||
@Tag(name = "报文类型" ,description = "报文类型")
|
||||
public class CarMessageTypeController extends BaseController {
|
||||
@Autowired
|
||||
private CarMessageTypeService sysCarMessageTypeService;
|
||||
|
||||
/**
|
||||
* 查询报文类型
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("messageTypeList")
|
||||
public Result messageTypeList(){
|
||||
sysCarMessageTypeService.messageTypeList();
|
||||
List<CarMessageType> list = sysCarMessageTypeService.list();
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
@PostMapping("inserMessageType")
|
||||
public Result inserMessageType(@RequestBody CarMessageType carMessageType){
|
||||
/** id 检验 */
|
||||
if(carMessageType.getMessageTypeId()>0){
|
||||
return Result.error("添加要什么id");
|
||||
}
|
||||
/** token 检验 */
|
||||
if(SecurityUtils.getToken().isEmpty()){
|
||||
return Result.error("token不为空");
|
||||
}
|
||||
/** 报文类型 */
|
||||
if(StringUtils.isEmpty(carMessageType.getMessageType())){
|
||||
return Result.error("报文类型不能为空");
|
||||
}
|
||||
/** 报文 */
|
||||
if(StringUtils.isEmpty(carMessageType.getMessageName())){
|
||||
return Result.error("报文不能为空");
|
||||
}
|
||||
/** 报文编码 */
|
||||
if(StringUtils.isEmpty(carMessageType.getMessageCode())){
|
||||
return Result.error("报文编码不能为空");
|
||||
}
|
||||
/** 报文字段类型 */
|
||||
if(StringUtils.isEmpty(carMessageType.getMessageClass())){
|
||||
return Result.error("报文字段类型不能为空");
|
||||
}
|
||||
sysCarMessageTypeService.save(carMessageType);
|
||||
return Result.success("添加成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改报文类型
|
||||
* @param carMessageType
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("updateMessageType")
|
||||
public Result updateMessageType(@RequestBody CarMessageType carMessageType){
|
||||
/** id */
|
||||
if(carMessageType.getMessageTypeId() < 0 ){
|
||||
return Result.error("修改需要id");
|
||||
}
|
||||
/** 报文编号 */
|
||||
if(StringUtils.isEmpty(carMessageType.getMessageCode())){
|
||||
return Result.error("");
|
||||
}
|
||||
sysCarMessageTypeService.updateById(carMessageType);
|
||||
return Result.success("修改成功");
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
package com.muyu.enterprise.controller;
|
||||
|
||||
import com.muyu.enterprise.domain.CarTemplate;
|
||||
import com.muyu.enterprise.service.SysCarTemplateService;
|
||||
import com.muyu.enterprise.service.CarTemplateService;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.web.controller.BaseController;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
|
@ -9,13 +9,19 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 报文模版--控制层
|
||||
* @ClassName CarTemplateController
|
||||
* @Description 报文模版 Controller 层
|
||||
* @author MingWei.Zong
|
||||
* @Date 2024/9/28 16:52
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/template") // 报文
|
||||
@RequestMapping("/carTemplate") // 报文模版
|
||||
@Tag(name = "模版模块",description = "报文模版模块")
|
||||
public class SysCarTemplateController extends BaseController {
|
||||
public class CarTemplateController extends BaseController {
|
||||
@Autowired
|
||||
private SysCarTemplateService sysCarTemplateService;
|
||||
private CarTemplateService sysCarTemplateService;
|
||||
|
||||
/**
|
||||
* 查询所有模版信息
|
|
@ -3,12 +3,14 @@ package com.muyu.enterprise.controller;
|
|||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.enterprise.domain.CarType;
|
||||
import com.muyu.enterprise.service.CarTypeService;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 车辆类型控制层
|
||||
* @ClassName CarController
|
||||
* @Description 车辆类型Controller层
|
||||
* @Author YiBo.Liu
|
||||
|
@ -16,6 +18,7 @@ import java.util.List;
|
|||
*/
|
||||
@RestController
|
||||
@RequestMapping("/carType")
|
||||
@Tag(name = "CarTypeController",description = "车辆类型")
|
||||
public class CarTypeController {
|
||||
|
||||
@Autowired
|
||||
|
|
|
@ -0,0 +1,145 @@
|
|||
package com.muyu.enterprise.controller;
|
||||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.enterprise.domain.dateBase.ElectronicFence;
|
||||
import com.muyu.enterprise.domain.req.ElectroicFenceAddReq;
|
||||
import com.muyu.enterprise.domain.req.ElectroicFenceListReq;
|
||||
import com.muyu.enterprise.domain.req.ElectroicFenceUpdReq;
|
||||
import com.muyu.enterprise.domain.req.FenceWayReq;
|
||||
import com.muyu.enterprise.domain.resp.ElectronicFenceResp;
|
||||
import com.muyu.enterprise.service.ElectronicFenceService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:李庆帅
|
||||
* @Package:com.muyu.fence.controller
|
||||
* @Project:cloud-server
|
||||
* @name:FenceEtlController
|
||||
* @Date:2024/9/17 16:28
|
||||
*/
|
||||
|
||||
/**
|
||||
* 电子围栏控制层
|
||||
*/
|
||||
@Log4j2
|
||||
@Tag(name = "电子围栏控制层")
|
||||
@RestController
|
||||
@RequestMapping("/fence")
|
||||
@RequiredArgsConstructor
|
||||
public class ElectronicFenceController {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Resource
|
||||
private ElectronicFenceService electronicFenceService;
|
||||
|
||||
|
||||
@PostMapping("/fenceArray")
|
||||
@Operation(description = "查询所有可用的围栏")
|
||||
public Result<List<ElectronicFenceResp>> fenceArray() {
|
||||
System.out.println("=====>" + "hgfvhgjy");
|
||||
return Result.success(electronicFenceService.fenceArray());
|
||||
}
|
||||
|
||||
@PostMapping("/fenceselectList")
|
||||
@Operation(description = "列表")
|
||||
public Result<List<ElectronicFenceResp>> fenceselectList(@RequestBody ElectroicFenceListReq electroicFenceListReq) {
|
||||
System.out.println("=====>" + "hgfvhgjy");
|
||||
return Result.success(electronicFenceService.fenceselectList(electroicFenceListReq));
|
||||
}
|
||||
|
||||
@PostMapping("/add")
|
||||
@Operation(description = "添加")
|
||||
public Result AddFence(@RequestBody ElectroicFenceAddReq electroicFenceAddReq) {
|
||||
|
||||
electronicFenceService.unquireFence(electroicFenceAddReq.getName());
|
||||
electronicFenceService.AddFence(electroicFenceAddReq);
|
||||
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@PostMapping("/upd/{id}")
|
||||
@Operation(description = "修改")
|
||||
public Result UpdFence(@PathVariable("id") Long id, @RequestBody ElectroicFenceUpdReq electroicFenceUpdReq) {
|
||||
|
||||
electronicFenceService.updateById(ElectronicFence.buildByElectronicUpd(electroicFenceUpdReq, () -> id));
|
||||
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@PostMapping("/findElectronicByid/{id}")
|
||||
@Operation(description = "通过id回显围栏信息")
|
||||
public Result<ElectronicFence> findElectronicByid(@PathVariable("id") Long id) {
|
||||
|
||||
ElectronicFence electronicFence= electronicFenceService.findElectronicByid(id);
|
||||
return Result.success(electronicFence);
|
||||
|
||||
}
|
||||
|
||||
// @PostMapping("/delElectronById/{id}")
|
||||
// @Operation(description = "通过id删除围栏")
|
||||
// public Result delElectronById(@PathVariable("id") Long id) {
|
||||
//
|
||||
// electronicFenceService.delElectronById(id);
|
||||
//
|
||||
// return Result.success();
|
||||
// }
|
||||
/**
|
||||
* 电子围栏表信息表删除
|
||||
* @param electronicFenceId 请求对象
|
||||
* @return 返回结果
|
||||
*/
|
||||
@DeleteMapping("/{electronicFenceId}")
|
||||
@Operation(summary = "电子围栏表信息表删除",
|
||||
description = "通过ID删除电子围栏表信息")
|
||||
public Result<String> remove(@PathVariable("electronicFenceId") Long electronicFenceId)
|
||||
{
|
||||
boolean b = electronicFenceService.removeById(electronicFenceId);
|
||||
return Result.success(null, "操作成功");
|
||||
}
|
||||
|
||||
@PostMapping("/open/{id}")
|
||||
@Operation(description = "开启围栏")
|
||||
public Result openFence(@PathVariable("id") Long id) {
|
||||
|
||||
electronicFenceService.openFence(id);
|
||||
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@PostMapping("/close/{id}")
|
||||
@Operation(description = "关闭围栏")
|
||||
public Result closeFence(@PathVariable("id") Long id) {
|
||||
|
||||
electronicFenceService.closeFence(id);
|
||||
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@PostMapping("/setFenceWay")
|
||||
@Operation(description = "设置电子围栏的位置")
|
||||
public Result setFenceWay(@RequestBody FenceWayReq fenceWayReq) {
|
||||
|
||||
Long id = fenceWayReq.getId();
|
||||
|
||||
String longitudeLatitude = fenceWayReq.getLongitudeLatitude();
|
||||
|
||||
log.info("接收到的数据,:{}" + id + "====" + longitudeLatitude);
|
||||
|
||||
electronicFenceService.setFenceWay(id, longitudeLatitude);
|
||||
|
||||
return Result.success();
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,132 @@
|
|||
package com.muyu.enterprise.controller;
|
||||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.enterprise.domain.dateBase.ElectronicFenceGroup;
|
||||
import com.muyu.enterprise.domain.req.ElectronicFenceGroupAddReq;
|
||||
import com.muyu.enterprise.domain.req.ElectronicFenceGroupListReq;
|
||||
import com.muyu.enterprise.domain.req.ElectronicFenceGroupUpdReq;
|
||||
import com.muyu.enterprise.domain.resp.ElectronicFenceGroupResp;
|
||||
import com.muyu.enterprise.domain.resp.GroupFenceListresp;
|
||||
import com.muyu.enterprise.service.ElectronicFenceGroupService;
|
||||
import com.muyu.enterprise.service.FenceGroupMidService;
|
||||
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.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:李庆帅
|
||||
* @Package:com.muyu.fence.controller
|
||||
* @Project:cloud-server
|
||||
* @name:FenceGroupController
|
||||
* @Date:2024/9/18 15:15
|
||||
*/
|
||||
|
||||
/**
|
||||
* 围栏组控制层
|
||||
*/
|
||||
@Log4j2
|
||||
@RestController
|
||||
@RequestMapping("/group")
|
||||
@Tag(name = "围栏组控制层")
|
||||
public class ElectronicFenceGroupController {
|
||||
|
||||
/**
|
||||
* 业务
|
||||
*/
|
||||
@Autowired
|
||||
private ElectronicFenceGroupService electronicFenceGroupService;
|
||||
|
||||
@Autowired
|
||||
private FenceGroupMidService fenceGroupMidService;
|
||||
|
||||
|
||||
@PostMapping("/selectGroupList")
|
||||
public Result<List<GroupFenceListresp>> selectGroupList(@RequestBody ElectronicFenceGroupListReq req) {
|
||||
//查询所有的围栏组
|
||||
List<ElectronicFenceGroup> fenceListList = electronicFenceGroupService.selectGroupList(req);
|
||||
|
||||
List<GroupFenceListresp> list = fenceListList.stream().map(ElectronicFenceGroup::buildGroupFence).toList();
|
||||
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@PostMapping("/addGroup")
|
||||
public Result addGroup(@RequestBody ElectronicFenceGroupAddReq addReq) {
|
||||
|
||||
ElectronicFenceGroup electronicFenceGroup = ElectronicFenceGroup.buildByAdd(addReq);
|
||||
//添加围栏组返回添加后的主键自增id
|
||||
electronicFenceGroupService.save(electronicFenceGroup);
|
||||
Long id = electronicFenceGroup.getId();
|
||||
//添加中间表
|
||||
fenceGroupMidService.addGroupAndFenceMid(id, addReq.getElectronicFenceRespList());
|
||||
|
||||
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@PostMapping("/findGroupByid/{id}")
|
||||
@Operation(description = "通过id回显围栏组信息")
|
||||
public Result<ElectronicFenceGroupResp> findGroupByid(@PathVariable("id") Long id) {
|
||||
|
||||
ElectronicFenceGroupResp fenceGroupResp = electronicFenceGroupService.findGroupByid(id);
|
||||
return Result.success(fenceGroupResp);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Transactional
|
||||
@PostMapping("/updGroup/{id}")
|
||||
@Operation(description = "修改")
|
||||
public Result UpdFence(@PathVariable("id") Long id, @RequestBody ElectronicFenceGroupUpdReq req) {
|
||||
|
||||
electronicFenceGroupService.updateById(ElectronicFenceGroup.buildByUpd(req, () -> id));
|
||||
|
||||
if (!CollectionUtils.isEmpty(req.getElectronicFenceRespList())) {
|
||||
//删除中间表
|
||||
fenceGroupMidService.deliteMid(id);
|
||||
//增加中间表
|
||||
fenceGroupMidService.addGroupAndFenceMid(id, req.getElectronicFenceRespList());
|
||||
}
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 围栏组表信息表删除
|
||||
* @param findGroupId 请求对象
|
||||
* @return 返回结果
|
||||
*/
|
||||
@DeleteMapping("/{findGroupId}")
|
||||
@Operation(summary = "围栏组表信息表删除",
|
||||
description = "通过ID删除围栏组表信息")
|
||||
public Result<String> remove(@PathVariable("findGroupId") Long findGroupId)
|
||||
{
|
||||
boolean b = electronicFenceGroupService.removeById(findGroupId);
|
||||
|
||||
|
||||
return Result.success(null, "操作成功");
|
||||
}
|
||||
/**
|
||||
* 围栏链信息表删除
|
||||
* @param findId 请求对象
|
||||
* @return 返回结果
|
||||
*/
|
||||
@DeleteMapping("/findId/{findId}")
|
||||
@Operation(summary = "围栏链信息表删除",
|
||||
description = "通过ID删除围栏链表信息")
|
||||
public Result<String> findId(@PathVariable("findId") Long findId)
|
||||
{
|
||||
boolean b = fenceGroupMidService.removeById(findId);
|
||||
|
||||
|
||||
return Result.success(null, "操作成功");
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -11,6 +11,12 @@ import org.springframework.web.bind.annotation.*;
|
|||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 故障日志控制层
|
||||
* @author chenruijia
|
||||
* @Date 2024/9/28 11:58
|
||||
* @Description FaultLogController:故障日志控制层
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/log")
|
||||
@Tag(name = "故障日志",description = "对故障记录日志")
|
||||
|
|
|
@ -10,7 +10,12 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 站内信控制层
|
||||
* @author chenruijia
|
||||
* @Date 2024/9/28 11:58
|
||||
* @Description FaultMessageController:站内信控制层
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/fault-message")
|
||||
@Tag(name = "站内信的管理",description = "对站内信息的处理与查看")
|
||||
|
|
|
@ -9,6 +9,12 @@ import org.springframework.web.bind.annotation.*;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 故障类型控制层
|
||||
* @author chenruijia
|
||||
* @Date 2024/9/28 11:58
|
||||
* @Description FaultTypeController:故障类型控制层
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/type")
|
||||
@Tag(name = "故障类型",description = "对故障类型的定义")
|
||||
|
@ -58,4 +64,15 @@ public class FaultTypeController {
|
|||
return Result.success(faultTypeService.removeById(faultTypeId));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询类型详细信息
|
||||
* @param faultTypeId
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/typeDetailOne/{faultTypeId}",method = RequestMethod.POST)
|
||||
public Result<List<FaultType>> typeDetailOne(@PathVariable Long faultTypeId){
|
||||
return Result.success(faultTypeService.typeDatailOne(faultTypeId));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -10,7 +10,12 @@ import org.springframework.web.bind.annotation.*;
|
|||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 故障的规则控制层
|
||||
* @author chenruijia
|
||||
* @Date 2024/9/28 11:58
|
||||
* @Description FaultrRuleController:故障的规则控制层
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/rule")
|
||||
@Tag(name = "故障的规则",description = "对故障数据规则的判断")
|
||||
|
|
|
@ -1,31 +0,0 @@
|
|||
package com.muyu.enterprise.controller;
|
||||
|
||||
import com.muyu.enterprise.service.SysCarCompanyService;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.web.controller.BaseController;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* 参数配置 信息操作处理
|
||||
*
|
||||
* @author muyu
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/company")
|
||||
@Tag(name = "SysCarCompanyController", description = "系统参数配置")
|
||||
public class SysCarCompanyController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private SysCarCompanyService sysCarCompanyService;
|
||||
|
||||
/**
|
||||
* 查询企业表
|
||||
*/
|
||||
@PostMapping("selectCompany")
|
||||
public Result selectCompany(){
|
||||
return Result.success(sysCarCompanyService.list());
|
||||
}
|
||||
|
||||
}
|
|
@ -20,6 +20,12 @@ import java.util.Arrays;
|
|||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
/**
|
||||
* 故障管理控制层
|
||||
* @author chenruijia
|
||||
* @Date 2024/9/28 11:58
|
||||
* @Description SysCarFaultController:故障管理控制层
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/faultInfo")
|
||||
@Tag(name = "故障管理",description = "故障的管理与查看")
|
||||
|
|
|
@ -1,66 +0,0 @@
|
|||
package com.muyu.enterprise.controller;
|
||||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.web.controller.BaseController;
|
||||
import com.muyu.enterprise.domain.CarMessage;
|
||||
import com.muyu.enterprise.service.SysCarMessageService;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/car-message")
|
||||
@Tag(name = "报文",description = "报文模块")
|
||||
public class SysCarMessageController extends BaseController {
|
||||
@Autowired
|
||||
private SysCarMessageService sysCarMessageService;
|
||||
|
||||
/**
|
||||
* 查询所有报文信息
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("selectMessageShow")
|
||||
public List<CarMessage> selectMessageShow(@RequestParam("templateId") Long templateId){
|
||||
return sysCarMessageService.selectMessageShow(templateId);
|
||||
}
|
||||
/**
|
||||
* 通过id查询报文信息
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("selectMessageByMessageId")
|
||||
public CarMessage selectMessageByMessageId(@RequestParam("messageId") Long messageId){
|
||||
return sysCarMessageService.selectMessageByMessageId(messageId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加报文信息
|
||||
* @return carMessage
|
||||
*/
|
||||
@PostMapping("insertMessage")
|
||||
public Result insertMessage(@RequestBody CarMessage carMessage){
|
||||
sysCarMessageService.save(carMessage);
|
||||
return Result.success("添加成功");
|
||||
}
|
||||
/**
|
||||
* 修改报文信息
|
||||
* @return carMessage
|
||||
*/
|
||||
@PostMapping("updataMessage")
|
||||
public Result updataMessage(@RequestBody CarMessage carMessage){
|
||||
sysCarMessageService.updateById(carMessage);
|
||||
return Result.success("修改成功");
|
||||
}
|
||||
/**
|
||||
* 删除报文信息
|
||||
* @return carMessage
|
||||
*/
|
||||
@PostMapping("deleteMessage")
|
||||
public Result deleteMessage(@RequestParam("ids") List<Long> ids){
|
||||
sysCarMessageService.removeBatchByIds(ids);
|
||||
return Result.success("删除成功");
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,85 @@
|
|||
package com.muyu.enterprise.controller.car;
|
||||
|
||||
|
||||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.web.controller.BaseController;
|
||||
import com.muyu.enterprise.domain.car.MessageTemplate;
|
||||
import com.muyu.enterprise.domain.req.car.MessageTemplateAddReq;
|
||||
import com.muyu.enterprise.domain.resp.car.MessageTemplateListResp;
|
||||
import com.muyu.enterprise.service.car.MessageTemplateService;
|
||||
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.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 报文模版控制层
|
||||
* @Author:李庆帅
|
||||
* @Package:com.muyu.car.controller
|
||||
* @Project:cloud-server
|
||||
* @name:MessageTemplateController
|
||||
* @Date:2024/9/26 22:08
|
||||
* @Description: 报文模版控制层
|
||||
*/
|
||||
@Log4j2
|
||||
@RestController
|
||||
@RequestMapping("messageTemplate")
|
||||
@Tag(name = "报文模版控制层", description = "进行报文模版操作")
|
||||
public class MessageTemplateController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private MessageTemplateService messageTemplateService;
|
||||
|
||||
|
||||
/**
|
||||
* 报文模版列表查询
|
||||
* @return 返回结果
|
||||
*/
|
||||
@RequestMapping(value = "/list", method = RequestMethod.POST)
|
||||
@Operation(summary = "报文模版列表查询", description = "报文模版列表查询")
|
||||
public Result<List<MessageTemplateListResp>> findAll() {
|
||||
List<MessageTemplate> list = messageTemplateService.list();
|
||||
List<MessageTemplateListResp> messageTemplateListRespList = list.stream()
|
||||
.map(template -> MessageTemplateListResp.messageTemplateBuild(
|
||||
template
|
||||
)
|
||||
)
|
||||
.toList();
|
||||
return Result.success(messageTemplateListRespList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增添加报文模版
|
||||
* @param messageTemplateAddReq 请求对象
|
||||
* @return 返回结果
|
||||
*/
|
||||
@Transactional
|
||||
@PostMapping("/")
|
||||
@Operation(summary = "新增添加报文模版", description = "新增添加报文模版")
|
||||
public Result<String> save(@RequestBody MessageTemplateAddReq messageTemplateAddReq) {
|
||||
messageTemplateService.save(MessageTemplate.addBuild(messageTemplateAddReq));
|
||||
return Result.success("添加成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除报文模版
|
||||
* @param messageTemplateId 请求对象
|
||||
* @return 返回结果
|
||||
*/
|
||||
@Transactional
|
||||
@DeleteMapping("/{messageTemplateId}")
|
||||
@Operation(summary = "删除报文模版", description = "删除报文模版")
|
||||
public Result<String> delete(@PathVariable("messageTemplateId") Long messageTemplateId) {
|
||||
messageTemplateService.removeById(messageTemplateId);
|
||||
return Result.success("删除成功");
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,121 @@
|
|||
package com.muyu.enterprise.controller.car;
|
||||
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.web.controller.BaseController;
|
||||
import com.muyu.enterprise.domain.car.MessageValue;
|
||||
import com.muyu.enterprise.domain.req.car.MessageValueAddReq;
|
||||
import com.muyu.enterprise.domain.req.car.MessageValueReq;
|
||||
import com.muyu.enterprise.domain.resp.car.MessageValueListResp;
|
||||
import com.muyu.enterprise.service.car.MessageValueService;
|
||||
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.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 报文数据控制层
|
||||
* @Author:李庆帅
|
||||
* @Package:com.muyu.car.controller
|
||||
* @Project:cloud-server
|
||||
* @name:MessageValueController
|
||||
* @Date:2024/9/26 22:11
|
||||
* @Description: 报文数据控制层
|
||||
*/
|
||||
@Log4j2
|
||||
@RestController
|
||||
@RequestMapping("/messageValue")
|
||||
@Tag(name = "报文数据控制层", description = "进行报文数据操作")
|
||||
public class MessageValueController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private MessageValueService messageValueService;
|
||||
|
||||
/**
|
||||
* 报文数据列表查询
|
||||
* @param messageValueReq 请求对象
|
||||
* @return 返回结果
|
||||
*/
|
||||
@RequestMapping(value = "/list", method = RequestMethod.POST)
|
||||
@Operation(summary = "报文数据列表", description = "根据报文类别, 报文模版筛选报文数据")
|
||||
public Result<List<MessageValueListResp>> findAll(@RequestBody MessageValueReq messageValueReq) {
|
||||
List<MessageValueListResp> list = messageValueService.findAll(messageValueReq);
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 提供预警和故障使用
|
||||
* @return 返回结果
|
||||
*/
|
||||
@GetMapping("/allList")
|
||||
@Operation(summary = "报文数据下拉框", description = "全部报文数据下拉框")
|
||||
public Result<List<MessageValueListResp>> findAllList() {
|
||||
List<MessageValueListResp> list = messageValueService.list().stream().map(
|
||||
value -> MessageValueListResp.valueBuild(
|
||||
value
|
||||
)
|
||||
).toList();
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增添加报文数据
|
||||
* @param messageValueAddReq 请求对象
|
||||
* @return 返回结果
|
||||
*/
|
||||
@Transactional
|
||||
@PostMapping("/add")
|
||||
@Operation(summary = "添加报文数据", description = "新增报文数据")
|
||||
public Result<String> save(@RequestBody MessageValueAddReq messageValueAddReq) {
|
||||
messageValueService.save(MessageValue.addBuild(messageValueAddReq));
|
||||
return Result.success("添加成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过报文id删除数据
|
||||
* @param messageId 请求对象
|
||||
* @return 返回结果
|
||||
*/
|
||||
@DeleteMapping("/{messageId}")
|
||||
@Operation(summary = "删除报文数据", description = "删除报文数据")
|
||||
public Result<String> delete(@PathVariable Long messageId) {
|
||||
messageValueService.removeById(messageId);
|
||||
return Result.success("删除成功");
|
||||
}
|
||||
|
||||
//7E 56 49 4e 31 32 33 34 35 36 37 38 39 31 32 33 34 35 32 33 35 36 37 38 39 31 32 33 34 35 31 31 36 2e 36 36 34 30 35 33 30 33 39 2e 35 33 31 37 39 31 30 32 30 30 2e 30 30 35 38 36 37 38 33 37 2e 33 32 34 36 33 35 2e 31 32 33 39 2e 34 39 31 36 38 37 39 38 2e 35 36 50 30 39 30 38 31 39 2e 39 39 39 39 2e 38 36 30 39 39 39 39 39 31 30 30 30 31 33 39 2e 34 36 31 34 2e 36 38 31 31 33 36 39 2e 38 39 31 30 30 2e 30 30 31 30 30 2e 30 30 31 30 30 2e 30 30 31 33 31 34 2e 36 35 33 36 30 2e 35 38 34 2e 35 36 33 2e 32 35 31 30 30 2e 30 30 39 38 2e 32 33 30 33 36 2e 32 36 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 76 7E
|
||||
/**
|
||||
* 报文转换测试
|
||||
* @param testStr 请求参数
|
||||
* @return 返回结果
|
||||
*/
|
||||
@PostMapping("/analysis/{testStr}")
|
||||
@Operation(summary = "测试解析报文", description = "解析报文测试")
|
||||
public Result<JSONObject> analysis(@PathVariable("testStr") String testStr){
|
||||
JSONObject messageValue = messageValueService.analysis(testStr);
|
||||
return Result.success(messageValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据报文模版id查询报文数据
|
||||
* @param templateId 请求对象
|
||||
* @return 返回结果
|
||||
*/
|
||||
@GetMapping("/findByTemplateId/{templateId}")
|
||||
@Operation(summary = "根据报文模版id查询报文数据", description = "根据报文模版id查询报文数据")
|
||||
public Result<List<MessageValueListResp>> findByTemplateId(@PathVariable("templateId") Long templateId){
|
||||
List<MessageValueListResp> list = messageValueService.findByTemplateId(templateId);
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,142 @@
|
|||
package com.muyu.enterprise.controller.car;
|
||||
|
||||
|
||||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.utils.poi.ExcelUtil;
|
||||
import com.muyu.common.core.web.controller.BaseController;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import com.muyu.common.log.annotation.Log;
|
||||
import com.muyu.enterprise.domain.car.Vehicle;
|
||||
import com.muyu.enterprise.domain.req.car.VehicleAddReq;
|
||||
import com.muyu.enterprise.domain.req.car.VehicleManageReq;
|
||||
import com.muyu.enterprise.domain.req.car.VehicleUpdReq;
|
||||
import com.muyu.enterprise.domain.resp.car.VehicleManageResp;
|
||||
import com.muyu.enterprise.service.car.VehicleService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 车辆管理控制层
|
||||
* @Author:李庆帅
|
||||
* @Package:com.muyu.car.controller
|
||||
* @Project:cloud-server
|
||||
* @name:VehicleController
|
||||
* @Date:2024/9/26 22:17
|
||||
* @Description: 车辆管理控制层
|
||||
*/
|
||||
@Log4j2
|
||||
@RestController
|
||||
@RequestMapping("/vehicleManage")
|
||||
@Tag(name = "车辆管理控制层", description = "进行车辆管理操作")
|
||||
public class VehicleController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private VehicleService vehicleService;
|
||||
|
||||
/**
|
||||
* 查询车辆管理列表
|
||||
* @param vehicleManageReq 请求对象
|
||||
* @return 返回结果
|
||||
*/
|
||||
@RequestMapping(path = "/list", method = RequestMethod.POST)
|
||||
@Operation(summary = "车辆管理列表", description = "根据车牌号、VIN码、车辆状态筛选车辆")
|
||||
public Result<TableDataInfo<VehicleManageResp>> getVehicleList(@RequestBody VehicleManageReq vehicleManageReq) {
|
||||
startPage();
|
||||
List<VehicleManageResp> list = vehicleService.getVehicleList(vehicleManageReq);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 车辆录入(添加车辆)
|
||||
* @param vehicleAddReq 请求对象
|
||||
* @return 返回结果
|
||||
*/
|
||||
@PostMapping("/")
|
||||
@Operation(summary = "新增车辆", description = "录入车辆信息")
|
||||
public Result<String> save(@RequestBody VehicleAddReq vehicleAddReq) {
|
||||
vehicleService.save(Vehicle.addBuild(vehicleAddReq));
|
||||
return Result.success("录入成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过车辆id获取车辆信息
|
||||
* @param vehicleId 请求对象
|
||||
* @return 返回结果
|
||||
*/
|
||||
@GetMapping("/{vehicleId}")
|
||||
@Operation(summary = "通过id查询车辆信息", description = "通过id查询车辆信息")
|
||||
public Result<Vehicle> findById(@PathVariable("vehicleId") Long vehicleId) {
|
||||
return Result.success(vehicleService.getById(vehicleId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改车辆信息
|
||||
* @param vehicleId 请求对象
|
||||
* @param vehicleUpdReq 请求对象
|
||||
* @return 返回结果
|
||||
*/
|
||||
@PutMapping("/{vehicleId}")
|
||||
@Operation(summary = "修改车辆信息", description = "修改车辆信息")
|
||||
public Result<String> update(
|
||||
@PathVariable("vehicleId") Long vehicleId,
|
||||
@RequestBody @Validated VehicleUpdReq vehicleUpdReq) {
|
||||
vehicleService.updateById(Vehicle.updBuild(vehicleUpdReq, () -> vehicleId));
|
||||
return Result.success("修改成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过车辆id删除车辆信息
|
||||
* @param vehicleId 请求对象
|
||||
* @return 返回结果
|
||||
*/
|
||||
@DeleteMapping("/{vehicleId}")
|
||||
@Operation(summary = "通过车辆id删除车辆信息", description = "通过车辆id删除车辆信息")
|
||||
public Result<String> delete(@PathVariable("vehicleId") Long vehicleId) {
|
||||
vehicleService.removeById(vehicleId);
|
||||
return Result.success("删除成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除车辆
|
||||
* @param vehicleIds 请求对象
|
||||
* @return 返回结果
|
||||
*/
|
||||
@DeleteMapping("/batchDelete")
|
||||
@Operation(summary = "批量删除车辆")
|
||||
public Result<String> batchDelete(@RequestBody List<Long> vehicleIds) {
|
||||
vehicleService.removeBatchByIds(vehicleIds);
|
||||
return Result.success("批量删除成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出所有车辆数据
|
||||
* @param response 请求对象
|
||||
*/
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response) {
|
||||
List<Vehicle> list = vehicleService.list();
|
||||
ExcelUtil<Vehicle> util = new ExcelUtil<>(Vehicle.class);
|
||||
util.exportExcel(response, list, "车辆数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过车辆vin码查询模板id
|
||||
* @param vehicleVin 请求对象
|
||||
* @return 返回结果
|
||||
*/
|
||||
@GetMapping("/findByVehicleVin/{vehicleVin}")
|
||||
@Operation(description = "通过车辆vin码查询模板id")
|
||||
public Result<Long> findByVehicleVin(@PathVariable("vehicleVin") String vehicleVin) {
|
||||
Long byVehicleVin = vehicleService.findByVehicleVin(vehicleVin);
|
||||
return Result.success(byVehicleVin);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,48 @@
|
|||
package com.muyu.enterprise.controller.car;
|
||||
|
||||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.web.controller.BaseController;
|
||||
import com.muyu.enterprise.domain.car.VehicleType;
|
||||
import com.muyu.enterprise.service.car.VehicleTypeService;
|
||||
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.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 车辆类型控制层
|
||||
* @Author:李庆帅
|
||||
* @Package:com.muyu.car.controller
|
||||
* @Project:cloud-server
|
||||
* @name:VehicleTypeController
|
||||
* @Date:2024/9/26 22:23
|
||||
* @Description: 车辆类型实体类
|
||||
*/
|
||||
@Log4j2
|
||||
@RestController
|
||||
@RequestMapping("/vehicleType")
|
||||
@Tag(name = "车辆类型控制层", description = "车辆类型控制层")
|
||||
public class VehicleTypeController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private VehicleTypeService vehicleTypeService;
|
||||
|
||||
/**
|
||||
* 车辆类型查询
|
||||
* @return 返回结果
|
||||
*/
|
||||
@RequestMapping(path = "/", method = RequestMethod.POST)
|
||||
@Operation(summary = "车辆类型列表",description = "车辆类型列表")
|
||||
public Result<List<VehicleType>> findAll(){
|
||||
return Result.success(vehicleTypeService.list());
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package com.muyu.enterprise.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.enterprise.domain.CarCompany;
|
||||
|
||||
|
||||
/**
|
||||
* 车辆企业--持久层
|
||||
* @ClassName CarCompanyMapper
|
||||
* @Description 车辆企业 Mapper 层
|
||||
* @author MingWei.Zong
|
||||
* @Date 2024/9/28 16:52
|
||||
*/
|
||||
public interface CarCompanyMapper extends BaseMapper<CarCompany> {
|
||||
|
||||
}
|
|
@ -2,19 +2,22 @@ package com.muyu.enterprise.mapper;
|
|||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.enterprise.domain.CarManage;
|
||||
import com.muyu.enterprise.domain.dto.CarDTO;
|
||||
import com.muyu.enterprise.domain.vo.CarVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* @author zmw
|
||||
* @description: 配置mybatis配置
|
||||
* @Date 2023-11-13 上午 10:05
|
||||
* 车辆管理--持久层
|
||||
* @ClassName CarManageMapper
|
||||
* @Description 车辆管理 Mapper 层
|
||||
* @author MingWei.Zong
|
||||
* @Date 2024/9/28 16:52
|
||||
*/
|
||||
public interface SysCarMapper extends BaseMapper<CarVO> {
|
||||
|
||||
public interface CarManageMapper extends BaseMapper<CarManage> {
|
||||
/**
|
||||
* 车辆列表
|
||||
* @param queryWrapper
|
|
@ -4,6 +4,20 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|||
import com.muyu.enterprise.domain.CarMessage;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
/**
|
||||
* 车辆报文--持久层
|
||||
* @ClassName CarMessageMapper
|
||||
* @Description 车辆类型 Mapper 层
|
||||
* @author MingWei.Zong
|
||||
* @Date 2024/9/28 16:52
|
||||
*/
|
||||
@Mapper
|
||||
public interface CarMessageMapper extends BaseMapper<CarMessage> {
|
||||
/**
|
||||
* 查询所有报文信息
|
||||
* @param templateId
|
||||
* @return
|
||||
*/
|
||||
List<CarMessage> selectMessageShow(Long templateId);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
package com.muyu.enterprise.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.enterprise.domain.CarMessageType;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
/**
|
||||
* 报文类型--持久层
|
||||
* @ClassName CarMessageTypeMapper
|
||||
* @Description 报文类型 Mapper 层
|
||||
* @author MingWei.Zong
|
||||
* @Date 2024/9/28 16:52
|
||||
*/
|
||||
@Mapper
|
||||
public interface CarMessageTypeMapper extends BaseMapper<CarMessageType> {
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue