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 77006089a4..ee070de1f7 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 @@ -18,7 +18,6 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; -import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; @@ -32,7 +31,6 @@ import com.epmet.dto.result.CustomerGridForStrangerResultDTO; import com.epmet.dto.result.GridInfoResultDTO; import com.epmet.dto.result.*; import com.epmet.entity.CustomerGridEntity; -import org.springframework.web.bind.annotation.RequestBody; import java.util.List; import java.util.Map; 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 043bb3a5d7..d6ce45b9a9 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 @@ -21,27 +21,17 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.FieldConstant; -import com.epmet.commons.tools.constant.FieldConstant; -import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dao.CustomerGridDao; -import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dao.CustomerStaffGridDao; import com.epmet.dto.*; import com.epmet.dto.form.*; import com.epmet.dto.result.*; -import com.epmet.dto.CustomerGridDTO; -import com.epmet.dto.CustomerStaffGridDTO; -import com.epmet.dto.StaffGridListDTO; -import com.epmet.dto.form.CommonAgencyIdFormDTO; -import com.epmet.dto.form.CustomerGridFormDTO; -import com.epmet.dto.form.ListCustomerGridFormDTO; -import com.epmet.dto.result.CustomerGridForStrangerResultDTO; -import com.epmet.dto.result.GridInfoResultDTO; import com.epmet.entity.CustomerGridEntity; import com.epmet.feign.EpmetUserFeignClient; import com.epmet.redis.CustomerGridRedis; @@ -57,7 +47,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; - import java.util.*; import java.util.stream.Collectors; @@ -73,8 +62,6 @@ public class CustomerGridServiceImpl extends BaseServiceImpl().ok(baseDao.getCustomerGridByGridId(customerGridFormDTO)); } - @Override - public Result getGridInfo(String gridId) { - GridInfoResultDTO gridInfoResultDTO=new GridInfoResultDTO(); - CustomerGridDTO customerGridDTO = this.get(gridId); - if(null==customerGridDTO){ - return new Result<>(); - } - gridInfoResultDTO.setCustomerId(customerGridDTO.getCustomerId()); - String pids=customerGridDTO.getPids(); - String[] pidArray = pids.split(":"); - for(String agencyId:pidArray){ - CustomerAgencyDTO customerAgencyDTO=customerAgencyService.get(agencyId); - if(null!=customerAgencyDTO){ - switch(customerAgencyDTO.getLevel()){ - case "community" : - //社区级 - gridInfoResultDTO.setCommuityId(customerAgencyDTO.getId()); - gridInfoResultDTO.setCommnuityName(customerAgencyDTO.getOrganizationName()); - break; - case "street" : - //乡(镇、街道)级 - gridInfoResultDTO.setStreetId(customerAgencyDTO.getId()); - gridInfoResultDTO.setStreetName(customerAgencyDTO.getOrganizationName()); - break; - case "district": - //区县级 - gridInfoResultDTO.setDistrictId(customerAgencyDTO.getId()); - gridInfoResultDTO.setDistrictName(customerAgencyDTO.getOrganizationName()); - break; - case "city": - //市级 - gridInfoResultDTO.setCityId(customerAgencyDTO.getId()); - gridInfoResultDTO.setCityName(customerAgencyDTO.getOrganizationName()); - break; - case "province": - //省级 - gridInfoResultDTO.setProvinceId(customerAgencyDTO.getId()); - gridInfoResultDTO.setProviceName(customerAgencyDTO.getOrganizationName()); - break; - } - } - } - return new Result().ok(gridInfoResultDTO); - } - /** * @param userId * @return @@ -468,4 +410,49 @@ public class CustomerGridServiceImpl extends BaseServiceImpl getGridInfo(String gridId) { + GridInfoResultDTO gridInfoResultDTO=new GridInfoResultDTO(); + CustomerGridDTO customerGridDTO = this.get(gridId); + if(null==customerGridDTO){ + return new Result<>(); + } + gridInfoResultDTO.setCustomerId(customerGridDTO.getCustomerId()); + String pids=customerGridDTO.getPids(); + String[] pidArray = pids.split(":"); + for(String agencyId:pidArray){ + CustomerAgencyDTO customerAgencyDTO=customerAgencyService.get(agencyId); + if(null!=customerAgencyDTO){ + switch(customerAgencyDTO.getLevel()){ + case "community" : + //社区级 + gridInfoResultDTO.setCommuityId(customerAgencyDTO.getId()); + gridInfoResultDTO.setCommnuityName(customerAgencyDTO.getOrganizationName()); + break; + case "street" : + //乡(镇、街道)级 + gridInfoResultDTO.setStreetId(customerAgencyDTO.getId()); + gridInfoResultDTO.setStreetName(customerAgencyDTO.getOrganizationName()); + break; + case "district": + //区县级 + gridInfoResultDTO.setDistrictId(customerAgencyDTO.getId()); + gridInfoResultDTO.setDistrictName(customerAgencyDTO.getOrganizationName()); + break; + case "city": + //市级 + gridInfoResultDTO.setCityId(customerAgencyDTO.getId()); + gridInfoResultDTO.setCityName(customerAgencyDTO.getOrganizationName()); + break; + case "province": + //省级 + gridInfoResultDTO.setProvinceId(customerAgencyDTO.getId()); + gridInfoResultDTO.setProviceName(customerAgencyDTO.getOrganizationName()); + break; + } + } + } + return new Result().ok(gridInfoResultDTO); + } + }