Commit 9ff2df61 authored by zhangqingle's avatar zhangqingle

打开通知

parent 1d10e803
...@@ -89,7 +89,7 @@ public class BDiscussServiceImpl implements BDiscussService { ...@@ -89,7 +89,7 @@ public class BDiscussServiceImpl implements BDiscussService {
message = bMessageList.get(0); message = bMessageList.get(0);
} }
if (StringUtils.isBlank(bDiscuss.getLevel()) && "2".equals(bDiscuss.getLevel()) && "1".equals(message.getFlag())){ if (StringUtils.isBlank(bDiscuss.getLevel()) && "2".equals(bDiscuss.getLevel()) && "1".equals(message.getFlag())){
try{ // try{
BNotice bNotice = new BNotice(); BNotice bNotice = new BNotice();
if (StringUtils.isNotEmpty(bDiscuss.getReplyId())){ if (StringUtils.isNotEmpty(bDiscuss.getReplyId())){
BDiscuss bDiscussStu = bDiscussRepository.selectByPrimaryKey(bDiscuss.getReplyId()); BDiscuss bDiscussStu = bDiscussRepository.selectByPrimaryKey(bDiscuss.getReplyId());
...@@ -110,9 +110,9 @@ public class BDiscussServiceImpl implements BDiscussService { ...@@ -110,9 +110,9 @@ public class BDiscussServiceImpl implements BDiscussService {
bNotice.setInfoText(sysUserServiceImpl.getNameById(bDiscuss.getStudentId()).getName() + "回复了您在" + lessonType +"[" + bLesson.getLessonName() +"]的评论" ); bNotice.setInfoText(sysUserServiceImpl.getNameById(bDiscuss.getStudentId()).getName() + "回复了您在" + lessonType +"[" + bLesson.getLessonName() +"]的评论" );
// 发消息 // 发消息
client.send(bNotice,InfoTypeEnum.REPLY_DISCUSS.getLable(), MessageEnum.HFPL.getName(),urlType); client.send(bNotice,InfoTypeEnum.REPLY_DISCUSS.getLable(), MessageEnum.HFPL.getName(),urlType);
}catch (Exception e){ // }catch (Exception e){
log.info("发送通知失败,"+e); // log.info("发送通知失败,"+e);
} // }
} }
//评论课程 //评论课程
List<BMessage> bMessageListFBPL = bMessageRepository.queryByNameAndCorp("FBPL",curUser.getCorpId()); List<BMessage> bMessageListFBPL = bMessageRepository.queryByNameAndCorp("FBPL",curUser.getCorpId());
...@@ -121,7 +121,7 @@ public class BDiscussServiceImpl implements BDiscussService { ...@@ -121,7 +121,7 @@ public class BDiscussServiceImpl implements BDiscussService {
messageFBPL = bMessageListFBPL.get(0); messageFBPL = bMessageListFBPL.get(0);
} }
if (StringUtils.isBlank(bDiscuss.getLevel()) && "1".equals(bDiscuss.getLevel()) && "1".equals(messageFBPL.getFlag())){ if (StringUtils.isBlank(bDiscuss.getLevel()) && "1".equals(bDiscuss.getLevel()) && "1".equals(messageFBPL.getFlag())){
try { // try {
BNotice bNotice = new BNotice(); BNotice bNotice = new BNotice();
bNotice.setInfoType(InfoTypeEnum.REPLY_DISCUSS.getValue()); bNotice.setInfoType(InfoTypeEnum.REPLY_DISCUSS.getValue());
bNotice.setLessonId(bDiscuss.getLessonId()); bNotice.setLessonId(bDiscuss.getLessonId());
...@@ -135,9 +135,9 @@ public class BDiscussServiceImpl implements BDiscussService { ...@@ -135,9 +135,9 @@ public class BDiscussServiceImpl implements BDiscussService {
bNotice.setInfoText(sysUserServiceImpl.getNameById(bDiscuss.getStudentId()).getName() + "评论了您主讲的" + lessonType +"\"" + bLesson.getLessonName()+"\"" ); bNotice.setInfoText(sysUserServiceImpl.getNameById(bDiscuss.getStudentId()).getName() + "评论了您主讲的" + lessonType +"\"" + bLesson.getLessonName()+"\"" );
// 发消息 // 发消息
client.send(bNotice,InfoTypeEnum.REPLY_DISCUSS.getLable(), MessageEnum.FBPL.getName(),urlType); client.send(bNotice,InfoTypeEnum.REPLY_DISCUSS.getLable(), MessageEnum.FBPL.getName(),urlType);
}catch (Exception e){ // }catch (Exception e){
log.info("发送通知失败,"+e); // log.info("发送通知失败,"+e);
} // }
} }
//增加操作 //增加操作
UserUtil.setCurrentPersistOperation(bDiscuss); UserUtil.setCurrentPersistOperation(bDiscuss);
......
...@@ -37,11 +37,6 @@ public class SendNoticeServiceImpl implements SendNoticeService { ...@@ -37,11 +37,6 @@ public class SendNoticeServiceImpl implements SendNoticeService {
@Override @Override
public void sendAppointNotice(BLesson bLesson,AppointLessonDTO appointLessonDTO, List<String> userIds ) { 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(); String type = LessonTypeEnum.LESSON.getCode().equals(bLesson.getLessonType()) ? MessageEnum.ZPKC.getName() : MessageEnum.ZPPX.getName();
List<BMessage> bMessageList = bMessageRepository.queryByNameAndCorp(type,appointLessonDTO.getCorpId()); List<BMessage> bMessageList = bMessageRepository.queryByNameAndCorp(type,appointLessonDTO.getCorpId());
...@@ -50,7 +45,7 @@ public class SendNoticeServiceImpl implements SendNoticeService { ...@@ -50,7 +45,7 @@ public class SendNoticeServiceImpl implements SendNoticeService {
message = bMessageList.get(0); message = bMessageList.get(0);
} }
if (userIds != null && userIds.size() > 0 && message != null && "1".equals(message.getFlag())){ if (userIds != null && userIds.size() > 0 && message != null && "1".equals(message.getFlag())){
try{ // try{
BNotice bNotice = new BNotice(); BNotice bNotice = new BNotice();
bNotice.setRecipientIds(userIds); bNotice.setRecipientIds(userIds);
bNotice.setLessonId(bLesson.getBusinessId()); bNotice.setLessonId(bLesson.getBusinessId());
...@@ -64,9 +59,9 @@ public class SendNoticeServiceImpl implements SendNoticeService { ...@@ -64,9 +59,9 @@ public class SendNoticeServiceImpl implements SendNoticeService {
bNotice.setInfoText(sysUserServiceImpl.getNameById(appointLessonDTO.getUserId()).getName() + "给您指派了" + lessonType +"“" + bLesson.getLessonName() +"”,请及时学习" ); bNotice.setInfoText(sysUserServiceImpl.getNameById(appointLessonDTO.getUserId()).getName() + "给您指派了" + lessonType +"“" + bLesson.getLessonName() +"”,请及时学习" );
// 往智信平台发啊消息 // 往智信平台发啊消息
client.send(bNotice,InfoTypeEnum.REPLY_DISCUSS.getLable(),type,urlType); client.send(bNotice,InfoTypeEnum.REPLY_DISCUSS.getLable(),type,urlType);
}catch (Exception e){ // }catch (Exception e){
log.info("发送通知失败,"+e); // log.info("发送通知失败,"+e);
} // }
} }
} }
} }
...@@ -85,7 +85,7 @@ public class MTNotificationApiRequestClient { ...@@ -85,7 +85,7 @@ public class MTNotificationApiRequestClient {
* @return * @return
*/ */
public boolean send(BNotice message, String noticeTitle, String type, String urlType) { public boolean send(BNotice message, String noticeTitle, String type, String urlType) {
if(true) { if("dev".equalsIgnoreCase(serverType)) {
return true; return true;
} }
NotiRet ret = new NotiRet(); NotiRet ret = new NotiRet();
...@@ -131,6 +131,8 @@ public class MTNotificationApiRequestClient { ...@@ -131,6 +131,8 @@ public class MTNotificationApiRequestClient {
}); });
HaveJurisdictionReqDTO haveJurisdictionReqDTO = new HaveJurisdictionReqDTO(Long.parseLong(message.getCorpId()),recipientIdLongList); HaveJurisdictionReqDTO haveJurisdictionReqDTO = new HaveJurisdictionReqDTO(Long.parseLong(message.getCorpId()),recipientIdLongList);
Ret haveJurisList = microappApiRequestClient.haveJurisdictionUserFast(haveJurisdictionReqDTO); Ret haveJurisList = microappApiRequestClient.haveJurisdictionUserFast(haveJurisdictionReqDTO);
log.info("----------------------通知-权限验证返回结果----------------------"+haveJurisList);
List<String> haveJurisAccountIds = new ArrayList<>(); List<String> haveJurisAccountIds = new ArrayList<>();
List<String> getUserAccountList = new ArrayList<>(); List<String> getUserAccountList = new ArrayList<>();
......
...@@ -76,11 +76,11 @@ public class messageTask { ...@@ -76,11 +76,11 @@ public class messageTask {
// 通知信息 // 通知信息
bNotice.setInfoText("“"+bLesson.getLessonName()+"”线下培训即将开始" ); bNotice.setInfoText("“"+bLesson.getLessonName()+"”线下培训即将开始" );
// 往智信平台发啊消息 // 往智信平台发啊消息
try { // try {
client.send(bNotice,InfoTypeEnum.REPLY_DISCUSS.getLable(),MessageEnum.PXJJKS.getName(),UrlTypeEnum.TRAIN.getName()); client.send(bNotice,InfoTypeEnum.REPLY_DISCUSS.getLable(),MessageEnum.PXJJKS.getName(),UrlTypeEnum.TRAIN.getName());
}catch (Exception e){ // }catch (Exception e){
log.info("发送通知失败,"+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