Commit 6ca54bf1 authored by wangjinjing's avatar wangjinjing

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	pom.xml
#	src/main/java/com/cx/cn/cxquartz/controller/ExtController.java
#	src/main/java/com/cx/cn/cxquartz/job/WebSocket.java
#	src/main/resources/file.properties
parents 793e5ae2 09b7207b
...@@ -2,6 +2,7 @@ package com.cx.cn.cxquartz; ...@@ -2,6 +2,7 @@ package com.cx.cn.cxquartz;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
......
package com.cx.cn.cxquartz.config;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.PropertyAccessor;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.cache.annotation.CachingConfigurerSupport;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.connection.jedis.JedisConnectionFactory;
import org.springframework.data.redis.core.*;
import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
import org.springframework.data.redis.serializer.StringRedisSerializer;
// @Configuration
@EnableCaching //开启注解
public class RedisConfig extends CachingConfigurerSupport {
/**
* retemplate相关配置
*
* @param factory
* @return
*/
@Bean
public RedisTemplate<String, Object> redisTemplate(RedisConnectionFactory factory) {
RedisTemplate<String, Object> template = new RedisTemplate<>();
// 配置连接工厂
template.setConnectionFactory(factory);
//使用Jackson2JsonRedisSerializer来序列化和反序列化redis的value值(默认使用JDK的序列化方式)
Jackson2JsonRedisSerializer jacksonSeial = new Jackson2JsonRedisSerializer(Object.class);
ObjectMapper om = new ObjectMapper();
// 指定要序列化的域,field,get和set,以及修饰符范围,ANY是都有包括private和public
om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY);
// 指定序列化输入的类型,类必须是非final修饰的,final修饰的类,比如String,Integer等会跑出异常
om.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL);
jacksonSeial.setObjectMapper(om);
// 值采用json序列化
template.setValueSerializer(jacksonSeial);
//使用StringRedisSerializer来序列化和反序列化redis的key值
template.setKeySerializer(new StringRedisSerializer());
// 设置hash key 和value序列化模式
template.setHashKeySerializer(new StringRedisSerializer());
template.setHashValueSerializer(jacksonSeial);
template.afterPropertiesSet();
return template;
}
/**
* 对hash类型的数据操作
*
* @param redisTemplate
* @return
*/
@Bean
public HashOperations<String, String, Object> hashOperations(RedisTemplate<String, Object> redisTemplate) {
return redisTemplate.opsForHash();
}
/**
* 对redis字符串类型数据操作
*
* @param redisTemplate
* @return
*/
@Bean
public ValueOperations<String, Object> valueOperations(RedisTemplate<String, Object> redisTemplate) {
return redisTemplate.opsForValue();
}
@Bean
public JedisConnectionFactory redisConnectionFactory() {
JedisConnectionFactory jedisConnectionFactory = new JedisConnectionFactory();
jedisConnectionFactory.setHostName("<server-hostname-here>");
jedisConnectionFactory.setPort(6379);
jedisConnectionFactory.setPassword("<server-password-here>");
jedisConnectionFactory.afterPropertiesSet();
return jedisConnectionFactory;
}
/**
* 对链表类型的数据操作
*
* @param redisTemplate
* @return
*/
@Bean
public ListOperations<String, Object> listOperations(RedisTemplate<String, Object> redisTemplate) {
return redisTemplate.opsForList();
}
/**
* 对无序集合类型的数据操作
*
* @param redisTemplate
* @return
*/
@Bean
public SetOperations<String, Object> setOperations(RedisTemplate<String, Object> redisTemplate) {
return redisTemplate.opsForSet();
}
/**
* 对有序集合类型的数据操作
*
* @param redisTemplate
* @return
*/
@Bean
public ZSetOperations<String, Object> zSetOperations(RedisTemplate<String, Object> redisTemplate) {
return redisTemplate.opsForZSet();
}
}
package com.cx.cn.cxquartz.config;
import com.cx.cn.cxquartz.job.WebSocket;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.socket.server.standard.ServerEndpointExporter;
@Configuration
public class WebSocketConfig {
/**
* ServerEndpointExporter 作用
*
* 这个Bean会自动注册使用@ServerEndpoint注解声明的websocket endpoint
*
* @return
*/
@Bean
public ServerEndpointExporter serverEndpointExporter() {
return new ServerEndpointExporter();
}
}
\ No newline at end of file
...@@ -51,6 +51,11 @@ public class DateUtils { ...@@ -51,6 +51,11 @@ public class DateUtils {
return new DateTime(date).toString(YMD_HMS); return new DateTime(date).toString(YMD_HMS);
} }
public static String formatDateTime(DateTime date){
return date.toString(YMD_HMS);
}
public static String formatDateToNoSign(Date date){ public static String formatDateToNoSign(Date date){
return new DateTime(date).toString(YMDHMS); return new DateTime(date).toString(YMDHMS);
} }
...@@ -62,7 +67,10 @@ public class DateUtils { ...@@ -62,7 +67,10 @@ public class DateUtils {
private static String formatCurrDateByType(DateTimeFormatter dateTimeFormatter){ private static String formatCurrDateByType(DateTimeFormatter dateTimeFormatter){
return DateTime.now().toString(dateTimeFormatter); return DateTime.now().toString(dateTimeFormatter);
} }
public static DateTime getNowDate(){
return DateTime.now();
}
public static Date addMinutes(Date date, int minutes) { public static Date addMinutes(Date date, int minutes) {
return new DateTime(date).plusMinutes(minutes).toDate(); return new DateTime(date).plusMinutes(minutes).toDate();
} }
......
...@@ -147,7 +147,7 @@ public class FileTransferManager { ...@@ -147,7 +147,7 @@ public class FileTransferManager {
GoalStructureParam param = new GoalStructureParam(); GoalStructureParam param = new GoalStructureParam();
param.setOutput(new Output(1, 1, -1, 3)); param.setOutput(new Output(1, 1, -1, 3));
param.setModel(model); param.setModel(model);
param.setApiout("1");////打开1400标准输出,默认可以不填 param.setApiout("0");////打开1400标准输出,默认可以不填
List<ImageList> list = new ArrayList<>(); List<ImageList> list = new ArrayList<>();
getImageList("1",roiarray, base64Encoder, list, transferRecord.getImg1path()); getImageList("1",roiarray, base64Encoder, list, transferRecord.getImg1path());
getImageList("2", roiarray,base64Encoder, list, transferRecord.getImg2path()); getImageList("2", roiarray,base64Encoder, list, transferRecord.getImg2path());
......
...@@ -2,6 +2,7 @@ package com.cx.cn.cxquartz.vo; ...@@ -2,6 +2,7 @@ package com.cx.cn.cxquartz.vo;
import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnore;
import org.joda.time.DateTime;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
...@@ -17,7 +18,6 @@ import java.util.Date; ...@@ -17,7 +18,6 @@ import java.util.Date;
public class TraffpictureParam extends Traffpicture { public class TraffpictureParam extends Traffpicture {
private static final long serialVersionUID=1L; private static final long serialVersionUID=1L;
@JsonIgnore @JsonIgnore
private Long recordid; private Long recordid;
@JsonIgnore @JsonIgnore
...@@ -37,7 +37,7 @@ public class TraffpictureParam extends Traffpicture { ...@@ -37,7 +37,7 @@ public class TraffpictureParam extends Traffpicture {
@JsonIgnore @JsonIgnore
private String creator; private String creator;
@JsonIgnore @JsonIgnore
private Date createtime; private DateTime createtime;
@JsonIgnore @JsonIgnore
private String updator; private String updator;
@JsonIgnore @JsonIgnore
...@@ -156,11 +156,11 @@ public class TraffpictureParam extends Traffpicture { ...@@ -156,11 +156,11 @@ public class TraffpictureParam extends Traffpicture {
this.creator = creator; this.creator = creator;
} }
public Date getCreatetime() { public DateTime getCreatetime() {
return createtime; return createtime;
} }
public void setCreatetime(Date createtime) { public void setCreatetime(DateTime createtime) {
this.createtime = createtime; this.createtime = createtime;
} }
......
...@@ -2,13 +2,6 @@ ...@@ -2,13 +2,6 @@
* Copyright 2021 json.cn * Copyright 2021 json.cn
*/ */
package com.cx.cn.cxquartz.vo; package com.cx.cn.cxquartz.vo;
/**
* Auto-generated: 2021-04-28 19:16:46
*
* @author json.cn (i@json.cn)
* @website http://www.json.cn/java2pojo/
*/
public class UpperBoundingBox { public class UpperBoundingBox {
private int x; private int x;
......
...@@ -37,8 +37,18 @@ spring: ...@@ -37,8 +37,18 @@ spring:
cache: false cache: false
enabled: true enabled: true
encoding: UTF-8 encoding: UTF-8
mode: HTML mode : HTML
redis:
host: 172.16.24.153
port: 6379
timeout: 300
# password:
pool:
minIdle: 1
maxIdle: 10
maxWait : -1
maxActive: 8
#logging: #logging:
# level: # level:
# root: # root:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment