|
|
@@ -1099,7 +1099,7 @@ public class OpenIMServiceImpl implements OpenIMService {
|
|
|
FsUserCourse fsUserCourse = fsUserCourseMapper.selectFsUserCourseByCourseId(batchSendCourseDTO.getCourseId());
|
|
|
Long project = fsUserCourse != null ? fsUserCourse.getProject() : null;
|
|
|
long planSendTimeStamp;
|
|
|
- if(batchSendCourseDTO.getSendType() == 1 && batchSendCourseDTO.getSendTime() != null && batchSendCourseDTO.getSendTime().compareTo(new Date()) > 0){
|
|
|
+ if(Objects.nonNull(batchSendCourseDTO.getSendType()) &&batchSendCourseDTO.getSendType() == 1 && batchSendCourseDTO.getSendTime() != null && batchSendCourseDTO.getSendTime().compareTo(new Date()) > 0){
|
|
|
planSendTimeStamp = batchSendCourseDTO.getSendTime().getTime();
|
|
|
} else {
|
|
|
planSendTimeStamp = System.currentTimeMillis();
|
|
|
@@ -1109,7 +1109,7 @@ public class OpenIMServiceImpl implements OpenIMService {
|
|
|
OpenImBatchMsgDTO openImBatchMsgDTO = makeOpenImBatchMsgDTO(batchSendCourseDTO, courseUrl, objectMapper, userIds, planSendTimeStamp, "发课");
|
|
|
|
|
|
int sendType;
|
|
|
- if(batchSendCourseDTO.getSendType() == 1 && batchSendCourseDTO.getSendTime() != null && batchSendCourseDTO.getSendTime().compareTo(new Date()) > 0) {
|
|
|
+ if(Objects.nonNull(batchSendCourseDTO.getSendType())&&batchSendCourseDTO.getSendType() == 1 && batchSendCourseDTO.getSendTime() != null && batchSendCourseDTO.getSendTime().compareTo(new Date()) > 0) {
|
|
|
sendType = 1; //定时
|
|
|
} else {
|
|
|
sendType = 2; //实时
|
|
|
@@ -1575,4 +1575,56 @@ public class OpenIMServiceImpl implements OpenIMService {
|
|
|
return null;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ //发送用户信息采集数据
|
|
|
+ @Override
|
|
|
+ public OpenImResponseDTO sendUserInformation(Long userId,Long doctorId,Long userInformationId) {
|
|
|
+ try {
|
|
|
+ accountCheck("U"+userId,"1");
|
|
|
+ OpenImMsgDTO openImMsgDTO = new OpenImMsgDTO();
|
|
|
+ ObjectMapper objectMapper = new ObjectMapper();
|
|
|
+ openImMsgDTO.setSendID("U"+userId);
|
|
|
+ openImMsgDTO.setRecvID("D"+doctorId);
|
|
|
+ //110为im的自定义消息类型
|
|
|
+ openImMsgDTO.setContentType(110);
|
|
|
+ openImMsgDTO.setSenderPlatformID(5);
|
|
|
+ openImMsgDTO.setSessionType(1);
|
|
|
+ OpenImMsgDTO.Content content = new OpenImMsgDTO.Content();
|
|
|
+ //content.setContent(ext);
|
|
|
+ PayloadDTO payload = new PayloadDTO();
|
|
|
+ payload.setDescription("userInformation");
|
|
|
+ payload.setData("userInformation");
|
|
|
+ PayloadDTO.Extension extension = new PayloadDTO.Extension();
|
|
|
+
|
|
|
+ extension.setDoctorId(doctorId);
|
|
|
+ extension.setUserInformationId(userInformationId);
|
|
|
+ payload.setExtension(extension);
|
|
|
+ OpenImMsgDTO.ImData imData = new OpenImMsgDTO.ImData();
|
|
|
+
|
|
|
+ imData.setPayload(payload);
|
|
|
+
|
|
|
+ String imJson = objectMapper.writeValueAsString(imData);
|
|
|
+ content.setData(imJson);
|
|
|
+ openImMsgDTO.setContent(content);
|
|
|
+ return openIMSendMsg(openImMsgDTO);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public OpenImResponseDTO doctorSendMsgToUser(Long userId, Long doctorId) {
|
|
|
+ OpenImMsgDTO openImMsgDTO = new OpenImMsgDTO();
|
|
|
+ ObjectMapper objectMapper = new ObjectMapper();
|
|
|
+ openImMsgDTO.setRecvID("U"+userId);
|
|
|
+ openImMsgDTO.setSendID("D"+doctorId);
|
|
|
+ openImMsgDTO.setContentType(101);
|
|
|
+ openImMsgDTO.setSenderPlatformID(5);
|
|
|
+ openImMsgDTO.setSessionType(1);
|
|
|
+ OpenImMsgDTO.Content content = new OpenImMsgDTO.Content();
|
|
|
+ content.setContent("您的用户信息已确认");
|
|
|
+ openImMsgDTO.setContent(content);
|
|
|
+ return openIMSendMsg(openImMsgDTO);
|
|
|
+ }
|
|
|
}
|