Joburgess 5 years ago
parent
commit
27e8049de3

+ 13 - 5
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamRegistrationServiceImpl.java

@@ -4,6 +4,7 @@ package com.keao.edu.user.service.impl;
 import com.keao.edu.auth.api.client.SysUserFeignService;
 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;
@@ -22,10 +23,7 @@ import com.keao.edu.user.enums.TransStatusEnum;
 import com.keao.edu.user.page.ApplyListQueryInfo;
 import com.keao.edu.user.page.ExamRecordQueryInfo;
 import com.keao.edu.user.page.ExamRegistrationQueryInfo;
-import com.keao.edu.user.service.ExamRegistrationPaymentService;
-import com.keao.edu.user.service.ExamRegistrationService;
-import com.keao.edu.user.service.OrganizationService;
-import com.keao.edu.user.service.PayService;
+import com.keao.edu.user.service.*;
 import com.keao.edu.util.collection.MapUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -64,6 +62,8 @@ public class ExamRegistrationServiceImpl extends BaseServiceImpl<Long, ExamRegis
     private SysUserDao sysUserDao;
     @Autowired
     private SysUserFeignService sysUserFeignService;
+    @Autowired
+    private SysConfigService sysConfigService;
 
     @Override
     public BaseDAO<Long, ExamRegistration> getDAO() {
@@ -286,6 +286,14 @@ public class ExamRegistrationServiceImpl extends BaseServiceImpl<Long, ExamRegis
         }
         er.setStatus(status);
         er.setMemo(memo);
+
+        SysConfig baseUrlConfig = sysConfigService.findByParamName(SysConfigService.BASE_API_URL);
+        String baseUrl="";
+        if(Objects.nonNull(baseUrlConfig)){
+            baseUrl=baseUrlConfig.getParanValue();
+        }
+        baseUrl = "1?" + baseUrl+"/#/appDetail?id=" + registId;
+
         Map<Integer, String> receiverMap = new HashMap<>(1);
         receiverMap.put(er.getStudentId(), er.getStudentId().toString());
         if(StudentRegistrationStatusEnum.AUDIT_PASS.equals(er.getStatus())){
@@ -293,7 +301,7 @@ public class ExamRegistrationServiceImpl extends BaseServiceImpl<Long, ExamRegis
                     receiverMap, null, 0, null, JiguangPushPlugin.PLUGIN_NAME);
         }else if(StudentRegistrationStatusEnum.AUDIT_REJECT.equals(er.getStatus())){
             sysMessageService.batchSendMessage(MessageTypeEnum.REGIST_REJECT_PUSH,
-                    receiverMap, null, 0, null, JiguangPushPlugin.PLUGIN_NAME);
+                    receiverMap, null, 0, baseUrl, JiguangPushPlugin.PLUGIN_NAME);
 
             SysUser student = sysUserDao.get(er.getStudentId());
             Map<Integer, String> phoneMap = new HashMap<>(1);

+ 5 - 1
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamRoomServiceImpl.java

@@ -80,6 +80,8 @@ public class ExamRoomServiceImpl extends BaseServiceImpl<Long, ExamRoom> impleme
 	private SysMessageService sysMessageService;
 	@Autowired
 	private ExamRoomStudentRelationDao examRoomStudentRelationDao;
+	@Autowired
+	private SysConfigService sysConfigService;
 
 	@Override
 	public BaseDAO<Long, ExamRoom> getDAO() {
@@ -420,6 +422,8 @@ public class ExamRoomServiceImpl extends BaseServiceImpl<Long, ExamRoom> impleme
 
 		List<ExamRoom> needUpdateExamRooms = new ArrayList<>();
 
+		String baseUrl = "2?examRegistrationId=";
+
 		for (Map.Entry<Long, List<ExamRoomStudentRelation>> examRoomStudentEntry : examRoomStudentMap.entrySet()) {
 			List<ExamRoomStudentRelation> students = examRoomStudentEntry.getValue();
 			Set<Integer> studentIds = students.stream().map(ExamRoomStudentRelation::getStudentId).collect(Collectors.toSet());
@@ -466,7 +470,7 @@ public class ExamRoomServiceImpl extends BaseServiceImpl<Long, ExamRoom> impleme
 				locationName=idLocationMap.get(examRoom.getExamLocationId());
 			}
 			sysMessageService.batchSendMessage(pushMessageType,
-					receiverMap, null, 0, null, JiguangPushPlugin.PLUGIN_NAME,
+					receiverMap, null, 0, baseUrl+students.get(0).getExamRegistrationId(), JiguangPushPlugin.PLUGIN_NAME,
 					examName, examDayStr, examTimeStr, locationName);
 			sysMessageService.batchSendMessage(smsMessageType,
 					phoneMap, null, 0, null, YimeiSmsPlugin.PLUGIN_NAME,

+ 4 - 1
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/StudentExamResultServiceImpl.java

@@ -129,6 +129,9 @@ public class StudentExamResultServiceImpl extends BaseServiceImpl<Long, StudentE
 		Set<Subject> subjectIds = studentExamResults.stream().map(e -> e.getExamRegistration().getSubject()).collect(Collectors.toSet());
 		Map<Integer, String> subjectIdNameMap = this.getMap("subject", "id_", "name_", new ArrayList(subjectIds), Integer.class, String.class);
 
+
+		String baseUrl = "4?";
+
 		for (StudentExamResult studentExamResult : studentExamResults) {
 			String examName = examIdNameMap.get(studentExamResult.getExaminationBasicId());
 			String subjectName = subjectIdNameMap.get(studentExamResult.getExamRegistration().getSubjectId());
@@ -138,7 +141,7 @@ public class StudentExamResultServiceImpl extends BaseServiceImpl<Long, StudentE
 			userPhoneMap.put(studentExamResult.getStudentId(), studentExamResult.getStudentId().toString());
 
 			sysMessageService.batchSendMessage(MessageTypeEnum.EXAM_RESULT_CONFIRM_PUSH,
-					userPhoneMap, null, 0, null, JiguangPushPlugin.PLUGIN_NAME,
+					userPhoneMap, null, 0, baseUrl, JiguangPushPlugin.PLUGIN_NAME,
 					examName, subjectName, level, studentExamResult.getResult().getMsg());
 		}
 	}