| 
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -4,29 +4,46 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.baomidou.mybatisplus.core.metadata.IPage; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.rocketmq.constants.TopicConstants; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.constant.FieldConstant; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.constant.MqConstant; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.dto.form.mq.eventmsg.BasePointEventMsg; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.exception.EpmetException; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.exception.RenException; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.page.PageData; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.redis.common.CustomerOrgRedis; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.redis.common.bean.GridInfoCache; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.utils.ConvertUtils; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.utils.Result; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.constant.SystemMessageType; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.dto.IcMessageDTO; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.dto.form.CommonGridIdFormDTO; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.dto.form.IcMessageListFormDTO; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.dto.form.IssueInitiatorFormDTO; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.dto.form.SystemMsgFormDTO; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.dto.result.CommonDataFilterResultDTO; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.dto.result.CustomerUserDetailResultDTO; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.feign.EpmetMessageOpenFeignClient; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.feign.EpmetUserOpenFeignClient; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.modules.partyOrg.dao.IcPartyActSignInRecordDao; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.modules.partyOrg.entity.IcPartyActEntity; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.modules.partyOrg.entity.IcPartyActSignInRecordEntity; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.modules.partyOrg.service.IcPartyActService; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.modules.partyOrg.service.IcPartyActSignInRecordService; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.resi.group.constant.TopicConstant; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.resi.group.dto.group.ResiGroupInfoRedisDTO; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.resi.partymember.dto.IcPartyActSignInRecordDTO; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.resi.partymember.dto.partyOrg.form.PartyActSignFormDTO; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.github.pagehelper.PageHelper; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.github.pagehelper.PageInfo; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import lombok.extern.slf4j.Slf4j; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import org.apache.commons.lang3.StringUtils; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import org.springframework.beans.factory.annotation.Autowired; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import org.springframework.stereotype.Service; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import org.springframework.transaction.annotation.Transactional; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import org.springframework.web.bind.annotation.RequestBody; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import java.util.ArrayList; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import java.util.Arrays; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import java.util.List; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import java.util.Map; | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -38,9 +55,14 @@ import java.util.Map; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					 * @since v1.0.0 2022-08-18 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					 */ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					@Service | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					@Slf4j | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					public class IcPartyActSignInRecordServiceImpl extends BaseServiceImpl<IcPartyActSignInRecordDao, IcPartyActSignInRecordEntity> implements IcPartyActSignInRecordService { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    @Autowired | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    private EpmetUserOpenFeignClient epmetUserOpenFeignClient; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    @Autowired | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    private IcPartyActService icPartyActService; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    @Autowired | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    @Override | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -121,6 +143,41 @@ public class IcPartyActSignInRecordServiceImpl extends BaseServiceImpl<IcPartyAc | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        entity.setIdCard(result.getData().getIdNum()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        entity.setUserRealName(result.getData().getName()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        insert(entity); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //推送mq加积分
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        IcPartyActEntity actEntity = icPartyActService.selectById(formDTO.getIcPartyActId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        String actType = actEntity.getActType(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        String eventTag = ("dangke".equals(actType) ? SystemMessageType.DANGKE : ("dxzh".equals(actType) ? SystemMessageType.DXZH : ( | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                "wmfwhd".equals(actType) ? SystemMessageType.WMFWHD : ("zbdydh".equals(actType) ? SystemMessageType.ZBDYDH : ( | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        "zbwyh".equals(actType) ? SystemMessageType.ZBWYH : ("ztdr".equals(actType) ? SystemMessageType.ZTDR : "") | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                )) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        ))); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //网格缓存信息
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(formDTO.getGridId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if (null == gridInfo) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            throw new EpmetException(String.format("未查询到网格{%s}信息", formDTO.getGridId())); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        List<BasePointEventMsg> pointEventMsgList = new ArrayList<>(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        BasePointEventMsg pointEventMsg = new BasePointEventMsg(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        pointEventMsg.setOpAgencyId(gridInfo.getPid()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        pointEventMsg.setOperatorId(formDTO.getUserId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        pointEventMsg.setAgencyId(gridInfo.getPid()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        pointEventMsg.setCustomerId(formDTO.getCustomerId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        pointEventMsg.setGridId(gridInfo.getId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        pointEventMsg.setUserId(formDTO.getUserId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        pointEventMsg.setActionFlag(MqConstant.PLUS); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        pointEventMsg.setIsCommon(false); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        pointEventMsg.setSourceType(actType); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        pointEventMsg.setSourceId(formDTO.getIcPartyActId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        pointEventMsgList.add(pointEventMsg); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        SystemMsgFormDTO msgFormDTO = new SystemMsgFormDTO(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        msgFormDTO.setMessageType(eventTag); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        msgFormDTO.setContent(pointEventMsgList); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        Result sendMsgResult = epmetMessageOpenFeignClient.sendSystemMsgByMQ(msgFormDTO); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if (!sendMsgResult.success()) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            log.error("党建活动签到发送积分失败,活动Id->" + formDTO.getIcPartyActId() + "  用户->" + formDTO.getUserId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					} |