Browse Source

调整王童的方法

master
yinzuomei 2 years ago
parent
commit
cda40ad9d5
  1. 8
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/IcPartyOrgService.java
  2. 24
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyOrgServiceImpl.java
  3. 81
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/IcPartyMemberController.java
  4. 8
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/IcPartyMemberService.java
  5. 13
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartyMemberServiceImpl.java
  6. 11
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcPartyMemberListFormDTO.java
  7. 9
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PartyMemberAgeResultDTO.java
  8. 7
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PartyMemberEducationResultDTO.java
  9. 19
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/resi/PartymemberPortraitResultDTO.java

8
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/IcPartyOrgService.java

@ -158,4 +158,12 @@ public interface IcPartyOrgService extends BaseService<IcPartyOrgEntity> {
*/
void editPrincipal(EditPrincipalFormDTO formDTO);
/**
* 获取工作人员所属组织下的党组织
* @param customerId
* @param staffId
* @return
*/
IcPartyOrgEntity getIcPartyOrg(String customerId,String staffId);
}

24
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyOrgServiceImpl.java

@ -503,4 +503,28 @@ public class IcPartyOrgServiceImpl extends BaseServiceImpl<IcPartyOrgDao, IcPart
baseDao.editPrincipal(formDTO);
}
/**
* 获取工作人员所属组织下的党组织
*
* @param customerId
* @param staffId
* @return
*/
@Override
public IcPartyOrgEntity getIcPartyOrg(String customerId, String staffId) {
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(customerId, staffId);
if (null == staffInfo) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取工作人员信息失败", "获取工作人员信息失败");
}
// 获取工作人员所属组织同级的党组织
LambdaQueryWrapper<IcPartyOrgEntity> orgWrapper = new LambdaQueryWrapper<>();
orgWrapper.eq(IcPartyOrgEntity::getCustomerId, customerId);
orgWrapper.eq(IcPartyOrgEntity::getAgencyId, staffInfo.getAgencyId());
orgWrapper.ne(IcPartyOrgEntity::getPartyOrgType, NumConstant.FIVE_STR);
IcPartyOrgEntity icPartyOrgEntity = baseDao.selectOne(orgWrapper);
if (null == icPartyOrgEntity) {
log.warn("当前工作人员所属组织下,暂无党组织,当前");
}
return icPartyOrgEntity;
}
}

81
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/IcPartyMemberController.java

