|
@@ -30,6 +30,7 @@ import com.ruoyi.system.domain.vo.ShipEepReportRecInfo;
|
|
|
import com.ruoyi.system.service.IAisInfoService;
|
|
|
import com.ruoyi.system.service.IIllegalShipDataService;
|
|
|
import com.ruoyi.system.service.ISysConfigService;
|
|
|
+import com.ruoyi.web.controller.tool.SMSUtil;
|
|
|
import com.ruoyi.web.core.config.CanalConfig;
|
|
|
import lombok.SneakyThrows;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
@@ -478,6 +479,24 @@ public class CanalScheduling implements Runnable, ApplicationContextAware {
|
|
|
}
|
|
|
try {
|
|
|
illegalShipDataService.insertIllegalShipData(illegalShipData);
|
|
|
+ // 发送短信给海事人员(常熟海事局)
|
|
|
+ if ((StrUtil.equals(illegalShipData.getOrgName(), "常熟海事局") || StrUtil.equals(illegalShipData.getDestination(), "常熟")) && illegalShipData.getIllegalStatus() != 1) {
|
|
|
+ String csPhone = configService.selectConfigByKey("sms.cs");
|
|
|
+ String detail = "";
|
|
|
+ if ("guangpu".equals(illegalShipData.getIllegalType())) {
|
|
|
+ detail = "光谱监测到硫含量:" + illegalShipData.getSo2Percent();
|
|
|
+ } else if ("xiutan".equals(illegalShipData.getIllegalType())) {
|
|
|
+ detail = "嗅探监测到硫含量:" + illegalShipData.getSo2Percent();
|
|
|
+ } else if ("heiyan".equals(illegalShipData.getIllegalType())) {
|
|
|
+ detail = "黑烟监测到黑度:" + illegalShipData.getRcgSoot();
|
|
|
+ }
|
|
|
+ String content = StrUtil.concat(true, "尾气系统监测到嫌疑数据。", "MMSI:", illegalShipData.getMmsi(), ",",
|
|
|
+ "船名:", illegalShipData.getShipName(), "。", detail);
|
|
|
+ SMSUtil smsUtil = new SMSUtil();
|
|
|
+ for (String phone : csPhone.split(",")) {
|
|
|
+ smsUtil.sendMessage(content, phone);
|
|
|
+ }
|
|
|
+ }
|
|
|
} catch (Exception ignored) {
|
|
|
ignored.printStackTrace();
|
|
|
}
|