版本迭代
This commit is contained in:
parent
900343db26
commit
e3d52ffd3c
|
@ -10,6 +10,8 @@ import com.bootdo.datasend.dianxin.service.BaseHighThrowRecordService;
|
||||||
import com.bootdo.util.Base64Util;
|
import com.bootdo.util.Base64Util;
|
||||||
import com.bootdo.util.StringKit;
|
import com.bootdo.util.StringKit;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
||||||
import org.springframework.scheduling.annotation.Scheduled;
|
import org.springframework.scheduling.annotation.Scheduled;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
@ -20,6 +22,7 @@ import java.util.List;
|
||||||
@Component
|
@Component
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class StandardTask {
|
public class StandardTask {
|
||||||
|
private static final Logger logger = LoggerFactory.getLogger(StandardTask.class);
|
||||||
|
|
||||||
private final RabbitTemplate rabbitTemplate;
|
private final RabbitTemplate rabbitTemplate;
|
||||||
private final BaseHighThrowRecordService highThrowRecordService;
|
private final BaseHighThrowRecordService highThrowRecordService;
|
||||||
|
@ -32,10 +35,10 @@ public class StandardTask {
|
||||||
|
|
||||||
//获取高抛记录
|
//获取高抛记录
|
||||||
List<BaseHighThrowRecord> highThrowRecords = highThrowRecordService.list(new QueryWrapper<BaseHighThrowRecord>()
|
List<BaseHighThrowRecord> highThrowRecords = highThrowRecordService.list(new QueryWrapper<BaseHighThrowRecord>()
|
||||||
.eq("is_send","0")
|
.eq("is_send", "0")
|
||||||
);
|
);
|
||||||
|
|
||||||
for (BaseHighThrowRecord h:highThrowRecords){
|
for (BaseHighThrowRecord h : highThrowRecords) {
|
||||||
|
|
||||||
HighThrowDto dto = new HighThrowDto();
|
HighThrowDto dto = new HighThrowDto();
|
||||||
|
|
||||||
|
@ -56,18 +59,19 @@ public class StandardTask {
|
||||||
dto.setRequestData(dataDTO);
|
dto.setRequestData(dataDTO);
|
||||||
|
|
||||||
//循环发送mq
|
//循环发送mq
|
||||||
boolean b=sendHighThrowMq(dto);
|
boolean b = sendHighThrowMq(dto);
|
||||||
if(b){
|
if (b) {
|
||||||
h.setIsSend(1);
|
h.setIsSend(1);
|
||||||
highThrowRecordService.saveOrUpdate(h);
|
highThrowRecordService.saveOrUpdate(h);
|
||||||
|
logger.info("高抛记录发送成功:" + h.getId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean sendHighThrowMq(HighThrowDto bean) {
|
public boolean sendHighThrowMq(HighThrowDto bean) {
|
||||||
try {
|
try {
|
||||||
rabbitTemplate.convertAndSend("warnrecord", "routing.key.warnrecord", JSON.toJSONString( bean));
|
rabbitTemplate.convertAndSend("warnrecord", "routing.key.warnrecord", JSON.toJSONString(bean));
|
||||||
}catch (Exception e){
|
} catch (Exception e) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -3,7 +3,8 @@ spring:
|
||||||
type: com.alibaba.druid.pool.DruidDataSource
|
type: com.alibaba.druid.pool.DruidDataSource
|
||||||
username: root
|
username: root
|
||||||
password: '1qaz!QAZ'
|
password: '1qaz!QAZ'
|
||||||
url: jdbc:mysql://221.229.107.118:30519/multidimensional_box?useUnicode=true&characterEncoding=utf8&useSSL=false&allowMultiQueries=true&serverTimezone=GMT
|
# url: jdbc:mysql://221.229.107.118:30519/multidimensional_box?useUnicode=true&characterEncoding=utf8&useSSL=false&allowMultiQueries=true&serverTimezone=GMT
|
||||||
|
url: jdbc:mysql://127.0.0.1:30519/multidimensional_box?useUnicode=true&characterEncoding=utf8&useSSL=false&allowMultiQueries=true&serverTimezone=GMT
|
||||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
initialSize: 5 # 配置初始化大小、最小、最大
|
initialSize: 5 # 配置初始化大小、最小、最大
|
||||||
minIdle: 5
|
minIdle: 5
|
||||||
|
|
Loading…
Reference in New Issue