diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java index 31f4614347..58b836df68 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java @@ -24,6 +24,7 @@ import com.epmet.dto.IcResiUserDTO; import com.epmet.dto.IcVolunteerPolyDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.*; +import com.epmet.dto.result.lingshan.LingShanSpecialCrowdStatsByOrgResultDTO; import com.epmet.entity.IcResiUserEntity; import org.apache.ibatis.annotations.MapKey; import org.apache.ibatis.annotations.Mapper; @@ -470,4 +471,13 @@ public interface IcResiUserDao extends BaseDao { * @return */ IcResiUserEntity getById(String icResiUserId); + + /** + * @Description: 根据orgIdPath计算各个组织下的特殊人群数量 + * @param orgIdPath: + * @Return java.util.List + * @Author: wangxianzhang + * @Date: 2023/5/24 9:27 AM + */ + List countSpecialQtyByOrgIdPath(@Param("orgIdPath") List orgIdPath); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/LingShanScreenServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/LingShanScreenServiceImpl.java index bb2438083e..c4f3c079dc 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/LingShanScreenServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/LingShanScreenServiceImpl.java @@ -18,7 +18,6 @@ import com.epmet.entity.*; import com.epmet.enums.LingShanSpecialCrowdTypeEnums; import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.service.LingShanScreenService; -import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -47,6 +46,9 @@ public class LingShanScreenServiceImpl implements LingShanScreenService, ResultD @Autowired private GovOrgOpenFeignClient govOrgOpenFeignClient; + @Autowired + private IcResiUserDao icResiUserDao; + @Override public List specialCrowdStatsCountBySubOrg(String parentAgencyId, String specialType) { List subOrgs = getResultDataOrThrowsException(govOrgOpenFeignClient.subOrgList(parentAgencyId), ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), null, null); @@ -77,30 +79,31 @@ public class LingShanScreenServiceImpl implements LingShanScreenService, ResultD return t; }).collect(Collectors.toList()); - - List ol = new ArrayList<>(); - if (LingShanSpecialCrowdTypeEnums.AZBJ.getType().equals(specialType) || StringUtils.isBlank(specialType)) { - ol.addAll(azbjDao.statsCountsByOrgIds(orgIdPaths)); - } - if (LingShanSpecialCrowdTypeEnums.SQJZ.getType().equals(specialType) || StringUtils.isBlank(specialType)) { - ol.addAll(sqjzDao.statsCountsByOrgIds(orgIdPaths)); - } - if (LingShanSpecialCrowdTypeEnums.XFRY.getType().equals(specialType) || StringUtils.isBlank(specialType)) { - ol.addAll(xfryDao.statsCountsByOrgIds(orgIdPaths)); - } - if (LingShanSpecialCrowdTypeEnums.JDRY.getType().equals(specialType) || StringUtils.isBlank(specialType)) { - ol.addAll(jdryDao.statsCountsByOrgIds(orgIdPaths)); - } - if (LingShanSpecialCrowdTypeEnums.JZHZ.getType().equals(specialType) || StringUtils.isBlank(specialType)) { - ol.addAll(jzhzDao.statsCountsByOrgIds(orgIdPaths)); - } + List ol = icResiUserDao.countSpecialQtyByOrgIdPath(orgIdPaths); + + // List ol = new ArrayList<>(); + // if (LingShanSpecialCrowdTypeEnums.AZBJ.getType().equals(specialType) || StringUtils.isBlank(specialType)) { + // ol.addAll(azbjDao.statsCountsByOrgIds(orgIdPaths)); + // } + // if (LingShanSpecialCrowdTypeEnums.SQJZ.getType().equals(specialType) || StringUtils.isBlank(specialType)) { + // ol.addAll(sqjzDao.statsCountsByOrgIds(orgIdPaths)); + // } + // if (LingShanSpecialCrowdTypeEnums.XFRY.getType().equals(specialType) || StringUtils.isBlank(specialType)) { + // ol.addAll(xfryDao.statsCountsByOrgIds(orgIdPaths)); + // } + // if (LingShanSpecialCrowdTypeEnums.JDRY.getType().equals(specialType) || StringUtils.isBlank(specialType)) { + // ol.addAll(jdryDao.statsCountsByOrgIds(orgIdPaths)); + // } + // if (LingShanSpecialCrowdTypeEnums.JZHZ.getType().equals(specialType) || StringUtils.isBlank(specialType)) { + // ol.addAll(jzhzDao.statsCountsByOrgIds(orgIdPaths)); + // } // 开始给rl++ - for (LingShanSpecialCrowdStatsByOrgResultDTO o : ol) { - for (LingShanSpecialCrowdStatsByOrgResultDTO r : rl) { - if (o.getOrgIdPath().contains(r.getOrgIdPath())) { + for (LingShanSpecialCrowdStatsByOrgResultDTO qtyData : ol) { + for (LingShanSpecialCrowdStatsByOrgResultDTO subOrg : rl) { + if (qtyData.getOrgIdPath().contains(subOrg.getOrgIdPath())) { // 如果ol中的数据,orgIdPath包含了这个组织的orgIdPath,说明这条数据就是这个组织的数据,那就++把 - r.setQuantity(r.getQuantity() + o.getQuantity()); + subOrg.setQuantity(subOrg.getQuantity() + qtyData.getQuantity()); } } } diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml index b2b6b36861..5b835aa4f7 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml @@ -1531,4 +1531,18 @@ + + +