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);
}
}
};
......
package com.yeejoin.equipmanage.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.equipmanage.common.response.Common3dResponse;
import com.yeejoin.equipmanage.common.response.Common3dResponseUtil;
import com.yeejoin.equipmanage.common.utils.CommonResponseUtil;
import com.yeejoin.equipmanage.common.vo.EquipFor3DVO;
import com.yeejoin.equipmanage.common.vo.EquipmentSpecific3dVo;
import com.yeejoin.equipmanage.common.vo.RetrieveParams;
import com.yeejoin.equipmanage.service.IAreaService;
import com.yeejoin.equipmanage.service.IEquipmentSpecificSerivce;
import com.yeejoin.equipmanage.service.IFireFightingSystemService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
/**
* @ProjectName: EquipManageRoot
* @Package: com.yeejoin.equipmanage.controller
* @ClassName: View3dController
* @Author: Jianqiang Gao
* @Description: 三维controller
* @Date: 2021/5/28 9:39
* @Version: 1.0
*/
@RestController
@RequestMapping("/api/view3d")
@Api(tags = "数字换流站")
public class View3dController extends AbstractBaseController {
@Autowired
private IFireFightingSystemService fireFightingSystemService;
@Lazy
@Autowired
private IEquipmentSpecificSerivce equipmentSpecificSerivce;
@Autowired
private IAreaService areaService;
@GetMapping(value = "/get3dFightingSystemList")
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "获取三维消防系统信息", notes = "获取三维消防系统信息")
public ResponseModel get3dFightingSystemList() {
return CommonResponseUtil.success(fireFightingSystemService.get3dFightingSystemList());
}
// @Permission
@GetMapping(value = "/get3dFightingSysEquipCount")
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "获取三维消防系统装备及统计信息", notes = "获取三维消防系统装备及统计信息")
public ResponseModel get3dFightingSysEquipCount(@RequestParam(name = "pageNum") String pageNum,
@RequestParam(name = "pageSize") String pageSize,
@RequestParam(name = "id") Long id,
@RequestParam(name = "status", required = false) Integer status,
@RequestParam(name = "name", required = false) String name) {
Map<String, Object> map = new HashMap<>();
// List<EquipmentSpecific3dVo> equipList = equipmentSpecificSerivce.get3dFightingSysEquipList(id, status, name);
List<LinkedHashMap> countMap = equipmentSpecificSerivce.get3dFightingSysEquipCount(id, status, name);
EquipFor3DVO equipment = new EquipFor3DVO(id, status, name);
map.put("equipList", this.listPage(pageNum, pageSize, equipment));
map.put("countMap", countMap);
return CommonResponseUtil.success(map);
}
public ResponseModel listPage(String pageNum, String pageSize, EquipFor3DVO equipment) {
Page<EquipmentSpecific3dVo> pageBean;
IPage<EquipmentSpecific3dVo> page;
if (StringUtils.isBlank(pageNum) || StringUtils.isBlank(pageSize)) {
pageBean = new Page<>(0, Long.MAX_VALUE);
} else {
pageBean = new Page<>(Integer.parseInt(pageNum), Integer.parseInt(pageSize));
}
page = equipmentSpecificSerivce.listPage(pageBean, equipment);
return CommonResponseUtil.success(page);
}
/**
* 获取指定层级区域树,起步2级树
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("获取指定层级区域树")
@GetMapping(value = "/getAreaTierTree")
public Common3dResponse getAreaTierTree(@RequestParam Integer tier) {
return Common3dResponseUtil.success(areaService.getAreaTierTree(tier));
}
@GetMapping(value = "/retrieve/all")
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "风险区域、物理区域设备部件列表查询", notes = "风险区域、物理区域设备部件列表查询")
public ResponseModel retrieveAll(@RequestBody RetrieveParams params) {
String orgCode = this.getOrgCode();
String token = this.getToken();
String appKey = this.getAppKey();
String product = this.getProduct();
// return view3dService.retrieveAll(params.getType(),
// params.getRiskSourceId(),
// params.getInputText(),
// params.getCurrent(),
// params.getPageSize(),
// orgCode,
// params.getDataLevel(),
// params.getProtectObjName(),
// token,appKey,product);
return null;
}
}
\ No newline at end of file
//package com.yeejoin.equipmanage.controller;
//
//import com.baomidou.mybatisplus.core.metadata.IPage;
//import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
//import com.yeejoin.equipmanage.common.response.Common3dResponse;
//import com.yeejoin.equipmanage.common.response.Common3dResponseUtil;
//import com.yeejoin.equipmanage.common.utils.CommonResponseUtil;
//import com.yeejoin.equipmanage.common.vo.EquipFor3DVO;
//import com.yeejoin.equipmanage.common.vo.EquipmentSpecific3dVo;
//import com.yeejoin.equipmanage.common.vo.RetrieveParams;
//import com.yeejoin.equipmanage.service.IAreaService;
//import com.yeejoin.equipmanage.service.IEquipmentSpecificSerivce;
//import com.yeejoin.equipmanage.service.IFireFightingSystemService;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
//import org.apache.commons.lang3.StringUtils;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.context.annotation.Lazy;
//import org.springframework.web.bind.annotation.*;
//import org.typroject.tyboot.core.foundation.enumeration.UserType;
//import org.typroject.tyboot.core.restful.doc.TycloudOperation;
//import org.typroject.tyboot.core.restful.utils.ResponseModel;
//
//import java.util.HashMap;
//import java.util.LinkedHashMap;
//import java.util.List;
//import java.util.Map;
//
///**
// * @ProjectName: EquipManageRoot
// * @Package: com.yeejoin.equipmanage.controller
// * @ClassName: View3dController
// * @Author: Jianqiang Gao
// * @Description: 三维controller
// * @Date: 2021/5/28 9:39
// * @Version: 1.0
// */
//@RestController
//@RequestMapping("/api/view3d")
//@Api(tags = "数字换流站")
//public cView3dController extends AbstractBaseController {
//
// @Autowired
// private IFireFightingSystemService fireFightingSystemService;
// @Lazy
// @Autowired
// private IEquipmentSpecificSerivce equipmentSpecificSerivce;
//
// @Autowired
// private IAreaService areaService;
//
// @GetMapping(value = "/get3dFightingSystemList")
// @TycloudOperation(ApiLevel = UserType.AGENCY)
// @ApiOperation(httpMethod = "GET", value = "获取三维消防系统信息", notes = "获取三维消防系统信息")
// public ResponseModel get3dFightingSystemList() {
// return CommonResponseUtil.success(fireFightingSystemService.get3dFightingSystemList());
// }
//
//// @Permission
// @GetMapping(value = "/get3dFightingSysEquipCount")
// @TycloudOperation(ApiLevel = UserType.AGENCY)
// @ApiOperation(httpMethod = "GET", value = "获取三维消防系统装备及统计信息", notes = "获取三维消防系统装备及统计信息")
// public ResponseModel get3dFightingSysEquipCount(@RequestParam(name = "pageNum") String pageNum,
// @RequestParam(name = "pageSize") String pageSize,
// @RequestParam(name = "id") Long id,
// @RequestParam(name = "status", required = false) Integer status,
// @RequestParam(name = "name", required = false) String name) {
// Map<String, Object> map = new HashMap<>();
//// List<EquipmentSpecific3dVo> equipList = equipmentSpecificSerivce.get3dFightingSysEquipList(id, status, name);
// List<LinkedHashMap> countMap = equipmentSpecificSerivce.get3dFightingSysEquipCount(id, status, name);
// EquipFor3DVO equipment = new EquipFor3DVO(id, status, name);
// map.put("equipList", this.listPage(pageNum, pageSize, equipment));
// map.put("countMap", countMap);
// return CommonResponseUtil.success(map);
// }
//
//
// public ResponseModel listPage(String pageNum, String pageSize, EquipFor3DVO equipment) {
// Page<EquipmentSpecific3dVo> pageBean;
// IPage<EquipmentSpecific3dVo> page;
// if (StringUtils.isBlank(pageNum) || StringUtils.isBlank(pageSize)) {
// pageBean = new Page<>(0, Long.MAX_VALUE);
// } else {
// pageBean = new Page<>(Integer.parseInt(pageNum), Integer.parseInt(pageSize));
// }
// page = equipmentSpecificSerivce.listPage(pageBean, equipment);
// return CommonResponseUtil.success(page);
// }
//
// /**
// * 获取指定层级区域树,起步2级树
// */
// @TycloudOperation(ApiLevel = UserType.AGENCY)
// @ApiOperation("获取指定层级区域树")
// @GetMapping(value = "/getAreaTierTree")
// public Common3dResponse getAreaTierTree(@RequestParam Integer tier) {
// return Common3dResponseUtil.success(areaService.getAreaTierTree(tier));
// }
//
// @GetMapping(value = "/retrieve/all")
// @TycloudOperation(ApiLevel = UserType.AGENCY)
// @ApiOperation(httpMethod = "GET", value = "风险区域、物理区域设备部件列表查询", notes = "风险区域、物理区域设备部件列表查询")
// public ResponseModel retrieveAll(@RequestBody RetrieveParams params) {
//
// String orgCode = this.getOrgCode();
// String token = this.getToken();
// String appKey = this.getAppKey();
// String product = this.getProduct();
//
//// return view3dService.retrieveAll(params.getType(),
//// params.getRiskSourceId(),
//// params.getInputText(),
//// params.getCurrent(),
//// params.getPageSize(),
//// orgCode,
//// params.getDataLevel(),
//// params.getProtectObjName(),
//// token,appKey,product);
//
// return null;
// }
//
//}
\ No newline at end of file
......@@ -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")
......
package com.yeejoin.equipmanage.listener;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yeejoin.equipmanage.common.entity.Car;
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.ICarService;
import com.yeejoin.equipmanage.service.IWlCarMileageService;
import com.yeejoin.equipmanage.thread.ThreadCar;
import org.eclipse.paho.client.mqttv3.MqttMessage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.typroject.tyboot.component.emq.EmqKeeper;
import org.typroject.tyboot.component.emq.EmqxListener;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigDecimal;
import java.net.HttpURLConnection;
import java.net.URL;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
@Component
public class CarIotNewListener extends EmqxListener {
@Autowired
private IWlCarMileageService iWlCarMileageService;
@Autowired
private ICarService iCarService;
@Autowired
private IotFeign iotFeign;
private final String GUIDE_KEY = "813684495d9a3981dd2c7694916fe404";
private final String GUIDE_URL = "https://restapi.amap.com/v3/geocode/regeo?";
@Autowired
private EmqKeeper emqkeeper;
private static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
// 用于根据topicId 也就是物联设备id 存储对应的线程来进行计时
private static HashMap<String, ThreadCar> deviceInfo = new HashMap();
@Override
public void processMessage(String topic, MqttMessage message) throws Exception {
JSONObject jsonObject = JSONObject.parseObject(message.toString());
//如果map中已经存在该设备或者该设备有但是线程已经执行了
if ((!deviceInfo.containsKey(topic)) || (deviceInfo.containsKey(topic) && deviceInfo.get(topic) == null)) {
ThreadCar threadCar = new ThreadCar(topic, jsonObject);
deviceInfo.put(topic, threadCar);
threadCar.start();
} else {
Long startTime = new Date().getTime();
Long endTime= jsonObject.getLong("time");
if((startTime-endTime) <=600000){
deviceInfo.get(topic).interrupt();
ThreadCar threadCar = new ThreadCar(topic, jsonObject);
deviceInfo.put(topic, threadCar);
threadCar.start();
}
}
if (jsonObject.containsKey("startUp") || jsonObject.containsKey("FireCar_Longitude")) {
System.out.println(topic);
System.out.println(message);
String measurement = topic.split("/")[0];
String deviceName = topic.split("/")[1];
String iotCode = measurement + deviceName;
if (jsonObject.containsKey("startUp")) {
if (jsonObject.getBooleanValue("startUp")) {
WlCarMileage wlCarMileage = new WlCarMileage();
wlCarMileage.setIotCode(iotCode);
wlCarMileage.setDate(new Date());
// 获取开始坐标
double startLongitude = jsonObject.getDoubleValue("FireCar_Longitude");
double startLatitude = jsonObject.getDoubleValue("FireCar_Latitude");
// String currentTime = "20"+jsonObject.getString("currentTime");
wlCarMileage.setStartLongitude(startLongitude);
wlCarMileage.setStartLatitude(startLatitude);
// Date startTime = UTCToCST();
Date startTime = new Date(jsonObject.getLong("time"));
wlCarMileage.setStartTime(startTime);
wlCarMileage.setStartName(getAddress(startLongitude, startLatitude));
wlCarMileage.setStartSpeed(jsonObject.getIntValue("FireCar_Speed"));
try {
iWlCarMileageService.save(wlCarMileage);
} catch (Exception e) {
e.printStackTrace();
iWlCarMileageService.save(wlCarMileage);
}
} else {
// 获取结束坐标
WlCarMileage 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) {
// 获取最后一个有坐标的数据
JSONObject lastObj = null;
// 过滤空坐标
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(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());
try {
iWlCarMileageService.updateById(last);
} catch (Exception e) {
iWlCarMileageService.updateById(last);
}
}
}
} else if (jsonObject.containsKey("FireCar_Longitude")) {
if (jsonObject.containsKey("FireCar_Longitude") && jsonObject.containsKey("FireCar_Latitude")) {
// 获取开始坐标
double startLongitude = jsonObject.getDoubleValue("FireCar_Longitude");
double startLatitude = jsonObject.getDoubleValue("FireCar_Latitude");
int direction = jsonObject.getIntValue("direction");
// 地图推送消息
Car car = iCarService.getOne(new LambdaQueryWrapper<Car>().eq(Car::getIotCode, iotCode));
if (car != null && startLongitude != 0 && startLatitude != 0) {
JSONArray sendArr = new JSONArray();
JSONObject sendObj = new JSONObject();
sendObj.put("id", String.valueOf(car.getId()));
sendObj.put("direction", direction);
sendObj.put("longitude", String.valueOf(startLongitude));
sendObj.put("latitude", String.valueOf(startLatitude));
sendObj.put("carNum", car.getCarNum());
sendObj.put("bizOrgName", car.getBizOrgName());
sendArr.add(sendObj);
MqttMessage mqttMessage = new MqttMessage();
mqttMessage.setPayload(sendArr.toJSONString().getBytes());
car.setLongitude(startLongitude);
car.setLatitude(startLatitude);
iCarService.updateById(car);
emqkeeper.getMqttClient().publish("car/location", mqttMessage);
}
}
}
}
}
public 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();
}
public Date UTCToCST(String UTCStr) throws ParseException {
Date date = sdf.parse(UTCStr);
System.out.println("UTC时间: " + date);
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
calendar.set(Calendar.HOUR, calendar.get(Calendar.HOUR) + 8);
return calendar.getTime();
}
}
......@@ -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;
/**
......
......@@ -161,6 +161,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
private String equipTypeAndCount;
@Autowired
@Lazy
IWlCarMileageService iWlCarMileageService;
@Override
......@@ -176,7 +177,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
@Override
public Map<String, Object> queryEquipmenInfoAndCount(String equimentName, String equimentCode, String construction,
String maintenance, String bizOrgCode, String formGroupId, int current, int pageSize, String controBoxBuildId,String companyId, String nameOrCode) {
String maintenance, String bizOrgCode, String formGroupId, int current, int pageSize, String controBoxBuildId, String companyId, String nameOrCode) {
Map<String, Object> map = equipmentManageService.queryEquipmenInfoAndCount(equimentName, equimentCode,
construction, maintenance, bizOrgCode, formGroupId, current, pageSize, controBoxBuildId, companyId, nameOrCode);
List<EquipmentManageVo> dataList = (List<EquipmentManageVo>) map.get("dataList");
......@@ -425,7 +426,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
// responses.add(p);
// });
// List<PointTreeVo> regionList = responses.stream().filter(r -> "TRUE".equals(r.getIsRegion())).collect(Collectors.toList());
if("dl".equals(type)){
if ("dl".equals(type)) {
FeignClientResult<List<OrgUsrDto>> feignClientResult = jcsFeignClient.getCompanyDeptListWithAuth(authKey, "COMPANY", "dl");
orgCode = feignClientResult.getResult().get(0).getBizOrgCode();
}
......@@ -1008,7 +1009,8 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
map.put("status", list1);
resList.add(map);
i++;
};
}
;
}
return resList;
}
......@@ -1033,7 +1035,8 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
map.put("realtimeValue", String.valueOf(m.get("realtimeValue")));
resList.add(map);
i++;
};
}
;
}
return resList;
}
......@@ -1229,7 +1232,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
syncDataService.saveOrUpdateEquipIotCodeRedisData(null);
EquipmentDetailController controllerProxy = SpringUtils.getBean(EquipmentDetailController.class);
controllerProxy.refreshCount(bizOrgCode);
}
}
return refreshEquipmentTypeAndCount(bizOrgCode);
}
......@@ -1443,6 +1446,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
public Map<String, Object> statisticsByStation(String bizOrgCode) {
return fireFightingSystemMapper.statisticsByStation(bizOrgCode);
}
@Override
public Map<String, Object> todayAlarmEquipment(String bizOrgCode) {
Map<String, Object> map = fireFightingSystemMapper.todayAlarmEquipment(bizOrgCode);
......@@ -1503,6 +1507,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
public Page<Map<String, Object>> equipList(Page page, String bizOrgCode) {
return fireFightingSystemMapper.equipList(page, bizOrgCode);
}
@Override
public BigScreenVo getSystemAlarmInfoNum(String companyCode) {
BigScreenVo bigScreenVo = new BigScreenVo();
......@@ -1567,13 +1572,13 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
ArrayList<Map<String, Object>> systemList = new ArrayList<>();
if (!CollectionUtils.isEmpty(system)) {
// 换流站信息
if (!ObjectUtils.isEmpty(system.get(0).get("stationName"))){
if (!ObjectUtils.isEmpty(system.get(0).get("stationName"))) {
map.put("station", system.get(0).get("stationName"));
}else {
} else {
map.put("station", "");
}
map.put("time", startDate.substring(0,7));
map.put("time", startDate.substring(0, 7));
// 单个系统数据
for (Map<String, Object> sys : system) {
HashMap<String, Object> systemData = new HashMap<>();
......@@ -1646,7 +1651,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
List<Map<String, Object>> pieChartList = fireFightingSystemMapper.selectMonthPieChart(String.valueOf(sys.get("code")), startDate, endDate);
List<Map<String, Object>> pieChartListTwo = fireFightingSystemMapper.selectMonthPieChartTwo(String.valueOf(sys.get("code")), startDate, endDate, indicatorList);
List<Map<String, Object>> selectMonthPolyline = fireFightingSystemMapper.selectMonthPolyline(String.valueOf(sys.get("code")), startDate, endDate, indicatorList);
List<Map<String, Object>> selectMonthPolyline = fireFightingSystemMapper.selectMonthPolyline(String.valueOf(sys.get("code")), startDate, endDate, indicatorList);
String pieChart = ChartsUtils.pieChart(pieChartList, "故障设备类型占比");
......@@ -1679,7 +1684,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
}
}else {
} else {
return null;
}
......@@ -1701,8 +1706,8 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
@Override
public String iotMonthReport(String bizOrgCode, String startDate, String endDate) {
Map<String, Object> DataMap = getData(bizOrgCode, startDate, endDate);
if (DataMap == null){
return null ;
if (DataMap == null) {
return null;
}
WordTemplateUtils instance = WordTemplateUtils.getInstance();
String pdfUrlString = "";
......@@ -1735,7 +1740,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
uploadFile.setUrl(pdfUrlString);
uploadFile.setFileType("image");
uploadFile.setObjectType("m-report");
long time = DateUtils.longStr2Date(startDate+" 00:00:00").getTime();
long time = DateUtils.longStr2Date(startDate + " 00:00:00").getTime();
uploadFile.setObjectId(time);
uploadFile.setName("换流站月总结分析报告");
uploadFile.setDepartmentOrgcode(bizOrgCode);
......@@ -1811,7 +1816,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
} else {
listItem.put("alarmEquipNum", String.valueOf(0));
}
// listItem.put("alarmEquipNum", ObjectUtils.isEmpty(weekItem.get("alarmEquipNum")) ? "" : String.valueOf(weekItem.get("alarmEquipNum")));
// listItem.put("alarmEquipNum", ObjectUtils.isEmpty(weekItem.get("alarmEquipNum")) ? "" : String.valueOf(weekItem.get("alarmEquipNum")));
// 7日告警条数
if (!ObjectUtils.isEmpty(weekItem.get("type_code")) && !ObjectUtils.isEmpty(weekItem.get("code"))) {
Integer integer = fireFightingSystemMapper.selectAlarms(valueOf(system.get("id")), valueOf(weekItem.get("type_code")), valueOf(weekItem.get("code")), startDate, endDate, indicatorList);
......@@ -1842,17 +1847,17 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
// } else {
// systemData.put("summarize", "");
// }
systemData.put("summarize", ObjectUtils.isEmpty(summarize.get("name"))?0:summarize.get("name")
+"设备总数"+(ObjectUtils.isEmpty(summarize.get("equipNum"))?0:summarize.get("equipNum"))
+"台,正常设备"+(ObjectUtils.isEmpty(summarize.get("normalNum"))?0:summarize.get("normalNum"))
+"台,正常率"+(ObjectUtils.isEmpty(summarize.get("normalRate"))?0:summarize.get("normalRate"))
+"%,故障设备"+(ObjectUtils.isEmpty(summarize.get("faultNum"))?0:summarize.get("faultNum"))
+"台,故障率为"+(ObjectUtils.isEmpty(summarize.get("faultRate"))?0:summarize.get("faultRate"))
+"%,七日告警设备为"+(ObjectUtils.isEmpty(summarize.get("exepctionNum"))?0:summarize.get("exepctionNum"))
+"台,同比上周"+(ObjectUtils.isEmpty(summarize.get("status1"))?"增加":summarize.get("status1"))+(ObjectUtils.isEmpty(summarize.get("exepctionWOW"))?0:summarize.get("exepctionWOW"))
+"%,七日告警总数为"+(ObjectUtils.isEmpty(summarize.get("alarmNum"))?0:summarize.get("alarmNum"))
+"条,同比上周"+(ObjectUtils.isEmpty(summarize.get("status2"))?"增加":summarize.get("status2"))+(ObjectUtils.isEmpty(summarize.get("alarmWOW"))?0:summarize.get("alarmWOW"))
+"%。"
systemData.put("summarize", ObjectUtils.isEmpty(summarize.get("name")) ? 0 : summarize.get("name")
+ "设备总数" + (ObjectUtils.isEmpty(summarize.get("equipNum")) ? 0 : summarize.get("equipNum"))
+ "台,正常设备" + (ObjectUtils.isEmpty(summarize.get("normalNum")) ? 0 : summarize.get("normalNum"))
+ "台,正常率" + (ObjectUtils.isEmpty(summarize.get("normalRate")) ? 0 : summarize.get("normalRate"))
+ "%,故障设备" + (ObjectUtils.isEmpty(summarize.get("faultNum")) ? 0 : summarize.get("faultNum"))
+ "台,故障率为" + (ObjectUtils.isEmpty(summarize.get("faultRate")) ? 0 : summarize.get("faultRate"))
+ "%,七日告警设备为" + (ObjectUtils.isEmpty(summarize.get("exepctionNum")) ? 0 : summarize.get("exepctionNum"))
+ "台,同比上周" + (ObjectUtils.isEmpty(summarize.get("status1")) ? "增加" : summarize.get("status1")) + (ObjectUtils.isEmpty(summarize.get("exepctionWOW")) ? 0 : summarize.get("exepctionWOW"))
+ "%,七日告警总数为" + (ObjectUtils.isEmpty(summarize.get("alarmNum")) ? 0 : summarize.get("alarmNum"))
+ "条,同比上周" + (ObjectUtils.isEmpty(summarize.get("status2")) ? "增加" : summarize.get("status2")) + (ObjectUtils.isEmpty(summarize.get("alarmWOW")) ? 0 : summarize.get("alarmWOW"))
+ "%。"
);
......@@ -1861,16 +1866,16 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
ArrayList<Map<String, Object>> mapList = new ArrayList<>();
HashMap<String, Object> dayEchartsDate = new HashMap<>();
dayEchartsDate.put("type","正常设备");
dayEchartsDate.put("value",ObjectUtils.isEmpty(summarize.get("normalNum"))?0:summarize.get("normalNum"));
dayEchartsDate.put("type", "正常设备");
dayEchartsDate.put("value", ObjectUtils.isEmpty(summarize.get("normalNum")) ? 0 : summarize.get("normalNum"));
mapList.add(dayEchartsDate);
HashMap<String, Object> dayEchartsDate1 = new HashMap<>();
dayEchartsDate1.put("type","异常设备");
if (!ObjectUtils.isEmpty(summarize.get("equipNum")) || !ObjectUtils.isEmpty(summarize.get("normalNum"))){
dayEchartsDate1.put("value",Integer.parseInt(String.valueOf(summarize.get("equipNum")))
-Integer.parseInt(String.valueOf(summarize.get("normalNum"))));
}else {
dayEchartsDate1.put("value",0);
dayEchartsDate1.put("type", "异常设备");
if (!ObjectUtils.isEmpty(summarize.get("equipNum")) || !ObjectUtils.isEmpty(summarize.get("normalNum"))) {
dayEchartsDate1.put("value", Integer.parseInt(String.valueOf(summarize.get("equipNum")))
- Integer.parseInt(String.valueOf(summarize.get("normalNum"))));
} else {
dayEchartsDate1.put("value", 0);
}
mapList.add(dayEchartsDate1);
String pieChart1 = ChartsUtils.pieChart(mapList, "告警设备占比");
......@@ -1891,8 +1896,8 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
}
}else {
return null;
} else {
return null;
}
......@@ -1935,7 +1940,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
uploadFile.setUrl(pdfUrlString);
uploadFile.setFileType("image");
uploadFile.setObjectType("w-report");
long time = DateUtils.longStr2Date(startDate+" 00:00:00").getTime();
long time = DateUtils.longStr2Date(startDate + " 00:00:00").getTime();
uploadFile.setObjectId(time);
uploadFile.setName("换流站周总结分析报告");
uploadFile.setDepartmentOrgcode(bizOrgCode);
......@@ -2012,13 +2017,13 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
} else {
listItem.put("trueNum", String.valueOf(0));
}
if (!ObjectUtils.isEmpty(weekItem.get("type_code")) && String.valueOf(weekItem.get("type_code")).endsWith("Fault")){
if (!ObjectUtils.isEmpty(binMap) && !ObjectUtils.isEmpty(listItem.get("name")) && binMap.containsKey(String.valueOf(listItem.get("name")))){
if (!ObjectUtils.isEmpty(weekItem.get("type_code")) && String.valueOf(weekItem.get("type_code")).endsWith("Fault")) {
if (!ObjectUtils.isEmpty(binMap) && !ObjectUtils.isEmpty(listItem.get("name")) && binMap.containsKey(String.valueOf(listItem.get("name")))) {
int newValue = Integer.parseInt(String.valueOf(listItem.get("alarmEquipNum")));
int oldValue = Integer.parseInt(String.valueOf(binMap.get(String.valueOf(listItem.get("name")))));
binMap.put(String.valueOf(listItem.get("name")),newValue + oldValue);
}else {
binMap.put(String.valueOf(listItem.get("name")),listItem.get("alarmEquipNum"));
binMap.put(String.valueOf(listItem.get("name")), newValue + oldValue);
} else {
binMap.put(String.valueOf(listItem.get("name")), listItem.get("alarmEquipNum"));
}
}
......@@ -2053,27 +2058,27 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
// } else {
// systemData.put("summarize", "");
// }
systemData.put("summarize", ObjectUtils.isEmpty(summarize.get("name"))?0:summarize.get("name")+"设备总数"+(ObjectUtils.isEmpty(summarize.get("equipNum"))?0:summarize.get("equipNum"))
+"台,今日告警设备为"+(ObjectUtils.isEmpty(summarize.get("dayNum"))?0:summarize.get("dayNum"))+"台,告警总数为"+(ObjectUtils.isEmpty(summarize.get("alarmNum"))?0:summarize.get("alarmNum"))+
"条,正常设备"+(ObjectUtils.isEmpty(summarize.get("normalNum"))?0:summarize.get("normalNum"))+"台,正常率"+(ObjectUtils.isEmpty(summarize.get("normalRate"))?0:summarize.get("normalRate"))+"%");
systemData.put("summarize", ObjectUtils.isEmpty(summarize.get("name")) ? 0 : summarize.get("name") + "设备总数" + (ObjectUtils.isEmpty(summarize.get("equipNum")) ? 0 : summarize.get("equipNum"))
+ "台,今日告警设备为" + (ObjectUtils.isEmpty(summarize.get("dayNum")) ? 0 : summarize.get("dayNum")) + "台,告警总数为" + (ObjectUtils.isEmpty(summarize.get("alarmNum")) ? 0 : summarize.get("alarmNum")) +
"条,正常设备" + (ObjectUtils.isEmpty(summarize.get("normalNum")) ? 0 : summarize.get("normalNum")) + "台,正常率" + (ObjectUtils.isEmpty(summarize.get("normalRate")) ? 0 : summarize.get("normalRate")) + "%");
// echarts 图表
List<Map<String, Object>> mapList = fireFightingSystemMapper.selectDayEquipEchart(valueOf(system.get("code")), startDate, endDate);
String pieChart1 = ChartsUtils.pieChart(alarmMapList, "故障设备类型占比");
// List<Map<String, Object>> dayEcharts = fireFightingSystemMapper.selectDayEchart(valueOf(system.get("id")), startDate, indicatorList);
// List<Map<String, Object>> dayEcharts = fireFightingSystemMapper.selectDayEchart(valueOf(system.get("id")), startDate, indicatorList);
ArrayList<Map<String, Object>> dayEchart = new ArrayList<>();
HashMap<String, Object> dayEchartsDate = new HashMap<>();
dayEchartsDate.put("type","正常设备");
dayEchartsDate.put("value",ObjectUtils.isEmpty(summarize.get("normalNum"))?0:summarize.get("normalNum"));
dayEchartsDate.put("type", "正常设备");
dayEchartsDate.put("value", ObjectUtils.isEmpty(summarize.get("normalNum")) ? 0 : summarize.get("normalNum"));
dayEchart.add(dayEchartsDate);
HashMap<String, Object> dayEchartsDate1 = new HashMap<>();
dayEchartsDate1.put("type","异常设备");
if (!ObjectUtils.isEmpty(summarize.get("equipNum")) || !ObjectUtils.isEmpty(summarize.get("normalNum"))){
dayEchartsDate1.put("value",Integer.parseInt(String.valueOf(summarize.get("equipNum")))
-Integer.parseInt(String.valueOf(summarize.get("normalNum"))));
}else {
dayEchartsDate1.put("value",0);
dayEchartsDate1.put("type", "异常设备");
if (!ObjectUtils.isEmpty(summarize.get("equipNum")) || !ObjectUtils.isEmpty(summarize.get("normalNum"))) {
dayEchartsDate1.put("value", Integer.parseInt(String.valueOf(summarize.get("equipNum")))
- Integer.parseInt(String.valueOf(summarize.get("normalNum"))));
} else {
dayEchartsDate1.put("value", 0);
}
dayEchart.add(dayEchartsDate1);
......@@ -2089,8 +2094,8 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
}
}else {
return null ;
} else {
return null;
}
......@@ -2100,7 +2105,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
@Override
public String iotDayReport(String bizOrgCode, String startDate, String endDate) {
Map<String, Object> dataMap = getDayData(bizOrgCode, startDate, endDate);
if (dataMap == null){
if (dataMap == null) {
return null;
}
WordTemplateUtils instance = WordTemplateUtils.getInstance();
......@@ -2133,8 +2138,8 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
uploadFile.setUrl(pdfUrlString);
uploadFile.setFileType("image");
uploadFile.setObjectType("d-report");
long time = DateUtils.longStr2Date(startDate+" 00:00:00").getTime();
// DateUtils.getCurrentDayStartTime(new Date()).getTime();
long time = DateUtils.longStr2Date(startDate + " 00:00:00").getTime();
// DateUtils.getCurrentDayStartTime(new Date()).getTime();
uploadFile.setObjectId(time);
uploadFile.setName("换流站日总结分析报告");
uploadFile.setDepartmentOrgcode(bizOrgCode);
......@@ -2269,8 +2274,8 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
}
@Override
public Map<String,Object> getSystemDetailByCode(String systemCode) {
Map<String,Object> map = new HashMap<>();
public Map<String, Object> getSystemDetailByCode(String systemCode) {
Map<String, Object> map = new HashMap<>();
LambdaQueryWrapper<FireFightingSystemEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(FireFightingSystemEntity::getCode, systemCode);
List<FireFightingSystemEntity> systemEntities = this.list(wrapper);
......@@ -2286,27 +2291,27 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
} else {
map.put("systemStatus", true);
}
map.put("name",systemEntities.get(0).getName());
map.put("code",systemEntities.get(0).getCode());
map.put("installDate",systemEntities.get(0).getInstallDate());
map.put("chargePersonPhone",systemEntities.get(0).getChargePersonPhone());
map.put("chargePersonName",systemEntities.get(0).getChargePersonName());
map.put("designOrg",systemEntities.get(0).getDesignOrg());
map.put("designOrgTelephone",systemEntities.get(0).getDesignOrgTelephone());
map.put("leadDesigner",systemEntities.get(0).getLeadDesigner());
map.put("name", systemEntities.get(0).getName());
map.put("code", systemEntities.get(0).getCode());
map.put("installDate", systemEntities.get(0).getInstallDate());
map.put("chargePersonPhone", systemEntities.get(0).getChargePersonPhone());
map.put("chargePersonName", systemEntities.get(0).getChargePersonName());
map.put("designOrg", systemEntities.get(0).getDesignOrg());
map.put("designOrgTelephone", systemEntities.get(0).getDesignOrgTelephone());
map.put("leadDesigner", systemEntities.get(0).getLeadDesigner());
Long num = this.baseMapper.selectEquipCountBySystemId(systemEntities.get(0).getId());
String systemType = this.baseMapper.selectEquipSystemType(systemCode);
map.put("systemType",systemType);
map.put("num",num);
map.put("systemType", systemType);
map.put("num", num);
return map;
}
public static List<OrgMenuDto> systemAndEquipmentTree(List<Map<String,Object>> list) {
public static List<OrgMenuDto> systemAndEquipmentTree(List<Map<String, Object>> list) {
List<OrgMenuDto> menuList = list.stream()
.map(o -> new OrgMenuDto(Long.parseLong(o.get("id").toString()), o.get("name").toString(),
ObjectUtils.isEmpty(o.get("parentId")) ? 0L : Long.parseLong(o.get("parentId").toString()),
ObjectUtils.isEmpty(o.get("code")) ? "": o.get("code").toString(),
ObjectUtils.isEmpty(o.get("code")) ? "" : o.get("code").toString(),
false, o.get("bizOrgCode").toString()))
.collect(Collectors.toList());
List<OrgMenuDto> result = new ArrayList<>();
......
......@@ -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