diff --git a/src/main/java/com/xkrs/service/impl/FirePointServiceImpl.java b/src/main/java/com/xkrs/service/impl/FirePointServiceImpl.java index 7a014af..78fade2 100644 --- a/src/main/java/com/xkrs/service/impl/FirePointServiceImpl.java +++ b/src/main/java/com/xkrs/service/impl/FirePointServiceImpl.java @@ -115,11 +115,11 @@ public class FirePointServiceImpl implements FirePointService { @Override public List selectTodayFirePoint(String countyCode) { String addTime = DateTimeUtil.dateToString(LocalDate.now()); - if(countyCode.substring(2).equals("0000")){ + if("0000".equals(countyCode.substring(2))){ List byProCode = cityDao.findByProCode(countyCode); String proName = byProCode.get(0).getProName(); return firePointDao.selectTodayFirePoint(addTime,proName); - }else if(countyCode.substring(4).equals("00") && !countyCode.substring(2).equals("0000")){ + }else if("00".equals(countyCode.substring(4)) && !"0000".equals(countyCode.substring(2))){ List byCityCode = cityDao.findByCityCode(countyCode); String cityName = byCityCode.get(0).getCityName(); return firePointDao.selectTodayFirePoint(addTime,cityName); @@ -190,18 +190,18 @@ public class FirePointServiceImpl implements FirePointService { String tokenUserName = TokenUtil.getTokenUserName(token); SysUserEntity sysUserEntity = sysUserDao.selectByUserName(tokenUserName); FirePointEntity byFireCode = firePointDao.findByFireCode(fireCode); - if (byFireCode.getFireType().equals("3") || byFireCode.getFireType().equals("-1")) { + if ("3".equals(byFireCode.getFireType()) || "-1".equals(byFireCode.getFireType())) { return outputEncapsulationObject(PromptMessageEnum.PROCESS_FAIL,"该火点已经结案,请勿进行有关状态操作",locale); } if (fireType.equals(byFireCode.getFireType())) { return outputEncapsulationObject(PromptMessageEnum.PROCESS_FAIL,"您正处于当前的状态,请勿进行该操作",locale); } firePointDao.updateFireTypeByFireCode(fireCode, fireType); - if (fireType.equals("1")) { + if ("1".equals(fireType)) { FirePointEntity byFireCode1 = firePointDao.findByFireCode(fireCode); // 预警 return outputEncapsulationObject(PromptMessageEnum.SUCCESS,byFireCode1,locale); - } else if (fireType.equals("2")){ + } else if ("2".equals(fireType)){ FirePointEntity byFireCode3 = firePointDao.findByFireCode(fireCode); // 核查 return outputEncapsulationObject(PromptMessageEnum.SUCCESS,byFireCode3,locale); @@ -318,11 +318,11 @@ public class FirePointServiceImpl implements FirePointService { // 当前时间减7 LocalDateTime localDateTime1 = localDateTime.minusDays(31); String startTime = DateTimeUtil.dateTimeToString(localDateTime1); - if(countyCode.substring(2).equals("0000")){ + if("0000".equals(countyCode.substring(2))){ List byProCode = cityDao.findByProCode(countyCode); String proName = byProCode.get(0).getProName(); return query.selectFirePointByMonth(proName,startTime,endTime); - }else if(countyCode.substring(4).equals("00") && !countyCode.substring(2).equals("0000")){ + }else if("00".equals(countyCode.substring(4)) && !"0000".equals(countyCode.substring(2))){ List byCityCode = cityDao.findByCityCode(countyCode); String cityName = byCityCode.get(0).getCityName(); return query.selectFirePointByMonthCity(cityName,startTime,endTime); diff --git a/src/main/java/com/xkrs/service/impl/ForestRangerServiceImpl.java b/src/main/java/com/xkrs/service/impl/ForestRangerServiceImpl.java index a460106..b71b70d 100644 --- a/src/main/java/com/xkrs/service/impl/ForestRangerServiceImpl.java +++ b/src/main/java/com/xkrs/service/impl/ForestRangerServiceImpl.java @@ -50,7 +50,7 @@ public class ForestRangerServiceImpl implements ForestRangerService { // 获取区域信息 Locale locale = LocaleContextHolder.getLocale(); String tokenUserName = TokenUtil.getTokenUserName(token); - if(countyCode.substring(2).equals("0000")){ + if("0000".equals(countyCode.substring(2))){ List allsByRangerCountyCode = forestRangerDao.findAllsByRangerCountyCode(countyCode.substring(0,2)); if(allsByRangerCountyCode == null || allsByRangerCountyCode.size() == 0){ return outputEncapsulationObject(PromptMessageEnum.DATA_NONE,"暂时还没该省护林员的信息",locale);