|
@@ -5,20 +5,23 @@ import com.ruoyi.common.core.utils.uuid.IdUtils;
|
|
|
import com.ruoyi.common.datascope.annotation.DataScopeMutiDept;
|
|
|
import com.ruoyi.common.security.utils.SecurityUtils;
|
|
|
import com.sooka.sponest.data.base.service.impl.BaseServiceImpl;
|
|
|
-import com.sooka.sponest.data.housingconstruction.domain.CenterdataTHousingconstructionStoragetank;
|
|
|
import com.sooka.sponest.data.housingconstruction.domain.CenterdataTHousingconstructionStoragetankLog;
|
|
|
import com.sooka.sponest.data.housingconstruction.domain.eventEntity.SensorEventVo;
|
|
|
import com.sooka.sponest.data.housingconstruction.domain.eventEntity.StaticEntity;
|
|
|
-import com.sooka.sponest.data.housingconstruction.feignClient.service.RemoteHousingconstructionEventService;
|
|
|
import com.sooka.sponest.data.housingconstruction.handler.SendEvent;
|
|
|
import com.sooka.sponest.data.housingconstruction.mapper.CenterdataTHousingconstructionStoragetankLogMapper;
|
|
|
import com.sooka.sponest.data.housingconstruction.mapper.CenterdataTHousingconstructionStoragetankMapper;
|
|
|
import com.sooka.sponest.data.housingconstruction.service.ICenterdataTHousingconstructionStoragetankLogService;
|
|
|
import org.apache.commons.collections4.MapUtils;
|
|
|
+import org.slf4j.Logger;
|
|
|
+import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
-import java.util.*;
|
|
|
+import java.util.Arrays;
|
|
|
+import java.util.Date;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
/**
|
|
|
* 储罐存储数据日志Service业务层处理
|
|
@@ -28,6 +31,8 @@ import java.util.*;
|
|
|
*/
|
|
|
@Service
|
|
|
public class CenterdataTHousingconstructionStoragetankLogServiceImpl extends BaseServiceImpl implements ICenterdataTHousingconstructionStoragetankLogService {
|
|
|
+ private static final Logger logger = LoggerFactory.getLogger(CenterdataTHousingconstructionStoragetankLogServiceImpl.class);
|
|
|
+
|
|
|
@Autowired
|
|
|
private CenterdataTHousingconstructionStoragetankLogMapper centerdataTHousingconstructionStoragetankLogMapper;
|
|
|
|
|
@@ -90,7 +95,7 @@ public class CenterdataTHousingconstructionStoragetankLogServiceImpl extends Bas
|
|
|
//设置储罐记录中出现预警的项
|
|
|
StringBuilder securityState = new StringBuilder();
|
|
|
//设置数值单位
|
|
|
- List<String> units = Arrays.asList(new String[]{"m", "℃", "PMa", "%LEL"});
|
|
|
+ List<String> units = Arrays.asList(new String[]{"m", "℃", "MPa", "%LEL"});
|
|
|
|
|
|
//设置基础模板
|
|
|
StringBuilder template = new StringBuilder();
|
|
@@ -107,10 +112,14 @@ public class CenterdataTHousingconstructionStoragetankLogServiceImpl extends Bas
|
|
|
MapUtils.getString(storagetank, "registeredAddress")
|
|
|
);
|
|
|
|
|
|
+ logger.info("storagetankLog===>运行数据{}",storagetankLog);
|
|
|
+ logger.info("storagetankLog===>设定阈值{}",storagetank);
|
|
|
+
|
|
|
//液位上限
|
|
|
if(storagetankLog.getLevel() >= MapUtils.getDouble(storagetank, "levelCeiling")){
|
|
|
//当前液位高于上限或低于下限, 触发时间告警
|
|
|
securityState.append("1").append(",");
|
|
|
+ logger.info("storagetankLog==error=>液位超过上限");
|
|
|
sendEvent.sendEvent(template.toString(), StaticEntity.LEVEL_CEILING_NAME, MapUtils.getString(storagetank, "levelCeiling") + units.get(0), storagetankLog.getLevel() + units.get(0), sensorEventVo, StaticEntity.LEVEL_CEILING_CODE);
|
|
|
}
|
|
|
|
|
@@ -118,6 +127,7 @@ public class CenterdataTHousingconstructionStoragetankLogServiceImpl extends Bas
|
|
|
if(storagetankLog.getLevel() <= MapUtils.getDouble(storagetank, "levelFloor")){
|
|
|
//当前液位高于上限或低于下限, 触发时间告警
|
|
|
securityState.append("1").append(",");
|
|
|
+ logger.info("storagetankLog==error=>液位超过下限");
|
|
|
sendEvent.sendEvent(template.toString(), StaticEntity.LEVEL_FLOOR_NAME, MapUtils.getString(storagetank, "levelFloor") + units.get(0), storagetankLog.getLevel() + units.get(0), sensorEventVo, StaticEntity.LEVEL_FLOOR_CODE);
|
|
|
}
|
|
|
|
|
@@ -125,6 +135,7 @@ public class CenterdataTHousingconstructionStoragetankLogServiceImpl extends Bas
|
|
|
if(storagetankLog.getHeat() >= MapUtils.getDouble(storagetank, "heat")){
|
|
|
//当前温度高于设定温度阈值
|
|
|
securityState.append("2").append(",");
|
|
|
+ logger.info("storagetankLog==error=>温度超过阈值");
|
|
|
sendEvent.sendEvent(template.toString(), StaticEntity.HEAT_NAME, MapUtils.getString(storagetank, "heat") + units.get(1), storagetankLog.getHeat() + units.get(1), sensorEventVo, StaticEntity.HEAT_CODE);
|
|
|
}
|
|
|
|
|
@@ -132,6 +143,7 @@ public class CenterdataTHousingconstructionStoragetankLogServiceImpl extends Bas
|
|
|
if(storagetankLog.getPressure() >= MapUtils.getDouble(storagetank, "pressure")){
|
|
|
//当前内部气压高于设定阈值
|
|
|
securityState.append("3").append(",");
|
|
|
+ logger.info("storagetankLog==error=>内部气压超过阈值");
|
|
|
sendEvent.sendEvent(template.toString(), StaticEntity.PRESSURE_NAME, MapUtils.getString(storagetank, "pressure") + units.get(2), storagetankLog.getPressure() + units.get(2), sensorEventVo, StaticEntity.PRESSURE_CODE);
|
|
|
}
|
|
|
|
|
@@ -139,6 +151,7 @@ public class CenterdataTHousingconstructionStoragetankLogServiceImpl extends Bas
|
|
|
if(storagetankLog.getGasLeak() >= MapUtils.getDouble(storagetank, "gasLeak")){
|
|
|
//可燃性气体泄露值高于设定的阈值
|
|
|
securityState.append("4").append(",");
|
|
|
+ logger.info("storagetankLog==error=>可燃气体超过阈值");
|
|
|
sendEvent.sendEvent(template.toString(), StaticEntity.GAS_LEAK_NAME, MapUtils.getString(storagetank, "gasLeak") + units.get(3), storagetankLog.getGasLeak() + units.get(3), sensorEventVo, StaticEntity.GAS_LEAK_CODE);
|
|
|
}
|
|
|
|