From 27b369f4ed5100dee607f7a62f191a7e1143bf66 Mon Sep 17 00:00:00 2001 From: liuchengqian Date: Mon, 24 Oct 2022 12:07:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=B4=E6=97=B6=E5=8F=98=E6=9B=B4=EF=BC=9A?= =?UTF-8?q?=E5=BC=80=E5=85=B3=E5=BC=80=E5=90=AF=E6=97=B6=EF=BC=8C=E5=B1=B1?= =?UTF-8?q?=E4=B8=9C=E7=9C=81=E5=86=85=E7=81=AB=E7=82=B9=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=80=9A=E8=BF=87=E9=80=9A=E9=81=931=E8=BF=9B=E5=85=A5?= =?UTF-8?q?=E5=B1=B1=E4=B8=9C=E4=B8=B4=E6=97=B6=E7=81=AB=E7=82=B9=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/FirePointServiceImpl.java | 58 +++++++++++++++++-- 1 file changed, 52 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/xkrs/service/impl/FirePointServiceImpl.java b/src/main/java/com/xkrs/service/impl/FirePointServiceImpl.java index 5667552..4d4161f 100644 --- a/src/main/java/com/xkrs/service/impl/FirePointServiceImpl.java +++ b/src/main/java/com/xkrs/service/impl/FirePointServiceImpl.java @@ -121,15 +121,36 @@ public class FirePointServiceImpl implements FirePointService { log.info("添加火点信息 逆地理编码请求街道编号失败:" + e.getMessage()); return false; } - if (firePointEntity.getCountyCode().startsWith("37")) { - return false; - } + if (checkDuplicatedData(firePointEntity)) { return false; } - log.info("-------发现新火点"); - firePointDao.save(firePointEntity); - return true; + if (firePointEntity.getCountyCode().startsWith("37")) { + //如果是山东的点,就入库 + if (isSwitchStateOpen()) { + //如果开关已打开,就只将未审核的火点添加到山东临时表 + log.info("-------发现新山东火点"); + ShanDongFirePointEntity shanDongFirePointByFirePoint = getShanDongFirePointByFirePoint(firePointEntity); + ShanDongFirePointEntity savedShanDongFirePoint = shanDongFirePointDao.save(shanDongFirePointByFirePoint); + //微信消息通知火点审核工作组 + try { + String messageContent = getMessageContent(savedShanDongFirePoint); + WDWxSendMsgUtil.sendMsg("18447024917@chatroom", messageContent, 0); + } catch (Exception e) { + e.printStackTrace(); + } + return true; + } else { + return false; + } + } else { + log.info("-------发现新火点"); + firePointDao.save(firePointEntity); + return true; + } +// log.info("-------发现新火点"); +// firePointDao.save(firePointEntity); +// return true; } /** @@ -278,6 +299,31 @@ public class FirePointServiceImpl implements FirePointService { return firePoint; } + private ShanDongFirePointEntity getShanDongFirePointByFirePoint(FirePointEntity firePoint) { + ShanDongFirePointEntity shanDongFirePoint = new ShanDongFirePointEntity(); + shanDongFirePoint.setId(firePoint.getId()); + shanDongFirePoint.setFireCode(firePoint.getFireCode()); + shanDongFirePoint.setLongitude(firePoint.getLongitude()); + shanDongFirePoint.setLatitude(firePoint.getLatitude()); + shanDongFirePoint.setCountyCode(firePoint.getCountyCode()); + shanDongFirePoint.setCountyName(firePoint.getCountyName()); + shanDongFirePoint.setSatelliteTime(firePoint.getSatelliteTime()); + shanDongFirePoint.setSatelliteType(firePoint.getSatelliteType()); + shanDongFirePoint.setLandType(firePoint.getLandType()); + shanDongFirePoint.setAddTime(firePoint.getAddTime()); + shanDongFirePoint.setConfidence(firePoint.getConfidence()); + shanDongFirePoint.setFirePointAddress(firePoint.getFirePointAddress()); + shanDongFirePoint.setFireType(firePoint.getFireType()); + shanDongFirePoint.setFireImage(firePoint.getFireImage()); + shanDongFirePoint.setSatelliteImage(firePoint.getSatelliteImage()); + shanDongFirePoint.setBeforeFireImage(firePoint.getBeforeFireImage()); + shanDongFirePoint.setAfterFireImage(firePoint.getAfterFireImage()); + shanDongFirePoint.setStreetCode(firePoint.getStreetCode()); + shanDongFirePoint.setStreetName(firePoint.getStreetName()); + shanDongFirePoint.setVerifyState("0"); + return shanDongFirePoint; + } + /** * 返回开关是否为打开状态 *