diff --git a/epmet-module/gov-org/gov-org-client/pom.xml b/epmet-module/gov-org/gov-org-client/pom.xml
index e9c924f60d..59518f86e2 100644
--- a/epmet-module/gov-org/gov-org-client/pom.xml
+++ b/epmet-module/gov-org/gov-org-client/pom.xml
@@ -10,7 +10,7 @@
gov-org-client
-
+ jar
diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/ListCustomerGridFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/ListCustomerGridFormDTO.java
new file mode 100644
index 0000000000..78aa62fd80
--- /dev/null
+++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/ListCustomerGridFormDTO.java
@@ -0,0 +1,38 @@
+package com.epmet.dto.form;/**
+ * Created by 11 on 2020/3/19.
+ */
+
+import lombok.Data;
+
+import javax.validation.constraints.Min;
+import javax.validation.constraints.NotBlank;
+import java.io.Serializable;
+
+/**
+ * @Description 陌生人导览查询附近网格传参定义
+ * @ClassName ListCustomerGridFormDTO
+ * @Author wangc
+ * @date 2020.03.19 15:00
+ */
+@Data
+public class ListCustomerGridFormDTO implements Serializable{
+
+ private static final long serialVersionUID = -1L;
+
+ /**
+ * 地区编码(城市、区县)
+ * */
+ @NotBlank(message = "地区码不能为空")
+ private String areaCode;
+
+ /**
+ * 当前页
+ * */
+ @Min(value = 1)
+ private Integer pageNo;
+
+ /**
+ * 每页显示数量
+ * */
+ private Integer pageSize = 20;
+}
diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CustomerGridForStangerResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CustomerGridForStrangerResultDTO.java
similarity index 68%
rename from epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CustomerGridForStangerResultDTO.java
rename to epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CustomerGridForStrangerResultDTO.java
index 2a8c4108d0..465db64595 100644
--- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CustomerGridForStangerResultDTO.java
+++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CustomerGridForStrangerResultDTO.java
@@ -1,6 +1,4 @@
-package com.epmet.dto.result;/**
- * Created by 11 on 2020/3/19.
- */
+package com.epmet.dto.result;
import lombok.Data;
@@ -8,12 +6,12 @@ import java.io.Serializable;
/**
* @Description 陌生人搜索网格返回结果
- * @ClassName CustomerGridForStangerResultDTO
+ * @ClassName CustomerGridForStrangerResultDTO
* @Author wangc
* @date 2020.03.19 00:38
*/
@Data
-public class CustomerGridForStangerResultDTO implements Serializable {
+public class CustomerGridForStrangerResultDTO implements Serializable {
private static final long serialVersionUID = -1L;
/**
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java
index 8e0a07fbfd..782a2f1678 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java
@@ -26,7 +26,8 @@ import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.dto.CustomerGridDTO;
-import com.epmet.dto.result.CustomerGridForStangerResultDTO;
+import com.epmet.dto.form.ListCustomerGridFormDTO;
+import com.epmet.dto.result.CustomerGridForStrangerResultDTO;
import com.epmet.excel.CustomerGridExcel;
import com.epmet.service.CustomerGridService;
import org.springframework.beans.factory.annotation.Autowired;
@@ -93,10 +94,17 @@ public class CustomerGridController {
}
+ /**
+ * @Description 陌生人导览模块调用 根据陌生揽客传入的地区码进行分页查询显示
+ * @Param ListCustomerGridFormDTO
+ * @return Result>
+ * @Author wangc
+ * @Date 2020.03.19 15:23
+ **/
+ @PostMapping("queryListForStrangerByOrder")
+ public Result> queryListForStrangerByOrder(@RequestBody ListCustomerGridFormDTO listCustomerGridFormDTO ){
- @GetMapping("queryListForStrangerByOrder")
- public Result> queryListForStrangerByOrder(@RequestParam("areaCode")String areaCode, @RequestParam("pageNo") Integer pageNo, Integer pageSize){
-
- return customerGridService.ListGridForStrangerByOrder(areaCode, pageNo, pageSize);
+ ValidatorUtils.validateEntity(listCustomerGridFormDTO);
+ return customerGridService.listGridForStrangerByOrder(listCustomerGridFormDTO);
}
}
\ No newline at end of file
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java
index 90aaa87faa..243180f257 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java
@@ -18,7 +18,7 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
-import com.epmet.dto.result.CustomerGridForStangerResultDTO;
+import com.epmet.dto.result.CustomerGridForStrangerResultDTO;
import com.epmet.entity.CustomerGridEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@@ -34,13 +34,34 @@ import java.util.List;
@Mapper
public interface CustomerGridDao extends BaseDao {
- //查特定区的网格
- List selectGridByAreaCode(@Param("areaCode")String areaCode);
- //查整个城市的网格
- List selectGridByCityLike(@Param("areaCode")String areaCode);
+ /**
+ * @Description 查特定区的网格
+ * @Param areaCode
+ * @return CustomerGridForStrangerResultDTO
+ * @Author wangc
+ * @Date 2020.03.19 15:53
+ **/
+ List selectGridByAreaCode(@Param("areaCode")String areaCode);
- //指定区时查询当前城市下除该区之外其余的网格
- List selectRestGridWithoutGivenAreaCode(@Param("areaCode")String areaCode , @Param("cityCode")String cityCode);
+ /**
+ * @Description 查整个城市的网格
+ * @Param areaCode
+ * @return CustomerGridForStrangerResultDTO
+ * @Author wangc
+ * @Date 2020.03.19 15:53
+ **/
+ List selectGridByCityLike(@Param("areaCode")String areaCode);
+
+
+ /**
+ * @Description 指定区时查询当前城市下除该区之外其余的网格
+ * @Param areaCode
+ * @Param cityCode
+ * @return CustomerGridForStrangerResultDTO
+ * @Author wangc
+ * @Date 2020.03.19 15:53
+ **/
+ List selectRestGridWithoutGivenAreaCode(@Param("areaCode")String areaCode , @Param("cityCode")String cityCode);
}
\ No newline at end of file
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java
index fb07d7d585..4a682957c2 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java
@@ -21,7 +21,8 @@ import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.CustomerGridDTO;
-import com.epmet.dto.result.CustomerGridForStangerResultDTO;
+import com.epmet.dto.form.ListCustomerGridFormDTO;
+import com.epmet.dto.result.CustomerGridForStrangerResultDTO;
import com.epmet.entity.CustomerGridEntity;
import java.util.List;
@@ -98,7 +99,10 @@ public interface CustomerGridService extends BaseService {
/**
* 陌生人查询附近网格数据
* 不管传递的areaCode是市级还是县级,都查询整个城市的网格信息,需要特定的排序
- *
+ * @param
+ * @return Result>
+ * @author wangc
+ * @date 2020-03-16
* */
- Result> ListGridForStrangerByOrder(String areaCode, Integer PageNo, Integer pageSize);
+ Result> listGridForStrangerByOrder(ListCustomerGridFormDTO listCustomerGridFormDTO);
}
\ No newline at end of file
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java
index 9dc2a5f126..a81e488a84 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java
@@ -27,9 +27,10 @@ import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dao.CustomerGridDao;
import com.epmet.dto.CustomerGridDTO;
-import com.epmet.dto.result.CustomerGridForStangerResultDTO;
+import com.epmet.dto.form.ListCustomerGridFormDTO;
+import com.epmet.dto.result.CustomerGridForStrangerResultDTO;
import com.epmet.entity.CustomerGridEntity;
-import com.epmet.exception.ModuleErrorCode;
+
import com.epmet.redis.CustomerGridRedis;
import com.epmet.service.CustomerGridService;
import com.github.pagehelper.PageHelper;
@@ -107,28 +108,18 @@ public class CustomerGridServiceImpl extends BaseServiceImpl> ListGridForStrangerByOrder(String areaCode, Integer pageNo, Integer pageSize) {
+ public Result> listGridForStrangerByOrder(ListCustomerGridFormDTO listCustomerGridFormDTO) {
- //判断areaCode是市级还是县级
- if(StringUtils.isBlank(areaCode)){
- throw new RenException(ModuleErrorCode.ARGS_NOT_ALLOW_NULL_ERROR,"地区码不能为空!");
- }
- if(areaCode.length() != 6){
- throw new RenException(ModuleErrorCode.NOT_STANDARD_AREA_CODE_ERROR,"无法识别的地区码!");
- }
- if(null == pageNo){
- throw new RenException(ModuleErrorCode.ARGS_NOT_ALLOW_NULL_ERROR,"页码不能为空!");
- }
- if(null == pageSize || pageSize <= 0 || pageSize >=100){
- pageSize = 20;
- }
+ Result> result = new Result<>();
- Result> result = new Result<>();
+ String areaCode = listCustomerGridFormDTO.getAreaCode();
+ Integer pageNo = listCustomerGridFormDTO.getPageNo();
+ Integer pageSize = listCustomerGridFormDTO.getPageSize();
if(areaCode.endsWith("00")){
//城市 - 查全部
PageHelper.startPage(pageNo,pageSize);
- List gridList
+ List gridList
= baseDao.selectGridByCityLike(areaCode.substring(0,areaCode.length()-2));
result.setData(gridList);
@@ -136,11 +127,11 @@ public class CustomerGridServiceImpl extends BaseServiceImpl gridListArea
+ List gridListArea
= baseDao.selectGridByAreaCode(areaCode);
- List restGridListArea
+ List restGridListArea
= baseDao.selectRestGridWithoutGivenAreaCode(areaCode,areaCode.substring(0,areaCode.length()-2));
- for(CustomerGridForStangerResultDTO obj : restGridListArea){
+ for(CustomerGridForStrangerResultDTO obj : restGridListArea){
gridListArea.add(obj);
}
diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml
index cd1a2338f0..f38d18caeb 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml
+++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml
@@ -23,36 +23,52 @@
-