Пример #1
0
  /**
   * 拷贝至对应邮箱
   *
   * @param sqlSession
   * @param mapper
   * @param mapperRelation
   * @param mapperContent
   * @param record
   * @param recordRelation
   * @param recordContent
   * @param temp
   * @throws IllegalAccessException
   * @throws UnsupportedEncodingException
   */
  private void copyMail(
      B_T_Ufp_Mail_Attribute record,
      B_T_Ufp_Mail_Relation recordRelation,
      B_T_Ufp_Mail_Content recordContent,
      String temp,
      C_T_Sys_FileExample example,
      C_T_Sys_FileExample.Criteria criteria)
      throws IllegalAccessException, UnsupportedEncodingException {
    String uuid = new GUID().toString();
    // 拷贝邮件时同时拷贝邮件带的附件
    criteria.andMainIdEqualTo(temp.trim());
    List<C_T_Sys_File> c_T_Sys_File_list = mapperFT.selectByExample(example);
    if (c_T_Sys_File_list != null) {
      for (C_T_Sys_File file : c_T_Sys_File_list) {
        file.setUuid(new GUID().toString());
        file.setMainId(uuid); // 设置原始邮件附件
        mapperFT.insertSelective(file);
      }
    }
    // 插入邮件关联表
    b_T_Ufp_Mail_Relation.setUuid(uuid);
    if ("1".equals(mailTypeS)) {
      b_T_Ufp_Mail_Relation.setReplyFlag(4); // 拷贝至发件箱:4
    } else if ("7".equals(mailTypeS)) {
      b_T_Ufp_Mail_Relation.setReplyFlag(1); // 收件箱:1
      // 拷贝至收件箱设置特定收件人为当前登录人
      b_T_Ufp_Mail_Relation.setSpecificRecsysUser(SessionFactory.getSessionUserId());
    } else if ("2".equals(mailTypeS)) {
      b_T_Ufp_Mail_Relation.setReplyFlag(3); // 草稿箱:3
    } else if ("3".equals(mailTypeS)) {
      b_T_Ufp_Mail_Relation.setReplyFlag(3); // 垃圾箱:3
    }
    b_T_Ufp_Mail_Relation.setMailType(Long.valueOf(mailTypeS));
    b_T_Ufp_Mail_Relation.setMailAttributeId(uuid);
    b_T_Ufp_Mail_Relation.setMailContentId(uuid);

    mapperMRT.insertSelective(b_T_Ufp_Mail_Relation);
    // 插入邮件属性表
    b_T_Ufp_Mail_Attribute = mapperMAT.selectByPrimaryKey(temp);
    b_T_Ufp_Mail_Attribute.setUuid(uuid);
    mapperMAT.insertSelective(b_T_Ufp_Mail_Attribute);
    // 插入邮件正文表
    b_T_Ufp_Mail_Content = mapperMCT.selectByPrimaryKey(temp);
    b_T_Ufp_Mail_Content.setUuid(uuid);
    mapperMCT.insertSelective(b_T_Ufp_Mail_Content);
  }
