Selaa lähdekoodia

Merge branch 'master' of http://git.dayaedu.com/yonge/edu-saas

zouxuan 5 vuotta sitten
vanhempi
commit
ed86d1a771

+ 10 - 1
edu-common/src/main/java/com/keao/edu/common/enums/MessageTypeEnum.java

@@ -22,7 +22,16 @@ public enum MessageTypeEnum implements BaseEnum<String, MessageTypeEnum> {
     BEFORE_EXAM_STUDENT_REMIND_PUSH("BEFORE_EXAM_STUDENT_REMIND_PUSH","明日考试安排"),
     BEFORE_EXAM_STUDENT_REMIND_SMS("BEFORE_EXAM_STUDENT_REMIND_SMS","明日考试安排"),
     EXAM_END_REMIND("EXAM_END_REMIND", "考试结果确认通知"),
-    EXAM_RESULT_CONFIRM_PUSH("EXAM_RESULT_CONFIRM_PUSH", "考试结果已确认");
+    EXAM_RESULT_CONFIRM_PUSH("EXAM_RESULT_CONFIRM_PUSH", "考试结果已确认"),
+
+    //监考端
+    EXAM_ROOM_OPEN_PUSH("EXAM_ROOM_OPEN_PUSH", "开考签到提醒"),
+    EXAM_ROOM_OPEN_SMS("EXAM_ROOM_OPEN_SMS", "开考签到提醒"),
+    EXAM_ROOM_STUDENT_SIGN_IN_PUSH("EXAM_ROOM_STUDENT_SIGN_IN_PUSH", "考试已签到"),
+    EXAM_WILL_START_PUSH("EXAM_WILL_START_PUSH", "考试即将开始"),
+    EXAM_STARTED_PUSH("EXAM_STARTED_PUSH", "考试已开始"),
+    EXAM_ROOM_STUDENT_SIGN_IN_AGAIN_PUSH("EXAM_ROOM_STUDENT_SIGN_IN_AGAIN_PUSH", "重考签到提醒"),
+    EXAM_ROOM_STUDENT_IS_SIGN_IN_AGAIN_PUSH("EXAM_ROOM_STUDENT_IS_SIGN_IN_AGAIN_PUSH", "重考已签到"),;
 
     MessageTypeEnum(String code, String msg) {
         this.code = code;

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

@@ -325,7 +325,7 @@ public class ExamOrganizationRelationServiceImpl extends BaseServiceImpl<Long, E
 
 		List<ExamOrganizationRelation> needUpdate=new ArrayList<>();
 		for (ExamOrganizationRelation examOrgan : examOrgans) {
-			if(YesOrNoEnum.YES.equals(examOrgan.getSendUrlFlag())){
+			if(YesOrNoEnum.YES.getCode().equals(examOrgan.getSendUrlFlag())){
 				continue;
 			}
 

+ 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());
 		}
 	}