解决冲突文件
commit
cd41265b79
|
@ -1,5 +1,6 @@
|
||||||
# Tomcat
|
# Tomcat
|
||||||
server:
|
server:
|
||||||
|
<<<<<<<< HEAD:cloud-modules/cloud-modules-data-processing/src/main/resources/bootstrap.yml
|
||||||
port: 9711
|
port: 9711
|
||||||
|
|
||||||
# nacos线上地址
|
# nacos线上地址
|
||||||
|
@ -8,6 +9,16 @@ nacos:
|
||||||
user-name: nacos
|
user-name: nacos
|
||||||
password: nacos
|
password: nacos
|
||||||
namespace: one-saas
|
namespace: one-saas
|
||||||
|
========
|
||||||
|
port: 10010
|
||||||
|
|
||||||
|
# nacos线上地址
|
||||||
|
nacos:
|
||||||
|
addr: 110.42.213.184:8848
|
||||||
|
user-name: nacos
|
||||||
|
password: nacos
|
||||||
|
namespace: icecream
|
||||||
|
>>>>>>>> dev.saas.customer:cloud-modules/cloud-modules-openbusiness/cloud-modules-openbusiness-server/src/main/resources/bootstrap.yml
|
||||||
# SPRING_AMQP_DESERIALIZATION_TRUST_ALL=true spring.amqp.deserialization.trust.all
|
# SPRING_AMQP_DESERIALIZATION_TRUST_ALL=true spring.amqp.deserialization.trust.all
|
||||||
# Spring
|
# Spring
|
||||||
spring:
|
spring:
|
||||||
|
@ -26,7 +37,11 @@ spring:
|
||||||
allow-bean-definition-overriding: true
|
allow-bean-definition-overriding: true
|
||||||
application:
|
application:
|
||||||
# 应用名称
|
# 应用名称
|
||||||
|
<<<<<<<< HEAD:cloud-modules/cloud-modules-data-processing/src/main/resources/bootstrap.yml
|
||||||
name: cloud-data-processing
|
name: cloud-data-processing
|
||||||
|
========
|
||||||
|
name: cloud-car
|
||||||
|
>>>>>>>> dev.saas.customer:cloud-modules/cloud-modules-openbusiness/cloud-modules-openbusiness-server/src/main/resources/bootstrap.yml
|
||||||
profiles:
|
profiles:
|
||||||
# 环境配置
|
# 环境配置
|
||||||
active: dev
|
active: dev
|
||||||
|
@ -35,19 +50,19 @@ spring:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: ${nacos.addr}
|
server-addr: ${nacos.addr}
|
||||||
# nacos用户名
|
# # nacos用户名
|
||||||
username: ${nacos.user-name}
|
# username: ${nacos.user-name}
|
||||||
# nacos密码
|
# # nacos密码
|
||||||
password: ${nacos.password}
|
# password: ${nacos.password}
|
||||||
# 命名空间
|
# 命名空间
|
||||||
namespace: ${nacos.namespace}
|
namespace: ${nacos.namespace}
|
||||||
config:
|
config:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: ${nacos.addr}
|
server-addr: ${nacos.addr}
|
||||||
# nacos用户名
|
# # nacos用户名
|
||||||
username: ${nacos.user-name}
|
# username: ${nacos.user-name}
|
||||||
# nacos密码
|
# # nacos密码
|
||||||
password: ${nacos.password}
|
# password: ${nacos.password}
|
||||||
# 命名空间
|
# 命名空间
|
||||||
namespace: ${nacos.namespace}
|
namespace: ${nacos.namespace}
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
|
@ -69,4 +84,7 @@ logging:
|
||||||
level:
|
level:
|
||||||
com.muyu.system.mapper: DEBUG
|
com.muyu.system.mapper: DEBUG
|
||||||
|
|
||||||
|
<<<<<<<< HEAD:cloud-modules/cloud-modules-data-processing/src/main/resources/bootstrap.yml
|
||||||
cacheNames: fault,fence,warming
|
cacheNames: fault,fence,warming
|
||||||
|
========
|
||||||
|
>>>>>>>> dev.saas.customer:cloud-modules/cloud-modules-openbusiness/cloud-modules-openbusiness-server/src/main/resources/bootstrap.yml
|
||||||
|
|
|
@ -16,3 +16,4 @@ public class CloudFileApplication {
|
||||||
System.out.println("CloudFile 模块启动成功!");
|
System.out.println("CloudFile 模块启动成功!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -54,5 +54,10 @@
|
||||||
<artifactId>spring-boot-starter-web</artifactId>
|
<artifactId>spring-boot-starter-web</artifactId>
|
||||||
<version>3.3.2</version>
|
<version>3.3.2</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>redis.clients</groupId>
|
||||||
|
<artifactId>jedis</artifactId>
|
||||||
|
<version>4.2.2</version>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
package com.muyu.openbusiness.domain;
|
||||||
|
|
||||||
|
import com.muyu.common.core.annotation.Excel;
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
@Setter
|
||||||
|
@Getter
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Data
|
||||||
|
public class Animal {
|
||||||
|
@Excel
|
||||||
|
private String aId;
|
||||||
|
@Excel
|
||||||
|
private String color;
|
||||||
|
@Excel
|
||||||
|
private String hobby;
|
||||||
|
@Excel
|
||||||
|
private String aName;
|
||||||
|
}
|
|
@ -0,0 +1,20 @@
|
||||||
|
package com.muyu.openbusiness.domain;
|
||||||
|
|
||||||
|
import io.micrometer.observation.annotation.Observed;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.ToString;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@ToString
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class Person {
|
||||||
|
private String person;
|
||||||
|
private Integer Age;
|
||||||
|
private String name;
|
||||||
|
private String Nation;
|
||||||
|
private String Animal;
|
||||||
|
private Integer id;
|
||||||
|
}
|
|
@ -0,0 +1,4 @@
|
||||||
|
package com.muyu.openbusiness.domain;
|
||||||
|
|
||||||
|
public interface RedisService {
|
||||||
|
}
|
|
@ -0,0 +1,27 @@
|
||||||
|
package com.muyu.openbusiness.domain;
|
||||||
|
|
||||||
|
import java.io.*;
|
||||||
|
|
||||||
|
public class SerializeUtil {
|
||||||
|
public static byte[] serialize(Object object){
|
||||||
|
ObjectOutputStream oos =null;
|
||||||
|
ByteArrayOutputStream baos =null;
|
||||||
|
try{
|
||||||
|
//序列化
|
||||||
|
baos =new ByteArrayOutputStream();
|
||||||
|
oos =new ObjectOutputStream(baos);
|
||||||
|
oos.writeObject(object);
|
||||||
|
byte[] bytes =baos.toByteArray();
|
||||||
|
return bytes;
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
public static Object unserialize(byte[] bytes) throws IOException {
|
||||||
|
ByteArrayInputStream bais =null;
|
||||||
|
bais =new ByteArrayInputStream(bytes);
|
||||||
|
ObjectInputStream ois =new ObjectInputStream(bais);
|
||||||
|
return ois.available();
|
||||||
|
}
|
||||||
|
}
|
|
@ -18,6 +18,7 @@
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|
||||||
<!-- SpringCloud Alibaba Nacos -->
|
<!-- SpringCloud Alibaba Nacos -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.alibaba.cloud</groupId>
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
|
@ -41,7 +42,15 @@
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>cloud-common-saas</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>cloud-common-system</artifactId>
|
||||||
|
</dependency>
|
||||||
<!-- Mysql Connector -->
|
<!-- Mysql Connector -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.mysql</groupId>
|
<groupId>com.mysql</groupId>
|
||||||
|
@ -66,6 +75,11 @@
|
||||||
<artifactId>cloud-common-log</artifactId>
|
<artifactId>cloud-common-log</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>cloud-common-redis</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- 接口模块 -->
|
<!-- 接口模块 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.muyu</groupId>
|
<groupId>com.muyu</groupId>
|
||||||
|
@ -88,12 +102,7 @@
|
||||||
<artifactId>bcpkix-jdk15on</artifactId>
|
<artifactId>bcpkix-jdk15on</artifactId>
|
||||||
<version>1.70</version>
|
<version>1.70</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>com.muyu</groupId>
|
|
||||||
<artifactId>cloud-modules-carmanage</artifactId>
|
|
||||||
<version>3.6.3</version>
|
|
||||||
<scope>compile</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.muyu</groupId>
|
<groupId>com.muyu</groupId>
|
||||||
<artifactId>cloud-modules-openbusiness-common</artifactId>
|
<artifactId>cloud-modules-openbusiness-common</artifactId>
|
||||||
|
@ -101,16 +110,17 @@
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.muyu</groupId>
|
|
||||||
<artifactId>cloud-common-saas</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.muyu</groupId>
|
<groupId>com.muyu</groupId>
|
||||||
<artifactId>cloud-common-system</artifactId>
|
<artifactId>cloud-modules-carmanage</artifactId>
|
||||||
|
<version>3.6.3</version>
|
||||||
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.cloud</groupId>
|
<groupId>org.springframework.cloud</groupId>
|
||||||
<artifactId>spring-cloud-starter-openfeign</artifactId>
|
<artifactId>spring-cloud-starter-openfeign</artifactId>
|
||||||
|
|
|
@ -0,0 +1,108 @@
|
||||||
|
package com.muyu.openbusiness.config;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description :
|
||||||
|
* Created by ZhangYi
|
||||||
|
* Date :2024/10/04
|
||||||
|
*/
|
||||||
|
public class SnowflakeIdWorker{
|
||||||
|
/** 开始时间截 (这个用自己业务系统上线的时间) */
|
||||||
|
private final long twepoch = 1575365018000L;
|
||||||
|
|
||||||
|
/** 机器id所占的位数 */
|
||||||
|
private final long workerIdBits = 10L;
|
||||||
|
|
||||||
|
/** 支持的最大机器id,结果是31 (这个移位算法可以很快的计算出几位二进制数所能表示的最大十进制数) */
|
||||||
|
private final long maxWorkerId = -1L ^ (-1L << workerIdBits);
|
||||||
|
|
||||||
|
/** 序列在id中占的位数 */
|
||||||
|
private final long sequenceBits = 12L;
|
||||||
|
|
||||||
|
/** 机器ID向左移12位 */
|
||||||
|
private final long workerIdShift = sequenceBits;
|
||||||
|
|
||||||
|
/** 时间截向左移22位(10+12) */
|
||||||
|
private final long timestampLeftShift = sequenceBits + workerIdBits;
|
||||||
|
|
||||||
|
/** 生成序列的掩码,这里为4095 (0b111111111111=0xfff=4095) */
|
||||||
|
private final long sequenceMask = -1L ^ (-1L << sequenceBits);
|
||||||
|
|
||||||
|
/** 工作机器ID(0~1024) */
|
||||||
|
private long workerId;
|
||||||
|
|
||||||
|
/** 毫秒内序列(0~4095) */
|
||||||
|
private long sequence = 0L;
|
||||||
|
|
||||||
|
/** 上次生成ID的时间截 */
|
||||||
|
private long lastTimestamp = -1L;
|
||||||
|
|
||||||
|
//==============================Constructors=====================================
|
||||||
|
/**
|
||||||
|
* 构造函数
|
||||||
|
* @param workerId 工作ID (0~1024)
|
||||||
|
*/
|
||||||
|
public void SnowMaker(long workerId) {
|
||||||
|
if (workerId > maxWorkerId || workerId < 0) {
|
||||||
|
throw new IllegalArgumentException(String.format("workerId can't be greater than %d or less than 0", maxWorkerId));
|
||||||
|
}
|
||||||
|
this.workerId = workerId;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ==============================Methods==========================================
|
||||||
|
/**
|
||||||
|
* 获得下一个ID (该方法是线程安全的)
|
||||||
|
* @return SnowflakeId
|
||||||
|
*/
|
||||||
|
public synchronized long nextId() {
|
||||||
|
long timestamp = timeGen();
|
||||||
|
|
||||||
|
//如果当前时间小于上一次ID生成的时间戳,说明系统时钟回退过这个时候应当抛出异常
|
||||||
|
if (timestamp < lastTimestamp) {
|
||||||
|
throw new RuntimeException(
|
||||||
|
String.format("Clock moved backwards. Refusing to generate id for %d milliseconds", lastTimestamp - timestamp));
|
||||||
|
}
|
||||||
|
|
||||||
|
//如果是同一时间生成的,则进行毫秒内序列
|
||||||
|
if (lastTimestamp == timestamp) {
|
||||||
|
sequence = (sequence + 1) & sequenceMask;
|
||||||
|
//毫秒内序列溢出
|
||||||
|
if (sequence == 0) {
|
||||||
|
//阻塞到下一个毫秒,获得新的时间戳
|
||||||
|
timestamp = tilNextMillis(lastTimestamp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//时间戳改变,毫秒内序列重置
|
||||||
|
else {
|
||||||
|
sequence = 0L;
|
||||||
|
}
|
||||||
|
|
||||||
|
//上次生成ID的时间截
|
||||||
|
lastTimestamp = timestamp;
|
||||||
|
|
||||||
|
//移位并通过或运算拼到一起组成64位的ID
|
||||||
|
return ((timestamp - twepoch) << timestampLeftShift) //
|
||||||
|
| (workerId << workerIdShift) //
|
||||||
|
| sequence;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 阻塞到下一个毫秒,直到获得新的时间戳
|
||||||
|
* @param lastTimestamp 上次生成ID的时间截
|
||||||
|
* @return 当前时间戳
|
||||||
|
*/
|
||||||
|
protected long tilNextMillis(long lastTimestamp) {
|
||||||
|
long timestamp = timeGen();
|
||||||
|
while (timestamp <= lastTimestamp) {
|
||||||
|
timestamp = timeGen();
|
||||||
|
}
|
||||||
|
return timestamp;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 返回以毫秒为单位的当前时间
|
||||||
|
* @return 当前时间(毫秒)
|
||||||
|
*/
|
||||||
|
protected long timeGen() {
|
||||||
|
return System.currentTimeMillis();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,4 @@
|
||||||
|
package com.muyu.openbusiness.controller;
|
||||||
|
|
||||||
|
public class RailController {
|
||||||
|
}
|
|
@ -1,6 +1,5 @@
|
||||||
package com.muyu.openbusiness.mapper;
|
package com.muyu.openbusiness.mapper;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import com.github.yulichang.base.MPJBaseMapper;
|
import com.github.yulichang.base.MPJBaseMapper;
|
||||||
import com.muyu.openbusiness.domain.Messages;
|
import com.muyu.openbusiness.domain.Messages;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
|
@ -3,10 +3,12 @@ package com.muyu.openbusiness.service.impl;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.muyu.common.core.utils.StringUtils;
|
import com.muyu.common.core.utils.StringUtils;
|
||||||
|
import com.muyu.openbusiness.config.SnowflakeIdWorker;
|
||||||
import com.muyu.openbusiness.domain.SysCarMessage;
|
import com.muyu.openbusiness.domain.SysCarMessage;
|
||||||
import com.muyu.openbusiness.mapper.SysCarMessageMapper;
|
import com.muyu.openbusiness.mapper.SysCarMessageMapper;
|
||||||
import com.muyu.openbusiness.service.ISysCarMessageService;
|
import com.muyu.openbusiness.service.ISysCarMessageService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.data.redis.core.RedisTemplate;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.util.Assert;
|
import org.springframework.util.Assert;
|
||||||
|
|
||||||
|
@ -18,6 +20,10 @@ import java.util.List;
|
||||||
* @author muyu
|
* @author muyu
|
||||||
* @date 2024-09-18
|
* @date 2024-09-18
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class SysCarMessageServiceImpl
|
public class SysCarMessageServiceImpl
|
||||||
extends ServiceImpl<SysCarMessageMapper, SysCarMessage>
|
extends ServiceImpl<SysCarMessageMapper, SysCarMessage>
|
||||||
|
@ -30,12 +36,17 @@ public class SysCarMessageServiceImpl
|
||||||
* @param id 车辆报文记录主键
|
* @param id 车辆报文记录主键
|
||||||
* @return 车辆报文记录
|
* @return 车辆报文记录
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
RedisTemplate
|
||||||
|
redisTemplate;
|
||||||
@Override
|
@Override
|
||||||
public SysCarMessage selectSysCarMessageById(Long id)
|
public SysCarMessage selectSysCarMessageById(Long id)
|
||||||
{
|
{
|
||||||
LambdaQueryWrapper<SysCarMessage> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<SysCarMessage> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
Assert.notNull(id, "id不可为空");
|
Assert.notNull(id, "id不可为空");
|
||||||
queryWrapper.eq(SysCarMessage::getId, id);
|
queryWrapper.eq(SysCarMessage::getId, id);
|
||||||
|
|
||||||
return this.getOne(queryWrapper);
|
return this.getOne(queryWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,6 +67,15 @@ public class SysCarMessageServiceImpl
|
||||||
if (StringUtils.isNotEmpty(sysCarMessage.getMessageType())){
|
if (StringUtils.isNotEmpty(sysCarMessage.getMessageType())){
|
||||||
queryWrapper.eq(SysCarMessage::getMessageType, sysCarMessage.getMessageType());
|
queryWrapper.eq(SysCarMessage::getMessageType, sysCarMessage.getMessageType());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//生成一个时间唯一戳
|
||||||
|
SnowflakeIdWorker snowMaker = new SnowflakeIdWorker();
|
||||||
|
for (int i = 0; i < 100; i++) {
|
||||||
|
long id = snowMaker.nextId();
|
||||||
|
System.out.println(id);
|
||||||
|
|
||||||
|
}
|
||||||
|
redisTemplate.opsForValue().set("id",list(queryWrapper));
|
||||||
return this.list(queryWrapper);
|
return this.list(queryWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,8 +87,7 @@ public class SysCarMessageServiceImpl
|
||||||
@Override
|
@Override
|
||||||
public Boolean checkIdUnique(SysCarMessage sysCarMessage) {
|
public Boolean checkIdUnique(SysCarMessage sysCarMessage) {
|
||||||
LambdaQueryWrapper<SysCarMessage> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<SysCarMessage> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
queryWrapper.eq(SysCarMessage::getModelCode, sysCarMessage.getModelCode())
|
queryWrapper.eq(SysCarMessage::getId, sysCarMessage.getId());
|
||||||
.eq(SysCarMessage::getMessageTypeCode, sysCarMessage.getMessageTypeCode());
|
|
||||||
return this.count(queryWrapper) > 0;
|
return this.count(queryWrapper) > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,9 +3,12 @@ package com.muyu.openbusiness.service.impl;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.muyu.common.core.utils.StringUtils;
|
import com.muyu.common.core.utils.StringUtils;
|
||||||
|
import com.muyu.openbusiness.config.SnowflakeIdWorker;
|
||||||
import com.muyu.openbusiness.domain.SysCar;
|
import com.muyu.openbusiness.domain.SysCar;
|
||||||
import com.muyu.openbusiness.mapper.SysCarMapper;
|
import com.muyu.openbusiness.mapper.SysCarMapper;
|
||||||
import com.muyu.openbusiness.service.ISysCarService;
|
import com.muyu.openbusiness.service.ISysCarService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.data.redis.core.RedisTemplate;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.util.Assert;
|
import org.springframework.util.Assert;
|
||||||
|
|
||||||
|
@ -28,6 +31,9 @@ public class SysCarServiceImpl
|
||||||
* @param id 车辆基础信息主键
|
* @param id 车辆基础信息主键
|
||||||
* @return 车辆基础信息
|
* @return 车辆基础信息
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
RedisTemplate redisTemplate;
|
||||||
@Override
|
@Override
|
||||||
public SysCar selectSysCarById(Long id)
|
public SysCar selectSysCarById(Long id)
|
||||||
{
|
{
|
||||||
|
@ -72,6 +78,15 @@ public class SysCarServiceImpl
|
||||||
if (StringUtils.isNotEmpty(sysCar.getState())){
|
if (StringUtils.isNotEmpty(sysCar.getState())){
|
||||||
queryWrapper.eq(SysCar::getState, sysCar.getState());
|
queryWrapper.eq(SysCar::getState, sysCar.getState());
|
||||||
}
|
}
|
||||||
|
//生成一个时间唯一戳
|
||||||
|
SnowflakeIdWorker snowMaker = new SnowflakeIdWorker();
|
||||||
|
for (int i = 0; i < 100; i++) {
|
||||||
|
long id = snowMaker.nextId();
|
||||||
|
System.out.println(id);
|
||||||
|
|
||||||
|
}
|
||||||
|
redisTemplate.opsForValue().set("id",list(queryWrapper));
|
||||||
|
|
||||||
return this.list(queryWrapper);
|
return this.list(queryWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,11 +3,13 @@ package com.muyu.openbusiness.service.impl;
|
||||||
import cn.hutool.core.lang.Assert;
|
import cn.hutool.core.lang.Assert;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.muyu.openbusiness.config.SnowflakeIdWorker;
|
||||||
import com.muyu.openbusiness.domain.SysFence;
|
import com.muyu.openbusiness.domain.SysFence;
|
||||||
import com.muyu.openbusiness.mapper.SysFenceMapper;
|
import com.muyu.openbusiness.mapper.SysFenceMapper;
|
||||||
import com.muyu.openbusiness.service.ISysFenceService;
|
import com.muyu.openbusiness.service.ISysFenceService;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.data.redis.core.RedisTemplate;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -25,7 +27,8 @@ public class SysFenceServiceImpl
|
||||||
extends ServiceImpl<SysFenceMapper, SysFence>
|
extends ServiceImpl<SysFenceMapper, SysFence>
|
||||||
implements ISysFenceService {
|
implements ISysFenceService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
RedisTemplate redisTemplate;
|
||||||
@Override
|
@Override
|
||||||
public SysFence selectSysFenceById(Long id) {
|
public SysFence selectSysFenceById(Long id) {
|
||||||
|
|
||||||
|
@ -50,6 +53,14 @@ public class SysFenceServiceImpl
|
||||||
if (StringUtils.isNotEmpty(sysFence.getState())){
|
if (StringUtils.isNotEmpty(sysFence.getState())){
|
||||||
queryWrapper.eq(SysFence::getState, sysFence.getState());
|
queryWrapper.eq(SysFence::getState, sysFence.getState());
|
||||||
}
|
}
|
||||||
|
//生成一个时间唯一戳
|
||||||
|
SnowflakeIdWorker snowMaker = new SnowflakeIdWorker();
|
||||||
|
for (int i = 0; i < 100; i++) {
|
||||||
|
long id = snowMaker.nextId();
|
||||||
|
System.out.println(id);
|
||||||
|
|
||||||
|
}
|
||||||
|
redisTemplate.opsForValue().set("id",list(queryWrapper));
|
||||||
return this.list(queryWrapper);
|
return this.list(queryWrapper);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,9 +3,12 @@ package com.muyu.openbusiness.service.impl;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.muyu.common.core.utils.StringUtils;
|
import com.muyu.common.core.utils.StringUtils;
|
||||||
|
import com.muyu.openbusiness.config.SnowflakeIdWorker;
|
||||||
import com.muyu.openbusiness.domain.SysMessageType;
|
import com.muyu.openbusiness.domain.SysMessageType;
|
||||||
import com.muyu.openbusiness.mapper.SysMessageTypeMapper;
|
import com.muyu.openbusiness.mapper.SysMessageTypeMapper;
|
||||||
import com.muyu.openbusiness.service.ISysMessageTypeService;
|
import com.muyu.openbusiness.service.ISysMessageTypeService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.data.redis.core.RedisTemplate;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.util.Assert;
|
import org.springframework.util.Assert;
|
||||||
|
|
||||||
|
@ -25,9 +28,12 @@ public class SysMessageTypeServiceImpl
|
||||||
/**
|
/**
|
||||||
* 精确查询车辆报文类型
|
* 精确查询车辆报文类型
|
||||||
*
|
*
|
||||||
* @param
|
* @param id 车辆报文类型主键
|
||||||
* @return 车辆报文类型
|
* @return 车辆报文类型
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
RedisTemplate<Object,Object> redisTemplate;
|
||||||
@Override
|
@Override
|
||||||
public SysMessageType selectSysMessageTypeByMessageCode(String messageCode)
|
public SysMessageType selectSysMessageTypeByMessageCode(String messageCode)
|
||||||
{
|
{
|
||||||
|
@ -54,6 +60,14 @@ public class SysMessageTypeServiceImpl
|
||||||
if (StringUtils.isNotEmpty(sysMessageType.getMessageType())){
|
if (StringUtils.isNotEmpty(sysMessageType.getMessageType())){
|
||||||
queryWrapper.eq(SysMessageType::getMessageType, sysMessageType.getMessageType());
|
queryWrapper.eq(SysMessageType::getMessageType, sysMessageType.getMessageType());
|
||||||
}
|
}
|
||||||
|
//生成一个时间唯一戳
|
||||||
|
SnowflakeIdWorker snowMaker = new SnowflakeIdWorker();
|
||||||
|
for (int i = 0; i < 100; i++) {
|
||||||
|
long id = snowMaker.nextId();
|
||||||
|
System.out.println(id);
|
||||||
|
}
|
||||||
|
redisTemplate.opsForValue().set("id",list(queryWrapper));
|
||||||
|
|
||||||
return this.list(queryWrapper);
|
return this.list(queryWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,13 +17,6 @@ import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
||||||
//@EnableCustomSwagger2
|
//@EnableCustomSwagger2
|
||||||
@EnableMyFeignClients
|
@EnableMyFeignClients
|
||||||
@SpringBootApplication
|
@SpringBootApplication
|
||||||
//@SpringBootApplication(
|
|
||||||
// exclude = {
|
|
||||||
// DataSourceAutoConfiguration.class,
|
|
||||||
// DruidDataSourceAutoConfigure.class,
|
|
||||||
// DynamicDataSourceAutoConfiguration.class
|
|
||||||
// }
|
|
||||||
//)
|
|
||||||
public class CloudSystemApplication {
|
public class CloudSystemApplication {
|
||||||
public static void main (String[] args) {
|
public static void main (String[] args) {
|
||||||
SpringApplication.run(CloudSystemApplication.class, args);
|
SpringApplication.run(CloudSystemApplication.class, args);
|
||||||
|
|
|
@ -49,6 +49,7 @@ public class SysConfigServiceImpl extends ServiceImpl<SysConfigMapper, SysConfig
|
||||||
if (Objects.nonNull(endTime) && endTime instanceof Date endDate){
|
if (Objects.nonNull(endTime) && endTime instanceof Date endDate){
|
||||||
queryWrapper.lt(SysConfig::getCreateTime, endDate);
|
queryWrapper.lt(SysConfig::getCreateTime, endDate);
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.list(queryWrapper);
|
return this.list(queryWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -57,7 +58,7 @@ public class SysConfigServiceImpl extends ServiceImpl<SysConfigMapper, SysConfig
|
||||||
*
|
*
|
||||||
* @param configKey
|
* @param configKey
|
||||||
*
|
*
|
||||||
* @return
|
* @return+
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String selectConfigByKey (String configKey) {
|
public String selectConfigByKey (String configKey) {
|
||||||
|
|
Loading…
Reference in New Issue