Пример #2
0
  /** 电子邮件发邮件列表加载 */
  public String sendlistLoad() {
    allPermission = "*";

    String sendUser = SessionFactory.getSessionUserNm();
    String sendSysUser = SessionFactory.getSessionUserId();
    if (StringTools.isNotNullAndHasValue(mainDocId)) {
      if ("1".equals(isReplyTrun)) {
        // 转发邮件
        b_T_Ufp_Mail_Attribute = mapperMAT.selectByPrimaryKey(mainDocId);
        b_T_Ufp_Mail_Relation = mapperMRT.selectByPrimaryKey(mainDocId);
        b_T_Ufp_Mail_Content = mapperMCT.selectByPrimaryKey(mainDocId);
        b_T_Ufp_Mail_Attribute.setTitle(titleS);
        b_T_Ufp_Mail_Relation.setUserId("");
        b_T_Ufp_Mail_Relation.setUserName("");
        // 回复时,清空抄送人和密送人
        b_T_Ufp_Mail_Attribute.setCopySysUser("");
        b_T_Ufp_Mail_Attribute.setCopyUser("");
        b_T_Ufp_Mail_Attribute.setDarkSysUser("");
        b_T_Ufp_Mail_Attribute.setDarkUser("");
        String receiptText = String.valueOf(b_T_Ufp_Mail_Attribute.getIsReceipt());
        checkBoxIsChecked(receiptText);
      } else if ("0".equals(isReplyTrun)) {
        // 回复邮件
        b_T_Ufp_Mail_Attribute = mapperMAT.selectByPrimaryKey(mainDocId);
        b_T_Ufp_Mail_Relation = mapperMRT.selectByPrimaryKey(mainDocId);
        b_T_Ufp_Mail_Relation.setUserId(b_T_Ufp_Mail_Attribute.getSendSysUser());
        b_T_Ufp_Mail_Relation.setUserName(b_T_Ufp_Mail_Attribute.getSendUser());
        b_T_Ufp_Mail_Attribute.setTitle(titleS);
        b_T_Ufp_Mail_Attribute.setSendUser(sendUser);
        b_T_Ufp_Mail_Attribute.setSendSysUser(sendSysUser);
        // 回复时,清空抄送人和密送人
        b_T_Ufp_Mail_Attribute.setCopySysUser("");
        b_T_Ufp_Mail_Attribute.setCopyUser("");
        b_T_Ufp_Mail_Attribute.setDarkSysUser("");
        b_T_Ufp_Mail_Attribute.setDarkUser("");
        // 回复邮件去掉原始邮件的附件
        newFileIds = "";
        b_T_Ufp_Mail_Attribute.setUuid("");
        b_T_Ufp_Mail_Content = mapperMCT.selectByPrimaryKey(mainDocId);
        String receiptText = String.valueOf(b_T_Ufp_Mail_Attribute.getIsReceipt());
        checkBoxIsChecked(receiptText);
      }
      if ("2".equals(mailType)) {
        b_T_Ufp_Mail_Attribute = mapperMAT.selectByPrimaryKey(mainDocId);
        b_T_Ufp_Mail_Relation = mapperMRT.selectByPrimaryKey(mainDocId);
        b_T_Ufp_Mail_Content = mapperMCT.selectByPrimaryKey(mainDocId);
        mailSaveSendFlag = "1"; // 默认勾选保存至发件箱
        isReceipt = b_T_Ufp_Mail_Attribute.getIsReceipt().toString(); // 默认不勾选回执
        isSendMsg = b_T_Ufp_Mail_Attribute.getIsSendMsg().toString(); // 默认不勾选发送短信
      }
    } else {
      // 发邮件
      if (b_T_Ufp_Mail_Attribute == null) {
        b_T_Ufp_Mail_Attribute = new B_T_Ufp_Mail_Attribute();
        b_T_Ufp_Mail_Attribute.setSendUser(SessionFactory.getSessionUserNm());
        b_T_Ufp_Mail_Attribute.setImportantLeve("2");
        b_T_Ufp_Mail_Attribute.setPriorityLeve("2");
        mailSaveSendFlag = "1"; // 默认勾选保存至发件箱
        isReceipt = "0"; // 默认不勾选回执
        isSendMsg = "0"; // 默认不勾选发送短信
      }
    }
    return SUCCESS;
  }
