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; + } + /** * 返回开关是否为打开状态 *