Commit 04b3f871 authored by maoying's avatar maoying

Merge branch 'develop_dl' of http://39.98.45.134:8090/moa/amos-boot-biz into develop_dl

parents 0f37994d 17d940b4
package com.yeejoin.equipmanage.common.vo;
import lombok.Data;
import java.util.List;
/**
* @author keyong
* @title: RiskBizInfoVo
* <pre>
* @description: TODO
* </pre>
* @date 2023/5/17 11:22
*/
@Data
public class RiskBizInfoVo {
private String warningObjectName;
private String warningObjectCode;
private String warningTime;
private String sourceAttribution;
private String sourceAttributionDesc;
private List<RiskDynamicDetailsVo> dynamicDetails;
}
package com.yeejoin.equipmanage.common.vo;
import lombok.Data;
/**
* @author keyong
* @title: RiskDataVo
* <pre>
* @description: TODO
* </pre>
* @date 2023/5/17 11:19
*/
@Data
public class RiskDataVo {
private String indexKey;
private String indexValue;
private RiskBizInfoVo bizInfo;
}
package com.yeejoin.equipmanage.common.vo;
import lombok.Data;
import java.util.List;
/**
* @author keyong
* @title: RiskDynamicDetailsVo
* <pre>
* @description: TODO
* </pre>
* @date 2023/5/17 11:36
*/
@Data
public class RiskDynamicDetailsVo {
private String tabName;
private List<TableContentVo> tabContent;
}
package com.yeejoin.equipmanage.common.vo;
import lombok.Data;
/**
* @author keyong
* @title: SendToMsgRiskAlarmInfoVo
* <pre>
* @description: TODO
* </pre>
* @date 2023/5/22 15:24
*/
@Data
public class SendToMsgRiskAlarmInfoVo {
private String key;
private String value;
}
package com.yeejoin.equipmanage.common.vo;
import lombok.Data;
/**
* @author keyong
* @title: SendToMsgRiskDetailVo
* <pre>
* @description: TODO
* </pre>
* @date 2023/5/22 15:16
*/
@Data
public class SendToMsgRiskDetailVo {
private SendToMsgRiskEquipInfoVo equipInfo;
private SendToMsgRiskAlarmInfoVo alarmInfo;
}
package com.yeejoin.equipmanage.common.vo;
import lombok.Data;
/**
* @author keyong
* @title: SendToMsgRiskEquipInfoVo
* <pre>
* @description: TODO
* </pre>
* @date 2023/5/22 15:21
*/
@Data
public class SendToMsgRiskEquipInfoVo {
private String id;
private String name;
private String code;
private String bizOrgName;
private String bizOrgCode;
}
package com.yeejoin.equipmanage.common.vo;
import lombok.Data;
/**
* @author keyong
* @title: TableContentVo
* <pre>
* @description: TODO
* </pre>
* @date 2023/5/17 11:20
*/
@Data
public class TableContentVo {
private String key;
private String label;
private String value;
private String type;
}
......@@ -21,6 +21,8 @@ public class TopicEntityVo {
private String message;
private String data;
private String type;
// 若是车辆返回车牌号
......
......@@ -58,6 +58,11 @@ public class EquipmentIotMqttReceiveConfig {
@Value("${spring.mqtt.completionTimeout}")
private int completionTimeout;
@Value("${equip.center.risk.topic}")
private String riskMsgCenterEquipTopic;
@Value("${patrol.center.risk.topic}")
private String riskMsgCenterPatrolTopic;
private EquipmentSpecificMapper equipmentSpecificMapper;
......@@ -121,9 +126,11 @@ public class EquipmentIotMqttReceiveConfig {
if (equipAndCars.size() <= 0) {
list.add(defaultTopic);
}
list.addAll(ConfigPageTopicEnum.getEnumTopicList()); //大屏数据推送接口订阅
list.add("+/+/property"); // 添加iot車輛裝備數據上報事件监听
list.addAll(ConfigPageTopicEnum.getEnumTopicList()); // 大屏数据推送接口订阅
list.add("+/+/property"); // 添加iot车辆装备数据上报事件监听
list.add("+/+/event"); // 添加iot事件监听
list.add(riskMsgCenterEquipTopic);
list.add(riskMsgCenterPatrolTopic);
String[] arr = list.toArray(new String[list.size()]);
adapter = new MqttPahoMessageDrivenChannelAdapter(clientId + "_inbound", mqttPahoClientFactory(), arr);
adapter.setCompletionTimeout(completionTimeout);
......@@ -147,6 +154,8 @@ public class EquipmentIotMqttReceiveConfig {
mqttReceiveService.handlerMqttIncrementMessage(topic, msg);
} else if (dataType.equals("event") && StringUtil.isNotEmpty(msg)) {
mqttEventReceiveService.handlerMqttIncrementMessage(topic, msg);
} else if (dataType.equals("trigger") && StringUtil.isNotEmpty(msg)) {
mqttReceiveService.handleDataToRiskModel(topic, msg);
}
}
};
......
......@@ -14,7 +14,8 @@ import java.util.Map;
/**
* @author DELL
*/
@FeignClient(name = "${iot.vehicle.track}", path = "iot", configuration = {FeignConfiguration.class})
//@FeignClient(name = "${iot.vehicle.track}", path = "iot", configuration = {FeignConfiguration.class})
@FeignClient(name = "AMOS-API-IOT", path = "iot", configuration = { FeignConfiguration.class }, url = "http://39.98.224.23:33001")
public interface IotFeign {
@RequestMapping(value = "/v1/livedata/list", method = RequestMethod.GET, consumes = "application/json")
......
......@@ -17,4 +17,11 @@ public interface MqttReceiveService {
* @param message 消息内容
*/
void handlerMqttIncrementMessage(String topic, String message);
/**
* 中心级接收消息发送至消息服务
* @param topic
* @param message
*/
void handleDataToRiskModel(String topic, String message);
}
......@@ -157,6 +157,7 @@ public class CarServiceImpl extends ServiceImpl<CarMapper, Car> implements ICarS
private Boolean syncSwitch;
@Autowired
@Lazy
private IWlCarMileageService iWlCarMileageService;
/**
......
......@@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.feign.privilege.model.DepartmentModel;
import com.yeejoin.amos.feign.systemctl.model.MessageModel;
import com.yeejoin.equipmanage.common.datasync.entity.FireEquipmentDefectAlarm;
import com.yeejoin.equipmanage.common.datasync.entity.FireEquipmentFaultAlarm;
......@@ -27,6 +28,7 @@ import com.yeejoin.equipmanage.quartz.QuartzManager;
import com.yeejoin.equipmanage.remote.RemoteSecurityService;
import com.yeejoin.equipmanage.service.*;
import com.yeejoin.equipmanage.utils.BeanUtil;
import javafx.scene.control.Tab;
import lombok.extern.slf4j.Slf4j;
import org.eclipse.paho.client.mqttv3.MqttException;
import org.springframework.beans.BeanUtils;
......@@ -48,6 +50,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.math.RoundingMode;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
......@@ -213,6 +216,15 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
@Value("${mqtt.vehicle.topic}")
private String carTopic;
@Value("${equip.risk.model.topic}")
private String riskTopic;
@Value("${equip.message.create.topic}")
private String riskTopicCreate;
@Value("${equip.center.risk.topic}")
private String riskTopicCenter;
private static String canvasTopic;
@Value("${equip.point.equipmentdata.topic}")
public void setCanvasTopic(String canvasTopic){
......@@ -254,6 +266,9 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
@Value("${emergency.disposal.indicators}")
private String emergencyDisposalIndicators;
@Value("${equip.message.create.topic}")
private String riskMsgCreateTopic;
private static Boolean bool = Boolean.FALSE;
@Autowired
......@@ -518,6 +533,10 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
// 四横八纵遥测信号信息列表刷新
publishNormalIndexValueToPage(equipmentSpecificIndexList);
// 触发风险---> 站端发送消息到Message服务
publishDataToMessage(equipmentSpecificIndexList);
if("zd".equals(system)){
System.out.println("站端系统----------------");
......@@ -541,7 +560,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
// 向其他系统推送报警
equipmentAlarmLogsToOtherSystems(alarmLogs);
if(vo.getEcode()!=null){
String ecode= vo.getEcode();
boolean flag=false;
......@@ -1433,6 +1452,63 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
log.info(String.format("四横八纵遥测指标消息发送:%s", JSON.toJSONString(equipmentSpecificIndexList)));
}
public void publishDataToMessage(List<EquipmentSpecificIndex> equipmentSpeIndexes) {
equipmentSpeIndexes.forEach(equipmentSpeIndex -> {
SendToMsgRiskDetailVo detailVo = new SendToMsgRiskDetailVo();
SendToMsgRiskEquipInfoVo equipInfoVo = new SendToMsgRiskEquipInfoVo();
SendToMsgRiskAlarmInfoVo alarmInfoVo = new SendToMsgRiskAlarmInfoVo();
equipInfoVo.setId(String.valueOf(equipmentSpeIndex.getEquipmentSpecificId()));
equipInfoVo.setName(equipmentSpeIndex.getEquipmentSpecificName());
equipInfoVo.setCode(equipmentSpeIndex.getEquipmentSpecificCode());
equipInfoVo.setBizOrgCode(equipmentSpeIndex.getBizOrgCode());
equipInfoVo.setBizOrgName(equipmentSpeIndex.getBizOrgName());
alarmInfoVo.setKey(equipmentSpeIndex.getEquipmentIndexKey());
alarmInfoVo.setValue(equipmentSpeIndex.getValue());
TopicEntityVo topicEntityVo = new TopicEntityVo();
topicEntityVo.setIotCode(equipmentSpeIndex.getIotCode());
topicEntityVo.setTopic(riskTopicCenter);
detailVo.setEquipInfo(equipInfoVo);
detailVo.setAlarmInfo(alarmInfoVo);
topicEntityVo.setData(JSON.toJSONString(detailVo));
mqttSendGateway.sendToMqtt(riskTopicCreate, JSON.toJSONString(topicEntityVo));
log.info(String.format("站端发送给中心级触发风险:%s", JSON.toJSONString(topicEntityVo)));
});
}
@Override
public void handleDataToRiskModel(String topic, String message) {
JSONObject jsonObject = JSONObject.parseObject(message);
SendToMsgRiskDetailVo detailVo = JSONObject.toJavaObject(jsonObject, SendToMsgRiskDetailVo.class);
RiskDataVo dataVo = new RiskDataVo();
dataVo.setIndexKey(detailVo.getAlarmInfo().getKey());
dataVo.setIndexValue(detailVo.getAlarmInfo().getValue());
RiskBizInfoVo infoVo = new RiskBizInfoVo();
infoVo.setWarningObjectName(detailVo.getEquipInfo().getName());
infoVo.setWarningObjectCode(detailVo.getEquipInfo().getCode());
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
infoVo.setWarningTime(sdf.format(new Date()));
infoVo.setSourceAttribution(detailVo.getEquipInfo().getBizOrgCode());
infoVo.setSourceAttributionDesc(detailVo.getEquipInfo().getBizOrgName());
infoVo.setWarningObjectCode(detailVo.getEquipInfo().getId());
List<RiskDynamicDetailsVo> detailsVos = new ArrayList<>();
RiskDynamicDetailsVo dynamicDetailsVo = new RiskDynamicDetailsVo();
dynamicDetailsVo.setTabName("装备指标联动数据");
List<TableContentVo> contentVos = new ArrayList<>();
TableContentVo contentVo = new TableContentVo();
contentVo.setKey("1");
contentVo.setLabel("文本名称");
contentVo.setValue("文本值");
contentVo.setType("text");
contentVos.add(contentVo);
dynamicDetailsVo.setTabContent(contentVos);
detailsVos.add(dynamicDetailsVo);
infoVo.setDynamicDetails(detailsVos);
dataVo.setBizInfo(infoVo);
mqttSendGateway.sendToMqtt(riskTopic, JSON.toJSONString(dataVo));
}
/**
* 更新数据报表表
*
......
......@@ -20,6 +20,9 @@ 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.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
......@@ -45,7 +48,10 @@ import java.util.*;
* @author duanwei
* @date 2023-02-01
*/
@Service
@EnableScheduling
@EnableAsync
public class WlCarMileageServiceImpl extends ServiceImpl<WlCarMileageMapper, WlCarMileage>
implements IWlCarMileageService {
......@@ -183,6 +189,10 @@ public class WlCarMileageServiceImpl extends ServiceImpl<WlCarMileageMapper, WlC
}
if (result != null) {
Map<String, Object> jsonObject = (Map<String, Object>) JSONObject.parseObject(result);
//判断是否坐标不满足高德地图纠偏需求
if(jsonObject.containsKey("errcode")&&jsonObject.get("errcode").toString().equals("30001")){
return list;
}
if (jsonObject.containsKey("data")) {
JSONObject data3 = JSONObject.parseObject(jsonObject.get("data").toString());
JSONArray points1 = JSONArray.parseArray(data3.get("points").toString());
......@@ -278,6 +288,7 @@ public class WlCarMileageServiceImpl extends ServiceImpl<WlCarMileageMapper, WlC
@Override
@Scheduled(cron = "${mileage.segmentation.cron}")
@Async
public void mileageSegmentation() {
log.info("轨迹切分定时任务开始执行时间.............{}", LocalDateTime.now());
Calendar cal = Calendar.getInstance();
......
package com.yeejoin.equipmanage.thread;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yeejoin.equipmanage.common.entity.WlCarMileage;
import com.yeejoin.equipmanage.common.utils.CoordinateUtil;
import com.yeejoin.equipmanage.fegin.IotFeign;
import com.yeejoin.equipmanage.service.IWlCarMileageService;
import com.yeejoin.equipmanage.utils.CarUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class ThreadCar extends Thread {
@Autowired
private IWlCarMileageService iWlCarMileageService;
@Autowired
private IotFeign iotFeign;
private String topic;
private JSONObject jsonObject;
public ThreadCar(String topic, JSONObject jsonObject){
this.topic = topic;
this.jsonObject = jsonObject;
}
@Override
public void run() {
//toDo
// 获取最后一个有坐标的数据
JSONObject lastObj = null;
WlCarMileage last= null;
try {
Thread.sleep(600000);
//业务处理
//如果十分钟没有坐标,则需要设置结束标记
// 获取结束坐标
String measurement = topic.split("/")[0];
String deviceName = topic.split("/")[1];
String iotCode = measurement + deviceName;
last = iWlCarMileageService
.getOne(new LambdaQueryWrapper<WlCarMileage>().eq(WlCarMileage::getIotCode, iotCode)
.isNull(WlCarMileage::getEndLongitude).isNull(WlCarMileage::getEndLatitude)
.orderByDesc(WlCarMileage::getStartTime).last("limit 1"));
ResponseModel<List<Object>> result = iotFeign.getLiveData(measurement, deviceName,
last.getStartTime(), new Date(new Date().getTime() + 2000));
List<Object> list = result.getResult();
if (list != null && list.size() > 0) {
// 过滤空坐标
List<Object> filterList = new ArrayList<Object>();
for (int i = 0; i < list.size(); i++) {
JSONObject Obj = JSONObject.parseObject(JSONObject.toJSONString(list.get(i)));
if (Obj.get("FireCar_Longitude") != null && Obj.get("FireCar_Latitude") != null
&& Obj.getDoubleValue("FireCar_Longitude") != 0
&& Obj.getDoubleValue("FireCar_Latitude") != 0) {
filterList.add(list.get(i));
// 获取第一个不为空的坐标
if (lastObj == null) {
lastObj = Obj;
}
}
}
// JSONObject lastObj =
// JSONObject.parseObject(JSONObject.toJSONString(list.get(list.size() - 1)));
if (lastObj == null) {
lastObj = new JSONObject();
lastObj.put("FireCar_Longitude", 0.0);
lastObj.put("FireCar_Latitude", 0.0);
lastObj.put("time", 0);
lastObj.put("FireCar_Speed", 0);
}
double endLongitude = lastObj.getDoubleValue("FireCar_Longitude");
double endLatitude = lastObj.getDoubleValue("FireCar_Latitude");
// 230215180624
// Date endTime =UTCToCST(lastObj.getString("time"));
Date endTime = new Date(jsonObject.getLong("time"));
long takeTime = (endTime.getTime() / 1000 * 1000) - (last.getStartTime().getTime() / 1000 * 1000);
last.setEndLongitude(endLongitude);
last.setEndLatitude(endLatitude);
last.setEndTime(endTime);
last.setEndName(CarUtils.getAddress(endLongitude, endLatitude));
last.setEndSpeed(lastObj.getIntValue("FireCar_Speed"));
last.setTakeTime(takeTime);
double travel = 0.0;
// 获取里程
for (int i = 0; i < filterList.size() - 1; i++) {
JSONObject start = JSONObject.parseObject(JSONObject.toJSONString(filterList.get(i)));
JSONObject end = JSONObject.parseObject(JSONObject.toJSONString(filterList.get(i + 1)));
travel += CoordinateUtil.distance(start.getDoubleValue("FireCar_Latitude"),
start.getDoubleValue("FireCar_Longitude"), end.getDoubleValue("FireCar_Latitude"),
end.getDoubleValue("FireCar_Longitude"));
}
last.setTravel(new BigDecimal(travel / 1000).setScale(1, BigDecimal.ROUND_HALF_UP).doubleValue());
iWlCarMileageService.updateById(last);
this.interrupt();
}
} catch (Exception exception) {
iWlCarMileageService.updateById(last);
}
}
}
package com.yeejoin.equipmanage.utils;
import com.alibaba.fastjson.JSONObject;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
public class CarUtils {
private static final String GUIDE_KEY = "813684495d9a3981dd2c7694916fe404";
private static final String GUIDE_URL = "https://restapi.amap.com/v3/geocode/regeo?";
public static String getAddress(double longitude, double lantitude) {
StringBuilder api = new StringBuilder(GUIDE_URL);
api.append("key=").append(GUIDE_KEY).append("&location=").append(longitude).append(",").append(lantitude)
.append("&radius=1000").append("&batch=false").append("&extensions=base").append("&roadlevel=0")
.append("&batch=false");
StringBuilder res = new StringBuilder();
BufferedReader in = null;
try {
System.out.println(api.toString());
URL url = new URL(api.toString());
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setDoOutput(true);
conn.setRequestMethod("POST");
in = new BufferedReader(new InputStreamReader(conn.getInputStream(), "UTF-8"));
String line;
while ((line = in.readLine()) != null) {
res.append(line).append("\n");
}
JSONObject object = JSONObject.parseObject(res.toString());
System.out.println(object);
JSONObject regeocode = object.getJSONObject("regeocode");
String address = regeocode.getString("formatted_address");
if ("[]".equals(address)) {
System.out.println("===============无效坐标:" + longitude + "," + lantitude);
address = "无效坐标";
}
res = new StringBuilder(address);
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (in != null) {
in.close();
}
} catch (IOException e) {
e.printStackTrace();
}
}
return res.toString();
}
}
......@@ -4,7 +4,8 @@ import com.alibaba.fastjson.JSON;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.patrol.business.constants.XJConstant;
import com.yeejoin.amos.patrol.business.dto.CheckDto;
import com.yeejoin.amos.patrol.business.dao.mapper.CheckMapper;
import com.yeejoin.amos.patrol.business.dto.*;
import com.yeejoin.amos.patrol.business.param.CheckInfoPageParam;
import com.yeejoin.amos.patrol.business.param.CheckRecordParam;
import com.yeejoin.amos.patrol.business.param.CheckStatisticalParam;
......@@ -101,6 +102,15 @@ public class CheckController extends AbstractBaseController {
@Autowired
private WebMqttComponent webMqttComponent;
@Value("${patrol.message.create.topic}")
private String patrolRiskCreateTopic;
@Value("${patrol.center.risk.topic}")
private String riskTopic;
@Autowired
private CheckMapper checkMapper;
/**
*
* 巡查记录列表
......@@ -239,6 +249,9 @@ public class CheckController extends AbstractBaseController {
});
}
List<Map<String, Object>> checkInputItems = checkMapper.queryCheckInputItemsByCheckId(checkDto.getCheckId());
publishDataToMessage(checkInputItems);
is.pointCheckInfoPushToB(checkDto.getCheckId());
//数字换流站页面刷新
try {
......@@ -259,8 +272,36 @@ public class CheckController extends AbstractBaseController {
}
}
/**
* 巡检组装发送风险消息
* @param
*/
public void publishDataToMessage(List<Map<String, Object>> checkInputItems) {
for (Map<String, Object> map : checkInputItems) {
SendToMsgRiskDetailVo detailVo = new SendToMsgRiskDetailVo();
SendToMsgRiskEquipInfoVo equipInfoVo = new SendToMsgRiskEquipInfoVo();
SendToMsgRiskAlarmInfoVo alarmInfoVo = new SendToMsgRiskAlarmInfoVo();
equipInfoVo.setId(String.valueOf(map.get("id")));
equipInfoVo.setName(String.valueOf(map.get("inputItem")));
equipInfoVo.setCode(String.valueOf(map.get("item_no")));
equipInfoVo.setBizOrgCode(String.valueOf(map.get("biz_org_code")));
equipInfoVo.setBizOrgName(String.valueOf(map.get("biz_org_name")));
alarmInfoVo.setKey(String.valueOf(map.get("inputItem")));
alarmInfoVo.setValue(String.valueOf(map.get("input_value")));
TopicEntityVo topicEntityVo = new TopicEntityVo();
topicEntityVo.setTopic(riskTopic);
detailVo.setEquipInfo(equipInfoVo);
detailVo.setAlarmInfo(alarmInfoVo);
topicEntityVo.setData(JSON.toJSONString(detailVo));
try {
webMqttComponent.publish(patrolRiskCreateTopic, JSON.toJSONString(topicEntityVo));
} catch (Exception e) {
log.error("推送失败-----------" + e.getMessage());
}
}
}
/**
* 巡检计划查询
......
......@@ -277,4 +277,5 @@ public interface CheckMapper extends BaseMapper {
List<Map<String, Object>> selectCheckById(@Param(value = "taskId") Long taskId, @Param(value = "pointId") Long pointId);
List<Map<String, Object>> queryCheckInputItemsByCheckId(@Param(value="checkId") long checkId);
}
package com.yeejoin.amos.patrol.business.dto;
import lombok.Data;
/**
* @author keyong
* @title: SendToMsgRiskAlarmInfoVo
* <pre>
* @description: TODO
* </pre>
* @date 2023/5/22 15:24
*/
@Data
public class SendToMsgRiskAlarmInfoVo {
private String key;
private String value;
}
package com.yeejoin.amos.patrol.business.dto;
import lombok.Data;
/**
* @author keyong
* @title: SendToMsgRiskDetailVo
* <pre>
* @description: TODO
* </pre>
* @date 2023/5/22 15:16
*/
@Data
public class SendToMsgRiskDetailVo {
private SendToMsgRiskEquipInfoVo equipInfo;
private SendToMsgRiskAlarmInfoVo alarmInfo;
}
package com.yeejoin.amos.patrol.business.dto;
import lombok.Data;
/**
* @author keyong
* @title: SendToMsgRiskEquipInfoVo
* <pre>
* @description: TODO
* </pre>
* @date 2023/5/22 15:21
*/
@Data
public class SendToMsgRiskEquipInfoVo {
private String id;
private String name;
private String code;
private String bizOrgName;
private String bizOrgCode;
}
package com.yeejoin.amos.patrol.business.dto;
import io.swagger.annotations.ApiModel;
import lombok.Data;
/**
* @author keyong
* @title: TopicVo
* <pre>
* @description:
* </pre>
* @date 2020/11/13 9:15
*/
@Data
@ApiModel(description = "订阅主题Vo")
public class TopicEntityVo {
private String topic;
private String iotCode;
private String message;
private String data;
private String type;
// 若是车辆返回车牌号
private String code;
}
......@@ -45,6 +45,16 @@ public class CheckInfoVo {
@Excel(name = "备注说明", orderNum = "14")
private String remark;
private String bizOrgName;
public void setBizOrgName(String bizOrgName) {
this.bizOrgName = bizOrgName;
}
public String getBizOrgName() {
return bizOrgName;
}
public String getId() {
return id;
}
......
......@@ -2,6 +2,7 @@ package com.yeejoin;
import com.yeejoin.amos.boot.biz.common.utils.oConvertUtils;
import com.yeejoin.equipmanage.listener.CarIotListener;
import com.yeejoin.equipmanage.listener.CarIotNewListener;
import org.eclipse.paho.client.mqttv3.MqttException;
import org.mybatis.spring.annotation.MapperScan;
import org.slf4j.Logger;
......@@ -19,6 +20,7 @@ import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.FilterType;
import org.springframework.core.env.Environment;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.web.client.RestTemplate;
import org.typroject.tyboot.component.emq.EmqKeeper;
......@@ -46,10 +48,14 @@ public class AmostEquipApplication {
@Autowired
private EmqKeeper emqKeeper;
// @Autowired
// private CarIotListener carIotListener;
@Autowired
private CarIotListener carIotListener;
private CarIotNewListener carIotNewListener;
public static void main(String[] args) throws UnknownHostException {
public static void main(String[] args) throws UnknownHostException {
ConfigurableApplicationContext context = SpringApplication.run(AmostEquipApplication.class, args);
Environment env = context.getEnvironment();
String ip = InetAddress.getLocalHost().getHostAddress();
......@@ -74,6 +80,6 @@ public class AmostEquipApplication {
*/
@Bean
void initMqtt() throws MqttException {
emqKeeper.getMqttClient().subscribe("+/+/property", 1, carIotListener);
emqKeeper.getMqttClient().subscribe("+/+/property", 1, carIotNewListener);
}
}
......@@ -15,22 +15,22 @@ mybatis.type-aliases-package=com.yeejoin.equipmanage.common.entity
spring.jackson.time-zone=GMT+8
spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
#分页
#\u5206\u9875
pagehelper.helper-dialect=mysql
pagehelper.params=count=countSql
pagehelper.reasonable=false
pagehelper.support-methods-arguments=true
#覆盖相同名称bean
#\u8986\u76D6\u76F8\u540C\u540D\u79F0bean
spring.main.allow-bean-definition-overriding=true
#liquibase
spring.liquibase.change-log=classpath:/changelog/changelog-master.xml
spring.liquibase.enabled=true
#上传文件设置
#\u4E0A\u4F20\u6587\u4EF6\u8BBE\u7F6E
spring.servlet.multipart.maxFileSize=100MB
spring.servlet.multipart.maxRequestSize=100MB
#fegin调用服务名称
#fegin\u8C03\u7528\u670D\u52A1\u540D\u79F0
patrol.fegin.name=AMOS-PATROL
maintenance.feign.name=AMOS-MAINTENANCE-API
precontrol.feign.name=JEPCC-PRECONTROL-SERVER
......@@ -45,21 +45,21 @@ iot.vehicle.track=AMOS-API-IOT
jcs.fegin.name=JCS
video.fegin.name=VIDEO
idx.feign.name=AMOS-IDX
#项目初始化画布id
#\u9879\u76EE\u521D\u59CB\u5316\u753B\u5E03id
morphic.projectSeq=1390314016458514433
#wl_equipment_category 表id (取火灾报警系统id)
#wl_equipment_category \u8868id \uFF08\u53D6\u706B\u707E\u62A5\u8B66\u7CFB\u7EDFid\uFF09
equipment.fire.systemid=1302870628873932802
equipment.type=2
equipment.hierarchy=1,2,4,6
#装备查询根据装备类型编码过滤,4为过滤掉车相关数据,多个的话,添加方式为4,5
#\u88C5\u5907\u67E5\u8BE2\u6839\u636E\u88C5\u5907\u7C7B\u578B\u7F16\u7801\u8FC7\u6EE4\uFF0C4\u4E3A\u8FC7\u6EE4\u6389\u8F66\u76F8\u5173\u6570\u636E\uFF0C\u591A\u4E2A\u7684\u8BDD\uFF0C\u6DFB\u52A0\u65B9\u5F0F\u4E3A4,5
equipment.filter.code=4
#wl_equipment_category 编码 92040000 为消防行业 火灾系统分类编码
#wl_equipment_category \u7F16\u7801 92040000 \u4E3A\u6D88\u9632\u884C\u4E1A \u706B\u707E\u7CFB\u7EDF\u5206\u7C7B\u7F16\u7801
equip.system.alarm.code=92040000
#wl_equipment_category 编码 50000000 为安防行业 摄像头分类编码
#wl_equipment_category \u7F16\u7801 50000000 \u4E3A\u5B89\u9632\u884C\u4E1A \u6444\u50CF\u5934\u5206\u7C7B\u7F16\u7801
equip.security.code=50000000
## redis失效时间
## redis\u5931\u6548\u65F6\u95F4
redis.cache.failure.time=10800
#平台字典配置项
#\u5E73\u53F0\u5B57\u5178\u914D\u7F6E\u9879
systemctl.dict.iot-core-param=IOT_CORE_PARAM
systemctl.dict.area-type=AREA_TYPE
systemctl.dict.allow-operation=ALLOW_OPERATION
......@@ -75,14 +75,22 @@ mqtt.vehicle.topic=${equipManage.name}.vehicle.state
equip.point.equipmentdata.topic=${equipManage.name}.equipment.state
equip.index.topic=${equipManage.name}.equipment.index.state
equip.iot.monitor.topic=team/station/monitor/matrix
# 接口地址
# \u7AD9\u7AEFmessage\u76D1\u542C\u4E3B\u9898
equip.message.create.topic=emq.risk.created
# \u4E2D\u5FC3\u7EA7\u76D1\u542C\u4E3B\u9898
equip.center.risk.topic=equip/risk/trigger
patrol.center.risk.topic=patrol/risk/trigger
# \u4E2D\u5FC3\u7EA7\u53D1\u9001\u81F3\u98CE\u9669\u670D\u52A1\u6D88\u606F\u683C\u5F0F
equip.risk.model.topic=equip/data/analysis
# \u63A5\u53E3\u5730\u5740
equip.scene.detail.url=${server.servlet.context-path}/scene/%s/detail/list
equip.point.equipmentdata.url=${server.servlet.context-path}/equipSpecific/getAll?id=
equip.point.speindex.url=${server.servlet.context-path}/fire-fighting-system/getSpeIndex?id=
equip.point.equipmentDetail.url=${server.servlet.context-path}/equipSpecific/getOneCard?id=
#组态获取系统详情接口地址
#\u7EC4\u6001\u83B7\u53D6\u7CFB\u7EDF\u8BE6\u60C5\u63A5\u53E3\u5730\u5740
firefightingsystem.detail.url=${server.servlet.context-path}/fire-fighting-system/getSystemById?id=
#组态获取分页接口地址
#\u7EC4\u6001\u83B7\u53D6\u5206\u9875\u63A5\u53E3\u5730\u5740
firefightingsystem.equip.alarms.url=${server.servlet.context-path}/fire-fighting-system/getEquipmentAlarmBySystemIdOrSourceIdVO
building.detail=${server.servlet.context-path}/building/findByInstanceId
building.floor.detail=${server.servlet.context-path}/building/getBuildDetaliByFloorId?instanceId=
......@@ -93,15 +101,15 @@ dcs.token-key=dcs_token_key
dcs.client.secret=fire_system
dcs.x.hw.id=NR_REST_APP
dcs.x.hw.appKey=s+YkvQhwilx91TRJHhNDmw==
# 故障告警/消防告警/跑马灯权限标识 true 机场 / false 电力
# \u6545\u969C\u544A\u8B66/\u6D88\u9632\u544A\u8B66/\u8DD1\u9A6C\u706F\u6743\u9650\u6807\u8BC6 true \u673A\u573A / false \u7535\u529B
equip.enabled =false
#es储存物联日志是否删除开关
#es\u50A8\u5B58\u7269\u8054\u65E5\u5FD7\u662F\u5426\u5220\u9664\u5F00\u5173
es.ESEquiplistSpecific.flag= true
#es储存数据时间年
#es\u50A8\u5B58\u6570\u636E\u65F6\u95F4\u5E74
es.ESEquiplistSpecific.year= 1
#es储存物联日志定时删除
#es\u50A8\u5B58\u7269\u8054\u65E5\u5FD7\u5B9A\u65F6\u5220\u9664
es.ESEquiplistSpecific.time= 0 0 2 1 * ?
## ES properties:
biz.elasticsearch.address=172.16.11.201
......@@ -114,21 +122,21 @@ elasticsearch.password= Yeejoin@2020
# 权限标识-物联区域
# \u6743\u9650\u6807\u8BC6-\u7269\u8054\u533A\u57DF
auth-key-area=area_info
# 权限标识-消防系统
# \u6743\u9650\u6807\u8BC6-\u6D88\u9632\u7CFB\u7EDF
auth-key-fire-system=fire_system_info
# 权限标识-消防系统和建筑
# \u6743\u9650\u6807\u8BC6-\u6D88\u9632\u7CFB\u7EDF\u548C\u5EFA\u7B51
auth-key-fire-system-build=fire_system_build_info
# 权限标识-消防装备
# \u6743\u9650\u6807\u8BC6-\u6D88\u9632\u88C5\u5907
auth-key-fire-equip=fire_equip_info
# 权限标识-消防视频
# \u6743\u9650\u6807\u8BC6-\u6D88\u9632\u89C6\u9891
auth-key-fire-video=fire_video_info
# 权限标识-消防建筑视频
# \u6743\u9650\u6807\u8BC6-\u6D88\u9632\u5EFA\u7B51\u89C6\u9891
auth-key-fire-build-video=fire_build_video_info
# 权限标识-消防车辆
# \u6743\u9650\u6807\u8BC6-\u6D88\u9632\u8F66\u8F86
auth-key-fire-car=fire_car_info
# 权限标识-消防建筑
# \u6743\u9650\u6807\u8BC6-\u6D88\u9632\u5EFA\u7B51
auth-key-fire-building=fire_building_info
redis_car_type_count = carTypeAndCount
......@@ -136,10 +144,10 @@ redis_car_type_count = carTypeAndCount
redis_equip_type_count = equipTypeAndCount
emergency.disposal.indicators=emergencyDisposalIndicators
# 权限标识-物联装备
# \u6743\u9650\u6807\u8BC6-\u7269\u8054\u88C5\u5907
auth-key-fire-iot-equip=fire_iot-equip_info
# app离线同步装备数据开关
# app\u79BB\u7EBF\u540C\u6B65\u88C5\u5907\u6570\u636E\u5F00\u5173
auth-open-fire-equip=false
fxkgtId=1522051112935387138
......@@ -148,7 +156,7 @@ management.security.enabled=true
management.endpoint.health.show-details=always
spring.security.user.name=admin
spring.security.user.password=a1234560
#每個站表示
#\u6BCF\u500B\u7AD9\u8868\u793A
stationCode=LSHLZ1bZAJU645Pgl7
##代码中有部分逻辑冲突需要处理 为区分机场和电力逻辑 增加开关 若为true 则为机场逻辑 为false 则为电力逻辑
##\u4EE3\u7801\u4E2D\u6709\u90E8\u5206\u903B\u8F91\u51B2\u7A81\u9700\u8981\u5904\u7406 \u4E3A\u533A\u5206\u673A\u573A\u548C\u7535\u529B\u903B\u8F91 \u589E\u52A0\u5F00\u5173 \u82E5\u4E3Atrue \u5219\u4E3A\u673A\u573A\u903B\u8F91 \u4E3Afalse \u5219\u4E3A\u7535\u529B\u903B\u8F91
logic=false
\ No newline at end of file
......@@ -51,6 +51,10 @@ amosRefresh.danger.topic =patrolDangerInsertOrUpdate
amosRefresh.patrol.topic =patrolCheckInsert
patrol.point.classify.topic=patrol/point/classify
patrol.topic=patrol/#
# \u7AD9\u7AEFmessage\u76D1\u542C\u4E3B\u9898
patrol.message.create.topic=emq.risk.created
# \u4E2D\u5FC3\u7EA7\u76D1\u542C\u4E3B\u9898
patrol.center.risk.topic=patrol/risk/trigger
#\u505C\u6B62\u901A\u8FC7WEB\u516C\u5F00\u6240\u6709\u7AEF\u70B9
#management.endpoints.web.exposure.exclude=*
## redis\u5931\u6548\u65F6\u95F4
......
......@@ -20,7 +20,7 @@
<result property="planTaskId" column="plan_Task_Id"/>
<result property="catalogId" column="Catalog_Id"/>
<result property="depId" column="departmentId"/>
<result property="bizOrgName" column="bizOrgName"/>
</resultMap>
<!--统计-记录统计 -->
<select id="countCheckInfoData" resultType="long">
......@@ -272,7 +272,8 @@
a.`route_id`,
b.`catalog_id`,
a.error,
a.remark
a.remark,
b.biz_org_name AS bizOrgName
FROM
`p_check` `a`
LEFT JOIN `p_point` `b` ON `a`.`point_id` = `b`.`id`
......@@ -2177,4 +2178,32 @@
WHERE pc.plan_task_id = #{taskId} AND pc.point_id = #{pointId} AND pc.is_ok = 3
</select>
<select id="queryCheckInputItemsByCheckId" resultType="Map">
SELECT
c.id,
ii.item_no,
ii.NAME inputItem,
ci.input_value,
CASE ci.is_ok
WHEN 1 THEN
'合格'
WHEN 2 THEN
'不合格'
ELSE
'漏检'
END AS is_ok,
ii.biz_org_code,
ii.biz_org_name,
ci.score
FROM
p_check c,
p_check_input ci,
p_input_item ii
WHERE
c.id = ci.check_id
AND ii.id = ci.input_id
AND c.id = #{checkId}
ORDER BY
ci.order_no
</select>
</mapper>
\ No newline at end of file
......@@ -28,5 +28,10 @@
"code": "xf",
"emqTopic": "emq.xf.created",
"akkaTopic": "JKXT2BP-XF-Topic"
},
{
"code": "risk",
"emqTopic": "emq.risk.created",
"akkaTopic": "JKXT2BP-RISK-Topic"
}
]
\ No newline at end of file
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