| | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.apache.logging.log4j.util.Strings; |
| | | import org.springblade.common.cache.SysCache; |
| | | import org.springblade.common.constant.DictConstant; |
| | | import org.springblade.common.node.TreeStringNode; |
| | | import org.springblade.common.param.CommonParamSet; |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.*; |
| | | import java.util.regex.Matcher; |
| | | import java.util.regex.Pattern; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | } |
| | | if (roleName.equals("民警")) { |
| | | // 查询对应的社区编号 |
| | | communityList = policeAffairsGridService.getCommunityCodeListByUserId(AuthUtil.getUserId()); |
| | | communityList = SysCache.getPoliceRegionChildCodesByDeptId(AuthUtil.getDeptId()); |
| | | } |
| | | } |
| | | // 查询街道 |
| | |
| | | }); |
| | | // 排序 |
| | | sortUnit(tempList, list); |
| | | // List<FuncNode> sortList = tempList.stream().sorted(Comparator.comparing(X -> X.getUnitName())).collect(Collectors.toList()); |
| | | // list.addAll(sortList); |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | } else if (funcNode.getUnitName().contains("六")) { |
| | | funcNode.setSort(6); |
| | | } else { |
| | | funcNode.setSort(1); |
| | | if (!containsNumber(funcNode.getUnitName())) { |
| | | funcNode.setSort(1); |
| | | }else { |
| | | funcNode.setSort(getNumber(funcNode.getUnitName())); |
| | | } |
| | | } |
| | | } |
| | | // 排序 |
| | |
| | | } |
| | | |
| | | /** |
| | | * 判断是否包含数字 |
| | | * @param str |
| | | * @return |
| | | */ |
| | | public static boolean containsNumber(String str) { |
| | | Pattern pattern = Pattern.compile(".*\\d+.*"); |
| | | Matcher matcher = pattern.matcher(str); |
| | | return matcher.matches(); |
| | | } |
| | | |
| | | /** |
| | | * 取出字符串中的数字 |
| | | * @param str |
| | | * @return |
| | | */ |
| | | public static int getNumber(String str){ |
| | | StringBuilder sb = new StringBuilder(); |
| | | for (char c : str.toCharArray()) { |
| | | if (Character.isDigit(c)) { |
| | | sb.append(c); |
| | | } |
| | | } |
| | | return Integer.parseInt(sb.toString()); |
| | | } |
| | | |
| | | /** |
| | | * 查询房屋及出租详情信息 |
| | | * |
| | | * @param code 门牌地址编号 |