Пример #3
0
  /**
   * 发邮件时保存邮件,并发送邮件
   *
   * @param sqlSession
   * @param mapper
   * @param mapperRelation
   * @param mapperContent
   * @param record
   * @param recordRelation
   * @param recordContent
   * @param sendTime
   * @param sendUser
   * @param sendSysUser
   * @return
   */
  private String saveMail(
      B_T_Ufp_Mail_Attribute record,
      B_T_Ufp_Mail_Relation recordRelation,
      B_T_Ufp_Mail_Content recordContent,
      String sendTime,
      String sendUser,
      String sendSysUser,
      int replyFlag,
      C_T_Sys_FileExample example,
      C_T_Sys_FileExample.Criteria criteria)
      throws Exception {
    String returnMsg;
    // 向邮件属性表 添加
    String uuid = new GUID().toString();
    String isFile = null;
    // 所有收邮件人:收件人、抄送人和暗送人
    String allReceiverSysUser = null;
    if (b_T_Ufp_Mail_Relation != null) {
      allReceiverSysUser = b_T_Ufp_Mail_Relation.getUserId();
      if (b_T_Ufp_Mail_Attribute != null) {
        if (StringTools.isNotNullAndHasValue(allReceiverSysUser)) {
          allReceiverSysUser =
              allReceiverSysUser
                  + ","
                  + b_T_Ufp_Mail_Attribute.getCopySysUser()
                  + ","
                  + b_T_Ufp_Mail_Attribute.getDarkSysUser();
        } else {
          allReceiverSysUser =
              b_T_Ufp_Mail_Attribute.getCopySysUser()
                  + ","
                  + b_T_Ufp_Mail_Attribute.getDarkSysUser();
        }
      }
    } else {
      allReceiverSysUser = "";
      if (b_T_Ufp_Mail_Attribute != null) {
        if (StringTools.isNotNullAndHasValue(allReceiverSysUser)) {
          allReceiverSysUser =
              allReceiverSysUser
                  + ","
                  + b_T_Ufp_Mail_Attribute.getCopySysUser()
                  + ","
                  + b_T_Ufp_Mail_Attribute.getDarkSysUser();
        } else {
          allReceiverSysUser =
              b_T_Ufp_Mail_Attribute.getCopySysUser()
                  + ","
                  + b_T_Ufp_Mail_Attribute.getDarkSysUser();
        }
      }
    }

    try {
      // 更新附件表的主文档ID
      FileIdUpdata.Updata(newFileIds, uuid);
      criteria.andMainIdEqualTo(uuid);
      List<C_T_Sys_File> listFile = mapperFT.selectByExample(example);
      if (listFile != null) {
        if (listFile.size() > 0) {
          isFile = "1"; // 有附件
        } else {
          isFile = "0"; // 没有附件
        }
      } else {
        isFile = "0"; // 没有附件
      }
    } catch (Exception e) {
      e.printStackTrace();
    }
    b_T_Ufp_Mail_Attribute.setUuid(uuid);
    b_T_Ufp_Mail_Attribute.setSendTime(sendTime);
    b_T_Ufp_Mail_Attribute.setSendUser(sendUser);
    b_T_Ufp_Mail_Attribute.setSendSysUser(sendSysUser);
    b_T_Ufp_Mail_Attribute.setIsReceipt(Integer.valueOf(booleanToString(isReceipt))); // 回执
    // b_T_Ufp_Mail_Attribute.setIsSendMsg(Integer.valueOf(booleanToString(isSendMsg)));//是否发送短消息
    mapperMAT.insertSelective(b_T_Ufp_Mail_Attribute);
    // 向邮件联系表添加(发送箱里面的邮件特定收件人统一不设置)
    b_T_Ufp_Mail_Relation.setUuid(uuid);
    if (StringTools.isNullOrNoValue(isPaper)) {
      if ("false".equals(mailType)) {
        // 未勾选保存至发件箱复选框,则保存至垃圾箱
        b_T_Ufp_Mail_Relation.setMailType(Long.valueOf("3"));
        b_T_Ufp_Mail_Relation.setReplyFlag(3); // 垃圾箱标志:3
      } else {
        // 1:默认勾选保存至发件箱
        b_T_Ufp_Mail_Relation.setMailType(Long.valueOf(booleanToString(mailType)));
        b_T_Ufp_Mail_Relation.setReplyFlag(replyFlag); // 收邮件默认值:1
      }
    } else {
      mailType = "2";
      b_T_Ufp_Mail_Relation.setMailType(Long.valueOf(mailType)); // 存原稿保存至草稿箱
      b_T_Ufp_Mail_Relation.setReplyFlag(3); // 存草稿箱标志:3
    }
    b_T_Ufp_Mail_Relation.setIsNew(0); // 新邮件
    b_T_Ufp_Mail_Relation.setMailAttributeId(uuid);
    b_T_Ufp_Mail_Relation.setMailContentId(uuid);
    b_T_Ufp_Mail_Relation.setReceiverTime(sendTime); // 未收邮件日期为发件日期
    b_T_Ufp_Mail_Relation.setIsFile(Integer.valueOf(isFile)); // 有无附件标志
    mapperMRT.insertSelective(b_T_Ufp_Mail_Relation);
    // 向邮件正文表添加
    b_T_Ufp_Mail_Content.setUuid(uuid);
    mapperMCT.insertSelective(b_T_Ufp_Mail_Content);

    // 给所有收邮件人:收件人、抄送人和暗送人发邮件
    String isuserxt = "";
    if (StringTools.isNullOrNoValue(isPaper) || !"2".equals(isPaper)) {
      if (StringTools.isNotNullAndHasValue(allReceiverSysUser)) {
        String temps[] = allReceiverSysUser.split(",");
        String guid = null;
        for (String temp : temps) {
          if (isuserxt.indexOf(temp) < 0) {
            if (StringTools.isNotNullAndHasValue(temp.trim())) {
              guid = new GUID().toString();
              addForAllRecUser(guid);

              String darkSysUser = b_T_Ufp_Mail_Attribute.getDarkSysUser();
              // 循环变量值包含在暗送人中时,设置信息
              if (darkSysUser.indexOf(temp) > -1) {
                b_T_Ufp_Mail_Attribute.setTipDarkInfo("你是这封邮件的密送人,所以不会显示在收件人中。");
              }

              b_T_Ufp_Mail_Attribute.setUuid(guid);
              b_T_Ufp_Mail_Attribute.setSendTime(sendTime);
              b_T_Ufp_Mail_Attribute.setSendUser(sendUser);
              b_T_Ufp_Mail_Attribute.setSendSysUser(sendSysUser);
              b_T_Ufp_Mail_Attribute.setIsReceipt(
                  Integer.valueOf(booleanToString(isReceipt))); // 回执
              // b_T_Ufp_Mail_Attribute.setIsSendMsg(Integer.valueOf(booleanToString(isSendMsg)));//是否发送短消息
              mapperMAT.insertSelective(b_T_Ufp_Mail_Attribute);
              // 向邮件联系表添加
              b_T_Ufp_Mail_Relation.setUuid(guid);
              b_T_Ufp_Mail_Relation.setMailType(
                  Long.valueOf("7")); // 7:发邮件时,发送给所有收邮件人(allReceiverSysUser)的邮件标志
              b_T_Ufp_Mail_Relation.setIsNew(0); // 新邮件
              b_T_Ufp_Mail_Relation.setMailAttributeId(guid);
              b_T_Ufp_Mail_Relation.setMailContentId(guid);
              b_T_Ufp_Mail_Relation.setReceiverTime(sendTime); // 未收邮件日期为发件日期
              b_T_Ufp_Mail_Relation.setReplyFlag(replyFlag); // 收邮件默认值:1
              b_T_Ufp_Mail_Relation.setIsFile(Integer.valueOf(isFile)); // 有无附件标志
              b_T_Ufp_Mail_Relation.setSpecificRecsysUser(temp); // 设置指定收件人系统名
              mapperMRT.insertSelective(b_T_Ufp_Mail_Relation);
              // 向邮件正文表添加
              b_T_Ufp_Mail_Content.setUuid(guid);
              mapperMCT.insertSelective(b_T_Ufp_Mail_Content);
            }
            if (isuserxt.equals("")) {
              isuserxt += "," + temp + ",";
            } else {
              isuserxt += temp + ",";
            }
          }
        }
      }
    }
    returnMsg = Constants.SAVE_SUCCESSFUL_MSG;
    return returnMsg;
  }
