1. mapper po 路径
This commit is contained in:
parent
7aedebe88b
commit
60c4529638
|
|
@ -8,7 +8,11 @@ import com.chushang.redis.config.properties.RedissonProperties;
|
|||
import com.chushang.redis.hanlder.KeyPrefixHandler;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.redisson.Redisson;
|
||||
import org.redisson.api.RedissonClient;
|
||||
import org.redisson.codec.JsonJacksonCodec;
|
||||
import org.redisson.config.Config;
|
||||
import org.redisson.config.SentinelServersConfig;
|
||||
import org.redisson.spring.starter.RedissonAutoConfigurationCustomizer;
|
||||
import org.springframework.cache.CacheManager;
|
||||
import org.springframework.cache.annotation.EnableCaching;
|
||||
|
|
@ -16,6 +20,7 @@ import org.springframework.context.annotation.Bean;
|
|||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
|
@ -34,76 +39,93 @@ public class RedisConfiguration {
|
|||
private RedissonProperties redissonProperties;
|
||||
@Resource
|
||||
private ObjectMapper objectMapper;
|
||||
@Bean(
|
||||
destroyMethod = "shutdown"
|
||||
)
|
||||
RedissonClient redissonClient() throws IOException {
|
||||
log.info("Redisson init...");
|
||||
Config config = new Config();
|
||||
// SentinelServersConfig ssc = ((SentinelServersConfig)c.useSentinelServers().setMasterName(this.masterName).setPassword(this.password)).setDatabase(this.database);
|
||||
// if (this.address != null) {
|
||||
// ssc.addSentinelAddress(this.address.replaceAll("\"", "").split(","));
|
||||
// }
|
||||
|
||||
@Bean
|
||||
public RedissonAutoConfigurationCustomizer redissonCustomizer() {
|
||||
return config -> {
|
||||
RedissonProperties.SingleServerConfig singleServerConfig = redissonProperties.getSingleServerConfig();
|
||||
RedissonProperties.ClusterServersConfig clusterServerConfig = redissonProperties.getClusterServersConfig();
|
||||
RedissonProperties.SentinelServersConfig sentinelServerConfig = redissonProperties.getSentinelServersConfig();
|
||||
if (ObjectUtil.isNotNull(singleServerConfig)) {
|
||||
String address = singleServerConfig.getAddress();
|
||||
AssertUtil.invalidate(StringUtils.isEmpty(address), "redisson 配置错误");
|
||||
if (!address.contains("redis://")){
|
||||
address = "redis://" + address;
|
||||
}
|
||||
// 使用单机模式
|
||||
config.setThreads(redissonProperties.getThreads())
|
||||
.setNettyThreads(redissonProperties.getNettyThreads())
|
||||
.setCodec(new JsonJacksonCodec(objectMapper))
|
||||
.useSingleServer()
|
||||
.setClientName(redissonProperties.getClientName())
|
||||
//设置redis key前缀
|
||||
.setNameMapper(new KeyPrefixHandler(redissonProperties.getPrefix()))
|
||||
.setTimeout(redissonProperties.getTimeout())
|
||||
.setPassword(redissonProperties.getPassword())
|
||||
.setUsername(redissonProperties.getUsername())
|
||||
.setDatabase(singleServerConfig.getDatabase())
|
||||
.setAddress(address)
|
||||
;
|
||||
RedissonProperties.SingleServerConfig singleServerConfig = redissonProperties.getSingleServerConfig();
|
||||
RedissonProperties.ClusterServersConfig clusterServerConfig = redissonProperties.getClusterServersConfig();
|
||||
RedissonProperties.SentinelServersConfig sentinelServerConfig = redissonProperties.getSentinelServersConfig();
|
||||
if (ObjectUtil.isNotNull(singleServerConfig)) {
|
||||
String address = singleServerConfig.getAddress();
|
||||
AssertUtil.invalidate(StringUtils.isEmpty(address), "redisson 配置错误");
|
||||
if (!address.contains("redis://")){
|
||||
address = "redis://" + address;
|
||||
}
|
||||
// 使用单机模式
|
||||
config.useSingleServer()
|
||||
.setClientName(redissonProperties.getClientName())
|
||||
//设置redis key前缀
|
||||
.setNameMapper(new KeyPrefixHandler(redissonProperties.getPrefix()))
|
||||
.setTimeout(redissonProperties.getTimeout())
|
||||
.setPassword(redissonProperties.getPassword())
|
||||
.setUsername(redissonProperties.getUsername())
|
||||
.setDatabase(singleServerConfig.getDatabase())
|
||||
.setAddress(address)
|
||||
;
|
||||
}
|
||||
else
|
||||
if (ObjectUtil.isNotNull(clusterServerConfig)) {
|
||||
String nodes = clusterServerConfig.getNodes();
|
||||
AssertUtil.invalidate(StringUtils.isEmpty(nodes), "redisson cluster 配置错误");
|
||||
List<String> nodeList;
|
||||
if (nodes.contains("redis://")){
|
||||
nodeList = Arrays.stream(nodes.split(",")).toList();
|
||||
}else {
|
||||
nodeList = Arrays.stream(nodes.split(",")).map(s-> "redis://" + s).collect(Collectors.toList());
|
||||
}
|
||||
else
|
||||
if (ObjectUtil.isNotNull(clusterServerConfig)) {
|
||||
String nodes = clusterServerConfig.getNodes();
|
||||
AssertUtil.invalidate(StringUtils.isEmpty(nodes), "redisson cluster 配置错误");
|
||||
List<String> nodeList;
|
||||
if (nodes.contains("redis://")){
|
||||
nodeList = Arrays.stream(nodes.split(",")).toList();
|
||||
}else {
|
||||
nodeList = Arrays.stream(nodes.split(",")).map(s-> "redis://" + s).collect(Collectors.toList());
|
||||
}
|
||||
config.useClusterServers()
|
||||
//设置redis key前缀
|
||||
.setNameMapper(new KeyPrefixHandler(redissonProperties.getPrefix()))
|
||||
.setClientName(redissonProperties.getClientName())
|
||||
.setTimeout(redissonProperties.getTimeout())
|
||||
.setPassword(redissonProperties.getPassword())
|
||||
.setUsername(redissonProperties.getUsername())
|
||||
.setNodeAddresses(nodeList);
|
||||
;
|
||||
} else if (ObjectUtil.isNotNull(sentinelServerConfig)){
|
||||
String nodes = clusterServerConfig.getNodes();
|
||||
AssertUtil.invalidate(StringUtils.isEmpty(nodes), "redisson sentinel 配置错误");
|
||||
List<String> nodeList;
|
||||
if (nodes.contains("redis://")){
|
||||
nodeList = Arrays.stream(nodes.split(",")).toList();
|
||||
}else {
|
||||
nodeList = Arrays.stream(nodes.split(",")).map(s-> "redis://" + s).collect(Collectors.toList());
|
||||
}
|
||||
config.useSentinelServers()
|
||||
.setNameMapper(new KeyPrefixHandler(redissonProperties.getPrefix()))
|
||||
.setClientName(redissonProperties.getClientName())
|
||||
.setTimeout(redissonProperties.getTimeout())
|
||||
.setUsername(redissonProperties.getUsername())
|
||||
.setPassword(redissonProperties.getPassword())
|
||||
.setDatabase(sentinelServerConfig.getDatabase())
|
||||
.setMasterName(sentinelServerConfig.getMasterName())
|
||||
.setSentinelAddresses(nodeList)
|
||||
;
|
||||
config.setThreads(redissonProperties.getThreads())
|
||||
.setNettyThreads(redissonProperties.getNettyThreads())
|
||||
.setCodec(new JsonJacksonCodec(objectMapper))
|
||||
.useClusterServers()
|
||||
//设置redis key前缀
|
||||
.setNameMapper(new KeyPrefixHandler(redissonProperties.getPrefix()))
|
||||
.setClientName(redissonProperties.getClientName())
|
||||
.setTimeout(redissonProperties.getTimeout())
|
||||
.setPassword(redissonProperties.getPassword())
|
||||
.setUsername(redissonProperties.getUsername())
|
||||
.setNodeAddresses(nodeList);
|
||||
;
|
||||
}
|
||||
else if (ObjectUtil.isNotNull(sentinelServerConfig)){
|
||||
String nodes = sentinelServerConfig.getNodes();
|
||||
AssertUtil.invalidate(StringUtils.isEmpty(nodes), "redisson sentinel 配置错误");
|
||||
List<String> nodeList;
|
||||
if (nodes.contains("redis://")){
|
||||
nodeList = Arrays.stream(nodes.split(",")).toList();
|
||||
}else {
|
||||
nodeList = Arrays.stream(nodes.split(",")).map(s-> "redis://" + s).collect(Collectors.toList());
|
||||
}
|
||||
log.info("------------- 初始化 redis 配置 -------------");
|
||||
};
|
||||
config.setThreads(redissonProperties.getThreads())
|
||||
.setNettyThreads(redissonProperties.getNettyThreads())
|
||||
.setCodec(new JsonJacksonCodec(objectMapper))
|
||||
.useSentinelServers()
|
||||
.setNameMapper(new KeyPrefixHandler(redissonProperties.getPrefix()))
|
||||
.setClientName(redissonProperties.getClientName())
|
||||
.setTimeout(redissonProperties.getTimeout())
|
||||
.setUsername(redissonProperties.getUsername())
|
||||
.setPassword(redissonProperties.getPassword())
|
||||
.setDatabase(sentinelServerConfig.getDatabase())
|
||||
.setMasterName(sentinelServerConfig.getMasterName())
|
||||
.setSentinelAddresses(nodeList)
|
||||
;
|
||||
}else {
|
||||
throw new IllegalArgumentException("redis 配置失败");
|
||||
}
|
||||
log.info("------------- 初始化 redis 配置 -------------");
|
||||
|
||||
|
||||
return Redisson.create(config);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -5,6 +5,9 @@ import com.baomidou.mybatisplus.annotation.TableField;
|
|||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.chushang.common.mybatis.base.BaseEntity;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
|
@ -63,20 +66,20 @@ public class FiveStore extends BaseEntity {
|
|||
/**
|
||||
* 当年新签约商户标志
|
||||
*/
|
||||
@TableField(value = "logo_of_newly_signed_merchants_that_year")
|
||||
private Byte logoOfNewlySignedMerchantsThatYear;
|
||||
@TableField(value = "new_year")
|
||||
private Integer newYear;
|
||||
|
||||
/**
|
||||
* 当月新签约商户标志
|
||||
*/
|
||||
@TableField(value = "logo_of_newly_signed_merchants_of_the_month")
|
||||
private Byte logoOfNewlySignedMerchantsOfTheMonth;
|
||||
@TableField(value = "new_month")
|
||||
private Integer newMonth;
|
||||
|
||||
/**
|
||||
* 当日新签约商户标志
|
||||
*/
|
||||
@TableField(value = "logo_of_newly_signed_merchants_on_the_day")
|
||||
private Byte logoOfNewlySignedMerchantsOnTheDay;
|
||||
@TableField(value = "new_day")
|
||||
private Integer newDay;
|
||||
|
||||
/**
|
||||
* 客户名称
|
||||
|
|
@ -88,19 +91,19 @@ public class FiveStore extends BaseEntity {
|
|||
* 客户身份标识
|
||||
*/
|
||||
@TableField(value = "customer_id")
|
||||
private Byte customerId;
|
||||
private Long customerId;
|
||||
|
||||
/**
|
||||
* 营销日期
|
||||
*/
|
||||
@TableField(value = "marketing_date")
|
||||
private Date marketingDate;
|
||||
private LocalDate marketingDate;
|
||||
|
||||
/**
|
||||
* 消费日期
|
||||
*/
|
||||
@TableField(value = "consumption_date")
|
||||
private Date consumptionDate;
|
||||
private LocalDate consumptionDate;
|
||||
|
||||
/**
|
||||
* 营销人
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ public class Store extends BaseEntity {
|
|||
* 商户类型
|
||||
*/
|
||||
@TableField(value = "store_type")
|
||||
private Byte storeType;
|
||||
private Integer storeType;
|
||||
|
||||
/**
|
||||
* 现有其他收单产品
|
||||
|
|
@ -118,7 +118,7 @@ public class Store extends BaseEntity {
|
|||
* 巡检频次
|
||||
*/
|
||||
@TableField(value = "ins_fre")
|
||||
private Byte insFre;
|
||||
private Integer insFre;
|
||||
|
||||
/**
|
||||
* 客户经理
|
||||
|
|
@ -154,5 +154,5 @@ public class Store extends BaseEntity {
|
|||
* 是否为业务员录入(1是 2否)
|
||||
*/
|
||||
@TableField(value = "is_enter")
|
||||
private Byte isEnter;
|
||||
private Integer isEnter;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,9 @@ import com.baomidou.mybatisplus.annotation.TableField;
|
|||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.chushang.common.mybatis.base.BaseEntity;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
|
@ -76,7 +79,7 @@ public class Terminal extends BaseEntity {
|
|||
* 终端类型
|
||||
*/
|
||||
@TableField(value = "terminal_type")
|
||||
private Byte terminalType;
|
||||
private Integer terminalType;
|
||||
|
||||
/**
|
||||
* 终端型号
|
||||
|
|
@ -100,31 +103,31 @@ public class Terminal extends BaseEntity {
|
|||
* 终端来源
|
||||
*/
|
||||
@TableField(value = "terminal_source")
|
||||
private Byte terminalSource;
|
||||
private Integer terminalSource;
|
||||
|
||||
/**
|
||||
* 终端产权人
|
||||
*/
|
||||
@TableField(value = "terminal_property")
|
||||
private Byte terminalProperty;
|
||||
private Integer terminalProperty;
|
||||
|
||||
/**
|
||||
* 是否占用
|
||||
*/
|
||||
@TableField(value = "occupy")
|
||||
private Boolean occupy;
|
||||
private Integer occupy;
|
||||
|
||||
/**
|
||||
* 终端状态
|
||||
*/
|
||||
@TableField(value = "terminal_status")
|
||||
private Byte terminalStatus;
|
||||
private Integer terminalStatus;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@TableField(value = "`state`")
|
||||
private Byte state;
|
||||
private Integer state;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
|
|
@ -159,8 +162,8 @@ public class Terminal extends BaseEntity {
|
|||
/**
|
||||
* 巡检位置信息
|
||||
*/
|
||||
@TableField(value = "work_adderss")
|
||||
private String workAdderss;
|
||||
@TableField(value = "work_address")
|
||||
private String workAddress;
|
||||
|
||||
/**
|
||||
* 偏差(直线距离 米)
|
||||
|
|
@ -172,19 +175,19 @@ public class Terminal extends BaseEntity {
|
|||
* 入库时间
|
||||
*/
|
||||
@TableField(value = "storage_time")
|
||||
private Date storageTime;
|
||||
private LocalDateTime storageTime;
|
||||
|
||||
/**
|
||||
* 出库时间
|
||||
*/
|
||||
@TableField(value = "delivery_time")
|
||||
private Date deliveryTime;
|
||||
private LocalDateTime deliveryTime;
|
||||
|
||||
/**
|
||||
* 出库原因
|
||||
*/
|
||||
@TableField(value = "reason_for_shipment")
|
||||
private Byte reasonForShipment;
|
||||
private Integer reasonForShipment;
|
||||
|
||||
/**
|
||||
* 操作员编号
|
||||
|
|
@ -195,20 +198,20 @@ public class Terminal extends BaseEntity {
|
|||
/**
|
||||
* 预制码编码
|
||||
*/
|
||||
@TableField(value = "precode_encoding")
|
||||
private String precodeEncoding;
|
||||
@TableField(value = "pre_code_encoding")
|
||||
private String preCodeEncoding;
|
||||
|
||||
/**
|
||||
* 是否为业务员录入(1是 2否)
|
||||
*/
|
||||
@TableField(value = "is_enter")
|
||||
private Byte isEnter;
|
||||
private Integer isEnter;
|
||||
|
||||
/**
|
||||
* 上次服务结果
|
||||
*/
|
||||
@TableField(value = "service_result")
|
||||
private Byte serviceResult;
|
||||
private Integer serviceResult;
|
||||
|
||||
/**
|
||||
* 审核通过次数
|
||||
|
|
@ -220,11 +223,11 @@ public class Terminal extends BaseEntity {
|
|||
* 巡检状态 1 已巡检 2 未巡检
|
||||
*/
|
||||
@TableField(value = "inspection_status")
|
||||
private Byte inspectionStatus;
|
||||
private Integer inspectionStatus;
|
||||
|
||||
/**
|
||||
* 巡检时间(上次业务员处理时间)
|
||||
*/
|
||||
@TableField(value = "inspection_time")
|
||||
private Date inspectionTime;
|
||||
private LocalDateTime inspectionTime;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|||
import com.chushang.inspection.terminal.mapper.FiveStoreMapper;
|
||||
|
||||
/**
|
||||
* 五统一商户 -- 只有建行内蒙古有
|
||||
* @auther: zhao
|
||||
* @date: 2024/6/21 16:39
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<?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.chushang.inspection.terminal.mapper.FiveStoreMapper">
|
||||
<resultMap id="BaseResultMap" type="com.chushang.inspection.terminal.StFiveStore">
|
||||
<resultMap id="BaseResultMap" type="com.chushang.inspection.terminal.po.FiveStore">
|
||||
<!--@mbg.generated-->
|
||||
<!--@Table st_five_store-->
|
||||
<id column="five_id" jdbcType="BIGINT" property="fiveId" />
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<?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.chushang.inspection.terminal.mapper.StoreMapper">
|
||||
<resultMap id="BaseResultMap" type="com.chushang.inspection.terminal.StStore">
|
||||
<resultMap id="BaseResultMap" type="com.chushang.inspection.terminal.po.Store">
|
||||
<!--@mbg.generated-->
|
||||
<!--@Table st_store-->
|
||||
<id column="store_id" jdbcType="BIGINT" property="storeId" />
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<?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.chushang.inspection.terminal.mapper.TerminalMapper">
|
||||
<resultMap id="BaseResultMap" type="com.chushang.inspection.terminal.StTerminal">
|
||||
<resultMap id="BaseResultMap" type="com.chushang.inspection.terminal.po.Terminal">
|
||||
<!--@mbg.generated-->
|
||||
<!--@Table st_terminal-->
|
||||
<id column="terminal_id" jdbcType="BIGINT" property="terminalId" />
|
||||
|
|
|
|||
Loading…
Reference in New Issue