@ -4,21 +4,18 @@ import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.annotation.MaskResponse;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.constant.AppClientConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.dto.result.OptionDataResultDTO;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.commons.tools.feign.ResultDataResolver;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.*;
import com.epmet.commons.tools.utils.poi.excel.handler.FreezeAndFilter;
@ -33,8 +30,9 @@ import com.epmet.dto.form.IcPartyMemberListFormDTO;
import com.epmet.dto.result.ImportTaskCommonResultDTO;
import com.epmet.dto.result.PartyMemberAgeResultDTO;
import com.epmet.dto.result.PartyMemberEducationResultDTO;
import com.epmet.modules.partyOrg.dao.IcPartyOrgDao;
import com.epmet.dto.result.resi.PartymemberPortraitResultDTO;
import com.epmet.modules.partyOrg.entity.IcPartyOrgEntity;
import com.epmet.modules.partyOrg.service.IcPartyOrgService;
import com.epmet.modules.partymember.excel.IcPartyMemberExcel;
import com.epmet.modules.partymember.service.IcPartyMemberService;
import com.epmet.resi.partymember.dto.partymember.IcPartyMemberDTO;
@ -79,8 +77,10 @@ public class IcPartyMemberController implements ResultDataResolver {
@Autowired
private IcPartyMemberService icPartyMemberService;
// @Autowired
// private IcPartyOrgDao icPartyOrgDao;
@Autowired
private IcPartyOrgDao icPartyOrgDao;
private IcPartyOrgService icPartyOrgService;
@RequestMapping("page")
@MaskResponse(fieldNames = { "mobile", "idCard" }, fieldsMaskType = { MaskResponse.MASK_TYPE_MOBILE, MaskResponse.MASK_TYPE_ID_CARD })
@ -230,6 +230,26 @@ public class IcPartyMemberController implements ResultDataResolver {
return new Result();
}
/**
* @describe: 统计分析-党员年龄范围统计
* @author wangtong
* @date 2022/5/23 10:19
* @params [formDTO]
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.commons.tools.dto.result.OptionDataResultDTO>>
*/
@PostMapping("partymemberagestatistics")
public Result<List<OptionDataResultDTO>> partyMemberAgeStatistics(@LoginUser TokenDto tokenDto,@RequestBody IcPartyMemberFormDTO formDTO) {
if(StringUtils.isBlank(formDTO.getOrgId())){
IcPartyOrgEntity org =icPartyOrgService.getIcPartyOrg(tokenDto.getCustomerId(),tokenDto.getUserId());
if (null == org) {
return new Result<List<OptionDataResultDTO>>().ok(new ArrayList<>());
}
formDTO.setOrgId(org.getId());
}
return new Result<List<OptionDataResultDTO>>().ok(icPartyMemberService.partyMemberAgeStatistics(formDTO));
}
/**
* @describe: 统计分析-党员学历统计
* @author wangtong
@ -240,7 +260,7 @@ public class IcPartyMemberController implements ResultDataResolver {
@PostMapping("partymembereducationstatistics")
public Result<List<OptionDataResultDTO>> partyMemberEducationStatistics(@LoginUser TokenDto tokenDto, @RequestBody IcPartyMemberFormDTO formDTO) {
if(StringUtils.isBlank(formDTO.getOrgId())){
IcPartyOrgEntity org = setOrgId(tokenDto);
IcPartyOrgEntity org= icPartyOrgService.getIcPartyOrg(tokenDto.getCustomerId(),tokenDto.getUserId());
if (null == org) {
return new Result<List<OptionDataResultDTO>>().ok(new ArrayList<>());
}
@ -260,7 +280,7 @@ public class IcPartyMemberController implements ResultDataResolver {
@MaskResponse(fieldNames = {"mobile"}, fieldsMaskType = {MaskResponse.MASK_TYPE_MOBILE})
public Result<PageData<PartyMemberAgeResultDTO>> partyMemberAgelist(@LoginUser TokenDto tokenDto,@RequestBody IcPartyMemberListFormDTO formDTO) {
if(StringUtils.isBlank(formDTO.getOrgId())){
IcPartyOrgEntity org = setOrgId(tokenDto);
IcPartyOrgEntity org= icPartyOrgService.getIcPartyOrg(tokenDto.getCustomerId(),tokenDto.getUserId());
if (null == org) {
return new Result<PageData<PartyMemberAgeResultDTO>>().ok(new PageData<>(Collections.emptyList(), 0));
}
@ -280,7 +300,7 @@ public class IcPartyMemberController implements ResultDataResolver {
@MaskResponse(fieldNames = {"mobile"}, fieldsMaskType = {MaskResponse.MASK_TYPE_MOBILE})
public Result<PageData<PartyMemberEducationResultDTO>> partyMemberEducationlist(@LoginUser TokenDto tokenDto,@RequestBody IcPartyMemberListFormDTO formDTO) {
if(StringUtils.isBlank(formDTO.getOrgId())){
IcPartyOrgEntity org = setOrgId(tokenDto);
IcPartyOrgEntity org= icPartyOrgService.getIcPartyOrg(tokenDto.getCustomerId(),tokenDto.getUserId());
if (null == org) {
return new Result<PageData<PartyMemberEducationResultDTO>>().ok(new PageData<>(Collections.emptyList(), 0));
}
@ -290,42 +310,23 @@ public class IcPartyMemberController implements ResultDataResolver {
}
/**
* @describe: 统计分析-党员年龄范围统计
* @author wangtong
* @date 2022/5/23 10:19
* @params [formDTO]
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.commons.tools.dto.result.OptionDataResultDTO>>
*/
@PostMapping("partymemberagestatistics")
public Result<List<OptionDataResultDTO>> partyMemberAgeStatistics(@LoginUser TokenDto tokenDto,@RequestBody IcPartyMemberFormDTO formDTO) {
if(StringUtils.isBlank(formDTO.getOrgId())){
IcPartyOrgEntity org = setOrgId(tokenDto);
* 烟台党员画像列表接口将上方两个接口合为一个
* @param tokenDto
* @param formDTO
* @return
*/
@PostMapping("partymember-portrait-list")
@MaskResponse(fieldNames = {"mobile"}, fieldsMaskType = {MaskResponse.MASK_TYPE_MOBILE})
public Result<PageData<PartymemberPortraitResultDTO>> queryPartymemberPortraitList(@LoginUser TokenDto tokenDto, @RequestBody IcPartyMemberListFormDTO formDTO) {
if (StringUtils.isBlank(formDTO.getOrgId())) {
// 当前工作人员所属组织下的,党组织
IcPartyOrgEntity org= icPartyOrgService.getIcPartyOrg(tokenDto.getCustomerId(),tokenDto.getUserId());
if (null == org) {
return new Result<List<OptionDataResultDTO>>().ok(new ArrayList<>());
return new Result<PageData<PartymemberPortraitResultDTO>>().ok(new PageData<>(Collections.emptyList(), 0));
}
formDTO.setOrgId(org.getId());
}
return new Result<List<OptionDataResultDTO>>().ok(icPartyMemberService.partyMemberAgeStatistics(formDTO));
}
/**
* @describe: 组装党组织信息
* @author wangtong
* @date 2022/7/8 16:46
* @params [tokenDto, formDTO]
* @return com.epmet.modules.partyOrg.entity.IcPartyOrgEntity
*/
public IcPartyOrgEntity setOrgId(TokenDto tokenDto){
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(),tokenDto.getUserId());
if (null == staffInfo) {
throw new EpmetException("获取工作人员信息失败");
}
//获取工作人员所属组织同级的党组织
LambdaQueryWrapper<IcPartyOrgEntity> orgWrapper = new LambdaQueryWrapper<>();
orgWrapper.eq(IcPartyOrgEntity::getCustomerId, tokenDto.getCustomerId());
orgWrapper.eq(IcPartyOrgEntity::getAgencyId, staffInfo.getAgencyId());
orgWrapper.ne(IcPartyOrgEntity::getPartyOrgType, NumConstant.FIVE_STR);
return icPartyOrgDao.selectOne(orgWrapper);
return new Result<PageData<PartymemberPortraitResultDTO>>().ok(icPartyMemberService.queryPartymemberPortraitList(formDTO));
}

8
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/IcPartyMemberService.java

@ -8,6 +8,7 @@ import com.epmet.dto.form.IcPartyMemberFormDTO;
import com.epmet.dto.form.IcPartyMemberListFormDTO;
import com.epmet.dto.result.PartyMemberAgeResultDTO;
import com.epmet.dto.result.PartyMemberEducationResultDTO;
import com.epmet.dto.result.resi.PartymemberPortraitResultDTO;
import com.epmet.modules.partymember.entity.IcPartyMemberEntity;
import com.epmet.resi.partymember.dto.partymember.IcPartyMemberDTO;
import com.epmet.resi.partymember.dto.partymember.form.IcPartyMemberFromDTO;
@ -150,4 +151,11 @@ public interface IcPartyMemberService extends BaseService<IcPartyMemberEntity> {
void execAsyncExcelImport(Path filePath, String importTaskId);
IcPartyInfoResultDTO partyInfo(TokenDto tokenDto);
/**
* 烟台管理平台党员画像列表查询
* @param formDTO
* @return
*/
PageData<PartymemberPortraitResultDTO> queryPartymemberPortraitList(IcPartyMemberListFormDTO formDTO);
}

13
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartyMemberServiceImpl.java

@ -32,6 +32,7 @@ import com.epmet.dto.form.IcPartyMemberListFormDTO;
import com.epmet.dto.result.PartyMemberAgeResultDTO;
import com.epmet.dto.result.PartyMemberEducationResultDTO;
import com.epmet.dto.result.UploadImgResultDTO;
import com.epmet.dto.result.resi.PartymemberPortraitResultDTO;
import com.epmet.feign.*;
import com.epmet.modules.partyOrg.dao.IcPartyOrgDao;
import com.epmet.modules.partyOrg.entity.IcPartyOrgEntity;
@ -734,5 +735,15 @@ public class IcPartyMemberServiceImpl extends BaseServiceImpl<IcPartyMemberDao,
return resultDTO;
}
/**
* 烟台管理平台党员画像列表查询
*
* @param formDTO
* @return
*/
@Override
public PageData<PartymemberPortraitResultDTO> queryPartymemberPortraitList(IcPartyMemberListFormDTO formDTO) {
// todo
return null;
}
}

