Browse Source

人户状况

master
zxc 3 years ago
parent
commit
88821961cd
  1. 15
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/SubUserHouseListResultDTO.java
  2. 20
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java
  3. 28
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/RHZKStatisticsFormDTO.java
  4. 1
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/RHZKStatisticsResultDTO.java
  5. 4
      epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java
  6. 5
      epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java
  7. 11
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java
  8. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java
  9. 6
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java
  10. 27
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java
  11. 11
      epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml

15
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/SubUserHouseListResultDTO.java

@ -1,8 +1,10 @@
package com.epmet.dto.result;
import com.epmet.commons.tools.constant.NumConstant;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* @author sun
@ -79,4 +81,17 @@ public class SubUserHouseListResultDTO implements Serializable {
*/
private Double ldUserRatio = 0.0;
/**
* 人户一致人在户不在户在人不在
* 为空的 暂不清楚
*/
private Integer rhyzUserTotal = NumConstant.ZERO;
private BigDecimal rhyzUserRatio = NumConstant.ZERO_DECIMAL;
private Integer rzhbzUserTotal = NumConstant.ZERO;
private BigDecimal rzhbzUserRatio = NumConstant.ZERO_DECIMAL;
private Integer hzrzUserTotal = NumConstant.ZERO;
private BigDecimal hzrzUserRatio = NumConstant.ZERO_DECIMAL;
private Integer zbqcUserTotal = NumConstant.ZERO;
private BigDecimal zbqcUserRatio = NumConstant.ZERO_DECIMAL;
}

20
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java

@ -935,6 +935,13 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
if (!userResult.success()) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取居民人房统计数据失败" + userResult.getInternalMsg(), userResult.getMsg());
}
RHZKStatisticsFormDTO rhzkStatisticsFormDTO = new RHZKStatisticsFormDTO();
rhzkStatisticsFormDTO.setOrgIds(idList);
rhzkStatisticsFormDTO.setOrgType(orgType);
Result<List<RHZKStatisticsResultDTO>> rhzkResult = epmetUserOpenFeignClient.renHuCondition(rhzkStatisticsFormDTO);
if (!rhzkResult.success()){
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取居民人户状况统计数据失败" + rhzkResult.getInternalMsg(), rhzkResult.getMsg());
}
//3.汇总封装数据
SubUserHouseListResultDTO dto = null;
for (String id : idList) {
@ -964,6 +971,19 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
dto.setLdUserRatio(u.getLdUserRatio());
}
}
for (RHZKStatisticsResultDTO r : rhzkResult.getData()) {
if (r.getOrgId().equals(id)){
dto.setRhyzUserTotal(r.getRhyzUserTotal());
dto.setRhyzUserRatio(r.getRhyzUserRatio());
dto.setRzhbzUserTotal(r.getRzhbzUserTotal());
dto.setRzhbzUserRatio(r.getRzhbzUserRatio());
dto.setHzrzUserTotal(r.getHzrzUserTotal());
dto.setHzrzUserRatio(r.getHzrzUserRatio());
dto.setZbqcUserTotal(r.getZbqcUserTotal());
dto.setZbqcUserRatio(r.getZbqcUserRatio());
dto.setUserTotal(r.getUserTotal());
}
}
list.add(dto);
}
return list;

28
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/RHZKStatisticsFormDTO.java

@ -0,0 +1,28 @@
package com.epmet.dto.form;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @Author zxc
* @DateTime 2022/11/16 13:26
*/
@Data
public class RHZKStatisticsFormDTO implements Serializable {
private static final long serialVersionUID = -4474168123286467820L;
private String orgId;
private List<String> orgIds;
/**
* grid网格village小区
*/
private String orgType;
private String staffId;
private String customerId;
}

1
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/RHZKStatisticsResultDTO.java

@ -30,6 +30,7 @@ public class RHZKStatisticsResultDTO implements Serializable {
private Integer zbqcUserTotal = NumConstant.ZERO;
private BigDecimal zbqcUserRatio = NumConstant.ZERO_DECIMAL;
private String orgId;
@JsonIgnore
private Integer total;
@JsonIgnore

4
epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java

@ -952,4 +952,8 @@ public interface EpmetUserOpenFeignClient {
@PostMapping("/epmetuser/dataSyncConfig/disabilityInfoScanTask")
Result disabilityInfoScanTask(@RequestBody DataSyncTaskParam formDTO);
@PostMapping("/epmetuser/icresiuser/rhzkList")
Result<List<RHZKStatisticsResultDTO>> renHuCondition(@RequestBody RHZKStatisticsFormDTO formDTO);
}

5
epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java

@ -741,4 +741,9 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien
public Result disabilityInfoScanTask(DataSyncTaskParam formDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "disabilityInfoScanTask", formDTO);
}
@Override
public Result<List<RHZKStatisticsResultDTO>> renHuCondition(RHZKStatisticsFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "renHuCondition", formDTO);
}
}

