Commit 40051baa authored by maoying's avatar maoying

解决冲突

parents bd962c4b 996372e3
......@@ -86,11 +86,6 @@
<artifactId>amos-component-feign</artifactId>
<version>1.1.0-SNAPSHOT</version>
</dependency>
<!-- <dependency>
<groupId>com.yeejoin.amos</groupId>
......
package com.yeejoin.amos.fas.business.action;
import java.io.IOException;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.ConcurrentHashMap;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
......@@ -41,25 +67,6 @@ import com.yeejoin.amos.fas.dao.entity.ContingencyPlanInstance;
import com.yeejoin.amos.fas.dao.entity.Equipment;
import com.yeejoin.amos.fas.dao.entity.PlanDetail;
import com.yeejoin.amos.fas.dao.entity.PlanOperationRecord;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import java.io.IOException;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
//import com.yeejoin.amos.fas.business.service.intfc.FireStengthService;
......@@ -183,14 +190,49 @@ public class ContingencyAction implements CustomerAction {
return returnMap;
}
/**
* @param stepCode 当前步骤编号
* @param stepName 当前步骤名称
* @param nextStepCode 下一步编号
* @param nextStepName 下一步名称
* @param paramObj 预案对象
*/
@RuleMethod(methodLabel = "步骤更新(新)", project = "换流站消防专项预案")
public void stepInfoNew(@MethodParam(paramLabel = "当前步骤编号") String stepCode,
@MethodParam(paramLabel = "当前步骤名称") String stepName,
@MethodParam(paramLabel = "下一步编号") String nextStepCode,
@MethodParam(paramLabel = "下一步名称") String nextStepName,
@MethodParam(paramLabel = "对象") Object paramObj) {
ContingencyRo contingencyRo = (ContingencyRo) paramObj;
stopSnapshop(contingencyRo);
SafteyPlanResult result = new SafteyPlanResult();
Map<String, Object> tempmap1 = new HashMap<>();
ArrayList list = new ArrayList();
HashMap step = new HashMap();
step.put("stepCode", stepCode);
step.put("stepName", stepName);
HashMap nextmap = new HashMap();
nextmap.put("stepCode", nextStepCode);
nextmap.put("stepName", nextStepName);
list.add(step);
list.add(nextmap);
tempmap1.put("step", list);
tempmap1.put("preStep", new HashMap());
result.add(tempmap1);
log.info("步骤更新(new)" + JSONObject.toJSONString(result));
this.sendcmd("steparea", contingencyRo, result);
}
/**
* @param stepCode 当前步骤编号
* @param paramObj 预案对象
*/
@RuleMethod(methodLabel = "步骤更新", project = "换流站消防专项预案")
public void stepInfo(@MethodParam(paramLabel = "当前编号") String stepCode,
// @MethodParam(paramLabel = "步骤类型") String stepType,
@MethodParam(paramLabel = "对象") Object paramObj) {
ContingencyRo contingencyRo = (ContingencyRo) paramObj;
stopSnapshop(contingencyRo);
......@@ -228,6 +270,9 @@ public class ContingencyAction implements CustomerAction {
log.info("巡检消息发送规则" + JSONObject.toJSONString(result));
this.sendcmd("steparea", contingencyRo, result);
}
public void sendcmd(String msgType, Object contingency, SafteyPlanResult result) {
ContingencyRo ro = (ContingencyRo)contingency;
......@@ -794,7 +839,7 @@ public class ContingencyAction implements CustomerAction {
Map<String, Object> equipemtnPoints = pointCache.get(contingencyRo.getEquipmentId());
tempmap1.put("type", "buttonCache");
tempmap1.put("content", equipemtnPoints.values());
tempmap1.put("content", ObjectUtils.isEmpty(equipemtnPoints) ? new ArrayList<>() : equipemtnPoints.values());
result.add(tempmap1);
this.sendcmd("message", paramObj, result);
......
......@@ -45,7 +45,7 @@ public class ProtalDataRo extends BasicsRo {
* 任务编号,如果无任务,则填充0
*/
@Label("任务id")
private Long taskId=0l;
private Long taskId= 0L;
/**
* 任务状态
*/
......
package com.yeejoin.amos.fas.business.action.util;
import java.util.Comparator;
import com.yeejoin.amos.fas.business.action.model.SetpEnum;
public class StepComparator implements Comparator<SetpEnum>{
@Override
public int compare(SetpEnum o1, SetpEnum o2) {
//对日期字段进行升序,如果欲降序可采用before方法
if(o1.getOrder() > o2.getOrder()) return 1;
return -1;
}
}
package com.yeejoin.amos.fas.business.controller;
import com.yeejoin.amos.fas.business.service.intfc.EquipmentSpecificIndexService;
import com.yeejoin.amos.fas.config.Permission;
import com.yeejoin.amos.fas.core.util.CommonResponse;
import com.yeejoin.amos.fas.core.util.CommonResponseUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.val;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
* @ProjectName: YeeAmosFireAutoSysRoot
* @Package: com.yeejoin.amos.fas.business.controller
* @ClassName: EquipmentSpecificIndexController
* @Author: Jianqiang Gao
* @Description: EquipmentSpecificIndexController
* @Date: 2021/1/18 16:32
* @Version: 1.0
*/
@RestController
@RequestMapping(value = "/api/equipSpecificIndex")
@Api(tags = "装备性能指标Api")
public class EquipmentSpecificIndexController extends BaseController {
@Value("${autoSys.alarm.nameKeys}")
private String nameKeys;
@Value("${autoSys.alarm.status}")
private String status;
@Value("${autoSys.alarm.value}")
private String value;
@Autowired
private EquipmentSpecificIndexService equipmentSpecificIndexService;
@Permission
@ApiOperation(httpMethod = "GET", value = "获取最新告警状态", notes = "获取最新告警状态")
@RequestMapping(value = "/queryInitAlarm", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
public CommonResponse queryInitAlerm(@ApiParam(value = "物联采集属性值", required = true) @RequestParam String value,
@ApiParam(value = "多nameKey,中间英文逗号隔开", required = true) @RequestParam String nameKeys,
@ApiParam(value = "多status,中间英文逗号隔开", required = true) @RequestParam String status) {
return CommonResponseUtil.success(equipmentSpecificIndexService.queryInitAlarm(value, nameKeys, status));
}
@Permission
@ApiOperation(httpMethod = "GET", value = "获取三维初始化告警信息", notes = "获取三维初始化告警信息")
@RequestMapping(value = "/getInitAlarm", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
public CommonResponse getInitAlarm(@ApiParam(value = "物联采集属性值") @RequestParam(required = false) String value,
@ApiParam(value = "多nameKey,中间英文逗号隔开") @RequestParam(required = false) String nameKeys,
@ApiParam(value = "多status,中间英文逗号隔开") @RequestParam(required = false) String status) {
if (!StringUtils.isNotBlank(value) && !StringUtils.isNotBlank(nameKeys) && !StringUtils.isNotBlank(status)) {
value = this.value;
nameKeys = this.nameKeys;
status = this.status;
}
return CommonResponseUtil.success(equipmentSpecificIndexService.getInitAlarm(value, nameKeys, status));
}
}
\ No newline at end of file
......@@ -636,7 +636,7 @@ public class RiskSourceController extends BaseController {
}
// @Permission
@Permission
// @Authorization(ingore = true)
@ApiOperation(httpMethod = "PUT", value = "上传巡检数据", notes = "上传巡检数据")
@RequestMapping(value = "/data/patroldata", produces = "application/json;charset=UTF-8", method = RequestMethod.PUT)
......
package com.yeejoin.amos.fas.business.dao.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.fas.business.vo.EquipmentSpecificIndexVo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 装备性能指标 Mapper 接口
*
* @author Jianqiang Gao
* @date 2021-01-18
*/
public interface EquipmentSpecificIndexMapper extends BaseMapper<EquipmentSpecificIndexVo> {
List<EquipmentSpecificIndexVo> findByDetailIdInAndNameKey(@Param("list") List<Object> equipDetailIdList, @Param("nameKey") String nameKey);
List<EquipmentSpecificIndexVo> queryInitAlarm(@Param("value") String value, @Param("list") String[] nameKeys);
List<EquipmentSpecificIndexVo> getInitAlarm(@Param("value") String value, @Param("list") String[] nameKeys);
}
......@@ -20,5 +20,5 @@ public interface ImpEquipMapper extends BaseMapper {
Long reservePageCount();
List<EquipmentDTO> reservePage(long start, int length);
List<EquipmentDTO> reservePage(@Param("start") long start,@Param("length") int length);
}
package com.yeejoin.amos.fas.business.dao.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.fas.business.vo.EquipmentSpecificIndexVo;
import com.yeejoin.amos.fas.business.vo.PollPointVo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @ProjectName: YeeAmosFireAutoSysRoot
* @Package: com.yeejoin.amos.fas.business.dao.mapper
* @ClassName: PollPointMapper
* @Author: Jianqiang Gao
* @Description: 巡检点Mapper
* @Date: 2021/1/18 17:36
* @Version: 1.0
*/
public interface PollPointMapper extends BaseMapper<PollPointVo> {
List<PollPointVo> queryInitAlarm(@Param("list") String[] status);
List<EquipmentSpecificIndexVo> getInitAlarm(@Param("list") String[] status);
}
\ No newline at end of file
......@@ -5,7 +5,6 @@ import com.yeejoin.amos.component.rule.RuleTrigger;
import com.yeejoin.amos.fas.business.action.ContingencyAction;
import com.yeejoin.amos.fas.business.action.model.ContingencyEvent;
import com.yeejoin.amos.fas.business.action.model.ContingencyRo;
import com.yeejoin.amos.fas.business.action.model.SetpEnum;
import com.yeejoin.amos.fas.business.action.util.ContingencyLogPublisher;
import com.yeejoin.amos.fas.business.dao.mapper.FireEquipPointMapper;
import com.yeejoin.amos.fas.business.dao.mapper.ImpAndFireEquipMapper;
......@@ -169,8 +168,8 @@ public class ContingencyInstanceImpl /*extends GenericManagerImpl<ContingencyPla
contingencyRo.setButtonCode(buttonCode);
contingencyRo.setButtonState(buttonState);
BeanUtils.copyProperties(contingencyOriginalData, contingencyRo);
SetpEnum step = SetpEnum.getStepByCode(stepCode);
contingencyRo.setStep(step.getValue());
// SetpEnum step = SetpEnum.getStepByCode(stepCode);
contingencyRo.setStep(stepCode);
contingencyRo.setStepState(stepMap.get(stepKey));
// contingencyRo.setStep(stepCode);
log.info("stepstate:" + contingencyRo.getStepState());
......
package com.yeejoin.amos.fas.business.service.impl;
import com.yeejoin.amos.fas.business.dao.mapper.EquipmentSpecificIndexMapper;
import com.yeejoin.amos.fas.business.dao.mapper.PollPointMapper;
import com.yeejoin.amos.fas.business.service.intfc.EquipmentSpecificIndexService;
import com.yeejoin.amos.fas.business.vo.EquipmentSpecificIndexVo;
import com.yeejoin.amos.fas.business.vo.PollPointVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @ProjectName: YeeAmosFireAutoSysRoot
* @Package: com.yeejoin.amos.fas.business.service.impl
* @ClassName: EquipmentSpecificIndexServiceImpl
* @Author: Jianqiang Gao
* @Description: EquipmentSpecificIndexServiceImpl
* @Date: 2021/1/18 16:35
* @Version: 1.0
*/
@Service
public class EquipmentSpecificIndexServiceImpl implements EquipmentSpecificIndexService {
@Autowired
private EquipmentSpecificIndexMapper equipmentSpecificIndexMapper;
@Autowired
private PollPointMapper pollPointMapper;
@Override
public Map<String, Object> queryInitAlarm(String value, String nameKeys, String status) {
Map<String, Object> map = new HashMap<>(16);
// 查询设备告警
List<EquipmentSpecificIndexVo> equipmentSpecificAlarmVoList = equipmentSpecificIndexMapper.queryInitAlarm(value, nameKeys.split(","));
map.put("equip", equipmentSpecificAlarmVoList);
// 查询巡检告警
List<PollPointVo> pollPointVoList = pollPointMapper.queryInitAlarm(status.split(","));
map.put("poll", pollPointVoList);
return map;
}
@Override
public List<EquipmentSpecificIndexVo> getInitAlarm(String value, String nameKeys, String status) {
// 查询设备告警
List<EquipmentSpecificIndexVo> equipmentSpecificAlarmVoList = equipmentSpecificIndexMapper.getInitAlarm(value, nameKeys.split(","));
// 查询巡检告警
List<EquipmentSpecificIndexVo> pollPointVoList = pollPointMapper.getInitAlarm(status.split(","));
pollPointVoList.stream().sequential().collect(Collectors.toCollection(() -> equipmentSpecificAlarmVoList));
return equipmentSpecificAlarmVoList;
}
}
\ No newline at end of file
......@@ -3,67 +3,73 @@ package com.yeejoin.amos.fas.business.service.impl;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.stereotype.Service;
import com.yeejoin.amos.fas.business.bo.FireEquipmentBo;
import com.yeejoin.amos.fas.business.dao.mapper.FireEquipMapper;
import com.yeejoin.amos.fas.business.dao.mapper.ImpEquipMapper;
import com.yeejoin.amos.fas.business.param.CommonPageInfoParam;
import com.yeejoin.amos.fas.business.service.intfc.IFireEquipService;
import com.yeejoin.amos.fas.business.util.FireEquipmentType;
import com.yeejoin.amos.fas.common.enums.EquipClassifyEnum;
import com.yeejoin.amos.fas.core.common.request.CommonPageable;
import com.yeejoin.amos.fas.core.common.response.CommonPage;
import com.yeejoin.amos.fas.dao.entity.FireEquipment;
@Service("fireEquipService")
public class FireEquipServiceImpl implements IFireEquipService {
/**
* 液位
*/
private final static String NAME_KEY = "liquidLevel";
@Autowired
FireEquipMapper fireEquipMapper;
@Autowired
ImpEquipMapper impEquipMapper;
// @Autowired
// IWaterResourceDao iWaterResourceDao;
@Autowired
IWaterResourceDao iWaterResourceDao;
// @Autowired
// IFireStationDao iFireStationDao;
@Autowired
IFireStationDao iFireStationDao;
// public FireEquipment save(FireEquipment fireEquipment) {
// Long id = fireEquipment.getId();
// iFireEquipmentDao.save(fireEquipment);
// return fireEquipment;
// }
//
//
// public FireEquipment queryOne(Long id) {
// Optional<FireEquipment> fireEquipment1=iFireEquipmentDao.findById(id);
// if(fireEquipment1.isPresent()){
// return fireEquipment1.get();
// }
// return null;
// }
@Autowired
EquipmentSpecificIndexMapper equipmentSpecificIndexMapper;
public FireEquipment save(FireEquipment fireEquipment) {
Long id = fireEquipment.getId();
iFireEquipmentDao.save(fireEquipment);
return fireEquipment;
}
public String[] delete(String[] idArray) throws Exception {
// for (String id : idArray) {
// Optional<FireEquipment> fireEquipment1 = iFireEquipmentDao.findById(Long.parseLong(id));
// FireEquipment fireEquipment=null;
// if(fireEquipment1.isPresent()){
// fireEquipment= fireEquipment1.get();
// }
//
// if (fireEquipment != null) {
// this.iFireEquipmentDao.deleteById(Long.parseLong(id));
// } else {
// throw new Exception("找不到指定的对象:" + id);
// }
// }
public FireEquipment queryOne(Long id) {
Optional<FireEquipment> fireEquipment1 = iFireEquipmentDao.findById(id);
if (fireEquipment1.isPresent()) {
return fireEquipment1.get();
}
return null;
}
public String[] delete(String[] idArray) throws Exception {
for (String id : idArray) {
Optional<FireEquipment> fireEquipment1 = iFireEquipmentDao.findById(Long.parseLong(id));
FireEquipment fireEquipment = null;
if (fireEquipment1.isPresent()) {
fireEquipment = fireEquipment1.get();
}
if (fireEquipment != null) {
this.iFireEquipmentDao.deleteById(Long.parseLong(id));
} else {
throw new Exception("找不到指定的对象:" + id);
}
}
return idArray;
}
......@@ -93,48 +99,47 @@ public class FireEquipServiceImpl implements IFireEquipService {
//查询 消防设备历史数据
public Page queryForFireEquipmentHistory(String fireEquipmentName,
String equipmentName,
String startTime,
String endTime,
CommonPageable commonPageable) {
String equipmentName,
String startTime,
String endTime,
CommonPageable commonPageable) {
long total = fireEquipMapper.queryForFireEquipmentHistoryCount( fireEquipmentName,equipmentName,
long total = fireEquipMapper.queryForFireEquipmentHistoryCount(fireEquipmentName, equipmentName,
startTime,
endTime);
List<Map> content = fireEquipMapper.queryForFireEquipmentHistory(fireEquipmentName,
List<Map> content = fireEquipMapper.queryForFireEquipmentHistory(fireEquipmentName,
equipmentName,
startTime,
endTime,
commonPageable.getOffset(),
commonPageable.getPageSize());
Page result = new CommonPage(content, commonPageable, total);
Page result = new CommonPage(content, commonPageable, total);
return result;
}
public Page queryForEquipmentList(String name, String code,String equipClassify,CommonPageable commonPageable,String bindStation) {
long total = fireEquipMapper.queryForEquipmentPageCount( name, code,equipClassify,bindStation);
List<Map> content = this.fireEquipMapper.queryForEquipmentPage(name, code,equipClassify,commonPageable.getOffset(),commonPageable.getPageSize(),bindStation);
Page result = new CommonPage(content, commonPageable, total);
return result;
public Page queryForEquipmentList(String name, String code, String equipClassify, CommonPageable commonPageable, String bindStation) {
long total = fireEquipMapper.queryForEquipmentPageCount(name, code, equipClassify, bindStation);
List<Map> content = this.fireEquipMapper.queryForEquipmentPage(name, code, equipClassify, commonPageable.getOffset(), commonPageable.getPageSize(), bindStation);
Page result = new CommonPage(content, commonPageable, total);
return result;
}
/**
* 查询设备信息明细
*
* @param type
* @param id
* @return
* @throws Exception
*/
public Object queryForDetail(String type, Long id) throws Exception
{
public Object queryForDetail(String type, Long id) throws Exception {
Object returnEntity = null;
FireEquipmentType fireEquipmentType = FireEquipmentType.valueOf(type);
switch (fireEquipmentType)
{
// case pool:
......@@ -172,6 +177,7 @@ public class FireEquipServiceImpl implements IFireEquipService {
FireEquipmentBo fireDetection=fireEquipMapper.findFireEquipById(id);
fireDetection.setProtectObjNames(this.impEquipMapper.queryProtectObjNames(fireDetection.getId()));
returnEntity = fireDetection;
break;
default:
......@@ -187,9 +193,11 @@ public class FireEquipServiceImpl implements IFireEquipService {
// }
// @Override
// public Boolean isExistByCode(String code) {
// Optional<FireEquipment> optional = iFireEquipmentDao.findByCode(code);
// return optional.isPresent();
// }
// @Override
// public Boolean isExistByCode(String code) {
// Optional<FireEquipment> optional = iFireEquipmentDao.findByCode(code);
// return optional.isPresent();
// }
}
......@@ -6,7 +6,11 @@ import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import com.yeejoin.amos.component.rule.RuleTrigger;
import com.yeejoin.amos.fas.business.action.model.ContingencyRo;
<<<<<<< HEAD
import com.yeejoin.amos.fas.business.action.model.SetpEnum;
=======
import com.yeejoin.amos.fas.business.action.model.FireEquimentDataRo;
>>>>>>> CSFAS_V2.1.3.3
import com.yeejoin.amos.fas.business.action.mq.WebMqttComponent;
import com.yeejoin.amos.fas.business.action.mq.WebMqttSubscribe;
import com.yeejoin.amos.fas.business.dao.mapper.*;
......@@ -27,7 +31,10 @@ import com.yeejoin.amos.fas.business.vo.Toke;
import com.yeejoin.amos.fas.business.vo.TopicEntityVo;
import com.yeejoin.amos.fas.client.invoke.RsDataQueue;
import com.yeejoin.amos.fas.common.enums.EquipmentRiskTypeEnum;
<<<<<<< HEAD
import com.yeejoin.amos.fas.common.enums.View3dRefreshAreaEum;
=======
>>>>>>> CSFAS_V2.1.3.3
import com.yeejoin.amos.fas.dao.entity.*;
import org.apache.commons.lang3.ArrayUtils;
import org.slf4j.Logger;
......@@ -42,6 +49,10 @@ import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.context.RequestContext;
<<<<<<< HEAD
=======
import java.math.BigDecimal;
>>>>>>> CSFAS_V2.1.3.3
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;
......@@ -118,8 +129,15 @@ public class HandlerMqttMessageImpl implements IEquipmentHandlerService {
@Value("${spring.application.name}")
private String serviceName;
<<<<<<< HEAD
@Autowired
private IPlanOperationRecordDao planOperationRecordDao;
=======
@Value("${autoSys.alarm.nameKeys}")
private String nameKeys;
>>>>>>> CSFAS_V2.1.3.3
@Override
public void handlerMqttMessage(String topic, String data) {
......@@ -127,13 +145,27 @@ public class HandlerMqttMessageImpl implements IEquipmentHandlerService {
log.info("iotCode 性能指标属于: " + topicEntity.getType());
EquipmentSpecificIndexVo equipmentSpecificIndex = JSONObject.parseObject(topicEntity.getMessage(), EquipmentSpecificIndexVo.class);
long eqSpecId = equipmentSpecificIndex.getEquipmentSpecificId();
String nameKey = equipmentSpecificIndex.getNameKey();
EquipmentSpecificForRiskVo equipmentSpecific = equipmentSpecificMapper.getOneById(eqSpecId);
Equipment equipment = impAndFireEquipMapper.queryImpEqumtByFireEquipmt(eqSpecId);
// 三维屏指标状态推送
String specificIndexType = equipmentSpecificIndex.getType();
if (nameKey !=null && nameKeys.contains(nameKey)) {
if (equipmentSpecific != null) {
equipmentSpecificIndex.setId(equipmentSpecific.getId());
equipmentSpecificIndex.setName(equipmentSpecific.getName());
equipmentSpecificIndex.setCode(equipmentSpecific.getCode());
}
equipmentSpecificIndex.setType("equip");
String title = String.format("/%s/%s", serviceName, "data/refresh/indexStatus");
webMqttComponent.publish(title, JSON.toJSONString(equipmentSpecificIndex));
}
Equipment equipment = topicEntity.getEquipment()==null?impAndFireEquipMapper.queryImpEqumtByFireEquipmt(eqSpecId):topicEntity.getEquipment();
Toke toke = remoteSecurityService.getServerToken();
AlarmParam deviceData = new AlarmParam();
deviceData.setMonitor(equipment != null ? equipment.getName() : "");
deviceData.setId(String.valueOf(equipmentSpecific.getId()));
deviceData.setCode(equipmentSpecific.getCode());
<<<<<<< HEAD
//设备告警处理逻辑
if (EquipmentRiskTypeEnum.HZGJ.getCode().equals(equipmentSpecificIndex.getType())) {
log.info("(报警)Message type is: " + equipmentSpecificIndex.getType());
......@@ -158,13 +190,59 @@ public class HandlerMqttMessageImpl implements IEquipmentHandlerService {
} else {
// 监测数据逻辑
log.info("(监测)Message type is: " + equipmentSpecificIndex.getType());
=======
if (EquipmentRiskTypeEnum.HZGJ.getCode().equals(specificIndexType)) { //设备告警处理逻辑
log.info("(报警)Message type is: " + specificIndexType);
//通知刷新3d页面告警数据
// iDataRefreshService.refreshViewData(DataRefreshTypeEum.alarm.getCode());
/**
* 推送告警数据
* 影响区域:消防安全=>火灾告警
*/
String title = String.format("/%s/%s/%s/%s", serviceName, stationName,"data/refresh","fireSafety");
webMqttComponent.publish(title, JSON.toJSONString(view3dService.getSafetyExecuteListTop5("fire", equipmentSpecific.getOrgCode())));
// 报警触发调用规则服务
if(!ObjectUtils.isEmpty(equipment) && !ObjectUtils.isEmpty(equipment.getReservePlan())){
executeDynamicPlan(deviceData, equipment, equipmentSpecific, toke);
}
} else if (EquipmentRiskTypeEnum.GZ.getCode().equals(specificIndexType)) { // 设备故障处理逻辑
log.info("(故障)Message type is: " + specificIndexType);
long equipId = 0;
if(StringUtil.isNotEmpty(equipment)) {
equipId = equipment.getId();
}
long specificIndexId = equipmentSpecificIndex.getId();
notifyAlarm(equipmentSpecificIndex, 1);
// 是否关联风险点
List<FmeaEquipmentPoint> list = fmeaEquipmentPointMapper.listFmeaByEquipIndexIdAndEquipId(specificIndexId, equipId);
if(list.size() > 0) {
// 关联风险点进行rpn,rpni值的修改
list.forEach(fmeaEqPoint -> {
long fmeaId = fmeaEqPoint.getFmeaId();
updateFmeaRpn(fmeaId);
});
} else {
// 没有关联风险点,三维页面消息推送
fireEquipRuleMessagePush(deviceData, toke);
}
} else { // 向三维推送实时值修改
log.info("(监测)Message type is: " + specificIndexType);
// 是否关联风险点
notifyAlarm(equipmentSpecificIndex, 0);
>>>>>>> CSFAS_V2.1.3.3
Map<String, Object> content = new HashMap<>();
content.put("id", "id");
content.put("label", "eqPointName");
content.put("id", equipmentSpecific.getId());
content.put("label", equipmentSpecific.getName()+" "+equipmentSpecificIndex.getEquipmentIndexName());
content.put("code", equipmentSpecific.getCode());
content.put("changeDate", new Date());
content.put("orgCode", equipmentSpecific.getOrgCode());
content.put("indexKey", equipmentSpecificIndex.getNameKey());
content.put("status", equipmentSpecificIndex.getValue());
iDataRefreshService.sendRefreshDataWithArea(View3dRefreshAreaEum.monitor_data.getCode(), content);
// iDataRefreshService.sendRefreshDataWithArea(View3dRefreshAreaEum.monitor_data.getCode(), content);
String title = String.format("/%s/%s/%s", serviceName, stationName,"data/refresh/monitorData");
webMqttComponent.publish(title, JSON.toJSONString(view3dService.getEquipStatusList(equipmentSpecific.getOrgCode())));
}
......@@ -291,7 +369,7 @@ public class HandlerMqttMessageImpl implements IEquipmentHandlerService {
contingencyRo.setEquipmentName(equipment.getName());
contingencyRo.setFireEquipmentId(String.valueOf(equipmentSpecific.getId()));
contingencyRo.setFireEquipmentName(equipmentSpecific.getName());
contingencyRo.setStep(SetpEnum.STEP0.getValue());
contingencyRo.setStep("0");
contingencyRo.setConfirm("NONE");
contingencyRo.setFireTruckRoute(equipment.getFireTruckRoute());
contingencyRo.setRunstep(false);
......
package com.yeejoin.amos.fas.business.service.intfc;
import com.yeejoin.amos.fas.business.vo.EquipmentSpecificIndexVo;
import java.util.List;
import java.util.Map;
/**
* @ProjectName: YeeAmosFireAutoSysRoot
* @Package: com.yeejoin.amos.fas.business.service.intfc
* @ClassName: EquipmentSpecificIndexService
* @Author: Jianqiang Gao
* @Description: EquipmentSpecificIndexService
* @Date: 2021/1/18 16:34
* @Version: 1.0
*/
public interface EquipmentSpecificIndexService {
Map<String, Object> queryInitAlarm(String value, String nameKeys, String status);
List<EquipmentSpecificIndexVo> getInitAlarm(String value, String nameKeys, String status);
}
\ No newline at end of file
......@@ -24,7 +24,9 @@ public class EquipmentSpecificIndexVo {
// 性能指标id
private Long equipmentIndexId;
private String name;
private String equipmentIndexName;
private String equipmentIndexUnitName;
......@@ -105,16 +107,45 @@ public class EquipmentSpecificIndexVo {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getEquipmentIndexName() {
return equipmentIndexName;
}
public void setEquipmentIndexName(String equipmentIndexName) {
this.equipmentIndexName = equipmentIndexName;
}
public String getEquipmentIndexUnitName() {
return equipmentIndexUnitName;
}
public void setEquipmentIndexUnitName(String equipmentIndexUnitName) {
this.equipmentIndexUnitName = equipmentIndexUnitName;
}
public EquipmentSpecificIndexVo() {
}
public EquipmentSpecificIndexVo(Long equipmentSpecificId, String value, Long equipmentIndexId, String nameKey, String code, String iotCode, String type) {
public EquipmentSpecificIndexVo(long id, Long equipmentSpecificId, String value, Long equipmentIndexId, String name, String equipmentIndexName, String equipmentIndexUnitName, String nameKey, String code, String iotCode, String type) {
this.id = id;
this.equipmentSpecificId = equipmentSpecificId;
this.value = value;
this.equipmentIndexId = equipmentIndexId;
this.name = name;
this.equipmentIndexName = equipmentIndexName;
this.equipmentIndexUnitName = equipmentIndexUnitName;
this.nameKey = nameKey;
this.code = code;
this.iotCode = iotCode;
this.type = type;
}
}
package com.yeejoin.amos.fas.business.vo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @ProjectName: YeeAmosFireAutoSysRoot
* @Package: com.yeejoin.amos.fas.business.vo
* @ClassName: EquipmentSpecificAlarm
* @Author: Jianqiang Gao
* @Description: 巡检点Vo
* @Date: 2021/1/18 15:54
* @Version: 1.0
*/
@Data
@Api("巡检点Vo")
public class PollPointVo {
@ApiModelProperty("巡检点名称")
private String name;
@ApiModelProperty("巡检点编码")
private String code;
@ApiModelProperty("巡检点状态:0 未纳入巡检,1 合格;2 不合格;3 漏检")
private String status;
}
\ No newline at end of file
package com.yeejoin.amos.fas.business.vo;
import com.yeejoin.amos.fas.dao.entity.Equipment;
import io.swagger.annotations.ApiModel;
import lombok.Data;
......@@ -24,4 +26,6 @@ public class TopicEntityVo {
private String type;
private Long recordId;
private Equipment equipment;
}
......@@ -83,38 +83,39 @@ public class PermissionAspect {
try {
feignClientResult = Privilege.agencyUserClient.getme();
userModel = (AgencyUserModel) feignClientResult.getResult();
} catch (InnerInvokException e) {
e.printStackTrace();
}
String userId = null;
ReginParams regionParam = new ReginParams();
if(userModel != null){
userId = userModel.getUserId();
ReginParams reginParams = JSON.parseObject(redisTemplate.opsForValue().get(buildKey(userModel.getUserId(), token)), ReginParams.class);
if(reginParams == null && userModel.getCompanys().size() > 0){
CompanyModel companyModel = userModel.getCompanys().get(0);
List<DepartmentModel> deptList = remoteSecurityService.getDepartmentTreeByCompanyId(token, product, appKey, companyModel.getSequenceNbr().toString());
if(deptList.size() > 0){
CompanyBo companyBo = convertCompanyModelToBo(companyModel);
DepartmentBo departmentBo = convertDepartmentModelToBo(deptList.get(0));
regionParam.setCompany(companyBo);
regionParam.setDepartment(departmentBo);
}
Map<Long, List<RoleModel>> orgRoles = userModel.getOrgRoles();
List<RoleModel> roleModels = null;
if(!ObjectUtils.isEmpty(orgRoles)) {
for (Map.Entry<Long, List<RoleModel>> entry : orgRoles.entrySet()) {
roleModels = entry.getValue();
break;
String userId = null;
ReginParams regionParam = new ReginParams();
if(userModel != null){
userId = userModel.getUserId();
ReginParams reginParams = JSON.parseObject(redisTemplate.opsForValue().get(buildKey(userModel.getUserId(), token)), ReginParams.class);
if(reginParams == null && userModel.getCompanys().size() > 0){
CompanyModel companyModel = userModel.getCompanys().get(0);
List<DepartmentModel> deptList = remoteSecurityService.getDepartmentTreeByCompanyId(token, product, appKey, companyModel.getSequenceNbr().toString());
if(deptList.size() > 0){
CompanyBo companyBo = convertCompanyModelToBo(companyModel);
DepartmentBo departmentBo = convertDepartmentModelToBo(deptList.get(0));
regionParam.setCompany(companyBo);
regionParam.setDepartment(departmentBo);
}
Map<Long, List<RoleModel>> orgRoles = userModel.getOrgRoles();
List<RoleModel> roleModels = null;
if(!ObjectUtils.isEmpty(orgRoles)) {
for (Map.Entry<Long, List<RoleModel>> entry : orgRoles.entrySet()) {
roleModels = entry.getValue();
break;
}
}
if(!ObjectUtils.isEmpty(roleModels)){
regionParam.setRole(convertRoleModelToBo(roleModels.get(0)));
}
redisTemplate.opsForValue().set(buildKey(userId, token), JSONObject.toJSONString(regionParam));
}
if(!ObjectUtils.isEmpty(roleModels)){
regionParam.setRole(convertRoleModelToBo(roleModels.get(0)));
}
redisTemplate.opsForValue().set(buildKey(userId, token), JSONObject.toJSONString(regionParam));
}
} catch (InnerInvokException e) {
logger.error(e.getMessage());
e.printStackTrace();
}
}
private DepartmentBo convertDepartmentModelToBo(DepartmentModel departmentModel){
......
......@@ -3,7 +3,7 @@ security.password=a1234560
security.loginId=fas_autosys
#environment
#spring.profiles.active = dev
eureka.client.serviceUrl.defaultZone=http://172.16.10.72:10001/eureka/
eureka.client.serviceUrl.defaultZone=http://172.16.3.100:10001/eureka/
eureka.client.register-with-eureka = true
eureka.client.fetch-registry = true
eureka.client.healthcheck.enabled = true
......@@ -23,9 +23,9 @@ spring.datasource.validationQuery = SELECT 1
params.remoteWebsocketUrl=http://172.16.11.36:10600/
#redis
spring.redis.database=0
spring.redis.host=172.16.10.85
spring.redis.host=172.16.3.100
spring.redis.port=6379
spring.redis.password=amos2019Redis
spring.redis.password=1234560
spring.redis.jedis.pool.max-active=200
spring.redis.jedis.pool.max-wait=-1
spring.redis.jedis.pool.max-idle=10
......@@ -41,9 +41,9 @@ params.isPush=true
## emqx
emqx.clean-session=true
emqx.client-id=${spring.application.name}-${random.int[1024,65536]}
emqx.broker=tcp://172.16.10.85:1883
emqx.user-name=super
emqx.password=a123456
emqx.broker=tcp://172.16.3.100:1883
emqx.user-name=admin
emqx.password=admin
#�����
file.downLoad.url=http://39.98.246.31:8888/
#站端名称使用全拼
......
spring.application.name = AMOS-AUTOSYS-1225
spring.application.name = AMOS-AUTOSYS
server.servlet.context-path=/fireAutoSys
server.port = 8083
spring.profiles.active=dev
......@@ -50,16 +50,13 @@ visual.fegin.name=maas-visual
#值班系统
dutyMode.fegin.name=AMOS-DUTYMODE
#队站装备管理名称,主要用于风险区域同步至仓库货位和订阅装备信息系统
equipManage.fegin.name=AMOS-EQUIPMANAGE-1225
equipManage.fegin.name=AMOS-EQUIPMANAGE
#feginName
number.plan.projectName=换流站消防专项预案
#jpush 服务名称
Push.fegin.name=AMOS-JPUSH
spring.http.multipart.maxFileSize = 10480000
spring.http.multipart.MaxRequestSize = 50480000
param.safetyIndexChange.cron = 0 0 2 * * ?
param.weather.url = http://wthrcdn.etouch.cn/weather_mini?citykey=
......@@ -76,6 +73,11 @@ amos.feign.gennerator.use-gateway=true
# 消息推送类型
autoSys.push.type=mqtt
# 3D告警初始化
autoSys.alarm.nameKeys=fireAlarm,fault,shield
autoSys.alarm.status=2,3
autoSys.alarm.value=true
#查询装备分类
#消防视频:xfsp
......
......@@ -52,7 +52,7 @@
left join f_fire_fighting_system as manage on spe.system_id = manage.id
where sto.amount <![CDATA[>]]> 0
<if test="name != null and name!='null' ">
and det.name like CONCAT('%',#{name},'%' )
and (det.name like CONCAT('%',#{name},'%') or ware.full_name like CONCAT('%',#{name},'%') or spe.iot_code like CONCAT('%',#{name},'%') or spe.code like CONCAT('%',#{name},'%'))
</if>
<if test="code != null and code!='null' ">
and cate.code like CONCAT('%',#{code},'%' )
......@@ -78,7 +78,7 @@
left join f_fire_fighting_system as manage on spe.system_id = manage.id
where sto.amount <![CDATA[>]]> 0
<if test="name != null and name!='null' ">
and det.name like CONCAT('%',#{name},'%' )
and (det.name like CONCAT('%',#{name},'%') or ware.full_name like CONCAT('%',#{name},'%') or spe.iot_code like CONCAT('%',#{name},'%') or spe.code like CONCAT('%',#{name},'%'))
</if>
<if test="code != null and code!='null' ">
and cate.code like CONCAT('%',#{code},'%' )
......
<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.fas.business.dao.mapper.EquipmentSpecificIndexMapper">
<select id="findByDetailIdInAndNameKey"
resultType="com.yeejoin.amos.fas.business.vo.EquipmentSpecificIndexVo">
SELECT
wsi.`value`,
wei.unit AS equipmentIndexUnitName
FROM
`wl_equipment_index` wei
RIGHT JOIN wl_equipment_specific_index wsi ON wei.id = wsi.equipment_index_id
LEFT JOIN wl_equipment_specific wes ON wsi.equipment_specific_id = wes.id
WHERE
wsi.`value` != ''
<if test="nameKey != null and nameKey !=''">
AND wei.name_key = #{nameKey}
</if>
<if test="list != null and list.size() > 0">
AND wes.equipment_detail_id IN
<foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
GROUP BY
wsi.id
ORDER BY
wsi.update_date DESC
</select>
<select id="queryInitAlarm" resultType="com.yeejoin.amos.fas.business.vo.EquipmentSpecificIndexVo">
SELECT
concat(wes.id) as id,
concat(wes.id) as equipmentSpecificId,
wed.`name`,
wes.`code`,
wei.name_key,
wei.`name` AS equipmentIndexName,
wsi.`value`
FROM
`wl_equipment_specific_index` wsi
LEFT JOIN wl_equipment_index wei ON wsi.equipment_index_id = wei.id
LEFT JOIN wl_equipment_specific wes ON wsi.equipment_specific_id = wes.id
LEFT JOIN wl_equipment_detail wed ON wed.id = wes.equipment_detail_id
<where>
<if test="value != null and value != ''">
AND wsi.`value` = #{value}
</if>
<if test="list != null and list.length > 0">
AND
<foreach collection="list" item="item" index="index" open="(" close=")" separator="OR">
wei.name_key = #{item}
</foreach>
</if>
</where>
GROUP BY
wsi.equipment_specific_id
ORDER BY
wsi.update_date DESC
</select>
<select id="getInitAlarm" resultType="com.yeejoin.amos.fas.business.vo.EquipmentSpecificIndexVo">
SELECT
concat(wes.id) as id,
concat(wes.id) as equipmentSpecificId,
wed.`name`,
wes.`code`,
wei.name_key,
wei.`name` AS equipmentIndexName,
wsi.`value`,
'equip' AS type
FROM
`wl_equipment_specific_index` wsi
LEFT JOIN wl_equipment_index wei ON wsi.equipment_index_id = wei.id
LEFT JOIN wl_equipment_specific wes ON wsi.equipment_specific_id = wes.id
LEFT JOIN wl_equipment_detail wed ON wed.id = wes.equipment_detail_id
where
wei.is_iot = 1
<if test="value != null and value != ''">
AND wsi.`value` = #{value}
</if>
<if test="list != null and list.length > 0">
AND
<foreach collection="list" item="item" index="index" open="(" close=")" separator="OR">
wei.name_key = #{item}
</foreach>
</if>
GROUP BY
wsi.equipment_specific_id
ORDER BY
wsi.update_date DESC
</select>
</mapper>
\ No newline at end of file
......@@ -113,10 +113,9 @@
</choose>
</select>
<select id="queryForFireEquipmentHistoryCount" resultType="long">
SELECT
count(1)
COUNT(1)
FROM
(
SELECT
......@@ -133,22 +132,22 @@
) equipmentName,
ind.update_date
FROM
wl_equipment_specific_index ind
wl_equipment_specific_index as ind
left join wl_equipment_specific as spe on spe.id = ind.equipment_specific_id
left join wl_equipment_detail as det on spe.equipment_detail_id = det.id
WHERE 1=1 AND ind.value IS NOT NULL
WHERE ind.`value` IS NOT NULL AND ind.`value` != ''
) d
WHERE
1 = 1
<if test="fireEquipmentName!=null">
AND d.fireEquipmentName LIKE '%${fireEquipmentName}%'
</if>
<if test="equipmentName!=null">
AND d.equipmentName LIKE '%${equipmentName}%'
</if>
<if test="startTime!=null">
AND d.update_date BETWEEN '${startTime}' AND '${endTime}'
</if>
<where>
<if test="fireEquipmentName!=null">
AND d.fireEquipmentName LIKE '%${fireEquipmentName}%'
</if>
<if test="equipmentName!=null">
AND d.equipmentName LIKE '%${equipmentName}%'
</if>
<if test="startTime!=null">
AND d.update_date BETWEEN '${startTime}' AND '${endTime}'
</if>
</where>
</select>
......@@ -158,15 +157,14 @@
FROM
(
SELECT
det.`name` as fireEquipmentName,
spe.`code` as fireEquipmentCode,
det.`name` as fireEquipmentName,
spe.`code` as fireEquipmentCode,
ein.name as eq_point_name,
CASE ind.value WHEN 'true' THEN '是'
WHEN 'false' THEN '否'
ELSE ind.value END 'e_value',
ein.unit as eq_point_unit,
str.full_name as source_name,
-- sce.name as source_name,
(
SELECT
group_concat(DISTINCT f.`name`)
......@@ -179,25 +177,24 @@
ind.update_date as create_date
FROM
wl_equipment_specific_index as ind
left join wl_equipment_specific as spe on spe.id = ind.equipment_specific_id
left join wl_equipment_specific as spe on spe.id = ind.equipment_specific_id
left join wl_equipment_detail as det on spe.equipment_detail_id = det.id
left join wl_equipment_index as ein on ind.equipment_index_id = ein.id
left join wl_stock_detail as sto on sto.qr_code = spe.qr_code
left join wl_stock_detail as sto on sto.equipment_specific_id = spe.id
left join wl_warehouse_structure as str on sto.warehouse_structure_id = str.source_id
-- left join f_risk_source as sce on str.source_id = sce.source_id
WHERE ind.`value` IS NOT NULL AND ind.`value` != ''
) d
WHERE
1 = 1
<if test="fireEquipmentName!=null">
AND d.fireEquipmentName LIKE '%${fireEquipmentName}%'
</if>
<if test="equipmentName!=null">
AND d.equipmentName LIKE '%${equipmentName}%'
</if>
<if test="startTime!=null">
AND d.create_date BETWEEN '${startTime}' AND '${endTime}'
</if>
AND e_value IS NOT NULL AND e_value != ''
<where>
<if test="fireEquipmentName!=null">
AND d.fireEquipmentName LIKE '%${fireEquipmentName}%'
</if>
<if test="equipmentName!=null">
AND d.equipmentName LIKE '%${equipmentName}%'
</if>
<if test="startTime!=null">
AND d.create_date BETWEEN '${startTime}' AND '${endTime}'
</if>
</where>
ORDER BY d.create_date desc
LIMIT ${start},${length}
</select>
......@@ -321,6 +318,42 @@
<!-- <if test="id!=null">AND eq.id = #{id}</if>-->
<!-- </where>-->
<!-- </select>-->
<select id="queryStorageEquips" resultType="map">
SELECT
wed.id,
wed.`name`,
u.`name` AS unit,
sum(wsd.amount) fireEquipmentCount
FROM
wl_stock_detail wsd
LEFT JOIN wl_equipment_detail wed ON wed.id = wsd.equipment_detail_id
LEFT JOIN wl_equipment we ON we.id = wed.equipment_id
LEFT JOIN wl_unit u ON u.id = we.unit_id
LEFT JOIN wl_warehouse_structure ws ON ws.id = wsd.warehouse_structure_id
LEFT JOIN f_risk_source as sce on sce.source_id = ws.source_id
WHERE
sce.id = #{riskSourceId}
GROUP BY
wsd.equipment_detail_id,
wed.`name`
</select>
<!-- <select id="findEquipDetailsById" resultType="com.yeejoin.amos.fas.core.common.response.EquipDetailsResponse">-->
<!-- SELECT-->
<!-- eq.`name`,-->
<!-- eq.`code`,-->
<!-- eq.address,-->
<!-- fs.`name` stationName,-->
<!-- eq.charge_user_id userId-->
<!-- FROM-->
<!-- f_equipment eq-->
<!-- LEFT JOIN f_fire_station fs ON fs.id = eq.fire_station_id-->
<!-- <where>-->
<!-- <if test="id!=null">AND eq.id = #{id}</if>-->
<!-- </where>-->
<!-- </select>-->
<!-- <select id="findOneByPointCode" resultType="com.yeejoin.amos.fas.business.vo.EquipCommunicationData">-->
......@@ -341,26 +374,26 @@
<!-- </select>-->
<select id="listByCodes" resultType="com.yeejoin.amos.fas.business.entity.mybatis.FireEquipmentEntity">
select
id,
code,
name
from
f_fire_equipment
where
code in
select
id,
code,
name
from
f_fire_equipment
where
code in
<foreach collection="codes" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
</select>
</select>
<select id="listByType" resultType="com.yeejoin.amos.fas.business.entity.mybatis.FireEquipmentEntity">
select
id,
code,
name
id,
code,
name
from
f_fire_equipment
f_fire_equipment
<where>
<if test="type!=null">
equip_classify = #{type}
......@@ -373,26 +406,26 @@
useGeneratedKeys="true">
insert into f_fire_equipment
(
org_code,
code,
equip_classify,
equip_type,
position3d,
floor3d,
is_indoor,
name,
maintenance_cycle,
manufacturer,
number,
unit,
room,
equip_status,
weight,
risk_source_id
org_code,
code,
equip_classify,
equip_type,
position3d,
floor3d,
is_indoor,
name,
maintenance_cycle,
manufacturer,
number,
unit,
room,
equip_status,
weight,
risk_source_id
)
values
<foreach collection="list" item="item" index="index" separator=",">
(
(
#{item.orgCode},
#{item.code},
#{item.equipClassify},
......@@ -409,7 +442,7 @@
#{item.equipStatus},
#{item.weight},
#{item.riskSourceId}
)
)
</foreach>
</insert>
......@@ -507,7 +540,7 @@
select name from f_fire_equipment where id= #{id}
</select>
<select id="removeIfmeaPointByFireEquipIdAndEquipId" resultType="long">
<select id="removeIfmeaPointByFireEquipIdAndEquipId" resultType="long">
DELETE fmep FROM `f_fmea_equipment_point` fmep
LEFT JOIN wl_equipment_specific_index esi ON esi.id = fmep.equipment_point_id
WHERE esi.equipment_specific_id = #{fireEquipmentId} AND fmep.important_equipment_id = #{importantEquipmentId}
......@@ -522,7 +555,7 @@
detail.NAME AS NAME,
detail.standard AS model,
detail.maintenance_cycle AS maintenance_cycle,
manufatcturer.NAME AS manufatcturer,
manufatcturer.NAME AS manufacturer,
detail.brand AS detail,
detail.production_date AS production_date,
sd.amount AS number,
......@@ -596,7 +629,7 @@
ffe.video_id = video.id
) protectObjNames
FROM wl_video video
LEFT JOIN wl_video_source source ON source.video_id =video.id
LEFT JOIN wl_video_source source ON source.video_id =video.id
LEFT JOIN f_risk_source risk ON risk.id = source.source_id
WHERE
<if test="id != null">
......@@ -639,4 +672,19 @@
<!-- f_risk_source r-->
<!-- where s.id = r.source_id and s.id = #{id}-->
<!-- </select>-->
<select id="findFireStationById" resultType="com.yeejoin.amos.fas.dao.entity.FireStation">
SELECT
wb.`name`,
wb.`code`,
wb.address,
wb.region_id AS riskSourceId,
wb.height,
wb.low,
wb.design_capacity
FROM
wl_building wb
WHERE
wb.id = #{id}
</select>
</mapper>
\ No newline at end of file
......@@ -62,7 +62,7 @@
</trim>
</select>
<select id="reservePage" resultMap="resultMap">
<select id="reservePage" resultType="com.yeejoin.amos.fas.dao.dto.EquipmentDTO">
SELECT
a.id,
a.`name`,
......
<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.fas.business.dao.mapper.PollPointMapper">
<select id="queryInitAlarm" resultType="com.yeejoin.amos.fas.business.vo.PollPointVo">
SELECT
p.`name`,
p.point_no AS `code`,
p.`status`
FROM
`p_point` p
<where>
<if test="list != null and list.length > 0">
AND
<foreach collection="list" item="item" index="index" open="(" close=")" separator="OR">
p.`status` = #{item}
</foreach>
</if>
</where>
</select>
<select id="getInitAlarm" resultType="com.yeejoin.amos.fas.business.vo.EquipmentSpecificIndexVo">
SELECT
concat(p.id) as id,
p.`name`,
p.point_no AS `code`,
'patrol' AS type,
'patrol' AS nameKey,
CASE
WHEN p.`status` = '2' THEN
'true'
WHEN p.`status` = '3' THEN
'true' ELSE 'false'
END AS `value`
FROM
`p_point` p
<where>
<if test="list != null and list.length > 0">
AND
<foreach collection="list" item="item" index="index" open="(" close=")" separator="OR">
p.`status` = #{item}
</foreach>
</if>
</where>
</select>
</mapper>
\ No newline at end of file
......@@ -34,9 +34,14 @@
<dependency>
<groupId>com.yeejoin</groupId>
<artifactId>amos-component-rule</artifactId>
<<<<<<< HEAD
<version>1.4.4-SNAPSHOT</version>
</dependency>
=======
<version>1.4.3-SNAPSHOT</version>
</dependency>
>>>>>>> CSFAS_V2.1.3.3
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
......
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