11
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcPartyMemberListFormDTO.java

@ -15,9 +15,20 @@ public class IcPartyMemberListFormDTO extends PageFormDTO implements Serializabl
private static final long serialVersionUID = -6085134769034337175L;
/**
* 党组织id
*/
private String orgId;
private String code;
private String agencyId;
/**
* 烟台党员画像列表接口将上方两个接口合为一个
* 年龄age
* 学历education
* 如果不传默认查询所有党员
*/
private String codeType;
}

9
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PartyMemberAgeResultDTO.java

@ -14,7 +14,16 @@ public class PartyMemberAgeResultDTO implements Serializable {
private static final long serialVersionUID = 3421162784157903637L;
private String userId;
private String name;
private String age;
/**
* 烟台党员画像列表接口将上方两个接口合为一个
* 在这个dto里增加了education
*/
private String education;
private String mobile;
private String icResiUser;
}

7
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PartyMemberEducationResultDTO.java

@ -14,6 +14,13 @@ public class PartyMemberEducationResultDTO implements Serializable {
private static final long serialVersionUID = -5042362121277863249L;
private String userId;
private String name;
/**
* 烟台党员画像列表接口将上方两个接口合为一个
* 在这个dto里增加了age
*/
private String age;
private String education;
private String mobile;
private String icResiUser;

19
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/resi/PartymemberPortraitResultDTO.java

@ -0,0 +1,19 @@
package com.epmet.dto.result.resi;
import lombok.Data;
/**
* @Description 烟台管理平台党员画像
* @Author yzm
* @Date 2023/4/20 13:32
*/
@Data
public class PartymemberPortraitResultDTO {
private String userId;
private String name;
private String age;
private String education;
private String mobile;
private String icResiUser;
}
Loading…
Cancel
Save