|
@@ -5,7 +5,10 @@ import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.keao.edu.auth.api.client.SysUserFeignService;
|
|
|
import com.keao.edu.auth.api.entity.SysUser;
|
|
|
+import com.keao.edu.common.controller.BaseController;
|
|
|
import com.keao.edu.common.dal.BaseDAO;
|
|
|
+import com.keao.edu.common.entity.HttpResponseResult;
|
|
|
+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;
|
|
@@ -84,6 +87,8 @@ public class ExamRoomServiceImpl extends BaseServiceImpl<Long, ExamRoom> impleme
|
|
|
private ExamLocationDao examLocationDao;
|
|
|
@Autowired
|
|
|
private IdGeneratorService idGeneratorService;
|
|
|
+ @Autowired
|
|
|
+ private SysConfigService sysConfigService;
|
|
|
|
|
|
@Override
|
|
|
public BaseDAO<Long, ExamRoom> getDAO() {
|
|
@@ -409,7 +414,7 @@ public class ExamRoomServiceImpl extends BaseServiceImpl<Long, ExamRoom> impleme
|
|
|
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public void sendExamPlan(Integer organId, Integer examId, Integer operatorId) {
|
|
|
+ public HttpResponseResult sendExamPlan(Integer organId, Integer examId, Integer operatorId) {
|
|
|
if(Objects.isNull(examId)){
|
|
|
throw new BizException("请指定考级项目");
|
|
|
}
|
|
@@ -431,7 +436,7 @@ public class ExamRoomServiceImpl extends BaseServiceImpl<Long, ExamRoom> impleme
|
|
|
List<ExamRoomStudentRelation> examRoomStudentWithOrgans = examRoomStudentRelationDao.getNoSendExamPlanRooms(examId.longValue(), null);
|
|
|
|
|
|
if(CollectionUtils.isEmpty(examRoomStudentWithOrgans)){
|
|
|
- return;
|
|
|
+ return BaseController.succeed("所有考场都已发送考试安排");
|
|
|
}
|
|
|
|
|
|
Set<Integer> locationIds = examRoomStudentWithOrgans.stream().filter(e -> Objects.nonNull(e.getExamLocationId())).map(ExamRoomStudentRelation::getExamLocationId).collect(Collectors.toSet());
|
|
@@ -453,7 +458,14 @@ public class ExamRoomServiceImpl extends BaseServiceImpl<Long, ExamRoom> impleme
|
|
|
List<ExamCertification> examCertifications=new ArrayList<>();
|
|
|
List<StudentExamResult> studentExamResults=new ArrayList<>();
|
|
|
|
|
|
+ SysConfig baseH5UrlConfig = sysConfigService.findByParamName(SysConfigService.BASE_H5_URL);
|
|
|
+ String baseH5Url = "";
|
|
|
+ if(Objects.nonNull(baseH5UrlConfig)){
|
|
|
+ baseH5Url = baseH5UrlConfig.getParanValue();
|
|
|
+ }
|
|
|
+
|
|
|
String baseUrl = "2?examRegistrationId=";
|
|
|
+ String downloadUrl = baseH5Url + "/#/downLoad?memo=2&examRegistrationId=";
|
|
|
|
|
|
for (Map.Entry<Long, List<ExamRoomStudentRelation>> examRoomStudentEntry : examRoomStudentMap.entrySet()) {
|
|
|
List<ExamRoomStudentRelation> students = examRoomStudentEntry.getValue();
|
|
@@ -534,12 +546,13 @@ public class ExamRoomServiceImpl extends BaseServiceImpl<Long, ExamRoom> impleme
|
|
|
smsMessageType = MessageTypeEnum.EXAM_ROOM_CONFIRM_OFFLINE_STUDENT_SMS;
|
|
|
locationName=idLocationMap.get(examRoom.getExamLocationId());
|
|
|
}
|
|
|
+ String url = baseUrl + students.get(0).getExamRegistrationId();
|
|
|
sysMessageService.batchSendMessage(pushMessageType,
|
|
|
- receiverMap, null, 0, baseUrl+students.get(0).getExamRegistrationId(), JiguangPushPlugin.PLUGIN_NAME,
|
|
|
+ receiverMap, null, 0, url, JiguangPushPlugin.PLUGIN_NAME,
|
|
|
examName, examDayStr, examTimeStr, locationName);
|
|
|
sysMessageService.batchSendMessage(smsMessageType,
|
|
|
phoneMap, null, 0, null, YimeiSmsPlugin.PLUGIN_NAME,
|
|
|
- examName, examDayStr, examTimeStr, locationName);
|
|
|
+ examName, examDayStr, examTimeStr, locationName, downloadUrl + students.get(0).getExamRegistrationId());
|
|
|
}
|
|
|
|
|
|
Map<Integer, String> idTeacherPhoneMap = this.getMap("sys_user", "id_", "phone_", new ArrayList(teacherExamRoomsMap.keySet()), Integer.class, String.class);
|
|
@@ -567,6 +580,7 @@ public class ExamRoomServiceImpl extends BaseServiceImpl<Long, ExamRoom> impleme
|
|
|
if(!CollectionUtils.isEmpty(studentExamResults)){
|
|
|
studentExamResultDao.batchInsert(studentExamResults);
|
|
|
}
|
|
|
+ return BaseController.succeed("发送成功");
|
|
|
}
|
|
|
|
|
|
@Override
|