|
@@ -191,7 +191,7 @@ public class CanalScheduling implements Runnable, ApplicationContextAware {
|
|
|
if (!StrUtil.equalsAnyIgnoreCase(table,
|
|
|
"ship_recognition",
|
|
|
"ship_snap_address",
|
|
|
- "alert",
|
|
|
+ "common_record",
|
|
|
"monitor_point",
|
|
|
"device",
|
|
|
"illegal_ship",
|
|
@@ -289,43 +289,6 @@ public class CanalScheduling implements Runnable, ApplicationContextAware {
|
|
|
CacheConstants.DEVICE_STATIC,
|
|
|
CacheConstants.DEVICE_TYPE_STATIC,
|
|
|
CacheConstants.DEVICE_LIST_STATIC));
|
|
|
- } else if (StrUtil.equalsIgnoreCase(database, "ship") && StrUtil.equalsIgnoreCase(table, "alert")) {
|
|
|
- // 船舶记录
|
|
|
- if ("prod".equals(env)) {
|
|
|
- AisShipInfo shipInfo = aisInfoService.getShipInfo("", Convert.toStr(afterDataMap.get("mmsi")), "", "");
|
|
|
- if (shipInfo != null) {
|
|
|
- afterDataMap.put("shipName", shipInfo.getShipName());
|
|
|
- afterDataMap.put("shipRegionType", shipInfo.getShipRegionType());
|
|
|
- }
|
|
|
- }
|
|
|
- // 判断是否大于阈值
|
|
|
- if (ObjectUtil.isNotEmpty(afterDataMap.get("so2Percent")) && NumberUtil.isGreaterOrEqual(Convert.toBigDecimal(afterDataMap.get("so2Percent")), Convert.toBigDecimal(so2ThresholdVal))) {
|
|
|
- // 查询检测点和船舶信息、船舶进出港记录
|
|
|
- ShipEepReportRecInfo eepReportRecInfo = aisInfoService.getShipEepReportRecInfo(DateUtil.formatDate(DateUtil.offsetDay(new Date(), -20)), DateUtil.formatDate(DateUtil.tomorrow()), Convert.toStr(afterDataMap.get("mmsi")), "", "");
|
|
|
- if (eepReportRecInfo != null) {
|
|
|
- afterDataMap.put("destination", eepReportRecInfo.getNextPortName());
|
|
|
- afterDataMap.put("berthName", eepReportRecInfo.getBerthName());
|
|
|
- }
|
|
|
-
|
|
|
- // 嫌疑船舶
|
|
|
- afterDataMap.put("illegalStatus", 2);
|
|
|
- afterDataMap.put("uploadFlag", 0);
|
|
|
- // TODO 上报行政检查系统
|
|
|
-
|
|
|
- } else {
|
|
|
- afterDataMap.put("uploadFlag", 0);
|
|
|
- afterDataMap.put("illegalStatus", 1);
|
|
|
- }
|
|
|
- Map<String, Object> monitor = client.getDocById(ElasticConstants.SO2_MONITOR_POINT, Convert.toStr(afterDataMap.get("monitorPointId")), "name");
|
|
|
- if (monitor != null && ObjectUtil.equal(monitor.get("code"), 200)) {
|
|
|
- Map<String, String> data = Convert.toMap(String.class, String.class, monitor.get("data"));
|
|
|
- afterDataMap.put("monitorPointName", data.get("name"));
|
|
|
- afterDataMap.put("orgName", orgMap.get(data.get("name")));
|
|
|
- }
|
|
|
- afterDataMap.put("illegalType", "guangpu");
|
|
|
- // 保存数据
|
|
|
- saveIllegalData(afterDataMap, ElasticConstants.SO2_ALERT);
|
|
|
- client.createDocument(ElasticConstants.SO2_ALERT, Convert.toStr(afterDataMap.get("id")), afterDataMap);
|
|
|
} else if (StrUtil.equalsIgnoreCase(database, "ais_database") && (StrUtil.equalsIgnoreCase(table, "sem_instrument"))) {
|
|
|
// 嗅探系统-站点信息
|
|
|
client.createDocument(ElasticConstants.AIS_SEM_INSTRUMENT, Convert.toStr(afterDataMap.get("id")), afterDataMap);
|
|
@@ -386,6 +349,43 @@ public class CanalScheduling implements Runnable, ApplicationContextAware {
|
|
|
CacheConstants.DEVICE_STATIC,
|
|
|
CacheConstants.DEVICE_TYPE_STATIC,
|
|
|
CacheConstants.DEVICE_LIST_STATIC));
|
|
|
+ } else if (StrUtil.equalsIgnoreCase(database, "ship") && StrUtil.equalsIgnoreCase(table, "common_record")) {
|
|
|
+ // 船舶记录
|
|
|
+ if ("prod".equals(env)) {
|
|
|
+ AisShipInfo shipInfo = aisInfoService.getShipInfo("", Convert.toStr(afterDataMap.get("mmsi")), "", "");
|
|
|
+ if (shipInfo != null) {
|
|
|
+ afterDataMap.put("shipName", shipInfo.getShipName());
|
|
|
+ afterDataMap.put("shipRegionType", shipInfo.getShipRegionType());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 判断是否大于阈值
|
|
|
+ if (ObjectUtil.isNotEmpty(afterDataMap.get("so2Percent")) && NumberUtil.isGreaterOrEqual(Convert.toBigDecimal(afterDataMap.get("so2Percent")), Convert.toBigDecimal(so2ThresholdVal))) {
|
|
|
+ // 查询检测点和船舶信息、船舶进出港记录
|
|
|
+ ShipEepReportRecInfo eepReportRecInfo = aisInfoService.getShipEepReportRecInfo(DateUtil.formatDate(DateUtil.offsetDay(new Date(), -20)), DateUtil.formatDate(DateUtil.tomorrow()), Convert.toStr(afterDataMap.get("mmsi")), "", "");
|
|
|
+ if (eepReportRecInfo != null) {
|
|
|
+ afterDataMap.put("destination", eepReportRecInfo.getNextPortName());
|
|
|
+ afterDataMap.put("berthName", eepReportRecInfo.getBerthName());
|
|
|
+ }
|
|
|
+
|
|
|
+ // 嫌疑船舶
|
|
|
+ afterDataMap.put("illegalStatus", 2);
|
|
|
+ afterDataMap.put("uploadFlag", 0);
|
|
|
+ // TODO 上报行政检查系统
|
|
|
+
|
|
|
+ } else {
|
|
|
+ afterDataMap.put("uploadFlag", 0);
|
|
|
+ afterDataMap.put("illegalStatus", 1);
|
|
|
+ }
|
|
|
+ Map<String, Object> monitor = client.getDocById(ElasticConstants.SO2_MONITOR_POINT, Convert.toStr(afterDataMap.get("monitorPointId")), "name");
|
|
|
+ if (monitor != null && ObjectUtil.equal(monitor.get("code"), 200)) {
|
|
|
+ Map<String, String> data = Convert.toMap(String.class, String.class, monitor.get("data"));
|
|
|
+ afterDataMap.put("monitorPointName", data.get("name"));
|
|
|
+ afterDataMap.put("orgName", orgMap.get(data.get("name")));
|
|
|
+ }
|
|
|
+ afterDataMap.put("illegalType", "guangpu");
|
|
|
+ // 保存数据
|
|
|
+ saveIllegalData(afterDataMap, ElasticConstants.SO2_ALERT);
|
|
|
+ client.createDocument(ElasticConstants.SO2_ALERT, Convert.toStr(afterDataMap.get("id")), afterDataMap);
|
|
|
} else if (StrUtil.equalsIgnoreCase(database, "ship") && StrUtil.equalsIgnoreCase(table, "monitor_point")) {
|
|
|
// 检测点信息
|
|
|
client.updateDocument(ElasticConstants.SO2_MONITOR_POINT, Convert.toStr(afterDataMap.get("id")), afterDataMap);
|