Пример #4
0
  /**
   * 回复,转发邮件
   *
   * @param sqlSession
   * @param mapper
   * @param mapperRelation
   * @param mapperContent
   * @param record
   * @param recordRelation
   * @param recordContent
   * @param sendTime
   * @param sendUser
   * @param sendSysUser
   * @return
   * @throws IllegalAccessException
   * @throws UnsupportedEncodingException
   */
  private String replyTrunMail(
      B_T_Ufp_Mail_Attribute record,
      B_T_Ufp_Mail_Relation recordRelation,
      B_T_Ufp_Mail_Content recordContent,
      String sendTime,
      String sendUser,
      String sendSysUser,
      C_T_Sys_FileExample example,
      C_T_Sys_FileExample.Criteria criteria)
      throws IllegalAccessException, UnsupportedEncodingException {
    String returnMsg;
    String uuid = new GUID().toString();
    // 更新附件表的主文档ID
    String isFile = null;
    try {
      replyMailFile(example, criteria, uuid);
      criteria.andMainIdEqualTo(uuid);
      List<C_T_Sys_File> listFile = mapperFT.selectByExample(example);
      if (listFile != null) {
        if (listFile.size() > 0) {
          isFile = "1"; // 有附件
        } else {
          isFile = "0"; // 没有附件
        }
      } else {
        isFile = "0"; // 没有附件
      }
    } catch (Exception e) {
      e.printStackTrace();
    }

    // 收件人未收邮件
    b_T_Ufp_Mail_Relation.setUuid(uuid);
    b_T_Ufp_Mail_Relation.setMailType(Long.valueOf(mailTypeS));
    b_T_Ufp_Mail_Relation.setMailAttributeId(uuid);
    b_T_Ufp_Mail_Relation.setMailContentId(uuid);
    b_T_Ufp_Mail_Relation.setReceiverTime(sendTime);
    b_T_Ufp_Mail_Relation.setReplyFlag(1); // 正常回复
    b_T_Ufp_Mail_Relation.setIsFile(Integer.valueOf(isFile)); // 有无附件
    if (b_T_Ufp_Mail_Relation != null) {
      b_T_Ufp_Mail_Relation.setSpecificRecsysUser(b_T_Ufp_Mail_Relation.getUserId());
    }

    mapperMRT.insertSelective(b_T_Ufp_Mail_Relation);
    // 插入邮件属性表
    b_T_Ufp_Mail_Attribute.setUuid(uuid);
    b_T_Ufp_Mail_Attribute.setSendTime(sendTime); // 回复时:发件箱中的发送时间
    b_T_Ufp_Mail_Attribute.setSendUser(sendUser);
    b_T_Ufp_Mail_Attribute.setSendSysUser(sendSysUser);
    b_T_Ufp_Mail_Attribute.setIsReceipt(Integer.valueOf(booleanToString(isReceipt))); // 回执选项
    mapperMAT.insertSelective(b_T_Ufp_Mail_Attribute);
    // 插入邮件正文表
    b_T_Ufp_Mail_Content.setUuid(uuid);
    mapperMCT.insertSelective(recordContent);

    // 发件箱显示
    String newUuid = new GUID().toString();
    String isNewFile = null;
    // 更新附件表的主文档ID
    try {
      replyMailFile(example, criteria, newUuid);

      example.clear();
      criteria = example.createCriteria();
      criteria.andMainIdEqualTo(newUuid);
      List<C_T_Sys_File> listFile = mapperFT.selectByExample(example);
      if (listFile != null) {
        if (listFile.size() > 0) {
          isNewFile = "1"; // 有附件
        } else {
          isNewFile = "0"; // 没有附件
        }
      } else {
        isNewFile = "0"; // 没有附件
      }
    } catch (Exception e) {
      e.printStackTrace();
    }
    b_T_Ufp_Mail_Relation.setUuid(newUuid);
    b_T_Ufp_Mail_Relation.setMailType(Long.valueOf("1"));
    b_T_Ufp_Mail_Relation.setMailAttributeId(uuid);
    b_T_Ufp_Mail_Relation.setMailContentId(uuid);
    b_T_Ufp_Mail_Relation.setReceiverTime(sendTime);
    b_T_Ufp_Mail_Relation.setReplyFlag(2); // 自己发的回复信息
    b_T_Ufp_Mail_Relation.setIsFile(Integer.valueOf(isNewFile)); // 有无附件
    mapperMRT.insertSelective(b_T_Ufp_Mail_Relation);
    // 插入邮件属性表
    b_T_Ufp_Mail_Attribute.setUuid(newUuid);
    b_T_Ufp_Mail_Attribute.setSendTime(sendTime); // 回复时:发件箱中的发送时间
    b_T_Ufp_Mail_Attribute.setSendUser(sendUser);
    b_T_Ufp_Mail_Attribute.setSendSysUser(sendSysUser);
    b_T_Ufp_Mail_Attribute.setIsReceipt(Integer.valueOf(booleanToString(isReceipt))); // 回执选项
    b_T_Ufp_Mail_Attribute.setIsSendMsg(Integer.valueOf(booleanToString(isSendMsg))); // 是否发送短消息
    mapperMAT.insertSelective(b_T_Ufp_Mail_Attribute);
    // 插入邮件正文表
    b_T_Ufp_Mail_Content.setUuid(newUuid);
    mapperMCT.insertSelective(b_T_Ufp_Mail_Content);

    if ("0".equals(isReplyTrun)) {
      returnMsg = "回复成功!";
    } else if ("1".equals(isReplyTrun)) {
      returnMsg = "转发成功!";
    } else {
      returnMsg = Constants.SAVE_SUCCESSFUL_MSG;
    }
    return returnMsg;
  }
