diff --git a/car-common/pom.xml b/car-common/pom.xml index b863a7b..13d1760 100644 --- a/car-common/pom.xml +++ b/car-common/pom.xml @@ -37,16 +37,16 @@ - - org.springframework.boot - spring-boot-starter-data-redis - - - io.lettuce - lettuce-core - - - + + + + + + + + + + org.apache.commons commons-lang3 @@ -140,11 +140,11 @@ caffeine 2.5.5 - - redis.clients - jedis - 2.9.0 - + + + + + com.aliyun alibaba-dingtalk-service-sdk diff --git a/car-common/src/main/java/com/weiqi/mis/RedisUtil.java b/car-common/src/main/java/com/weiqi/mis/RedisUtil.java index 45b2c55..173dbcc 100644 --- a/car-common/src/main/java/com/weiqi/mis/RedisUtil.java +++ b/car-common/src/main/java/com/weiqi/mis/RedisUtil.java @@ -1,87 +1,87 @@ -package com.weiqi.mis; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.PropertySource; -import redis.clients.jedis.Jedis; -import redis.clients.jedis.JedisPool; -import redis.clients.jedis.JedisPoolConfig; - -import java.util.function.Consumer; - -/** - * Created by sky on 2019/7/24. - */ - - -@Configuration -//@PropertySource("classpath:redis.properties") -public class RedisUtil { - - @Value("${spring.redis.host:192.168.0.1}") - private String host; - - @Value("${spring.redis.port:6793}") - private int port; - - @Value("${spring.redis.timeout:5000}") - private int timeout; - - @Value("${spring.redis.jedis.pool.max-idle:1}") - private int maxIdle; - - @Value("${spring.redis.jedis.pool.max-wait:0}") - private long maxWaitMillis; - - @Value("${spring.redis.block-when-exhausted:0}") - private boolean blockWhenExhausted; - - @Bean - public JedisPool redisPoolFactory() throws Exception{ - - JedisPoolConfig jedisPoolConfig = new JedisPoolConfig(); - jedisPoolConfig.setMaxIdle(maxIdle); - jedisPoolConfig.setMaxWaitMillis(maxWaitMillis); - // 连接耗尽时是否阻塞, false报异常,ture阻塞直到超时, 默认true - jedisPoolConfig.setBlockWhenExhausted(blockWhenExhausted); - // 是否启用pool的jmx管理功能, 默认true - jedisPoolConfig.setJmxEnabled(true); - JedisPool jedisPool = new JedisPool(jedisPoolConfig, host, port, timeout); - return jedisPool; - - } - - - public static JedisPool pool=null; - @Autowired - void init(JedisPool _pool) - { - pool=_pool; - } - public static void call(Consumer fun) - { - try (Jedis jedis = pool.getResource()) { - fun.accept(jedis); - } - } - - - - private static final String SCRIPT="local t= redis.call('time')[1]\n return redis.call('incrby',KEYS[1]..':'..KEYS[2]..':'..t,ARGV[1])"; - public static Long qpsOK(String key, Integer value) { - try (Jedis jedis = pool.getResource()) { - return (Long) jedis.eval(SCRIPT,2,"incrOK",key, String.valueOf(value)); - } - } - public static Long qpsERROR(String key, Integer value) { - try (Jedis jedis = pool.getResource()) { - return (Long) jedis.eval(SCRIPT,2,"incrERROR",key, String.valueOf(value)); - } - } - - -} - - +//package com.weiqi.mis; +// +//import org.springframework.beans.factory.annotation.Autowired; +//import org.springframework.beans.factory.annotation.Value; +//import org.springframework.context.annotation.Bean; +//import org.springframework.context.annotation.Configuration; +//import org.springframework.context.annotation.PropertySource; +//import redis.clients.jedis.Jedis; +//import redis.clients.jedis.JedisPool; +//import redis.clients.jedis.JedisPoolConfig; +// +//import java.util.function.Consumer; +// +///** +// * Created by sky on 2019/7/24. +// */ +// +// +//@Configuration +////@PropertySource("classpath:redis.properties") +//public class RedisUtil { +// +// @Value("${spring.redis.host:192.168.0.1}") +// private String host; +// +// @Value("${spring.redis.port:6793}") +// private int port; +// +// @Value("${spring.redis.timeout:5000}") +// private int timeout; +// +// @Value("${spring.redis.jedis.pool.max-idle:1}") +// private int maxIdle; +// +// @Value("${spring.redis.jedis.pool.max-wait:0}") +// private long maxWaitMillis; +// +// @Value("${spring.redis.block-when-exhausted:0}") +// private boolean blockWhenExhausted; +// +// @Bean +// public JedisPool redisPoolFactory() throws Exception{ +// +// JedisPoolConfig jedisPoolConfig = new JedisPoolConfig(); +// jedisPoolConfig.setMaxIdle(maxIdle); +// jedisPoolConfig.setMaxWaitMillis(maxWaitMillis); +// // 连接耗尽时是否阻塞, false报异常,ture阻塞直到超时, 默认true +// jedisPoolConfig.setBlockWhenExhausted(blockWhenExhausted); +// // 是否启用pool的jmx管理功能, 默认true +// jedisPoolConfig.setJmxEnabled(true); +// JedisPool jedisPool = new JedisPool(jedisPoolConfig, host, port, timeout); +// return jedisPool; +// +// } +// +// +// public static JedisPool pool=null; +// @Autowired +// void init(JedisPool _pool) +// { +// pool=_pool; +// } +// public static void call(Consumer fun) +// { +// try (Jedis jedis = pool.getResource()) { +// fun.accept(jedis); +// } +// } +// +// +// +// private static final String SCRIPT="local t= redis.call('time')[1]\n return redis.call('incrby',KEYS[1]..':'..KEYS[2]..':'..t,ARGV[1])"; +// public static Long qpsOK(String key, Integer value) { +// try (Jedis jedis = pool.getResource()) { +// return (Long) jedis.eval(SCRIPT,2,"incrOK",key, String.valueOf(value)); +// } +// } +// public static Long qpsERROR(String key, Integer value) { +// try (Jedis jedis = pool.getResource()) { +// return (Long) jedis.eval(SCRIPT,2,"incrERROR",key, String.valueOf(value)); +// } +// } +// +// +//} +// +// diff --git a/car-dao/src/main/java/com/weiqi/mis/bo/WxXrPemsOrderResult.java b/car-dao/src/main/java/com/weiqi/mis/bo/WxXrPemsOrderResult.java new file mode 100644 index 0000000..6db358b --- /dev/null +++ b/car-dao/src/main/java/com/weiqi/mis/bo/WxXrPemsOrderResult.java @@ -0,0 +1,477 @@ +package com.weiqi.mis.bo; + + +import java.util.ArrayList; +import java.util.List; + +/** + * @ClassName WxXrPemsOrderResult + * @Description 订单列表 + * @createTime 2024-09-22 23:48:00 + */ + +public class WxXrPemsOrderResult { + private int count; + private List wxXrPemsOrderItemResultList; + + public List getWxXrPemsOrderItemResultList() { + return wxXrPemsOrderItemResultList == null ? new ArrayList<>() : wxXrPemsOrderItemResultList; + } + + /** + * **************低怠速检测数据定义:************** + * CO检测值 超标级别 数据定义 + * [0,0.24) A 较低排放 + * [0.24,0.40) B 临界超标 + * [0.40,1.6) C 一般超标 + * [1.6,∞) D 严重超标 + * + * HC检测值 超标级别 数据定义 + * [0,24) A 较低排放 + * [24,40) B 临界超标 + * [40,160) C 一般超标 + * [160,∞) D 严重超标 + * + * NOX检测值 超标级别 数据定义 + * [0,16) A 较低排放 + * [16,20) B 临界超标 + * [20,60) C 一般超标 + * [60,∞) D 严重超标 + * + * λ检测值 数值分类 数据定义 + * [0,0.9) R3 过浓 + * [0.9,0.95) R2 偏浓 + * [0.95,0.98) R1 较浓 + * [0.98,1.03) N 正常 + * [1.03,1.05) L1 较稀 + * [1.05,∞) L2 偏稀 + * + * **************高怠速检测数据定义:************** + * + * CO检测值 超标级别 数据定义 + * [0,0.18) A 较低排放 + * [0.18,0.30) B 临界超标 + * [0.30,1.2) C 一般超标 + * [1.2,∞) D 严重超标 + * + * HC检测值 超标级别 数据定义 + * [0,18) A 较低排放 + * [18,30) B 临界超标 + * [30,120) C 一般超标 + * [120,∞) D 严重超标 + * + * NOX检测值 超标级别 数据定义 + * [0,24) A 较低排放 + * [24,30) B 临界超标 + * [30,90) C 一般超标 + * [90,∞) D 严重超标 + * + * λ检测值 数值分类 数据定义 + * [0,0.9) R3 过浓 + * [0.9,0.95) R2 偏浓 + * [0.95,0.98) R1 较浓 + * [0.98,1.03) N 正常 + * [1.03,1.05) L1 较稀 + * [1.05,∞) L2 偏稀 + * */ + + public static class WxXrPemsOrderItemResult{ + /** + * id + * */ + private Integer id; + /** + * 工单号 + * */ + private String orderNo; + /** + * 车辆照片 + * */ + private String vehicleSrc; + /** + * 车牌号 + * */ + private String plateNumber; + /** + * 车型名称 + * */ + private String vehicleType; + /** + * 检测时间 HH-MM-DD hh:mm + * */ + private String checkUpDateTime; + /** + * 最后一位检修员名称 + * */ + private String pemsUserName; + /** + * 订单状态 + * 1 未处理 + * 2 检测中 + * 4 检测完成 + * */ + private int status; + /** + * 订单状态 + * 1 未处理 + * 2 检测中 + * 4 检测完成 + * */ + private String orderStatus; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getOrderNo() { + return orderNo; + } + + public void setOrderNo(String orderNo) { + this.orderNo = orderNo; + } + + public String getVehicleSrc() { + return vehicleSrc; + } + + public void setVehicleSrc(String vehicleSrc) { + this.vehicleSrc = vehicleSrc; + } + + public String getPlateNumber() { + return plateNumber; + } + + public void setPlateNumber(String plateNumber) { + this.plateNumber = plateNumber; + } + + public String getVehicleType() { + return vehicleType; + } + + public void setVehicleType(String vehicleType) { + this.vehicleType = vehicleType; + } + + public String getCheckUpDateTime() { + return checkUpDateTime; + } + + public void setCheckUpDateTime(String checkUpDateTime) { + this.checkUpDateTime = checkUpDateTime; + } + + public String getPemsUserName() { + return pemsUserName; + } + + public void setPemsUserName(String pemsUserName) { + this.pemsUserName = pemsUserName; + } + + public int getStatus() { + return status; + } + + public void setStatus(int status) { + this.status = status; + } + + public String getOrderStatus() { + return orderStatus; + } + + public void setOrderStatus(String orderStatus) { + this.orderStatus = orderStatus; + } + + public double gethLambda() { + return hLambda; + } + + public void sethLambda(double hLambda) { + this.hLambda = hLambda; + } + + public void sethLambdaDetection(String hLambdaDetection) { + this.hLambdaDetection = hLambdaDetection; + } + + public double gethCO() { + return hCO; + } + + public void sethCO(double hCO) { + this.hCO = hCO; + } + + public void sethCODetection(String hCODetection) { + this.hCODetection = hCODetection; + } + + public double gethHC() { + return hHC; + } + + public void sethHC(double hHC) { + this.hHC = hHC; + } + + public void sethHCDetection(String hHCDetection) { + this.hHCDetection = hHCDetection; + } + + public double getlLambda() { + return lLambda; + } + + public void setlLambda(double lLambda) { + this.lLambda = lLambda; + } + + public void setlLambdaDetection(String lLambdaDetection) { + this.lLambdaDetection = lLambdaDetection; + } + + public double getlCO() { + return lCO; + } + + public void setlCO(double lCO) { + this.lCO = lCO; + } + + public void setlCODetection(String lCODetection) { + this.lCODetection = lCODetection; + } + + public double getlHC() { + return lHC; + } + + public void setlHC(double lHC) { + this.lHC = lHC; + } + + public void setlHCDetection(String lHCDetection) { + this.lHCDetection = lHCDetection; + } + + /** + * 高怠速——Lambda + * */ + private double hLambda; + private String hLambdaDetection; + +// /** +// * 高怠速——O2 +// * */ +// private double categoryHighO2; + /** + * 高怠速——CO + * */ + private double hCO; + private String hCODetection; +// /** +// * 高怠速——CO2 +// * */ +// private double categoryHighCO2; + /** + * 高怠速——HC + * */ + private double hHC; + private String hHCDetection; +// /** +// * 高怠速——NO +// * */ +// private double categoryHighNO; + + + /** + * 低怠速——Lambda + * */ + private double lLambda; + /** + * 低怠速——Lambda检测结果 + * */ + private String lLambdaDetection; +// /** +// * 低怠速——O2 +// * */ +// private double categoryLowO2; + /** + * 低怠速——CO + * */ + private double lCO; + /** + * 低怠速——CO检测结果 + * */ + private String lCODetection; +// /** +// * 低怠速——CO2 +// * */ +// private double categoryLowCO2; + /** + * 低怠速——HC + * */ + private double lHC; + /** + * 低怠速——HC检测结果 + * */ + private String lHCDetection; +// /** +// * 低怠速——NO +// * */ +// private double categoryLowNO; + + + /** + * 高怠速——Lambda检测结果 + * * λ检测值 数值分类 数据定义 + * * [0,0.9) R3 过浓 + * * [0.9,0.95) R2 偏浓 + * * [0.95,0.98) R1 较浓 + * * [0.98,1.03) N 正常 + * * [1.03,1.05) L1 较稀 + * * [1.05,∞) L2 偏稀 + * */ + public String gethLambdaDetection() { + List listMap = new ArrayList<>(); + listMap.add("0,0.9,λ过浓"); + listMap.add("0.9,0.95,λ偏浓"); + listMap.add("0.95,0.98,λ较浓"); + listMap.add("0.98,1.03,λ正常"); + listMap.add("1.03,1.05,λ较稀"); + listMap.add("1.05,10000000,λ偏稀"); + String value = getText(listMap, hLambda); + return value; + } + + /** + * 高怠速——CO检测结果 + * * CO检测值 超标级别 数据定义 + * * [0,0.18) A 较低排放 + * * [0.18,0.30) B 临界超标 + * * [0.30,1.2) C 一般超标 + * * [1.2,∞) D 严重超标 + * */ + public String gethCODetection() { + List listMap = new ArrayList<>(); + listMap.add("0,0.18,CO较低排放"); + listMap.add("0.18,0.30,CO临界超标"); + listMap.add("0.30,1.2,CO一般超标"); + listMap.add("1.2,10000000,CO严重超标"); + String value = getText(listMap, hCO); + return value; + } + + /** + * 高怠速——HC检测结果 + * * HC检测值 超标级别 数据定义 + * * [0,18) A 较低排放 + * * [18,30) B 临界超标 + * * [30,120) C 一般超标 + * * [120,∞) D 严重超标 + * */ + public String gethHCDetection() { + List listMap = new ArrayList<>(); + listMap.add("0,18,HC较低排放"); + listMap.add("18,30,HC临界超标"); + listMap.add("30,120,HC一般超标"); + listMap.add("120,10000000,HC严重超标"); + String value = getText(listMap, hHC); + return value; + } + + /** + * λ检测值 数值分类 数据定义 + * [0,0.9) R3 过浓 + * [0.9,0.95) R2 偏浓 + * [0.95,0.98) R1 较浓 + * [0.98,1.03) N 正常 + * [1.03,1.05) L1 较稀 + * [1.05,∞) L2 偏稀 + * */ + public String getlLambdaDetection() { + List listMap = new ArrayList<>(); + listMap.add("0,0.9,λ过浓"); + listMap.add("0.9,0.95,λ偏浓"); + listMap.add("0.95,0.98,λ较浓"); + listMap.add("0.98,1.03,λ正常"); + listMap.add("1.03,1.05,λ较稀"); + listMap.add("1.05,10000000,λ偏稀"); + String value = getText(listMap, lLambda); + return value; + } + + /** + * CO检测值 超标级别 数据定义 + * [0,0.24) A 较低排放 + * [0.24,0.40) B 临界超标 + * [0.40,1.6) C 一般超标 + * [1.6,∞) D 严重超标 + * */ + public String getlCODetection() { + List listMap = new ArrayList<>(); + listMap.add("0,0.24,CO较低排放"); + listMap.add("0.24,0.40,CO临界超标"); + listMap.add("0.40,1.6,CO一般超标"); + listMap.add("1.6,10000000,CO严重超标"); + String value = getText(listMap, lCO); + return value; + } + + /** + * HC检测值 超标级别 数据定义 + * [0,24) A 较低排放 + * [24,40) B 临界超标 + * [40,160) C 一般超标 + * [160,∞) D 严重超标 + * */ + public String getlHCDetection() { + List listMap = new ArrayList<>(); + listMap.add("0,24,HC较低排放"); + listMap.add("24,40,HC临界超标"); + listMap.add("40,160,HC一般超标"); + listMap.add("160,10000000,HC严重超标"); + String value = getText(listMap, lHC); + return value; + } + + private String getText(List listMap, double value){ + if(Double.compare(value, 0) == 0){ + return "暂无"; + } + for(int i=0; i= 0 && comparisonResult2 == -1){ + return text; + } + } + return "暂无"; + } + } + + public int getCount() { + return count; + } + + public void setCount(int count) { + this.count = count; + } + + public void setWxXrPemsOrderItemResultList(List wxXrPemsOrderItemResultList) { + this.wxXrPemsOrderItemResultList = wxXrPemsOrderItemResultList; + } +} diff --git a/car-dao/src/main/java/com/weiqi/mis/domain/WxSgPolluteSds.java b/car-dao/src/main/java/com/weiqi/mis/domain/WxSgPolluteSds.java new file mode 100644 index 0000000..4c5a377 --- /dev/null +++ b/car-dao/src/main/java/com/weiqi/mis/domain/WxSgPolluteSds.java @@ -0,0 +1,145 @@ +package com.weiqi.mis.domain; + +import java.util.Date; + +public class WxSgPolluteSds { + private Integer id; + + private Double lambda; + + private Double o2; + + private Double co; + + private Double co2; + + private Double hc; + + private Double no; + + private Integer category; + + private Integer wxOrderId; + + private Integer delFlag; + + private String createBy; + + private Date createTime; + + private String updateBy; + + private Date updateTime; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public Double getLambda() { + return lambda; + } + + public void setLambda(Double lambda) { + this.lambda = lambda; + } + + public Double getO2() { + return o2; + } + + public void setO2(Double o2) { + this.o2 = o2; + } + + public Double getCo() { + return co; + } + + public void setCo(Double co) { + this.co = co; + } + + public Double getCo2() { + return co2; + } + + public void setCo2(Double co2) { + this.co2 = co2; + } + + public Double getHc() { + return hc; + } + + public void setHc(Double hc) { + this.hc = hc; + } + + public Double getNo() { + return no; + } + + public void setNo(Double no) { + this.no = no; + } + + public Integer getCategory() { + return category; + } + + public void setCategory(Integer category) { + this.category = category; + } + + public Integer getWxOrderId() { + return wxOrderId; + } + + public void setWxOrderId(Integer wxOrderId) { + this.wxOrderId = wxOrderId; + } + + public Integer getDelFlag() { + return delFlag; + } + + public void setDelFlag(Integer delFlag) { + this.delFlag = delFlag; + } + + public String getCreateBy() { + return createBy; + } + + public void setCreateBy(String createBy) { + this.createBy = createBy == null ? null : createBy.trim(); + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public String getUpdateBy() { + return updateBy; + } + + public void setUpdateBy(String updateBy) { + this.updateBy = updateBy == null ? null : updateBy.trim(); + } + + public Date getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } +} \ No newline at end of file diff --git a/car-dao/src/main/java/com/weiqi/mis/domain/WxSgPolluteSdsExample.java b/car-dao/src/main/java/com/weiqi/mis/domain/WxSgPolluteSdsExample.java new file mode 100644 index 0000000..b7471cc --- /dev/null +++ b/car-dao/src/main/java/com/weiqi/mis/domain/WxSgPolluteSdsExample.java @@ -0,0 +1,1061 @@ +package com.weiqi.mis.domain; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class WxSgPolluteSdsExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public WxSgPolluteSdsExample() { + oredCriteria = new ArrayList(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Integer value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Integer value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Integer value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Integer value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Integer value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Integer value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Integer value1, Integer value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Integer value1, Integer value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andLambdaIsNull() { + addCriterion("lambda is null"); + return (Criteria) this; + } + + public Criteria andLambdaIsNotNull() { + addCriterion("lambda is not null"); + return (Criteria) this; + } + + public Criteria andLambdaEqualTo(Double value) { + addCriterion("lambda =", value, "lambda"); + return (Criteria) this; + } + + public Criteria andLambdaNotEqualTo(Double value) { + addCriterion("lambda <>", value, "lambda"); + return (Criteria) this; + } + + public Criteria andLambdaGreaterThan(Double value) { + addCriterion("lambda >", value, "lambda"); + return (Criteria) this; + } + + public Criteria andLambdaGreaterThanOrEqualTo(Double value) { + addCriterion("lambda >=", value, "lambda"); + return (Criteria) this; + } + + public Criteria andLambdaLessThan(Double value) { + addCriterion("lambda <", value, "lambda"); + return (Criteria) this; + } + + public Criteria andLambdaLessThanOrEqualTo(Double value) { + addCriterion("lambda <=", value, "lambda"); + return (Criteria) this; + } + + public Criteria andLambdaIn(List values) { + addCriterion("lambda in", values, "lambda"); + return (Criteria) this; + } + + public Criteria andLambdaNotIn(List values) { + addCriterion("lambda not in", values, "lambda"); + return (Criteria) this; + } + + public Criteria andLambdaBetween(Double value1, Double value2) { + addCriterion("lambda between", value1, value2, "lambda"); + return (Criteria) this; + } + + public Criteria andLambdaNotBetween(Double value1, Double value2) { + addCriterion("lambda not between", value1, value2, "lambda"); + return (Criteria) this; + } + + public Criteria andO2IsNull() { + addCriterion("O2 is null"); + return (Criteria) this; + } + + public Criteria andO2IsNotNull() { + addCriterion("O2 is not null"); + return (Criteria) this; + } + + public Criteria andO2EqualTo(Double value) { + addCriterion("O2 =", value, "o2"); + return (Criteria) this; + } + + public Criteria andO2NotEqualTo(Double value) { + addCriterion("O2 <>", value, "o2"); + return (Criteria) this; + } + + public Criteria andO2GreaterThan(Double value) { + addCriterion("O2 >", value, "o2"); + return (Criteria) this; + } + + public Criteria andO2GreaterThanOrEqualTo(Double value) { + addCriterion("O2 >=", value, "o2"); + return (Criteria) this; + } + + public Criteria andO2LessThan(Double value) { + addCriterion("O2 <", value, "o2"); + return (Criteria) this; + } + + public Criteria andO2LessThanOrEqualTo(Double value) { + addCriterion("O2 <=", value, "o2"); + return (Criteria) this; + } + + public Criteria andO2In(List values) { + addCriterion("O2 in", values, "o2"); + return (Criteria) this; + } + + public Criteria andO2NotIn(List values) { + addCriterion("O2 not in", values, "o2"); + return (Criteria) this; + } + + public Criteria andO2Between(Double value1, Double value2) { + addCriterion("O2 between", value1, value2, "o2"); + return (Criteria) this; + } + + public Criteria andO2NotBetween(Double value1, Double value2) { + addCriterion("O2 not between", value1, value2, "o2"); + return (Criteria) this; + } + + public Criteria andCoIsNull() { + addCriterion("CO is null"); + return (Criteria) this; + } + + public Criteria andCoIsNotNull() { + addCriterion("CO is not null"); + return (Criteria) this; + } + + public Criteria andCoEqualTo(Double value) { + addCriterion("CO =", value, "co"); + return (Criteria) this; + } + + public Criteria andCoNotEqualTo(Double value) { + addCriterion("CO <>", value, "co"); + return (Criteria) this; + } + + public Criteria andCoGreaterThan(Double value) { + addCriterion("CO >", value, "co"); + return (Criteria) this; + } + + public Criteria andCoGreaterThanOrEqualTo(Double value) { + addCriterion("CO >=", value, "co"); + return (Criteria) this; + } + + public Criteria andCoLessThan(Double value) { + addCriterion("CO <", value, "co"); + return (Criteria) this; + } + + public Criteria andCoLessThanOrEqualTo(Double value) { + addCriterion("CO <=", value, "co"); + return (Criteria) this; + } + + public Criteria andCoIn(List values) { + addCriterion("CO in", values, "co"); + return (Criteria) this; + } + + public Criteria andCoNotIn(List values) { + addCriterion("CO not in", values, "co"); + return (Criteria) this; + } + + public Criteria andCoBetween(Double value1, Double value2) { + addCriterion("CO between", value1, value2, "co"); + return (Criteria) this; + } + + public Criteria andCoNotBetween(Double value1, Double value2) { + addCriterion("CO not between", value1, value2, "co"); + return (Criteria) this; + } + + public Criteria andCo2IsNull() { + addCriterion("CO2 is null"); + return (Criteria) this; + } + + public Criteria andCo2IsNotNull() { + addCriterion("CO2 is not null"); + return (Criteria) this; + } + + public Criteria andCo2EqualTo(Double value) { + addCriterion("CO2 =", value, "co2"); + return (Criteria) this; + } + + public Criteria andCo2NotEqualTo(Double value) { + addCriterion("CO2 <>", value, "co2"); + return (Criteria) this; + } + + public Criteria andCo2GreaterThan(Double value) { + addCriterion("CO2 >", value, "co2"); + return (Criteria) this; + } + + public Criteria andCo2GreaterThanOrEqualTo(Double value) { + addCriterion("CO2 >=", value, "co2"); + return (Criteria) this; + } + + public Criteria andCo2LessThan(Double value) { + addCriterion("CO2 <", value, "co2"); + return (Criteria) this; + } + + public Criteria andCo2LessThanOrEqualTo(Double value) { + addCriterion("CO2 <=", value, "co2"); + return (Criteria) this; + } + + public Criteria andCo2In(List values) { + addCriterion("CO2 in", values, "co2"); + return (Criteria) this; + } + + public Criteria andCo2NotIn(List values) { + addCriterion("CO2 not in", values, "co2"); + return (Criteria) this; + } + + public Criteria andCo2Between(Double value1, Double value2) { + addCriterion("CO2 between", value1, value2, "co2"); + return (Criteria) this; + } + + public Criteria andCo2NotBetween(Double value1, Double value2) { + addCriterion("CO2 not between", value1, value2, "co2"); + return (Criteria) this; + } + + public Criteria andHcIsNull() { + addCriterion("HC is null"); + return (Criteria) this; + } + + public Criteria andHcIsNotNull() { + addCriterion("HC is not null"); + return (Criteria) this; + } + + public Criteria andHcEqualTo(Double value) { + addCriterion("HC =", value, "hc"); + return (Criteria) this; + } + + public Criteria andHcNotEqualTo(Double value) { + addCriterion("HC <>", value, "hc"); + return (Criteria) this; + } + + public Criteria andHcGreaterThan(Double value) { + addCriterion("HC >", value, "hc"); + return (Criteria) this; + } + + public Criteria andHcGreaterThanOrEqualTo(Double value) { + addCriterion("HC >=", value, "hc"); + return (Criteria) this; + } + + public Criteria andHcLessThan(Double value) { + addCriterion("HC <", value, "hc"); + return (Criteria) this; + } + + public Criteria andHcLessThanOrEqualTo(Double value) { + addCriterion("HC <=", value, "hc"); + return (Criteria) this; + } + + public Criteria andHcIn(List values) { + addCriterion("HC in", values, "hc"); + return (Criteria) this; + } + + public Criteria andHcNotIn(List values) { + addCriterion("HC not in", values, "hc"); + return (Criteria) this; + } + + public Criteria andHcBetween(Double value1, Double value2) { + addCriterion("HC between", value1, value2, "hc"); + return (Criteria) this; + } + + public Criteria andHcNotBetween(Double value1, Double value2) { + addCriterion("HC not between", value1, value2, "hc"); + return (Criteria) this; + } + + public Criteria andNoIsNull() { + addCriterion("NO is null"); + return (Criteria) this; + } + + public Criteria andNoIsNotNull() { + addCriterion("NO is not null"); + return (Criteria) this; + } + + public Criteria andNoEqualTo(Double value) { + addCriterion("NO =", value, "no"); + return (Criteria) this; + } + + public Criteria andNoNotEqualTo(Double value) { + addCriterion("NO <>", value, "no"); + return (Criteria) this; + } + + public Criteria andNoGreaterThan(Double value) { + addCriterion("NO >", value, "no"); + return (Criteria) this; + } + + public Criteria andNoGreaterThanOrEqualTo(Double value) { + addCriterion("NO >=", value, "no"); + return (Criteria) this; + } + + public Criteria andNoLessThan(Double value) { + addCriterion("NO <", value, "no"); + return (Criteria) this; + } + + public Criteria andNoLessThanOrEqualTo(Double value) { + addCriterion("NO <=", value, "no"); + return (Criteria) this; + } + + public Criteria andNoIn(List values) { + addCriterion("NO in", values, "no"); + return (Criteria) this; + } + + public Criteria andNoNotIn(List values) { + addCriterion("NO not in", values, "no"); + return (Criteria) this; + } + + public Criteria andNoBetween(Double value1, Double value2) { + addCriterion("NO between", value1, value2, "no"); + return (Criteria) this; + } + + public Criteria andNoNotBetween(Double value1, Double value2) { + addCriterion("NO not between", value1, value2, "no"); + return (Criteria) this; + } + + public Criteria andCategoryIsNull() { + addCriterion("category is null"); + return (Criteria) this; + } + + public Criteria andCategoryIsNotNull() { + addCriterion("category is not null"); + return (Criteria) this; + } + + public Criteria andCategoryEqualTo(Integer value) { + addCriterion("category =", value, "category"); + return (Criteria) this; + } + + public Criteria andCategoryNotEqualTo(Integer value) { + addCriterion("category <>", value, "category"); + return (Criteria) this; + } + + public Criteria andCategoryGreaterThan(Integer value) { + addCriterion("category >", value, "category"); + return (Criteria) this; + } + + public Criteria andCategoryGreaterThanOrEqualTo(Integer value) { + addCriterion("category >=", value, "category"); + return (Criteria) this; + } + + public Criteria andCategoryLessThan(Integer value) { + addCriterion("category <", value, "category"); + return (Criteria) this; + } + + public Criteria andCategoryLessThanOrEqualTo(Integer value) { + addCriterion("category <=", value, "category"); + return (Criteria) this; + } + + public Criteria andCategoryIn(List values) { + addCriterion("category in", values, "category"); + return (Criteria) this; + } + + public Criteria andCategoryNotIn(List values) { + addCriterion("category not in", values, "category"); + return (Criteria) this; + } + + public Criteria andCategoryBetween(Integer value1, Integer value2) { + addCriterion("category between", value1, value2, "category"); + return (Criteria) this; + } + + public Criteria andCategoryNotBetween(Integer value1, Integer value2) { + addCriterion("category not between", value1, value2, "category"); + return (Criteria) this; + } + + public Criteria andWxOrderIdIsNull() { + addCriterion("wx_order_id is null"); + return (Criteria) this; + } + + public Criteria andWxOrderIdIsNotNull() { + addCriterion("wx_order_id is not null"); + return (Criteria) this; + } + + public Criteria andWxOrderIdEqualTo(Integer value) { + addCriterion("wx_order_id =", value, "wxOrderId"); + return (Criteria) this; + } + + public Criteria andWxOrderIdNotEqualTo(Integer value) { + addCriterion("wx_order_id <>", value, "wxOrderId"); + return (Criteria) this; + } + + public Criteria andWxOrderIdGreaterThan(Integer value) { + addCriterion("wx_order_id >", value, "wxOrderId"); + return (Criteria) this; + } + + public Criteria andWxOrderIdGreaterThanOrEqualTo(Integer value) { + addCriterion("wx_order_id >=", value, "wxOrderId"); + return (Criteria) this; + } + + public Criteria andWxOrderIdLessThan(Integer value) { + addCriterion("wx_order_id <", value, "wxOrderId"); + return (Criteria) this; + } + + public Criteria andWxOrderIdLessThanOrEqualTo(Integer value) { + addCriterion("wx_order_id <=", value, "wxOrderId"); + return (Criteria) this; + } + + public Criteria andWxOrderIdIn(List values) { + addCriterion("wx_order_id in", values, "wxOrderId"); + return (Criteria) this; + } + + public Criteria andWxOrderIdNotIn(List values) { + addCriterion("wx_order_id not in", values, "wxOrderId"); + return (Criteria) this; + } + + public Criteria andWxOrderIdBetween(Integer value1, Integer value2) { + addCriterion("wx_order_id between", value1, value2, "wxOrderId"); + return (Criteria) this; + } + + public Criteria andWxOrderIdNotBetween(Integer value1, Integer value2) { + addCriterion("wx_order_id not between", value1, value2, "wxOrderId"); + return (Criteria) this; + } + + public Criteria andDelFlagIsNull() { + addCriterion("del_flag is null"); + return (Criteria) this; + } + + public Criteria andDelFlagIsNotNull() { + addCriterion("del_flag is not null"); + return (Criteria) this; + } + + public Criteria andDelFlagEqualTo(Integer value) { + addCriterion("del_flag =", value, "delFlag"); + return (Criteria) this; + } + + public Criteria andDelFlagNotEqualTo(Integer value) { + addCriterion("del_flag <>", value, "delFlag"); + return (Criteria) this; + } + + public Criteria andDelFlagGreaterThan(Integer value) { + addCriterion("del_flag >", value, "delFlag"); + return (Criteria) this; + } + + public Criteria andDelFlagGreaterThanOrEqualTo(Integer value) { + addCriterion("del_flag >=", value, "delFlag"); + return (Criteria) this; + } + + public Criteria andDelFlagLessThan(Integer value) { + addCriterion("del_flag <", value, "delFlag"); + return (Criteria) this; + } + + public Criteria andDelFlagLessThanOrEqualTo(Integer value) { + addCriterion("del_flag <=", value, "delFlag"); + return (Criteria) this; + } + + public Criteria andDelFlagIn(List values) { + addCriterion("del_flag in", values, "delFlag"); + return (Criteria) this; + } + + public Criteria andDelFlagNotIn(List values) { + addCriterion("del_flag not in", values, "delFlag"); + return (Criteria) this; + } + + public Criteria andDelFlagBetween(Integer value1, Integer value2) { + addCriterion("del_flag between", value1, value2, "delFlag"); + return (Criteria) this; + } + + public Criteria andDelFlagNotBetween(Integer value1, Integer value2) { + addCriterion("del_flag not between", value1, value2, "delFlag"); + return (Criteria) this; + } + + public Criteria andCreateByIsNull() { + addCriterion("create_by is null"); + return (Criteria) this; + } + + public Criteria andCreateByIsNotNull() { + addCriterion("create_by is not null"); + return (Criteria) this; + } + + public Criteria andCreateByEqualTo(String value) { + addCriterion("create_by =", value, "createBy"); + return (Criteria) this; + } + + public Criteria andCreateByNotEqualTo(String value) { + addCriterion("create_by <>", value, "createBy"); + return (Criteria) this; + } + + public Criteria andCreateByGreaterThan(String value) { + addCriterion("create_by >", value, "createBy"); + return (Criteria) this; + } + + public Criteria andCreateByGreaterThanOrEqualTo(String value) { + addCriterion("create_by >=", value, "createBy"); + return (Criteria) this; + } + + public Criteria andCreateByLessThan(String value) { + addCriterion("create_by <", value, "createBy"); + return (Criteria) this; + } + + public Criteria andCreateByLessThanOrEqualTo(String value) { + addCriterion("create_by <=", value, "createBy"); + return (Criteria) this; + } + + public Criteria andCreateByLike(String value) { + addCriterion("create_by like", value, "createBy"); + return (Criteria) this; + } + + public Criteria andCreateByNotLike(String value) { + addCriterion("create_by not like", value, "createBy"); + return (Criteria) this; + } + + public Criteria andCreateByIn(List values) { + addCriterion("create_by in", values, "createBy"); + return (Criteria) this; + } + + public Criteria andCreateByNotIn(List values) { + addCriterion("create_by not in", values, "createBy"); + return (Criteria) this; + } + + public Criteria andCreateByBetween(String value1, String value2) { + addCriterion("create_by between", value1, value2, "createBy"); + return (Criteria) this; + } + + public Criteria andCreateByNotBetween(String value1, String value2) { + addCriterion("create_by not between", value1, value2, "createBy"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNull() { + addCriterion("create_time is null"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNotNull() { + addCriterion("create_time is not null"); + return (Criteria) this; + } + + public Criteria andCreateTimeEqualTo(Date value) { + addCriterion("create_time =", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotEqualTo(Date value) { + addCriterion("create_time <>", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThan(Date value) { + addCriterion("create_time >", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("create_time >=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThan(Date value) { + addCriterion("create_time <", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThanOrEqualTo(Date value) { + addCriterion("create_time <=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeIn(List values) { + addCriterion("create_time in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotIn(List values) { + addCriterion("create_time not in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeBetween(Date value1, Date value2) { + addCriterion("create_time between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotBetween(Date value1, Date value2) { + addCriterion("create_time not between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andUpdateByIsNull() { + addCriterion("update_by is null"); + return (Criteria) this; + } + + public Criteria andUpdateByIsNotNull() { + addCriterion("update_by is not null"); + return (Criteria) this; + } + + public Criteria andUpdateByEqualTo(String value) { + addCriterion("update_by =", value, "updateBy"); + return (Criteria) this; + } + + public Criteria andUpdateByNotEqualTo(String value) { + addCriterion("update_by <>", value, "updateBy"); + return (Criteria) this; + } + + public Criteria andUpdateByGreaterThan(String value) { + addCriterion("update_by >", value, "updateBy"); + return (Criteria) this; + } + + public Criteria andUpdateByGreaterThanOrEqualTo(String value) { + addCriterion("update_by >=", value, "updateBy"); + return (Criteria) this; + } + + public Criteria andUpdateByLessThan(String value) { + addCriterion("update_by <", value, "updateBy"); + return (Criteria) this; + } + + public Criteria andUpdateByLessThanOrEqualTo(String value) { + addCriterion("update_by <=", value, "updateBy"); + return (Criteria) this; + } + + public Criteria andUpdateByLike(String value) { + addCriterion("update_by like", value, "updateBy"); + return (Criteria) this; + } + + public Criteria andUpdateByNotLike(String value) { + addCriterion("update_by not like", value, "updateBy"); + return (Criteria) this; + } + + public Criteria andUpdateByIn(List values) { + addCriterion("update_by in", values, "updateBy"); + return (Criteria) this; + } + + public Criteria andUpdateByNotIn(List values) { + addCriterion("update_by not in", values, "updateBy"); + return (Criteria) this; + } + + public Criteria andUpdateByBetween(String value1, String value2) { + addCriterion("update_by between", value1, value2, "updateBy"); + return (Criteria) this; + } + + public Criteria andUpdateByNotBetween(String value1, String value2) { + addCriterion("update_by not between", value1, value2, "updateBy"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNull() { + addCriterion("update_time is null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNotNull() { + addCriterion("update_time is not null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeEqualTo(Date value) { + addCriterion("update_time =", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotEqualTo(Date value) { + addCriterion("update_time <>", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThan(Date value) { + addCriterion("update_time >", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("update_time >=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThan(Date value) { + addCriterion("update_time <", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThanOrEqualTo(Date value) { + addCriterion("update_time <=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIn(List values) { + addCriterion("update_time in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotIn(List values) { + addCriterion("update_time not in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeBetween(Date value1, Date value2) { + addCriterion("update_time between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotBetween(Date value1, Date value2) { + addCriterion("update_time not between", value1, value2, "updateTime"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/car-dao/src/main/java/com/weiqi/mis/mapper/WxSgPolluteSdsMapper.java b/car-dao/src/main/java/com/weiqi/mis/mapper/WxSgPolluteSdsMapper.java new file mode 100644 index 0000000..f291793 --- /dev/null +++ b/car-dao/src/main/java/com/weiqi/mis/mapper/WxSgPolluteSdsMapper.java @@ -0,0 +1,23 @@ +package com.weiqi.mis.mapper; + +import com.weiqi.mis.domain.WxSgPolluteSds; +import com.weiqi.mis.domain.WxSgPolluteSdsExample; +import java.util.List; + +public interface WxSgPolluteSdsMapper { + int countByExample(WxSgPolluteSdsExample example); + + int deleteByPrimaryKey(Integer id); + + int insert(WxSgPolluteSds record); + + int insertSelective(WxSgPolluteSds record); + + List selectByExample(WxSgPolluteSdsExample example); + + WxSgPolluteSds selectByPrimaryKey(Integer id); + + int updateByPrimaryKeySelective(WxSgPolluteSds record); + + int updateByPrimaryKey(WxSgPolluteSds record); +} \ No newline at end of file diff --git a/car-dao/src/main/resources/com/weiqi/mis/mapper/WxSgPolluteSdsMapper.xml b/car-dao/src/main/resources/com/weiqi/mis/mapper/WxSgPolluteSdsMapper.xml new file mode 100644 index 0000000..d25442f --- /dev/null +++ b/car-dao/src/main/resources/com/weiqi/mis/mapper/WxSgPolluteSdsMapper.xml @@ -0,0 +1,249 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, lambda, O2, CO, CO2, HC, NO, category, wx_order_id, del_flag, create_by, create_time, + update_by, update_time + + + + + delete from wx_sg_pollute_sds + where id = #{id,jdbcType=INTEGER} + + + insert into wx_sg_pollute_sds (id, lambda, O2, + CO, CO2, HC, NO, + category, wx_order_id, del_flag, + create_by, create_time, update_by, + update_time) + values (#{id,jdbcType=INTEGER}, #{lambda,jdbcType=DOUBLE}, #{o2,jdbcType=DOUBLE}, + #{co,jdbcType=DOUBLE}, #{co2,jdbcType=DOUBLE}, #{hc,jdbcType=DOUBLE}, #{no,jdbcType=DOUBLE}, + #{category,jdbcType=INTEGER}, #{wxOrderId,jdbcType=INTEGER}, #{delFlag,jdbcType=INTEGER}, + #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR}, + #{updateTime,jdbcType=TIMESTAMP}) + + + insert into wx_sg_pollute_sds + + + id, + + + lambda, + + + O2, + + + CO, + + + CO2, + + + HC, + + + NO, + + + category, + + + wx_order_id, + + + del_flag, + + + create_by, + + + create_time, + + + update_by, + + + update_time, + + + + + #{id,jdbcType=INTEGER}, + + + #{lambda,jdbcType=DOUBLE}, + + + #{o2,jdbcType=DOUBLE}, + + + #{co,jdbcType=DOUBLE}, + + + #{co2,jdbcType=DOUBLE}, + + + #{hc,jdbcType=DOUBLE}, + + + #{no,jdbcType=DOUBLE}, + + + #{category,jdbcType=INTEGER}, + + + #{wxOrderId,jdbcType=INTEGER}, + + + #{delFlag,jdbcType=INTEGER}, + + + #{createBy,jdbcType=VARCHAR}, + + + #{createTime,jdbcType=TIMESTAMP}, + + + #{updateBy,jdbcType=VARCHAR}, + + + #{updateTime,jdbcType=TIMESTAMP}, + + + + + + update wx_sg_pollute_sds + + + lambda = #{lambda,jdbcType=DOUBLE}, + + + O2 = #{o2,jdbcType=DOUBLE}, + + + CO = #{co,jdbcType=DOUBLE}, + + + CO2 = #{co2,jdbcType=DOUBLE}, + + + HC = #{hc,jdbcType=DOUBLE}, + + + NO = #{no,jdbcType=DOUBLE}, + + + category = #{category,jdbcType=INTEGER}, + + + wx_order_id = #{wxOrderId,jdbcType=INTEGER}, + + + del_flag = #{delFlag,jdbcType=INTEGER}, + + + create_by = #{createBy,jdbcType=VARCHAR}, + + + create_time = #{createTime,jdbcType=TIMESTAMP}, + + + update_by = #{updateBy,jdbcType=VARCHAR}, + + + update_time = #{updateTime,jdbcType=TIMESTAMP}, + + + where id = #{id,jdbcType=INTEGER} + + + update wx_sg_pollute_sds + set lambda = #{lambda,jdbcType=DOUBLE}, + O2 = #{o2,jdbcType=DOUBLE}, + CO = #{co,jdbcType=DOUBLE}, + CO2 = #{co2,jdbcType=DOUBLE}, + HC = #{hc,jdbcType=DOUBLE}, + NO = #{no,jdbcType=DOUBLE}, + category = #{category,jdbcType=INTEGER}, + wx_order_id = #{wxOrderId,jdbcType=INTEGER}, + del_flag = #{delFlag,jdbcType=INTEGER}, + create_by = #{createBy,jdbcType=VARCHAR}, + create_time = #{createTime,jdbcType=TIMESTAMP}, + update_by = #{updateBy,jdbcType=VARCHAR}, + update_time = #{updateTime,jdbcType=TIMESTAMP} + where id = #{id,jdbcType=INTEGER} + + \ No newline at end of file diff --git a/car-mis/src/main/java/com/weiqi/mis/MisApplication.java b/car-mis/src/main/java/com/weiqi/mis/MisApplication.java index f97c6c3..1ed042d 100644 --- a/car-mis/src/main/java/com/weiqi/mis/MisApplication.java +++ b/car-mis/src/main/java/com/weiqi/mis/MisApplication.java @@ -4,14 +4,16 @@ import org.mybatis.spring.annotation.MapperScan; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.scheduling.annotation.EnableAsync; +import org.springframework.scheduling.annotation.EnableScheduling; -@MapperScan(basePackages = { "com.weiqi.mis.mapper"}) +@MapperScan(basePackages = {"com.weiqi.mis.mapper"}) @SpringBootApplication @EnableAsync +@EnableScheduling public class MisApplication { - public static void main(String[] args) { - SpringApplication.run(MisApplication.class, args); - } + public static void main(String[] args) { + SpringApplication.run(MisApplication.class, args); + } } diff --git a/car-mis/src/main/java/com/weiqi/mis/config/JobLog.java b/car-mis/src/main/java/com/weiqi/mis/config/JobLog.java deleted file mode 100644 index fe19436..0000000 --- a/car-mis/src/main/java/com/weiqi/mis/config/JobLog.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.weiqi.mis.config; - -import com.weiqi.mis.DateUtil; -import com.xxl.job.core.context.XxlJobContext; -import com.xxl.job.core.log.XxlJobFileAppender; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.PrintWriter; -import java.io.StringWriter; -import java.util.Date; - -public class JobLog { - private static final Logger logger = LoggerFactory.getLogger("xxl-job logger"); - - public static void info(String appendLog) { - String formatAppendLog = formatLog(appendLog); - if (XxlJobContext.getXxlJobContext() == null) { - logger.info(appendLog); - return; - } - String jobLogFileName = XxlJobContext.getXxlJobContext() == null ? null : XxlJobContext.getXxlJobContext().getJobLogFileName(); - if (jobLogFileName != null && jobLogFileName.trim().length() != 0) { - XxlJobFileAppender.appendLog(jobLogFileName, formatAppendLog); - logger.info("[{}]: {}", jobLogFileName, appendLog); - } else { - logger.info(appendLog); - } - } - - public static void warn(String appendLog) { - String formatAppendLog = formatLog(appendLog); - if (XxlJobContext.getXxlJobContext() == null) { - logger.warn(appendLog); - return; - } - String jobLogFileName = XxlJobContext.getXxlJobContext().getJobLogFileName(); - if (jobLogFileName != null && jobLogFileName.trim().length() != 0) { - XxlJobFileAppender.appendLog(jobLogFileName, formatAppendLog); - logger.warn("[{}]: {}", jobLogFileName, appendLog); - } else { - logger.warn(appendLog); - } - } - - public static void error(String appendLog, Throwable e) { - String formatAppendLog = formatLog(appendLog); - if (XxlJobContext.getXxlJobContext() == null) { - logger.error(appendLog, e); - return; - } - String jobLogFileName = XxlJobContext.getXxlJobContext().getJobLogFileName(); - if (jobLogFileName != null && jobLogFileName.trim().length() != 0) { - XxlJobFileAppender.appendLog(jobLogFileName, formatAppendLog); - StringWriter out = new StringWriter(); - PrintWriter pr = new PrintWriter(out); - e.printStackTrace(pr); - XxlJobFileAppender.appendLog(jobLogFileName, out.toString()); - - logger.error("[{}]: {}", jobLogFileName, appendLog, e); - } else { - logger.error(appendLog, e); - } - } - - private static String formatLog(String appendLog) { - StackTraceElement[] stackTraceElements = (new Throwable()).getStackTrace(); - StackTraceElement callInfo = stackTraceElements[1]; - String formatLocalDateTime = DateUtil.Date2String (new Date(),"yyyy-MM-dd HH:mm:ss"); - return formatLocalDateTime + " [" + - callInfo.getClassName() + "]-[" + - callInfo.getMethodName() + "]-[" + - callInfo.getLineNumber() + "]-[" + - Thread.currentThread().getName() + "] " + - (appendLog != null ? appendLog : ""); - } -} diff --git a/car-mis/src/main/java/com/weiqi/mis/config/XxlJobConfig.java b/car-mis/src/main/java/com/weiqi/mis/config/XxlJobConfig.java deleted file mode 100644 index e35eaf5..0000000 --- a/car-mis/src/main/java/com/weiqi/mis/config/XxlJobConfig.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.weiqi.mis.config; - -import com.xxl.job.core.executor.impl.XxlJobSpringExecutor; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -@ConditionalOnProperty(name = "xxl.job.enable", havingValue = "true", matchIfMissing = false) -@Configuration -public class XxlJobConfig { - private Logger logger = LoggerFactory.getLogger(XxlJobConfig.class); - - @Value("${xxl.job.admin.addresses}") - private String adminAddresses; - - @Value("${xxl.job.executor.appname}") - private String appName; - - @Value("${xxl.job.executor.bindip}") - private String ip; - - @Value("${xxl.job.executor.port}") - private int port; - - @Value("${xxl.job.accessToken}") - private String accessToken; - - @Value("${xxl.job.executor.logpath}") - private String logPath; - - @Value("${xxl.job.executor.logretentiondays}") - private int logRetentionDays; - - - @Bean - public XxlJobSpringExecutor xxlJobExecutor() { - XxlJobSpringExecutor xxlJobSpringExecutor = new XxlJobSpringExecutor(); - xxlJobSpringExecutor.setAdminAddresses(adminAddresses); - xxlJobSpringExecutor.setAppname(appName); - xxlJobSpringExecutor.setIp(ip); - xxlJobSpringExecutor.setPort(port); - xxlJobSpringExecutor.setAccessToken(accessToken); - xxlJobSpringExecutor.setLogPath(logPath); - xxlJobSpringExecutor.setLogRetentionDays(logRetentionDays); - - return xxlJobSpringExecutor; - } - -} \ No newline at end of file diff --git a/car-mis/src/main/java/com/weiqi/mis/contorller/AppRunnerController.java b/car-mis/src/main/java/com/weiqi/mis/contorller/AppRunnerController.java new file mode 100644 index 0000000..8c6b5ee --- /dev/null +++ b/car-mis/src/main/java/com/weiqi/mis/contorller/AppRunnerController.java @@ -0,0 +1,27 @@ +package com.weiqi.mis.contorller; + +import com.weiqi.mis.MsgService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.ApplicationArguments; +import org.springframework.boot.ApplicationRunner; +import org.springframework.stereotype.Component; + +/** + * 项目启动后执行一次 + * + * @author createTime 2024-10-07 22:37 + **/ +@Component +public class AppRunnerController implements ApplicationRunner { + + @Autowired + MsgService msgService; + + + @Override + public void run(ApplicationArguments args) throws Exception { + + // 启动后初始化参数表信息 + msgService.addinfo(); + } +} diff --git a/car-mis/src/main/java/com/weiqi/mis/contorller/CarController.java b/car-mis/src/main/java/com/weiqi/mis/contorller/CarController.java index c95e023..dba2ee8 100644 --- a/car-mis/src/main/java/com/weiqi/mis/contorller/CarController.java +++ b/car-mis/src/main/java/com/weiqi/mis/contorller/CarController.java @@ -23,7 +23,9 @@ public class CarController { MsgService msgService; - /** 订单明细 + /** + * 订单明细 + * * @return */ @RequestMapping(value = "/index") @@ -59,6 +61,17 @@ public class CarController { } + /** + * @return + */ + @RequestMapping(value = "init123") + @ResponseBody + public Object setorderInfo() { + + return msgService.setorderInfo(); + + } + /** * 获取通道 * @@ -94,9 +107,16 @@ public class CarController { @ResponseBody public Object tb(int id) { - log.info("id= {}",id); + log.info("id= {}", id); return ReturnValue.buildErrordata(0, "同步成功!"); } + @RequestMapping(value = "addinfo") + @ResponseBody + public Object addinfo() { + + return msgService.addinfo(); + + } } diff --git a/car-mis/src/main/java/com/weiqi/mis/contorller/ScheduledTasks.java b/car-mis/src/main/java/com/weiqi/mis/contorller/ScheduledTasks.java new file mode 100644 index 0000000..20c2cea --- /dev/null +++ b/car-mis/src/main/java/com/weiqi/mis/contorller/ScheduledTasks.java @@ -0,0 +1,44 @@ +package com.weiqi.mis.contorller; + +import com.weiqi.mis.MsgService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Configurable; +import org.springframework.scheduling.annotation.EnableScheduling; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Component; +import org.springframework.web.bind.annotation.RestController; + +@Component +@Configurable +@EnableScheduling +@RestController + +/** + * + */ +public class ScheduledTasks { + private Logger logger = LoggerFactory.getLogger(getClass()); + + @Autowired + MsgService msgService; + + /** + * 一小时缓存失效一次 + */ + @Scheduled(cron = "0 0 0/1 * * ? ") + public void addinfoCron() { + msgService.addinfo(); + } + + /** + * 定期更新订单表数据 + * + */ + @Scheduled(cron = "0 0/1 * * * ? ") + public void setorderInfoCron() { + msgService.setorderInfo(); + } + +} diff --git a/car-mis/src/main/resources/application-test.properties b/car-mis/src/main/resources/application-test.properties index 97930b9..08cba0b 100644 --- a/car-mis/src/main/resources/application-test.properties +++ b/car-mis/src/main/resources/application-test.properties @@ -1,9 +1,10 @@ ###\u7AEF\u53E3\u914D\u7F6E spring.datasource.type=com.alibaba.druid.pool.DruidDataSource -spring.datasource.url=jdbc:mysql://10.27.74.56:4000/smsdb?allowMultiQueries=true&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&serverTimezone=GMT%2b8&useSSL=false -spring.datasource.username=sysbench -spring.datasource.password=SysBench12 + +spring.datasource.url=jdbc:mysql://cfo.mycar369.com:3306/wx_weiqi?allowMultiQueries=true&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&serverTimezone=GMT%2b8&useSSL=false +spring.datasource.username=root +spring.datasource.password=autoHOME2022!!!!mysql spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver spring.datasource.initialSize=1 @@ -25,13 +26,3 @@ spring.datasource.connectionProperties=druid.stat.mergeSql=true;druid.stat.slowS logging.config=classpath:logback-test.xml -##redis 189 -#spring.redis.database=0 -#spring.redis.host=10.168.100.189 -#spring.redis.password=0gyU7a -#spring.redis.port=6379 -#spring.redis.jedis.pool.max-active=1024 -#spring.redis.jedis.pool.max-idle=500 -#spring.redis.jedis.pool.min-idle=100 -#spring.redis.block-when-exhausted=true - diff --git a/car-mis/src/main/resources/application-yz.properties b/car-mis/src/main/resources/application-yz.properties index b9c1dbc..2ed456d 100644 --- a/car-mis/src/main/resources/application-yz.properties +++ b/car-mis/src/main/resources/application-yz.properties @@ -1,57 +1,57 @@ -###\u7AEF\u53E3\u914D\u7F6E -spring.datasource.type=com.alibaba.druid.pool.DruidDataSource - +####\u7AEF\u53E3\u914D\u7F6E +#spring.datasource.type=com.alibaba.druid.pool.DruidDataSource # -#spring.datasource.url=jdbc:mysql://feed-4000-tidb.yz.weiqi.com.cn:4000/smsdb?useUnicode=true&characterEncoding=utf-8&useSSL=false -spring.datasource.url=jdbc:mysql://sms-master-4000.tidb.db.corpweiqi.com:4000/smsdb?allowMultiQueries=true&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&serverTimezone=GMT%2b8&useSSL=false -spring.datasource.username=smsdb_wr -spring.datasource.password=ULZahlCFfI9Tt5qk - -#\u4E3A\u4E86\u4F7F\u7528tiflash\u5148\u4F7F\u7528\u5ECA\u574A\u673A\u623F -#spring.datasource.url=jdbc:mysql://sms-slave-4000.tidb.db.corpweiqi.com:4000/smsdb?useUnicode=true&characterEncoding=utf-8&useSSL=false&rewriteBatchedStatements=true&useServerPrepStmts=true&allowMultiQueries=true +## +##spring.datasource.url=jdbc:mysql://feed-4000-tidb.yz.weiqi.com.cn:4000/smsdb?useUnicode=true&characterEncoding=utf-8&useSSL=false +#spring.datasource.url=jdbc:mysql://sms-master-4000.tidb.db.corpweiqi.com:4000/smsdb?allowMultiQueries=true&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&serverTimezone=GMT%2b8&useSSL=false #spring.datasource.username=smsdb_wr #spring.datasource.password=ULZahlCFfI9Tt5qk - -spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver -spring.datasource.initialSize=1 -spring.datasource.minIdle=1 -spring.datasource.maxActive=20 -spring.datasource.dbcp2.max-open-prepared-statements=20 -spring.datasource.maxWait=60000 -spring.datasource.timeBetweenEvictionRunsMillis=60000 -spring.datasource.minEvictableIdleTimeMillis=300000 -spring.datasource.testWhileIdle=true -spring.datasource.testOnBorrow=false -spring.datasource.testOnReturn=false -spring.datasource.poolPreparedStatements=false -spring.datasource.maxPoolPreparedStatementPerConnectionSize=20 -spring.datasource.hikari.validation-timeout=900000 -spring.datasource.filters=stat,wall,log4j -spring.datasource.connectionProperties=druid.stat.mergeSql=true;druid.stat.slowSqlMillis=50 - -logging.config=classpath:logback-prod.xml - - -spring.redis.database=0 -spring.redis.host=jiage-sms-kafka.redis.cache.corpweiqi.com -spring.redis.port=20061 -spring.redis.password=9FL4a*g4Ai -#spring.redis.host=10.231.61.40 -#spring.redis.port=6379 +# +##\u4E3A\u4E86\u4F7F\u7528tiflash\u5148\u4F7F\u7528\u5ECA\u574A\u673A\u623F +##spring.datasource.url=jdbc:mysql://sms-slave-4000.tidb.db.corpweiqi.com:4000/smsdb?useUnicode=true&characterEncoding=utf-8&useSSL=false&rewriteBatchedStatements=true&useServerPrepStmts=true&allowMultiQueries=true +##spring.datasource.username=smsdb_wr +##spring.datasource.password=ULZahlCFfI9Tt5qk +# +#spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver +#spring.datasource.initialSize=1 +#spring.datasource.minIdle=1 +#spring.datasource.maxActive=20 +#spring.datasource.dbcp2.max-open-prepared-statements=20 +#spring.datasource.maxWait=60000 +#spring.datasource.timeBetweenEvictionRunsMillis=60000 +#spring.datasource.minEvictableIdleTimeMillis=300000 +#spring.datasource.testWhileIdle=true +#spring.datasource.testOnBorrow=false +#spring.datasource.testOnReturn=false +#spring.datasource.poolPreparedStatements=false +#spring.datasource.maxPoolPreparedStatementPerConnectionSize=20 +#spring.datasource.hikari.validation-timeout=900000 +#spring.datasource.filters=stat,wall,log4j +#spring.datasource.connectionProperties=druid.stat.mergeSql=true;druid.stat.slowSqlMillis=50 +# +#logging.config=classpath:logback-prod.xml +# +# +#spring.redis.database=0 +#spring.redis.host=jiage-sms-kafka.redis.cache.corpweiqi.com +#spring.redis.port=20061 #spring.redis.password=9FL4a*g4Ai -spring.redis.jedis.pool.max-active=1024 -spring.redis.jedis.pool.max-idle=500 -spring.redis.jedis.pool.min-idle=100 -spring.redis.block-when-exhausted=true - -#\u9001\u8FBE\u7387\u4F4E\u4E8E90%\u62A5\u8B66 -send.rate.alarm.phoneno=18801217561,18975045528,16601102415,13180180070,13581608179 -# xxl-job?? -xxl.job.enable=true -xxl.job.admin.addresses=http://uag-job.corpweiqi.com/xxl-job-admin -xxl.job.executor.appname=sms-mis -xxl.job.executor.port=7999 -xxl.job.executor.logpath=/data/jiage-sms-mis/log -xxl.job.executor.logretentiondays=30 -xxl.job.accessToken=xMrVFjivwewvVriOeikYJFJIpUEktBGWrZMrBkhSXJS -xxl.job.executor.bindip= \ No newline at end of file +##spring.redis.host=10.231.61.40 +##spring.redis.port=6379 +##spring.redis.password=9FL4a*g4Ai +#spring.redis.jedis.pool.max-active=1024 +#spring.redis.jedis.pool.max-idle=500 +#spring.redis.jedis.pool.min-idle=100 +#spring.redis.block-when-exhausted=true +# +##\u9001\u8FBE\u7387\u4F4E\u4E8E90%\u62A5\u8B66 +#send.rate.alarm.phoneno=18801217561,18975045528,16601102415,13180180070,13581608179 +## xxl-job?? +#xxl.job.enable=true +#xxl.job.admin.addresses=http://uag-job.corpweiqi.com/xxl-job-admin +#xxl.job.executor.appname=sms-mis +#xxl.job.executor.port=7999 +#xxl.job.executor.logpath=/data/jiage-sms-mis/log +#xxl.job.executor.logretentiondays=30 +#xxl.job.accessToken=xMrVFjivwewvVriOeikYJFJIpUEktBGWrZMrBkhSXJS +#xxl.job.executor.bindip= \ No newline at end of file diff --git a/car-mis/src/main/resources/application.properties b/car-mis/src/main/resources/application.properties index 7aba31d..66bda32 100644 --- a/car-mis/src/main/resources/application.properties +++ b/car-mis/src/main/resources/application.properties @@ -22,5 +22,3 @@ spring.jackson.time-zone=GMT+8 spring.jackson.date-format=yyyy/MM/dd HH:mm:ss -redis.check.geetest.status.key=REDIS_CHECK_GEETEST_STATUS_KEY -redis.check.geetest.status.extime=86400 diff --git a/car-mis/src/main/resources/config.properties b/car-mis/src/main/resources/config.properties deleted file mode 100644 index c0410f3..0000000 --- a/car-mis/src/main/resources/config.properties +++ /dev/null @@ -1,40 +0,0 @@ -# \u5411\u6781\u9A8C\u7533\u8BF7\u7684id\u548Ckey -geetest.id=467f23c37772ea257ecda512156704bc -geetest.key=5467948a5474802dd245e8f4d544a72d - -# \u6781\u9A8C\u4E91\u76D1\u63A7\u63A5\u53E3 -check.geetest.status.url=http://bypass.geetest.com/v1/bypass_status.php -# \u5B9A\u65F6\u5668\u4EFB\u52A1\u8F6E\u8BE2\u95F4\u9694\u65F6\u95F4\u8BBE\u7F6E\uFF0C\u5355\u4F4D/\u6BEB\u79D2 -task.schedule.check.geetest.status.interval=10000 - -# redis\u4E2D\u5B58\u5165\u6781\u9A8C\u4E91\u72B6\u6001\u7684key -redis.check.geetest.status.key=REDIS_CHECK_GEETEST_STATUS_KEY -# redis\u8FC7\u671F\u65F6\u95F4\uFF0C\u5355\u4F4D/\u79D2 -redis.check.geetest.status.extime=86400 - -# redis\u5730\u5740 -#redis1.ip=127.0.0.1 -#redis1.port=6379 -#redis1.password=crs-57hpob9h4ng6d#o2s5H - -redis1.ip=10.28.74.50 -redis1.port=6399 - -# redis\u8FDE\u63A5\u6C60\u914D\u7F6E -# \u6700\u5927\u8FDE\u63A5\u6570 -redis.max.total=20 -# \u5728jedispool\u4E2D\u6700\u5927\u7684idle\u72B6\u6001(\u7A7A\u95F2\u7684)jedis\u5B9E\u4F8B\u7684\u4E2A\u6570 -redis.max.idle=20 -# \u5728jedispool\u4E2D\u6700\u5C0F\u7684idle\u72B6\u6001(\u7A7A\u95F2\u7684)jedis\u5B9E\u4F8B\u7684\u4E2A\u6570 -redis.min.idle=20 -# \u6700\u5927\u7B49\u5F85\u65F6\u95F4 -redis.max.millis=5 -# \u5728borow\u4E00\u4E2Ajedis\u5B9E\u4F8B\u7684\u65F6\u5019\uFF0C\u662F\u5426\u8981\u8FDB\u884C\u9A8C\u8BC1\u64CD\u4F5C\uFF0C\u5982\u679C\u8D4B\u503Ctrue\uFF0C\u5219\u5F97\u5230\u7684jedis\u5B9E\u4F8B\u80AF\u5B9A\u662F\u53EF\u4EE5\u7528\u7684\u3002 -redis.test.borrow=true -# \u5728return\u4E00\u4E2Ajedis\u5B9E\u4F8B\u7684\u65F6\u5019\uFF0C\u662F\u5426\u8981\u8FDB\u884C\u9A8C\u8BC1\u64CD\u4F5C\uFF0C\u5982\u679C\u8D4B\u503Ctrue\uFF0C\u5219\u653E\u56DE\u7684jedis\u5B9E\u4F8B\u80AF\u5B9A\u662F\u53EF\u4EE5\u7528\u7684\u3002 -redis.test.return=true -# \u8FDE\u63A5\u8017\u5C3D\u7684\u65F6\u5019\uFF0C\u662F\u5426\u963B\u585E\uFF0Cfalse\u4F1A\u629B\u51FA\u5F02\u5E38\uFF0Ctrue\u963B\u585E\u76F4\u5230\u8D85\u65F6\u3002\u9ED8\u8BA4true -redis.block.exhausted=true - - - diff --git a/car-service/src/main/java/com/weiqi/mis/MsgService.java b/car-service/src/main/java/com/weiqi/mis/MsgService.java index 3551654..0c78406 100644 --- a/car-service/src/main/java/com/weiqi/mis/MsgService.java +++ b/car-service/src/main/java/com/weiqi/mis/MsgService.java @@ -23,4 +23,8 @@ public interface MsgService { public Object getOrderinfoLog(OrderInfoVo records); + public Object addinfo(); + + public Object setorderInfo(); + } diff --git a/car-service/src/main/java/com/weiqi/mis/PushService.java b/car-service/src/main/java/com/weiqi/mis/PushService.java new file mode 100644 index 0000000..0b9d2d9 --- /dev/null +++ b/car-service/src/main/java/com/weiqi/mis/PushService.java @@ -0,0 +1,9 @@ +package com.weiqi.mis; + +import com.alibaba.fastjson.JSONObject; + +public interface PushService { + + JSONObject pushorder(int id); + +} diff --git a/car-service/src/main/java/com/weiqi/mis/impl/MsgServiceImpl.java b/car-service/src/main/java/com/weiqi/mis/impl/MsgServiceImpl.java index b6a200a..1c98fb5 100644 --- a/car-service/src/main/java/com/weiqi/mis/impl/MsgServiceImpl.java +++ b/car-service/src/main/java/com/weiqi/mis/impl/MsgServiceImpl.java @@ -3,15 +3,21 @@ package com.weiqi.mis.impl; import java.util.*; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.Executor; +import java.util.concurrent.TimeUnit; import javax.annotation.Resource; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.github.benmanes.caffeine.cache.Cache; +import com.github.benmanes.caffeine.cache.Caffeine; import com.weiqi.mis.DateUtil; import com.weiqi.mis.ReturnValue; import com.weiqi.mis.domain.*; import com.weiqi.mis.mapper.WxXrPemsOrderMapper; import com.weiqi.mis.mapper.WxXrPemsOrderPushLogMapper; import com.weiqi.vo.OrderInfoVo; +import lombok.val; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -23,8 +29,12 @@ import com.weiqi.mis.*; @Service public class MsgServiceImpl implements MsgService { - private Logger logger = LoggerFactory.getLogger(getClass()); + public static Cache brandIdCache = + Caffeine.newBuilder().expireAfterWrite(12, TimeUnit.HOURS).build(); + public static Cache seriesIdCache = + Caffeine.newBuilder().expireAfterWrite(12, TimeUnit.HOURS).build(); + private Logger logger = LoggerFactory.getLogger(getClass()); // 记录上次处理时间 @@ -37,18 +47,13 @@ public class MsgServiceImpl implements MsgService { @Resource(name = "threadPool") Executor executor; - public Object getinfo(){ + + public Object getinfo() { return ""; } - - - - - - /** * 查询所有appid * @@ -79,7 +84,6 @@ public class MsgServiceImpl implements MsgService { } - @Override public Object getOrderinfo(OrderInfoVo records) { @@ -98,7 +102,7 @@ public class MsgServiceImpl implements MsgService { if (records.getPlatenumber() != null && !records.getPlatenumber().equals("null") && records.getPlatenumber().toString().length() > 0) { - cri1.andPlatenumberLike("%"+records.getPlatenumber()+"%"); + cri1.andPlatenumberLike("%" + records.getPlatenumber() + "%"); } offset = (pageNumber - 1) * pagesize; example1.setOrderByClause(" create_time desc limit " + offset + " ," + pagesize); @@ -113,8 +117,9 @@ public class MsgServiceImpl implements MsgService { int num = wxXrPemsOrderMapper.countByExample(example1); List wxXrPemsOrders = wxXrPemsOrderMapper.selectByExample(example1); - return ReturnValue.buildSuccessdata(wxXrPemsOrders, num); + return ReturnValue.buildSuccessdata(wxXrPemsOrders, num); } + @Override public Object getOrderinfoLog(OrderInfoVo records) { @@ -146,7 +151,85 @@ public class MsgServiceImpl implements MsgService { int num = wxXrPemsOrderPushLogMapper.countByExample(example1); List wxXrPemsOrders = wxXrPemsOrderPushLogMapper.selectByExample(example1); - return ReturnValue.buildSuccessdata(wxXrPemsOrders, num); + return ReturnValue.buildSuccessdata(wxXrPemsOrders, num); + } + + @Override + public Object addinfo() { + + getbrandInfo(); + + return null; + } + + @Override + public Object setorderInfo() { + + WxXrPemsOrderExample example1 = new WxXrPemsOrderExample(); + WxXrPemsOrderExample.Criteria cri1 = example1.createCriteria(); + cri1.andSeriesidIsNull(); + + List wxXrPemsOrders = wxXrPemsOrderMapper.selectByExample(example1); + for (WxXrPemsOrder wxXrPemsOrder : wxXrPemsOrders) { + Integer brandId = brandIdCache.getIfPresent(wxXrPemsOrder.getBrandname()); + JSONObject jsonObject = seriesIdCache.getIfPresent(wxXrPemsOrder.getSeriesname()); + Integer id = jsonObject.getInteger("id"); + String img = jsonObject.getString("img"); + wxXrPemsOrder.setBrandid(brandId); + wxXrPemsOrder.setSeriesid(id); + wxXrPemsOrder.setVehiclesrc(img); + int i = wxXrPemsOrderMapper.updateByPrimaryKeySelective(wxXrPemsOrder); + logger.info("更新结果为:{}", i); + } + + return null; + } + + /** + * 获取品牌ID + * + * @return + */ + public Map getbrandInfo() { + + JSONObject js = new JSONObject(); + Map retmap = new HashMap(); + try { + String url = "https://api.mycar369.com/api//app/getbrands/v1?appid=LANBBXCXtest&os=android-11-M2011K2C&version=1.1.2×tamp=1725702019&udid=a97c068f-0ba3-3f3b-a25e-172087d538e2&noncestr=WySsMg&usid=36&_sign=C404D844CC87716925DC40E65F6E4FF9"; + String body = HttpUtil.sendGetRequest(url); + js = JSONObject.parseObject(body); + JSONArray objects = js.getJSONObject("result").getJSONArray("brand"); + for (int i = 0; i < objects.size(); i++) { + retmap.put(objects.getJSONObject(i).getString("brandname"), objects.getJSONObject(i).getInteger("brandid")); + brandIdCache.put(objects.getJSONObject(i).getString("brandname"), objects.getJSONObject(i).getInteger("brandid")); + getseries(objects.getJSONObject(i).getInteger("brandid") + ""); + } + } catch (Exception e) { + logger.error("{}", e); + } + return retmap; + } + + + public JSONObject getseries(String brandId) { + JSONObject js = new JSONObject(); + try { + String url = "https://api.mycar369.com/api/app/getseries/v1?brandid=" + brandId + "&appid=LANBBXCXtest&os=android-11-M2011K2C&version=1.1.2×tamp=1725705334&udid=a97c068f-0ba3-3f3b-a25e-172087d538e2&noncestr=B7aIVh&usid=36&_sign=AF5BBEE40C3C6C7205550B73A3B531E8"; + String body = HttpUtil.sendGetRequest(url); + js = JSONObject.parseObject(body); + if (js.getInteger("returncode") == 2000) { + JSONArray objects = js.getJSONArray("result"); + for (int i = 0; i < objects.size(); i++) { + JSONObject jsonObject = objects.getJSONObject(i); + seriesIdCache.put(jsonObject.getString("name"), jsonObject); + } + } + } catch (Exception e) { + js.put("returncode", -1); + js.put("message", "请求数据报错"); + } + + return js; } } diff --git a/car-service/src/main/java/com/weiqi/mis/impl/PushServiceImpl.java b/car-service/src/main/java/com/weiqi/mis/impl/PushServiceImpl.java new file mode 100644 index 0000000..75e0c20 --- /dev/null +++ b/car-service/src/main/java/com/weiqi/mis/impl/PushServiceImpl.java @@ -0,0 +1,264 @@ +package com.weiqi.mis.impl; + +import com.alibaba.fastjson.JSONObject; +import com.weiqi.mis.DateHelper; +import com.weiqi.mis.HttpUtil; +import com.weiqi.mis.PushService; +import com.weiqi.mis.bo.WxXrPemsOrderResult; +import com.weiqi.mis.domain.WxSgPolluteSds; +import com.weiqi.mis.domain.WxSgPolluteSdsExample; +import com.weiqi.mis.domain.WxXrPemsOrder; +import com.weiqi.mis.domain.WxXrPemsOrderPushLog; +import com.weiqi.mis.mapper.WxSgPolluteSdsMapper; +import com.weiqi.mis.mapper.WxXrPemsOrderMapper; +import com.weiqi.mis.mapper.WxXrPemsOrderPushLogMapper; +import lombok.extern.slf4j.Slf4j; +import lombok.val; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.*; + +@Service +@Slf4j +public class PushServiceImpl implements PushService { + @Autowired + private WxSgPolluteSdsMapper wxSgPolluteSdsMapper; + @Autowired + private WxXrPemsOrderMapper wxXrPemsOrderMapper; + @Autowired + private WxXrPemsOrderPushLogMapper wxXrPemsOrderPushLogMapper; + + + @Override + public JSONObject pushorder(int id) { + JSONObject jsret = new JSONObject(); + jsret.put("returncode", 0); + jsret.put("message", ""); + + try { + + WxXrPemsOrder wxXrPemsOrder = wxXrPemsOrderMapper.selectByPrimaryKey(id); + log.info("{}", wxXrPemsOrder); + //调用生成订单接口,返回订单编号 + JSONObject createorder = createorder(wxXrPemsOrder); + //{"extmessage":null,"message":"操作成功","result":{"brandimg":"https://api.mycar369.com/api/carimg/14.jpg","orderid":"2024101418552975925900036","sname":"思域","platenum":"京atest1"},"returncode":2000} + + if (createorder.getInteger("returncode") != 2000) { + jsret.put("returncode", -1); + jsret.put("message", "调用接口生成订单失败"); + return jsret; + } + String orderId = createorder.getJSONObject("result").getString("orderid"); + List wxSgPolluteSdsList = new ArrayList<>(); + + List wxXrPemsOrderItemResultList = new ArrayList<>(); + + //查询订单检测结果list + + WxSgPolluteSdsExample example1 = new WxSgPolluteSdsExample(); + WxSgPolluteSdsExample.Criteria ca = example1.createCriteria(); + ca.andWxOrderIdEqualTo(id); + wxSgPolluteSdsList = wxSgPolluteSdsMapper.selectByExample(example1); + + + JSONObject pollutesave = pollutesave(wxXrPemsOrder, wxSgPolluteSdsList, orderId); + if (pollutesave.getInteger("returncode") != 2000) { + jsret.put("returncode", -1); + jsret.put("message", "调用接口保存订单失败"); + return jsret; + } + + } catch (Exception e) { + log.error("pushorder is error:{}", e); + jsret.put("returncode", -1); + jsret.put("message", e.getMessage()); + + } + + return jsret; + } + + /** + * 【第一步】: + * https://api.mycar369.com/api/sg/createorder?mid=22&userid=36&vin=0000&platenum=%E4%BA%ACatest1&licensingtime=2022-10-14&mileage=10&drivinglicenseimgsrc=&carimgsrc=&modelid=135&brandid=14&linkname=lxr&phonenum=13126679999&engine_air_count=4&exhaustsystem=2&appid=LANBBXCXtest&os=xiaochengxu&version=1.1.2×tamp=1728900072&udid=000&noncestr=000&usid=36&_sign=77705A9803DCEBBD6006E07BF592882D + * 发动机缸数 + * engine_air_count:4 + * 排气系统类型 1,单排 2,双排 + * exhaustsystem: 1 or 2 + * 维修门店id + * mid:22 + * 操作用户id + * usid:36 对应数据库里的用户id + * userid:36 对应数据库里的用户id + * 车系品牌id + * modelid=135&brandid=14 + *

