|  |  | @ -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>> | 
			
		
	
		
			
				
					|  |  |  |      * 烟台党员画像列表接口,将上方两个接口,合为一个 | 
			
		
	
		
			
				
					|  |  |  |      * @param tokenDto | 
			
		
	
		
			
				
					|  |  |  |      * @param formDTO | 
			
		
	
		
			
				
					|  |  |  |      * @return | 
			
		
	
		
			
				
					|  |  |  |      */ | 
			
		
	
		
			
				
					|  |  |  |     @PostMapping("partymemberagestatistics") | 
			
		
	
		
			
				
					|  |  |  |     public Result<List<OptionDataResultDTO>> partyMemberAgeStatistics(@LoginUser TokenDto tokenDto,@RequestBody IcPartyMemberFormDTO formDTO) { | 
			
		
	
		
			
				
					|  |  |  |     @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 = setOrgId(tokenDto); | 
			
		
	
		
			
				
					|  |  |  |             // 当前工作人员所属组织下的,党组织
 | 
			
		
	
		
			
				
					|  |  |  |             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)); | 
			
		
	
		
			
				
					|  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
	
		
			
				
					|  |  | 
 |