Пример #5
0
  /** 电子邮件详细信息页面加载 */
  public String detailsLoad() throws Exception {
    allPermission = "*";
    C_T_Sys_FileExample example = null;
    B_T_Ufp_Mail_Relation recordRelation = null;
    B_V_Ufp_MailExample exampleVMail = null;
    B_V_Ufp_MailExample.Criteria criteriaVMail = null;
    try {
      example = new C_T_Sys_FileExample();
      exampleVMail = new B_V_Ufp_MailExample();
      criteriaVMail = exampleVMail.createCriteria();

      if (StringTools.isNotNullAndHasValue(allReplyFlag) && "1".equals(allReplyFlag)) {
        // 显示全部文件名
        if (StringTools.isNotNullAndHasValue(titleS)) {
          criteriaVMail.andTitleLike("%" + titleS + "%");
        }
        criteriaVMail.andReplyFlagEqualTo(1);
        criteriaVMail.andSendTimeLessThanOrEqualTo(sendTimeS);
        exampleVMail
            .or()
            .andTitleEqualTo(titleS)
            .andReplyFlagEqualTo(1)
            .andSendTimeLessThanOrEqualTo(sendTimeS)
            .andSpecificRecsysUserIsNull();
        exampleVMail.setOrderByClause("SEND_TIME desc");
        b_V_Ufp_Mail_list = mapperMV.selectByExample(exampleVMail);
        String fileNameTemp = null;
        if (b_V_Ufp_Mail_list != null) {
          for (B_V_Ufp_Mail b_V_Ufp_Mail : b_V_Ufp_Mail_list) {
            fileNameTemp = searchFileName(example, b_V_Ufp_Mail.getUuid());
            fileNameList.add(fileNameTemp);
          }
        }
        ActionContext.getContext().getSession().put("fileNameList", fileNameList);
      }
      // 当前登录人系统名
      String loginId = SessionFactory.getSessionUserId();
      b_T_Ufp_Mail_Attribute = mapperMAT.selectByPrimaryKey(mainDocId);
      b_T_Ufp_Mail_Relation = mapperMRT.selectByPrimaryKey(mainDocId);
      b_T_Ufp_Mail_Content = mapperMCT.selectByPrimaryKey(mainDocId);
      fileName = searchFileName(example, mainDocId);
      mailSaveSendFlag = String.valueOf(b_T_Ufp_Mail_Relation.getMailType());
      isSendMsg = String.valueOf(b_T_Ufp_Mail_Attribute.getIsSendMsg());

      if (b_T_Ufp_Mail_Relation.getIsNew() != null && b_T_Ufp_Mail_Relation.getIsNew() == 0) {
        if (b_T_Ufp_Mail_Attribute.getIsReceipt() != null
            && b_T_Ufp_Mail_Attribute.getIsReceipt() == 1) {
          // 修改 by:youjh  2015-10-21
          String uuid = new GUID().toString();

          B_T_Ufp_Mail_Attribute newMailAttribute = new B_T_Ufp_Mail_Attribute();
          B_T_Ufp_Mail_Relation mailRelation = new B_T_Ufp_Mail_Relation();

          newMailAttribute.setUuid(uuid);
          newMailAttribute.setTitle("回复:收到:" + b_T_Ufp_Mail_Attribute.getTitle());
          newMailAttribute.setSendTime(DateTools.getServerDateTime(10));
          newMailAttribute.setCreateTime(DateTools.getServerDateTime(10));
          newMailAttribute.setCreateUser(loginId);
          newMailAttribute.setSendUser(SessionFactory.getSessionUserNm());
          newMailAttribute.setSendSysUser(loginId);
          newMailAttribute.setImportantLeve("3");
          newMailAttribute.setPriorityLeve("3");
          mapperMAT.insertSelective(newMailAttribute);

          mailRelation.setUuid(uuid);
          mailRelation.setMailContentId(uuid);
          mailRelation.setMailAttributeId(uuid);
          mailRelation.setMailType(new Long(4));
          mailRelation.setUserId(b_T_Ufp_Mail_Attribute.getSendSysUser());
          mailRelation.setCreateTime(DateTools.getServerDateTime(10));
          mailRelation.setReceiverTime(DateTools.getServerDateTime(10));
          mailRelation.setReplyFlag(1);
          mailRelation.setCreateUser(loginId);
          mailRelation.setSpecificRecsysUser(b_T_Ufp_Mail_Attribute.getSendSysUser());
          mailRelation.setUserName(SessionFactory.getSessionUserNm());

          mapperMRT.insertSelective(mailRelation);

          // 插入邮件正文表
          b_T_Ufp_Mail_Content.setUuid(uuid);
          b_T_Ufp_Mail_Content.setContent(
              "回复:您发送的邮件已收到:"
                  + ""
                  + b_T_Ufp_Mail_Content.getContent()
                  + ""
                  + "发送人:"
                  + SessionFactory.getSessionUserNm());
          mapperMCT.insertSelective(b_T_Ufp_Mail_Content);
          addForAllRecUser(uuid);
        }
      }

      // 阅读邮件
      recordRelation = updateIsNewMail(recordRelation, loginId);

      String copySysUser = b_T_Ufp_Mail_Attribute.getCopySysUser();
      String darkSysUser = b_T_Ufp_Mail_Attribute.getDarkSysUser();
      copyDarkUserShow(loginId, copySysUser, darkSysUser);
    } catch (Exception e) {
      throw e;
    } finally {
      // 释放资源
      example = null;
      recordRelation = null;
      exampleVMail = null;
      criteriaVMail = null;
    }
    return SUCCESS;
  }