Compare commits
80 Commits
master
...
dev.vehicl
Author | SHA1 | Date |
---|---|---|
|
1f9b832c38 | |
|
80b68c2df7 | |
|
98fa19923d | |
|
5d66ce181f | |
|
576befa0ee | |
|
6f95055a6b | |
|
17245c91b3 | |
|
ff3f1e8ac2 | |
|
147dbe2c99 | |
|
b9529234e9 | |
|
0ed0f872e9 | |
|
7e2ad67a64 | |
|
c67d648a8a | |
|
5203c69a90 | |
|
3ebd1d2c39 | |
|
add31c49fa | |
|
7100bf71bf | |
|
497de4ade9 | |
|
940e41b297 | |
|
514c94b398 | |
|
7e02675028 | |
|
22675757b3 | |
|
6594363a91 | |
|
e2d710fbb6 | |
|
9f01b76182 | |
|
fedc3c4ea7 | |
|
423836afb7 | |
|
cb79600bc0 | |
|
a18ba509d8 | |
|
5979dbea8f | |
|
782f31446b | |
|
47567ff055 | |
|
1378aeeb06 | |
|
51cfc6ab2d | |
|
681c88db28 | |
|
9c059750b6 | |
|
38a096ea72 | |
|
a51f80aa00 | |
|
c8fd288cc4 | |
|
26d3ffda93 | |
|
b70a552b6a | |
|
13bf016452 | |
|
1131fbe0f1 | |
|
2d25fd9a04 | |
|
d054119692 | |
|
af712e3937 | |
|
97ab01bd2a | |
|
40d0dde1f9 | |
|
2c3197fac9 | |
|
e9a19e94e9 | |
|
06815c8552 | |
|
49d6651df2 | |
|
ec676ca227 | |
|
411a454c1b | |
|
b0672dbd60 | |
|
2fc56d44c9 | |
|
0febb2cb21 | |
|
5012e3c895 | |
|
de23d2e383 | |
|
0b297a028f | |
|
f19b18d273 | |
|
aa1d518628 | |
|
c9d25d1ebc | |
|
63cbc37084 | |
|
c123bb91c4 | |
|
4476a8c1ae | |
|
a2f0c48e98 | |
|
94e0bef9ab | |
|
1f7202c496 | |
|
c101b474da | |
|
9d3e62e0c2 | |
|
5cd6840e2a | |
|
82d99ce0f2 | |
|
2ed82cdd80 | |
|
c8cd62c1be | |
|
9f40bbaaf6 | |
|
ecf2c96c80 | |
|
882819a6e0 | |
|
9e6ca8a8ff | |
|
2ad4794e78 |
|
@ -1,7 +1,7 @@
|
||||||
package com.muyu.auth.controller;
|
package com.muyu.auth.controller;
|
||||||
|
|
||||||
import com.muyu.auth.form.LoginBody;
|
import com.muyu.common.system.domain.form.LoginBody;
|
||||||
import com.muyu.auth.form.RegisterBody;
|
import com.muyu.common.system.domain.form.RegisterBody;
|
||||||
import com.muyu.auth.service.SysLoginService;
|
import com.muyu.auth.service.SysLoginService;
|
||||||
import com.muyu.common.core.domain.Result;
|
import com.muyu.common.core.domain.Result;
|
||||||
import com.muyu.common.core.utils.JwtUtils;
|
import com.muyu.common.core.utils.JwtUtils;
|
||||||
|
@ -66,7 +66,7 @@ public class TokenController {
|
||||||
@PostMapping("register")
|
@PostMapping("register")
|
||||||
public Result<?> register (@RequestBody RegisterBody registerBody) {
|
public Result<?> register (@RequestBody RegisterBody registerBody) {
|
||||||
// 用户注册
|
// 用户注册
|
||||||
sysLoginService.register(registerBody.getUsername(), registerBody.getPassword());
|
sysLoginService.register(registerBody);
|
||||||
return Result.success();
|
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;
|
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.CacheConstants;
|
||||||
import com.muyu.common.core.constant.Constants;
|
import com.muyu.common.core.constant.Constants;
|
||||||
import com.muyu.common.core.constant.SecurityConstants;
|
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)) {
|
if (StringUtils.isAnyBlank(username, password)) {
|
||||||
throw new ServiceException("用户/密码必须填写");
|
throw new ServiceException("用户/密码必须填写");
|
||||||
|
@ -117,7 +133,7 @@ public class SysLoginService {
|
||||||
sysUser.setUserName(username);
|
sysUser.setUserName(username);
|
||||||
sysUser.setNickName(username);
|
sysUser.setNickName(username);
|
||||||
sysUser.setPassword(SecurityUtils.encryptPassword(password));
|
sysUser.setPassword(SecurityUtils.encryptPassword(password));
|
||||||
Result<?> registerResult = remoteUserService.registerUserInfo(sysUser, SecurityConstants.INNER);
|
Result<?> registerResult = remoteUserService.registerUserInfo(registerBody, SecurityConstants.INNER);
|
||||||
|
|
||||||
if (Result.FAIL == registerResult.getCode()) {
|
if (Result.FAIL == registerResult.getCode()) {
|
||||||
throw new ServiceException(registerResult.getMsg());
|
throw new ServiceException(registerResult.getMsg());
|
||||||
|
|
|
@ -7,7 +7,7 @@ nacos:
|
||||||
addr: 106.15.136.7:8848
|
addr: 106.15.136.7:8848
|
||||||
user-name: nacos
|
user-name: nacos
|
||||||
password: nacos
|
password: nacos
|
||||||
namespace: xzr
|
namespace: dev
|
||||||
# Spring
|
# Spring
|
||||||
spring:
|
spring:
|
||||||
application:
|
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
|
* 文件服务的serviceid
|
||||||
*/
|
*/
|
||||||
public static final String FILE_SERVICE = "cloud-file";
|
public static final String FILE_SERVICE = "cloud-file";
|
||||||
|
/**
|
||||||
|
* 企业平台服务的serviceid
|
||||||
|
*/
|
||||||
|
public static final String ENTERPRISE_SERVICE = "cloud-enterprise";
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,65 @@
|
||||||
|
package com.muyu.common.core.handler;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
|
||||||
|
import com.muyu.common.core.context.SecurityContextHolder;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.ibatis.reflection.MetaObject;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
/**
|
||||||
|
* @Author: zi run
|
||||||
|
* @Date 2024/9/26 16:43
|
||||||
|
* @Description 填充公共字段
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
public class MyMetaObjectHandler implements MetaObjectHandler {
|
||||||
|
|
||||||
|
|
||||||
|
public MyMetaObjectHandler () {
|
||||||
|
log.info("元数据填充初始化成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加时触发
|
||||||
|
* @param metaObject 元数据对象
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void insertFill(MetaObject metaObject) {
|
||||||
|
String[] setterNames = metaObject.getSetterNames();
|
||||||
|
Set<String> setterNamesSet = Arrays.stream(setterNames).collect(Collectors.toSet());
|
||||||
|
if (setterNamesSet.contains("createBy")){
|
||||||
|
if (metaObject.getValue("createBy") == null) {
|
||||||
|
this.setFieldValByName("createBy", SecurityContextHolder.getUserName(), metaObject);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (setterNamesSet.contains("createTime")){
|
||||||
|
if (metaObject.getValue("createTime") == null) {
|
||||||
|
this.setFieldValByName("createTime", new Date(), metaObject);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改时触发
|
||||||
|
* @param metaObject 元数据对象
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void updateFill(MetaObject metaObject) {
|
||||||
|
String[] setterNames = metaObject.getSetterNames();
|
||||||
|
Set<String> setterNamesSet = Arrays.stream(setterNames).collect(Collectors.toSet());
|
||||||
|
if (setterNamesSet.contains("updateBy")){
|
||||||
|
if (metaObject.getValue("updateBy") == null) {
|
||||||
|
this.setFieldValByName("updateBy", SecurityContextHolder.getUserName(), metaObject);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (setterNamesSet.contains("updateTime")){
|
||||||
|
if (metaObject.getValue("updateTime") == null) {
|
||||||
|
this.setFieldValByName("updateTime", new Date(), metaObject);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,27 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<parent>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>cloud-common</artifactId>
|
||||||
|
<version>3.6.3</version>
|
||||||
|
</parent>
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
<artifactId>cloud-common-datascope</artifactId>
|
||||||
|
|
||||||
|
<description>
|
||||||
|
cloud-common-datascope权限范围
|
||||||
|
</description>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
|
||||||
|
<!-- MuYu Common Security -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>cloud-common-security</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
</dependencies>
|
||||||
|
</project>
|
|
@ -0,0 +1,28 @@
|
||||||
|
package com.muyu.common.datascope.annotation;
|
||||||
|
|
||||||
|
import java.lang.annotation.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据权限过滤注解
|
||||||
|
*
|
||||||
|
* @author muyu
|
||||||
|
*/
|
||||||
|
@Target(ElementType.METHOD)
|
||||||
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
|
@Documented
|
||||||
|
public @interface DataScope {
|
||||||
|
/**
|
||||||
|
* 部门表的别名
|
||||||
|
*/
|
||||||
|
public String deptAlias () default "";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户表的别名
|
||||||
|
*/
|
||||||
|
public String userAlias () default "";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 权限字符(用于多个角色匹配符合要求的权限)默认根据权限注解@RequiresPermissions获取,多个权限用逗号分隔开来
|
||||||
|
*/
|
||||||
|
public String permission () default "";
|
||||||
|
}
|
|
@ -0,0 +1,149 @@
|
||||||
|
package com.muyu.common.datascope.aspect;
|
||||||
|
|
||||||
|
import com.muyu.common.core.context.SecurityContextHolder;
|
||||||
|
import com.muyu.common.core.text.Convert;
|
||||||
|
import com.muyu.common.core.utils.StringUtils;
|
||||||
|
import com.muyu.common.core.web.domain.BaseEntity;
|
||||||
|
import com.muyu.common.datascope.annotation.DataScope;
|
||||||
|
import com.muyu.common.security.utils.SecurityUtils;
|
||||||
|
import com.muyu.common.system.domain.SysRole;
|
||||||
|
import com.muyu.common.system.domain.SysUser;
|
||||||
|
import com.muyu.common.system.domain.LoginUser;
|
||||||
|
import org.aspectj.lang.JoinPoint;
|
||||||
|
import org.aspectj.lang.annotation.Aspect;
|
||||||
|
import org.aspectj.lang.annotation.Before;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据过滤处理
|
||||||
|
*
|
||||||
|
* @author muyu
|
||||||
|
*/
|
||||||
|
@Aspect
|
||||||
|
@Component
|
||||||
|
public class DataScopeAspect {
|
||||||
|
/**
|
||||||
|
* 全部数据权限
|
||||||
|
*/
|
||||||
|
public static final String DATA_SCOPE_ALL = "1";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自定数据权限
|
||||||
|
*/
|
||||||
|
public static final String DATA_SCOPE_CUSTOM = "2";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部门数据权限
|
||||||
|
*/
|
||||||
|
public static final String DATA_SCOPE_DEPT = "3";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部门及以下数据权限
|
||||||
|
*/
|
||||||
|
public static final String DATA_SCOPE_DEPT_AND_CHILD = "4";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 仅本人数据权限
|
||||||
|
*/
|
||||||
|
public static final String DATA_SCOPE_SELF = "5";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据权限过滤关键字
|
||||||
|
*/
|
||||||
|
public static final String DATA_SCOPE = "dataScope";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据范围过滤
|
||||||
|
*
|
||||||
|
* @param joinPoint 切点
|
||||||
|
* @param user 用户
|
||||||
|
* @param deptAlias 部门别名
|
||||||
|
* @param userAlias 用户别名
|
||||||
|
* @param permission 权限字符
|
||||||
|
*/
|
||||||
|
public static void dataScopeFilter (JoinPoint joinPoint, SysUser user, String deptAlias, String userAlias, String permission) {
|
||||||
|
StringBuilder sqlString = new StringBuilder();
|
||||||
|
List<String> conditions = new ArrayList<String>();
|
||||||
|
|
||||||
|
for (SysRole role : user.getRoles()) {
|
||||||
|
String dataScope = role.getDataScope();
|
||||||
|
if (!DATA_SCOPE_CUSTOM.equals(dataScope) && conditions.contains(dataScope)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotEmpty(permission) && StringUtils.isNotEmpty(role.getPermissions())
|
||||||
|
&& !StringUtils.containsAny(role.getPermissions(), Convert.toStrArray(permission))) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (DATA_SCOPE_ALL.equals(dataScope)) {
|
||||||
|
sqlString = new StringBuilder();
|
||||||
|
conditions.add(dataScope);
|
||||||
|
break;
|
||||||
|
} else if (DATA_SCOPE_CUSTOM.equals(dataScope)) {
|
||||||
|
sqlString.append(StringUtils.format(
|
||||||
|
" OR {}.dept_id IN ( SELECT dept_id FROM sys_role_dept WHERE role_id = {} ) ", deptAlias,
|
||||||
|
role.getRoleId()));
|
||||||
|
} else if (DATA_SCOPE_DEPT.equals(dataScope)) {
|
||||||
|
sqlString.append(StringUtils.format(" OR {}.dept_id = {} ", deptAlias, user.getDeptId()));
|
||||||
|
} else if (DATA_SCOPE_DEPT_AND_CHILD.equals(dataScope)) {
|
||||||
|
sqlString.append(StringUtils.format(
|
||||||
|
" OR {}.dept_id IN ( SELECT dept_id FROM sys_dept WHERE dept_id = {} or find_in_set( {} , ancestors ) )",
|
||||||
|
deptAlias, user.getDeptId(), user.getDeptId()));
|
||||||
|
} else if (DATA_SCOPE_SELF.equals(dataScope)) {
|
||||||
|
if (StringUtils.isNotBlank(userAlias)) {
|
||||||
|
sqlString.append(StringUtils.format(" OR {}.user_id = {} ", userAlias, user.getUserId()));
|
||||||
|
} else {
|
||||||
|
// 数据权限为仅本人且没有userAlias别名不查询任何数据
|
||||||
|
sqlString.append(StringUtils.format(" OR {}.dept_id = 0 ", deptAlias));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
conditions.add(dataScope);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 多角色情况下,所有角色都不包含传递过来的权限字符,这个时候sqlString也会为空,所以要限制一下,不查询任何数据
|
||||||
|
if (StringUtils.isEmpty(conditions)) {
|
||||||
|
sqlString.append(StringUtils.format(" OR {}.dept_id = 0 ", deptAlias));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (StringUtils.isNotBlank(sqlString.toString())) {
|
||||||
|
Object params = joinPoint.getArgs()[0];
|
||||||
|
if (StringUtils.isNotNull(params) && params instanceof BaseEntity) {
|
||||||
|
BaseEntity baseEntity = (BaseEntity) params;
|
||||||
|
baseEntity.getParams().put(DATA_SCOPE, " AND (" + sqlString.substring(4) + ")");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Before("@annotation(controllerDataScope)")
|
||||||
|
public void doBefore (JoinPoint point, DataScope controllerDataScope) throws Throwable {
|
||||||
|
clearDataScope(point);
|
||||||
|
handleDataScope(point, controllerDataScope);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void handleDataScope (final JoinPoint joinPoint, DataScope controllerDataScope) {
|
||||||
|
// 获取当前的用户
|
||||||
|
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||||
|
if (StringUtils.isNotNull(loginUser)) {
|
||||||
|
SysUser currentUser = loginUser.getSysUser();
|
||||||
|
// 如果是超级管理员,则不过滤数据
|
||||||
|
if (StringUtils.isNotNull(currentUser) && !currentUser.isAdmin()) {
|
||||||
|
String permission = StringUtils.defaultIfEmpty(controllerDataScope.permission(), SecurityContextHolder.getPermission());
|
||||||
|
dataScopeFilter(joinPoint, currentUser, controllerDataScope.deptAlias(),
|
||||||
|
controllerDataScope.userAlias(), permission);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拼接权限sql前先清空params.dataScope参数防止注入
|
||||||
|
*/
|
||||||
|
private void clearDataScope (final JoinPoint joinPoint) {
|
||||||
|
Object params = joinPoint.getArgs()[0];
|
||||||
|
if (StringUtils.isNotNull(params) && params instanceof BaseEntity) {
|
||||||
|
BaseEntity baseEntity = (BaseEntity) params;
|
||||||
|
baseEntity.getParams().put(DATA_SCOPE, "");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
com.muyu.common.datascope.aspect.DataScopeAspect
|
|
@ -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
|
|
@ -0,0 +1,44 @@
|
||||||
|
package com.muyu.common.rabbit.callback;
|
||||||
|
|
||||||
|
import jakarta.annotation.PostConstruct;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.amqp.rabbit.connection.CorrelationData;
|
||||||
|
import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: zi run
|
||||||
|
* @Date 2024/10/2 9:26
|
||||||
|
* @Description 消息发送到broker确认回调
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
public class ConfirmCallback implements RabbitTemplate.ConfirmCallback {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private RabbitTemplate rabbitTemplate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 初始化
|
||||||
|
*/
|
||||||
|
@PostConstruct
|
||||||
|
public void init() {
|
||||||
|
this.rabbitTemplate.setConfirmCallback(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 回调确认方法(消息发送之后 消息无论发送成功还是失败都会执行这个回调方法)
|
||||||
|
* @param correlationData 回调的相关数据
|
||||||
|
* @param ack 确认结果(true表示消息已经被broker接收,false表示消息未被broker接收)
|
||||||
|
* @param cause 失败原因(当ack为false时,表示拒绝接收消息的原因;当ack为true时,该值为空)
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void confirm(CorrelationData correlationData, boolean ack, String cause) {
|
||||||
|
if (ack) {
|
||||||
|
log.info("消息发送到broker成功!");
|
||||||
|
} else {
|
||||||
|
log.info("消息发送到broker失败,失败原因:{}", cause);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,39 @@
|
||||||
|
package com.muyu.common.rabbit.callback;
|
||||||
|
|
||||||
|
import jakarta.annotation.PostConstruct;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.amqp.core.ReturnedMessage;
|
||||||
|
import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: zi run
|
||||||
|
* @Date 2024/10/2 9:33
|
||||||
|
* @Description 消息发送失败时回调
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
public class ReturnsCallback implements RabbitTemplate.ReturnsCallback {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private RabbitTemplate rabbitTemplate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 初始化
|
||||||
|
*/
|
||||||
|
@PostConstruct
|
||||||
|
public void init() {
|
||||||
|
rabbitTemplate.setReturnsCallback(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 消息发送到队列失败时执行
|
||||||
|
* @param returnedMessage 返回的消息和元数据
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void returnedMessage(ReturnedMessage returnedMessage) {
|
||||||
|
log.info("消息:{}被交换机:{}回退!回退原因:{}", returnedMessage.getMessage().toString(),
|
||||||
|
returnedMessage.getExchange(), returnedMessage.getReplyText());
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,72 @@
|
||||||
|
package com.muyu.common.rabbit.config;
|
||||||
|
|
||||||
|
import org.springframework.amqp.rabbit.connection.CachingConnectionFactory;
|
||||||
|
import org.springframework.amqp.rabbit.connection.ConnectionFactory;
|
||||||
|
import org.springframework.amqp.rabbit.core.RabbitAdmin;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: zi run
|
||||||
|
* @Date 2024/10/2 16:41
|
||||||
|
* @Description RabbitMQ连接和管理功能配置
|
||||||
|
*/
|
||||||
|
@Configuration
|
||||||
|
public class RabbitAdminConfig {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* RabbitMQ服务器的主机地址
|
||||||
|
*/
|
||||||
|
@Value("${spring.rabbitmq.host}")
|
||||||
|
private String host;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* RabbitMQ的用户名
|
||||||
|
*/
|
||||||
|
@Value("${spring.rabbitmq.username}")
|
||||||
|
private String username;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* RabbitMQ的密码
|
||||||
|
*/
|
||||||
|
@Value("${spring.rabbitmq.password}")
|
||||||
|
private String password;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* RabbitMQ的虚拟主机
|
||||||
|
*/
|
||||||
|
@Value("${spring.rabbitmq.virtualhost}")
|
||||||
|
private String virtualhost;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建并初始化RabbitAdmin实例
|
||||||
|
*
|
||||||
|
* @return RabbitAdmin 实例
|
||||||
|
*/
|
||||||
|
@Bean
|
||||||
|
public RabbitAdmin rabbitAdmin() {
|
||||||
|
RabbitAdmin rabbitAdmin = new RabbitAdmin(connectionFactory());
|
||||||
|
rabbitAdmin.setAutoStartup(true);
|
||||||
|
return rabbitAdmin;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建RabbitMQ连接工厂
|
||||||
|
*
|
||||||
|
* @return ConnectionFactory 实例
|
||||||
|
*/
|
||||||
|
@Bean
|
||||||
|
public ConnectionFactory connectionFactory() {
|
||||||
|
CachingConnectionFactory connectionFactory = new CachingConnectionFactory();
|
||||||
|
connectionFactory.setAddresses(host);
|
||||||
|
connectionFactory.setUsername(username);
|
||||||
|
connectionFactory.setPassword(password);
|
||||||
|
connectionFactory.setVirtualHost(virtualhost);
|
||||||
|
|
||||||
|
// 配置发送确认回调时,次配置必须配置,否则即使在RabbitTemplate配置了ConfirmCallback也不会生效
|
||||||
|
connectionFactory.setPublisherConfirmType(CachingConnectionFactory.ConfirmType.CORRELATED);
|
||||||
|
connectionFactory.setPublisherReturns(true);
|
||||||
|
return connectionFactory;
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,28 +1,41 @@
|
||||||
package com.muyu.common.rabbit;
|
package com.muyu.common.rabbit.config;
|
||||||
|
|
||||||
|
import org.springframework.amqp.rabbit.annotation.RabbitListenerConfigurer;
|
||||||
import org.springframework.amqp.rabbit.connection.ConnectionFactory;
|
import org.springframework.amqp.rabbit.connection.ConnectionFactory;
|
||||||
import org.springframework.amqp.rabbit.listener.RabbitListenerEndpointRegistrar;
|
import org.springframework.amqp.rabbit.listener.RabbitListenerEndpointRegistrar;
|
||||||
|
import org.springframework.amqp.support.converter.MessageConverter;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.messaging.converter.MappingJackson2MessageConverter;
|
import org.springframework.messaging.converter.MappingJackson2MessageConverter;
|
||||||
import org.springframework.messaging.handler.annotation.support.DefaultMessageHandlerMethodFactory;
|
import org.springframework.messaging.handler.annotation.support.DefaultMessageHandlerMethodFactory;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: zi run
|
||||||
|
* @Date 2024/10/2 10:06
|
||||||
|
* @Description rabbitMQ的监听器配置
|
||||||
|
*/
|
||||||
@Configuration
|
@Configuration
|
||||||
public class RabbitListenerConfigurer implements org.springframework.amqp.rabbit.annotation.RabbitListenerConfigurer {
|
public class RabbitListenerConfig implements RabbitListenerConfigurer {
|
||||||
|
|
||||||
static {
|
static {
|
||||||
|
// 设置为信任所有类型的反序列化,确保消息能够正确反序列化
|
||||||
System.setProperty("spring.amqp.deserialization.trust.all", "true");
|
System.setProperty("spring.amqp.deserialization.trust.all", "true");
|
||||||
}
|
}
|
||||||
|
|
||||||
//以下配置RabbitMQ消息服务
|
/**
|
||||||
|
* RabbitMQ连接工厂,用于创建连接
|
||||||
|
*/
|
||||||
@Autowired
|
@Autowired
|
||||||
public ConnectionFactory connectionFactory;
|
public ConnectionFactory connectionFactory;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private MessageConverter jsonMessageConverter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 处理器方法工厂
|
* 创建处理器方法工厂的bean
|
||||||
* @return
|
*
|
||||||
|
* @return DefaultMessageHandlerMethodFactory 实例,用于处理消息的转换和方法调用
|
||||||
*/
|
*/
|
||||||
@Bean
|
@Bean
|
||||||
public DefaultMessageHandlerMethodFactory handlerMethodFactory() {
|
public DefaultMessageHandlerMethodFactory handlerMethodFactory() {
|
||||||
|
@ -32,8 +45,14 @@ public class RabbitListenerConfigurer implements org.springframework.amqp.rabbit
|
||||||
return factory;
|
return factory;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 配置RabbitMQ监听器的消息处理方法工厂。
|
||||||
|
*
|
||||||
|
* @param rabbitListenerEndpointRegistrar 实例,用于注册监听器的配置
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void configureRabbitListeners(RabbitListenerEndpointRegistrar rabbitListenerEndpointRegistrar) {
|
public void configureRabbitListeners(RabbitListenerEndpointRegistrar rabbitListenerEndpointRegistrar) {
|
||||||
|
// 注册自定义的消息处理方法工厂
|
||||||
rabbitListenerEndpointRegistrar.setMessageHandlerMethodFactory(handlerMethodFactory());
|
rabbitListenerEndpointRegistrar.setMessageHandlerMethodFactory(handlerMethodFactory());
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,26 @@
|
||||||
|
|
||||||
|
package com.muyu.common.rabbit.config;
|
||||||
|
|
||||||
|
import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter;
|
||||||
|
import org.springframework.amqp.support.converter.MessageConverter;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: zi run
|
||||||
|
* @Date 2024/10/2 9:17
|
||||||
|
* @Description rabbitMQ消息转换器配置
|
||||||
|
*/
|
||||||
|
@Configuration
|
||||||
|
public class RabbitMQMessageConverterConfig {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 消息转换配置
|
||||||
|
*
|
||||||
|
* @return 消息转换器
|
||||||
|
*/
|
||||||
|
@Bean
|
||||||
|
public MessageConverter jsonMessageConverter() {
|
||||||
|
return new Jackson2JsonMessageConverter();
|
||||||
|
}
|
||||||
|
}
|
|
@ -1 +1,3 @@
|
||||||
com.muyu.common.rabbit.RabbitListenerConfigurer
|
com.muyu.common.rabbit.config.RabbitAdminConfig
|
||||||
|
com.muyu.common.rabbit.config.RabbitListenerConfig
|
||||||
|
com.muyu.common.rabbit.config.RabbitMQMessageConverterConfig
|
|
@ -64,7 +64,7 @@ public class ManyDataSource implements ApplicationRunner {
|
||||||
RemoteUserService remoteUserService = SpringUtils.getBean(RemoteUserService.class);
|
RemoteUserService remoteUserService = SpringUtils.getBean(RemoteUserService.class);
|
||||||
Result<List<SysUser>> entListResult = remoteUserService.entList();
|
Result<List<SysUser>> entListResult = remoteUserService.entList();
|
||||||
if (entListResult==null){
|
if (entListResult==null){
|
||||||
throw new SaaSException("saas远调数据源错误");
|
throw new SaaSException("saas远调数据源异常");
|
||||||
}
|
}
|
||||||
List<SysUser> data = entListResult.getData();
|
List<SysUser> data = entListResult.getData();
|
||||||
if (entListResult.getCode() == Result.SUCCESS && data != null){
|
if (entListResult.getCode() == Result.SUCCESS && data != null){
|
||||||
|
|
|
@ -9,7 +9,6 @@ import com.muyu.common.security.utils.SecurityUtils;
|
||||||
import com.muyu.common.system.domain.LoginUser;
|
import com.muyu.common.system.domain.LoginUser;
|
||||||
import org.springframework.web.method.HandlerMethod;
|
import org.springframework.web.method.HandlerMethod;
|
||||||
import org.springframework.web.servlet.AsyncHandlerInterceptor;
|
import org.springframework.web.servlet.AsyncHandlerInterceptor;
|
||||||
|
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
|
|
@ -64,6 +64,11 @@ public class SysDept extends BaseEntity {
|
||||||
*/
|
*/
|
||||||
private String email;
|
private String email;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 企业ID
|
||||||
|
*/
|
||||||
|
private Long entId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 部门状态:0正常,1停用
|
* 部门状态:0正常,1停用
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -0,0 +1,61 @@
|
||||||
|
package com.muyu.common.system.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 lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 企业表
|
||||||
|
* @Author: zi run
|
||||||
|
* @Date 2024/9/25 22:38
|
||||||
|
* @Description 企业表
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@TableName(value = "sys_ent", autoResultMap = true)
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class SysEnt extends BaseEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 企业名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 负责人
|
||||||
|
*/
|
||||||
|
private String leader;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 联系电话
|
||||||
|
*/
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 邮箱
|
||||||
|
*/
|
||||||
|
private String email;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 企业编码
|
||||||
|
*/
|
||||||
|
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.constant.ServiceNameConstants;
|
||||||
import com.muyu.common.core.domain.Result;
|
import com.muyu.common.core.domain.Result;
|
||||||
import com.muyu.common.system.domain.SysUser;
|
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.remote.factory.RemoteUserFallbackFactory;
|
||||||
import com.muyu.common.system.domain.LoginUser;
|
import com.muyu.common.system.domain.LoginUser;
|
||||||
import org.springframework.cloud.openfeign.FeignClient;
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
|
@ -38,7 +39,7 @@ public interface RemoteUserService {
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@PostMapping("/user/register")
|
@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;
|
package com.muyu.common.system.remote.factory;
|
||||||
|
|
||||||
import com.muyu.common.core.domain.Result;
|
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.remote.RemoteUserService;
|
||||||
import com.muyu.common.system.domain.SysUser;
|
import com.muyu.common.system.domain.SysUser;
|
||||||
import com.muyu.common.system.domain.LoginUser;
|
import com.muyu.common.system.domain.LoginUser;
|
||||||
|
@ -30,7 +31,7 @@ public class RemoteUserFallbackFactory implements FallbackFactory<RemoteUserServ
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result<Boolean> registerUserInfo (SysUser sysUser, String source) {
|
public Result<Boolean> registerUserInfo (RegisterBody registerBody, String source) {
|
||||||
return Result.error("注册用户失败:" + throwable.getMessage());
|
return Result.error("注册用户失败:" + throwable.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
<module>cloud-common-system</module>
|
<module>cloud-common-system</module>
|
||||||
<module>cloud-common-xxl</module>
|
<module>cloud-common-xxl</module>
|
||||||
<module>cloud-common-rabbit</module>
|
<module>cloud-common-rabbit</module>
|
||||||
|
<module>cloud-common-kafka</module>
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
<artifactId>cloud-common</artifactId>
|
<artifactId>cloud-common</artifactId>
|
||||||
|
|
|
@ -7,7 +7,7 @@ nacos:
|
||||||
addr: 106.15.136.7:8848
|
addr: 106.15.136.7:8848
|
||||||
user-name: nacos
|
user-name: nacos
|
||||||
password: nacos
|
password: nacos
|
||||||
namespace: xzr
|
namespace: dev
|
||||||
|
|
||||||
# Spring
|
# Spring
|
||||||
spring:
|
spring:
|
||||||
|
@ -60,4 +60,4 @@ spring:
|
||||||
groupId: DEFAULT_GROUP
|
groupId: DEFAULT_GROUP
|
||||||
namespace: ${nacos.namespace}
|
namespace: ${nacos.namespace}
|
||||||
data-type: json
|
data-type: json
|
||||||
rule-type: gw-flow
|
rule-type: gw-flow
|
||||||
|
|
|
@ -1,23 +0,0 @@
|
||||||
package com.muyu;
|
|
||||||
|
|
||||||
import com.alibaba.druid.spring.boot3.autoconfigure.DruidDataSourceAutoConfigure;
|
|
||||||
import com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DynamicDataSourceAutoConfiguration;
|
|
||||||
import com.muyu.common.security.annotation.EnableCustomConfig;
|
|
||||||
import com.muyu.common.security.annotation.EnableMyFeignClients;
|
|
||||||
import org.springframework.boot.SpringApplication;
|
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|
||||||
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 系统模块
|
|
||||||
*
|
|
||||||
* @author muyu
|
|
||||||
*/
|
|
||||||
@EnableCustomConfig
|
|
||||||
@EnableMyFeignClients
|
|
||||||
@SpringBootApplication
|
|
||||||
public class CloudCarApplication {
|
|
||||||
public static void main (String[] args) {
|
|
||||||
SpringApplication.run(CloudCarApplication.class, args);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,40 +0,0 @@
|
||||||
package com.muyu.car.controller;
|
|
||||||
|
|
||||||
import cn.hutool.core.util.RandomUtil;
|
|
||||||
import com.muyu.car.domain.dto.CarDTO;
|
|
||||||
import com.muyu.car.domain.vo.CarVO;
|
|
||||||
import com.muyu.car.service.SysCarCompanyService;
|
|
||||||
import com.muyu.car.service.SysCarService;
|
|
||||||
import com.muyu.common.core.domain.Result;
|
|
||||||
import com.muyu.common.core.web.controller.BaseController;
|
|
||||||
import com.muyu.common.core.web.page.TableDataInfo;
|
|
||||||
import com.muyu.common.security.utils.SecurityUtils;
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 参数配置 信息操作处理
|
|
||||||
*
|
|
||||||
* @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());
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,44 +0,0 @@
|
||||||
package com.muyu.car.domain;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
@Builder
|
|
||||||
@TableName(value = "t_car_message")
|
|
||||||
public class CarMessage {
|
|
||||||
/**
|
|
||||||
* 报文表
|
|
||||||
*/
|
|
||||||
@TableId(value = "message_id",type = IdType.AUTO)
|
|
||||||
private Long messageId;
|
|
||||||
/**
|
|
||||||
* 车辆报文类别
|
|
||||||
*/
|
|
||||||
private String messageType;
|
|
||||||
/**
|
|
||||||
* 开始位下标
|
|
||||||
*/
|
|
||||||
private Integer messageStartIndex;
|
|
||||||
/**
|
|
||||||
* 结束位下标
|
|
||||||
*/
|
|
||||||
private Integer messageEndIndex;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 模版id
|
|
||||||
*/
|
|
||||||
private Long templateId;
|
|
||||||
/**
|
|
||||||
* 报文标签
|
|
||||||
*/
|
|
||||||
private String messageLabel;
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,19 +0,0 @@
|
||||||
package com.muyu.car.mapper;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import com.muyu.car.domain.CarCompany;
|
|
||||||
import com.muyu.car.domain.dto.CarDTO;
|
|
||||||
import com.muyu.car.domain.vo.CarVO;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author zmw
|
|
||||||
* @description: 配置mybatis配置
|
|
||||||
* @Date 2023-11-13 上午 10:05
|
|
||||||
*/
|
|
||||||
public interface SysCarCompanyMapper extends BaseMapper<CarCompany> {
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,17 +0,0 @@
|
||||||
package com.muyu.car.mapper;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import com.muyu.car.domain.CarMessage;
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Mapper
|
|
||||||
public interface SysCarMessageMapper extends BaseMapper<CarMessage> {
|
|
||||||
/**
|
|
||||||
* 查询所有报文信息
|
|
||||||
* @param templateId
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
List<CarMessage> selectMessageShow(Long templateId);
|
|
||||||
}
|
|
|
@ -1,17 +0,0 @@
|
||||||
package com.muyu.car.mapper;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import com.muyu.car.domain.CarMessage;
|
|
||||||
import com.muyu.car.domain.CarTemplate;
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Mapper
|
|
||||||
public interface SysCarTemplateMapper extends BaseMapper<CarTemplate> {
|
|
||||||
/**
|
|
||||||
* 查询所有报文信息
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
List<CarTemplate> selectTemplateShow();
|
|
||||||
}
|
|
|
@ -1,22 +0,0 @@
|
||||||
package com.muyu.car.service;
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
|
||||||
import com.muyu.car.domain.CarCompany;
|
|
||||||
import com.muyu.car.domain.dto.CarDTO;
|
|
||||||
import com.muyu.car.domain.vo.CarVO;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author zmw
|
|
||||||
* @description: 配置plus业务层
|
|
||||||
* @Date 2023-11-13 上午 10:06
|
|
||||||
*/
|
|
||||||
public interface SysCarCompanyService extends IService<CarCompany> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询企业表
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
//List<CarCompany> selectCompany();
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,54 +0,0 @@
|
||||||
package com.muyu.car.service;
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
|
||||||
import com.muyu.car.domain.CarCompany;
|
|
||||||
import com.muyu.car.domain.SysCar;
|
|
||||||
import com.muyu.car.domain.dto.CarDTO;
|
|
||||||
import com.muyu.car.domain.vo.CarVO;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author zmw
|
|
||||||
* @description: 配置plus业务层
|
|
||||||
* @Date 2023-11-13 上午 10:06
|
|
||||||
*/
|
|
||||||
public interface SysCarService extends IService<CarVO> {
|
|
||||||
/**
|
|
||||||
* 车辆列表
|
|
||||||
* @param carVO
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
List<CarVO> carList(CarVO carVO);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 车辆添加
|
|
||||||
* @param carVO
|
|
||||||
*/
|
|
||||||
void insertCar(CarVO carVO);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 车辆删除
|
|
||||||
* @param ids
|
|
||||||
*/
|
|
||||||
void deleteCar(List<Long> ids);
|
|
||||||
|
|
||||||
// /**
|
|
||||||
// * 车辆修改
|
|
||||||
// * @param carVO
|
|
||||||
// */
|
|
||||||
// void updataCar(CarVO carVO);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 车辆列表2
|
|
||||||
* @param carDTO
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
List<CarVO> CarListShow(CarDTO carDTO);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过id查询
|
|
||||||
* @param carId
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
List<CarVO> CarListShowByCarId(Long carId);
|
|
||||||
}
|
|
|
@ -1,30 +0,0 @@
|
||||||
package com.muyu.car.service.impl;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
import com.muyu.car.domain.CarCompany;
|
|
||||||
import com.muyu.car.mapper.SysCarCompanyMapper;
|
|
||||||
import com.muyu.car.service.SysCarCompanyService;
|
|
||||||
import com.muyu.common.redis.service.RedisService;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author zmw
|
|
||||||
* @description: 配置plus业务实现层
|
|
||||||
* @Date 2023-11-13 上午 10:06
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class SysCarCompanyServiceImpl extends ServiceImpl<SysCarCompanyMapper, CarCompany>
|
|
||||||
implements SysCarCompanyService {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private RedisService redisService;
|
|
||||||
@Autowired
|
|
||||||
private SysCarCompanyMapper sysCarCompanyMapper;
|
|
||||||
|
|
||||||
|
|
||||||
// @Override
|
|
||||||
// public List<CarCompany> selectCompany() {
|
|
||||||
// return sysCarCompanyMapper.;
|
|
||||||
// }
|
|
||||||
}
|
|
|
@ -1,128 +0,0 @@
|
||||||
package com.muyu.car.service.impl;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
import com.muyu.car.domain.CarCompany;
|
|
||||||
import com.muyu.car.domain.SysCar;
|
|
||||||
import com.muyu.car.domain.dto.CarDTO;
|
|
||||||
import com.muyu.car.domain.vo.CarVO;
|
|
||||||
import com.muyu.car.mapper.SysCarMapper;
|
|
||||||
import com.muyu.car.service.SysCarService;
|
|
||||||
import com.muyu.common.redis.service.RedisService;
|
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author zmw
|
|
||||||
* @description: 配置plus业务实现层
|
|
||||||
* @Date 2023-11-13 上午 10:06
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class SysCarServiceImpl extends ServiceImpl<SysCarMapper, CarVO>
|
|
||||||
implements SysCarService {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private RedisService redisService;
|
|
||||||
@Autowired
|
|
||||||
private SysCarMapper carMapper;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 车辆列表
|
|
||||||
* @param carVO
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public List<CarVO> carList(CarVO carVO) {
|
|
||||||
|
|
||||||
// MPJLambdaWrapper<CarVO> queryWrapper = new MPJLambdaWrapper<>();
|
|
||||||
// carMapper.selectJoinList(CarVO.class,
|
|
||||||
// queryWrapper.selectAll(CarVO.class)// 主表查询所有
|
|
||||||
// .select(Type::getTypeName)// 获取附表的字段
|
|
||||||
// .select(Type::getEnergyType)
|
|
||||||
// .select(Type::getGearType)
|
|
||||||
// .leftJoin(Type.class,Type::getTypeId,Car::getTypeId)// 左链接
|
|
||||||
// );
|
|
||||||
// // vin码--精确
|
|
||||||
// if(StringUtils.isNotEmpty(carVO.getCarVin())){
|
|
||||||
// queryWrapper.eq(CarVO::getCarVin,carVO.getCarVin());
|
|
||||||
// }
|
|
||||||
// // 车辆型号
|
|
||||||
// if(StringUtils.isNotEmpty(carVO.getTypeName())){
|
|
||||||
// queryWrapper.like(CarVO::getTypeName,carVO.getTypeName());
|
|
||||||
// }
|
|
||||||
// // 能源类型 1.电动 2.纯油 3.混动
|
|
||||||
// if(carVO.getEnergyType()>0){
|
|
||||||
// queryWrapper.eq(CarVO::getEnergyType,carVO.getEnergyType());
|
|
||||||
// }
|
|
||||||
// // 档的类型 1.手动 2.自动
|
|
||||||
// if(carVO.getGearType()>0){
|
|
||||||
// queryWrapper.eq(CarVO::getGearType,carVO.getGearType());
|
|
||||||
// }
|
|
||||||
// // 自定义列表查询
|
|
||||||
//// @Select("")
|
|
||||||
//// this.list(queryWrapper);
|
|
||||||
// // mybatis列表查询
|
|
||||||
// //return carMapper.carList(queryWrapper);
|
|
||||||
// // 单表的列表查询
|
|
||||||
// this.list(
|
|
||||||
// new LambdaQueryWrapper<CarVO>()
|
|
||||||
// .eq(StringUtils.isNotEmpty(carVO.getCarVin()),CarVO::getCarVin,carVO.getCarVin())
|
|
||||||
// .eq(carVO.getEnergyType()>0,CarVO::getEnergyType,carVO.getEnergyType())
|
|
||||||
// .eq(carVO.getGearType()>0,CarVO::getGearType,carVO.getGearType())
|
|
||||||
// .like(StringUtils.isNotEmpty(carVO.getTypeName()),CarVO::getTypeName,carVO.getTypeName())
|
|
||||||
// );
|
|
||||||
// return this.list(queryWrapper);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 车辆添加
|
|
||||||
* @param carVO
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void insertCar(CarVO carVO) {
|
|
||||||
carMapper.insert(carVO);
|
|
||||||
}
|
|
||||||
|
|
||||||
// /**
|
|
||||||
// * 车辆修改
|
|
||||||
// * @param carVO
|
|
||||||
// */
|
|
||||||
// @Override
|
|
||||||
// public void updataCar(CarVO carVO) {
|
|
||||||
// carMapper.updateById(carVO);
|
|
||||||
// }
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 车辆列表2
|
|
||||||
* @param carDTO
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public List<CarVO> CarListShow(CarDTO carDTO) {
|
|
||||||
return carMapper.CarListShow(carDTO);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过id查询
|
|
||||||
* @param carId
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public List<CarVO> CarListShowByCarId(Long carId) {
|
|
||||||
return carMapper.CarListShowByCarId(carId);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 车辆删除
|
|
||||||
* @param ids
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void deleteCar(List<Long> ids) {
|
|
||||||
carMapper.deleteBatchIds(ids);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -0,0 +1,34 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>cloud-modules-enterprise</artifactId>
|
||||||
|
<version>3.6.3</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>cloud-modules-enterprise-common</artifactId>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<maven.compiler.source>17</maven.compiler.source>
|
||||||
|
<maven.compiler.target>17</maven.compiler.target>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
|
||||||
|
<!-- 公共依赖 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>cloud-common-core</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!--swagger3依赖-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.swagger.core.v3</groupId>
|
||||||
|
<artifactId>swagger-annotations-jakarta</artifactId>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
</project>
|
|
@ -1,18 +1,26 @@
|
||||||
package com.muyu.car.domain;
|
package com.muyu.enterprise.domain;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
/**
|
||||||
|
* 企业表--实体类
|
||||||
|
* @ClassName CarCompany
|
||||||
|
* @Description 企业表
|
||||||
|
* @author MingWei.Zong
|
||||||
|
* @Date 2024/9/28 16:52
|
||||||
|
*/
|
||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@Builder
|
@Builder
|
||||||
@TableName(value = "t_company")
|
@TableName(value = "car_company")
|
||||||
|
@Tag(name = "企业表")
|
||||||
public class CarCompany {
|
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;
|
||||||
|
|
||||||
|
}
|
|
@ -1,23 +1,31 @@
|
||||||
package com.muyu.car.domain;
|
package com.muyu.enterprise.domain;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.muyu.common.core.annotation.Excel;
|
import com.muyu.common.core.annotation.Excel;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
/**
|
||||||
|
* 车辆表--实体类
|
||||||
|
* @ClassName CarManage
|
||||||
|
* @Description 车辆表
|
||||||
|
* @author MingWei.Zong
|
||||||
|
* @Date 2024/9/28 16:52
|
||||||
|
*/
|
||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
|
@Tag(name = "车辆表")
|
||||||
@Builder
|
@Builder
|
||||||
@TableName(value = "t_car")
|
@TableName(value = "car_manage",autoResultMap = true)
|
||||||
public class SysCar {
|
public class CarManage {
|
||||||
/**
|
/**
|
||||||
* 车辆表
|
* 车辆表
|
||||||
*/
|
*/
|
||||||
|
@ -30,7 +38,7 @@ public class SysCar {
|
||||||
/**
|
/**
|
||||||
* 车牌号
|
* 车牌号
|
||||||
*/
|
*/
|
||||||
private String carCoed;
|
private String carCode;
|
||||||
/**
|
/**
|
||||||
* 车牌颜色 1.白色 2.绿色 3.黑色 4.银色 5.红色
|
* 车牌颜色 1.白色 2.绿色 3.黑色 4.银色 5.红色
|
||||||
*/
|
*/
|
||||||
|
@ -40,21 +48,13 @@ public class SysCar {
|
||||||
*/
|
*/
|
||||||
private String carVin;
|
private String carVin;
|
||||||
/**
|
/**
|
||||||
* 车主
|
* 驾驶员
|
||||||
*/
|
*/
|
||||||
private Long userId;
|
private long userId;
|
||||||
/**
|
/**
|
||||||
* 车辆配置
|
* 车辆配置
|
||||||
*/
|
*/
|
||||||
private Long typeId;
|
private long configId;
|
||||||
|
|
||||||
/** 车辆品牌 */
|
|
||||||
@Excel(name = "车辆品牌")
|
|
||||||
private String carBrand;
|
|
||||||
|
|
||||||
/** 车辆型号 */
|
|
||||||
@Excel(name = "车辆型号")
|
|
||||||
private String carModel;
|
|
||||||
/**
|
/**
|
||||||
* 年审日期
|
* 年审日期
|
||||||
*/
|
*/
|
||||||
|
@ -73,7 +73,7 @@ public class SysCar {
|
||||||
/**
|
/**
|
||||||
* 在线状态 1.无信号 2.行驶中 3.已停止
|
* 在线状态 1.无信号 2.行驶中 3.已停止
|
||||||
*/
|
*/
|
||||||
private Integer carStatus;
|
private Integer carStayus;
|
||||||
/**
|
/**
|
||||||
* 创建时间
|
* 创建时间
|
||||||
*/
|
*/
|
||||||
|
@ -83,16 +83,32 @@ public class SysCar {
|
||||||
* 当前档位
|
* 当前档位
|
||||||
*/
|
*/
|
||||||
private Integer carGears;
|
private Integer carGears;
|
||||||
|
/**
|
||||||
|
* 车辆品牌
|
||||||
|
*/
|
||||||
|
private String carModel;
|
||||||
|
/**
|
||||||
|
* 车辆型号
|
||||||
|
*/
|
||||||
|
private String cardDrand;
|
||||||
|
|
||||||
/** 最后一次连线时间 */
|
/** 最后一次连线时间 */
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
@Excel(name = "最后一次连线时间", width = 30, dateFormat = "yyyy-MM-dd")
|
@Excel(name = "最后一次连线时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||||
private Date carLastJoinTime;
|
private Date carLastJoinTime;
|
||||||
|
|
||||||
/** 最后一次离线时间 */
|
/** 最后一次离线时间 */
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
@Excel(name = "最后一次离线时间", width = 30, dateFormat = "yyyy-MM-dd")
|
@Excel(name = "最后一次离线时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||||
private Date carLastOfflineTime;
|
private Date carLastOfflineTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 汽车所属企业id
|
||||||
|
*/
|
||||||
|
private Long companyId;
|
||||||
|
/**
|
||||||
|
* 车辆类型 1.轿车 2.跑车 3.越野 4.客车 5.公交 6.其他
|
||||||
|
*/
|
||||||
|
private Integer carType;
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,5 +1,7 @@
|
||||||
package com.muyu.warn.domain;
|
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.baomidou.mybatisplus.annotation.TableName;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
|
@ -8,22 +10,24 @@ import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* 报文表--实体类
|
||||||
* @ClassName CarMessage
|
* @ClassName CarMessage
|
||||||
* @Description 描述
|
* @Description 报文表
|
||||||
* @Author YiBo.Liu
|
* @author MingWei.Zong
|
||||||
* @Date 2024/9/22 22:24
|
* @Date 2024/9/28 16:52
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@Builder
|
@Builder
|
||||||
@Tag(name = "报文表")
|
@Tag(name = "报文表")
|
||||||
@TableName(value = "t_car_message")
|
@TableName(value = "car_message")
|
||||||
public class CarMessage {
|
public class CarMessage {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 报文表
|
* 报文表
|
||||||
*/
|
*/
|
||||||
|
@TableId(value = "message_id" ,type = IdType.AUTO)
|
||||||
private Long messageId;
|
private Long messageId;
|
||||||
/**
|
/**
|
||||||
* 车辆报文类别
|
* 车辆报文类别
|
|
@ -1,18 +1,26 @@
|
||||||
package com.muyu.car.domain;
|
package com.muyu.enterprise.domain;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
/**
|
||||||
|
* 报文类型表--实体类
|
||||||
|
* @ClassName CarMessageType
|
||||||
|
* @Description 报文类型表
|
||||||
|
* @author MingWei.Zong
|
||||||
|
* @Date 2024/9/28 16:52
|
||||||
|
*/
|
||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@Builder
|
@Builder
|
||||||
@TableName(value = "t_message_type")
|
@TableName(value = "car_message_type")
|
||||||
|
@Tag(name = "报文类型表")
|
||||||
public class CarMessageType {
|
public class CarMessageType {
|
||||||
/**
|
/**
|
||||||
* 报文
|
* 报文
|
|
@ -1,18 +1,26 @@
|
||||||
package com.muyu.car.domain;
|
package com.muyu.enterprise.domain;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
/**
|
||||||
|
* 报文模版表--实体类
|
||||||
|
* @ClassName CarTemplate
|
||||||
|
* @Description 报文模版表
|
||||||
|
* @author MingWei.Zong
|
||||||
|
* @Date 2024/9/28 16:52
|
||||||
|
*/
|
||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@Builder
|
@Builder
|
||||||
@TableName(value = "t_template")
|
@TableName(value = "car_template")
|
||||||
|
@Tag(name = "报文模版表")
|
||||||
public class CarTemplate {
|
public class CarTemplate {
|
||||||
|
|
||||||
/**
|
/**
|
|
@ -1,5 +1,7 @@
|
||||||
package com.muyu.warn.domain;
|
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.baomidou.mybatisplus.annotation.TableName;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
|
@ -8,22 +10,24 @@ import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* 车辆类型表--实体类
|
||||||
* @ClassName CarType
|
* @ClassName CarType
|
||||||
* @Description 描述
|
* @Description 车辆类型表
|
||||||
* @Author YiBo.Liu
|
* @author YiBo.Liu
|
||||||
* @Date 2024/9/22 16:53
|
* @Date 2024/9/28 16:52
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@Builder
|
@Builder
|
||||||
@Tag(name = "车辆类型表")
|
@Tag(name = "车辆类型表")
|
||||||
@TableName(value = "t_car_type")
|
@TableName(value = "car_type")
|
||||||
public class CarType {
|
public class CarType {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 车辆类型id
|
* 车辆类型id
|
||||||
*/
|
*/
|
||||||
|
@TableId(value = "car_type_id",type = IdType.AUTO)
|
||||||
private Integer carTypeId;
|
private Integer carTypeId;
|
||||||
|
|
||||||
/**
|
/**
|
|
@ -0,0 +1,59 @@
|
||||||
|
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.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
|
||||||
|
*/
|
||||||
|
@TableId(value = "fault_log_id", type= IdType.AUTO)
|
||||||
|
@Schema(defaultValue = "日志ID",type = "Long",description = "日志ID")
|
||||||
|
private Long faultLogId;
|
||||||
|
/**
|
||||||
|
* 故障码
|
||||||
|
*/
|
||||||
|
@Schema(defaultValue = "故障码",type = "String",description = "故障码")
|
||||||
|
private String faultLogCodes;
|
||||||
|
/**
|
||||||
|
* 车辆VIN
|
||||||
|
*/
|
||||||
|
@Schema(defaultValue = "车辆VIN",type = "String",description = "车辆VIN")
|
||||||
|
private String faultLogVin;
|
||||||
|
/**
|
||||||
|
* 开始报警时间
|
||||||
|
*/
|
||||||
|
@Schema(defaultValue = "开始报警时间",type = "Date",description = "开始报警时间")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date faultLogStartTime;
|
||||||
|
/**
|
||||||
|
* 结束报警时间
|
||||||
|
*/
|
||||||
|
@Schema(defaultValue = "结束报警时间",type = "Date",description = "结束报警时间")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date faultLogEndTime;
|
||||||
|
}
|
|
@ -0,0 +1,61 @@
|
||||||
|
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 io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
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 FaultMessage:站内信
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@TableName(value = "fault_message",autoResultMap = true)
|
||||||
|
@Tag(name = "站内信")
|
||||||
|
public class FaultMessage {
|
||||||
|
/**
|
||||||
|
* 站内信ID
|
||||||
|
*/
|
||||||
|
@TableId(value = "fault_message_id", type= IdType.AUTO)
|
||||||
|
@Schema(defaultValue = "站内信ID",type = "Long",description = "站内信ID")
|
||||||
|
private Long faultMessageId;
|
||||||
|
/**
|
||||||
|
* 消息发送人
|
||||||
|
*/
|
||||||
|
@Schema(defaultValue = "消息发送人",type = "String",description = "消息发送人")
|
||||||
|
private String faultMessageSendName;
|
||||||
|
/**
|
||||||
|
* 消息接收人
|
||||||
|
*/
|
||||||
|
@Schema(defaultValue = "消息接收人",type = "String",description = "消息发送人")
|
||||||
|
private String faultMessageRemoveName;
|
||||||
|
/**
|
||||||
|
* 消息内容
|
||||||
|
*/
|
||||||
|
@Schema(defaultValue = "消息内容",type = "String",description = "消息内容")
|
||||||
|
private String faultMessageContent;
|
||||||
|
/**
|
||||||
|
* 发送时间
|
||||||
|
*/
|
||||||
|
@Schema(defaultValue = "发送时间",type = "Date",description = "发送时间")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date faultMessageSendTime;
|
||||||
|
/**
|
||||||
|
* 消息状态(1:未读,2:已读)
|
||||||
|
*/
|
||||||
|
@Schema(defaultValue = "消息状态",type = "Integer",description = "消息状态(1:未读,2:已读)")
|
||||||
|
private Integer faultMessageState;
|
||||||
|
}
|
|
@ -1,26 +1,32 @@
|
||||||
package com.muyu.fault.common;
|
package com.muyu.enterprise.domain;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.muyu.common.core.web.domain.BaseEntity;
|
import com.muyu.common.core.web.domain.BaseEntity;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import lombok.experimental.SuperBuilder;
|
import lombok.experimental.SuperBuilder;
|
||||||
|
/**
|
||||||
|
* 故障等级
|
||||||
|
* @Author: chenruijia
|
||||||
|
* @Date 2024/9/28 12.23
|
||||||
|
* @Description FaultSeverity:故障等级
|
||||||
|
*/
|
||||||
@Data
|
@Data
|
||||||
@SuperBuilder
|
@SuperBuilder
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@TableName(value = "fault_severity",autoResultMap = true)
|
@TableName(value = "fault_severity",autoResultMap = true)
|
||||||
|
@Tag(name = "故障等级")
|
||||||
public class FaultSeverity extends BaseEntity {
|
public class FaultSeverity extends BaseEntity {
|
||||||
/**
|
/**
|
||||||
* 等级ID
|
* 等级ID
|
||||||
*/
|
*/
|
||||||
@TableId(value = "id", type= IdType.AUTO)
|
@TableId(value = "fault_severity_id", type= IdType.AUTO)
|
||||||
@Schema(defaultValue = "等级ID",type = "Long",description = "等级ID")
|
@Schema(defaultValue = "等级ID",type = "Long",description = "等级ID")
|
||||||
private Long faultSeverityId;
|
private Long faultSeverityId;
|
||||||
/**
|
/**
|
|
@ -1,24 +1,31 @@
|
||||||
package com.muyu.fault.common;
|
package com.muyu.enterprise.domain;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import lombok.experimental.SuperBuilder;
|
import lombok.experimental.SuperBuilder;
|
||||||
|
/**
|
||||||
|
* 故障类型
|
||||||
|
* @Author: chenruijia
|
||||||
|
* @Date 2024/9/28 12.23
|
||||||
|
* @Description FaultType:故障类型
|
||||||
|
*/
|
||||||
@Data
|
@Data
|
||||||
@SuperBuilder
|
@SuperBuilder
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@TableName(value = "falut_type",autoResultMap = true)
|
@TableName(value = "fault_type",autoResultMap = true)
|
||||||
public class FalutType {
|
@Tag(name = "故障类型")
|
||||||
|
public class FaultType{
|
||||||
/**
|
/**
|
||||||
* 故障类型ID
|
* 故障类型ID
|
||||||
*/
|
*/
|
||||||
@TableId(value = "faultTypeId", type= IdType.AUTO)
|
@TableId(value = "fault_type_id", type= IdType.AUTO)
|
||||||
@Schema(defaultValue = "故障类型ID",type = "Long",description = "故障类型ID")
|
@Schema(defaultValue = "故障类型ID",type = "Long",description = "故障类型ID")
|
||||||
private Long faultTypeId;
|
private Long faultTypeId;
|
||||||
/**
|
/**
|
|
@ -1,36 +1,46 @@
|
||||||
package com.muyu.fault.common;
|
package com.muyu.enterprise.domain;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.muyu.common.core.web.domain.BaseEntity;
|
import com.muyu.common.core.web.domain.BaseEntity;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.AllArgsConstructor;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import lombok.Builder;
|
import lombok.*;
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.SuperBuilder;
|
import lombok.experimental.SuperBuilder;
|
||||||
|
/**
|
||||||
|
* 故障规则
|
||||||
|
* @Author: chenruijia
|
||||||
|
* @Date 2024/9/28 12.23
|
||||||
|
* @Description FaultrRule:故障规则
|
||||||
|
*/
|
||||||
@Data
|
@Data
|
||||||
@SuperBuilder
|
@SuperBuilder
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@TableName(value = "faultr_rule",autoResultMap = true)
|
@TableName(value = "fault_rule",autoResultMap = true)
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Tag(name = "故障规则")
|
||||||
public class FaultrRule extends BaseEntity {
|
public class FaultrRule extends BaseEntity {
|
||||||
/**
|
/**
|
||||||
* 故障规则ID
|
* 故障规则ID
|
||||||
*/
|
*/
|
||||||
@TableId(value = "faultrRuleId", type= IdType.AUTO)
|
@TableId(value = "fault_rule_id", type= IdType.AUTO)
|
||||||
@Schema(defaultValue = "故障规则ID",type = "Long",description = "故障规则ID")
|
@Schema(defaultValue = "故障规则ID",type = "Long",description = "故障规则ID")
|
||||||
private Long faultrRuleId;
|
private Long faultRuleId;
|
||||||
/**
|
/**
|
||||||
* 故障规则名称
|
* 故障规则名称
|
||||||
*/
|
*/
|
||||||
@Schema(defaultValue = "故障规则名称",type = "String",description = "故障规则名称")
|
@Schema(defaultValue = "故障规则名称",type = "String",description = "故障规则名称")
|
||||||
private String faultrRuleName;
|
private String faultRuleName;
|
||||||
|
/**
|
||||||
|
* 故障规则参数
|
||||||
|
*/
|
||||||
|
@Schema(defaultValue = "故障规则参数",type = "String",description = "故障规则参数")
|
||||||
|
private String faultRuleParameter;
|
||||||
/**
|
/**
|
||||||
* 故障规则描述
|
* 故障规则描述
|
||||||
*/
|
*/
|
||||||
@Schema(defaultValue = "故障规则描述",type = "String",description = "故障规则描述")
|
@Schema(defaultValue = "故障规则描述",type = "String",description = "故障规则描述")
|
||||||
private String faultrRuleDescription;
|
private String faultRuleDescription;
|
||||||
}
|
}
|
|
@ -1,21 +1,30 @@
|
||||||
package com.muyu.fault.common;
|
package com.muyu.enterprise.domain;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.muyu.common.core.web.domain.BaseEntity;
|
import com.muyu.common.core.web.domain.BaseEntity;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import lombok.experimental.SuperBuilder;
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 故障表
|
||||||
|
* @Author: chenruijia
|
||||||
|
* @Date 2024/9/28 12.23
|
||||||
|
* @Description SysCarFault:故障表
|
||||||
|
*/
|
||||||
@Data
|
@Data
|
||||||
@SuperBuilder
|
@SuperBuilder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@TableName(value = "sys_car_fault", autoResultMap = true)
|
@TableName(value = "sys_car_fault", autoResultMap = true)
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Tag(name = "故障表")
|
||||||
public class SysCarFault extends BaseEntity {
|
public class SysCarFault extends BaseEntity {
|
||||||
/**
|
/**
|
||||||
* 自增主键
|
* 自增主键
|
||||||
|
@ -29,10 +38,10 @@ public class SysCarFault extends BaseEntity {
|
||||||
@Schema(defaultValue = "车辆故障编码",type = "String",description = "车辆故障编码")
|
@Schema(defaultValue = "车辆故障编码",type = "String",description = "车辆故障编码")
|
||||||
private String faultCode;
|
private String faultCode;
|
||||||
/**
|
/**
|
||||||
* 车辆故障类型
|
* 车辆故障类型ID
|
||||||
*/
|
*/
|
||||||
@Schema(defaultValue = "车辆故障类型",type = "String",description = "车辆故障类型")
|
@Schema(defaultValue = "车辆故障类型ID",type = "Integer",description = "车辆故障类型ID")
|
||||||
private String faultType;
|
private Integer faultTypeId;
|
||||||
/**
|
/**
|
||||||
* 故障VIN编码
|
* 故障VIN编码
|
||||||
*/
|
*/
|
||||||
|
@ -71,6 +80,6 @@ public class SysCarFault extends BaseEntity {
|
||||||
/**
|
/**
|
||||||
* 启用状态(1.待处理 2.处理中 3.已处理 4.忽略)
|
* 启用状态(1.待处理 2.处理中 3.已处理 4.忽略)
|
||||||
*/
|
*/
|
||||||
@Schema(defaultValue = "启用状态",type = "String",description = "启用状态")
|
@Schema(defaultValue = "启用状态",type = "String",description = "启用状态(1.待处理 2.处理中 3.已处理 4.忽略)")
|
||||||
private String state;
|
private String state;
|
||||||
}
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
package com.muyu.warn.domain;
|
package com.muyu.enterprise.domain;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
@ -7,6 +7,7 @@ import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* 描述
|
||||||
* @ClassName Template
|
* @ClassName Template
|
||||||
* @Description 描述
|
* @Description 描述
|
||||||
* @Author YiBo.Liu
|
* @Author YiBo.Liu
|
|
@ -1,4 +1,4 @@
|
||||||
package com.muyu.many.datasource.domain;
|
package com.muyu.enterprise.domain;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
@ -9,6 +9,7 @@ import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* 测试用户实体类
|
||||||
* @Author: zi run
|
* @Author: zi run
|
||||||
* @Date 2024/9/21 0:07
|
* @Date 2024/9/21 0:07
|
||||||
* @Description 测试用户实体类
|
* @Description 测试用户实体类
|
|
@ -1,4 +1,4 @@
|
||||||
package com.muyu.warn.domain;
|
package com.muyu.enterprise.domain;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
|
@ -1,4 +1,4 @@
|
||||||
package com.muyu.warn.domain;
|
package com.muyu.enterprise.domain;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
|
@ -1,4 +1,4 @@
|
||||||
package com.muyu.warn.domain;
|
package com.muyu.enterprise.domain;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
|
@ -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;
|
||||||
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
package com.muyu.car.domain.dto;
|
package com.muyu.enterprise.domain.dto;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
|
@ -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;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -1,9 +1,9 @@
|
||||||
package com.muyu.warn.domain.Resp;
|
package com.muyu.enterprise.domain.resp;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.muyu.common.core.annotation.Excel;
|
import com.muyu.common.core.annotation.Excel;
|
||||||
import com.muyu.warn.domain.WarnRule;
|
import com.muyu.enterprise.domain.WarnRule;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
|
@ -23,7 +23,7 @@ import java.util.List;
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@Builder
|
@Builder
|
||||||
@Tag(name = "策略规则一对多")
|
@Tag(name = "策略规则一对多")
|
||||||
public class StrategyRuleList {
|
public class StrategyRule {
|
||||||
|
|
||||||
|
|
||||||
/** 策略id */
|
/** 策略id */
|
|
@ -1,4 +1,4 @@
|
||||||
package com.muyu.warn.domain.Resp;
|
package com.muyu.enterprise.domain.resp;
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
|
@ -17,7 +17,7 @@ import lombok.NoArgsConstructor;
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@Builder
|
@Builder
|
||||||
@Tag(name = "策略规则双表联查")
|
@Tag(name = "策略规则双表联查")
|
||||||
public class WarnStrategyList {
|
public class WarnStrategy {
|
||||||
|
|
||||||
/** 策略id */
|
/** 策略id */
|
||||||
private Long strategyId;
|
private Long strategyId;
|
|
@ -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";
|
||||||
|
|
||||||
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
package com.muyu.car.domain.vo;
|
package com.muyu.enterprise.domain.vo;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
|
@ -5,11 +5,11 @@
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>com.muyu</groupId>
|
<groupId>com.muyu</groupId>
|
||||||
<artifactId>cloud-modules</artifactId>
|
<artifactId>cloud-modules-enterprise</artifactId>
|
||||||
<version>3.6.3</version>
|
<version>3.6.3</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>cloud-modules-fault</artifactId>
|
<artifactId>cloud-modules-enterprise-server</artifactId>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<maven.compiler.source>17</maven.compiler.source>
|
<maven.compiler.source>17</maven.compiler.source>
|
||||||
|
@ -17,7 +17,17 @@
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
|
<description>
|
||||||
|
cloud-modules-enterprise-server企业平台
|
||||||
|
</description>
|
||||||
|
|
||||||
<dependencies>
|
<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 -->
|
<!-- SpringCloud Alibaba Nacos -->
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@ -72,6 +82,19 @@
|
||||||
<groupId>com.muyu</groupId>
|
<groupId>com.muyu</groupId>
|
||||||
<artifactId>cloud-common-api-doc</artifactId>
|
<artifactId>cloud-common-api-doc</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 企业业务平台 - 公共依赖 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>cloud-modules-enterprise-common</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- MyBatisPlusJoin 依赖包 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.yulichang</groupId>
|
||||||
|
<artifactId>mybatis-plus-join</artifactId>
|
||||||
|
<version>1.4.13</version>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
@ -91,4 +114,4 @@
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
</project>
|
</project>
|
|
@ -0,0 +1,41 @@
|
||||||
|
package com.muyu.enterprise;
|
||||||
|
|
||||||
|
import com.muyu.common.security.annotation.EnableCustomConfig;
|
||||||
|
import com.muyu.common.security.annotation.EnableMyFeignClients;
|
||||||
|
import org.springframework.boot.SpringApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 企业平台微服务启动类
|
||||||
|
*
|
||||||
|
* @author muyu
|
||||||
|
*/
|
||||||
|
@EnableCustomConfig
|
||||||
|
@EnableMyFeignClients
|
||||||
|
@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 //");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue