Commit b5cff5a5 authored by KeYong's avatar KeYong

更新

parent aea6e9f5
...@@ -31,6 +31,7 @@ import org.springframework.beans.BeanUtils; ...@@ -31,6 +31,7 @@ import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.support.TransactionSynchronization; import org.springframework.transaction.support.TransactionSynchronization;
import org.springframework.transaction.support.TransactionSynchronizationManager; import org.springframework.transaction.support.TransactionSynchronizationManager;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
...@@ -131,6 +132,7 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ ...@@ -131,6 +132,7 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ
} }
@Override @Override
@Transactional(rollbackFor = Exception.class)
public void confirmAlam(EquipmentSpecificAlarmLog ent, String appKey, String product, String token, String userId) { public void confirmAlam(EquipmentSpecificAlarmLog ent, String appKey, String product, String token, String userId) {
try { try {
AgencyUserModel userModel = remoteSecurityService.getAgencyUser(); AgencyUserModel userModel = remoteSecurityService.getAgencyUser();
...@@ -184,14 +186,14 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ ...@@ -184,14 +186,14 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ
} }
//数字换流站使用 //数字换流站使用
mqttSendGateway.sendToMqtt(TopicEnum.EQZXDT.getTopic(), ""); mqttSendGateway.sendToMqtt(TopicEnum.EQZXDT.getTopic(), "");
// TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronization() { TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronization() {
// @Override @Override
// public void afterCommit() { public void afterCommit() {
// JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
// jsonObject.put("seqNo", UUID.randomUUID().toString().replace("-", "").toLowerCase()); jsonObject.put("seqNo", UUID.randomUUID().toString().replace("-", "").toLowerCase());
// mqttSendGateway.sendToMqtt(TopicEnum.ALARM_LOG_INSERT.getTopic(), jsonObject.toString()); mqttSendGateway.sendToMqtt(TopicEnum.ALARM_LOG_INSERT.getTopic(), jsonObject.toString());
// } }
// }); });
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
throw new BadRequest("确认失败"); throw new BadRequest("确认失败");
......
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