Browse Source

增加orgIdPath条件

master
wangxianzhang 3 years ago
parent
commit
9e1be9537c
  1. 2
      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. 8
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java
  4. 2
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java
  5. 8
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java
  6. 24
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/ResiServiceImpl.java
  7. 1
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/IcResiUserDao.xml

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

@ -69,6 +69,7 @@ public interface IcResiUserDao extends BaseDao<IcResiUserEntity> {
* @return
*/
List<ResiByPolicyInfoResultDTO> listByPolicyRules(@Param("customerId") String customerId,
@Param("orgIdPath") String orgIdPath,
@Param("orgId") String orgId,
@Param("orgType") String orgType,
@Param("neighborHoodId") String neighborHoodId,
@ -86,6 +87,7 @@ public interface IcResiUserDao extends BaseDao<IcResiUserEntity> {
* @return
*/
Integer getTotalByPolicyRules(@Param("customerId") String customerId,
@Param("orgIdPath") String orgIdPath,
@Param("orgId") String orgId,
@Param("orgType") String orgType,
@Param("neighborHoodId") String neighborHoodId,

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

@ -201,11 +201,11 @@ public interface EpmetUserService {
*/
List<StaffSelectResDTO> staffSelectList(List<String> staffIds);
List<ResiByPolicyInfoResultDTO> listByPolicyRules(String customerId, String orgId, String orgType, String neighborHoodId, String buildingId, String unitId,
List<ResiByPolicyInfoResultDTO> listByPolicyRules(String customerId, String orgIdPath, 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,
Integer getTotalByPolicyRules(String customerId, String orgIdPath, String orgId, String orgType, String neighborHoodId, String buildingId, String unitId,
String houseId, String idCard, String name,
List<ResisByPolicyRulesFormDTO.ResiRule> resiRule, List<String> houseIds);
}

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

@ -846,15 +846,15 @@ public class EpmetUserServiceImpl implements EpmetUserService {
}
@Override
public List<ResiByPolicyInfoResultDTO> listByPolicyRules(String customerId, String orgId, String orgType, String neighborHoodId, String buildingId, String unitId,
public List<ResiByPolicyInfoResultDTO> listByPolicyRules(String customerId, String orgIdPath, 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) {
PageHelper.startPage(pageNo, pageSize);
return icResiUserDao.listByPolicyRules(customerId, orgId, orgType, neighborHoodId, buildingId, unitId, houseId, idCard, name, resiRule, houseIds);
return icResiUserDao.listByPolicyRules(customerId, orgIdPath, 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);
public Integer getTotalByPolicyRules(String customerId, String orgIdPath, 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, orgIdPath, orgId, orgType, neighborHoodId, buildingId, unitId, houseId, idCard, name, resiRule, houseIds);
}
}

2
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java

@ -218,7 +218,7 @@ public interface GovOrgService {
*/
CustomerAgencyEntity getRootAgencyByCustomerId(String customerId);
List<IcHouseEntity> listHousesByRules(String customerId, String orgId, String orgType, String neighborHoodId, String buildingId,
List<IcHouseEntity> listHousesByRules(String customerId, String orgIdPath, String orgId, String orgType, String neighborHoodId, String buildingId,
String unitId, String houseId, List<ResisByPolicyRulesFormDTO.HouseRule> houseRule,
List<ResisByPolicyRulesFormDTO.StatRule> statRule, Integer pageNo, Integer pageSize);

8
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java

@ -1110,7 +1110,7 @@ public class GovOrgServiceImpl implements GovOrgService {
}
@Override
public List<IcHouseEntity> listHousesByRules(String customerId, String orgId, String orgType, String neighborHoodId, String buildingId,
public List<IcHouseEntity> listHousesByRules(String customerId, String orgIdPath, String orgId, String orgType, String neighborHoodId, String buildingId,
String unitId, String houseId, List<ResisByPolicyRulesFormDTO.HouseRule> houseRule,
List<ResisByPolicyRulesFormDTO.StatRule> statRule, Integer pageNo, Integer pageSize) {
@ -1120,11 +1120,13 @@ public class GovOrgServiceImpl implements GovOrgService {
QueryWrapper<IcHouseEntity> query = new QueryWrapper<>();
// 如果参数里面选了,就用参数选择的来查询,没有选择的话,就查询当前工作人员所属组织的本级及下级
if (StringUtils.isNotBlank(orgId) && StringUtils.isNotBlank(orgType)) {
String orgIdPath = getOrgIdPath(orgId, orgType);
query.likeRight(StringUtils.isNotBlank(orgIdPath), "ORG_ID_PATH", orgIdPath);
orgIdPath = getOrgIdPath(orgId, orgType);
}
query.likeRight(StringUtils.isNotBlank(orgIdPath), "ORG_ID_PATH", orgIdPath);
if (StringUtils.isNotBlank(customerId)) {
query.eq("CUSTOMER_ID", customerId);
}

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

@ -22,7 +22,10 @@ import com.epmet.dataaggre.service.ResiService;
import com.epmet.dataaggre.service.epmetuser.EpmetUserService;
import com.epmet.dataaggre.service.govorg.GovOrgService;
import com.epmet.dto.IcNeighborHoodDTO;
import com.epmet.dto.form.LoginUserDetailsFormDTO;
import com.epmet.dto.result.LoginUserDetailsResultDTO;
import com.epmet.feign.EpmetHeartOpenFeignClient;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.github.pagehelper.PageInfo;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
@ -48,21 +51,34 @@ public class ResiServiceImpl implements ResiService, ResultDataResolver {
@Autowired
private EpmetHeartOpenFeignClient heartOpenFeignClient;
@Autowired
private EpmetUserOpenFeignClient userOpenFeignClient;
@Override
public PageData<ResiByPolicyInfoResultDTO> listByPolicyRules(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<ResisByPolicyRulesFormDTO.HouseRule> houseRule,
List<ResisByPolicyRulesFormDTO.StatRule> statRule) {
String userId = EpmetRequestHolder.getLoginUserId();
String app = EpmetRequestHolder.getLoginUserApp();
String client = EpmetRequestHolder.getLoginUserClient();
String customerId = EpmetRequestHolder.getLoginUserCustomerId();
// 查询当前组织及下级id路径
LoginUserDetailsResultDTO userDetail = getResultDataOrThrowsException(userOpenFeignClient.getLoginUserDetails(new LoginUserDetailsFormDTO(app, client, userId)),
ServiceConstant.EPMET_USER_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), null, null);
String orgIdPath = userDetail.getOrgIdPath();
// 结果集
List<ResiByPolicyInfoResultDTO> resultResis = new ArrayList<>();
// 1.用户没配置house和stat规则,直接按照居民规则查询
if (CollectionUtils.isEmpty(houseRule) && CollectionUtils.isEmpty(statRule)) {
List<ResiByPolicyInfoResultDTO> resis = epmetUserService.listByPolicyRules(customerId, orgId, orgType, neighborHoodId, buildingId, unitId,
List<ResiByPolicyInfoResultDTO> resis = epmetUserService.listByPolicyRules(customerId, orgIdPath, orgId, orgType, neighborHoodId, buildingId, unitId,
houseId, idCard, name, pageNo, pageSize, resiRule, null);
fillResisExtraInfoForPolicy(resis);
return new PageData<>(resis, new PageInfo(resis).getTotal());
}
@ -71,7 +87,7 @@ public class ResiServiceImpl implements ResiService, ResultDataResolver {
int total = 0;
do {
// 拿到房屋id列表,去查询居民列表
List<IcHouseEntity> houseEntities = govOrgService.listHousesByRules(customerId, orgId, orgType, neighborHoodId, buildingId, unitId,
List<IcHouseEntity> houseEntities = govOrgService.listHousesByRules(customerId, orgIdPath, orgId, orgType, neighborHoodId, buildingId, unitId,
houseId, houseRule, statRule, housePageNo, 50);
List<String> houseIds = houseEntities.stream().map(icHouseEntity -> icHouseEntity.getId()).collect(Collectors.toList());
@ -83,7 +99,7 @@ public class ResiServiceImpl implements ResiService, ResultDataResolver {
// 查询居民,满了20个,不再查询数据,只查询数量
if (resultResis.size() < pageSize) {
List<ResiByPolicyInfoResultDTO> resis = epmetUserService.listByPolicyRules(
customerId, orgId, orgType, neighborHoodId, buildingId, unitId,
customerId, orgIdPath, orgId, orgType, neighborHoodId, buildingId, unitId,
houseId, idCard, name, pageNo, pageSize, resiRule, houseIds);
resultResis.addAll(resis);
@ -91,7 +107,7 @@ public class ResiServiceImpl implements ResiService, ResultDataResolver {
// 查询数量
Integer count = epmetUserService.getTotalByPolicyRules(
customerId, orgId, orgType, neighborHoodId, buildingId, unitId,
customerId, orgIdPath, orgId, orgType, neighborHoodId, buildingId, unitId,
houseId, idCard, name, resiRule, houseIds);
total += count;

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

@ -73,6 +73,7 @@
<where>
ic_resi_user.status='0'
and ic_resi_user.CUSTOMER_ID=#{customerId}
and ic_resi_user.PIDS LIKE CONCAT(#{orgIdPath},'%')
and ic_resi_user.del_flag='0'
<!--组织过滤-->
<if test="orgId != null and orgId != '' and orgType != null and orgType != ''">

Loading…
Cancel
Save