Commit 42a577ae authored by 吴江's avatar 吴江

Merge branch 'dev_upgrade' of http://172.16.10.76/station/YeeAmosFireAutoSysRoot into dev_upgrade

parents 15db6f25 bc956768
......@@ -7,6 +7,7 @@ public class SafetyExecuteBo {
private String label;
private String pointId;
private String type;
private String status;//指标状态
private String changeDate;
public Long getId() {
return id;
......@@ -44,4 +45,10 @@ public class SafetyExecuteBo {
public void setChangeDate(String changeDate) {
this.changeDate = changeDate;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
}
......@@ -100,7 +100,7 @@ public class FireEquimtPointController extends BaseController {
@ApiParam(value = "监测点编号或者监测点名称模糊匹配") @RequestParam(required = false) String searchValue,
@ApiParam(value = "类型(模拟量:ANALOGUE;开关量:SWITCH)") @RequestParam(required = false) String type) {
Map<String, Object> queryMap = Maps.newHashMap();
queryMap.put("pageNumber", pageNumber);
queryMap.put("offset", pageNumber*pageSize);
queryMap.put("pageSize", pageSize);
if (isBindDevice != null && isBindDevice == 0) {
queryMap.put("fireEquipmentId", 0);
......
......@@ -12,6 +12,8 @@ import com.yeejoin.amos.fas.core.util.CommonResponseUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import io.swagger.annotations.Authorization;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.web.bind.annotation.*;
......
......@@ -73,6 +73,14 @@ public interface View3dMapper extends BaseMapper{
* @return list
*/
List<CheckErrorBo> getAllErrorPatrolPoint(Map<String, Object> params);
/**
* 今日安全指数故障告警详情
* @param params orgCode,date
* @return list
*/
List<CheckErrorBo> getAllFaultAlarm(Map<String, Object> params);
/**
* 今日巡检统计接口
......@@ -94,6 +102,20 @@ public interface View3dMapper extends BaseMapper{
* @return
*/
List<SafetyExecuteBo> getCheckErrorTop5(String orgCode);
/**
* 火灾告警最新5条
* @param orgCode
* @return
*/
List<SafetyExecuteBo> getFireAlarmTop5(String orgCode);
/**
* 设备状态最新5条
* @param orgCode
* @return
*/
List<SafetyExecuteBo> getEquipStatusTop5(String orgCode);
/**
* 按照类型查询点
......
......@@ -67,8 +67,6 @@ import com.yeejoin.amos.fas.business.dao.repository.IEvaluationModelDao;
import com.yeejoin.amos.fas.business.dao.repository.IFireEquipmentDao;
import com.yeejoin.amos.fas.business.dao.repository.IFireEquipmentDataDao;
import com.yeejoin.amos.fas.business.dao.repository.IFireEquipmentPointDao;
import com.yeejoin.amos.fas.business.dao.repository.IFmeaDao;
import com.yeejoin.amos.fas.business.dao.repository.IPPointDao;
import com.yeejoin.amos.fas.business.dao.repository.IPreplanPictureDao;
import com.yeejoin.amos.fas.business.dao.repository.IRiskFactorDao;
import com.yeejoin.amos.fas.business.dao.repository.IRiskLevelDao;
......@@ -102,6 +100,7 @@ import com.yeejoin.amos.fas.common.enums.DataRefreshTypeEum;
import com.yeejoin.amos.fas.core.common.request.CommonPageable;
import com.yeejoin.amos.fas.core.common.response.RegionTreeResponse;
import com.yeejoin.amos.fas.core.common.response.RiskSourceTreeResponse;
import com.yeejoin.amos.fas.core.util.StringUtil;
import com.yeejoin.amos.fas.dao.entity.Alarm;
import com.yeejoin.amos.fas.dao.entity.ContingencyOriginalData;
import com.yeejoin.amos.fas.dao.entity.Dict;
......@@ -122,7 +121,6 @@ import com.yeejoin.amos.fas.exception.YeeException;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.privilege.model.DepartmentModel;
@Service("riskSourceService")
public class RiskSourceServiceImpl implements IRiskSourceService {
......@@ -144,8 +142,6 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
@Autowired
private AppMessagePushService appMessagePushService;
@Autowired
private IFmeaDao iFmeaDao;
@Autowired
private IRiskLevelDao riskLevelDao;
......@@ -177,8 +173,6 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
@Autowired
private IRiskLevelDao iRiskLevelDao;
@Autowired
private IPPointDao iPPointDao;
@Autowired
private RemoteSecurityService remoteSecurityService;
......@@ -775,71 +769,72 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
Equipment equipment = null;
if (fireEquipment != null) {
deviceData.setCode(fireEquipment.getCode());
equipment = impAndFireEquipMapper.queryImpEqumtByFireEquipmt(fireEquipmentPoint.getFireEquipmentId());
//报警数据存库
//保存实时数据
saveFireEquipmentData(fireEquipmentPoint, fireEquipment, deviceData, fireEquipmentPointType);
List<AlarmParam> list = new ArrayList<>();
list.add(deviceData);
//保存到mongo
saveData(list, "soe");
equipment = impAndFireEquipMapper.queryImpEqumtByFireEquipmt(fireEquipmentPoint.getFireEquipmentId());
if (equipment != null) {
String batchNo = null;
Object batch = null;
Dict dict = null;
if (fireEquipmentPointType != null) {
if ("alarm_type_fire".equals(fireEquipmentPointType)) {
redisTemplate.opsForHash().put("currentContingency", "batchNo", null);
} else {
batch = redisTemplate.opsForHash().get("currentContingency", "batchNo");
}
if (batch != null) {
batchNo = batch.toString();
} else {
batchNo = UUID.randomUUID().toString();
}
} else {
batchNo = UUID.randomUUID().toString();
}
if (ObjectUtils.isEmpty(batchNo)) {
return;
}
deviceData.setBatchNo(batchNo);
deviceData.setMonitor(equipment.getName());
deviceData.setEquimentId(String.valueOf(equipment.getId()));
if ("alarm_type_fire".equals(fireEquipmentPointType)) {
if (deviceData.getIsMock()) {
redisTemplate.delete(RiskSourceServiceImpl.cacheKeyForCanBeRunning());
}
Object canBeRunning = redisTemplate.opsForValue().get(cacheKeyForCanBeRunning());
if (canBeRunning == null) {
//动态预案执行
dynamicPlan(deviceData, equipment, fireEquipment, fireEquipmentPointType);
}
}
}
/**
* 预案执行
* @param deviceData
* @param equipment
* @param fireEquipment
* @param fireEquipmentPointType
*/
@Async
private void dynamicPlan(AlarmParam deviceData, Equipment equipment, FireEquipment fireEquipment, String fireEquipmentPointType){
String batchNo = null;
Object batch = null;
Dict dict = null;
if (fireEquipmentPointType != null) {
if ("alarm_type_fire".equals(fireEquipmentPointType)) {
redisTemplate.opsForHash().put("currentContingency", "batchNo", null);
} else {
batch = redisTemplate.opsForHash().get("currentContingency", "batchNo");
}
if (batch != null) {
try {
alermContingency(batchNo, fireEquipment, equipment);
} catch (Exception e) {
log.error("调用规则失败", e);
}
} else {
redisTemplate.expire(cacheKeyForCanBeRunning(), 24 * 60 * 60, TimeUnit.SECONDS);
}
redisTemplate.opsForHash().put("currentContingency", "batchNo", batchNo);
redisTemplate.opsForHash().put("currentContingency", "contingencyPlan", null);
redisTemplate.opsForHash().put("currentContingency", "alarmType", null);
//通知刷新3d页面告警数据
iDataRefreshService.refreshViewData(DataRefreshTypeEum.alarm.getCode());
} else {
if ("alarm_type_trouble".equals(fireEquipmentPointType)) {
notifyAlarm(fireEquipmentPoint, deviceData);
//通知刷新3d页面相关故障数据
iDataRefreshService.refreshViewData(DataRefreshTypeEum.trouble.getCode());
}
String alarmType = (String) redisTemplate.opsForHash().get("currentContingency", "alarmType");
if (!ObjectUtils.isEmpty(alarmType) && dict.getDictValue().equals(alarmType)) {
ContingencyDeviceStatus contingencyDeviceStatus = (ContingencyDeviceStatus) redisTemplate.opsForHash().get("currentContingency", "contingencyPlan");
contingencyDeviceStatus.setNeedStatus("true");
autoProcessContingency(contingencyDeviceStatus, alarmType);
}
batchNo = batch.toString();
} else {
batchNo = UUID.randomUUID().toString();
}
} else {
batchNo = UUID.randomUUID().toString();
}
if (ObjectUtils.isEmpty(batchNo)) {
return;
}
deviceData.setBatchNo(batchNo);
deviceData.setMonitor(equipment.getName());
deviceData.setEquimentId(String.valueOf(equipment.getId()));
if ("alarm_type_fire".equals(fireEquipmentPointType)) {
if (deviceData.getIsMock()) {
redisTemplate.delete(RiskSourceServiceImpl.cacheKeyForCanBeRunning());
}
Object canBeRunning = redisTemplate.opsForValue().get(cacheKeyForCanBeRunning());
if (canBeRunning == null) {
try {
alermContingency(batchNo, fireEquipment, equipment);
} catch (Exception e) {
log.error("调用规则失败", e);
}
} else {
redisTemplate.expire(cacheKeyForCanBeRunning(), 24 * 60 * 60, TimeUnit.SECONDS);
}
redisTemplate.opsForHash().put("currentContingency", "batchNo", batchNo);
redisTemplate.opsForHash().put("currentContingency", "contingencyPlan", null);
redisTemplate.opsForHash().put("currentContingency", "alarmType", null);
} else {
String alarmType = (String) redisTemplate.opsForHash().get("currentContingency", "alarmType");
if (!ObjectUtils.isEmpty(alarmType) && dict.getDictValue().equals(alarmType)) {
ContingencyDeviceStatus contingencyDeviceStatus = (ContingencyDeviceStatus) redisTemplate.opsForHash().get("currentContingency", "contingencyPlan");
contingencyDeviceStatus.setNeedStatus("true");
autoProcessContingency(contingencyDeviceStatus, alarmType);
}
}
}
......@@ -853,7 +848,6 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
private void saveFireEquipmentData(FireEquipmentPoint fireEquipmentPoint, FireEquipment fireEquipment, AlarmParam deviceData, String fireEquipmentPointType) {
if("alarm_type_fire".equals(fireEquipmentPointType) || "alarm_type_trouble".equals(fireEquipmentPointType)){
Alarm alarm = iAlarmDao.findByStatusTrueAndFireEquipmentPointCode(deviceData.getPointCode());
if(alarm != null){
......@@ -865,41 +859,65 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
alarm.setFrequency((alarm.getFrequency()+1));
alarm.setUpdateDate(new Date());
}
iAlarmDao.save(alarm);
}else{
alarm = new Alarm();
alarm.setFireEquipmentCode(fireEquipment.getCode());
alarm.setFireEquipmentId(fireEquipment.getId());
alarm.setFireEquipmentName(fireEquipment.getName());
alarm.setFireEquipmentPointCode(fireEquipmentPoint.getCode());
alarm.setFireEquipmentPointId(fireEquipmentPoint.getId());
alarm.setFireEquipmentPointName(fireEquipmentPoint.getName());
alarm.setFireEquipmentPointValue(deviceData.getState());
alarm.setOrgCode(fireEquipment.getOrgCode());
alarm.setType(fireEquipmentPointType);
if("true".equals(deviceData.getState())){
alarm = new Alarm();
alarm.setFireEquipmentCode(fireEquipment.getCode());
alarm.setFireEquipmentId(fireEquipment.getId());
alarm.setFireEquipmentName(fireEquipment.getName());
alarm.setFireEquipmentPointCode(fireEquipmentPoint.getCode());
alarm.setFireEquipmentPointId(fireEquipmentPoint.getId());
alarm.setFireEquipmentPointName(fireEquipmentPoint.getName());
alarm.setFireEquipmentPointValue(deviceData.getState());
alarm.setOrgCode(fireEquipment.getOrgCode());
alarm.setType(fireEquipmentPointType);
iAlarmDao.save(alarm);
}
}
iAlarmDao.save(alarm);
if(alarm != null){
if ("alarm_type_trouble".equals(fireEquipmentPointType)) {
//通知刷新3d页面相关故障数据
if(alarm.getFrequency()==1 || alarm.getStatus() == false){
notifyAlarm(fireEquipmentPoint, deviceData);
iDataRefreshService.refreshViewData(DataRefreshTypeEum.trouble.getCode());
}
}else{
//通知刷新3d页面告警数据
iDataRefreshService.refreshViewData(DataRefreshTypeEum.alarm.getCode());
}
}
}else{
FireEquipmentData fireEquipmentData = new FireEquipmentData();
fireEquipmentData.setEqPointCode(deviceData.getPointCode());
fireEquipmentData.seteValue(deviceData.getState());
fireEquipmentData.setInformationAddress(deviceData.getInformationAddress());
fireEquipmentData.setSoe(deviceData.getSoe());
fireEquipmentData.setIsInvalid(deviceData.getIsInvalid());
fireEquipmentData.setEqPointName(fireEquipmentPoint.getName());
fireEquipmentData.setEqPointUnit(fireEquipmentPoint.getUnit());
fireEquipmentData.setFireEquipmentPointId(fireEquipmentPoint.getId());
fireEquipmentData.setFireEquipmentId(fireEquipmentPoint.getFireEquipmentId());
fireEquipmentData.setType("monitor");
iFireEquipmentDataDao.save(fireEquipmentData);
Map<String, Object> content = new HashMap<>();
content.put("id", fireEquipmentData.getId());
content.put("label", fireEquipmentData.getEqPointName());
content.put("changeDate", fireEquipmentData.getCreateDate());
content.put("orgCode", fireEquipment.getOrgCode());
iDataRefreshService.sendRefreshDataWithArea(DataRefreshTypeEum.monitor.getCode(), content);
if("SWITCH".equals(fireEquipmentPoint.getType())){ //保存遥信信号数据到mysql中
FireEquipmentData fireEquipmentData = new FireEquipmentData();
fireEquipmentData.setEqPointCode(deviceData.getPointCode());
fireEquipmentData.seteValue(deviceData.getState());
fireEquipmentData.setInformationAddress(deviceData.getInformationAddress());
fireEquipmentData.setSoe(deviceData.getSoe());
fireEquipmentData.setIsInvalid(deviceData.getIsInvalid());
fireEquipmentData.setEqPointName(fireEquipmentPoint.getName());
fireEquipmentData.setEqPointUnit(fireEquipmentPoint.getUnit());
fireEquipmentData.setFireEquipmentPointId(fireEquipmentPoint.getId());
fireEquipmentData.setFireEquipmentId(fireEquipmentPoint.getFireEquipmentId());
fireEquipmentData.setType("monitor");
iFireEquipmentDataDao.save(fireEquipmentData);
Map<String, Object> content = new HashMap<>();
content.put("id", fireEquipmentData.getId());
content.put("label", fireEquipmentData.getEqPointName());
content.put("changeDate", fireEquipmentData.getCreateDate());
content.put("orgCode", fireEquipment.getOrgCode());
content.put("status", deviceData.getSoe());
iDataRefreshService.sendRefreshDataWithArea(DataRefreshTypeEum.monitor.getCode(), content);
}
}
List<AlarmParam> list = new ArrayList<>();
list.add(deviceData);
//保存所有数据(遥测,遥信)到mongo
saveData(list, "soe");
}
@Override
public void saveData(List<AlarmParam> deviceDatas, String type) {
List<EquipCommunicationData> list = deviceDatas.stream().map(param -> {
......@@ -1072,26 +1090,26 @@ public class RiskSourceServiceImpl implements IRiskSourceService {
List<Map> list = riskSourceMapper.queryContingencyWater();
HashOperations hashOperations = redisTemplate.opsForHash();
for (Map map : list) {
double area = 0;
if (!ObjectUtils.isEmpty(map.get("area"))) {
area = Double.valueOf(map.get("area").toString());
}
String maxlevel = map.get("max_level") !=null?map.get("max_level").toString():"0.0";
String level = map.get("value") !=null&& StringUtil.isNumeric(map.get("value").toString())?String.format("%.2f", (Double.valueOf(map.get("value").toString()))):maxlevel;
String volume = String.format("%.2f", Double.valueOf(level) * area);
if (hashOperations.size("Analogue") > 0) {
if (ObjectUtils.isEmpty(map.get("CODE")) || !hashOperations.hasKey("Analogue", map.get("CODE"))) {
map.put("level", 0);
map.put("volume", 0);
map.put("level", level);
map.put("volume", volume);
continue;
}
EquipCommunicationData data = (EquipCommunicationData) hashOperations.get("Analogue", map.get("CODE"));
map.put("level", String.format("%.2f", Double.valueOf(data.getState())));
if (!ObjectUtils.isEmpty(map.get("level"))) {
double area = 0;
if (!ObjectUtils.isEmpty(map.get("area"))) {
area = Double.valueOf(map.get("area").toString());
}
map.put("volume", String.format("%.2f", Double.valueOf(map.get("level").toString()) * area));
} else {
map.put("volume", 0);
}
map.put("level", StringUtil.isNumeric(data.getState())?data.getState():level);
map.put("volume", String.format("%.2f", (Double.valueOf(map.get("level").toString())* area)));
} else {
map.put("level", 0);
map.put("volume", 0);
map.put("level", level);
map.put("volume", volume);
}
}
return list;
......
......@@ -307,8 +307,7 @@ public class View3dServiceImpl implements IView3dService {
Long checkExceptionNum = this.getCheckExceptionNum(orgCode,date);
vo.setCheckExceptionNum(checkExceptionNum);
//4.统计故障数量-日期+机构
//TODO:待毛颖确认调整完成后继续
vo.setFireExceptionNum(0L);
vo.setFireExceptionNum(getFireExceptionNum(orgCode,date));
} else {
throw new YeeException("机构:"+orgCode+" 不存在");
}
......@@ -350,6 +349,15 @@ public class View3dServiceImpl implements IView3dService {
});
} else if(StatisticsErrorTypeEum.equip.getCode().equals(type)){
//TODO:待毛颖确认调整完成后继续
List<CheckErrorBo> checkErrorBoList = view3dMapper.getAllFaultAlarm(params);
Map<String,List<CheckErrorBo>> map = checkErrorBoList.stream().collect(Collectors.groupingBy(CheckErrorBo::getStatus));
map.forEach((k,v)->{
SafetyIndexDetailVo safetyIndexDetailVo = new SafetyIndexDetailVo();
safetyIndexDetailVo.setTypeCode(k);
safetyIndexDetailVo.setTypeName(k);
safetyIndexDetailVo.setContent(getErrorContentVos(v));
resultList.add(safetyIndexDetailVo);
});
}
return resultList;
}
......@@ -411,9 +419,8 @@ public class View3dServiceImpl implements IView3dService {
if (optional.isPresent()) {
List<RiskSource> regionList = iRiskSourceDao.findByParentIdAndIsRegion(optional.get().getId(),RiskSourceRegionEum.TRUE.getCode());
exceptionList = regionList.stream().filter(riskSource -> {
//TODO:待毛颖确认,增加判断故障的规则(统计数据:故障或者rpn上升)
BigDecimal rpnBig = riskSource.getRpn() == null ? new BigDecimal("0") : riskSource.getRpn();
return rpnBig.subtract(riskSource.getRpni()).doubleValue() > 0;
BigDecimal rpn = riskSource.getRpn() == null ? new BigDecimal("0") : riskSource.getRpn();
return rpn.subtract(riskSource.getRpni()).doubleValue() > 0;
}).map(riskSource -> {
ExceptionRegionVo regionVo = new ExceptionRegionVo();
regionVo.setId(riskSource.getId());
......@@ -421,7 +428,8 @@ public class View3dServiceImpl implements IView3dService {
regionVo.setUe4Rotation(getInitJSONArray(riskSource.getUe4Rotation()));
regionVo.setUe4Extent(getInitJSONArray(riskSource.getUe4Extent()));
regionVo.setSafetyIndex(changeRpnToSafetyIndex(riskSource.getRpn()));
regionVo.setBreakdown(isBreakDown(riskSource.getId()));
regionVo.setBreakdown(isBreakDown(riskSource.getId()));//待后期去掉,前端图标显示统一不在细分
regionVo.setRoutePath(this.changeStringToJson(riskSource.getRoutePath()));
return regionVo;
}).collect(Collectors.toList());
}
......@@ -436,8 +444,15 @@ public class View3dServiceImpl implements IView3dService {
}
}
private JSONObject changeStringToJson(String str){
if(StringUtil.isNotEmpty(str)){
return JSON.parseObject(str);
}else {
return new JSONObject();
}
}
private Boolean isBreakDown(Long id){
//TODO:判断是否故障,待毛颖确认
return true;
}
......@@ -471,23 +486,24 @@ public class View3dServiceImpl implements IView3dService {
case "check"://巡检异常
return view3dMapper.getCheckErrorTop5(orgCode);
case "fire":
return JSON.parseArray(" [\r\n" +
" {\r\n" +
" \"id\": 35781,\r\n" +
" \"code\": \"s001\",\r\n" +
" \"label\": \"设备test\",\r\n" +
" \"pointId\": \"1\",\r\n" +
" \"type\": \"check\",\r\n" +
" \"changeDate\": \"2020-04-23 14:31:31\"\r\n" +
" },\r\n" +
" {\r\n" +
" \"id\": 35780,\r\n" +
" \"code\": \"s002\",\r\n" +
" \"label\": \"设备002\",\r\n" +
" \"pointId\": \"23123\",\r\n" +
" \"type\": \"check\",\r\n" +
" \"changeDate\": \"2020-04-23 14:31:27\"\r\n" +
" }]", SafetyExecuteBo.class);
return view3dMapper.getFireAlarmTop5(orgCode);
// return JSON.parseArray(" [\r\n" +
// " {\r\n" +
// " \"id\": 35781,\r\n" +
// " \"code\": \"s001\",\r\n" +
// " \"label\": \"设备test\",\r\n" +
// " \"pointId\": \"1\",\r\n" +
// " \"type\": \"check\",\r\n" +
// " \"changeDate\": \"2020-04-23 14:31:31\"\r\n" +
// " },\r\n" +
// " {\r\n" +
// " \"id\": 35780,\r\n" +
// " \"code\": \"s002\",\r\n" +
// " \"label\": \"设备002\",\r\n" +
// " \"pointId\": \"23123\",\r\n" +
// " \"type\": \"check\",\r\n" +
// " \"changeDate\": \"2020-04-23 14:31:27\"\r\n" +
// " }]", SafetyExecuteBo.class);
default:
throw new YeeException("不支持的类型 -->"+ type);
}
......@@ -503,9 +519,10 @@ public class View3dServiceImpl implements IView3dService {
}
@Override
public Object getEquipStatusList(String orgCode) {
return JSON.parseArray("[{\"id\":1,\"label\":\"设备1 label\",\"changeDate\":\"2020-04-26 10:00:00\"}"
+ ",{\"id\":2,\"label\":\"设备2 label\",\"changeDate\":\"2020-04-25 10:00:00\"}]");
public List<SafetyExecuteBo> getEquipStatusList(String orgCode) {
return view3dMapper.getEquipStatusTop5(orgCode);
// return JSON.parseArray("[{\"id\":1,\"label\":\"设备1 label\",\"changeDate\":\"2020-04-26 10:00:00\"}"
// + ",{\"id\":2,\"label\":\"设备2 label\",\"changeDate\":\"2020-04-25 10:00:00\"}]");
}
@Override
......
......@@ -112,7 +112,7 @@ public interface IView3dService {
* @param orgCode
* @return
*/
Object getEquipStatusList(String orgCode);
List<SafetyExecuteBo> getEquipStatusList(String orgCode);
/**
* 左侧菜单(异常点)
......
package com.yeejoin.amos.fas.business.vo;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import springfox.documentation.spring.web.json.Json;
/**
* @author suhg
*/
......@@ -32,6 +36,11 @@ public class ExceptionRegionVo {
*/
private JSONArray ue4Extent;
/**
* 自研3维区域参数
*/
private JSONObject routePath;
public Long getId() {
return id;
}
......@@ -68,6 +77,14 @@ public class ExceptionRegionVo {
return ue4Extent;
}
public JSONObject getRoutePath() {
return routePath;
}
public void setRoutePath(JSONObject routePath) {
this.routePath = routePath;
}
public void setUe4Extent(JSONArray ue4Extent) {
this.ue4Extent = ue4Extent;
}
......
......@@ -61,20 +61,21 @@ public class StringUtil {
* @return 是否数字的标志
*/
public static boolean isNumeric(String str) {
// 该正则表达式可以匹配所有的数字 包括负数
String bigStr;
try {
bigStr = new BigDecimal(str).toString();
} catch (Exception e) {
return false;// 异常 说明包含非数字。
}
// 该正则表达式可以匹配所有的数字 包括负数
Pattern pattern = Pattern.compile("-?[0-9]+(\\.[0-9]+)?");
String bigStr;
try {
bigStr = new BigDecimal(str).toString();
} catch (Exception e) {
return false;//异常 说明包含非数字。
}
Matcher isNum = numericPattern.matcher(bigStr); // matcher是全匹配
if (!isNum.matches()) {
return false;
}
return true;
}
Matcher isNum = pattern.matcher(bigStr); // matcher是全匹配
if (!isNum.matches()) {
return false;
}
return true;
}
public static int toInt(String s) {
if (s != null && !"".equals(s.trim())) {
......
......@@ -152,8 +152,8 @@
</if>
</where>
order by a.create_date desc
<if test="pageSize!=null and pageSize!=-1 and pageNumber!=null">
limit #{pageNumber},#{pageSize}
<if test="pageSize!=null and pageSize!=-1 and offset!=null">
limit #{offset},#{pageSize}
</if>
</select>
......
......@@ -609,7 +609,8 @@
wr.max_level,
wr.area,
ep.CODE,
wr.`name`
wr.`name`,
ep.value
FROM
f_fire_equipment_point ep
INNER JOIN f_water_resource_equipment wre ON wre.fire_equipment_id = ep.fire_equipment_id AND ep.type = 'ANALOGUE'
......
......@@ -438,7 +438,15 @@
</select>
<select id="countFireException" resultType="long">
SELECT
count(1)
FROM
f_alarm a
WHERE
`status` = TRUE
AND org_code = #{orgCode}
AND type = 'alarm_type_trouble'
AND date_format(a.update_date, '%Y-%m-%d') = #{date}
</select>
<select id="getAllErrorRiskPoint" resultType="com.yeejoin.amos.fas.business.bo.RiskPointRpnChangeBo" >
......@@ -473,6 +481,23 @@
and a.org_code = #{orgCode}
</select>
<select id="getAllFaultAlarm" resultType="com.yeejoin.amos.fas.business.bo.CheckErrorBo">
SELECT
a.id,
a.fire_equipment_point_name as `name`,
fe.equip_type as status,
a.update_date as changeDate
FROM
f_alarm a
LEFT JOIN f_fire_equipment fe ON fe.id = a.fire_equipment_id
WHERE
`status` = TRUE
AND type = 'alarm_type_trouble'
AND a.org_code = #{orgCode}
AND date_format(a.update_date, '%Y-%m-%d') =#{date}
</select>
<select id="getStatisticsCheck" resultType="java.util.HashMap">
<![CDATA[
SELECT d.status as type, count(1) as value
......@@ -503,11 +528,42 @@
left join p_point I ON I.id = p.point_id
where p.is_ok IN ('2', '3')
AND I.is_delete = 0
AND p.org_code = #{org_code} or p.org_code like CONCAT(#{orgCode},'-','%')
AND p.org_code = #{orgCode} or p.org_code like CONCAT(#{orgCode},'-','%')
ORDER BY p.check_time desc
limit 0,5
</select>
<select id="getFireAlarmTop5" resultType="com.yeejoin.amos.fas.business.bo.SafetyExecuteBo">
SELECT
a.fire_equipment_id id,
a.fire_equipment_code code,
a.fire_equipment_point_name as `label`,
a.update_date as changeDate,
"monitorEquipment" type
FROM
f_alarm a
WHERE
a.org_code = #{orgCode}
AND a.`status` = TRUE
AND a.type = 'alarm_type_fire'
ORDER BY a.update_date DESC
limit 0,5
</select>
<select id="getEquipStatusTop5" resultType="com.yeejoin.amos.fas.business.bo.SafetyExecuteBo">
SELECT
fed.id,
fed.eq_point_name label,
fed.e_value status,
fed.create_date changeDate
FROM
f_fire_equipment_data fed
WHERE
fed.org_code = #{orgCode}
ORDER BY fed.create_date DESC
limit 0,5
</select>
<select id="getPintsByType" resultType="hashmap">
select CONCAT(type,'-',id) as `key`,sp.* from
(select id,name,code,ue4_location as ue4Location,ue4_rotation as ue4Rotation ,'riskSource' as type,org_code as orgCode,
......
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