+ * 返回内容: + * {"extmessage":null,"message":"操作成功","result":{"brandimg":"https://api.mycar369.com/api/carimg/14.jpg","orderid":"2024101418552975925900036","sname":"思域","platenum":"京atest1"},"returncode":2000} + * returncode:2000 表示成功 + * + * @param wxXrPemsOrder + * @return + */ + public JSONObject createorder(WxXrPemsOrder wxXrPemsOrder) { + JSONObject js = new JSONObject(); + Map fields = new HashMap<>(); + String body = ""; + try { + fields.put("mid", wxXrPemsOrder.getMid()+""); + fields.put("userid", wxXrPemsOrder.getOrderuserid()+""); + fields.put("vin", wxXrPemsOrder.getVin()); + fields.put("platenum", wxXrPemsOrder.getPlatenumber()); + fields.put("licensingtime", DateHelper.serialize(wxXrPemsOrder.getAdmissiontime(), DateHelper.DATEFORMAT_ONLY_DATE)); + fields.put("mileage", wxXrPemsOrder.getKilometers().intValue()+""); + fields.put("drivinglicenseimgsrc", wxXrPemsOrder.getDrivinglicensesrc() == null ? "" : wxXrPemsOrder.getDrivinglicensesrc()); + fields.put("carimgsrc", wxXrPemsOrder.getVehiclesrc() == null ? "" : wxXrPemsOrder.getVehiclesrc()); + fields.put("modelid", wxXrPemsOrder.getSeriesid() == null ? "" : wxXrPemsOrder.getSeriesid()+""); + fields.put("brandid", wxXrPemsOrder.getBrandid() == null ? "" : wxXrPemsOrder.getBrandid()+""); + fields.put("linkname", wxXrPemsOrder.getLinkname() == null ? "" : wxXrPemsOrder.getLinkname()); + fields.put("phonenum", wxXrPemsOrder.getLinktel() == null ? "" : wxXrPemsOrder.getLinktel()); + fields.put("engine_air_count", wxXrPemsOrder.getEnginestructurenumber()+""); + // 排气系统类型 1,单排 2,双排 这个对应表中哪个字段,是排期构造? exhau + fields.put("exhaustsystem", "1"); + // fields.put("exhaustsystem", wxXrPemsOrder.getExhauststructure()); + fields.put("appid", "LANBBXCXtest"); + fields.put("os", "xiaochengxu"); + fields.put("version", "1.1.2"); + fields.put("timestamp", (System.currentTimeMillis() / 1000)+""); + fields.put("udid", "000"); + fields.put("noncestr", "000"); + fields.put("usid", wxXrPemsOrder.getOrderuserid()+""); + fields.put("_sign", "77705A9803DCEBBD6006E07BF592882D"); + + String url = "https://api.mycar369.com/api/sg/createorder?"; + body = HttpUtil.sendGetRequest(url, fields); + +// String url = "https://api.mycar369.com/api/sg/createorder?mid=22&userid=36&vin=0000&platenum=%E4%BA%ACatest1&licensingtime=2022-10-14&mileage=10&drivinglicenseimgsrc=&carimgsrc=&modelid=135&brandid=14&linkname=lxr&phonenum=13126679999&engine_air_count=4&exhaustsystem=2&appid=LANBBXCXtest&os=xiaochengxu&version=1.1.2×tamp=1728900072&udid=000&noncestr=000&usid=36&_sign=77705A9803DCEBBD6006E07BF592882D"; +// body = HttpUtil.sendGetRequest(url); + + js = JSONObject.parseObject(body); + + } catch (Exception e) { + log.error("createorder is error:{}", e); + js.put("returncode", -1); + js.put("message", "请求数据报错"); + } finally { + WxXrPemsOrderPushLog record = new WxXrPemsOrderPushLog(); + record.setOrderno(wxXrPemsOrder.getOrderno()); + record.setWeixiuorderno(""); + record.setRequestparam(fields.toString()); + record.setResponse(body.length() > 1000 ? body.substring(0, 1000) : body); + record.setStep(1); + + if (js.containsKey("returncode")) { + record.setStatus(js.getInteger("returncode")); + } else { + record.setStatus(-1); + } + wxXrPemsOrderPushLogMapper.insert(record); + } + + return js; + } + + /** + * 第二步】: + * https://api.mycar369.com/api/sg/pollutesave?ordernum=2024101418552975925900036&categroy=2&jystco=0&jysthc=0&jystnox=0&cohigh1=1&hchigh=2&lambdahigh1=3&colow1=0&hclow1=0&lambdalow1=0&appid=LANBB00M&os=android-11-M2011K2C&version=1.1.2×tamp=1728900609&udid=a97c068f-0ba3-3f3b-a25e-172087d538e2&noncestr=3PbaRn&usid=36&_sign=8F016C479C2D69561AE541A0A26C98C7 + *

+ * 第一步得到的订单id + * ordernum:2024101418552975925900036 + * 污染数据-高怠速 + * categroy=2 + * 污染数据 cohigh1=1&hchigh=2&lambdahigh1=3 其它污染数据填0 + * 污染数据-低怠速 + * categroy=3 + * 污染数据 colow1=20&hclow1=20&lambdalow1=20 其它污染数据填0 + * 返回内容: + * {"extmessage":null,"message":"操作成功","result":{"code":"0","message":"添加成功"},"returncode":2000} + * + * @param + * @return + */ + public JSONObject pollutesave(WxXrPemsOrder wxXrPemsOrder, List wxSgPolluteSdsList, String orderId) { + JSONObject js = new JSONObject(); + js.put("returncode",-1); + String body = ""; + Map fields = new HashMap<>(); + try { + for (WxSgPolluteSds wxSgPolluteSds : wxSgPolluteSdsList) { + String url = "https://api.mycar369.com/api/sg/pollutesave?"; + fields = new HashMap<>(); + fields.put("ordernum", orderId); + //高怠速 + if (wxSgPolluteSds.getCategory() == 2) { + fields.put("categroy", wxSgPolluteSds.getCategory()+""); + fields.put("cohigh1", wxSgPolluteSds.getCo()+""); + fields.put("hchigh", wxSgPolluteSds.getHc()+""); + fields.put("lambdahigh1", wxSgPolluteSds.getLambda()+""); + fields.put("lambdalow1", "0"); + fields.put("colow1", "0"); + fields.put("hclow1", "0"); + } else { + fields.put("categroy", "1"); + fields.put("colow1", wxSgPolluteSds.getCo()+""); + fields.put("hclow1", wxSgPolluteSds.getHc()+""); + fields.put("lambdalow1", wxSgPolluteSds.getLambda()+""); + fields.put("lambdahigh1", "0"); + fields.put("cohigh1", "0"); + fields.put("hchigh", "0"); + } + fields.put("jystco", "0"); + fields.put("jysthc", "0"); + fields.put("jystnox", "0"); + + fields.put("appid", "LANBBXCXtest"); + fields.put("os", "xiaochengxu"); + fields.put("version", "1.1.2"); + fields.put("timestamp", (System.currentTimeMillis()/1000)+""); + fields.put("udid", "000"); + fields.put("noncestr", "000"); + fields.put("usid", wxXrPemsOrder.getOrderuserid()+""); + fields.put("_sign", "77705A9803DCEBBD6006E07BF592882D"); + body= HttpUtil.sendGetRequest(url, fields); + + try{ + js = JSONObject.parseObject(body); + }catch (Exception e){ + log.error("返回结果非json body={}",body); + } + + WxXrPemsOrderPushLog record = new WxXrPemsOrderPushLog(); + record.setOrderno(wxXrPemsOrder.getOrderno()); + record.setWeixiuorderno(""); + record.setRequestparam(fields.toString()); + record.setResponse(body.length() > 1000 ? body.substring(1, 1000) : body); + record.setStep(2); + savelog(record, js); + + } + } catch (Exception e) { + log.error("pollutesave is error:{}", e); + js.put("returncode", -1); + js.put("message", "请求数据报错"); + } + return js; + } + + public void savelog(WxXrPemsOrderPushLog record, JSONObject js) { + try { + if (js.containsKey("returncode")) { + record.setStatus(js.getInteger("returncode")); + } else { + record.setStatus(-1); + } + record.setCreateTime(new Date()); + record.setUpdateTime(new Date()); + wxXrPemsOrderPushLogMapper.insert(record); + } catch (Exception e) { + log.error("insert log error:{}", e); + } + } + +} + diff --git a/car-service/src/main/java/com/weiqi/mis/redis/RedisListenerConfig.java b/car-service/src/main/java/com/weiqi/mis/redis/RedisListenerConfig.java index aa25f60..329bf9b 100644 --- a/car-service/src/main/java/com/weiqi/mis/redis/RedisListenerConfig.java +++ b/car-service/src/main/java/com/weiqi/mis/redis/RedisListenerConfig.java @@ -1,105 +1,105 @@ -package com.weiqi.mis.redis; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.data.redis.connection.RedisConnectionFactory; -import org.springframework.data.redis.core.RedisTemplate; -import org.springframework.data.redis.core.StringRedisTemplate; -import org.springframework.data.redis.listener.PatternTopic; -import org.springframework.data.redis.listener.RedisMessageListenerContainer; -import org.springframework.data.redis.listener.adapter.MessageListenerAdapter; -import org.springframework.data.redis.serializer.GenericToStringSerializer; -import org.springframework.data.redis.serializer.StringRedisSerializer; - -@Configuration -public class RedisListenerConfig { - - public static final String sms_redisqueue_channel = "sms_redisqueue"; - public static final String sms_redisqueue_total_channel = "sms_redisqueue_total"; - public static final String sms_redis_kg_channel = "sms_redi_kg_channel"; - public static final String sms_redis_wg_channel = "sms_redi_wg_channel"; - public static final String sms_redis_headbeat = "headbeat"; - - /** - * redis消息监听器容器 可以添加多个监听不同话题的redis监听器,只需要把消息监听器和相应的消息订阅处理器绑定,该消息监听器 通过反射技术调用消息订阅处理器的相关方法进行一些业务处理 - * - * @param connectionFactory - * @param listenerAdapter - * @return - */ - @Bean - RedisMessageListenerContainer container(RedisConnectionFactory connectionFactory, - MessageListenerAdapter listenerAdapter, MessageListenerAdapter listenerAdapter2, - MessageListenerAdapter listenerAdapterkg,MessageListenerAdapter listenerAdapterwg,MessageListenerAdapter listenerAdapterhb) { - RedisMessageListenerContainer container = new RedisMessageListenerContainer(); - container.setConnectionFactory(connectionFactory); - - // 可以添加多个 messageListener - container.addMessageListener(listenerAdapter, new PatternTopic(sms_redisqueue_channel)); - container.addMessageListener(listenerAdapter2, new PatternTopic(sms_redisqueue_total_channel)); - container.addMessageListener(listenerAdapterkg, new PatternTopic(sms_redis_kg_channel)); - container.addMessageListener(listenerAdapterwg, new PatternTopic(sms_redis_wg_channel)); - container.addMessageListener(listenerAdapterhb, new PatternTopic(sms_redis_headbeat)); - - return container; - } - - /** - * 消息监听器适配器,绑定消息处理器,利用反射技术调用消息处理器的业务方法 - * - * @param redisReceiver - * @return - */ - @Bean - MessageListenerAdapter listenerAdapter(RedisReceiver redisReceiver) { - - return new MessageListenerAdapter(redisReceiver, "receiveMessage"); - } - - /** - * 消息监听器适配器,绑定消息处理器,利用反射技术调用消息处理器的业务方法 - * - * @param redisReceiver - * @return - */ - @Bean - MessageListenerAdapter listenerAdapter2(RedisReceiver redisReceiver) { - - return new MessageListenerAdapter(redisReceiver, "receiveMessage2"); - } - - /** - * 消息监听器适配器,绑定消息处理器,利用反射技术调用消息处理器的业务方法 - * - * @param redisReceiver - * @return - */ - @Bean - MessageListenerAdapter listenerAdapterkg(RedisReceiver redisReceiver) { - - return new MessageListenerAdapter(redisReceiver, "receiveMessage3"); - } - - /** - * 消息监听器适配器,绑定消息处理器,利用反射技术调用消息处理器的业务方法 - * - * @param redisReceiver - * @return - */ - @Bean - MessageListenerAdapter listenerAdapterwg(RedisReceiver redisReceiver) { - - return new MessageListenerAdapter(redisReceiver, "receiveMessage4"); - } - @Bean - MessageListenerAdapter listenerAdapterhb(RedisReceiver redisReceiver) { - - return new MessageListenerAdapter(redisReceiver, "receiveMessage5"); - } - - // 使用默认的工厂初始化redis操作模板 - @Bean - StringRedisTemplate template(RedisConnectionFactory connectionFactory) { - return new StringRedisTemplate(connectionFactory); - } -} \ No newline at end of file +//package com.weiqi.mis.redis; +// +//import org.springframework.context.annotation.Bean; +//import org.springframework.context.annotation.Configuration; +//import org.springframework.data.redis.connection.RedisConnectionFactory; +//import org.springframework.data.redis.core.RedisTemplate; +//import org.springframework.data.redis.core.StringRedisTemplate; +//import org.springframework.data.redis.listener.PatternTopic; +//import org.springframework.data.redis.listener.RedisMessageListenerContainer; +//import org.springframework.data.redis.listener.adapter.MessageListenerAdapter; +//import org.springframework.data.redis.serializer.GenericToStringSerializer; +//import org.springframework.data.redis.serializer.StringRedisSerializer; +// +//@Configuration +//public class RedisListenerConfig { +// +// public static final String sms_redisqueue_channel = "sms_redisqueue"; +// public static final String sms_redisqueue_total_channel = "sms_redisqueue_total"; +// public static final String sms_redis_kg_channel = "sms_redi_kg_channel"; +// public static final String sms_redis_wg_channel = "sms_redi_wg_channel"; +// public static final String sms_redis_headbeat = "headbeat"; +// +// /** +// * redis消息监听器容器 可以添加多个监听不同话题的redis监听器,只需要把消息监听器和相应的消息订阅处理器绑定,该消息监听器 通过反射技术调用消息订阅处理器的相关方法进行一些业务处理 +// * +// * @param connectionFactory +// * @param listenerAdapter +// * @return +// */ +// @Bean +// RedisMessageListenerContainer container(RedisConnectionFactory connectionFactory, +// MessageListenerAdapter listenerAdapter, MessageListenerAdapter listenerAdapter2, +// MessageListenerAdapter listenerAdapterkg,MessageListenerAdapter listenerAdapterwg,MessageListenerAdapter listenerAdapterhb) { +// RedisMessageListenerContainer container = new RedisMessageListenerContainer(); +// container.setConnectionFactory(connectionFactory); +// +// // 可以添加多个 messageListener +// container.addMessageListener(listenerAdapter, new PatternTopic(sms_redisqueue_channel)); +// container.addMessageListener(listenerAdapter2, new PatternTopic(sms_redisqueue_total_channel)); +// container.addMessageListener(listenerAdapterkg, new PatternTopic(sms_redis_kg_channel)); +// container.addMessageListener(listenerAdapterwg, new PatternTopic(sms_redis_wg_channel)); +// container.addMessageListener(listenerAdapterhb, new PatternTopic(sms_redis_headbeat)); +// +// return container; +// } +// +// /** +// * 消息监听器适配器,绑定消息处理器,利用反射技术调用消息处理器的业务方法 +// * +// * @param redisReceiver +// * @return +// */ +// @Bean +// MessageListenerAdapter listenerAdapter(RedisReceiver redisReceiver) { +// +// return new MessageListenerAdapter(redisReceiver, "receiveMessage"); +// } +// +// /** +// * 消息监听器适配器,绑定消息处理器,利用反射技术调用消息处理器的业务方法 +// * +// * @param redisReceiver +// * @return +// */ +// @Bean +// MessageListenerAdapter listenerAdapter2(RedisReceiver redisReceiver) { +// +// return new MessageListenerAdapter(redisReceiver, "receiveMessage2"); +// } +// +// /** +// * 消息监听器适配器,绑定消息处理器,利用反射技术调用消息处理器的业务方法 +// * +// * @param redisReceiver +// * @return +// */ +// @Bean +// MessageListenerAdapter listenerAdapterkg(RedisReceiver redisReceiver) { +// +// return new MessageListenerAdapter(redisReceiver, "receiveMessage3"); +// } +// +// /** +// * 消息监听器适配器,绑定消息处理器,利用反射技术调用消息处理器的业务方法 +// * +// * @param redisReceiver +// * @return +// */ +// @Bean +// MessageListenerAdapter listenerAdapterwg(RedisReceiver redisReceiver) { +// +// return new MessageListenerAdapter(redisReceiver, "receiveMessage4"); +// } +// @Bean +// MessageListenerAdapter listenerAdapterhb(RedisReceiver redisReceiver) { +// +// return new MessageListenerAdapter(redisReceiver, "receiveMessage5"); +// } +// +// // 使用默认的工厂初始化redis操作模板 +// @Bean +// StringRedisTemplate template(RedisConnectionFactory connectionFactory) { +// return new StringRedisTemplate(connectionFactory); +// } +//} \ No newline at end of file diff --git a/car-service/src/main/java/com/weiqi/mis/redis/RedisReceiver.java b/car-service/src/main/java/com/weiqi/mis/redis/RedisReceiver.java index 1caef6e..646baa9 100644 --- a/car-service/src/main/java/com/weiqi/mis/redis/RedisReceiver.java +++ b/car-service/src/main/java/com/weiqi/mis/redis/RedisReceiver.java @@ -1,86 +1,86 @@ -package com.weiqi.mis.redis; - -import java.util.List; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Service; - -import com.weiqi.mis.Z; -import com.weiqi.util.SmsTools; -import com.weiqi.vo.SmsGlobalIndex; -import com.fasterxml.jackson.core.type.TypeReference; - -@Service -public class RedisReceiver { - private static final Logger log = LoggerFactory.getLogger(RedisReceiver.class); - - public void receiveMessage(String message) { - - try { - - List jsonObj = Z.fromJSON(new TypeReference>() {}, message); - SmsTools.sv = jsonObj; - - log.info("SmsTools.sv 消息条数为:{},info={}", SmsTools.sv.size(), SmsTools.sv); - } catch (Exception e) { - e.printStackTrace(); - log.error("消息来了:{}", e); - } - - } - - /** 接收消息的方法 */ - public void receiveMessage2(String message) { - - try { - SmsTools.sendTotalNum = Integer.parseInt(message); - } catch (NumberFormatException e) { - e.printStackTrace(); - log.error("消息来了2:{}", e); - } - log.info("SmsTools.sendTotalNum ={}", SmsTools.sendTotalNum); - - } - - /** 接收消息的方法 */ - public void receiveMessage3(String message) { - - try { - SmsTools.isRedisStatistic = message.equalsIgnoreCase("1") ? true : false; - - log.info("消息来了3:{}", SmsTools.isRedisStatistic); - } catch (NumberFormatException e) { - e.printStackTrace(); - log.error("消息来了3:{}", e); - } - log.info("SmsTools.sendTotalNum ={}", SmsTools.sendTotalNum); - - } - - /** 接收消息的方法 */ - public void receiveMessage4(String message) { - - try { - SmsTools.isRedisStatisticUP = message.equalsIgnoreCase("1") ? true : false; - - log.info("消息来了4:{}", SmsTools.isRedisStatisticUP); - } catch (NumberFormatException e) { - e.printStackTrace(); - log.error("消息来了4:{}", e); - } - log.info("SmsTools.sendTotalNum ={}", SmsTools.sendTotalNum); - - } - /** 心跳 */ - public void receiveMessage5(String message) { - - try { - log.info("心跳消息来了5:{}",message); - } catch (NumberFormatException e) { - e.printStackTrace(); - log.error("心跳消息来了5:{}", e); - } - - } -} \ No newline at end of file +//package com.weiqi.mis.redis; +// +//import java.util.List; +// +//import org.slf4j.Logger; +//import org.slf4j.LoggerFactory; +//import org.springframework.stereotype.Service; +// +//import com.weiqi.mis.Z; +//import com.weiqi.util.SmsTools; +//import com.weiqi.vo.SmsGlobalIndex; +//import com.fasterxml.jackson.core.type.TypeReference; +// +//@Service +//public class RedisReceiver { +// private static final Logger log = LoggerFactory.getLogger(RedisReceiver.class); +// +// public void receiveMessage(String message) { +// +// try { +// +// List jsonObj = Z.fromJSON(new TypeReference>() {}, message); +// SmsTools.sv = jsonObj; +// +// log.info("SmsTools.sv 消息条数为:{},info={}", SmsTools.sv.size(), SmsTools.sv); +// } catch (Exception e) { +// e.printStackTrace(); +// log.error("消息来了:{}", e); +// } +// +// } +// +// /** 接收消息的方法 */ +// public void receiveMessage2(String message) { +// +// try { +// SmsTools.sendTotalNum = Integer.parseInt(message); +// } catch (NumberFormatException e) { +// e.printStackTrace(); +// log.error("消息来了2:{}", e); +// } +// log.info("SmsTools.sendTotalNum ={}", SmsTools.sendTotalNum); +// +// } +// +// /** 接收消息的方法 */ +// public void receiveMessage3(String message) { +// +// try { +// SmsTools.isRedisStatistic = message.equalsIgnoreCase("1") ? true : false; +// +// log.info("消息来了3:{}", SmsTools.isRedisStatistic); +// } catch (NumberFormatException e) { +// e.printStackTrace(); +// log.error("消息来了3:{}", e); +// } +// log.info("SmsTools.sendTotalNum ={}", SmsTools.sendTotalNum); +// +// } +// +// /** 接收消息的方法 */ +// public void receiveMessage4(String message) { +// +// try { +// SmsTools.isRedisStatisticUP = message.equalsIgnoreCase("1") ? true : false; +// +// log.info("消息来了4:{}", SmsTools.isRedisStatisticUP); +// } catch (NumberFormatException e) { +// e.printStackTrace(); +// log.error("消息来了4:{}", e); +// } +// log.info("SmsTools.sendTotalNum ={}", SmsTools.sendTotalNum); +// +// } +// /** 心跳 */ +// public void receiveMessage5(String message) { +// +// try { +// log.info("心跳消息来了5:{}",message); +// } catch (NumberFormatException e) { +// e.printStackTrace(); +// log.error("心跳消息来了5:{}", e); +// } +// +// } +//} \ No newline at end of file