| | |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.panzhihua.service_community.dao.ComActDAO; |
| | | import com.panzhihua.service_community.model.dos.ComActDO; |
| | | import org.springframework.amqp.rabbit.annotation.RabbitListener; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | |
| | | public class AcidMessage { |
| | | public static final String DELAYED_QUEUE="huacheng.acid.queue"; |
| | | public static final String ACID_DANGER_QUEUE = "huacheng.acid.danger.queue"; |
| | | public static final String DIRECT_QUEUE="huacheng.acid.direct.queue"; |
| | | @Resource |
| | | private UserService userService; |
| | | @Resource |
| | | private ComActAcidMemberService comActAcidMemberService; |
| | | @Resource |
| | | private ComActDAO comActDAO; |
| | | |
| | | @RabbitListener(queues=DELAYED_QUEUE) |
| | | public void doTemplate(ComActAcidRecordVO comActAcidRecordVO) { |
| | |
| | | } |
| | | } |
| | | } |
| | | @RabbitListener(queues = DIRECT_QUEUE) |
| | | public void updateUserInfo(ComActAcidRecordVO comActAcidRecordVO){ |
| | | //防疫登记提交默认绑定用户信息 |
| | | R<LoginUserInfoVO> loginUserInfoVOR= userService.getUserInfoByUserId(comActAcidRecordVO.getUserId().toString()); |
| | | if(R.isOk(loginUserInfoVOR)&&loginUserInfoVOR.getData()!=null){ |
| | | LoginUserInfoVO loginUserInfoVO=loginUserInfoVOR.getData(); |
| | | if(StringUtils.isEmpty(loginUserInfoVO.getPhone())||StringUtils.isEmpty(loginUserInfoVO.getIdCard())){ |
| | | loginUserInfoVO.setPhone(comActAcidRecordVO.getPhone()); |
| | | loginUserInfoVO.setIdCard(comActAcidRecordVO.getIdCard()); |
| | | if(StringUtils.isNotEmpty(comActAcidRecordVO.getLocalCity())){ |
| | | String town=comActAcidRecordVO.getLocalCity().split(",")[2]; |
| | | String area=comActAcidRecordVO.getLocalCity().split(",")[1]; |
| | | String country=comActAcidRecordVO.getLocalCity().split(",")[0]; |
| | | List<ComActDO> comActDOS=comActDAO.selectList(new QueryWrapper<ComActDO>().lambda().eq(ComActDO::getName,town)); |
| | | if(CollectionUtils.isNotEmpty(comActDOS)){ |
| | | if(comActDOS.size()==1){ |
| | | loginUserInfoVO.setCommunityId(comActDOS.get(0).getCommunityId()); |
| | | } |
| | | else { |
| | | ComActDO comActDO=comActDAO.selectOne(new QueryWrapper<ComActDO>().lambda().eq(ComActDO::getName,town).and(comActDOLambdaQueryWrapper -> comActDOLambdaQueryWrapper.like(ComActDO::getAddress,town).or().like(ComActDO::getAddress,area).or().like(ComActDO::getAddress,country))); |
| | | if(comActDO!=null){ |
| | | loginUserInfoVO.setCommunityId(comActDO.getCommunityId()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | userService.putUser(loginUserInfoVO); |
| | | } |
| | | } |
| | | } |
| | | } |