Package com.jeecms.cms.entity.assist

Examples of com.jeecms.cms.entity.assist.CmsReceiverMessage


      return FrontUtils.showMessage(request, model, "member.memberClose");
    }
    if (user == null) {
      return FrontUtils.showLogin(request, model, site);
    }
    CmsReceiverMessage message = receiverMessageMng.findById(id);
    // 非收件人无法回复信件
    if (!message.getMsgReceiverUser().equals(user)) {
      WebErrors errors = WebErrors.create(request);
      errors.addErrorCode("error.noPermissionsView");
      return FrontUtils.showError(request, response, model, errors);
    }
    model.addAttribute("message", message);
View Full Code Here


    message.setMsgReceiverUser(msgReceiverUser);
    message.setMsgStatus(false);
    message.setSendTime(new Date());
    message.setSite(site);
    messageMng.save(message);
    CmsReceiverMessage receiverMessage = new CmsReceiverMessage(message);
    receiverMessage.setMsgBox(0);
    receiverMessage.setMessage(message);
    // 接收端(有一定冗余)
    receiverMessageMng.save(receiverMessage);
    log.info("member CmsMessage save CmsMessage success. id={}", message
        .getId());
    return FrontUtils.showSuccess(request, model, nextUrl);
View Full Code Here

    // 作为草稿和发件箱的区别
    message.setSendTime(null);
    // message.setSendTime(new Date());
    message.setSite(site);
    messageMng.save(message);
    CmsReceiverMessage receiverMessage = new CmsReceiverMessage(message);
    receiverMessage.setMsgBox(2);
    receiverMessage.setMessage(message);
    // 接收端(有一定冗余)
    receiverMessageMng.save(receiverMessage);
    return FrontUtils.showSuccess(request, model, nextUrl);
  }
View Full Code Here

    message.setMsgBox(1);
    message.setSendTime(new Date());
    messageMng.update(message);
    Set<CmsReceiverMessage> receiverMessageSet = message.getReceiverMsgs();
    Iterator<CmsReceiverMessage> it = receiverMessageSet.iterator();
    CmsReceiverMessage receiverMessage;
    while (it.hasNext()) {
      receiverMessage = it.next();
      receiverMessage.setMsgBox(0);
      receiverMessage.setSendTime(new Date());
      receiverMessage.setMessage(message);
      // 接收端(有一定冗余)
      receiverMessageMng.update(receiverMessage);
    }
    log.info("member CmsMessage save CmsMessage success. id={}", message
        .getId());
View Full Code Here

    }
    message = messageMng.update(message);
    // 更新发送表的信息,收件表的信息同步更新
    Set<CmsReceiverMessage> receiverMessageSet = message.getReceiverMsgs();
    Iterator<CmsReceiverMessage> it = receiverMessageSet.iterator();
    CmsReceiverMessage receiverMessage;
    while (it.hasNext()) {
      receiverMessage = it.next();
      receiverMessage.setMsgContent(message.getContentHtml());
      receiverMessage.setMsgReceiverUser(message.getMsgReceiverUser());
      receiverMessage.setMsgTitle(message.getMsgTitle());
      receiverMessage.setMessage(message);
      // 接收端(有一定冗余)
      receiverMessageMng.update(receiverMessage);
    }
    log.info("member CmsMessage update CmsMessage success. id={}", message
        .getId());
