Commit e255d280 authored by 田涛's avatar 田涛

数字预案绑定资源删除信息同步

parent 640a10a8
package com.yeejoin.amos.fas.business.service.impl;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.component.rule.config.ClazzUtils;
import com.yeejoin.amos.fas.business.dao.mapper.*;
......@@ -19,9 +18,7 @@ import com.yeejoin.amos.fas.exception.YeeException;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.eclipse.paho.client.mqttv3.IMqttMessageListener;
import org.eclipse.paho.client.mqttv3.MqttException;
import org.eclipse.paho.client.mqttv3.MqttMessage;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
......@@ -403,7 +400,7 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
} catch (MqttException e) {
logger.fatal("订阅规则删除同步消息失败,资源删除或取消无法同步", e);
}
try {
/*try {
emqKeeper.getMqttClient().subscribe(DELETE_SYNC_PLAN_EQUIP, (s, mqttMessage) -> {
System.out.println(s);
byte[] payload = mqttMessage.getPayload();
......@@ -418,6 +415,7 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
});
} catch (MqttException e) {
logger.fatal("订阅保护对象删除同步消息失败,资源删除或取消无法同步", e);
}
}*/
}
}
\ No newline at end of file
......@@ -2,10 +2,7 @@ package com.yeejoin.amos.fas.business.service.impl;
import com.yeejoin.amos.fas.business.constants.FasConstant;
import com.yeejoin.amos.fas.business.dao.mapper.EquipmentSpecificMapper;
import com.yeejoin.amos.fas.business.dao.mapper.FireEquipMapper;
import com.yeejoin.amos.fas.business.dao.mapper.ImpAndFireEquipMapper;
import com.yeejoin.amos.fas.business.dao.mapper.ImpEquipMapper;
import com.yeejoin.amos.fas.business.dao.mapper.*;
import com.yeejoin.amos.fas.business.dao.repository.IEquipmentDao;
import com.yeejoin.amos.fas.business.dao.repository.IEquipmentFireEquipmentDao;
import com.yeejoin.amos.fas.business.dao.repository.IPreplanPictureDao;
......@@ -72,6 +69,9 @@ public class EquipmentServiceImpl implements IEquipmentService {
@Autowired
private RedisTemplate redisTemplate;
@Autowired
private PlanEquipmentMapper planEquipmentMapper;
// @Autowired
// private IFmeaEquipmentPointDao iFmeaEquipmentPointDao;
......@@ -109,6 +109,7 @@ public class EquipmentServiceImpl implements IEquipmentService {
@Override
@Transactional
public String[] delete(String[] idArray) throws Exception {
List<Long> idList = new ArrayList<>();
for (String id : idArray) {
Optional<Equipment> equipment1 = iEquipmentDao.findById(Long.parseLong(id));
Equipment equipment=null;
......@@ -125,10 +126,12 @@ public class EquipmentServiceImpl implements IEquipmentService {
} else {
throw new Exception("找不到指定的对象:" + id);
}
idList.add(Long.valueOf(id));
//删除重点设备关联关系
equipmentFireEquipmentDao.deleteByEquipmentId(Long.valueOf(id));
}
// 同步至数字预案
planEquipmentMapper.logicDeleteByEquipIdList(idList);
return idArray;
}
......
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