11
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java

@ -1472,8 +1472,15 @@ public class IcResiUserController implements ResultDataResolver {
* @Date 2022/11/16 09:22
*/
@PostMapping("rhzk")
public Result<RHZKStatisticsResultDTO> renHuCondition(@LoginUser TokenDto tokenDto){
return new Result<RHZKStatisticsResultDTO>().ok(icResiUserService.renHuCondition(tokenDto));
public Result<RHZKStatisticsResultDTO> renHuCondition(@LoginUser TokenDto tokenDto,@RequestBody RHZKStatisticsFormDTO formDTO){
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setStaffId(tokenDto.getUserId());
return new Result<RHZKStatisticsResultDTO>().ok(icResiUserService.renHuCondition(formDTO));
}
@PostMapping("rhzkList")
public Result<List<RHZKStatisticsResultDTO>> renHuConditionList(@RequestBody RHZKStatisticsFormDTO formDTO){
return new Result<List<RHZKStatisticsResultDTO>>().ok(icResiUserService.renHuConditionList(formDTO));
}
}

2
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java

@ -440,5 +440,5 @@ public interface IcResiUserDao extends BaseDao<IcResiUserEntity> {
*/
ResiAndLocalResiResultDTO getResiCount(@Param("agencyId")String agencyId,@Param("idCard")String idCard,@Param("customerId")String customerId);
List<RHZKStatisticsResultDTO> getUserByRenHu(@Param("agencyId")String agencyId);
List<RHZKStatisticsResultDTO> getUserByRenHu(RHZKStatisticsFormDTO formDTO);
}

6
epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java

@ -528,10 +528,12 @@ public interface IcResiUserService extends BaseService<IcResiUserEntity> {
/**
* @Description 人户状况统计查询
* @param tokenDto
* @param formDTO
* @Author zxc
* @Date 2022/11/16 09:22
*/
RHZKStatisticsResultDTO renHuCondition(TokenDto tokenDto);
RHZKStatisticsResultDTO renHuCondition(RHZKStatisticsFormDTO formDTO);
List<RHZKStatisticsResultDTO> renHuConditionList(RHZKStatisticsFormDTO formDTO);
}

27
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java

@ -3639,17 +3639,21 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
/**
* @Description 人户状况统计查询
* @param tokenDto
* @param formDTO
* @Author zxc
* @Date 2022/11/16 09:22
*/
@Override
public RHZKStatisticsResultDTO renHuCondition(TokenDto tokenDto) {
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId());
public RHZKStatisticsResultDTO renHuCondition(RHZKStatisticsFormDTO formDTO) {
if (StringUtils.isBlank(formDTO.getOrgId())){
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId());
if (null == staffInfo){
throw new EpmetException("未查询到工作人员:"+tokenDto.getUserId());
throw new EpmetException("未查询到工作人员:"+formDTO.getStaffId());
}
formDTO.setOrgId(staffInfo.getAgencyId());
formDTO.setOrgType("agency");
}
List<RHZKStatisticsResultDTO> userByRenHu = baseDao.getUserByRenHu(staffInfo.getAgencyId());
List<RHZKStatisticsResultDTO> userByRenHu = baseDao.getUserByRenHu(formDTO);
RHZKStatisticsResultDTO r = new RHZKStatisticsResultDTO();
if (CollectionUtils.isEmpty(userByRenHu)){
return r;
@ -3680,6 +3684,19 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
return r;
}
@Override
public List<RHZKStatisticsResultDTO> renHuConditionList(RHZKStatisticsFormDTO formDTO) {
if (CollectionUtils.isEmpty(formDTO.getOrgIds())){
return new ArrayList<>();
}
List<RHZKStatisticsResultDTO> result = new ArrayList<>();
formDTO.getOrgIds().forEach(o -> {
formDTO.setOrgId(o);
result.add(renHuCondition(formDTO));
});
return result;
}
/**
* @Description
* @param total 总人数

11
epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml

@ -1414,7 +1414,16 @@
FROM ic_resi_user
WHERE DEL_FLAG = '0'
AND `STATUS` = '0'
AND PIDS LIKE CONCAT('%',#{agencyId},'%')) t
<if test='orgType == "agency" '>
AND PIDS LIKE CONCAT('%',#{orgId},'%')
</if>
<if test='orgType == "grid" '>
AND GRID_ID = #{orgId}
</if>
<if test='orgType == "village" '>
AND VILLAGE_ID = #{orgId}
</if>
) t
GROUP BY rhzk
</select>

Loading…
Cancel
Save