|
@ -33,13 +33,13 @@ import com.epmet.entity.CustomerGridEntity; |
|
|
|
|
|
|
|
|
import com.epmet.redis.CustomerGridRedis; |
|
|
import com.epmet.redis.CustomerGridRedis; |
|
|
import com.epmet.service.CustomerGridService; |
|
|
import com.epmet.service.CustomerGridService; |
|
|
import com.github.pagehelper.PageHelper; |
|
|
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
|
import java.util.Arrays; |
|
|
import java.util.Arrays; |
|
|
|
|
|
import java.util.HashMap; |
|
|
import java.util.List; |
|
|
import java.util.List; |
|
|
import java.util.Map; |
|
|
import java.util.Map; |
|
|
|
|
|
|
|
@ -114,32 +114,32 @@ public class CustomerGridServiceImpl extends BaseServiceImpl<CustomerGridDao, Cu |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String areaCode = listCustomerGridFormDTO.getAreaCode(); |
|
|
String areaCode = listCustomerGridFormDTO.getAreaCode(); |
|
|
Integer pageNo = listCustomerGridFormDTO.getPageNo(); |
|
|
listCustomerGridFormDTO.setPageNo((listCustomerGridFormDTO.getPageNo() - 1) * listCustomerGridFormDTO.getPageSize()); |
|
|
Integer pageSize = listCustomerGridFormDTO.getPageSize(); |
|
|
|
|
|
|
|
|
|
|
|
if(areaCode.endsWith("00")){ |
|
|
if(areaCode.endsWith("00")){ |
|
|
//城市 - 查全部
|
|
|
//城市 - 查全部
|
|
|
PageHelper.startPage(pageNo,pageSize); |
|
|
listCustomerGridFormDTO.setAreaCode(areaCode.substring(0,areaCode.length()-2)); |
|
|
List<CustomerGridForStrangerResultDTO> gridList |
|
|
List<CustomerGridForStrangerResultDTO> gridList |
|
|
= baseDao.selectGridByCityLike(areaCode.substring(0,areaCode.length()-2)); |
|
|
= baseDao.selectGridByCityLike(listCustomerGridFormDTO); |
|
|
|
|
|
|
|
|
result.setData(gridList); |
|
|
result.setData(gridList); |
|
|
result.setCode(0); |
|
|
result.setCode(0); |
|
|
return result; |
|
|
return result; |
|
|
}else{ |
|
|
}else{ |
|
|
//行政区
|
|
|
//行政区
|
|
|
List<CustomerGridForStrangerResultDTO> gridListArea |
|
|
|
|
|
= baseDao.selectGridByAreaCode(areaCode); |
|
|
|
|
|
List<CustomerGridForStrangerResultDTO> restGridListArea |
|
|
|
|
|
= baseDao.selectRestGridWithoutGivenAreaCode(areaCode,areaCode.substring(0,areaCode.length()-2)); |
|
|
|
|
|
for(CustomerGridForStrangerResultDTO obj : restGridListArea){ |
|
|
|
|
|
gridListArea.add(obj); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//分页操作
|
|
|
Map<String,Object> map = new HashMap<>(); |
|
|
|
|
|
|
|
|
|
|
|
map.put("areaCode",areaCode); |
|
|
|
|
|
map.put("cityCode",areaCode.substring(0,areaCode.length()-2)); |
|
|
|
|
|
map.put("pageSize",listCustomerGridFormDTO.getPageSize()); |
|
|
|
|
|
map.put("pageNo",listCustomerGridFormDTO.getPageNo()); |
|
|
|
|
|
|
|
|
|
|
|
List<CustomerGridForStrangerResultDTO> gridListArea |
|
|
|
|
|
= baseDao.selectRestGridWithoutGivenAreaCode(map); |
|
|
|
|
|
|
|
|
result.setData(gridListArea); |
|
|
result.setData(gridListArea); |
|
|
result.setCode(0); |
|
|
|
|
|
return result; |
|
|
return result; |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|