Browse Source

感知与交通事件主子类转换

develop
wangsixiang 8 months ago
parent
commit
6255a4a5b9
  1. 22
      zc-business/src/main/java/com/zc/business/enums/ValueConverter.java
  2. 9
      zc-business/src/main/java/com/zc/business/service/impl/DcWarningServiceImpl.java

22
zc-business/src/main/java/com/zc/business/enums/ValueConverter.java

@ -18,7 +18,7 @@ public class ValueConverter {
// 静态映射,用于存储转换关系 事件主类转换
private static final Map<Integer, Integer> valueMappingHost = new HashMap<>();
// 静态映射,用于存储转换关系 事件子类转换
// 静态映射,用于存储转换关系 事件子类转换(注:子类7和10子类不能转需要前端自传)
private static final Map<String, String> valueMappingSon = new HashMap<>();
// 静态映射,用于存储转换关系 事件源转换
private static final Map<Integer, Integer> valueMappingSource = new HashMap<>();
@ -36,9 +36,12 @@ public class ValueConverter {
valueMappingHost.put(4, 2);
valueMappingHost.put(5, 11);
valueMappingHost.put(6, 6);
valueMappingHost.put(7, 6);
valueMappingHost.put(7, 7);
valueMappingHost.put(8, 10);
valueMappingHost.put(9, 1);
valueMappingHost.put(10, 1);
valueMappingHost.put(11, 2);
valueMappingHost.put(99, 11);
valueMappingSon.put("1-1", "4-1");
valueMappingSon.put("1-2", "4-1");
valueMappingSon.put("2-1", "5-1");
@ -55,9 +58,18 @@ public class ValueConverter {
valueMappingSon.put("4-7", "2-1");
valueMappingSon.put("4-8", "2-1");
valueMappingSon.put("4-9", "2-1");
valueMappingSon.put("4-10", "2-1");
valueMappingSon.put("5-1", "11-1");
valueMappingSon.put("5-2", "11-1");
valueMappingSon.put("5-3", "11-1");
valueMappingSon.put("5-4", "11-1");
valueMappingSon.put("5-5", "11-1");
valueMappingSon.put("5-6", "11-1");
valueMappingSon.put("5-7", "11-1");
valueMappingSon.put("6-1", "6-1");
valueMappingSon.put("7-1", "6-3");
valueMappingSon.put("6-2", "6-5");
valueMappingSon.put("6-3", "6-5");
valueMappingSon.put("6-4", "6-3");
valueMappingSon.put("8-1", "10-1");
valueMappingSon.put("8-2", "10-9");
valueMappingSon.put("8-3", "10-4");
@ -71,6 +83,10 @@ public class ValueConverter {
valueMappingSon.put("9-1", "1-3");
valueMappingSon.put("9-2", "1-3");
valueMappingSon.put("9-3", "1-3");
valueMappingSon.put("11-1", "2-1");
valueMappingSon.put("11-2", "2-1");
valueMappingSon.put("11-3", "2-1");
valueMappingSon.put("99-1", "11-1");
}
}

9
zc-business/src/main/java/com/zc/business/service/impl/DcWarningServiceImpl.java

@ -146,8 +146,13 @@ public class DcWarningServiceImpl implements IDcWarningService
if (dcWarning.getWarningType()!=null) {
dcEvent.setEventType((long) ValueConverter.convertValueHost(dcWarning.getWarningType()));//事件主类
}
if (StringUtils.isBlank(dcWarning.getWarningSubclass())) {
dcEvent.setEventSubclass(ValueConverter.convertValueSon(dcWarning.getWarningSubclass()));//事件子类
if (StringUtils.isBlank(dcWarning.getWarningSubclass())&&dcWarning.getWarningType()!=7&&
dcWarning.getWarningType()!=10) {
dcEvent.setEventSubclass(ValueConverter.convertValueSon(dcWarning.getWarningSubclass()));//事件子类(7与10不转)
}
if (StringUtils.isBlank(dcWarning.getWarningSubclass())&&dcWarning.getWarningType()==7||
dcWarning.getWarningType()==10){
dcEvent.setEventSubclass(dcWarning.getWarningSubclass());//事件子类(7与10主类对应的子类直接set)
}
dcEvent.setEventTitle(dcWarning.getWarningTitle());//标题
dcEvent.setLang(dcWarning.getLane());//车道

Loading…
Cancel
Save