Browse Source

【政策】人员预览列表基本应该差不多了

master
wangxianzhang 3 years ago
parent
commit
41b65f9d34
  1. 17
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/IcResiUserDao.java
  2. 4
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java
  3. 5
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java
  4. 33
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/ResiServiceImpl.java
  5. 39
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/IcResiUserDao.xml

17
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/IcResiUserDao.java

@ -79,4 +79,21 @@ public interface IcResiUserDao extends BaseDao<IcResiUserEntity> {
@Param("name") String name,
@Param("resiRules") List<ResisByPolicyRulesFormDTO.ResiRule> resiRule,
@Param("houseIds") List<String> houseIds);
/**
* 政策查找居民
* @param houseIds
* @return
*/
Integer getTotalByPolicyRules(@Param("customerId") String customerId,
@Param("orgId") String orgId,
@Param("orgType") String orgType,
@Param("neighborHoodId") String neighborHoodId,
@Param("buildingId") String buildingId,
@Param("unitId") String unitId,
@Param("houseId") String houseId,
@Param("idCard") String idCard,
@Param("name") String name,
@Param("resiRules") List<ResisByPolicyRulesFormDTO.ResiRule> resiRule,
@Param("houseIds") List<String> houseIds);
}

4
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java

@ -204,4 +204,8 @@ public interface EpmetUserService {
List<ResiByPolicyInfoResultDTO> listByPolicyRules(String customerId, String orgId, String orgType, String neighborHoodId, String buildingId, String unitId,
String houseId, String idCard, String name, Integer pageNo, Integer pageSize,
List<ResisByPolicyRulesFormDTO.ResiRule> resiRule, List<String> houseIds);
Integer getTotalByPolicyRules(String customerId, String orgId, String orgType, String neighborHoodId, String buildingId, String unitId,
String houseId, String idCard, String name,
List<ResisByPolicyRulesFormDTO.ResiRule> resiRule, List<String> houseIds);
}

5
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java

@ -851,4 +851,9 @@ public class EpmetUserServiceImpl implements EpmetUserService {
return icResiUserDao.listByPolicyRules(customerId, orgId, orgType, neighborHoodId, buildingId, unitId, houseId, idCard, name, resiRule, houseIds);
}
@Override
public Integer getTotalByPolicyRules(String customerId, String orgId, String orgType, String neighborHoodId, String buildingId, String unitId, String houseId, String idCard, String name, List<ResisByPolicyRulesFormDTO.ResiRule> resiRule, List<String> houseIds) {
return icResiUserDao.getTotalByPolicyRules(customerId, orgId, orgType, neighborHoodId, buildingId, unitId, houseId, idCard, name, resiRule, houseIds);
}
}

33
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/ResiServiceImpl.java

@ -48,7 +48,8 @@ public class ResiServiceImpl implements ResiService {
}
// 2.用户至少配置了house和stat规则的一个,那么就先查询房屋出来,然后根据房屋去找居民
int housePageNo = 0;
int housePageNo = 1;
int total = 0;
do {
// 拿到房屋id列表,去查询居民列表
List<IcHouseEntity> houseEntities = govOrgService.listHousesByRules(customerId, orgId, orgType, neighborHoodId, buildingId, unitId,
@ -60,19 +61,22 @@ public class ResiServiceImpl implements ResiService {
break;
}
// 查询居民
List<ResiByPolicyInfoResultDTO> resis = epmetUserService.listByPolicyRules(
customerId, orgId, orgType, neighborHoodId, buildingId, unitId,
houseId, idCard, name, pageNo, pageSize, resiRule, houseIds);
resultResis.addAll(resis);
// 查询居民,满了20个,不再查询数据,只查询数量
if (resultResis.size() < pageSize) {
List<ResiByPolicyInfoResultDTO> resis = epmetUserService.listByPolicyRules(
customerId, orgId, orgType, neighborHoodId, buildingId, unitId,
houseId, idCard, name, pageNo, pageSize, resiRule, houseIds);
// 满了20个,或者查不到居民和房屋了(数据空了),则跳出
// 没有用house的条件,没有循环的必要,查一次居民信息即可,跳出
if (resultResis.size() >= pageSize) {
break;
resultResis.addAll(resis);
}
// 查询数量
Integer count = epmetUserService.getTotalByPolicyRules(
customerId, orgId, orgType, neighborHoodId, buildingId, unitId,
houseId, idCard, name, resiRule, houseIds);
total += count;
housePageNo ++;
} while (true);
@ -83,8 +87,7 @@ public class ResiServiceImpl implements ResiService {
// 补充额外信息
fillResisExtraInfoForPolicy(resultResis);
// todo
return new PageData<>(resultResis, 100);
return new PageData<>(resultResis, total);
}
/**
@ -92,6 +95,10 @@ public class ResiServiceImpl implements ResiService {
* @param resultResis
*/
private void fillResisExtraInfoForPolicy(List<ResiByPolicyInfoResultDTO> resultResis) {
if (CollectionUtils.isEmpty(resultResis)) {
return;
}
List<String> gridIds = new ArrayList<>();
List<String> neighborhoodIds = new ArrayList<>();
resultResis.stream().forEach((r) -> {

39
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/IcResiUserDao.xml

@ -69,19 +69,7 @@
and resi.STATUS='0'
</select>
<!--政策查找-->
<select id="listByPolicyRules" resultType="com.epmet.dataaggre.dto.epmetuser.result.ResiByPolicyInfoResultDTO">
select `ID` as icResiUserId,
`GRID_ID`,
`NAME`,
`MOBILE`,
`ID_CARD`,
`VILLAGE_ID` as neighborhoodId,
`BIRTHDAY`
from ic_resi_user
<foreach collection="resiRules" item="rule">
<if test="rule.colTable != 'ic_resi_user'"> inner join #{rule.colTable}</if>
</foreach>
<sql id="segmentForPolicyRules">
<where>
ic_resi_user.CUSTOMER_ID=#{customerId}
<!--组织过滤-->
@ -129,6 +117,31 @@
</foreach>
</if>
</where>
</sql>
<!--政策查找-->
<select id="listByPolicyRules" resultType="com.epmet.dataaggre.dto.epmetuser.result.ResiByPolicyInfoResultDTO">
select `ID` as icResiUserId,
`GRID_ID`,
`NAME`,
`MOBILE`,
`ID_CARD`,
`VILLAGE_ID` as neighborhoodId,
`BIRTHDAY`
from ic_resi_user
<foreach collection="resiRules" item="rule">
<if test="rule.colTable != 'ic_resi_user'"> inner join #{rule.colTable}</if>
</foreach>
<include refid="segmentForPolicyRules"></include>
</select>
<select id="getTotalByPolicyRules" resultType="int">
select count(1)
from ic_resi_user
<foreach collection="resiRules" item="rule">
<if test="rule.colTable != 'ic_resi_user'"> inner join #{rule.colTable}</if>
</foreach>
<include refid="segmentForPolicyRules"></include>
</select>
</mapper>

Loading…
Cancel
Save