Commit 9ff2df61 authored by zhangqingle's avatar zhangqingle

打开通知

parent 1d10e803
......@@ -89,30 +89,30 @@ public class BDiscussServiceImpl implements BDiscussService {
message = bMessageList.get(0);
}
if (StringUtils.isBlank(bDiscuss.getLevel()) && "2".equals(bDiscuss.getLevel()) && "1".equals(message.getFlag())){
try{
BNotice bNotice = new BNotice();
if (StringUtils.isNotEmpty(bDiscuss.getReplyId())){
BDiscuss bDiscussStu = bDiscussRepository.selectByPrimaryKey(bDiscuss.getReplyId());
bNotice.setRecipientIds(new ArrayList<>(Arrays.asList(bDiscussStu.getStudentId())));
}else {
BDiscuss bDiscussStu = bDiscussRepository.selectByPrimaryKey(bDiscuss.getPid());
bNotice.setRecipientIds(new ArrayList<>(Arrays.asList(bDiscussStu.getStudentId())));
}
bNotice.setInfoType(InfoTypeEnum.REPLY_DISCUSS.getValue());
bNotice.setLessonId(bDiscuss.getLessonId());
bNotice.setSenderId(curUser.getUserId());
bNotice.setCorpId(curUser.getCorpId());
// 获取课程信息
BLesson bLesson = lessonRepository.selectByPrimaryKey(bDiscuss.getLessonId());
String lessonType = LessonTypeEnum.LESSON.getCode().equals(bLesson.getLessonType()) ? "线上课程" : "线下培训";
String urlType = LessonTypeEnum.LESSON.getCode().equals(bLesson.getLessonType()) ? UrlTypeEnum.LESSON.getName() : UrlTypeEnum.TRAIN.getName();
bNotice.setInfoText(sysUserServiceImpl.getNameById(bDiscuss.getStudentId()).getName() + "回复了您在" + lessonType +"[" + bLesson.getLessonName() +"]的评论" );
// 发消息
client.send(bNotice,InfoTypeEnum.REPLY_DISCUSS.getLable(), MessageEnum.HFPL.getName(),urlType);
}catch (Exception e){
log.info("发送通知失败,"+e);
// try{
BNotice bNotice = new BNotice();
if (StringUtils.isNotEmpty(bDiscuss.getReplyId())){
BDiscuss bDiscussStu = bDiscussRepository.selectByPrimaryKey(bDiscuss.getReplyId());
bNotice.setRecipientIds(new ArrayList<>(Arrays.asList(bDiscussStu.getStudentId())));
}else {
BDiscuss bDiscussStu = bDiscussRepository.selectByPrimaryKey(bDiscuss.getPid());
bNotice.setRecipientIds(new ArrayList<>(Arrays.asList(bDiscussStu.getStudentId())));
}
bNotice.setInfoType(InfoTypeEnum.REPLY_DISCUSS.getValue());
bNotice.setLessonId(bDiscuss.getLessonId());
bNotice.setSenderId(curUser.getUserId());
bNotice.setCorpId(curUser.getCorpId());
// 获取课程信息
BLesson bLesson = lessonRepository.selectByPrimaryKey(bDiscuss.getLessonId());
String lessonType = LessonTypeEnum.LESSON.getCode().equals(bLesson.getLessonType()) ? "线上课程" : "线下培训";
String urlType = LessonTypeEnum.LESSON.getCode().equals(bLesson.getLessonType()) ? UrlTypeEnum.LESSON.getName() : UrlTypeEnum.TRAIN.getName();
bNotice.setInfoText(sysUserServiceImpl.getNameById(bDiscuss.getStudentId()).getName() + "回复了您在" + lessonType +"[" + bLesson.getLessonName() +"]的评论" );
// 发消息
client.send(bNotice,InfoTypeEnum.REPLY_DISCUSS.getLable(), MessageEnum.HFPL.getName(),urlType);
// }catch (Exception e){
// log.info("发送通知失败,"+e);
// }
}
//评论课程
List<BMessage> bMessageListFBPL = bMessageRepository.queryByNameAndCorp("FBPL",curUser.getCorpId());
......@@ -121,23 +121,23 @@ public class BDiscussServiceImpl implements BDiscussService {
messageFBPL = bMessageListFBPL.get(0);
}
if (StringUtils.isBlank(bDiscuss.getLevel()) && "1".equals(bDiscuss.getLevel()) && "1".equals(messageFBPL.getFlag())){
try {
BNotice bNotice = new BNotice();
bNotice.setInfoType(InfoTypeEnum.REPLY_DISCUSS.getValue());
bNotice.setLessonId(bDiscuss.getLessonId());
bNotice.setSenderId(curUser.getUserId());
bNotice.setCorpId(curUser.getCorpId());
// 获取课程信息
BLesson bLesson = lessonRepository.selectByPrimaryKey(bDiscuss.getLessonId());
bNotice.setRecipientIds(new ArrayList<>(Arrays.asList(bLesson.getLecturerId())));
String lessonType = LessonTypeEnum.LESSON.getCode().equals(bLesson.getLessonType()) ? "线上课程" : "线下培训";
String urlType = LessonTypeEnum.LESSON.getCode().equals(bLesson.getLessonType()) ? UrlTypeEnum.LESSON.getName() : UrlTypeEnum.TRAIN.getName();
bNotice.setInfoText(sysUserServiceImpl.getNameById(bDiscuss.getStudentId()).getName() + "评论了您主讲的" + lessonType +"\"" + bLesson.getLessonName()+"\"" );
// 发消息
client.send(bNotice,InfoTypeEnum.REPLY_DISCUSS.getLable(), MessageEnum.FBPL.getName(),urlType);
}catch (Exception e){
log.info("发送通知失败,"+e);
}
// try {
BNotice bNotice = new BNotice();
bNotice.setInfoType(InfoTypeEnum.REPLY_DISCUSS.getValue());
bNotice.setLessonId(bDiscuss.getLessonId());
bNotice.setSenderId(curUser.getUserId());
bNotice.setCorpId(curUser.getCorpId());
// 获取课程信息
BLesson bLesson = lessonRepository.selectByPrimaryKey(bDiscuss.getLessonId());
bNotice.setRecipientIds(new ArrayList<>(Arrays.asList(bLesson.getLecturerId())));
String lessonType = LessonTypeEnum.LESSON.getCode().equals(bLesson.getLessonType()) ? "线上课程" : "线下培训";
String urlType = LessonTypeEnum.LESSON.getCode().equals(bLesson.getLessonType()) ? UrlTypeEnum.LESSON.getName() : UrlTypeEnum.TRAIN.getName();
bNotice.setInfoText(sysUserServiceImpl.getNameById(bDiscuss.getStudentId()).getName() + "评论了您主讲的" + lessonType +"\"" + bLesson.getLessonName()+"\"" );
// 发消息
client.send(bNotice,InfoTypeEnum.REPLY_DISCUSS.getLable(), MessageEnum.FBPL.getName(),urlType);
// }catch (Exception e){
// log.info("发送通知失败,"+e);
// }
}
//增加操作
UserUtil.setCurrentPersistOperation(bDiscuss);
......
......@@ -37,11 +37,6 @@ public class SendNoticeServiceImpl implements SendNoticeService {
@Override
public void sendAppointNotice(BLesson bLesson,AppointLessonDTO appointLessonDTO, List<String> userIds ) {
// try {
// Thread.sleep(10000);
// } catch (InterruptedException e) {
// e.printStackTrace();
// }
//是否去掉已在切已指派的人员
String type = LessonTypeEnum.LESSON.getCode().equals(bLesson.getLessonType()) ? MessageEnum.ZPKC.getName() : MessageEnum.ZPPX.getName();
List<BMessage> bMessageList = bMessageRepository.queryByNameAndCorp(type,appointLessonDTO.getCorpId());
......@@ -50,23 +45,23 @@ public class SendNoticeServiceImpl implements SendNoticeService {
message = bMessageList.get(0);
}
if (userIds != null && userIds.size() > 0 && message != null && "1".equals(message.getFlag())){
try{
BNotice bNotice = new BNotice();
bNotice.setRecipientIds(userIds);
bNotice.setLessonId(bLesson.getBusinessId());
bNotice.setSenderId(appointLessonDTO.getUserId());
bNotice.setCorpId(appointLessonDTO.getCorpId());
// 获取课程信息
String lessonType = LessonTypeEnum.LESSON.getCode().equals(bLesson.getLessonType()) ? "线上课程" : "线下培训";
String infoType = LessonTypeEnum.LESSON.getCode().equals(bLesson.getLessonType()) ? InfoTypeEnum.ONLINE_LESSON.getValue() : InfoTypeEnum.OFFLINE_TRAIN.getValue();
bNotice.setInfoType(infoType);
String urlType = LessonTypeEnum.LESSON.getCode().equals(bLesson.getLessonType()) ? UrlTypeEnum.LESSON.getName() : UrlTypeEnum.TRAIN.getName();
bNotice.setInfoText(sysUserServiceImpl.getNameById(appointLessonDTO.getUserId()).getName() + "给您指派了" + lessonType +"“" + bLesson.getLessonName() +"”,请及时学习" );
// 往智信平台发啊消息
client.send(bNotice,InfoTypeEnum.REPLY_DISCUSS.getLable(),type,urlType);
}catch (Exception e){
log.info("发送通知失败,"+e);
}
// try{
BNotice bNotice = new BNotice();
bNotice.setRecipientIds(userIds);
bNotice.setLessonId(bLesson.getBusinessId());
bNotice.setSenderId(appointLessonDTO.getUserId());
bNotice.setCorpId(appointLessonDTO.getCorpId());
// 获取课程信息
String lessonType = LessonTypeEnum.LESSON.getCode().equals(bLesson.getLessonType()) ? "线上课程" : "线下培训";
String infoType = LessonTypeEnum.LESSON.getCode().equals(bLesson.getLessonType()) ? InfoTypeEnum.ONLINE_LESSON.getValue() : InfoTypeEnum.OFFLINE_TRAIN.getValue();
bNotice.setInfoType(infoType);
String urlType = LessonTypeEnum.LESSON.getCode().equals(bLesson.getLessonType()) ? UrlTypeEnum.LESSON.getName() : UrlTypeEnum.TRAIN.getName();
bNotice.setInfoText(sysUserServiceImpl.getNameById(appointLessonDTO.getUserId()).getName() + "给您指派了" + lessonType +"“" + bLesson.getLessonName() +"”,请及时学习" );
// 往智信平台发啊消息
client.send(bNotice,InfoTypeEnum.REPLY_DISCUSS.getLable(),type,urlType);
// }catch (Exception e){
// log.info("发送通知失败,"+e);
// }
}
}
}
......@@ -85,7 +85,7 @@ public class MTNotificationApiRequestClient {
* @return
*/
public boolean send(BNotice message, String noticeTitle, String type, String urlType) {
if(true) {
if("dev".equalsIgnoreCase(serverType)) {
return true;
}
NotiRet ret = new NotiRet();
......@@ -131,6 +131,8 @@ public class MTNotificationApiRequestClient {
});
HaveJurisdictionReqDTO haveJurisdictionReqDTO = new HaveJurisdictionReqDTO(Long.parseLong(message.getCorpId()),recipientIdLongList);
Ret haveJurisList = microappApiRequestClient.haveJurisdictionUserFast(haveJurisdictionReqDTO);
log.info("----------------------通知-权限验证返回结果----------------------"+haveJurisList);
List<String> haveJurisAccountIds = new ArrayList<>();
List<String> getUserAccountList = new ArrayList<>();
......
......@@ -76,11 +76,11 @@ public class messageTask {
// 通知信息
bNotice.setInfoText("“"+bLesson.getLessonName()+"”线下培训即将开始" );
// 往智信平台发啊消息
try {
client.send(bNotice,InfoTypeEnum.REPLY_DISCUSS.getLable(),MessageEnum.PXJJKS.getName(),UrlTypeEnum.TRAIN.getName());
}catch (Exception e){
log.info("发送通知失败,"+e);
}
// try {
client.send(bNotice,InfoTypeEnum.REPLY_DISCUSS.getLable(),MessageEnum.PXJJKS.getName(),UrlTypeEnum.TRAIN.getName());
// }catch (Exception e){
// log.info("发送通知失败,"+e);
// }
});
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment