diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java index 152f147f5f..9e1dcdd59d 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java @@ -615,6 +615,7 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl resultDTOS = customerGridService.getGridIListByAgency(agencyId); return new Result>().ok(resultDTOS); } + + /** + * @Author sun + * @Description 查询组织直属网格列表 + **/ + @PostMapping("getGridIListByAgency/{agencyId}") + public Result> gridListByAgencyId(@PathVariable("agencyId") String agencyId) { + return new Result>().ok(customerGridService.gridListByAgencyId(agencyId)); + } + } 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 d6ac66d201..2b2624ac54 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 @@ -348,4 +348,10 @@ public interface CustomerGridService extends BaseService { * @Date 2021/11/29 17:00 */ List getGridIListByAgency(String agencyId); + + /** + * @Author sun + * @Description 查询组织直属网格列表 + **/ + List gridListByAgencyId(String agencyId); } 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 9b6f41daad..b09d46e52b 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 @@ -22,7 +22,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; 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.rocketmq.messages.OrgOrStaffMQMsg; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; @@ -47,7 +46,6 @@ import com.epmet.entity.CustomerGridEntity; import com.epmet.feign.EpmetMessageOpenFeignClient; import com.epmet.feign.EpmetUserFeignClient; import com.epmet.feign.OperCrmOpenFeignClient; -import com.epmet.send.SendMqMsgUtil; import com.epmet.service.CustomerAgencyService; import com.epmet.service.CustomerGridService; import com.epmet.util.ModuleConstant; @@ -866,4 +864,14 @@ public class CustomerGridServiceImpl extends BaseServiceImpl gridListByAgencyId(String agencyId) { + List result = baseDao.selectAgencyGridMsgList(agencyId); + return result; + } + } diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml index f35fe34fed..88ad6386d6 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml @@ -340,11 +340,27 @@ SELECT - cg.id AS "gridId", + cg.id gridId, CONCAT( ca.organization_name, "-", cg.grid_name - ) "agencyGridName" + ) agencyGridName, + cg.grid_name gridName, + + ( CASE WHEN cg.longitude is null THEN + ( SELECT longitude FROM customer_agency + WHERE del_flag = '0' AND customer_id = (SELECT customer_id FROM customer_agency WHERE id = ca.id) + ORDER BY pid ASC LIMIT 1 + ) + ELSE cg.longitude + END + ) longitude, + ( CASE WHEN cg.latitude is null THEN + ( SELECT latitude FROM customer_agency + WHERE del_flag = '0' AND customer_id = (SELECT customer_id FROM customer_agency WHERE id = ca.id) + ORDER BY pid ASC LIMIT 1 + ) + ELSE cg.latitude + END + ) latitude FROM customer_grid cg INNER JOIN customer_agency ca ON cg.pid = ca.id