diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/AgencySubTreeDto.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/AgencySubTreeDto.java new file mode 100644 index 0000000000..f68be23990 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/AgencySubTreeDto.java @@ -0,0 +1,41 @@ +package com.epmet.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description + * @ClassName AgencySubTreeDto + * @Auth wangc + * @Date 2020-06-16 16:51 + */ +@Data +public class AgencySubTreeDto implements Serializable { + private static final long serialVersionUID = 312765293830315198L; + /** + * 机构Id + * */ + private String agencyId; + + /** + * 机构名称 + * */ + private String agencyName; + + /** + * 直属网格Id + * */ + List gridIds; + + /** + * 客户Id + * */ + String customerId; + + /** + * 下级机关集合 + * */ + List subAgencies; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java index 08b6880295..69cdd8776f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java @@ -1,11 +1,14 @@ package com.epmet.controller; +import com.epmet.dto.AgencySubTreeDto; import com.epmet.service.StatsDemoService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import java.util.List; + @RequestMapping("demo") @RestController public class DemoController { @@ -23,5 +26,11 @@ public class DemoController { demoService.testTx(); } + @GetMapping("cascadegencyinfo") + public List selectAllAgency(){ + List result = demoService.getAllAgency(); + return result; + } + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/StatsCustomerAgencyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/StatsCustomerAgencyDao.java index 8e6b2330bd..ef6ab4005d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/StatsCustomerAgencyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/StatsCustomerAgencyDao.java @@ -1,8 +1,10 @@ package com.epmet.dao.org; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.AgencySubTreeDto; import com.epmet.entity.org.CustomerAgencyEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import java.util.List; @@ -11,4 +13,7 @@ public interface StatsCustomerAgencyDao extends BaseDao { List listAllEntities(); + List selectAllAgency(); + + List selectSubAgencyByPid(@Param("pid")String pid); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsDemoService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsDemoService.java index 1952ade8bf..3ee8455f70 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsDemoService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsDemoService.java @@ -1,8 +1,12 @@ package com.epmet.service; +import com.epmet.dto.AgencySubTreeDto; + +import java.util.List; + public interface StatsDemoService { void testList(); void testTx(); - + List getAllAgency(); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDemoServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDemoServiceImpl.java index 19cd01f578..cde6df48b8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDemoServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDemoServiceImpl.java @@ -1,5 +1,6 @@ package com.epmet.service.impl; +import com.epmet.dto.AgencySubTreeDto; import com.epmet.entity.issue.IssueEntity; import com.epmet.entity.org.CustomerAgencyEntity; import com.epmet.service.Issue.DemoIssueService; @@ -37,4 +38,8 @@ public class StatsDemoServiceImpl implements StatsDemoService { public void testTx() { demoDataStatsService.testTx(); } + + public List getAllAgency(){ + return demoGovOrgService.getAllAgency(); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/DemoGovOrgService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/DemoGovOrgService.java index e0f0c7369a..d5086c6b4e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/DemoGovOrgService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/DemoGovOrgService.java @@ -1,9 +1,12 @@ package com.epmet.service.org; +import com.epmet.dto.AgencySubTreeDto; import com.epmet.entity.org.CustomerAgencyEntity; import java.util.List; public interface DemoGovOrgService { List listAllEntities(); + + List getAllAgency(); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/DemoGovOrgServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/DemoGovOrgServiceImpl.java index 643510086b..0d1f46e0cb 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/DemoGovOrgServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/DemoGovOrgServiceImpl.java @@ -3,6 +3,7 @@ package com.epmet.service.org.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.constant.DataSourceConstant; import com.epmet.dao.org.StatsCustomerAgencyDao; +import com.epmet.dto.AgencySubTreeDto; import com.epmet.entity.org.CustomerAgencyEntity; import com.epmet.service.org.DemoGovOrgService; import org.springframework.beans.factory.annotation.Autowired; @@ -20,4 +21,9 @@ public class DemoGovOrgServiceImpl implements DemoGovOrgService { public List listAllEntities() { return govOrgDao.listAllEntities(); } + + @Override + public List getAllAgency() { + return govOrgDao.selectAllAgency(); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/StatsCustomerAgencyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/StatsCustomerAgencyDao.xml index 789a79dfe1..937233021b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/StatsCustomerAgencyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/StatsCustomerAgencyDao.xml @@ -10,4 +10,55 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file