diff --git a/epmet-module/gov-grid/gov-grid-server/docker-compose.yml b/epmet-module/gov-grid/gov-grid-server/docker-compose.yml
index 77d9b3d06b..83fde4e92b 100644
--- a/epmet-module/gov-grid/gov-grid-server/docker-compose.yml
+++ b/epmet-module/gov-grid/gov-grid-server/docker-compose.yml
@@ -2,7 +2,7 @@ version: "3.7"
services:
gov-grid-server:
container_name: gov-grid-server-dev
- image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/gov-grid-server:0.3.9
+ image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/gov-grid-server:0.3.10
ports:
- "8097:8097"
network_mode: host # 使用现有网络
diff --git a/epmet-module/gov-grid/gov-grid-server/pom.xml b/epmet-module/gov-grid/gov-grid-server/pom.xml
index 8eb4863cb0..60f67b62a8 100644
--- a/epmet-module/gov-grid/gov-grid-server/pom.xml
+++ b/epmet-module/gov-grid/gov-grid-server/pom.xml
@@ -3,7 +3,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4.0.0
- 0.3.9
+ 0.3.10
com.epmet
gov-grid
diff --git a/epmet-module/gov-mine/gov-mine-server/docker-compose.yml b/epmet-module/gov-mine/gov-mine-server/docker-compose.yml
index e1a9cfb9fb..d6909ad07f 100644
--- a/epmet-module/gov-mine/gov-mine-server/docker-compose.yml
+++ b/epmet-module/gov-mine/gov-mine-server/docker-compose.yml
@@ -2,7 +2,7 @@ version: "3.7"
services:
gov-mine-server:
container_name: gov-mine-server-dev
- image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/gov-mine-server:0.3.6
+ image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/gov-mine-server:0.3.7
ports:
- "8098:8098"
network_mode: host # 使用现有网络
diff --git a/epmet-module/gov-mine/gov-mine-server/pom.xml b/epmet-module/gov-mine/gov-mine-server/pom.xml
index 5e0da7bf23..5f48b69c93 100644
--- a/epmet-module/gov-mine/gov-mine-server/pom.xml
+++ b/epmet-module/gov-mine/gov-mine-server/pom.xml
@@ -2,7 +2,7 @@
- 0.3.6
+ 0.3.7
com.epmet
gov-mine
diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/StaffGridListDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/StaffGridListDTO.java
index 263405df0c..a4787ffcef 100644
--- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/StaffGridListDTO.java
+++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/StaffGridListDTO.java
@@ -2,12 +2,14 @@ package com.epmet.dto;
import lombok.Data;
+import java.io.Serializable;
+
/**
* @Auther zxc
* @Create 2020-04-23 10:38
*/
@Data
-public class StaffGridListDTO {
+public class StaffGridListDTO implements Serializable {
private static final long serialVersionUID = 1L;
diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AllGridsByUserIdResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AllGridsByUserIdResultDTO.java
new file mode 100644
index 0000000000..551e3302e5
--- /dev/null
+++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AllGridsByUserIdResultDTO.java
@@ -0,0 +1,31 @@
+package com.epmet.dto.result;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @Auther sun
+ * 获取用户访问过的所有网格列表-接口返参
+ */
+@Data
+public class AllGridsByUserIdResultDTO implements Serializable {
+
+ private static final long serialVersionUID = -1L;
+
+ /**
+ * 客户Id
+ */
+ private String customerId;
+
+ /**
+ * 网格Id
+ */
+ private String gridId;
+
+ /**
+ * 网格名称
+ */
+ private String gridName;
+
+}
diff --git a/epmet-module/gov-org/gov-org-server/docker-compose.yml b/epmet-module/gov-org/gov-org-server/docker-compose.yml
index 691fb62d7e..8c86af7e94 100644
--- a/epmet-module/gov-org/gov-org-server/docker-compose.yml
+++ b/epmet-module/gov-org/gov-org-server/docker-compose.yml
@@ -2,7 +2,7 @@ version: "3.7"
services:
gov-org-server:
container_name: gov-org-server-dev
- image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/gov-org-server:0.3.24
+ image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-dev/gov-org-server:0.3.26
ports:
- "8092:8092"
network_mode: host # 使用现有网络
diff --git a/epmet-module/gov-org/gov-org-server/pom.xml b/epmet-module/gov-org/gov-org-server/pom.xml
index e35314fb3f..d51e8e368b 100644
--- a/epmet-module/gov-org/gov-org-server/pom.xml
+++ b/epmet-module/gov-org/gov-org-server/pom.xml
@@ -2,7 +2,7 @@
4.0.0
- 0.3.24
+ 0.3.26
com.epmet
gov-org
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 834aa9bd1c..5e092efda6 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
@@ -171,4 +171,15 @@ public class CustomerGridController {
return customerGridService.getAgencyAndStaffsBygridId(gridId);
}
+ /**
+ * @param gridIdList
+ * @return
+ * @Description 根据网格Id集合获取网格列表信息
+ * @Author sun
+ */
+ @PostMapping("getgridlistbygridids")
+ public Result> getGridListByGridIds(@RequestBody List gridIdList) {
+ return customerGridService.getGridListByGridIds(gridIdList);
+ }
+
}
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 a8c6aeb6d0..70f4361032 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,17 +18,12 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
-import com.epmet.dto.UserIdAndPidDTO;
+import com.epmet.dto.*;
import com.epmet.dto.form.ListCustomerGridFormDTO;
import com.epmet.dto.form.SelectGridNameByGridIdFormDTO;
import com.epmet.dto.result.*;
-import com.epmet.commons.tools.utils.Result;
-import com.epmet.dto.CustomerGridDTO;
-import com.epmet.dto.CustomerStaffGridDTO;
-import com.epmet.dto.UserIdDTO;
import com.epmet.dto.form.CustomerGridFormDTO;
import com.epmet.dto.form.DeleteGridFormDTO;
-import com.epmet.dto.form.ListCustomerGridFormDTO;
import com.epmet.dto.result.CustomerGridForStrangerResultDTO;
import com.epmet.entity.CustomerGridEntity;
import org.apache.ibatis.annotations.Mapper;
@@ -38,7 +33,7 @@ import java.util.List;
import java.util.Map;
/**
- * 客户网格表
+ * 客户网格表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-03-16
@@ -46,32 +41,28 @@ import java.util.Map;
@Mapper
public interface CustomerGridDao extends BaseDao {
-
-
/**
+ * @return CustomerGridForStrangerResultDTO
* @Description 查整个城市的网格
* @Param areaCode
- * @return CustomerGridForStrangerResultDTO
* @Author wangc
* @Date 2020.03.19 15:53
**/
List selectGridByCityLike(ListCustomerGridFormDTO listCustomerGridFormDTO);
-
/**
+ * @return CustomerGridForStrangerResultDTO
* @Description 指定区时查询当前城市下除该区之外其余的网格
* @Param areaCode
* @Param cityCode
- * @return CustomerGridForStrangerResultDTO
* @Author wangc
* @Date 2020.03.19 15:53
**/
- List selectRestGridWithoutGivenAreaCode(Map paramsMap);
+ List selectRestGridWithoutGivenAreaCode(Map paramsMap);
CustomerGridDTO getCustomerGridByGridId(CustomerGridFormDTO customerGridFormDTO);
/**
- *
* @Description 根据网格id查询网格名称
* @Author zxc
* @CreatedTime 2020/4/27 9:22
@@ -88,6 +79,7 @@ public interface CustomerGridDao extends BaseDao {
/**
* 根据gridId获取网格详情
+ *
* @param customerGridFormDTO
* @return
*/
@@ -95,6 +87,7 @@ public interface CustomerGridDao extends BaseDao {
/**
* 根据gridId查询uerId和pid
+ *
* @param customerGridFormDTO
* @return
*/
@@ -102,6 +95,7 @@ public interface CustomerGridDao extends BaseDao {
/**
* 根据userId查询customerId
+ *
* @param userId
* @return
*/
@@ -109,57 +103,66 @@ public interface CustomerGridDao extends BaseDao {
/**
* 根据pid查询pids
+ *
* @param pid
* @return
*/
- String selectPidsByPid(@Param("pid")String pid);
+ String selectPidsByPid(@Param("pid") String pid);
/**
* 根据gridName查询gridId
+ *
* @param gridName
* @return
*/
- String selectGridIdByGridName(@Param("gridName")String gridName,@Param("agencyId")String pid,@Param("gridId")String gridId);
+ AddGridResultDTO selectGridIdByGridName(@Param("gridName") String gridName, @Param("agencyId") String pid, @Param("gridId") String gridId);
/**
* 编辑网格信息
+ *
* @param customerGridDTO
*/
void editGrid(CustomerGridDTO customerGridDTO);
/**
* 删除网格
+ *
* @param deleteGridFormDTO
*/
void deleteGrid(DeleteGridFormDTO deleteGridFormDTO);
/**
- *
* @Description 根据gridId查询userId
* @Author zxc
* @CreatedTime 2020/4/26 10:08
*/
- List selectUserIdByGrid(@Param("gridId")String gridId);
-
-
+ List selectUserIdByGrid(@Param("gridId") String gridId);
/**
+ * @return int
* @Description 得到当前机构的网格总数
* @Param agencyId(String) 对应CUSTOMER_GRID中的PID字段
- * @return int
* @Author wangc
* @Date 2020.04.23 15:05
**/
int selectGridCountByAgencyId(@Param("agencyId") String agencyId);
/**
+ * @return List -> GridBaseInfoResultDTO :: getGridId :: getGridName :: getTotalUser
* @Description 得到当前机构的网格详情列表
* @Param agencyId(String) 对应CUSTOMER_GRID中的PID字段
- * @return List -> GridBaseInfoResultDTO :: getGridId :: getGridName :: getTotalUser
* @Author wangc
* @Date 2020.04.23 15:30
**/
- List selectGridListByAgencyId(@Param("agencyId")String agencyId,@Param("pageSize")Integer pageSize);
+ List selectGridListByAgencyId(@Param("agencyId") String agencyId, @Param("pageSize") Integer pageSize);
List listGridsbystaffid(@Param("staffId") String staffId);
+
+ /**
+ * @param gridIdList
+ * @return
+ * @Description 根据网格Id集合获取网格列表信息
+ * @Author sun
+ */
+ List selectGridByIds(@Param("gridIdList") List gridIdList);
}
\ 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 477780c4bd..0553e60758 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
@@ -219,4 +219,13 @@ public interface CustomerGridService extends BaseService {
Result getAgencyAndStaffsBygridId(String gridId);
List listGridsbystaffid(String staffId);
+
+ /**
+ * @param gridIdList
+ * @return
+ * @Description 根据网格Id集合获取网格列表信息
+ * @Author sun
+ */
+ Result> getGridListByGridIds(List gridIdList);
+
}
\ 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 8f5a6d850d..7004e084cf 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
@@ -45,6 +45,7 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -200,19 +201,17 @@ public class CustomerGridServiceImpl extends BaseServiceImpl addGrid(TokenDto tokenDto, AddGridFormDTO addGridFormDTO) {
//查询是否重名
- String checkGridName = baseDao.selectGridIdByGridName(addGridFormDTO.getGridName(),addGridFormDTO.getAgencyId(),null);
- if (checkGridName!=null){
+ AddGridResultDTO gridResult = baseDao.selectGridIdByGridName(addGridFormDTO.getGridName(), addGridFormDTO.getAgencyId(), null);
+ if (gridResult!=null){
return new Result().error(EpmetErrorCode.NOT_ADD_GRID.getCode());
}
- //查询地区编码
- String areaCode = customerAgencyDao.selectAreaCodeByAgencyId(addGridFormDTO.getAgencyId());
- CustomerGridEntity customerGridEntity = new CustomerGridEntity();
- customerGridEntity.setAreaCode(areaCode);
CustomerAgencyDTO customerAgencyDTO=customerAgencyService.get(addGridFormDTO.getAgencyId());
- customerGridEntity.setCustomerId(customerAgencyDTO.getCustomerId());//查询customerId
- customerGridEntity.setGridName(addGridFormDTO.getGridName());
- customerGridEntity.setManageDistrict(addGridFormDTO.getManageDistrict());
+ CustomerGridEntity customerGridEntity = new CustomerGridEntity();
+ BeanUtils.copyProperties(addGridFormDTO,customerGridEntity);
+ customerGridEntity.setAreaCode(customerAgencyDTO.getAreaCode());
+ customerGridEntity.setCustomerId(customerAgencyDTO.getCustomerId());
customerGridEntity.setPid(addGridFormDTO.getAgencyId());
+ //所有上级机构id,必须包括当前机构id (放在所有上级机构id后)
if(StringUtils.isBlank(customerAgencyDTO.getPids())){
customerGridEntity.setPids(addGridFormDTO.getAgencyId());
}else{
@@ -222,12 +221,9 @@ public class CustomerGridServiceImpl extends BaseServiceImpl().ok(addGridResultDTO);
}
@@ -239,8 +235,8 @@ public class CustomerGridServiceImpl extends BaseServiceImpl listGridsbystaffid(String staffId) {
return baseDao.listGridsbystaffid(staffId);
}
+
+ /**
+ * @param gridIdList
+ * @return
+ * @Description 根据网格Id集合获取网格列表信息
+ * @Author sun
+ */
+ @Override
+ public Result> getGridListByGridIds(List gridIdList) {
+ Result> result = new Result>();
+ List list = baseDao.selectGridByIds(gridIdList);
+ return result.ok(list);
+ }
}
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 8b2962f518..335ff75f55 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
@@ -176,7 +176,7 @@
-
+
+
+ SELECT DISTINCT
+ grid_id
+ FROM
+ grid_latest
+ WHERE
+ del_flag = '0'
+ AND customer_user_id = #{userId}
+