Merge branch 'master' into 重构/1078
# Conflicts: # pom.xml # src/main/java/com/genersoft/iot/vmp/gb28181/bean/CommonGBChannel.java # src/main/java/com/genersoft/iot/vmp/jt1078/codec/decode/Jt808Decoder.java # src/main/java/com/genersoft/iot/vmp/jt1078/codec/netty/Jt808Handler.java # src/main/java/com/genersoft/iot/vmp/jt1078/codec/netty/TcpServer.java # src/main/java/com/genersoft/iot/vmp/jt1078/proc/request/Re.java # src/main/java/com/genersoft/iot/vmp/media/service/IMediaNodeServerService.java # src/main/java/com/genersoft/iot/vmp/media/service/IMediaServerService.java # src/main/java/com/genersoft/iot/vmp/media/service/impl/MediaServerServiceImpl.java # src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMMediaNodeServerService.java # src/main/java/com/genersoft/iot/vmp/service/impl/MediaServiceImpl.java # src/main/java/com/genersoft/iot/vmp/utils/CivilCodeUtil.java # src/main/resources/application.yml # web_src/src/layout/UiHeader.vue # web_src/src/router/index.js
This commit is contained in:
@@ -1,18 +1,19 @@
|
||||
package com.genersoft.iot.vmp.utils;
|
||||
|
||||
import com.genersoft.iot.vmp.common.CivilCodePo;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import com.genersoft.iot.vmp.gb28181.bean.Region;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
@Slf4j
|
||||
public enum CivilCodeUtil {
|
||||
|
||||
INSTANCE;
|
||||
private final static Logger log = LoggerFactory.getLogger(CivilCodeUtil.class);
|
||||
|
||||
// 用与消息的缓存
|
||||
private final Map<String, CivilCodePo> civilCodeMap = new ConcurrentHashMap<>();
|
||||
|
||||
@@ -27,6 +28,10 @@ public enum CivilCodeUtil {
|
||||
}
|
||||
}
|
||||
|
||||
public void add(CivilCodePo civilCodePo) {
|
||||
civilCodeMap.put(civilCodePo.getCode(), civilCodePo);
|
||||
}
|
||||
|
||||
public CivilCodePo get(String code) {
|
||||
return civilCodeMap.get(code);
|
||||
}
|
||||
@@ -50,4 +55,49 @@ public enum CivilCodeUtil {
|
||||
return civilCodeMap.get(parentCode);
|
||||
}
|
||||
}
|
||||
|
||||
public CivilCodePo getCivilCodePo(String code) {
|
||||
if (code.length() > 8) {
|
||||
return null;
|
||||
}else {
|
||||
return civilCodeMap.get(code);
|
||||
}
|
||||
}
|
||||
|
||||
public List<CivilCodePo> getAllParentCode(String civilCode) {
|
||||
List<CivilCodePo> civilCodePoList = new ArrayList<>();
|
||||
CivilCodePo parentCode = getParentCode(civilCode);
|
||||
if (parentCode != null) {
|
||||
civilCodePoList.add(parentCode);
|
||||
List<CivilCodePo> allParentCode = getAllParentCode(parentCode.getCode());
|
||||
if (!allParentCode.isEmpty()) {
|
||||
civilCodePoList.addAll(allParentCode);
|
||||
}else {
|
||||
return civilCodePoList;
|
||||
}
|
||||
}
|
||||
return civilCodePoList;
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return civilCodeMap.isEmpty();
|
||||
}
|
||||
|
||||
public int size() {
|
||||
return civilCodeMap.size();
|
||||
}
|
||||
|
||||
public List<Region> getAllChild(String parent) {
|
||||
List<Region> result = new ArrayList<>();
|
||||
for (String key : civilCodeMap.keySet()) {
|
||||
if (parent == null) {
|
||||
if (ObjectUtils.isEmpty(civilCodeMap.get(key).getParentCode().trim())) {
|
||||
result.add(Region.getInstance(key, civilCodeMap.get(key).getName(), civilCodeMap.get(key).getParentCode()));
|
||||
}
|
||||
}else if (civilCodeMap.get(key).getParentCode().equals(parent)) {
|
||||
result.add(Region.getInstance(key, civilCodeMap.get(key).getName(), civilCodeMap.get(key).getParentCode()));
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,18 +1,13 @@
|
||||
package com.genersoft.iot.vmp.utils;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.OutputStream;
|
||||
import java.net.Socket;
|
||||
import com.genersoft.iot.vmp.gb28181.bean.BaiduPoint;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.util.Base64;
|
||||
|
||||
import com.genersoft.iot.vmp.gb28181.bean.BaiduPoint;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@Slf4j
|
||||
public class GpsUtil {
|
||||
|
||||
private static Logger logger = LoggerFactory.getLogger(GpsUtil.class);
|
||||
|
||||
public static BaiduPoint Wgs84ToBd09(String xx, String yy) {
|
||||
|
||||
|
||||
@@ -1,16 +1,14 @@
|
||||
package com.genersoft.iot.vmp.utils;
|
||||
|
||||
import com.genersoft.iot.vmp.media.zlm.ZLMHttpHookListener;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import oshi.SystemInfo;
|
||||
import oshi.hardware.*;
|
||||
import oshi.hardware.CentralProcessor;
|
||||
import oshi.hardware.GlobalMemory;
|
||||
import oshi.hardware.HardwareAbstractionLayer;
|
||||
import oshi.hardware.NetworkIF;
|
||||
import oshi.software.os.OperatingSystem;
|
||||
import oshi.util.FormatUtil;
|
||||
|
||||
import java.io.File;
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@@ -22,10 +20,9 @@ import java.util.concurrent.TimeUnit;
|
||||
* 版权声明:本文为xiaozhangnomoney原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明
|
||||
* 原文出处链接:https://blog.csdn.net/xiaozhangnomoney/article/details/107769147
|
||||
*/
|
||||
@Slf4j
|
||||
public class SystemInfoUtils {
|
||||
|
||||
private final static Logger logger = LoggerFactory.getLogger(SystemInfoUtils.class);
|
||||
|
||||
/**
|
||||
* 获取cpu信息
|
||||
* @return
|
||||
@@ -78,7 +75,7 @@ public class SystemInfoUtils {
|
||||
try {
|
||||
Thread.sleep(1000);
|
||||
} catch (InterruptedException e) {
|
||||
logger.error("[线程休眠失败] : {}", e.getMessage());
|
||||
log.error("[线程休眠失败] : {}", e.getMessage());
|
||||
}
|
||||
List<NetworkIF> afterNetworkIFs = hal.getNetworkIFs();
|
||||
NetworkIF afterNet = afterNetworkIFs.get(afterNetworkIFs.size() - 1);
|
||||
|
||||
@@ -4,9 +4,8 @@ import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.node.ObjectNode;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
@@ -17,9 +16,9 @@ import java.util.Objects;
|
||||
* @version 1.0
|
||||
* @date 2022/3/11 10:17
|
||||
*/
|
||||
@Slf4j
|
||||
public class UJson {
|
||||
|
||||
private static Logger logger = LoggerFactory.getLogger(UJson.class);
|
||||
public static final ObjectMapper JSON_MAPPER = new ObjectMapper();
|
||||
|
||||
static {
|
||||
@@ -39,7 +38,7 @@ public class UJson {
|
||||
try {
|
||||
this.node = JSON_MAPPER.readValue(json, ObjectNode.class);
|
||||
}catch (Exception e){
|
||||
logger.error(e.getMessage(), e);
|
||||
log.error(e.getMessage(), e);
|
||||
this.node = JSON_MAPPER.createObjectNode();
|
||||
}
|
||||
}
|
||||
@@ -90,7 +89,7 @@ public class UJson {
|
||||
try {
|
||||
return JSON_MAPPER.readValue(json, clazz);
|
||||
}catch (Exception e){
|
||||
logger.error(e.getMessage(), e);
|
||||
log.error(e.getMessage(), e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -99,7 +98,7 @@ public class UJson {
|
||||
try{
|
||||
return JSON_MAPPER.writeValueAsString(object);
|
||||
}catch (Exception e){
|
||||
logger.error(e.getMessage(), e);
|
||||
log.error(e.getMessage(), e);
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user