diff --git a/src/main/java/com/xkrs/service/impl/ForestRangerServiceImpl.java b/src/main/java/com/xkrs/service/impl/ForestRangerServiceImpl.java index 9e4dba0..a460106 100644 --- a/src/main/java/com/xkrs/service/impl/ForestRangerServiceImpl.java +++ b/src/main/java/com/xkrs/service/impl/ForestRangerServiceImpl.java @@ -50,14 +50,14 @@ public class ForestRangerServiceImpl implements ForestRangerService { // 获取区域信息 Locale locale = LocaleContextHolder.getLocale(); String tokenUserName = TokenUtil.getTokenUserName(token); - if("370000".equals(countyCode)){ - List all = forestRangerDao.findAll(); - if(all == null || all.size() == 0){ + if(countyCode.substring(2).equals("0000")){ + List allsByRangerCountyCode = forestRangerDao.findAllsByRangerCountyCode(countyCode.substring(0,2)); + if(allsByRangerCountyCode == null || allsByRangerCountyCode.size() == 0){ return outputEncapsulationObject(PromptMessageEnum.DATA_NONE,"暂时还没该省护林员的信息",locale); } - return outputEncapsulationObject(PromptMessageEnum.SUCCESS,all,locale); + return outputEncapsulationObject(PromptMessageEnum.SUCCESS,allsByRangerCountyCode,locale); }else { - List allByRangerCountyCode = forestRangerDao.findAllsByRangerCountyCode(countyCode); + List allByRangerCountyCode = forestRangerDao.findAllsByRangerCountyCode(countyCode.substring(0,4)); if(allByRangerCountyCode == null || allByRangerCountyCode.size() == 0){ return outputEncapsulationObject(PromptMessageEnum.DATA_NONE,"暂时还没该市护林员的信息",locale); }