|  | @@ -1,8 +1,11 @@
 | 
	
		
			
				|  |  |  package com.keao.edu.user.service.impl;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  import com.keao.edu.auth.api.client.SysMessageFeignService;
 | 
	
		
			
				|  |  | +import com.keao.edu.auth.api.client.SysUserFeignService;
 | 
	
		
			
				|  |  | +import com.keao.edu.auth.api.entity.SysMessageParams;
 | 
	
		
			
				|  |  |  import com.keao.edu.auth.api.entity.SysUser;
 | 
	
		
			
				|  |  |  import com.keao.edu.common.dal.BaseDAO;
 | 
	
		
			
				|  |  | +import com.keao.edu.common.entity.SysConfig;
 | 
	
		
			
				|  |  |  import com.keao.edu.common.enums.MessageTypeEnum;
 | 
	
		
			
				|  |  |  import com.keao.edu.common.exception.BizException;
 | 
	
		
			
				|  |  |  import com.keao.edu.common.page.PageInfo;
 | 
	
	
		
			
				|  | @@ -12,6 +15,7 @@ import com.keao.edu.common.tenant.TenantContextHolder;
 | 
	
		
			
				|  |  |  import com.keao.edu.thirdparty.message.MessageSenderPluginContext;
 | 
	
		
			
				|  |  |  import com.keao.edu.user.dao.ExamOrganizationRelationDao;
 | 
	
		
			
				|  |  |  import com.keao.edu.user.dao.ExaminationBasicDao;
 | 
	
		
			
				|  |  | +import com.keao.edu.user.dao.TeacherDao;
 | 
	
		
			
				|  |  |  import com.keao.edu.user.entity.ExamOrganizationRelation;
 | 
	
		
			
				|  |  |  import com.keao.edu.user.entity.ExaminationBasic;
 | 
	
		
			
				|  |  |  import com.keao.edu.user.entity.Organization;
 | 
	
	
		
			
				|  | @@ -21,6 +25,7 @@ import com.keao.edu.user.page.ExamOrganizationRelationQueryInfo;
 | 
	
		
			
				|  |  |  import com.keao.edu.user.service.ExamOrganizationRelationService;
 | 
	
		
			
				|  |  |  import com.keao.edu.user.service.OrganizationService;
 | 
	
		
			
				|  |  |  import com.keao.edu.user.service.ShortUrlService;
 | 
	
		
			
				|  |  | +import com.keao.edu.user.service.SysConfigService;
 | 
	
		
			
				|  |  |  import com.keao.edu.util.collection.MapUtil;
 | 
	
		
			
				|  |  |  import org.apache.commons.lang3.StringUtils;
 | 
	
		
			
				|  |  |  import org.apache.poi.ss.formula.functions.T;
 | 
	
	
		
			
				|  | @@ -46,7 +51,11 @@ public class ExamOrganizationRelationServiceImpl extends BaseServiceImpl<Long, E
 | 
	
		
			
				|  |  |  	@Autowired
 | 
	
		
			
				|  |  |  	private ShortUrlService shortUrlService;
 | 
	
		
			
				|  |  |  	@Autowired
 | 
	
		
			
				|  |  | +	private SysUserFeignService sysUserFeignService;
 | 
	
		
			
				|  |  | +	@Autowired
 | 
	
		
			
				|  |  |  	private SysMessageFeignService sysMessageFeignService;
 | 
	
		
			
				|  |  | +	@Autowired
 | 
	
		
			
				|  |  | +	private SysConfigService sysConfigService;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  	@Override
 | 
	
		
			
				|  |  |  	public BaseDAO<Long, ExamOrganizationRelation> getDAO() {
 | 
	
	
		
			
				|  | @@ -136,15 +145,31 @@ public class ExamOrganizationRelationServiceImpl extends BaseServiceImpl<Long, E
 | 
	
		
			
				|  |  |  			throw new BizException("考级项目不存在");
 | 
	
		
			
				|  |  |  		}
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +		SysConfig baseUrlConfig = sysConfigService.findByParamName(SysConfigService.BASE_API_URL);
 | 
	
		
			
				|  |  | +		String baseUrl="";
 | 
	
		
			
				|  |  | +		if(Objects.nonNull(baseUrlConfig)){
 | 
	
		
			
				|  |  | +			baseUrl=baseUrlConfig.getParanValue();
 | 
	
		
			
				|  |  | +		}
 | 
	
		
			
				|  |  | +		baseUrl = baseUrl+"/#/signUp?";
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  		for (ExamOrganizationRelation examOrgan : examOrgans) {
 | 
	
		
			
				|  |  |  			examOrgan.setUrl(shortUrlService.createShortUrl(""));
 | 
	
		
			
				|  |  |  			examOrgan.setSendUrlFlag(YesOrNoEnum.YES);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -//			SysUser student = teacherDao.getUser(practiceGroup.getStudentId());
 | 
	
		
			
				|  |  | -//			Map<Integer, String> userPhoneMap = new HashMap<>();
 | 
	
		
			
				|  |  | -//			userPhoneMap.put(practiceGroup.getStudentId(), student.getPhone());
 | 
	
		
			
				|  |  | -//			sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.YIMEI, MessageTypeEnum.EXAM_REGISTRATION_URL_PUSH,
 | 
	
		
			
				|  |  | -//					userPhoneMap, null, 0, null, "STUDENT", groupStartTime, groupEndTime, teacherName, drillTimesOnWeek, firstCourseStartTime);
 | 
	
		
			
				|  |  | +			String registrationUrl = baseUrl + "organId=" + examOrgan.getOrganId();
 | 
	
		
			
				|  |  | +			String registShortUrl = shortUrlService.createShortUrl(registrationUrl);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +			SysUser student = sysUserFeignService.queryUserById(examOrgan.getOrganId());
 | 
	
		
			
				|  |  | +			Map<Integer, String> userPhoneMap = new HashMap<>();
 | 
	
		
			
				|  |  | +			userPhoneMap.put(examOrgan.getOrganId(), student.getPhone());
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +			SysMessageParams sysMessageParams=new SysMessageParams();
 | 
	
		
			
				|  |  | +			sysMessageParams.setMessageSender(MessageSenderPluginContext.MessageSender.YIMEI);
 | 
	
		
			
				|  |  | +			sysMessageParams.setMessageType(MessageTypeEnum.EXAM_REGISTRATION_URL_PUSH);
 | 
	
		
			
				|  |  | +			sysMessageParams.setReceivers(userPhoneMap);
 | 
	
		
			
				|  |  | +			sysMessageParams.setReadStatus(0);
 | 
	
		
			
				|  |  | +			sysMessageParams.setArgs(new Object[]{registShortUrl});
 | 
	
		
			
				|  |  | +			sysMessageFeignService.batchSendMessage(sysMessageParams);
 | 
	
		
			
				|  |  |  		}
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  		examOrganizationRelationDao.batchUpdate(examOrgans);
 |