| 
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -35,9 +35,9 @@ import com.epmet.resi.partymember.dto.partyOrg.form.ActAndScheduleListFormDTO; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.resi.partymember.dto.partyOrg.form.HomeMonthTotalFormDTO; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.resi.partymember.dto.partyOrg.result.ActAndScheduleListResultDTO; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.resi.partymember.dto.partyOrg.result.HomeMonthTotalResultDTO; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import org.apache.commons.collections4.CollectionUtils; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.github.pagehelper.PageHelper; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.github.pagehelper.PageInfo; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import org.apache.commons.collections4.CollectionUtils; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import org.apache.commons.lang3.StringUtils; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import org.springframework.beans.factory.annotation.Autowired; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import org.springframework.stereotype.Service; | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -53,6 +53,7 @@ import java.util.stream.Collectors; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					 * @author generator generator@elink-cn.com | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					 * @since v1.0.0 2022-08-18 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					 */ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					@Slf4j | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					@Service | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					public class IcPartyActServiceImpl extends BaseServiceImpl<IcPartyActDao, IcPartyActEntity> implements IcPartyActService { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    @Autowired | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -67,6 +68,8 @@ public class IcPartyActServiceImpl extends BaseServiceImpl<IcPartyActDao, IcPart | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    private IcPartyOrgDao partyOrgDao; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    @Autowired | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    private ResiPartymemberAttachmentDao resiPartymemberAttachmentDao; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    @Autowired | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    private EpmetMessageOpenFeignClient messageOpenFeignClient; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    /** | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     * 活动类型列表 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     * | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -314,7 +317,6 @@ public class IcPartyActServiceImpl extends BaseServiceImpl<IcPartyActDao, IcPart | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        return result; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    public static List<ActAndScheduleListResultDTO> constructHomeSearchData(String startDate,String endDate){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        List<ActAndScheduleListResultDTO> result = new ArrayList<>(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if (StringUtils.isNotBlank(startDate) && StringUtils.isNotBlank(endDate)){ | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -328,7 +330,6 @@ public class IcPartyActServiceImpl extends BaseServiceImpl<IcPartyActDao, IcPart | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        return result; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    /** | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     * 党建小助手活动触发为用户推送消息 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     */ | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -340,6 +341,7 @@ public class IcPartyActServiceImpl extends BaseServiceImpl<IcPartyActDao, IcPart | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            String msg = "活动信息不存在,活动Id:" + formDTO.getIcPartyActId(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), msg, msg); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        List<UserMessageFormDTO> msgList = new ArrayList<>(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //2.根据不同类型消息触发不同处理逻辑
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //2-1.发布活动给居民端涉及党员已经工作端活动发布站推送党建活动消息
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if("publish".equals(formDTO.getType())){ | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -353,7 +355,7 @@ public class IcPartyActServiceImpl extends BaseServiceImpl<IcPartyActDao, IcPart | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            //分别查询党组织、党小组下的人
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            List<String> userIdList = new ArrayList<>(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if(!CollectionUtils.isEmpty(groupIdList)){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                Result<List<ResiGroupMemberDTO>> result = resiGroupOpenFeignClient.getMemberList(groupIdList); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                Result<List<ResiGroupMemberDTO>> result = resiGroupOpenFeignClient.groupMemberList(groupIdList); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                if (!result.success()) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    throw new RenException("调用common service查询secret失败"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                } | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -364,9 +366,38 @@ public class IcPartyActServiceImpl extends BaseServiceImpl<IcPartyActDao, IcPart | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            //组装消息
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            userIdList.forEach(id->{ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                UserMessageFormDTO msg = new UserMessageFormDTO(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                msg.setCustomerId(formDTO.getCustomerId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                msg.setApp(AppClientConstant.APP_RESI); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                msg.setTitle("您收到一个新的活动通知"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                msg.setReadFlag(ReadFlagConstant.UN_READ); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                StringBuffer str = new StringBuffer(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                str.append("主题:").append(entity.getTopic()).append("\n").append("时间:").append(entity.getHoldTime()).append("\n").append("地点:").append(entity.getAddress()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                msg.setMessageContent(str.toString()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                msg.setMessageType("party"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                msg.setTargetId(formDTO.getIcPartyActId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                msg.setUserId(id); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                msgList.add(msg); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            }); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            //工作人员
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            UserMessageFormDTO msg = new UserMessageFormDTO(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            msg.setCustomerId(formDTO.getCustomerId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            msg.setApp(AppClientConstant.APP_GOV); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            msg.setTitle("您有一个活动已经发布"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            msg.setReadFlag(ReadFlagConstant.UN_READ); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            StringBuffer str = new StringBuffer(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            str.append("主题:").append(entity.getTopic()).append("\n").append("时间:").append(entity.getHoldTime()).append("\n").append("地点:").append(entity.getAddress()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            msg.setMessageContent(str.toString()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            msg.setMessageType("party"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            msg.setTargetId(formDTO.getIcPartyActId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            msg.setUserId(entity.getPublishStaffId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            msgList.add(msg); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //推送消息
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        Result sendMessageRes = messageOpenFeignClient.saveIcMessageList(msgList); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					} |