From 9321bdf9bf7f9eb9f14d288b1d9260dd7d6f6c8a Mon Sep 17 00:00:00 2001 From: liuchengqian Date: Sat, 7 May 2022 15:31:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E4=BB=8A=E5=A4=A9=E7=9A=84=E7=81=AB=E7=82=B9=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/FirePointServiceImpl.java | 28 ++++++------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/src/main/java/com/xkrs/service/impl/FirePointServiceImpl.java b/src/main/java/com/xkrs/service/impl/FirePointServiceImpl.java index 48dabae..3562890 100644 --- a/src/main/java/com/xkrs/service/impl/FirePointServiceImpl.java +++ b/src/main/java/com/xkrs/service/impl/FirePointServiceImpl.java @@ -69,6 +69,9 @@ public class FirePointServiceImpl implements FirePointService { @Resource private CountyDao countyDao; + @Resource + private StreetDao streetDao; + @Resource private FireDao fireDao; @@ -146,39 +149,24 @@ public class FirePointServiceImpl implements FirePointService { /** * 查询今天的火点信息 - * - * @param - * @return */ @Cacheable(keyGenerator = "keyGenerator", unless = "#result == null") @Override public List selectTodayFirePoint(String countyCode) { String addTime = DateTimeUtil.dateToString(LocalDate.now()); - if ("0000".equals(countyCode.substring(2))) { + if (9 == countyCode.length()) { + List byStreetCode = streetDao.findByStreetCode(countyCode); + String streetName = byStreetCode.get(0).getStreetName(); + return firePointDao.selectTodayFirePoint(addTime, streetName); + } else if ("0000".equals(countyCode.substring(2))) { List byProCode = cityDao.findByProCode(countyCode); String proName = byProCode.get(0).getProName(); -// if(proName.equals("山东省")){ -// return firePointDao.selectTodayFirePointShandong(addTime,proName); -// } return firePointDao.selectTodayFirePoint(addTime, proName); - } else if ("00".equals(countyCode.substring(4)) && !"0000".equals(countyCode.substring(2))) { List byCityCode = countyDao.findByCityCode(countyCode); String cityName = byCityCode.get(0).getCityName(); - CityEntity byCityName = cityDao.findByCityName(cityName); -// if(byCityName.getProName().equals("山东省")){ -// return firePointDao.selectTodayFirePointShandong(addTime,cityName); -// } return firePointDao.selectTodayFirePoint(addTime, cityName); } else { - List byCountyCode = countyDao.findByCountyCode(countyCode); - CityEntity byCityName = cityDao.findByCityName(byCountyCode.get(0).getCityName()); -// if(b -// -// -// yCityName.getProName().equals("山东省")){ -// return firePointDao.selectTodayFirePointOneShandong(addTime,countyCode); -// } return firePointDao.selectTodayFirePointOne(addTime, countyCode); } }