From 94e3a209bb9a31c4ddbd31494bb1628f6fe2e96e Mon Sep 17 00:00:00 2001 From: lidongdong <1459917685@qq.com> Date: 星期三, 12 十月 2022 17:54:49 +0800 Subject: [PATCH] 新增首页工单 办事指南排行榜接口 导办人员排行榜接口 组织排行榜接口 新增办事指南统计接口 导办人员统计接口 组织胖行榜统计接口 --- flower_city/src/main/java/com/dg/core/service/impl/AreaCodeServiceImpl.java | 31 ++++++++++++++++++++++--------- 1 files changed, 22 insertions(+), 9 deletions(-) diff --git a/flower_city/src/main/java/com/dg/core/service/impl/AreaCodeServiceImpl.java b/flower_city/src/main/java/com/dg/core/service/impl/AreaCodeServiceImpl.java index c2be340..7fd2db9 100644 --- a/flower_city/src/main/java/com/dg/core/service/impl/AreaCodeServiceImpl.java +++ b/flower_city/src/main/java/com/dg/core/service/impl/AreaCodeServiceImpl.java @@ -13,6 +13,7 @@ import javax.annotation.Resource; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; @Service @@ -26,6 +27,7 @@ @Override public List<AreaCode2022> getAreaCodeByTransactionId(Integer transactionId){ +// HashMap<Object, Object> objectObjectHashMap = new HashMap<>(); TransactionEvent transactionEvent = transactionEventMapper.selectOne(new QueryWrapper<TransactionEvent>().lambda(). eq(TransactionEvent::getId, transactionId)); OrganizationChartEntity organizationChartEntity = organizationChartMapper.selectOne(new QueryWrapper<OrganizationChartEntity>().lambda() @@ -46,20 +48,31 @@ return baseMapper.selectByIdSet(areaCodes); } + public List<String> getAreaCodeIds(List<String> areaCodes, OrganizationChartEntity organizationChartEntity){ - organizationChartEntity = organizationChartMapper.selectOne(new QueryWrapper<OrganizationChartEntity>().lambda() + List<OrganizationChartEntity> organizationChartEntitys= organizationChartMapper.selectList(new QueryWrapper<OrganizationChartEntity>().lambda() .eq(OrganizationChartEntity::getParentId, organizationChartEntity.getId())); - if (organizationChartEntity!=null){ - if (organizationChartEntity.getCity()!=null) - areaCodes.add(organizationChartEntity.getCity()); - if (organizationChartEntity.getDistrict()!=null) - areaCodes.add(organizationChartEntity.getDistrict()); - if (organizationChartEntity.getVillage()!=null) - areaCodes.add(organizationChartEntity.getVillage()); - getAreaCodeIds(areaCodes,organizationChartEntity); + for (OrganizationChartEntity organizationChart:organizationChartEntitys) { + if (organizationChart.getCity()!=null) + areaCodes.add(organizationChart.getCity()); + if (organizationChart.getDistrict()!=null) + areaCodes.add(organizationChart.getDistrict()); + if (organizationChart.getVillage()!=null) + areaCodes.add(organizationChart.getVillage()); + getAreaCodeIds(areaCodes,organizationChart); } return areaCodes; } + @Override + public List<AreaCode2022> getListByPCode(String id){ + List<AreaCode2022> areaCode2022s = baseMapper.selectList(new QueryWrapper<AreaCode2022>().lambda().eq(AreaCode2022::getPcode, id)); + for (AreaCode2022 areaCode2022:areaCode2022s) { + if (areaCode2022.getLevel()!=3) + areaCode2022.setChild(this.getListByPCode(areaCode2022.getCode().toString())); + } + return areaCode2022s; + } + } -- Gitblit v1.7.1