View Full Code Here

      return FrontUtils.showMessage(request, model, "member.memberClose");
    }
    if (user == null) {
      return FrontUtils.showLogin(request, model, site);
    }
    CmsReceiverMessage message = receiverMessageMng.findById(id);
    if (message != null) {
      // 阅读收信
      // 非收件人和发件人无权查看信件
      if (!message.getMsgReceiverUser().equals(user)
          && !message.getMsgSendUser().equals(user)) {
        WebErrors errors = WebErrors.create(request);
        errors.addErrorCode("error.noPermissionsView");
        return FrontUtils.showError(request, response, model, errors);
      }
      // 收件人查看更新已读状态
      if (message.getMsgReceiverUser().equals(user)) {
        message.setMsgStatus(true);
        receiverMessageMng.update(message);
        log
            .info(
                "member CmsMessage read CmsMessage success. id={}",
                id);
View Full Code Here

      return FrontUtils.showMessage(request, model, "member.memberClose");
    }
    if (user == null) {
      return FrontUtils.showLogin(request, model, site);
    }
    CmsReceiverMessage receiverMessage = receiverMessageMng.findById(id);
    CmsMessage message;
    if (receiverMessage != null) {
      model.addAttribute("message", receiverMessage);
    } else {
      message = messageMng.findById(id);
View Full Code Here

  public void message_trash(Integer ids[], HttpServletRequest request,
      HttpServletResponse response, ModelMap model) throws JSONException {
    CmsUser user = CmsUtils.getUser(request);
    JSONObject object = new JSONObject();
    CmsMessage message;
    CmsReceiverMessage receiverMessage;
    if (user == null) {
      object.put("result", false);
    } else {
      Iterator<CmsReceiverMessage> it;
      for (Integer i = 0; i < ids.length; i++) {
        message = messageMng.findById(ids[i]);
        receiverMessage = receiverMessageMng.findById(ids[i]);
        if (message != null && message.getMsgSendUser().equals(user)) {
          message.setMsgBox(3);
          receiverMessage = new CmsReceiverMessage();
          receiverMessage.setMsgBox(3);
          receiverMessage.setMsgContent(message.getMsgContent());
          receiverMessage.setMsgSendUser(message.getMsgSendUser());
          receiverMessage.setMsgReceiverUser(user);
          receiverMessage.setMsgStatus(message.getMsgStatus());
          receiverMessage.setMsgTitle(message.getMsgTitle());
          receiverMessage.setSendTime(message.getSendTime());
          receiverMessage.setSite(message.getSite());
          receiverMessage.setMessage(null);
          // 接收端(有一定冗余)
          receiverMessageMng.save(receiverMessage);
          // 清空该发件对应的收件关联关系
          Set<CmsReceiverMessage> receiverMessages = message
              .getReceiverMsgs();
          if (receiverMessages != null && receiverMessages.size() > 0) {
            it = receiverMessages.iterator();
            CmsReceiverMessage tempReceiverMessage;
            while (it.hasNext()) {
              tempReceiverMessage = it.next();
              tempReceiverMessage.setMessage(null);
              receiverMessageMng.update(tempReceiverMessage);
            }
          }
          messageMng.deleteById(ids[i]);
        }
View Full Code Here

  @RequestMapping(value = "/member/message_revert.jspx")
  public void message_revert(Integer ids[], HttpServletRequest request,
      HttpServletResponse response, ModelMap model) throws JSONException {
    CmsUser user = CmsUtils.getUser(request);
    JSONObject object = new JSONObject();
    CmsReceiverMessage receiverMessage;
    if (user == null) {
      object.put("result", false);
    } else {
      for (Integer i = 0; i < ids.length; i++) {
        receiverMessage = receiverMessageMng.findById(ids[i]);
        // 收件箱
        if (receiverMessage != null
            && receiverMessage.getMsgReceiverUser().equals(user)) {
          receiverMessage.setMsgBox(0);
          receiverMessageMng.update(receiverMessage);
        }
        log.info("member CmsMessage revert CmsMessage success. id={}",
            ids[i]);
      }
View Full Code Here

  public void message_empty(Integer ids[], HttpServletRequest request,
      HttpServletResponse response, ModelMap model) throws JSONException {
    CmsUser user = CmsUtils.getUser(request);
    JSONObject object = new JSONObject();
    CmsMessage message;
    CmsReceiverMessage receiverMessage;
    if (user == null) {
      object.put("result", false);
    } else {
      for (Integer i = 0; i < ids.length; i++) {
        // 清空收到的站内信
        receiverMessage = receiverMessageMng.findById(ids[i]);
        if (receiverMessage != null
            && receiverMessage.getMsgReceiverUser().equals(user)) {
          receiverMessageMng.deleteById(ids[i]);
        } else {
          // 清空发送的站内信
          message = receiverMessage.getMessage();
          if (receiverMessage.getMsgBox().equals(3)) {
            // 草稿直接删除
            receiverMessage.setMessage(null);
            if (message != null) {
              messageMng.deleteById(message.getId());
            }
          } else {
            // 非草稿删除和主表的关联
            receiverMessage.setMessage(null);
          }
          if (message != null
              && message.getMsgSendUser().equals(user)) {
            messageMng.deleteById(message.getId());
          }
View Full Code Here

TOP

Related Classes of com.jeecms.cms.entity.assist.CmsReceiverMessage

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.