| | |
| | | package com.stylefeng.guns.modular.api; |
| | | |
| | | import cn.hutool.core.io.FileUtil; |
| | | import cn.hutool.http.HttpRequest; |
| | | import cn.hutool.http.HttpResponse; |
| | | import cn.hutool.http.HttpUtil; |
| | |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.collections.CollectionUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.data.geo.Circle; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.io.File; |
| | | import java.io.InputStream; |
| | | import java.math.BigDecimal; |
| | | import java.text.MessageFormat; |
| | | import java.text.SimpleDateFormat; |
| | |
| | | ArrayList<CompanyVo> companyVos = new ArrayList<>(); |
| | | List<CompanyCity> companyCities = companyCityService.selectList(new EntityWrapper<CompanyCity>().eq("areaCode", areaCode).eq("state", 1)); |
| | | if(companyCities.isEmpty()){ |
| | | // 最后两位替换为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)) { |
| | | // 最后四位替换为0 |
| | | String provinceCode = areaCode.substring(0, areaCode.length() - 4) + "0000"; |
| | | companyCities = companyCityService.selectList(new EntityWrapper<CompanyCity>().eq("provinceCode", provinceCode).eq("state", 1)); |
| | | } |
| | | if(CollectionUtils.isEmpty(companyCities)) { |
| | | return ResultUtil.success(companyVos); |
| | | } |
| | | |
| | | Wrapper<Company> in = new EntityWrapper<Company>().ne("type", 1).ne("flag", 3).in("id", companyCities.stream().map(CompanyCity::getCompanyId).collect(Collectors.toList())); |
| | | |
| | | if(ToolUtil.isNotEmpty( name)){ |