Browse Source

Merge remote-tracking branch 'origin/yantai_zhengwu_master' into dev

master
yinzuomei 2 years ago
parent
commit
8def3d6973
  1. 10
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/resi/ResiPortrayalDetailDTO.java
  2. 17
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/resi/ResiPortrayalResult.java
  3. 12
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java
  4. 23
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java
  5. 70
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java

10
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/resi/ResiPortrayalDetailDTO.java

@ -21,8 +21,9 @@ public class ResiPortrayalDetailDTO {
@ExcelIgnore
private String gridId;
@ExcelProperty(value = "所属网格")
@ColumnWidth(30)
@ExcelIgnore
// @ExcelProperty(value = "所属网格")
// @ColumnWidth(30)
private String gridName;
/**
@ -53,8 +54,9 @@ public class ResiPortrayalDetailDTO {
@ExcelIgnore
private String homeId;
@ExcelProperty(value = "所属房屋")
@ColumnWidth(30)
@ExcelIgnore
// @ExcelProperty(value = "所属房屋")
// @ColumnWidth(30)
private String homeName;
/**

17
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/resi/ResiPortrayalResult.java

@ -0,0 +1,17 @@
package com.epmet.dto.result.resi;
import lombok.Data;
import java.util.List;
/**
* @Description
* @Author yzm
* @Date 2023/4/19 17:26
*/
@Data
public class ResiPortrayalResult {
private Integer total;
private List<ResiPortrayalResultDTO> list;
}

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

@ -64,7 +64,7 @@ import com.epmet.dto.result.*;
import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.dto.result.resi.IcResiNonDynamicResultDTO;
import com.epmet.dto.result.resi.ResiPortrayalDetailDTO;
import com.epmet.dto.result.resi.ResiPortrayalResultDTO;
import com.epmet.dto.result.resi.ResiPortrayalResult;
import com.epmet.enums.IcResiUserTableEnum;
import com.epmet.excel.PartyMemberAgeExportExcel;
import com.epmet.excel.PartyMemberEducationExportExcel;
@ -1536,8 +1536,8 @@ public class IcResiUserController implements ResultDataResolver {
* @return
*/
@PostMapping("age-distribute")
public Result<List<ResiPortrayalResultDTO>> queryAgeDistribute(@LoginUser TokenDto tokenDto,@RequestBody ResiPortrayalCommonFormDTO formDTO) {
return new Result<List<ResiPortrayalResultDTO>>().ok(icResiUserService.queryAgeDistribute(tokenDto.getCustomerId(),tokenDto.getUserId(),formDTO.getOrgId(), formDTO.getOrgType()));
public Result<ResiPortrayalResult> queryAgeDistribute(@LoginUser TokenDto tokenDto, @RequestBody ResiPortrayalCommonFormDTO formDTO) {
return new Result<ResiPortrayalResult>().ok(icResiUserService.queryAgeDistribute(tokenDto.getCustomerId(),tokenDto.getUserId(),formDTO.getOrgId(), formDTO.getOrgType()));
}
/**
@ -1549,8 +1549,8 @@ public class IcResiUserController implements ResultDataResolver {
* @return
*/
@PostMapping("education-distribute")
public Result<List<ResiPortrayalResultDTO>> queryEducationDistribute(@LoginUser TokenDto tokenDto,@RequestBody ResiPortrayalCommonFormDTO formDTO) {
return new Result<List<ResiPortrayalResultDTO>>().ok(icResiUserService.queryEducationDistribute(tokenDto.getCustomerId(),tokenDto.getUserId(),formDTO.getOrgId(), formDTO.getOrgType()));
public Result<ResiPortrayalResult> queryEducationDistribute(@LoginUser TokenDto tokenDto,@RequestBody ResiPortrayalCommonFormDTO formDTO) {
return new Result<ResiPortrayalResult>().ok(icResiUserService.queryEducationDistribute(tokenDto.getCustomerId(),tokenDto.getUserId(),formDTO.getOrgId(), formDTO.getOrgType()));
}
/**
@ -1593,7 +1593,7 @@ public class IcResiUserController implements ResultDataResolver {
List<ResiPortrayalDetailDTO> list = null;
do {
// 默认查询本组织及下级
data = icResiUserService.queryPortrayalResiList(EpmetRequestHolder.getLoginUserCustomerId(),EpmetRequestHolder.getLoginUserId(),
data = icResiUserService.queryPortrayalResiListForExport(EpmetRequestHolder.getLoginUserCustomerId(),EpmetRequestHolder.getLoginUserId(),
formDTO.getPageNo(),formDTO.getPageSize(),
formDTO.getOrgId(),formDTO.getOrgType(),
formDTO.getCodeType(),formDTO.getCode());

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

@ -29,7 +29,7 @@ import com.epmet.dto.result.*;
import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.dto.result.resi.IcResiNonDynamicResultDTO;
import com.epmet.dto.result.resi.ResiPortrayalDetailDTO;
import com.epmet.dto.result.resi.ResiPortrayalResultDTO;
import com.epmet.dto.result.resi.ResiPortrayalResult;
import com.epmet.entity.IcResiUserEntity;
import com.epmet.excel.support.ExportResiUserItemDTO;
import com.epmet.resi.partymember.dto.partymember.IcPartyMemberDTO;
@ -562,7 +562,7 @@ public interface IcResiUserService extends BaseService<IcResiUserEntity> {
* @param orgType
* @return
*/
List<ResiPortrayalResultDTO> queryAgeDistribute(String customerId, String staffId, String orgId, String orgType);
ResiPortrayalResult queryAgeDistribute(String customerId, String staffId, String orgId, String orgType);
/**
* 烟台需求https://modao.cc/app/DUshpXWirii6amoDQsb8OP#screen=slfbvoz5w4z9f98
@ -573,7 +573,7 @@ public interface IcResiUserService extends BaseService<IcResiUserEntity> {
* @param orgType agency/grid
* @return
*/
List<ResiPortrayalResultDTO> queryEducationDistribute(String customerId, String staffId, String orgId, String orgType);
ResiPortrayalResult queryEducationDistribute(String customerId, String staffId, String orgId, String orgType);
/**
* 烟台需求https://modao.cc/app/DUshpXWirii6amoDQsb8OP#screen=slfbvoz5w4z9f98
@ -585,4 +585,21 @@ public interface IcResiUserService extends BaseService<IcResiUserEntity> {
Integer pageNo, Integer pageSize,
String orgId, String orgType,
String codeType,String code);
/**
* 导出居民画像居民列表调用此方法只导出列表信息
* @param customerId
* @param staffId
* @param pageNo
* @param pageSize
* @param orgId
* @param orgType
* @param codeType
* @param code
* @return
*/
PageData<ResiPortrayalDetailDTO> queryPortrayalResiListForExport(String customerId, String staffId,
Integer pageNo, Integer pageSize,
String orgId, String orgType,
String codeType,String code);
}

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

@ -63,6 +63,7 @@ import com.epmet.dto.result.demand.IcResiDemandDictDTO;
import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.dto.result.resi.IcResiNonDynamicResultDTO;
import com.epmet.dto.result.resi.ResiPortrayalDetailDTO;
import com.epmet.dto.result.resi.ResiPortrayalResult;
import com.epmet.dto.result.resi.ResiPortrayalResultDTO;
import com.epmet.entity.*;
import com.epmet.enums.RenHuConditionEnum;
@ -3914,7 +3915,8 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
* @return
*/
@Override
public List<ResiPortrayalResultDTO> queryAgeDistribute(String customerId,String staffId,String orgId, String orgType) {
public ResiPortrayalResult queryAgeDistribute(String customerId, String staffId, String orgId, String orgType) {
ResiPortrayalResult result=new ResiPortrayalResult();
if (StringUtils.isBlank(orgId)) {
orgId = CustomerStaffRedis.getStaffInfo(customerId, staffId).getAgencyId();
orgType = OrgTypeEnum.AGENCY.getCode();
@ -3926,15 +3928,21 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
List<ResiPortrayalResultDTO> resultList=getDefaultAgeDistribute();
List<ResiPortrayalResultDTO> list=baseDao.selectAgeAgeDistribute(customerId,orgId,orgType,orgIdPath);
if(CollectionUtils.isEmpty(list)){
return resultList;
result.setTotal(NumConstant.ZERO);
result.setList(resultList);
return result;
}
Map<String,Integer> resultMap = list.stream().collect(Collectors.toMap(ResiPortrayalResultDTO::getCode,ResiPortrayalResultDTO::getTotalResi));
resultList.forEach(result->{
if (MapUtils.isNotEmpty(resultMap) && resultMap.containsKey(result.getCode())) {
result.setTotalResi(resultMap.get(result.getCode()));
int total=NumConstant.ZERO;
for(ResiPortrayalResultDTO resultDto:resultList){
if (MapUtils.isNotEmpty(resultMap) && resultMap.containsKey(resultDto.getCode())) {
resultDto.setTotalResi(resultMap.get(resultDto.getCode()));
}
});
return resultList;
total+=resultDto.getTotalResi();
}
result.setTotal(total);
result.setList(resultList);
return result;
}
private List<ResiPortrayalResultDTO> getDefaultAgeDistribute() {
@ -3978,7 +3986,8 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
* @return
*/
@Override
public List<ResiPortrayalResultDTO> queryEducationDistribute(String customerId, String staffId, String orgId, String orgType) {
public ResiPortrayalResult queryEducationDistribute(String customerId, String staffId, String orgId, String orgType) {
ResiPortrayalResult result=new ResiPortrayalResult();
if (StringUtils.isBlank(orgId)) {
orgId = CustomerStaffRedis.getStaffInfo(customerId, staffId).getAgencyId();
orgType = OrgTypeEnum.AGENCY.getCode();
@ -3998,17 +4007,21 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
List<ResiPortrayalResultDTO> totalList = baseDao.queryEducationDistribute(customerId, orgId, orgType,orgIdPath);
Map<String,Integer> map = totalList.stream().collect(Collectors.toMap(ResiPortrayalResultDTO::getCode,ResiPortrayalResultDTO::getTotalResi));
List<ResiPortrayalResultDTO> resultDTOList = new ArrayList<>();
dictResult.getData().forEach(dict -> {
int total=NumConstant.ZERO;
for (DictListResultDTO dict : dictResult.getData()) {
ResiPortrayalResultDTO resultDTO = new ResiPortrayalResultDTO();
resultDTO.setCode(dict.getValue());
resultDTO.setCodeName(dict.getLabel());
resultDTO.setTotalResi(NumConstant.ZERO);
if(MapUtils.isNotEmpty(map)&&map.containsKey(dict.getValue())){
if (MapUtils.isNotEmpty(map) && map.containsKey(dict.getValue())) {
resultDTO.setTotalResi(map.get(dict.getValue()));
}
resultDTOList.add(resultDTO);
});
return resultDTOList;
total += resultDTO.getTotalResi();
}
result.setTotal(total);
result.setList(resultDTOList);
return result;
}
@ -4086,5 +4099,38 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
return new PageData<>(list, pageInfo.getTotal(), pageSize);
}
@Override
public PageData<ResiPortrayalDetailDTO> queryPortrayalResiListForExport(String customerId, String staffId,
Integer pageNo, Integer pageSize,
String orgId, String orgType,
String codeType,
String code) {
// 获取文化程度字典
DictListFormDTO dictFormDTO = new DictListFormDTO();
dictFormDTO.setDictType(DictTypeEnum.EDUCATION.getCode());
Result<List<DictListResultDTO>> dictResult = epmetAdminOpenFeignClient.dictList(dictFormDTO);
if (!dictResult.success() || CollectionUtils.isEmpty(dictResult.getData())) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "学历字典获取失败", "学历字典获取失败");
}
Map<String, String> educationMap = dictResult.getData().stream().collect(Collectors.toMap(DictListResultDTO::getValue, DictListResultDTO::getLabel));
if (StringUtils.isBlank(orgId)) {
orgId = CustomerStaffRedis.getStaffInfo(customerId, staffId).getAgencyId();
orgType = OrgTypeEnum.AGENCY.getCode();
}
String orgIdPath=StrConstant.EPMETY_STR;
if(OrgTypeEnum.AGENCY.getCode().equals(orgType)){
orgIdPath=CustomerOrgRedis.getOrgIdPath(orgId,orgType);
}
PageHelper.startPage(pageNo, pageSize);
List<ResiPortrayalDetailDTO> list = baseDao.selectPortrayalResiList(customerId, orgId, orgType,orgIdPath,codeType, code);
if(CollectionUtils.isNotEmpty(list)){
list.forEach(resi -> {
// 学历名称
resi.setEducationName(educationMap.get(resi.getEducationCode()));
});
}
PageInfo<ResiPortrayalDetailDTO> pageInfo = new PageInfo<>(list);
return new PageData<>(list, pageInfo.getTotal(), pageSize);
}
}

Loading…
Cancel
Save