commit
a399073121
|
@ -12,6 +12,8 @@ out
|
|||
######################################################################
|
||||
# IDE
|
||||
|
||||
|
||||
|
||||
### STS ###
|
||||
.apt_generated
|
||||
.classpath
|
||||
|
@ -26,6 +28,7 @@ logs
|
|||
*.iws
|
||||
*.iml
|
||||
*.ipr
|
||||
*.yml
|
||||
|
||||
### JRebel ###
|
||||
rebel.xml
|
||||
|
|
|
@ -66,7 +66,7 @@ public class TokenController {
|
|||
@PostMapping("register")
|
||||
public Result<?> register (@RequestBody RegisterBody registerBody) {
|
||||
// 用户注册
|
||||
sysLoginService.register(registerBody.getUsername(), registerBody.getPassword());
|
||||
sysLoginService.register(registerBody);
|
||||
return Result.success();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@ package com.muyu.auth.form;
|
|||
* @author muyu
|
||||
*/
|
||||
public class LoginBody {
|
||||
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
|
@ -16,6 +17,8 @@ public class LoginBody {
|
|||
*/
|
||||
private String password;
|
||||
|
||||
|
||||
|
||||
public String getUsername () {
|
||||
return username;
|
||||
}
|
||||
|
|
|
@ -1,10 +1,35 @@
|
|||
package com.muyu.auth.form;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
/**
|
||||
* 用户注册对象
|
||||
*
|
||||
* @author muyu
|
||||
*/
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class RegisterBody extends LoginBody {
|
||||
/**
|
||||
* 公司名称
|
||||
*/
|
||||
private String firmName;
|
||||
|
||||
/**
|
||||
* 邮件地址
|
||||
*/
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
private String phoneNumber;
|
||||
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.muyu.auth.service;
|
||||
|
||||
import com.muyu.auth.form.RegisterBody;
|
||||
import com.muyu.common.core.constant.CacheConstants;
|
||||
import com.muyu.common.core.constant.Constants;
|
||||
import com.muyu.common.core.constant.SecurityConstants;
|
||||
|
@ -12,6 +13,8 @@ import com.muyu.common.core.utils.StringUtils;
|
|||
import com.muyu.common.core.utils.ip.IpUtils;
|
||||
import com.muyu.common.redis.service.RedisService;
|
||||
import com.muyu.common.security.utils.SecurityUtils;
|
||||
import com.muyu.common.system.domain.Firm;
|
||||
import com.muyu.common.system.remote.RemoteFirmService;
|
||||
import com.muyu.common.system.remote.RemoteUserService;
|
||||
import com.muyu.common.system.domain.SysUser;
|
||||
import com.muyu.common.system.domain.LoginUser;
|
||||
|
@ -28,6 +31,9 @@ public class SysLoginService {
|
|||
@Autowired
|
||||
private RemoteUserService remoteUserService;
|
||||
|
||||
@Autowired
|
||||
private RemoteFirmService remoteFirmService;
|
||||
|
||||
@Autowired
|
||||
private SysPasswordService passwordService;
|
||||
|
||||
|
@ -98,31 +104,39 @@ public class SysLoginService {
|
|||
/**
|
||||
* 注册
|
||||
*/
|
||||
public void register (String username, String password) {
|
||||
public void register (RegisterBody registerBody) {
|
||||
// 用户名或密码为空 错误
|
||||
if (StringUtils.isAnyBlank(username, password)) {
|
||||
if (StringUtils.isAnyBlank(registerBody.getUsername(), registerBody.getPassword())) {
|
||||
throw new ServiceException("用户/密码必须填写");
|
||||
}
|
||||
if (username.length() < UserConstants.USERNAME_MIN_LENGTH
|
||||
|| username.length() > UserConstants.USERNAME_MAX_LENGTH) {
|
||||
if (registerBody.getUsername().length() < UserConstants.USERNAME_MIN_LENGTH
|
||||
|| registerBody.getUsername().length() > UserConstants.USERNAME_MAX_LENGTH) {
|
||||
throw new ServiceException("账户长度必须在2到20个字符之间");
|
||||
}
|
||||
if (password.length() < UserConstants.PASSWORD_MIN_LENGTH
|
||||
|| password.length() > UserConstants.PASSWORD_MAX_LENGTH) {
|
||||
if (registerBody.getPassword().length() < UserConstants.PASSWORD_MIN_LENGTH
|
||||
|| registerBody.getPassword().length() > UserConstants.PASSWORD_MAX_LENGTH) {
|
||||
throw new ServiceException("密码长度必须在5到20个字符之间");
|
||||
}
|
||||
String firmName = registerBody.getFirmName();
|
||||
Result<Firm> byFirmName = remoteFirmService.findByFirmName(firmName);
|
||||
Firm data = byFirmName.getData();
|
||||
if (null != data){
|
||||
throw new ServiceException("公司名称已经存在");
|
||||
}
|
||||
|
||||
|
||||
// 注册用户信息
|
||||
SysUser sysUser = new SysUser();
|
||||
sysUser.setUserName(username);
|
||||
sysUser.setNickName(username);
|
||||
sysUser.setPassword(SecurityUtils.encryptPassword(password));
|
||||
sysUser.setUserName(registerBody.getUsername());
|
||||
sysUser.setEmail(registerBody.getEmail());
|
||||
sysUser.setPhonenumber(registerBody.getPhoneNumber());
|
||||
sysUser.setPassword(SecurityUtils.encryptPassword(registerBody.getPassword()));
|
||||
Result<?> registerResult = remoteUserService.registerUserInfo(sysUser, SecurityConstants.INNER);
|
||||
|
||||
if (Result.FAIL == registerResult.getCode()) {
|
||||
throw new ServiceException(registerResult.getMsg());
|
||||
}
|
||||
recordLogService.recordLogininfor(username, Constants.REGISTER, "注册成功");
|
||||
recordLogService.recordLogininfor(registerBody.getUsername(), Constants.REGISTER, "注册成功");
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@ server:
|
|||
|
||||
# nacos线上地址
|
||||
nacos:
|
||||
addr: 159.75.188.178:8848
|
||||
addr: 127.0.0.1:8848
|
||||
user-name: nacos
|
||||
password: nacos
|
||||
namespace: eight
|
||||
|
|
|
@ -16,6 +16,11 @@ public class SecurityConstants {
|
|||
*/
|
||||
public static final String DETAILS_FIRM_ID = "firm_id";
|
||||
|
||||
/**
|
||||
* 部门ID
|
||||
*/
|
||||
public static final String DETAILS_DEPT_ID = "dept_id";
|
||||
|
||||
/**
|
||||
* 用户名字段
|
||||
*/
|
||||
|
@ -51,5 +56,5 @@ public class SecurityConstants {
|
|||
*/
|
||||
public static final String ROLE_PERMISSION = "role_permission";
|
||||
|
||||
public static final String SAAS_KEY = "ent_code";
|
||||
public static final String SAAS_KEY = "ent-code";
|
||||
}
|
||||
|
|
|
@ -151,6 +151,16 @@ public class JwtUtils {
|
|||
return getValue(claims, SecurityConstants.DETAILS_USERNAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据身份信息获取SAAS标识
|
||||
*
|
||||
* @param claims 身份信息
|
||||
* @return SAAS标识
|
||||
*/
|
||||
public static String getSaaSKey(Claims claims) {
|
||||
return getValue(claims, SecurityConstants.SAAS_KEY);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据身份信息获取键值
|
||||
*
|
||||
|
@ -162,4 +172,13 @@ public class JwtUtils {
|
|||
public static String getValue (Claims claims, String key) {
|
||||
return Convert.toStr(claims.get(key), "");
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param claims 身份信息
|
||||
* @return 值
|
||||
*/
|
||||
public static String getDeptId(Claims claims) {
|
||||
return getValue(claims, SecurityConstants.DETAILS_DEPT_ID);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -501,4 +501,5 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils {
|
|||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -20,10 +20,7 @@ import org.springframework.boot.autoconfigure.AutoConfiguration;
|
|||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @Author: DongZeLiang
|
||||
|
@ -66,7 +63,7 @@ public class ManyDataSource implements ApplicationRunner{
|
|||
public DynamicDataSource dynamicDataSource(DruidDataSourceFactory druidDataSourceFactory) {
|
||||
// 企业列表 企业CODE,端口,IP
|
||||
Map<Object, Object> dataSourceMap = new HashMap<>();
|
||||
dataSourceInfoList()
|
||||
Objects.requireNonNull(dataSourceInfoList())
|
||||
.stream()
|
||||
.map(entInfo -> DataSourceInfo.hostAndPortBuild(entInfo.getEntCode(), entInfo.getIp(), entInfo.getPort()))
|
||||
.forEach(dataSourceInfo -> {
|
||||
|
|
|
@ -11,7 +11,7 @@ public class DatasourceContent {
|
|||
|
||||
public final static String USER_NAME = "root";
|
||||
|
||||
public final static String PASSWORD = "root";
|
||||
public final static String PASSWORD = "bwie-8666";
|
||||
|
||||
public final static String IP = "159.75.188.178";
|
||||
|
||||
|
|
|
@ -56,6 +56,7 @@ public class TokenService {
|
|||
claimsMap.put(SecurityConstants.DETAILS_USER_ID, userId);
|
||||
claimsMap.put(SecurityConstants.DETAILS_USERNAME, userName);
|
||||
claimsMap.put(SecurityConstants.SAAS_KEY,loginUser.getSysUser().getDatabaseName());
|
||||
claimsMap.put(SecurityConstants.DETAILS_DEPT_ID,loginUser.getSysUser().getDeptId());
|
||||
|
||||
// 接口返回信息
|
||||
Map<String, Object> rspMap = new HashMap<String, Object>();
|
||||
|
|
|
@ -0,0 +1,35 @@
|
|||
package com.muyu.common.system.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @Author:张腾
|
||||
* @Package:com.muyu.common.system.domain
|
||||
* @Project:cloud-server-8
|
||||
* @name:Firm
|
||||
* @Date:2024/9/25 22:03
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class Firm {
|
||||
|
||||
/**
|
||||
* 公司编号
|
||||
*/
|
||||
private Integer firmId;
|
||||
|
||||
/**
|
||||
* 公司名称
|
||||
*/
|
||||
private String firmName;
|
||||
|
||||
/**
|
||||
* 公司所属数据库
|
||||
*/
|
||||
private String databaseName;
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
package com.muyu.common.system.remote;
|
||||
|
||||
import com.muyu.common.core.constant.ServiceNameConstants;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.system.domain.Firm;
|
||||
import com.muyu.common.system.remote.factory.RemoteFirmFallbackFactory;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
/**
|
||||
* @Author:张腾
|
||||
* @Package:com.muyu.common.system.remote
|
||||
* @Project:cloud-server-8
|
||||
* @name:RemoteFirmService
|
||||
* @Date:2024/9/25 22:21
|
||||
*/
|
||||
@FeignClient(contextId = "remoteFirmService", value = ServiceNameConstants.SYSTEM_SERVICE,fallbackFactory = RemoteFirmFallbackFactory.class)
|
||||
public interface RemoteFirmService {
|
||||
|
||||
@RequestMapping("/firm/findByFirmName/{firmName}")
|
||||
public Result<Firm> findByFirmName(@PathVariable("firmName") String firmName);
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
package com.muyu.common.system.remote.factory;
|
||||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.exception.ServiceException;
|
||||
import com.muyu.common.system.domain.Firm;
|
||||
import com.muyu.common.system.remote.RemoteFirmService;
|
||||
import org.springframework.cloud.openfeign.FallbackFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @Author:张腾
|
||||
* @Package:com.muyu.common.system.remote.factory
|
||||
* @Project:cloud-server-8
|
||||
* @name:RemoteFirmFallbackFactory
|
||||
* @Date:2024/9/25 22:22
|
||||
*/
|
||||
@Component
|
||||
public class RemoteFirmFallbackFactory implements FallbackFactory<RemoteFirmService> {
|
||||
@Override
|
||||
public RemoteFirmService create(Throwable cause) {
|
||||
|
||||
return new RemoteFirmService() {
|
||||
@Override
|
||||
public Result<Firm> findByFirmName(String firmName) {
|
||||
throw new ServiceException(cause.getCause().toString());
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
|
@ -1,3 +1,4 @@
|
|||
com.muyu.common.system.remote.factory.RemoteUserFallbackFactory
|
||||
com.muyu.common.system.remote.factory.RemoteLogFallbackFactory
|
||||
com.muyu.common.system.remote.factory.RemoteFileFallbackFactory
|
||||
com.muyu.common.system.remote.factory.RemoteFirmFallbackFactory
|
||||
|
|
|
@ -0,0 +1,62 @@
|
|||
<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-wechat</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>cloud-common-wechat</name>
|
||||
<url>http://maven.apache.org</url>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<!-- MuYu Common Core-->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-common-core</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.dom4j</groupId>
|
||||
<artifactId>dom4j</artifactId>
|
||||
<version>2.1.3</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 帮助将java对象转换为xml字符串-->
|
||||
<!-- 依赖冲突会导致InaccessibleObjectException异常更新到适用版本-->
|
||||
<dependency>
|
||||
<groupId>com.thoughtworks.xstream</groupId>
|
||||
<artifactId>xstream</artifactId>
|
||||
<version>1.4.20</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.squareup.okhttp3</groupId>
|
||||
<artifactId>okhttp</artifactId>
|
||||
<version>4.9.3</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Alibaba Fastjson -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>fastjson</artifactId>
|
||||
<version>1.2.83</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>3.8.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
|
@ -0,0 +1,23 @@
|
|||
package com.muyu.common.wechat.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author 24415
|
||||
*/
|
||||
@Data
|
||||
public class AccessToken {
|
||||
|
||||
private String access_token;
|
||||
|
||||
private Long expires_in;
|
||||
|
||||
public void setExpiresTime(Long expiresIn) {
|
||||
this.expires_in = System.currentTimeMillis()+expiresIn*1000;
|
||||
}
|
||||
|
||||
public boolean isExpired(Long expiresIn){
|
||||
long now = System.currentTimeMillis();
|
||||
return now>expiresIn;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
package com.muyu.common.wechat.domain;
|
||||
|
||||
import com.thoughtworks.xstream.annotations.XStreamAlias;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @Author:蓬叁
|
||||
* @Package:com.muyu.wxapplication.massage
|
||||
* @Project:WXApplication
|
||||
* @name:Articles
|
||||
* @Date:2024/9/18 下午10:14
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@XStreamAlias("item")
|
||||
public class Articles {
|
||||
// <Articles>
|
||||
// <item>
|
||||
// <Title><![CDATA[title1]]></Title>
|
||||
// <Description><![CDATA[description1]]></Description>
|
||||
// <PicUrl><![CDATA[picurl]]></PicUrl>
|
||||
// <Url><![CDATA[url]]></Url>
|
||||
// </item>
|
||||
// </Articles>
|
||||
|
||||
@XStreamAlias("Title")
|
||||
private String title ;
|
||||
@XStreamAlias("Description")
|
||||
private String description ;
|
||||
@XStreamAlias("PicUrl")
|
||||
private String picUrl ;
|
||||
@XStreamAlias("Url")
|
||||
private String url ;
|
||||
|
||||
}
|
|
@ -0,0 +1,50 @@
|
|||
package com.muyu.common.wechat.domain;
|
||||
|
||||
import com.thoughtworks.xstream.annotations.XStreamAlias;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:蓬叁
|
||||
* @Package:com.muyu.wxapplication.massage
|
||||
* @Project:WXApplication
|
||||
* @name:ImageText
|
||||
* @Date:2024/9/18 下午9:27
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@XStreamAlias("xml")
|
||||
public class NewsMessage {
|
||||
// <ToUserName><![CDATA[toUser]]></ToUserName>
|
||||
// <FromUserName><![CDATA[fromUser]]></FromUserName>
|
||||
// <CreateTime>12345678</CreateTime>
|
||||
// <MsgType><![CDATA[news]]></MsgType>
|
||||
// <ArticleCount>1</ArticleCount>
|
||||
// <Articles>
|
||||
// <item>
|
||||
// <Title><![CDATA[title1]]></Title>
|
||||
// <Description><![CDATA[description1]]></Description>
|
||||
// <PicUrl><![CDATA[picurl]]></PicUrl>
|
||||
// <Url><![CDATA[url]]></Url>
|
||||
// </item>
|
||||
// </Articles>
|
||||
|
||||
@XStreamAlias("ToUserName")
|
||||
private String toUserName ;
|
||||
@XStreamAlias("FromUserName")
|
||||
private String fromUserName ;
|
||||
@XStreamAlias("CreateTime")
|
||||
private long createTime ;
|
||||
@XStreamAlias("MsgType")
|
||||
private String msgType ;
|
||||
@XStreamAlias("ArticleCount")
|
||||
private Integer articleCount ;
|
||||
@XStreamAlias("Articles")
|
||||
private List<Articles> articles ;
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
package com.muyu.common.wechat.domain;
|
||||
|
||||
import com.thoughtworks.xstream.annotations.XStreamAlias;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @Author:蓬叁
|
||||
* @Package:com.muyu.wxapplication.massage
|
||||
* @Project:WXApplication
|
||||
* @name:TextMessage
|
||||
* @Date:2024/9/18 上午11:33
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@XStreamAlias("xml")
|
||||
public class TextMessage {
|
||||
|
||||
//起一个别名 因为我们微信返回信息与java代码格式规范发生冲突
|
||||
//微信格式 ToUserName
|
||||
//JAVA格式 toUserName
|
||||
@XStreamAlias("ToUserName")
|
||||
private String toUserName;
|
||||
@XStreamAlias("FromUserName")
|
||||
private String fromUserName;
|
||||
@XStreamAlias("CreateTime")
|
||||
private long createTime;
|
||||
@XStreamAlias("MsgType")
|
||||
private String msgType;
|
||||
@XStreamAlias("Content")
|
||||
private String content;
|
||||
|
||||
}
|
||||
// <ToUserName><![CDATA[toUser]]></ToUserName>
|
||||
// <FromUserName><![CDATA[fromUser]]></FromUserName>
|
||||
// <CreateTime>12345678</CreateTime>
|
||||
// <MsgType><![CDATA[text]]></MsgType>
|
||||
// <Content><![CDATA[你好]]></Content>
|
|
@ -0,0 +1,38 @@
|
|||
package com.muyu;
|
||||
|
||||
import junit.framework.Test;
|
||||
import junit.framework.TestCase;
|
||||
import junit.framework.TestSuite;
|
||||
|
||||
/**
|
||||
* Unit test for simple App.
|
||||
*/
|
||||
public class AppTest
|
||||
extends TestCase
|
||||
{
|
||||
/**
|
||||
* Create the test case
|
||||
*
|
||||
* @param testName name of the test case
|
||||
*/
|
||||
public AppTest( String testName )
|
||||
{
|
||||
super( testName );
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the suite of tests being tested
|
||||
*/
|
||||
public static Test suite()
|
||||
{
|
||||
return new TestSuite( AppTest.class );
|
||||
}
|
||||
|
||||
/**
|
||||
* Rigourous Test :-)
|
||||
*/
|
||||
public void testApp()
|
||||
{
|
||||
assertTrue( true );
|
||||
}
|
||||
}
|
|
@ -1,32 +0,0 @@
|
|||
<?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-electronic-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>
|
||||
<!-- MuYu Common Core-->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-common-core</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.swagger.core.v3</groupId>
|
||||
<artifactId>swagger-annotations-jakarta</artifactId>
|
||||
<version>2.2.8</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
|
@ -1,83 +0,0 @@
|
|||
package com.muyu.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Author:yang
|
||||
* @Package:com.muyu.domain
|
||||
* @Project:cloud-server-8
|
||||
* @name:CarInformation
|
||||
* @Date:2024/9/22 22:18
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Tag(name = "车辆表")
|
||||
@TableName(value = "car_information",autoResultMap = true)
|
||||
public class CarInformation {
|
||||
|
||||
/**
|
||||
* 车辆ID
|
||||
*/
|
||||
@TableId(value = "car_information_id",type = IdType.AUTO)
|
||||
private Integer carInformationId;
|
||||
/**
|
||||
* 车辆唯一VIN
|
||||
*/
|
||||
// @TableName(value = "car_information_VIN")
|
||||
private String carInformationVin;
|
||||
/**
|
||||
* 车牌号
|
||||
*/
|
||||
private String carInformationLicensePlate;
|
||||
/**
|
||||
* 车辆颜色
|
||||
*/
|
||||
private String carInformationColor;
|
||||
/**
|
||||
* 车辆驾驶员
|
||||
*/
|
||||
private String carInformationDriver;
|
||||
/**
|
||||
* 车辆电子围栏外键ID
|
||||
*/
|
||||
private String carInformationFence;
|
||||
/**
|
||||
* 车检到期日期
|
||||
*/
|
||||
@DateTimeFormat(fallbackPatterns = "yyyy/MM/dd hh:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy/MM/dd hh:mm:ss")
|
||||
private Date carInformationExamineEnddata;
|
||||
/**
|
||||
* 车辆类型外键ID
|
||||
*/
|
||||
private Integer carInformationType;
|
||||
/**
|
||||
* 车辆品牌外键ID
|
||||
*/
|
||||
private Integer carInformationBrand;
|
||||
/**
|
||||
* 是否重点车辆 (0否默认 1是 )
|
||||
*/
|
||||
private Integer carInformationFocus;
|
||||
|
||||
public static CarInformation carInformationBuilder(CarInformation carInformation) {
|
||||
return CarInformation.builder()
|
||||
.carInformationId(carInformation.getCarInformationId())
|
||||
.carInformationLicensePlate(carInformation.getCarInformationLicensePlate())
|
||||
.build();
|
||||
}
|
||||
}
|
|
@ -21,6 +21,7 @@
|
|||
<module>cloud-common-xxl</module>
|
||||
<module>cloud-common-rabbit</module>
|
||||
<module>cloud-common-saas</module>
|
||||
<module>cloud-common-wechat</module>
|
||||
</modules>
|
||||
|
||||
<artifactId>cloud-common</artifactId>
|
||||
|
|
|
@ -66,11 +66,15 @@ public class AuthFilter implements GlobalFilter, Ordered {
|
|||
if (StringUtils.isEmpty(userid) || StringUtils.isEmpty(username)) {
|
||||
return unauthorizedResponse(exchange, "令牌验证失败");
|
||||
}
|
||||
String saaSKey = JwtUtils.getSaaSKey(claims);
|
||||
String deptId = JwtUtils.getDeptId(claims);
|
||||
|
||||
// 设置用户信息到请求
|
||||
addHeader(mutate, SecurityConstants.USER_KEY, userkey);
|
||||
addHeader(mutate, SecurityConstants.DETAILS_USER_ID, userid);
|
||||
addHeader(mutate, SecurityConstants.DETAILS_USERNAME, username);
|
||||
addHeader(mutate, SecurityConstants.SAAS_KEY,saaSKey);
|
||||
addHeader(mutate,SecurityConstants.DETAILS_DEPT_ID,deptId);
|
||||
// 内部请求来源参数清除
|
||||
removeHeader(mutate, SecurityConstants.FROM_SOURCE);
|
||||
return chain.filter(exchange.mutate().request(mutate.build()).build());
|
||||
|
|
|
@ -4,7 +4,7 @@ server:
|
|||
|
||||
# nacos线上地址
|
||||
nacos:
|
||||
addr: 159.75.188.178:8848
|
||||
addr: 127.0.0.1:8848
|
||||
user-name: nacos
|
||||
password: nacos
|
||||
namespace: eight
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
package com.muyu.vehicle;
|
||||
|
||||
import com.muyu.common.security.annotation.EnableMyFeignClients;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
/**
|
||||
* @Author:杨闪闪
|
||||
* @Package:com.muyu.server.integration
|
||||
* @Project:cloud-integration
|
||||
* @name:Integration
|
||||
* @Date:2024/9/17 下午9:56
|
||||
*/
|
||||
@EnableMyFeignClients
|
||||
@SpringBootApplication
|
||||
public class VehicleSimulationApplication {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(VehicleSimulationApplication.class, args);
|
||||
}
|
||||
}
|
|
@ -1,47 +0,0 @@
|
|||
# Tomcat
|
||||
server:
|
||||
port: 9111
|
||||
|
||||
# nacos线上地址
|
||||
nacos:
|
||||
addr: 127.0.0.1:8848
|
||||
user-name: nacos
|
||||
password: nacos
|
||||
namespace: eight
|
||||
|
||||
# Spring
|
||||
spring:
|
||||
application:
|
||||
# 应用名称
|
||||
name: cloud-electronic
|
||||
profiles:
|
||||
# 环境配置
|
||||
active: dev
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: ${nacos.addr}
|
||||
# nacos用户名
|
||||
username: ${nacos.user-name}
|
||||
# nacos密码
|
||||
password: ${nacos.password}
|
||||
# 命名空间
|
||||
namespace: ${nacos.namespace}
|
||||
config:
|
||||
# 服务注册地址
|
||||
server-addr: ${nacos.addr}
|
||||
# nacos用户名
|
||||
username: ${nacos.user-name}
|
||||
# nacos密码
|
||||
password: ${nacos.password}
|
||||
# 命名空间
|
||||
namespace: ${nacos.namespace}
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
shared-configs:
|
||||
# 系统共享配置
|
||||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||
# 系统环境Config共享配置
|
||||
- application-config-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
|
@ -1,15 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.muyu.server.mapper.CarMiddleGroupMapper">
|
||||
|
||||
<select id="selectByIdList" resultType="com.muyu.domain.CarMiddleGroup">
|
||||
select
|
||||
*
|
||||
from
|
||||
car_middle_group
|
||||
where
|
||||
car_fence_id = #{carFenceId};
|
||||
</select>
|
||||
</mapper>
|
|
@ -1,108 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-server</artifactId>
|
||||
<version>3.6.3</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
<groupId>com.muyu.server</groupId>
|
||||
<artifactId>cloud-electronic</artifactId>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>21</maven.compiler.source>
|
||||
<maven.compiler.target>21</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<!-- <dependency> -->
|
||||
<!-- <groupId>com.muyu</groupId> -->
|
||||
<!-- <artifactId>cloud-common-rabbit</artifactId> -->
|
||||
<!-- </dependency> -->
|
||||
<!-- SpringCloud Alibaba Nacos -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
<!-- SpringCloud Alibaba Nacos Config -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||
</dependency>
|
||||
<!-- SpringCloud Alibaba Sentinel -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
|
||||
</dependency>
|
||||
<!-- SpringBoot Actuator -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>
|
||||
<!-- Mysql Connector -->
|
||||
<dependency>
|
||||
<groupId>com.mysql</groupId>
|
||||
<artifactId>mysql-connector-j</artifactId>
|
||||
</dependency>
|
||||
<!-- MuYu Common DataSource -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-common-datasource</artifactId>
|
||||
</dependency>
|
||||
<!-- MuYu Common DataScope -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-common-datascope</artifactId>
|
||||
</dependency>
|
||||
<!-- MuYu Common Log -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-common-log</artifactId>
|
||||
</dependency>
|
||||
<!-- 接口模块 -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-common-api-doc</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-electronic-common</artifactId>
|
||||
<version>3.6.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.pagehelper</groupId>
|
||||
<artifactId>pagehelper</artifactId>
|
||||
<version>6.0.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<finalName>cloud-electronic</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<!-- <!– 加入maven deploy插件,当在deploy时,忽略些model–> -->
|
||||
<!-- <plugin> -->
|
||||
<!-- <groupId>org.apache.maven.plugins</groupId> -->
|
||||
<!-- <artifactId>maven-deploy-plugin</artifactId> -->
|
||||
<!-- <version>3.1.1</version> -->
|
||||
<!-- <configuration> -->
|
||||
<!-- <skip>true</skip> -->
|
||||
<!-- </configuration> -->
|
||||
<!-- </plugin> -->
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
|
@ -1,47 +0,0 @@
|
|||
package com.muyu.server.controller;
|
||||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.domain.CarFenceType;
|
||||
import com.muyu.domain.CarInformation;
|
||||
import com.muyu.server.service.CarInformationService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:yang
|
||||
* @Package:com.muyu.server.controller
|
||||
* @Project:cloud-server-8
|
||||
* @name:CarInformationController
|
||||
* @Date:2024/9/22 22:20
|
||||
*/
|
||||
@RequestMapping("/carInformation")
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@Tag(name = "查询数据",description = "从围栏信息表中查询数据")
|
||||
@Log4j2
|
||||
public class CarInformationController {
|
||||
|
||||
private final CarInformationService carInformationService;
|
||||
|
||||
/**
|
||||
* 查询围栏业务信息
|
||||
*/
|
||||
@PostMapping("/selectCarInformation")
|
||||
@Operation(summary = "查询数据",description = "查询数据")
|
||||
public Result<List<CarInformation>> selectConnect(){
|
||||
List<CarInformation> connects = carInformationService.list()
|
||||
.stream()
|
||||
.map(CarInformation::carInformationBuilder)
|
||||
.toList();
|
||||
return Result.success(
|
||||
connects, "操作成功"
|
||||
);
|
||||
}
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
package com.muyu.server.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.domain.CarInformation;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @Author:yang
|
||||
* @Package:com.muyu.server.mapper
|
||||
* @Project:cloud-server-8
|
||||
* @name:CarInformationMapper
|
||||
* @Date:2024/9/22 22:24
|
||||
*/
|
||||
@Mapper
|
||||
public interface CarInformationMapper extends BaseMapper<CarInformation> {
|
||||
}
|
|
@ -1,14 +0,0 @@
|
|||
package com.muyu.server.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.domain.CarInformation;
|
||||
|
||||
/**
|
||||
* @Author:yang
|
||||
* @Package:com.muyu.server.service
|
||||
* @Project:cloud-server-8
|
||||
* @name:CarInformationService
|
||||
* @Date:2024/9/22 22:22
|
||||
*/
|
||||
public interface CarInformationService extends IService<CarInformation> {
|
||||
}
|
|
@ -1,22 +0,0 @@
|
|||
package com.muyu.server.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.muyu.domain.CarFenceType;
|
||||
import com.muyu.domain.CarInformation;
|
||||
import com.muyu.server.mapper.CarFenceTypeMapper;
|
||||
import com.muyu.server.mapper.CarInformationMapper;
|
||||
import com.muyu.server.service.CarInformationService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @Author:yang
|
||||
* @Package:com.muyu.server.service.impl
|
||||
* @Project:cloud-server-8
|
||||
* @name:CarInformationServiceImpl
|
||||
* @Date:2024/9/22 22:22
|
||||
*/
|
||||
@Service
|
||||
public class CarInformationServiceImpl
|
||||
extends ServiceImpl<CarInformationMapper, CarInformation>
|
||||
implements CarInformationService {
|
||||
}
|
|
@ -1,118 +0,0 @@
|
|||
package com.muyu.server.util;//package com.muyu.server.util;
|
||||
//
|
||||
//import com.alibaba.druid.pool.DruidDataSource;
|
||||
//import com.muyu.common.domain.Connect;
|
||||
//import com.muyu.common.domain.req.ConnectReq;
|
||||
//import lombok.extern.log4j.Log4j2;
|
||||
//import org.springframework.stereotype.Component;
|
||||
//
|
||||
//import java.sql.Connection;
|
||||
//import java.sql.PreparedStatement;
|
||||
//import java.sql.ResultSet;
|
||||
//import java.sql.SQLException;
|
||||
//
|
||||
///**
|
||||
// * @Author:张腾
|
||||
// * @Package:com.muyu.server.util
|
||||
// * @Project:cloud-integration
|
||||
// * @name:BaseDao
|
||||
// * @Date:2024/8/20 21:45
|
||||
// */
|
||||
//@Component
|
||||
//@Log4j2
|
||||
//public class JdbcHelper {
|
||||
//
|
||||
// /**
|
||||
// * 连接池
|
||||
// * @param connect 连接池对象参数 查询结构
|
||||
// * @return 返回结果
|
||||
// */
|
||||
// public static DruidDataSource getConn( Connect connect) {
|
||||
// while (0<connect.getMaxWaitTimes()){
|
||||
// try {
|
||||
// DruidDataSource druidDataSource = new DruidDataSource();
|
||||
// String dcp = connect.getDataConnParam();
|
||||
// druidDataSource.setUrl(new ConnectReq().getUrl()
|
||||
// +connect.getIpAddress()+":"+connect.getPort()+
|
||||
// "/"+connect.getDatabaseName() +
|
||||
// (dcp != null && !dcp.isEmpty()? "?" + dcp : ""));
|
||||
// druidDataSource.setUsername(connect.getUserName());
|
||||
// druidDataSource.setPassword(connect.getPassword());
|
||||
// //"com.mysql.cj.jdbc.Driver"
|
||||
// druidDataSource.setDriverClassName(new ConnectReq().getDRIVER());
|
||||
// druidDataSource.setInitialSize(connect.getInitSize());
|
||||
// druidDataSource.setMaxActive(connect.getMaxNumConn());
|
||||
// druidDataSource.setMaxWait(connect.getMaxWaitTime());
|
||||
//
|
||||
// return druidDataSource;
|
||||
// } catch (Exception e) {
|
||||
// log.error("异常为:{}", String.valueOf(e));
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// return null;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 查询服务器上说有数据库名 连接池
|
||||
// * @return
|
||||
// */
|
||||
// public static DruidDataSource getConnRs(String dataName) {
|
||||
//
|
||||
// try {
|
||||
// DruidDataSource druidDataSource = new DruidDataSource();
|
||||
// druidDataSource.setUrl("jdbc:mysql://21.12.0.10:3306/"+dataName+"?useUnicode=true&characterEncoding" +
|
||||
// "=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8");
|
||||
// druidDataSource.setUsername("root");
|
||||
// druidDataSource.setPassword("Bwie-8666");
|
||||
// druidDataSource.setDriverClassName(new ConnectReq().getDRIVER());
|
||||
//
|
||||
// return druidDataSource;
|
||||
// } catch (Exception e) {
|
||||
// log.error("异常为:{}", String.valueOf(e));
|
||||
//
|
||||
// }
|
||||
//
|
||||
// return null;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 查询服务器上说有数据库中表名 连接池
|
||||
// * @return
|
||||
// */
|
||||
// public static DruidDataSource getDataConnRs(String name) {
|
||||
//
|
||||
// try {
|
||||
// DruidDataSource druidDataSource = new DruidDataSource();
|
||||
// druidDataSource.setUrl("jdbc:mysql://21.12.0.10:3306/"
|
||||
// +name+
|
||||
// "?useUnicode=true&characterEncoding=" +
|
||||
// "utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8");
|
||||
// druidDataSource.setUsername("root");
|
||||
// druidDataSource.setPassword("Bwie-8666");
|
||||
// druidDataSource.setDriverClassName(new ConnectReq().getDRIVER());
|
||||
//
|
||||
// return druidDataSource;
|
||||
// } catch (Exception e) {
|
||||
// log.error("异常为:{}", String.valueOf(e));
|
||||
//
|
||||
// }
|
||||
//
|
||||
// return null;
|
||||
// }
|
||||
//
|
||||
// public static void close(Connection connection,PreparedStatement preparedStatement,ResultSet resultSet) throws SQLException {
|
||||
//
|
||||
// if (null != connection){
|
||||
// connection.close();
|
||||
// }
|
||||
//
|
||||
// if (null != preparedStatement){
|
||||
// preparedStatement.close();
|
||||
// }
|
||||
//
|
||||
// if (null != resultSet){
|
||||
// resultSet.close();
|
||||
// }
|
||||
// }
|
||||
//}
|
|
@ -1 +0,0 @@
|
|||
|
|
@ -1,2 +0,0 @@
|
|||
Spring Boot Version: ${spring-boot.version}
|
||||
Spring Application Name: ${spring.application.name}
|
|
@ -1,74 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration scan="true" scanPeriod="60 seconds" debug="false">
|
||||
<!-- 日志存放路径 -->
|
||||
<property name="log.path" value="logs/cloud-electronic"/>
|
||||
<!-- 日志输出格式 -->
|
||||
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
|
||||
|
||||
<!-- 控制台输出 -->
|
||||
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- 系统日志输出 -->
|
||||
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/info.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/info.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>INFO</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/error.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/error.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>ERROR</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<!-- 系统模块日志级别控制 -->
|
||||
<logger name="com.muyu" level="info"/>
|
||||
<!-- Spring日志级别控制 -->
|
||||
<logger name="org.springframework" level="warn"/>
|
||||
|
||||
<root level="info">
|
||||
<appender-ref ref="console"/>
|
||||
</root>
|
||||
|
||||
<!--系统操作日志-->
|
||||
<root level="info">
|
||||
<appender-ref ref="file_info"/>
|
||||
<appender-ref ref="file_error"/>
|
||||
</root>
|
||||
</configuration>
|
|
@ -1,81 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration scan="true" scanPeriod="60 seconds" debug="false">
|
||||
<!-- 日志存放路径 -->
|
||||
<property name="log.path" value="logs/cloud-electronic"/>
|
||||
<!-- 日志输出格式 -->
|
||||
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
|
||||
<property name="log.sky.pattern" value="%d{HH:mm:ss.SSS} %yellow([%tid]) [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
|
||||
|
||||
<!-- 控制台输出 -->
|
||||
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>${log.sky.pattern}</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- 系统日志输出 -->
|
||||
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/info.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/info.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>INFO</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/error.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/error.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>ERROR</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<!-- 使用gRpc将日志发送到skywalking服务端 -->
|
||||
<appender name="GRPC_LOG" class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.log.GRPCLogClientAppender">
|
||||
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
|
||||
<layout class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.TraceIdPatternLogbackLayout">
|
||||
<Pattern>${log.sky.pattern}</Pattern>
|
||||
</layout>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- 系统模块日志级别控制 -->
|
||||
<logger name="com.muyu" level="info"/>
|
||||
<!-- Spring日志级别控制 -->
|
||||
<logger name="org.springframework" level="warn"/>
|
||||
|
||||
<root level="info">
|
||||
<appender-ref ref="GRPC_LOG"/>
|
||||
<appender-ref ref="console"/>
|
||||
</root>
|
||||
|
||||
<!--系统操作日志-->
|
||||
<root level="info">
|
||||
<appender-ref ref="file_info"/>
|
||||
<appender-ref ref="file_error"/>
|
||||
</root>
|
||||
</configuration>
|
|
@ -1,81 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration scan="true" scanPeriod="60 seconds" debug="false">
|
||||
<!-- 日志存放路径 -->
|
||||
<property name="log.path" value="logs/cloud-electronic"/>
|
||||
<!-- 日志输出格式 -->
|
||||
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
|
||||
<property name="log.sky.pattern" value="%d{HH:mm:ss.SSS} %yellow([%tid]) [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
|
||||
|
||||
<!-- 控制台输出 -->
|
||||
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>${log.sky.pattern}</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- 系统日志输出 -->
|
||||
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/info.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/info.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>INFO</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/error.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/error.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>ERROR</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<!-- 使用gRpc将日志发送到skywalking服务端 -->
|
||||
<appender name="GRPC_LOG" class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.log.GRPCLogClientAppender">
|
||||
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
|
||||
<layout class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.TraceIdPatternLogbackLayout">
|
||||
<Pattern>${log.sky.pattern}</Pattern>
|
||||
</layout>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- 系统模块日志级别控制 -->
|
||||
<logger name="com.muyu" level="info"/>
|
||||
<!-- Spring日志级别控制 -->
|
||||
<logger name="org.springframework" level="warn"/>
|
||||
|
||||
<root level="info">
|
||||
<appender-ref ref="GRPC_LOG"/>
|
||||
<appender-ref ref="console"/>
|
||||
</root>
|
||||
|
||||
<!--系统操作日志-->
|
||||
<root level="info">
|
||||
<appender-ref ref="file_info"/>
|
||||
<appender-ref ref="file_error"/>
|
||||
</root>
|
||||
</configuration>
|
|
@ -1,15 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.muyu.server.mapper.CarMiddleGroupMapper">
|
||||
|
||||
<select id="selectByIdList" resultType="com.muyu.domain.CarMiddleGroup">
|
||||
select
|
||||
*
|
||||
from
|
||||
car_middle_group
|
||||
where
|
||||
car_fence_id = #{carFenceId};
|
||||
</select>
|
||||
</mapper>
|
|
@ -9,14 +9,13 @@
|
|||
<version>3.6.3</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>cloud-test</artifactId>
|
||||
<artifactId>cloud-modules-carData</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>
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos -->
|
||||
|
@ -72,5 +71,26 @@
|
|||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-common-api-doc</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-common-core</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.github.ben-manes.caffeine</groupId>
|
||||
<artifactId>caffeine</artifactId>
|
||||
<version>2.9.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.kafka</groupId>
|
||||
<artifactId>kafka-clients</artifactId>
|
||||
<version>3.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.iotdb</groupId>
|
||||
<artifactId>iotdb-session</artifactId>
|
||||
<version>0.13.1</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
|
@ -0,0 +1,25 @@
|
|||
package com.muyu.carData;
|
||||
|
||||
import com.muyu.common.security.annotation.EnableMyFeignClients;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
|
||||
import javax.swing.*;
|
||||
|
||||
/**
|
||||
* @Author:张腾
|
||||
* @Package:com.muyu.carData
|
||||
* @Project:cloud-server-8
|
||||
* @name:CarDataApplication
|
||||
* @Date:2024/9/26 15:33
|
||||
*/
|
||||
@SpringBootApplication
|
||||
@EnableMyFeignClients
|
||||
public class CarDataApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(CarDataApplication.class,args);
|
||||
System.out.println("caused: Handler dispatch failed; nested exception is java.lang.NoSuchMethodError: java.nio.ByteBuffer.flip()Ljava/nio/ByteBuffer;;caused: java.nio.ByteBuffer.flip()Ljava/nio/ByteBuffer;");
|
||||
}
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
package com.muyu.carData.annotation;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
/**
|
||||
* @Author:张腾
|
||||
* @Package:com.muyu.carData.annotation
|
||||
* @Project:cloud-server-8
|
||||
* @name:IoTTableName
|
||||
* @Date:2024/9/27 19:29
|
||||
*/
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target({ElementType.TYPE, ElementType.ANNOTATION_TYPE})
|
||||
public @interface IoTTableName {
|
||||
|
||||
String value() default "";
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
package com.muyu.carData.config.cacheconfig;
|
||||
import com.github.benmanes.caffeine.cache.Expiry;
|
||||
import org.checkerframework.checker.index.qual.NonNegative;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* @Author:张腾
|
||||
* @Package:com.muyu.carData.cacheconfig
|
||||
* @Project:cloud-server-8
|
||||
* @name:CacheExpiry
|
||||
* @Date:2024/9/26 23:46
|
||||
*/
|
||||
public class CacheExpiry implements Expiry<String,ExpiryTime>{
|
||||
@Override
|
||||
public long expireAfterCreate(String key, ExpiryTime value, long currentTime) {
|
||||
return TimeUnit.SECONDS.toNanos(value.getExpiryTime());
|
||||
}
|
||||
|
||||
@Override
|
||||
public long expireAfterUpdate(String key, ExpiryTime value, long currentTime, @NonNegative long currentDuration) {
|
||||
return TimeUnit.SECONDS.toNanos(value.getRefreshTime());
|
||||
}
|
||||
|
||||
@Override
|
||||
public long expireAfterRead(String key, ExpiryTime value, long currentTime, @NonNegative long currentDuration) {
|
||||
return TimeUnit.SECONDS.toNanos(value.getRefreshTime());
|
||||
}
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
package com.muyu.carData.config.cacheconfig;
|
||||
|
||||
import com.github.benmanes.caffeine.cache.Cache;
|
||||
import com.github.benmanes.caffeine.cache.Caffeine;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* @Author:张腾
|
||||
* @Package:com.muyu.carData.cacheconfig
|
||||
* @Project:cloud-server-8
|
||||
* @name:CaffeineConfig
|
||||
* @Date:2024/9/26 23:51
|
||||
*/
|
||||
@Configuration
|
||||
public class CaffeineConfig {
|
||||
|
||||
@Bean
|
||||
public Cache<String, ? extends ExpiryTime> caffeineCache(){
|
||||
CacheExpiry cacheExpiry = new CacheExpiry();
|
||||
return Caffeine.newBuilder()
|
||||
.expireAfter(cacheExpiry)
|
||||
.initialCapacity(128)
|
||||
.build();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
package com.muyu.carData.config.cacheconfig;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
/**
|
||||
* @Author:张腾
|
||||
* @Package:com.muyu.carData.cacheconfig
|
||||
* @Project:cloud-server-8
|
||||
* @name:ExpiryTime
|
||||
* @Date:2024/9/26 23:44
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ExpiryTime {
|
||||
|
||||
/**
|
||||
* 过期时间单位(秒)默认30分钟
|
||||
*/
|
||||
@Builder.Default
|
||||
private long expiryTime = 30 * 60;
|
||||
|
||||
/**
|
||||
* 刷新时间单位(秒) 默认15分钟
|
||||
*/
|
||||
@Builder.Default
|
||||
private long refreshTime = 15 * 60;
|
||||
}
|
|
@ -0,0 +1,76 @@
|
|||
package com.muyu.carData.config.kafkaconfig;
|
||||
|
||||
import org.apache.kafka.clients.consumer.KafkaConsumer;
|
||||
import org.apache.kafka.clients.producer.KafkaProducer;
|
||||
import org.apache.kafka.common.serialization.StringDeserializer;
|
||||
import org.apache.kafka.common.serialization.StringSerializer;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
/**
|
||||
* @Author:张腾
|
||||
* @Package:com.muyu.carData.config.kafkaconfig
|
||||
* @Project:cloud-server-8
|
||||
* @name:KafkaConfig
|
||||
* @Date:2024/9/28 12:19
|
||||
*/
|
||||
@Configuration
|
||||
public class KafkaConfig {
|
||||
|
||||
@Bean
|
||||
public KafkaProducer kafkaProducer(){
|
||||
HashMap<String, Object> configs = new HashMap<>();
|
||||
configs.put("bootstrap.servers","60.204.221.52:9092");
|
||||
configs.put("retries",2);
|
||||
configs.put("batch.size",16384);
|
||||
//生产者可用于缓冲等待发送到服务器的记录的总内存字节数
|
||||
configs.put("buffer-memory",3554432);
|
||||
/**
|
||||
*生产者producer要求leader节点在考虑完成请求之前收到的确认数,用于控制发送记录在服务端的持久化
|
||||
*acks=0,设置为0,则生产者producer将不会等待来自服务器的任何确认.该记录将立即添加到套接字(socket)缓冲区并视为已发送
|
||||
* .在这种情况下,无法保证服务器已收到记录,并且重试配置(retries)将不会生效(因为客户端通常不会知道任何故障),每条记录返回的偏移量始终设置为-1.
|
||||
*acks=1,设置为1,leader节点会把记录写入本地日志,不需要等待所有follower节点完全确认就会立即应答producer.在这种情况下,
|
||||
* 在follower节点复制前,leader节点确认记录后立即失败的话,记录将会丢失.
|
||||
*/
|
||||
configs.put("acks","-1");
|
||||
//指定key使用的序列化类
|
||||
StringSerializer keySerializer = new StringSerializer();
|
||||
//指定value使用的序列化类
|
||||
StringSerializer valueSerializer = new StringSerializer();
|
||||
//创建kafka生产者
|
||||
return new KafkaProducer(configs, keySerializer, valueSerializer);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public KafkaConsumer kafkaConsumer(){
|
||||
HashMap<String, Object> configs = new HashMap<>();
|
||||
configs.put("bootstrap.servers","60.204.221.52:9092");
|
||||
//开启consumer的偏移量(offset)自动提交到kafka
|
||||
configs.put("enable.auto.commit",true);
|
||||
//偏移量自动提交的时间间隔,单位毫秒
|
||||
configs.put("auto.commit.interval",5000);
|
||||
//在Kafka中没有初始化偏移量或者当前偏移量不存在情况
|
||||
//earliest, 在偏移量无效的情况下, 自动重置为最早的偏移量
|
||||
//latest, 在偏移量无效的情况下, 自动重置为最新的偏移量
|
||||
//none, 在偏移量无效的情况下, 抛出异常.
|
||||
configs.put("auto.offset.reset","latest");
|
||||
//请求阻塞的最大时间(毫秒)
|
||||
configs.put("fetch.max.wait",500);
|
||||
//请求应答的最小字节数
|
||||
configs.put("fetch.min.size",1);
|
||||
//心跳间隔时间(毫秒)
|
||||
configs.put("heartbeat-interval",3000);
|
||||
//一次调用poll返回的最大记录条数
|
||||
configs.put("max.poll.records",500);
|
||||
//指定消费组
|
||||
configs.put("group.id","firstGroup");
|
||||
//指定key使用的反序列化类
|
||||
StringDeserializer keyDeserializer = new StringDeserializer();
|
||||
//指定value使用的反序列化类
|
||||
StringDeserializer valueDeserializer = new StringDeserializer();
|
||||
//创建kafka消费者
|
||||
return new KafkaConsumer(configs,keyDeserializer,valueDeserializer);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,86 @@
|
|||
package com.muyu.carData.config.lotdbconfig;
|
||||
|
||||
import org.apache.iotdb.rpc.IoTDBConnectionException;
|
||||
import org.apache.iotdb.session.Session;
|
||||
import org.apache.iotdb.session.pool.SessionPool;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:张腾
|
||||
* @Package:com.muyu.carData.lotdbconfig
|
||||
* @Project:cloud-server-8
|
||||
* @name:IotDBSessionConfig
|
||||
* @Date:2024/9/27 12:25
|
||||
* IotDB线程池
|
||||
*/
|
||||
@Component
|
||||
@Configuration
|
||||
public class IotDBSessionConfig {
|
||||
|
||||
private static Logger logger = LoggerFactory.getLogger(IotDBSessionConfig.class);
|
||||
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
@Value("${spring.iotdb.username}")
|
||||
private String username;
|
||||
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
@Value("${spring.iotdb.password}")
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* ip地址
|
||||
*/
|
||||
@Value("${spring.iotdb.ip}")
|
||||
private String ip;
|
||||
|
||||
/**
|
||||
* 端口号
|
||||
*/
|
||||
@Value("${spring.iotdb.port}")
|
||||
private Integer port;
|
||||
|
||||
/**
|
||||
* 最大连接数
|
||||
*/
|
||||
@Value("${spring.iotdb.maxSize}")
|
||||
private Integer maxSize;
|
||||
|
||||
|
||||
/**
|
||||
* 默认每次查询的条数
|
||||
*/
|
||||
@Value("${spring.iotdb.fetchSize}")
|
||||
private int fetchSize;
|
||||
|
||||
|
||||
@Bean
|
||||
public Session iotSession(){
|
||||
Session session = new Session(ip, port, username, password);
|
||||
try {
|
||||
session.open();
|
||||
} catch (IoTDBConnectionException e) {
|
||||
logger.error(String.valueOf(e.getCause()));
|
||||
}
|
||||
return session;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
package com.muyu.carData.constract;
|
||||
|
||||
/**
|
||||
* @Author:张腾
|
||||
* @Package:com.muyu.carData.constract
|
||||
* @Project:cloud-server-8
|
||||
* @name:IoTDBTableParam
|
||||
* @Date:2024/9/27 20:02
|
||||
*/
|
||||
public class IoTDBTableParam {
|
||||
|
||||
public static final String SYSLOG_IOT_TABLE = "student";
|
||||
}
|
|
@ -0,0 +1,55 @@
|
|||
package com.muyu.carData.consumer;
|
||||
|
||||
import cn.hutool.core.thread.ThreadUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.alibaba.nacos.shaded.com.google.common.collect.Lists;
|
||||
import com.muyu.carData.pojo.Student;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.apache.kafka.clients.consumer.ConsumerRecord;
|
||||
import org.apache.kafka.clients.consumer.ConsumerRecords;
|
||||
import org.apache.kafka.clients.consumer.KafkaConsumer;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.time.Duration;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* @Author:张腾
|
||||
* @Package:com.muyu.carData.consumer
|
||||
* @Project:cloud-server-8
|
||||
* @name:MyKafkaConsumer
|
||||
* @Date:2024/9/26 15:42
|
||||
*/
|
||||
@Component
|
||||
@Log4j2
|
||||
public class MyKafkaConsumer implements InitializingBean {
|
||||
|
||||
@Autowired
|
||||
private KafkaConsumer kafkaConsumer;
|
||||
|
||||
private final String topicName = "test";
|
||||
|
||||
@Override
|
||||
public void afterPropertiesSet() throws Exception {
|
||||
log.info("启动线程开始监听topic:{}",topicName);
|
||||
Thread thread = new Thread(() -> {
|
||||
ThreadUtil.sleep(1000);
|
||||
Collection<String> topics = Lists.newArrayList(topicName);
|
||||
kafkaConsumer.subscribe(topics);
|
||||
while (true){
|
||||
ConsumerRecords<String,String> consumerRecords = kafkaConsumer.poll(Duration.ofMillis(1000));
|
||||
for (ConsumerRecord<String, String> consumerRecord : consumerRecords) {
|
||||
//从consumerRecord中获取消费数据
|
||||
String value = consumerRecord.value();
|
||||
log.info("从Kafka中消费的原始数据:{}",value);
|
||||
//转换为java对象
|
||||
Student stu = JSONUtil.toBean(value, Student.class);
|
||||
log.info("消费数据转换为Java对象:{}",stu);
|
||||
}
|
||||
}
|
||||
});
|
||||
thread.start();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,47 @@
|
|||
package com.muyu.carData.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:张腾
|
||||
* @Package:com.muyu.carData.domain
|
||||
* @Project:cloud-server-8
|
||||
* @name:IoTDBRecord
|
||||
* @Date:2024/9/27 19:25
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class IoTDBRecord {
|
||||
|
||||
/**
|
||||
* 节点路径
|
||||
*/
|
||||
private String deviceId;
|
||||
|
||||
/**
|
||||
* 时间戳
|
||||
*/
|
||||
private long time = System.currentTimeMillis();
|
||||
|
||||
/**
|
||||
* 属性
|
||||
*/
|
||||
private List<String> measurementList;
|
||||
|
||||
/**
|
||||
* 属性值
|
||||
*/
|
||||
private List<Object> valueList;
|
||||
|
||||
/**
|
||||
* 数据类型
|
||||
*/
|
||||
private List<String> typeList;
|
||||
}
|
|
@ -0,0 +1,53 @@
|
|||
package com.muyu.carData.interfaces;
|
||||
|
||||
import com.muyu.carData.annotation.IoTTableName;
|
||||
import com.muyu.carData.domain.IoTDBRecord;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* @Author:张腾
|
||||
* @Package:com.muyu.carData.interfaces
|
||||
* @Project:cloud-server-8
|
||||
* @name:IoTDBRecordable
|
||||
* @Date:2024/9/27 19:22
|
||||
* iot基类
|
||||
*/
|
||||
public interface IoTDBRecordable {
|
||||
|
||||
Logger logger = LoggerFactory.getLogger(IoTDBRecordable.class);
|
||||
|
||||
/**
|
||||
* 数据载入方法
|
||||
* @return Record
|
||||
*/
|
||||
default IoTDBRecord toRecord() throws Exception {
|
||||
IoTDBRecord ioTDBRecord = new IoTDBRecord();
|
||||
Object getIoTDBTime = this.getClass().getMethod("getIoTDBTime").invoke(this);
|
||||
if (null != getIoTDBTime){
|
||||
ioTDBRecord.setTime((Long) getIoTDBTime);
|
||||
}
|
||||
Class aClass = this.getClass();
|
||||
IoTTableName name = this.getClass().getAnnotation(IoTTableName.class);
|
||||
ioTDBRecord.setDeviceId(name.value());
|
||||
Field[] declaredFields = aClass.getDeclaredFields();
|
||||
ArrayList<String> measurements = new ArrayList<>();
|
||||
ArrayList<Object> records = new ArrayList<>();
|
||||
ArrayList<String> types = new ArrayList<>();
|
||||
for (Field declaredField : declaredFields) {
|
||||
measurements.add(declaredField.getName());
|
||||
String methodNamePro = declaredField.getName().substring(0, 1).toUpperCase() + declaredField.getName().substring(1);
|
||||
Method methodName = this.getClass().getMethod("get" + methodNamePro);
|
||||
records.add(methodName.invoke(this));
|
||||
types.add(methodName.getReturnType().getName());
|
||||
}
|
||||
ioTDBRecord.setMeasurementList(measurements);
|
||||
ioTDBRecord.setValueList(records);
|
||||
ioTDBRecord.setTypeList(types);
|
||||
return ioTDBRecord;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
package com.muyu.carData.pojo;
|
||||
|
||||
import com.muyu.carData.config.cacheconfig.ExpiryTime;
|
||||
import lombok.*;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
/**
|
||||
* @Author:张腾
|
||||
* @Package:com.muyu.carData.pojo
|
||||
* @Project:cloud-server-8
|
||||
* @name:Student
|
||||
* @Date:2024/9/27 0:40
|
||||
*/
|
||||
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class Student extends ExpiryTime{
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 性别
|
||||
*/
|
||||
private String sex;
|
||||
|
||||
/**
|
||||
* 插入时间
|
||||
*/
|
||||
private long time = System.currentTimeMillis();
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
package com.muyu.carData.testcontroller;
|
||||
|
||||
import com.github.benmanes.caffeine.cache.Cache;
|
||||
import com.muyu.carData.config.cacheconfig.CaffeineConfig;
|
||||
import com.muyu.carData.pojo.Student;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @Author:张腾
|
||||
* @Package:com.muyu.carData.controller
|
||||
* @Project:cloud-server-8
|
||||
* @name:TestController
|
||||
* @Date:2024/9/26 23:56
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/testCache")
|
||||
@Log4j2
|
||||
public class CacheController {
|
||||
|
||||
@Autowired
|
||||
private CaffeineConfig caffeineConfig;
|
||||
|
||||
@RequestMapping("/caffeine")
|
||||
public String caffeine() throws InterruptedException {
|
||||
Cache<String, Student> stringCache = (Cache<String, Student>) caffeineConfig.caffeineCache();
|
||||
Student build = Student.builder().id(1)
|
||||
.name("小马")
|
||||
.sex("男")
|
||||
.expiryTime(20 * 60)
|
||||
.refreshTime(15 * 30)
|
||||
.build();
|
||||
stringCache.put("1", build);
|
||||
Thread.sleep(1000);
|
||||
//返回缓存的个数
|
||||
log.info(stringCache.estimatedSize());
|
||||
//返回缓存的数据
|
||||
log.info(stringCache.getIfPresent("1"));
|
||||
return "111";
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,111 @@
|
|||
package com.muyu.carData.testcontroller;
|
||||
|
||||
import com.muyu.carData.config.lotdbconfig.IotDBSessionConfig;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.apache.iotdb.rpc.IoTDBConnectionException;
|
||||
import org.apache.iotdb.rpc.StatementExecutionException;
|
||||
import org.apache.iotdb.session.Session;
|
||||
import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
|
||||
import org.apache.iotdb.tsfile.write.record.Tablet;
|
||||
import org.apache.iotdb.tsfile.write.schema.MeasurementSchema;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:张腾
|
||||
* @Package:com.muyu.carData.testcontroller
|
||||
* @Project:cloud-server-8
|
||||
* @name:IotDBController
|
||||
* @Date:2024/9/28 23:58
|
||||
*/
|
||||
@RequestMapping("/iotdb")
|
||||
@RestController
|
||||
@Log4j2
|
||||
public class IotDBController {
|
||||
|
||||
|
||||
@Autowired
|
||||
private IotDBSessionConfig iotDBSessionConfig;
|
||||
|
||||
/**
|
||||
* 批量插入数据
|
||||
* @param insertSize 每次插入的条数
|
||||
* @param count 插入的总条数
|
||||
* @return
|
||||
* @throws IoTDBConnectionException
|
||||
* @throws StatementExecutionException
|
||||
*/
|
||||
@GetMapping("/insertData/{insertSize}/{count}")
|
||||
public String insert(@PathVariable(name = "insertSize") int insertSize,@PathVariable(name = "count") int count) throws IoTDBConnectionException, StatementExecutionException {
|
||||
Session session = iotDBSessionConfig.iotSession();
|
||||
List<MeasurementSchema> schemaList = new ArrayList<>();
|
||||
schemaList.add(new MeasurementSchema("id", TSDataType.INT32));
|
||||
schemaList.add(new MeasurementSchema("name", TSDataType.TEXT));
|
||||
schemaList.add(new MeasurementSchema("sex", TSDataType.TEXT));
|
||||
|
||||
Tablet tablet = new Tablet("root.yang.baling", schemaList);
|
||||
|
||||
//以当前时间戳作为插入的起始时间戳
|
||||
long timestamp = System.currentTimeMillis();
|
||||
long beginTime = System.currentTimeMillis();
|
||||
for (long row = 0;row < count; row++){
|
||||
int rowIndex = tablet.rowSize++;
|
||||
tablet.addTimestamp(rowIndex,timestamp); //批量插入的时间戳是数组形式,所以需要使用rowIndex来指定插入的位置
|
||||
tablet.addValue("id", rowIndex, ((row & 1) == 0 ? 1 : 0));
|
||||
tablet.addValue("name", rowIndex, "name<=>" + row);
|
||||
tablet.addValue("sex", rowIndex, "男");
|
||||
if (tablet.rowSize == insertSize){
|
||||
long bg = System.currentTimeMillis();
|
||||
session.insertTablet(tablet);
|
||||
tablet.reset();
|
||||
log.info("已经插入了"+(row + 1)+",插入耗时:" + (System.currentTimeMillis() - bg));
|
||||
}
|
||||
timestamp++;
|
||||
}
|
||||
|
||||
if (tablet.rowSize != 0){
|
||||
session.insertTablet(tablet);
|
||||
log.info("插入完成,耗时:" + (System.currentTimeMillis() - beginTime));
|
||||
tablet.reset();
|
||||
}
|
||||
long endTime = System.currentTimeMillis();
|
||||
log.info("插入了"+insertSize+"条数据,每次插入"+count+"条数据,总耗时:"+(endTime - beginTime));
|
||||
return "时序性数据库测试success";
|
||||
}
|
||||
|
||||
|
||||
/* @GetMapping("/batchInsertRecords/{num}")
|
||||
public String batchInsertRecords(@PathVariable Integer num){
|
||||
String deviceId = "root.yang";
|
||||
|
||||
//属性(字段)
|
||||
List<String> schemaList = new ArrayList<>();
|
||||
schemaList.add("id");
|
||||
schemaList.add("name");
|
||||
schemaList.add("age");
|
||||
|
||||
ArrayList<TSDataType> tsDataTypes = new ArrayList<>();
|
||||
tsDataTypes.add(TSDataType.INT32);
|
||||
tsDataTypes.add(TSDataType.TEXT);
|
||||
tsDataTypes.add(TSDataType.INT32);
|
||||
|
||||
List<Object> value = new ArrayList<>();
|
||||
value.add(1);
|
||||
value.add("张腾");
|
||||
value.add(18);
|
||||
|
||||
ArrayList<String> deviceIds = new ArrayList<>();
|
||||
ArrayList<Long> times = new ArrayList<>();
|
||||
ArrayList<List<TSDataType>> typeList = new ArrayList<>();
|
||||
ArrayList<List<Object>> valueList = new ArrayList<>();
|
||||
for (int i = 0; i < num; i++) {
|
||||
deviceIds.add()
|
||||
}
|
||||
}*/
|
||||
}
|
|
@ -0,0 +1,50 @@
|
|||
package com.muyu.carData.testcontroller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.muyu.carData.pojo.Student;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.apache.kafka.clients.producer.KafkaProducer;
|
||||
import org.apache.kafka.clients.producer.ProducerRecord;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @Author:张腾
|
||||
* @Package:com.muyu.carData.testcontroller
|
||||
* @Project:cloud-server-8
|
||||
* @name:KafkaProducerController
|
||||
* @Date:2024/9/28 15:10
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/produce")
|
||||
@Log4j2
|
||||
public class KafkaProducerController {
|
||||
|
||||
@Autowired
|
||||
private KafkaProducer kafkaProducer;
|
||||
|
||||
private final String topicName = "test";
|
||||
|
||||
@GetMapping("/produceTest")
|
||||
public String produceTest() {
|
||||
try {
|
||||
Student stu = Student.builder().id(2)
|
||||
.name("杨闪闪")
|
||||
.sex("男")
|
||||
.build();
|
||||
String stuStr = JSONObject.toJSONString(stu);
|
||||
log.info("Topic:{}", topicName);
|
||||
log.info("Java对象:{}",stu);
|
||||
log.info("转换为JSON:{}",stuStr);
|
||||
//使用KafkaProducer发送消息
|
||||
ProducerRecord<String, String> stringProducerRecord = new ProducerRecord<>(topicName, stuStr);
|
||||
kafkaProducer.send(stringProducerRecord);
|
||||
}catch (Exception e){
|
||||
log.error("Producer写入Topic异常,异常信息是:{}",e.getMessage());
|
||||
}
|
||||
return "消息发送成功";
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,58 @@
|
|||
<?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>
|
||||
<version>1.0.0</version>
|
||||
<description>
|
||||
cloud-modules-enterprise-common 企业业务common
|
||||
</description>
|
||||
<properties>
|
||||
<maven.compiler.source>21</maven.compiler.source>
|
||||
<maven.compiler.target>21</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<!-- MuYu Common Core-->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-common-core</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.swagger.core.v3</groupId>
|
||||
<artifactId>swagger-annotations-jakarta</artifactId>
|
||||
<version>2.2.8</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.dom4j</groupId>
|
||||
<artifactId>dom4j</artifactId>
|
||||
<version>2.1.3</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.thoughtworks.xstream</groupId>
|
||||
<artifactId>xstream</artifactId>
|
||||
<version>1.4.20</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.squareup.okhttp3</groupId>
|
||||
<artifactId>okhttp</artifactId>
|
||||
<version>4.9.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>fastjson</artifactId>
|
||||
<version>1.2.83</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
|
@ -0,0 +1,25 @@
|
|||
package com.muyu.domain;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 连接微信服务器(微信公众号)
|
||||
*/
|
||||
@Data
|
||||
@Tag(name = "连接微信服务器")
|
||||
public class AccessToken {
|
||||
|
||||
private String access_token;
|
||||
|
||||
private Long expires_in;
|
||||
|
||||
public void setExpiresTime(Long expiresIn) {
|
||||
this.expires_in = System.currentTimeMillis()+expiresIn*1000;
|
||||
}
|
||||
|
||||
public boolean isExpired(Long expiresIn){
|
||||
long now = System.currentTimeMillis();
|
||||
return now>expiresIn;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
package com.muyu.domain;
|
||||
|
||||
import com.thoughtworks.xstream.annotations.XStreamAlias;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 发送图文回复消息内容(微信公众号)
|
||||
* @Author:蓬叁
|
||||
* @Package:com.muyu.wxapplication.massage
|
||||
* @Project:WXApplication
|
||||
* @name:Articles
|
||||
* @Date:2024/9/18 下午10:14
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@XStreamAlias("item")
|
||||
@Tag(name = "发送图文回复消息内容")
|
||||
public class Articles {
|
||||
// <Articles>
|
||||
// <item>
|
||||
// <Title><![CDATA[title1]]></Title>
|
||||
// <Description><![CDATA[description1]]></Description>
|
||||
// <PicUrl><![CDATA[picurl]]></PicUrl>
|
||||
// <Url><![CDATA[url]]></Url>
|
||||
// </item>
|
||||
// </Articles>
|
||||
|
||||
@XStreamAlias("Title")
|
||||
private String title ;
|
||||
@XStreamAlias("Description")
|
||||
private String description ;
|
||||
@XStreamAlias("PicUrl")
|
||||
private String picUrl ;
|
||||
@XStreamAlias("Url")
|
||||
private String url ;
|
||||
|
||||
}
|
|
@ -0,0 +1,213 @@
|
|||
package com.muyu.domain;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
/**
|
||||
*
|
||||
* 故障规则测试类(故障)
|
||||
* @Author:weiran
|
||||
* @Package:com.muyu.cloud.faultmanage.domain.faultrule
|
||||
* @Project:cloud-server-8
|
||||
* @name:PureElectricCar
|
||||
* @Date:2024/9/20 20:22
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@SuperBuilder
|
||||
@Tag(name = "故障规则测试类")
|
||||
public class CarFaultRule {
|
||||
|
||||
/**
|
||||
* VIN码VIN码VIN码
|
||||
*/
|
||||
private String vin;
|
||||
/**
|
||||
* 时间戳时间戳时间戳
|
||||
*/
|
||||
private long timestamp;
|
||||
/**
|
||||
* 经度经度经度
|
||||
*/
|
||||
private double longitude;
|
||||
/**
|
||||
* 纬度纬度纬度
|
||||
*/
|
||||
private double latitude;
|
||||
/**
|
||||
* 车速车速车速
|
||||
*/
|
||||
private double speed;
|
||||
/**
|
||||
* 总里程总里程总里程
|
||||
*/
|
||||
private Long tm;
|
||||
/**
|
||||
* 总电压总电压总电压
|
||||
*/
|
||||
private double tv;
|
||||
/**
|
||||
* 总电流总电流总电流
|
||||
*/
|
||||
private double cc;
|
||||
/**
|
||||
* 绝缘电阻绝缘电阻绝缘电阻
|
||||
*/
|
||||
private double ir;
|
||||
/**
|
||||
* 档位档位档位
|
||||
*/
|
||||
private String gp;
|
||||
/**
|
||||
* 加速踏板行程值加速踏板行程值加速踏板行程值
|
||||
*/
|
||||
private double aptv;
|
||||
/**
|
||||
* 制动踏板行程值制动踏板行程值制动踏板行程值
|
||||
*/
|
||||
private double bptv;
|
||||
/**
|
||||
* 燃料消耗率燃料消耗率燃料消耗率
|
||||
*/
|
||||
private double sfc;
|
||||
/**
|
||||
* 电机控制器温度电机控制器温度电机控制器温度
|
||||
*/
|
||||
private double mct;
|
||||
/**
|
||||
* 电机转速电机转速电机转速
|
||||
*/
|
||||
private int ms;
|
||||
/**
|
||||
* 电机转矩电机转矩电机转矩
|
||||
*/
|
||||
private double mto;
|
||||
/**
|
||||
* 电机温度电机温度电机温度
|
||||
*/
|
||||
private double mte;
|
||||
/**
|
||||
* 电机电压电机电压电机电压
|
||||
*/
|
||||
private double mv;
|
||||
/**
|
||||
* 电机电流电机电流电机电流
|
||||
*/
|
||||
private double mc;
|
||||
/**
|
||||
* 动力电池剩余电量SOC动力电池剩余电量SOC动力电池剩余电量SOC
|
||||
*/
|
||||
private double pbrsoc;
|
||||
/**
|
||||
* 当前状态允许的最大反馈功率当前状态允许的最大反馈功率当前状态允许的最大反馈功率
|
||||
*/
|
||||
private double macsfp;
|
||||
/**
|
||||
* 当前状态允许最大放电功率当前状态允许最大放电功率当前状态允许最大放电功率
|
||||
*/
|
||||
private double csatmdp;
|
||||
/**
|
||||
* BMS自检计数器BMS自检计数器BMS自检计数器
|
||||
*/
|
||||
private int bms;
|
||||
/**
|
||||
* 动力电池充放电电流动力电池充放电电流动力电池充放电电流
|
||||
*/
|
||||
private double cadc;
|
||||
/**
|
||||
* 动力电池负载端总电压V3动力电池负载端总电压V3动力电池负载端总电压V3
|
||||
*/
|
||||
private double pbletvv3;
|
||||
/**
|
||||
* 单次最大电压单次最大电压单次最大电压
|
||||
*/
|
||||
private double smv;
|
||||
/**
|
||||
* 单体电池最低电压单体电池最低电压单体电池最低电压
|
||||
*/
|
||||
private double mvoab;
|
||||
/**
|
||||
* 单体电池最高温度单体电池最高温度单体电池最高温度
|
||||
*/
|
||||
private double maxbt;
|
||||
/**
|
||||
* 单体电池最低温度单体电池最低温度单体电池最低温度
|
||||
*/
|
||||
private double minbt;
|
||||
/**
|
||||
* 动力电池可用容量动力电池可用容量动力电池可用容量
|
||||
*/
|
||||
private double pbac;
|
||||
/**
|
||||
* 车辆状态车辆状态车辆状态
|
||||
*/
|
||||
private String vs;
|
||||
/**
|
||||
* 充电状态充电状态充电状态
|
||||
*/
|
||||
private String cs;
|
||||
/**
|
||||
* 运行状态运行状态运行状态
|
||||
*/
|
||||
private String rs;
|
||||
/**
|
||||
* SOCSOCSOC
|
||||
*/
|
||||
private double soc;
|
||||
/**
|
||||
* 可充电储能装置工作状态可充电储能装置工作状态可充电储能装置工作状态
|
||||
*/
|
||||
private String resdwc;
|
||||
/**
|
||||
* EASEASEAS
|
||||
*/
|
||||
private String eas;
|
||||
/**
|
||||
* PTCPTCPTC
|
||||
*/
|
||||
private String ptc;
|
||||
/**
|
||||
* EPSEPSEPS
|
||||
*/
|
||||
private String eps;
|
||||
/**
|
||||
* ABSABSABS
|
||||
*/
|
||||
private String abs;
|
||||
/**
|
||||
* MCUMCUMCU
|
||||
*/
|
||||
private String mcu;
|
||||
/**
|
||||
* 动力电池加热状态动力电池加热状态动力电池加热状态
|
||||
*/
|
||||
private String pbhs;
|
||||
/**
|
||||
* 动力电池当前状态动力电池当前状态动力电池当前状态
|
||||
*/
|
||||
private String pbcs;
|
||||
/**
|
||||
* 动力电池保温状态动力电池保温状态动力电池保温状态
|
||||
*/
|
||||
private String pbis;
|
||||
/**
|
||||
* DCDCDCDCDCDC
|
||||
*/
|
||||
private String dcdc;
|
||||
/**
|
||||
* CHGCHGCHG
|
||||
*/
|
||||
private String chg;
|
||||
/**
|
||||
* 校验位校验位校验位
|
||||
*/
|
||||
private byte chb;
|
||||
/**
|
||||
* 截止位截止位截止位
|
||||
*/
|
||||
private byte cub;
|
||||
|
||||
|
||||
}
|
|
@ -16,6 +16,7 @@ import java.util.Date;
|
|||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 电子围栏类
|
||||
* @Author:yang
|
||||
* @Package:com.muyu.domain
|
||||
* @Project:cloud-electronic
|
||||
|
@ -26,7 +27,7 @@ import java.util.List;
|
|||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Tag(name = "车辆电子围栏类")
|
||||
@Tag(name = "电子围栏类")
|
||||
@TableName(value = "car_fence",autoResultMap = true)
|
||||
public class CarFence {
|
||||
|
|
@ -8,6 +8,7 @@ import lombok.Data;
|
|||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 电子围栏业务类型
|
||||
* @Author:yang
|
||||
* @Package:com.muyu.domain
|
||||
* @Project:cloud-electronic
|
||||
|
@ -18,7 +19,7 @@ import lombok.NoArgsConstructor;
|
|||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Tag(name = "车辆电子业务类型")
|
||||
@Tag(name = "电子业务类型")
|
||||
@TableName(value = "car_fence_clazz",autoResultMap = true)
|
||||
public class CarFenceClazz {
|
||||
/**
|
|
@ -10,6 +10,7 @@ import lombok.Data;
|
|||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 电子围栏组类
|
||||
* @Author:yang
|
||||
* @Package:com.muyu.domain
|
||||
* @Project:cloud-server-8
|
||||
|
@ -21,7 +22,7 @@ import lombok.NoArgsConstructor;
|
|||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Tag(name = "车辆电子业务类型")
|
||||
@Tag(name = "电子围栏组类")
|
||||
@TableName(value = "car_fence_group",autoResultMap = true)
|
||||
public class CarFenceGroup {
|
||||
|
|
@ -8,6 +8,7 @@ import lombok.Data;
|
|||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 电子围栏类型
|
||||
* @Author:yang
|
||||
* @Package:com.muyu.domain
|
||||
* @Project:cloud-electronic
|
||||
|
@ -18,7 +19,7 @@ import lombok.NoArgsConstructor;
|
|||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Tag(name = "车辆电子围栏类型")
|
||||
@Tag(name = "电子围栏类型")
|
||||
@TableName(value = "car_fence_type",autoResultMap = true)
|
||||
public class CarFenceType {
|
||||
/**
|
|
@ -0,0 +1,150 @@
|
|||
package com.muyu.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.muyu.domain.req.CarInformationAddReq;
|
||||
import com.muyu.domain.req.CarInformationUpdReq;
|
||||
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;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
/**
|
||||
* 企业车辆管理实体类
|
||||
* @Author:yang
|
||||
* @Package:com.muyu.domain
|
||||
* @Project:cloud-server-8
|
||||
* @name:CarInformation
|
||||
* @Date:2024/9/22 22:18
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@SuperBuilder
|
||||
@Tag(name = "企业车辆管理实体类")
|
||||
@TableName(value = "car_information",autoResultMap = true)
|
||||
public class CarInformation {
|
||||
|
||||
/**
|
||||
* 车辆ID
|
||||
*/
|
||||
@TableId(value = "car_information_id",type = IdType.AUTO)
|
||||
private Long carInformationId;
|
||||
/**
|
||||
* 车辆唯一VIN
|
||||
*/
|
||||
// @TableName(value = "car_information_VIN")
|
||||
@TableField(value = "car_information_VIN")
|
||||
private String carInformationVin;
|
||||
/**
|
||||
* 车牌号
|
||||
*/
|
||||
private String carInformationLicensePlate;
|
||||
/**
|
||||
* 车辆颜色
|
||||
*/
|
||||
private String carInformationColor;
|
||||
/**
|
||||
* 车辆驾驶员
|
||||
*/
|
||||
private String carInformationDriver;
|
||||
/**
|
||||
* 车辆电子围栏外键ID
|
||||
*/
|
||||
@Schema(title = "车辆电子围栏外键ID", type = "Integer")
|
||||
private Integer carInformationFence;
|
||||
/**
|
||||
* 车检到期日期
|
||||
*/
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd")
|
||||
private Date carInformationExamineEnddata;
|
||||
/**
|
||||
* 车辆类型外键ID
|
||||
*/
|
||||
@Schema(title = "车辆类型外键ID", type = "Integer")
|
||||
private Integer carInformationType;
|
||||
/**
|
||||
* 车辆品牌
|
||||
*/
|
||||
private String carInformationBrand;
|
||||
/**
|
||||
* 是否重点车辆 (0否默认 1是 )
|
||||
*/
|
||||
private Integer carInformationFocus;
|
||||
|
||||
/**
|
||||
* 车辆电机厂商
|
||||
*/
|
||||
private String carInformationMotorManufacturer;
|
||||
|
||||
/**
|
||||
* 车辆电机型号
|
||||
*/
|
||||
private String carInformationMotorModel;
|
||||
|
||||
/**
|
||||
* 车辆电池厂商
|
||||
*/
|
||||
private String carInformationBatteryManufacturer;
|
||||
|
||||
/**
|
||||
* 车辆电池型号
|
||||
*/
|
||||
private String carInformationBatteryModel;
|
||||
|
||||
/**
|
||||
* 启用状态(1.在线 2.离线 3.已断开 4.待连接 5.维修中)
|
||||
*/
|
||||
private Integer carInformationState;
|
||||
|
||||
public static CarInformation carInformationBuilder(CarInformation carInformation) {
|
||||
return CarInformation.builder()
|
||||
.carInformationId(carInformation.getCarInformationId())
|
||||
.carInformationLicensePlate(carInformation.getCarInformationLicensePlate())
|
||||
.build();
|
||||
}
|
||||
|
||||
public static CarInformation carInformationUpdBuilder(CarInformationUpdReq carInformation, Supplier<Long> idSupplier) {
|
||||
return CarInformation.builder()
|
||||
.carInformationId(idSupplier.get())
|
||||
.carInformationBrand(carInformation.getCarInformationBrand())
|
||||
.carInformationColor(carInformation.getCarInformationColor())
|
||||
.carInformationDriver(carInformation.getCarInformationDriver())
|
||||
.carInformationMotorManufacturer(carInformation.getCarInformationMotorManufacturer())
|
||||
.carInformationMotorModel(carInformation.getCarInformationMotorModel())
|
||||
.carInformationBatteryManufacturer(carInformation.getCarInformationBatteryManufacturer())
|
||||
.carInformationBatteryModel(carInformation.getCarInformationBatteryModel())
|
||||
.carInformationFence(carInformation.getCarInformationFence())
|
||||
.carInformationType(carInformation.getCarInformationType())
|
||||
.carInformationFocus(carInformation.getCarInformationFocus())
|
||||
.carInformationMotorModel(carInformation.getCarInformationMotorModel())
|
||||
.build();
|
||||
}
|
||||
|
||||
public static CarInformation carInformationAddBuilder(CarInformationAddReq carInformation) {
|
||||
return CarInformation.builder()
|
||||
.carInformationVin(carInformation.getCarInformationVin())
|
||||
.carInformationLicensePlate(carInformation.getCarInformationLicensePlate())
|
||||
.carInformationBrand(carInformation.getCarInformationBrand())
|
||||
.carInformationColor(carInformation.getCarInformationColor())
|
||||
.carInformationDriver(carInformation.getCarInformationDriver())
|
||||
.carInformationMotorManufacturer(carInformation.getCarInformationMotorManufacturer())
|
||||
.carInformationMotorModel(carInformation.getCarInformationMotorModel())
|
||||
.carInformationBatteryManufacturer(carInformation.getCarInformationBatteryManufacturer())
|
||||
.carInformationBatteryModel(carInformation.getCarInformationBatteryModel())
|
||||
.carInformationFence(carInformation.getCarInformationFence())
|
||||
.carInformationType(carInformation.getCarInformationType())
|
||||
.carInformationMotorModel(carInformation.getCarInformationMotorModel())
|
||||
.build();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,133 @@
|
|||
package com.muyu.domain;
|
||||
|
||||
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;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
|
||||
/**
|
||||
* 车辆报文模板实体类
|
||||
* @author 17353
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Tag(name = "车辆报文模板实体类")
|
||||
@TableName(value = "car_message",autoResultMap = true)
|
||||
public class CarMessage {
|
||||
//报文类型模块表
|
||||
/**
|
||||
* 自增主键
|
||||
*/
|
||||
private Long messageTypeId;
|
||||
/**
|
||||
* 报文编码
|
||||
*/
|
||||
private String messageTypeCode;
|
||||
/**
|
||||
* 报文名称
|
||||
*/
|
||||
private String messageTypeName;
|
||||
/**
|
||||
* 报文所属类别
|
||||
*/
|
||||
private String messageTypeBelongs;
|
||||
|
||||
//报文拆分位置主表
|
||||
/**
|
||||
* 自增主键
|
||||
*/
|
||||
private Long carMessageId;
|
||||
/**
|
||||
* 车辆类型外键
|
||||
*/
|
||||
private Integer carMessageCartype;
|
||||
/**
|
||||
* 车辆报文类型外键
|
||||
*/
|
||||
private Integer carMessageType;
|
||||
/**
|
||||
* 开始位下标
|
||||
*/
|
||||
private Integer carMessageStartIndex;
|
||||
/**
|
||||
* 结束位下标
|
||||
*/
|
||||
private Integer carMessageEndIndex;
|
||||
/**
|
||||
* 报文数据类型 (固定值 区间随机值)
|
||||
*/
|
||||
private String messageTypeClass;
|
||||
/**
|
||||
* 报文是否开启故障检测(0默认未开启 1开启)
|
||||
*/
|
||||
private Integer carMessageState;
|
||||
|
||||
/**
|
||||
* 修改方法
|
||||
* @param carMessage
|
||||
* @param supplier
|
||||
* @return
|
||||
*/
|
||||
public static CarMessage carMessageUpdBuilder(CarMessage carMessage, Supplier<Long> supplier) {
|
||||
return CarMessage.builder()
|
||||
.messageTypeId(supplier.get())
|
||||
.messageTypeCode(carMessage.messageTypeCode)
|
||||
.messageTypeName(carMessage.messageTypeName)
|
||||
.messageTypeBelongs(carMessage.messageTypeBelongs)
|
||||
.carMessageId(carMessage.carMessageId)
|
||||
.carMessageCartype(carMessage.carMessageCartype)
|
||||
.carMessageType(carMessage.carMessageType)
|
||||
.carMessageStartIndex(carMessage.carMessageStartIndex)
|
||||
.carMessageEndIndex(carMessage.carMessageEndIndex)
|
||||
.messageTypeClass(carMessage.messageTypeClass)
|
||||
.carMessageState(carMessage.carMessageState)
|
||||
.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加方法
|
||||
* @param carMessage
|
||||
* @return
|
||||
*/
|
||||
public static CarMessage carMessageAddBuilder(CarMessage carMessage) {
|
||||
return CarMessage.builder()
|
||||
.messageTypeCode(carMessage.messageTypeCode)
|
||||
.messageTypeName(carMessage.messageTypeName)
|
||||
.messageTypeBelongs(carMessage.messageTypeBelongs)
|
||||
.carMessageId(carMessage.carMessageId)
|
||||
.carMessageCartype(carMessage.carMessageCartype)
|
||||
.carMessageType(carMessage.carMessageType)
|
||||
.carMessageStartIndex(carMessage.carMessageStartIndex)
|
||||
.carMessageEndIndex(carMessage.carMessageEndIndex)
|
||||
.messageTypeClass(carMessage.messageTypeClass)
|
||||
.carMessageState(carMessage.carMessageState)
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
private Long messageTypeId ;
|
||||
private String messageTypeCode ;
|
||||
private String messageTypeName ;
|
||||
private String messageTypeBelongs ;
|
||||
private String messageTypeClass ;
|
||||
private Long carMessageId ;
|
||||
private Integer carMessageCartype ;
|
||||
private Integer carMessageType ;
|
||||
private Integer carMessageStartIndex ;
|
||||
private Integer carMessageEndIndex ;
|
||||
private Integer carMessageState ;
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
package com.muyu.domain;
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* 车辆报文所属类型
|
||||
* @Author:蓬叁
|
||||
* @Package:com.muyu.warn.domain.car
|
||||
* @Project:cloud-server-8
|
||||
* @name:CarMessage
|
||||
* @Date:2024/9/22 下午3:07
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Tag(name = "车辆报文所属类型")
|
||||
@TableName(value = "car_message_type",autoResultMap = true)
|
||||
public class CarMessageType {
|
||||
|
||||
/**
|
||||
* 自增主键
|
||||
*/
|
||||
private Integer messageTypeId ;
|
||||
/**
|
||||
* 报文编码
|
||||
*/
|
||||
private String messageTypeCode ;
|
||||
/**
|
||||
* 报文名称
|
||||
*/
|
||||
private String messageTypeName ;
|
||||
/**
|
||||
* 报文所属类别
|
||||
*/
|
||||
private String messageTypeBelongs ;
|
||||
|
||||
}
|
|
@ -10,6 +10,7 @@ import lombok.Data;
|
|||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 车辆电子组中间表
|
||||
* @Author:yang
|
||||
* @Package:com.muyu.domain
|
||||
* @Project:cloud-electronic
|
||||
|
@ -36,9 +37,9 @@ public class CarMiddle {
|
|||
/**
|
||||
* 车辆ID
|
||||
*/
|
||||
private Integer carInformationId;
|
||||
private Long carInformationId;
|
||||
|
||||
public CarMiddle(Integer fenceGroupId, Integer carInformationId) {
|
||||
public CarMiddle(Integer fenceGroupId, Long carInformationId) {
|
||||
this.fenceGroupId = fenceGroupId;
|
||||
this.carInformationId = carInformationId;
|
||||
}
|
|
@ -10,6 +10,7 @@ import lombok.Data;
|
|||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 围栏组中间表围栏
|
||||
* @Author:yang
|
||||
* @Package:com.muyu.domain
|
||||
* @Project:cloud-server-8
|
|
@ -0,0 +1,39 @@
|
|||
package com.muyu.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
/**
|
||||
* 车辆类型
|
||||
* @Author:weiran
|
||||
* @Package:com.muyu.cloud.faultmanage.domain
|
||||
* @Project:cloud-server-8
|
||||
* @name:CarType
|
||||
* @Date:2024/9/21 19:01
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@SuperBuilder
|
||||
@TableName(value = "car_type",autoResultMap = true)
|
||||
@Tag(name ="车辆类型表")
|
||||
public class CarType {
|
||||
|
||||
/**
|
||||
* 车辆类型ID
|
||||
*/
|
||||
private long carTypeId;
|
||||
/**
|
||||
* 车辆类型名
|
||||
*/
|
||||
private String carTypeName;
|
||||
/**
|
||||
* 车辆规则外键ID
|
||||
*/
|
||||
private long carTypeRules;
|
||||
|
||||
}
|
|
@ -0,0 +1,122 @@
|
|||
package com.muyu.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.muyu.domain.req.FaultCodeAddReq;
|
||||
import com.muyu.domain.req.FaultCodeUpdReq;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
/**
|
||||
* @Author:weiran
|
||||
* @Package:com.muyu.cloud.faultmanage.domain
|
||||
* @Project:cloud-faultmanage
|
||||
* @name:FaultCode
|
||||
* @Date:2024/9/17 14:55
|
||||
*/
|
||||
/**
|
||||
* 故障码
|
||||
*
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@SuperBuilder
|
||||
@TableName(value = "car_faultcode",autoResultMap = true)
|
||||
@Tag(name = "故障码")
|
||||
public class FaultCode {
|
||||
|
||||
/**
|
||||
*故障码Id
|
||||
*/
|
||||
@TableId(value = "faultcode_id",type = IdType.AUTO)
|
||||
private long faultcodeId;
|
||||
/**
|
||||
*故障名称Id
|
||||
*/
|
||||
private long messageTypeId;
|
||||
/**
|
||||
*故障码
|
||||
*/
|
||||
private String faultcodeNumber;
|
||||
/**
|
||||
*故障组
|
||||
*/
|
||||
private String faultGroup;
|
||||
/**
|
||||
*故障位
|
||||
*/
|
||||
private String faultBit;
|
||||
/**
|
||||
*故障值
|
||||
*/
|
||||
private String faultValue;
|
||||
/**
|
||||
*是否警告
|
||||
*/
|
||||
private Integer isWarning;
|
||||
/**
|
||||
*故障类型名称
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String faulttypeName;
|
||||
/**
|
||||
* 故障名称
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String messageTypeName;
|
||||
/**
|
||||
* 报文编码
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String messageTypeCode;
|
||||
/**
|
||||
*报文所属类别
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String messageTypeBelongs;
|
||||
|
||||
|
||||
public static FaultCode addfaultcode(FaultCodeAddReq faultCodeAddReq){
|
||||
return FaultCode.builder()
|
||||
.faultcodeId(0)
|
||||
.messageTypeId(faultCodeAddReq.getMessageTypeId())
|
||||
.faultcodeNumber(faultCodeAddReq.getFaultcodeNumber())
|
||||
.faultGroup(faultCodeAddReq.getFaultGroup())
|
||||
.faultBit(faultCodeAddReq.getFaultBit())
|
||||
.faultValue(faultCodeAddReq.getFaultValue())
|
||||
.isWarning(faultCodeAddReq.getIsWarning())
|
||||
.build();
|
||||
}
|
||||
|
||||
public static FaultCode updfaultcode(FaultCodeUpdReq faultCodeUpdReq){
|
||||
return FaultCode.builder()
|
||||
.faultcodeId(0)
|
||||
.messageTypeId(faultCodeUpdReq.getMessageTypeId())
|
||||
.faultcodeNumber(faultCodeUpdReq.getFaultcodeNumber())
|
||||
.faultGroup(faultCodeUpdReq.getFaultGroup())
|
||||
.faultBit(faultCodeUpdReq.getFaultBit())
|
||||
.faultValue(faultCodeUpdReq.getFaultValue())
|
||||
.isWarning(faultCodeUpdReq.getIsWarning())
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
public static FaultCode faultCodeBuilder(FaultCode faultCode) {
|
||||
return FaultCode.builder()
|
||||
.faultcodeId(faultCode.getFaultcodeId())
|
||||
.messageTypeId(faultCode.getMessageTypeId())
|
||||
.faultcodeNumber(faultCode.getFaultcodeNumber())
|
||||
.faultGroup(faultCode.faultGroup)
|
||||
.faultBit(faultCode.faultBit)
|
||||
.faultValue(faultCode.faultValue)
|
||||
.isWarning(faultCode.isWarning)
|
||||
.build();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,95 @@
|
|||
package com.muyu.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.muyu.domain.req.FaultConditionAddReq;
|
||||
import com.muyu.domain.req.FaultConditionUpdReq;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
/**
|
||||
* 故障规则
|
||||
* @Author:weiran
|
||||
* @Package:com.muyu.cloud.faultmanage.domain
|
||||
* @Project:cloud-server-8
|
||||
* @name:FaultCondition
|
||||
* @Date:2024/9/21 19:51
|
||||
*/
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@SuperBuilder
|
||||
@TableName(value = "car_fault_condition",autoResultMap = true)
|
||||
@Tag(name = "故障规则")
|
||||
public class FaultCondition {
|
||||
/**
|
||||
* 故障规则表Id
|
||||
*/
|
||||
@TableId(value = "carcondition_id",type = IdType.AUTO)
|
||||
private long carconditionId;
|
||||
/**
|
||||
* 车辆类型Id
|
||||
*/
|
||||
private long carTypeId;
|
||||
/**
|
||||
*故障名称Id
|
||||
*/
|
||||
private long messageTypeId;
|
||||
/**
|
||||
* 故障条件
|
||||
*/
|
||||
private String faultconditionIdentification;
|
||||
/**
|
||||
* 故障规则参数
|
||||
*/
|
||||
private BigDecimal faultconditionParameter;
|
||||
/**
|
||||
* 车辆类型名称
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String carTypeName;
|
||||
/**
|
||||
* 故障名称
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String messageTypeName;
|
||||
/**
|
||||
* 报文编码
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String messageTypeCode;
|
||||
|
||||
|
||||
public static FaultCondition faultConditionadd(FaultConditionAddReq faultConditionAddReq){
|
||||
return FaultCondition.builder()
|
||||
.carTypeId(faultConditionAddReq.getCarTypeId())
|
||||
.messageTypeId(faultConditionAddReq.getMessageTypeId())
|
||||
.faultconditionIdentification(faultConditionAddReq.getFaultconditionIdentification())
|
||||
.faultconditionParameter(faultConditionAddReq.getFaultconditionParameter())
|
||||
.build();
|
||||
}
|
||||
|
||||
public static FaultCondition faultConditionupd(FaultConditionUpdReq faultConditionUpdReq, Supplier<Long> idSupplier){
|
||||
return FaultCondition.builder()
|
||||
.carconditionId(faultConditionUpdReq.getCarconditionId())
|
||||
.carTypeId(faultConditionUpdReq.getCarTypeId())
|
||||
.messageTypeId(faultConditionUpdReq.getMessageTypeId())
|
||||
.faultconditionIdentification(faultConditionUpdReq.getFaultconditionIdentification())
|
||||
.faultconditionParameter(faultConditionUpdReq.getFaultconditionParameter())
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,62 @@
|
|||
package com.muyu.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.muyu.domain.req.FaultCodeAddReq;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
/**
|
||||
* 故障标签
|
||||
* @Author:weiran
|
||||
* @Package:com.muyu.cloud.faultmanage.domain
|
||||
* @Project:cloud-faultmanage
|
||||
* @name:FaultLabel
|
||||
* @Date:2024/9/17 15:06
|
||||
*/
|
||||
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@SuperBuilder
|
||||
@TableName(value = "car_fault_label",autoResultMap = true)
|
||||
@Tag(name = "故障标签")
|
||||
public class FaultLabel {
|
||||
/**
|
||||
*自增主键
|
||||
*/
|
||||
@TableId(value = "message_type_id",type = IdType.AUTO)
|
||||
private long messageTypeId;
|
||||
/**
|
||||
*报文编码
|
||||
*/
|
||||
private String messageTypeCode;
|
||||
/**
|
||||
*报文名称
|
||||
*/
|
||||
private String messageTypeName;
|
||||
/**
|
||||
*报文所属类别
|
||||
*/
|
||||
private String messageTypeBelongs;
|
||||
|
||||
|
||||
public static FaultLabel addfaultLabel(FaultCodeAddReq faultCodeAddReq){
|
||||
return FaultLabel.builder()
|
||||
.messageTypeId(0)
|
||||
.messageTypeId(faultCodeAddReq.getMessageTypeId())
|
||||
.messageTypeCode(faultCodeAddReq.getMessageTypeCode())
|
||||
.messageTypeName(faultCodeAddReq.getMessageTypeName())
|
||||
.messageTypeBelongs(faultCodeAddReq.getMessageTypeBelongs())
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,73 @@
|
|||
package com.muyu.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 故障日志
|
||||
* @Author:weiran
|
||||
* @Package:com.muyu.cloud.faultmanage.domain
|
||||
* @Project:cloud-server-8
|
||||
* @name:FaultLog
|
||||
* @Date:2024/9/19 0:42
|
||||
*/
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@SuperBuilder
|
||||
@TableName(value = "car_fault_log",autoResultMap = true)
|
||||
@Tag(name = "故障日志")
|
||||
public class FaultLog {
|
||||
|
||||
/**
|
||||
* 故障日志Id
|
||||
*/
|
||||
@TableId(value = "log_id",type = IdType.AUTO)
|
||||
private long logId;
|
||||
/**
|
||||
* 故障码Id
|
||||
*/
|
||||
private long faultcodeId;
|
||||
/**
|
||||
* 车辆Id
|
||||
*/
|
||||
private long carInformationId;
|
||||
/**
|
||||
* 车辆VIN
|
||||
*/
|
||||
private String carVin;
|
||||
|
||||
/**
|
||||
* 故障码
|
||||
*/
|
||||
private String faultcodeNumber;
|
||||
/**
|
||||
* 车辆VIN
|
||||
*/
|
||||
private String carInformationVIN;
|
||||
/**
|
||||
* 开始报警时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Schema(description = "开始报警时间",defaultValue = "2024-8-9 10:47:57",type = "Date")
|
||||
private Date startwarningTime;
|
||||
/**
|
||||
* 结束报警时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Schema(description = "结束报警时间",defaultValue = "2024-8-9 10:47:57",type = "Date")
|
||||
private Date endwarningTime;
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
package com.muyu.domain;
|
||||
|
||||
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:weiran
|
||||
* @Package:com.muyu.cloud.faultmanage.domain
|
||||
* @Project:cloud-faultmanage
|
||||
* @name:FaultType
|
||||
* @Date:2024/9/17 15:03
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@SuperBuilder
|
||||
@TableName(value = "car_fault_type",autoResultMap = true)
|
||||
public class FaultType {
|
||||
/**
|
||||
*故障类型Id
|
||||
*/
|
||||
@TableId(value = "faulttype_id",type = IdType.AUTO)
|
||||
private long faulttypeId;
|
||||
/**
|
||||
*故障类型名称
|
||||
*/
|
||||
private String faulttypeName;
|
||||
}
|
|
@ -0,0 +1,53 @@
|
|||
package com.muyu.domain ;
|
||||
|
||||
import com.thoughtworks.xstream.annotations.XStreamAlias;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 图文信息(微信公众号)
|
||||
* @Author:蓬叁
|
||||
* @Package:com.muyu.wxapplication.massage
|
||||
* @Project:WXApplication
|
||||
* @name:ImageText
|
||||
* @Date:2024/9/18 下午9:27
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@XStreamAlias("xml")
|
||||
@Tag(name = "图文信息")
|
||||
public class NewsMessage {
|
||||
// <ToUserName><![CDATA[toUser]]></ToUserName>
|
||||
// <FromUserName><![CDATA[fromUser]]></FromUserName>
|
||||
// <CreateTime>12345678</CreateTime>
|
||||
// <MsgType><![CDATA[news]]></MsgType>
|
||||
// <ArticleCount>1</ArticleCount>
|
||||
// <Articles>
|
||||
// <item>
|
||||
// <Title><![CDATA[title1]]></Title>
|
||||
// <Description><![CDATA[description1]]></Description>
|
||||
// <PicUrl><![CDATA[picurl]]></PicUrl>
|
||||
// <Url><![CDATA[url]]></Url>
|
||||
// </item>
|
||||
// </Articles>
|
||||
|
||||
@XStreamAlias("ToUserName")
|
||||
private String toUserName ;
|
||||
@XStreamAlias("FromUserName")
|
||||
private String fromUserName ;
|
||||
@XStreamAlias("CreateTime")
|
||||
private long createTime ;
|
||||
@XStreamAlias("MsgType")
|
||||
private String msgType ;
|
||||
@XStreamAlias("ArticleCount")
|
||||
private Integer articleCount ;
|
||||
@XStreamAlias("Articles")
|
||||
private List<Articles> articles ;
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
package com.muyu.common.wechat.domain;
|
||||
|
||||
import com.thoughtworks.xstream.annotations.XStreamAlias;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 文本信息(微信公众号)
|
||||
* @Author:蓬叁
|
||||
* @Package:com.muyu.wxapplication.massage
|
||||
* @Project:WXApplication
|
||||
* @name:TextMessage
|
||||
* @Date:2024/9/18 上午11:33
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@XStreamAlias("xml")
|
||||
@Tag(name = "文本信息")
|
||||
public class TextMessage {
|
||||
|
||||
//起一个别名 因为我们微信返回信息与java代码格式规范发生冲突
|
||||
//微信格式 ToUserName
|
||||
//JAVA格式 toUserName
|
||||
@XStreamAlias("ToUserName")
|
||||
private String toUserName;
|
||||
@XStreamAlias("FromUserName")
|
||||
private String fromUserName;
|
||||
@XStreamAlias("CreateTime")
|
||||
private long createTime;
|
||||
@XStreamAlias("MsgType")
|
||||
private String msgType;
|
||||
@XStreamAlias("Content")
|
||||
private String content;
|
||||
|
||||
}
|
||||
// <ToUserName><![CDATA[toUser]]></ToUserName>
|
||||
// <FromUserName><![CDATA[fromUser]]></FromUserName>
|
||||
// <CreateTime>12345678</CreateTime>
|
||||
// <MsgType><![CDATA[text]]></MsgType>
|
||||
// <Content><![CDATA[你好]]></Content>
|
|
@ -0,0 +1,32 @@
|
|||
package com.muyu.domain;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
/**
|
||||
* 故障查询信息结果返回对象
|
||||
* @Author:weiran
|
||||
* @Package:com.muyu.cloud.faultmanage.domain
|
||||
* @Project:cloud-server-8
|
||||
* @name:Vehicle
|
||||
* @Date:2024/9/20 20:44
|
||||
*/
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@SuperBuilder
|
||||
@Tag(name = "故障查询信息结果返回对象")
|
||||
public class Vehicle {
|
||||
/**
|
||||
* 车辆VIN 唯一标识
|
||||
*/
|
||||
private String VIN;
|
||||
/**
|
||||
* 故障信息
|
||||
*/
|
||||
private String faultmessage;
|
||||
}
|
|
@ -0,0 +1,107 @@
|
|||
package com.muyu.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.muyu.common.core.annotation.Excel;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 预警日志
|
||||
* @Author:蓬叁
|
||||
* @Package:com.muyu.warn.domain
|
||||
* @Project:cloud-server-8
|
||||
* @name:WarnLogs
|
||||
* @Date:2024/9/20 下午7:11
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@TableName("warn_logs")
|
||||
@Tag(name = "预警日志")
|
||||
public class WarnLogs {
|
||||
|
||||
/**
|
||||
* 预警日志id
|
||||
*/
|
||||
@Excel(name = "预警日志id", cellType = Excel.ColumnType.NUMERIC)
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
/**
|
||||
* 车辆vin码
|
||||
*/
|
||||
@Excel(name = "车辆vin码")
|
||||
private String vin;
|
||||
/**
|
||||
* 规则id
|
||||
*/
|
||||
@Excel(name = "规则id")
|
||||
private Long warnRuleId;
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
@Excel(name = "开始时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date startTime ;
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
@Excel(name = "结束时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date endTime ;
|
||||
/**
|
||||
* 最大值
|
||||
*/
|
||||
@Excel(name = "最大值")
|
||||
private Long maxValue ;
|
||||
/**
|
||||
* 最小值
|
||||
*/
|
||||
@Excel(name = "最小值")
|
||||
private Long minValue ;
|
||||
/**
|
||||
* 平均值
|
||||
*/
|
||||
@Excel(name = "平均值")
|
||||
private Long avgValue ;
|
||||
/**
|
||||
* 中位数
|
||||
*/
|
||||
@Excel(name = "中位数")
|
||||
private Long medianValue ;
|
||||
/**
|
||||
* 是否发送预警
|
||||
*/
|
||||
@Excel(name = "是否发送预警")
|
||||
private Long status ;
|
||||
// /**
|
||||
// * 创建人
|
||||
// */
|
||||
// @Excel(name = "创建人")
|
||||
// private String createBy ;
|
||||
// /**
|
||||
// * 创建时间
|
||||
// */
|
||||
// @Excel(name = "创建时间")
|
||||
// private String createTime ;
|
||||
// /**
|
||||
// * 更新人
|
||||
// */
|
||||
// @Excel(name = "更新人")
|
||||
// private String updateBy ;
|
||||
// /**
|
||||
// * 更新时间
|
||||
// */
|
||||
// @Excel(name = "更新时间")
|
||||
// private String updateTime ;
|
||||
|
||||
}
|
|
@ -0,0 +1,53 @@
|
|||
package com.muyu.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.muyu.common.core.annotation.Excel;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 预警规则
|
||||
* @Author:蓬叁
|
||||
* @Package:com.muyu.warn.domain
|
||||
* @Project:cloud-server-8
|
||||
* @name:WarnRule
|
||||
* @Date:2024/9/20 下午7:20
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@TableName("warn_rule")
|
||||
@Tag(name = "预警规则")
|
||||
public class WarnRule {
|
||||
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
private String ruleName;
|
||||
private Long strategyId;
|
||||
private Long msgTypeId;
|
||||
private Long slideTime;
|
||||
private Long slideFrequency;
|
||||
private Long maxValue;
|
||||
private Long minValue;
|
||||
// /**
|
||||
// * 创建人
|
||||
// */
|
||||
// private String createBy ;
|
||||
// /**
|
||||
// * 创建时间
|
||||
// */
|
||||
// private String createTime ;
|
||||
// /**
|
||||
// * 更新人
|
||||
// */
|
||||
// private String updateBy ;
|
||||
// /**
|
||||
// * 更新时间
|
||||
// */
|
||||
// private String updateTime ;
|
||||
|
||||
}
|
|
@ -0,0 +1,53 @@
|
|||
package com.muyu.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.muyu.common.core.annotation.Excel;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 预警策略
|
||||
* @Author:蓬叁
|
||||
* @Package:com.muyu.warn.domain
|
||||
* @Project:cloud-server-8
|
||||
* @name:WarnStrategy
|
||||
* @Date:2024/9/20 下午7:27
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@TableName("warn_strategy")
|
||||
@Tag(name = "预警策略")
|
||||
public class WarnStrategy {
|
||||
|
||||
/**
|
||||
* 策略Id
|
||||
*/
|
||||
@TableId( type = IdType.AUTO)
|
||||
private Long id;
|
||||
private Long carTypeId ;
|
||||
private String strategyName ;
|
||||
private Long msgId ;
|
||||
|
||||
// /**
|
||||
// * 创建人
|
||||
// */
|
||||
// private String createBy ;
|
||||
// /**
|
||||
// * 创建时间
|
||||
// */
|
||||
// private String createTime ;
|
||||
// /**
|
||||
// * 更新人
|
||||
// */
|
||||
// private String updateBy ;
|
||||
// /**
|
||||
// * 更新时间
|
||||
// */
|
||||
// private String updateTime ;
|
||||
|
||||
}
|
|
@ -0,0 +1,81 @@
|
|||
package com.muyu.domain.message;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 站内信
|
||||
* @Author:weiran
|
||||
* @Package:com.muyu.cloud.faultmanage.domain.message
|
||||
* @Project:cloud-server-8
|
||||
* @name:Message
|
||||
* @Date:2024/9/22 10:40
|
||||
*/
|
||||
|
||||
@Tag(name = "站内信")
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@SuperBuilder
|
||||
@TableName(value = "car_fault_message",autoResultMap = true)
|
||||
public class Message {
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId(value = "id",type = IdType.AUTO)
|
||||
private long id;
|
||||
|
||||
/**
|
||||
* 发送者
|
||||
*/
|
||||
private String sender;
|
||||
|
||||
/**
|
||||
* 接收者
|
||||
*/
|
||||
private String receiver;
|
||||
|
||||
/**
|
||||
* 消息内容
|
||||
*/
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 消息状态
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Schema(description = "消息创建时间",defaultValue = "2024-8-9 10:47:57",type = "Date")
|
||||
private Date createTime;
|
||||
/**
|
||||
* 登录人Id
|
||||
*/
|
||||
private long userId;
|
||||
|
||||
|
||||
public static Message messageBuilder(Message message) {
|
||||
return Message.builder()
|
||||
.id(message.getId())
|
||||
.sender(message.getSender())
|
||||
.receiver(message.getReceiver())
|
||||
.content(message.getContent())
|
||||
.status(message.getStatus())
|
||||
.createTime(message.getCreateTime())
|
||||
.userId(message.getUserId())
|
||||
.build();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
package com.muyu.domain.message;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 消息状态
|
||||
* @Author:weiran
|
||||
* @Package:com.muyu.cloud.faultmanage.domain.message
|
||||
* @Project:cloud-server-8
|
||||
* @name:MessageReq
|
||||
* @Date:2024/9/22 11:00
|
||||
*/
|
||||
|
||||
@Tag(name = "消息状态")
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class MessageReq {
|
||||
/**
|
||||
* 消息状态
|
||||
*/
|
||||
private Integer status;
|
||||
/**
|
||||
* 登录人Id
|
||||
*/
|
||||
private long userId;
|
||||
}
|
|
@ -0,0 +1,51 @@
|
|||
package com.muyu.domain.message;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 消息发送参数
|
||||
* @Author:weiran
|
||||
* @Package:com.muyu.cloud.faultmanage.domain.message
|
||||
* @Project:cloud-server-8
|
||||
* @name:MessageReq
|
||||
* @Date:2024/9/22 11:00
|
||||
*/
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Tag(name = "消息发送参数")
|
||||
public class MessageSendReq {
|
||||
/**
|
||||
* 发送者
|
||||
*/
|
||||
private String sender;
|
||||
/**
|
||||
* 接收者
|
||||
*/
|
||||
private String receiver;
|
||||
|
||||
/**
|
||||
* 消息内容
|
||||
*/
|
||||
private String content;
|
||||
/**
|
||||
* 登录人Id
|
||||
*/
|
||||
private long userId;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Schema(description = "消息创建时间",defaultValue = "2024-8-9 10:47:57",type = "String")
|
||||
private Date createTime;
|
||||
}
|
|
@ -6,6 +6,7 @@ import lombok.Data;
|
|||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 车辆电子围栏组请求对象
|
||||
* @Author:yang
|
||||
* @Package:com.muyu.domain.req
|
||||
* @Project:cloud-server-8
|
||||
|
@ -15,7 +16,7 @@ import lombok.NoArgsConstructor;
|
|||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Tag(name = "车辆电子围栏组响应参数")
|
||||
@Tag(name = "车辆电子围栏组请求对象")
|
||||
public class CarFenceGroupReq {
|
||||
/**
|
||||
* 车辆ID
|
|
@ -8,6 +8,7 @@ import lombok.Data;
|
|||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 电子围栏请求对象
|
||||
* @Author:yang
|
||||
* @Package:com.muyu.domain.req
|
||||
* @Project:cloud-electronic
|
||||
|
@ -17,7 +18,7 @@ import lombok.NoArgsConstructor;
|
|||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Tag(name = "电子围栏响应参数")
|
||||
@Tag(name = "电子围栏请求对象")
|
||||
public class CarFenceReq {
|
||||
|
||||
/**
|
|
@ -6,6 +6,7 @@ import lombok.Data;
|
|||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 围栏组电子围栏请求对象
|
||||
* @Author:yang
|
||||
* @Package:com.muyu.domain.req
|
||||
* @Project:cloud-server-8
|
||||
|
@ -15,7 +16,7 @@ import lombok.NoArgsConstructor;
|
|||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Tag(name = "围栏组电子围栏响应参数")
|
||||
@Tag(name = "围栏组电子围栏请求对象")
|
||||
public class CarGroupIdReq {
|
||||
/**
|
||||
* 围栏组Id
|
|
@ -10,6 +10,7 @@ import lombok.NoArgsConstructor;
|
|||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 车辆电子围栏请求对象
|
||||
* @Author:yang
|
||||
* @Package:com.muyu.domain.req
|
||||
* @Project:cloud-server-8
|
||||
|
@ -19,7 +20,7 @@ import java.util.List;
|
|||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Tag(name = "车辆电子围栏响应参数")
|
||||
@Tag(name = "车辆电子围栏请求对象")
|
||||
public class CarGroupReq {
|
||||
/**
|
||||
* 车辆
|
|
@ -0,0 +1,86 @@
|
|||
package com.muyu.domain.req;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
/**
|
||||
* 车辆管理信息添加请求对象
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Tag(name = "车辆管理信息添加请求对象")
|
||||
public class CarInformationAddReq {
|
||||
|
||||
/**
|
||||
* 车辆唯一VIN
|
||||
*/
|
||||
private String carInformationVin;
|
||||
|
||||
/**
|
||||
* 车牌号
|
||||
*/
|
||||
private String carInformationLicensePlate;
|
||||
|
||||
/**
|
||||
* 车辆品牌
|
||||
*/
|
||||
private String carInformationBrand;
|
||||
|
||||
/**
|
||||
* 车辆颜色
|
||||
*/
|
||||
private String carInformationColor;
|
||||
|
||||
/**
|
||||
* 车辆驾驶员
|
||||
*/
|
||||
private String carInformationDriver;
|
||||
|
||||
/**
|
||||
* 车检到期日期
|
||||
*/
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd")
|
||||
private String carInformationExamineEnddata;
|
||||
|
||||
/**
|
||||
* 车辆电机厂商
|
||||
*/
|
||||
private String carInformationMotorManufacturer;
|
||||
|
||||
/**
|
||||
* 车辆电机型号
|
||||
*/
|
||||
private String carInformationMotorModel;
|
||||
|
||||
/**
|
||||
* 车辆电池厂商
|
||||
*/
|
||||
private String carInformationBatteryManufacturer;
|
||||
|
||||
/**
|
||||
* 车辆电池型号
|
||||
*/
|
||||
private String carInformationBatteryModel;
|
||||
|
||||
/**
|
||||
* 车辆电子围栏外键ID
|
||||
*/
|
||||
private Integer carInformationFence;
|
||||
|
||||
/**
|
||||
* 车辆类型外键ID
|
||||
*/
|
||||
private Integer carInformationType;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,112 @@
|
|||
package com.muyu.domain.req;
|
||||
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* 车辆管理列表请求对象
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@SuperBuilder
|
||||
@Tag(name="车辆管理列表请求对象")
|
||||
public class CarInformationListReq {
|
||||
|
||||
/**
|
||||
* 车辆唯一VIN
|
||||
*/
|
||||
@Schema(
|
||||
description = "车辆唯一VIN",
|
||||
type = "String"
|
||||
)
|
||||
private String carInformationVIN;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 车辆类型ID
|
||||
*/
|
||||
@Schema(
|
||||
description = "车辆类型ID",
|
||||
type = "Interger"
|
||||
)
|
||||
private Integer carTypeId;
|
||||
|
||||
/**
|
||||
* 车辆电子围栏外键ID
|
||||
*/
|
||||
@Schema(
|
||||
description = "车辆电子围栏外键ID",
|
||||
type = "Interger"
|
||||
)
|
||||
private Integer carInformationFence;
|
||||
|
||||
/**
|
||||
* 启用状态(1.在线 2.离线 3.已断开 4.待连接 5.维修中)
|
||||
*/
|
||||
@Schema(
|
||||
description = "启用状态(1.在线 2.离线 3.已断开 4.待连接 5.维修中)",
|
||||
type = "Interger"
|
||||
)
|
||||
private Integer carInformationState;
|
||||
|
||||
/**
|
||||
* 车辆电机厂商
|
||||
*/
|
||||
@Schema(
|
||||
description = "车辆电机厂商",
|
||||
type = "String"
|
||||
)
|
||||
private String carInformationMotorManufacturer;
|
||||
|
||||
/**
|
||||
* 车辆电机型号
|
||||
*/
|
||||
@Schema(
|
||||
description = "车辆电机型号",
|
||||
type = "String"
|
||||
)
|
||||
private String carInformationMotorModel;
|
||||
|
||||
/**
|
||||
* 车辆电池厂商
|
||||
*/
|
||||
@Schema(
|
||||
description = "车辆电池厂商",
|
||||
type = "String"
|
||||
)
|
||||
private String carInformationBatteryManufacturer;
|
||||
|
||||
/**
|
||||
* 车辆电池型号
|
||||
*/
|
||||
@Schema(
|
||||
description = "车辆电池型号",
|
||||
type = "String"
|
||||
)
|
||||
private String carInformationBatteryModel;
|
||||
|
||||
//分页页数
|
||||
private Integer pageNum = 1;
|
||||
//分页条数
|
||||
private Integer pageSize = 5;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,102 @@
|
|||
package com.muyu.domain.req;
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* 车辆管理修改操作请求对象
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@SuperBuilder
|
||||
@Tag(name = "车辆管理修改操作请求对象")
|
||||
public class CarInformationUpdReq {
|
||||
|
||||
/**
|
||||
* 车辆ID
|
||||
*/
|
||||
@Schema(title = "车辆管理主键", type = "Long")
|
||||
private Long carInformationId;
|
||||
|
||||
/**
|
||||
* 车辆品牌
|
||||
*/
|
||||
@Schema(title = "车辆品牌", type = "String")
|
||||
private String carInformationBrand;
|
||||
|
||||
/**
|
||||
* 车辆颜色
|
||||
*/
|
||||
@Schema(title = "车辆颜色", type = "String")
|
||||
private String carInformationColor;
|
||||
|
||||
/**
|
||||
* 车辆驾驶员
|
||||
*/
|
||||
@Schema(title = "车辆驾驶员", type = "String")
|
||||
private String carInformationDriver;
|
||||
/**
|
||||
* 车辆电机厂商
|
||||
*/
|
||||
@Schema(title = "车辆电机厂商", type = "String")
|
||||
private String carInformationMotorManufacturer;
|
||||
|
||||
/**
|
||||
* 车辆电机型号
|
||||
*/
|
||||
@Schema(title = "车辆电机型号", type = "String")
|
||||
private String carInformationMotorModel;
|
||||
|
||||
/**
|
||||
* 车辆电池厂商
|
||||
*/
|
||||
@Schema(title = "车辆电池厂商", type = "String")
|
||||
private String carInformationBatteryManufacturer;
|
||||
|
||||
/**
|
||||
* 车辆电池型号
|
||||
*/
|
||||
@Schema(title = "车辆电池型号", type = "String")
|
||||
private String carInformationBatteryModel;
|
||||
|
||||
/**
|
||||
* 车辆电子围栏外键ID
|
||||
*/
|
||||
@Schema(title = "车辆电子围栏外键ID", type = "Integer")
|
||||
private Integer carInformationFence;
|
||||
|
||||
/**
|
||||
* 车辆类型外键ID
|
||||
*/
|
||||
@Schema(title = "车辆类型外键ID", type = "Integer")
|
||||
private Integer carInformationType;
|
||||
|
||||
/**
|
||||
* 是否重点车辆 (0否默认 1是 )
|
||||
*/
|
||||
@Schema(title = "是否重点车辆 (0否默认 1是 )", type = "Integer")
|
||||
private Integer carInformationFocus;
|
||||
|
||||
/**
|
||||
* 启用状态(1.在线 2.离线 3.已断开 4.待连接 5.维修中)
|
||||
*/
|
||||
@Schema(title = "启用状态(1.在线 2.离线 3.已断开 4.待连接 5.维修中)", type = "Integer")
|
||||
private Integer carInformationState;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,71 @@
|
|||
package com.muyu.domain.req;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
/**
|
||||
* 故障码添加请求对象
|
||||
* @Author:weiran
|
||||
* @Package:com.muyu.cloud.faultmanage.domain.req
|
||||
* @Project:cloud-server-8
|
||||
* @name:FaultCodeAddReq
|
||||
* @Date:2024/9/18 10:12
|
||||
*/
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class FaultCodeAddReq {
|
||||
|
||||
/**
|
||||
*故障名称Id
|
||||
*/
|
||||
private long messageTypeId;
|
||||
/**
|
||||
* 故障名称
|
||||
*/
|
||||
private String messageTypeName;
|
||||
/**
|
||||
* 报文编码
|
||||
*/
|
||||
private String messageTypeCode;
|
||||
|
||||
/**
|
||||
* 故障码
|
||||
*/
|
||||
private String faultcodeNumber;
|
||||
/**
|
||||
* 故障分类Id
|
||||
*/
|
||||
private long faulttypeId;
|
||||
/**
|
||||
* 是否产生报警
|
||||
*/
|
||||
private Integer isWarning;
|
||||
/**
|
||||
* 故障描述
|
||||
*/
|
||||
private String faultContent;
|
||||
/**
|
||||
*故障组
|
||||
*/
|
||||
private String faultGroup;
|
||||
/**
|
||||
*故障位
|
||||
*/
|
||||
private String faultBit;
|
||||
/**
|
||||
*故障值
|
||||
*/
|
||||
private String faultValue;
|
||||
/**
|
||||
*报文所属类别
|
||||
*/
|
||||
private String messageTypeBelongs;
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
package com.muyu.domain.req;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 故障码列表条件查询请求对象
|
||||
* @Author:weiran
|
||||
* @Package:com.muyu.cloud.faultmanage.domain.req
|
||||
* @Project:cloud-faultmanage
|
||||
* @name:FaultCodeListReq
|
||||
* @Date:2024/9/17 15:55
|
||||
*/
|
||||
|
||||
@Tag(name = "故障码列表请求对象")
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class FaultCodeListReq {
|
||||
|
||||
/**
|
||||
*故障码
|
||||
*/
|
||||
private String faultcodeNumber;
|
||||
/**
|
||||
*故障位
|
||||
*/
|
||||
private String faultBit;
|
||||
/**
|
||||
* 页码,从1开始
|
||||
*/
|
||||
private Integer pageNum=1;
|
||||
/**
|
||||
* 每页大小
|
||||
*/
|
||||
private Integer pageSize=10;
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,81 @@
|
|||
package com.muyu.domain.req;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
*
|
||||
* 故障码修改请求对象
|
||||
* @Author:weiran
|
||||
* @Package:com.muyu.cloud.faultmanage.domain.req
|
||||
* @Project:cloud-server-8
|
||||
* @name:FaultCodeAddReq
|
||||
* @Date:2024/9/18 10:12
|
||||
*/
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class FaultCodeUpdReq {
|
||||
|
||||
/**
|
||||
*故障码Id
|
||||
*/
|
||||
private long faultcodeId;
|
||||
/**
|
||||
*故障名称Id
|
||||
*/
|
||||
private long messageTypeId;
|
||||
/**
|
||||
* 故障名称
|
||||
*/
|
||||
private String messageTypeName;
|
||||
/**
|
||||
* 报文编码
|
||||
*/
|
||||
private String messageTypeCode;
|
||||
/**
|
||||
* 故障码
|
||||
*/
|
||||
private String faultcodeNumber;
|
||||
/**
|
||||
* 故障分类Id
|
||||
*/
|
||||
private long faulttypeId;
|
||||
/**
|
||||
* 是否产生报警
|
||||
*/
|
||||
private Integer isWarning;
|
||||
/**
|
||||
* 故障描述
|
||||
*/
|
||||
private String faultContent;
|
||||
/**
|
||||
*故障状态
|
||||
*/
|
||||
private Integer faultStatus;
|
||||
/**
|
||||
*故障组
|
||||
*/
|
||||
private String faultGroup;
|
||||
/**
|
||||
*故障位
|
||||
*/
|
||||
private String faultBit;
|
||||
/**
|
||||
*故障值
|
||||
*/
|
||||
private String faultValue;
|
||||
/**
|
||||
*报文所属类别
|
||||
*/
|
||||
private String messageTypeBelongs;
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,46 @@
|
|||
package com.muyu.domain.req;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 故障规则制定请求对象
|
||||
* @Author:weiran
|
||||
* @Package:com.muyu.cloud.faultmanage.domain.req
|
||||
* @Project:cloud-server-8
|
||||
* @name:FaultConditionAddReq
|
||||
* @Date:2024/9/21 21:02
|
||||
*/
|
||||
@Tag(name = "故障规则制定请求对象")
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class FaultConditionAddReq {
|
||||
/**
|
||||
* 故障规则表Id
|
||||
*/
|
||||
private long carconditionId;
|
||||
/**
|
||||
* 车辆类型Id
|
||||
*/
|
||||
private long carTypeId;
|
||||
/**
|
||||
*故障名称Id
|
||||
*/
|
||||
private long messageTypeId;
|
||||
/**
|
||||
* 故障条件
|
||||
*/
|
||||
private String faultconditionIdentification;
|
||||
/**
|
||||
* 故障规则参数
|
||||
*/
|
||||
private BigDecimal faultconditionParameter;
|
||||
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
package com.muyu.domain.req;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 故障规则列表条件查询请求对象
|
||||
* @Author:weiran
|
||||
* @Package:com.muyu.cloud.faultmanage.domain.req
|
||||
* @Project:cloud-server-8
|
||||
* @name:FaultCondition
|
||||
* @Date:2024/9/21 20:02
|
||||
*/
|
||||
@Tag(name = "故障规则列表请求对象")
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class FaultConditionListReq {
|
||||
|
||||
|
||||
/**
|
||||
* 车辆类型Id
|
||||
*/
|
||||
private long carTypeId;
|
||||
/**
|
||||
*故障名称Id
|
||||
*/
|
||||
private long messageTypeId;
|
||||
/**
|
||||
* 页码,从1开始
|
||||
*/
|
||||
private Integer pageNum=1;
|
||||
/**
|
||||
* 每页大小
|
||||
*/
|
||||
private Integer pageSize=10;
|
||||
}
|
|
@ -0,0 +1,46 @@
|
|||
package com.muyu.domain.req;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 故障规则修改请求对象
|
||||
* @Author:weiran
|
||||
* @Package:com.muyu.cloud.faultmanage.domain.req
|
||||
* @Project:cloud-server-8
|
||||
* @name:FaultConditionUpdReq
|
||||
* @Date:2024/9/22 9:38
|
||||
*/
|
||||
@Tag(name = "故障规则修改请求对象")
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class FaultConditionUpdReq {
|
||||
|
||||
/**
|
||||
* 故障规则表Id
|
||||
*/
|
||||
private long carconditionId;
|
||||
/**
|
||||
* 车辆类型Id
|
||||
*/
|
||||
private long carTypeId;
|
||||
/**
|
||||
*故障名称Id
|
||||
*/
|
||||
private long messageTypeId;
|
||||
/**
|
||||
* 故障条件
|
||||
*/
|
||||
private String faultconditionIdentification;
|
||||
/**
|
||||
* 故障规则参数
|
||||
*/
|
||||
private BigDecimal faultconditionParameter;
|
||||
}
|
|
@ -0,0 +1,58 @@
|
|||
package com.muyu.domain.req;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 故障日志列表请求对象
|
||||
* @Author:weiran
|
||||
* @Package:com.muyu.cloud.faultmanage.domain.req
|
||||
* @Project:cloud-server-8
|
||||
* @name:FaultLogReq
|
||||
* @Date:2024/9/20 9:38
|
||||
*/
|
||||
|
||||
@Tag(name = "故障日志列表请求对象")
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class FaultLogListReq {
|
||||
|
||||
/**
|
||||
* 故障码Id
|
||||
*/
|
||||
private long faultcodeId;
|
||||
/**
|
||||
* 车辆VIN
|
||||
*/
|
||||
private String carVin;
|
||||
/**
|
||||
* 开始报警时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Schema(description = "开始报警时间",defaultValue = "2024-8-9 10:47:57",type = "Date")
|
||||
private Date startwarningTime;
|
||||
/**
|
||||
* 结束报警时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Schema(description = "结束报警时间",defaultValue = "2024-8-9 10:47:57",type = "Date")
|
||||
private Date endwarningTime;
|
||||
|
||||
/**
|
||||
* 页码,从1开始
|
||||
*/
|
||||
private Integer pageNum=1;
|
||||
/**
|
||||
* 每页大小
|
||||
*/
|
||||
private Integer pageSize=10;
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue