云前置改造-暂态数据补召功能
This commit is contained in:
@@ -38,7 +38,6 @@ import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@@ -328,7 +327,12 @@ public class CsDeviceServiceImpl implements ICsDeviceService {
|
||||
param.setNDid(nDid);
|
||||
param.setStatus(1);
|
||||
param.setRunStatus(1);
|
||||
boolean isConnectDev = DicDataEnum.CONNECT_DEV.getCode().equals(dictTreeFeignClient.queryById(csEquipmentDeliveryVO.getDevType()).getData().getCode());
|
||||
if (isConnectDev) {
|
||||
param.setProcess(2);
|
||||
} else {
|
||||
param.setProcess(4);
|
||||
}
|
||||
csEquipmentDeliveryService.devResetFactory(param);
|
||||
//清除关系表
|
||||
QueryWrapper<CsLedger> csLedgerQueryWrapper = new QueryWrapper<>();
|
||||
@@ -374,12 +378,6 @@ public class CsDeviceServiceImpl implements ICsDeviceService {
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public String wlDevRegister(String nDid) {
|
||||
String result = "fail";
|
||||
// 设备状态判断
|
||||
checkDeviceStatus(nDid);
|
||||
// 询问设备支持的主题信息,并将支持的主题入库
|
||||
askAndStoreTopics(nDid);
|
||||
// MQTT询问装置用的模板,并判断库中是否存在模板
|
||||
checkDeviceModel(nDid);
|
||||
// 根据模板接入设备
|
||||
DeviceLogDTO logDto = new DeviceLogDTO();
|
||||
logDto.setUserName(RequestUtil.getUserNickname());
|
||||
@@ -387,6 +385,14 @@ public class CsDeviceServiceImpl implements ICsDeviceService {
|
||||
logDto.setOperate("便携式设备"+nDid+"注册、接入");
|
||||
logDto.setResult(1);
|
||||
try {
|
||||
Thread.sleep(5000);
|
||||
resetFactory(nDid);
|
||||
// 设备状态判断
|
||||
checkDeviceStatus(nDid);
|
||||
// 询问设备支持的主题信息,并将支持的主题入库
|
||||
askAndStoreTopics(nDid);
|
||||
// MQTT询问装置用的模板,并判断库中是否存在模板
|
||||
checkDeviceModel(nDid);
|
||||
Thread.sleep(2000);
|
||||
//获取版本
|
||||
String version = csTopicService.getVersion(nDid);
|
||||
|
||||
@@ -11,10 +11,10 @@ import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -33,12 +33,19 @@ public class CsEventServiceImpl extends ServiceImpl<CsEventMapper, CsEventPO> im
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public List<String> updateCsEvent(CsEventParam csEventParam) {
|
||||
List<String> eventList = new ArrayList<>();
|
||||
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSSSSS");
|
||||
LocalDateTime dateTime = LocalDateTime.parse(csEventParam.getStartTime(), formatter);
|
||||
// 减去1毫秒
|
||||
LocalDateTime newDateTime = dateTime.minusNanos(1000000);
|
||||
String startTime = newDateTime.format(formatter);
|
||||
|
||||
//1.将波形文件关联事件
|
||||
LambdaUpdateWrapper<CsEventPO> lambdaUpdateWrapper = new LambdaUpdateWrapper<>();
|
||||
lambdaUpdateWrapper.set(CsEventPO::getWavePath,csEventParam.getPath()).eq(CsEventPO::getLineId,csEventParam.getLineId())
|
||||
.eq(CsEventPO::getDeviceId,csEventParam.getDeviceId())
|
||||
.in(CsEventPO::getType, Arrays.asList(0,1))
|
||||
.between(CsEventPO::getStartTime,csEventParam.getStartTime(),csEventParam.getEndTime());
|
||||
.between(CsEventPO::getStartTime,startTime,csEventParam.getEndTime());
|
||||
if (Objects.nonNull(csEventParam.getLocation())) {
|
||||
lambdaUpdateWrapper.eq(CsEventPO::getLocation, csEventParam.getLocation());
|
||||
}
|
||||
|
||||
@@ -16,7 +16,6 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
|
||||
import org.apache.rocketmq.spring.core.RocketMQListener;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
@@ -33,6 +32,7 @@ import java.util.Objects;
|
||||
@RocketMQMessageListener(
|
||||
topic = BusinessTopic.REPLY_TOPIC,
|
||||
consumerGroup = BusinessTopic.REPLY_TOPIC,
|
||||
selectorExpression = "Test_Tag",
|
||||
consumeThreadNumber = 10,
|
||||
enableMsgTrace = true
|
||||
)
|
||||
@@ -47,7 +47,6 @@ public class UpdateLedgerConsumer extends EnhanceConsumerMessageHandler<UpdateLe
|
||||
private CsTerminalReplyFeignClient csTerminalReplyFeignClient;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void handleMessage(UpdateLedgerMessage updateLedgerMessage) {
|
||||
log.info("分发至更新台账响应处理程序");
|
||||
//收到消息修改(cs_terminal_reply)
|
||||
|
||||
Reference in New Issue
Block a user