| | |
| | | public ResultUtil queryNeedCertificate(String code){ |
| | | try { |
| | | Integer integer = driverService.queryNeedCertificate(code); |
| | | if(Objects.isNull(integer)) { |
| | | String cityCode = code.substring(0, code.length() - 2) + "00"; |
| | | integer = driverService.queryNeedCertificate(cityCode); |
| | | } |
| | | if(Objects.isNull(integer)) { |
| | | String provinceCode = code.substring(0, code.length() - 4) + "0000"; |
| | | integer = driverService.queryNeedCertificate(provinceCode); |
| | | } |
| | | return ResultUtil.success(integer == null ? 0 : integer); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | try { |
| | | |
| | | ArrayList<CompanyVo> companyVos = new ArrayList<>(); |
| | | List<CompanyCity> companyCities = companyCityService.selectList(new EntityWrapper<CompanyCity>().eq("areaCode", areaCode).eq("state", 1)); |
| | | if(companyCities.isEmpty()) { |
| | | List<CompanyCity> companyCities = new ArrayList<>(); |
| | | List<CompanyCity> companyCities1 = companyCityService.selectList(new EntityWrapper<CompanyCity>().eq("areaCode", areaCode).eq("state", 1)); |
| | | // 最后两位替换为0 |
| | | String cityCode = areaCode.substring(0, areaCode.length() - 2) + "00"; |
| | | companyCities = companyCityService.selectList(new EntityWrapper<CompanyCity>().eq("cityCode", cityCode).eq("state", 1)); |
| | | |
| | | } |
| | | if(CollectionUtils.isEmpty(companyCities)) { |
| | | List<CompanyCity> companyCities2 = companyCityService.selectList(new EntityWrapper<CompanyCity>().eq("cityCode", cityCode).eq("state", 1)); |
| | | // 最后四位替换为0 |
| | | String provinceCode = areaCode.substring(0, areaCode.length() - 4) + "0000"; |
| | | companyCities = companyCityService.selectList(new EntityWrapper<CompanyCity>().eq("provinceCode", provinceCode).eq("state", 1)); |
| | | List<CompanyCity> companyCities3 = companyCityService.selectList(new EntityWrapper<CompanyCity>().eq("provinceCode", provinceCode).eq("state", 1)); |
| | | if(CollectionUtils.isNotEmpty(companyCities1)) { |
| | | companyCities.addAll(companyCities1); |
| | | } |
| | | if(CollectionUtils.isNotEmpty(companyCities2)) { |
| | | companyCities.addAll(companyCities2); |
| | | } |
| | | if(CollectionUtils.isNotEmpty(companyCities3)) { |
| | | companyCities.addAll(companyCities3); |
| | | } |
| | | if(CollectionUtils.isEmpty(companyCities)) { |
| | | return ResultUtil.success(companyVos); |