Package com.iisigroup.cap.base.model

Examples of com.iisigroup.cap.base.model.Remind


    if (CollectionUtils.isEmpty(allPrincipal)) {
      logger.debug("principals are empty!");
      return;
    }
    for (Reminds remind : reminds) {
      Remind content = reminderService.findRemind(remind.getPid());
      try {
        NotifyObject data = new NotifyObject();
        data.setTargetId(remind.getScopePid());
        data.setStartTime(formatter.reformat(content.getStartDate()));
        data.setEndTime(formatter.reformat(content.getEndDate()));
        data.setContent(content.getContent());

        CapUserDetails userDetail = allPrincipal
            .get(data.getTargetId());
        if (userDetail != null) {
          SocketIOClient client = userDetail.getSocketClient();
View Full Code Here


  }

  public void sendEmail(List<Reminds> reminds) {
    ADDateTimeFormatter formatter = new ADDateTimeFormatter();
    for (Reminds remind : reminds) {
      Remind content = reminderService.findRemind(remind.getPid());
      // 主旨
      StringBuffer subject = new StringBuffer();
      subject.append(CapAppContext.getMessage("remind.subject1"));
      subject.append(formatter.reformat(content.getStartDate()));
      subject.append(" ");
      subject.append(CapAppContext.getMessage("remind.subject2"));
      subject.append(CapString.isEmpty(content.getContent()) ? ""
          : content.getContent().substring(
              0,
              content.getContent().length() > 40 ? 40 : content
                  .getContent().length()));
      // 內文
      StringBuffer sendContext = new StringBuffer();
      sendContext.append(CapAppContext.getMessage("remind.startDate"));
      sendContext.append(formatter.reformat(content.getStartDate()));
      sendContext.append("<br/>");
      sendContext.append(CapAppContext.getMessage("remind.endDate"));
      sendContext.append(formatter.reformat(content.getEndDate()));
      sendContext.append("<br/>");
      sendContext.append(CapAppContext.getMessage("remind.subject2"));
      sendContext.append(formatter.reformat(content.getContent()));

      String email = reminderService.getUsrEmail(remind.getScopePid());
      if (email != null) {
        emailService.sendEmail(new String[] { email },
            subject.toString(), sendContext.toString());
View Full Code Here

  }// ;

  public IResult queryForm(IRequest request) {
    AjaxFormResult result = new AjaxFormResult();
    String oid = request.get("oid");
    Remind remind = null;

    if (!CapString.isEmpty(oid)) {
      remind = commonSrv.findById(Remind.class, oid);
    }

    if (remind != null) {
      Map<String, IFormatter> fmt = new HashMap<String, IFormatter>();
      fmt.put("startDate", new ADDateFormatter());
      fmt.put("endDate", new ADDateFormatter());

      result.set("startTime", new ADDateTimeFormatter("HH:mm")
          .reformat(remind.getStartDate()));
      result.set("endTime", new ADDateTimeFormatter("HH:mm")
          .reformat(remind.getEndDate()));
      result.putAll(new AjaxFormResult(remind.toJSONObject(
          CapEntityUtil.getColumnName(remind), fmt)));
    }

    return result;
  }
View Full Code Here

   * @throws CapException
   */
  public IResult save(IRequest request) {
    AjaxFormResult result = new AjaxFormResult();
    String oid = request.get("oid");
    Remind remind = null;

    if (!CapString.isEmpty(oid)) {
      remind = commonSrv.findById(Remind.class, oid);
    }
    if (remind == null) {
      remind = new Remind();
      remind.setCrTime(CapDate.getCurrentTimestamp());
    }
    String startDate = request.get("startDate");
    String startTime = request.get("startTime");
    if (CapString.isEmpty(startTime)) {
      startTime = "00:00:00";
    } else {
      startTime = startTime + ":00";
    }
    request.put("startDate", startDate + " " + startTime);
    String endDate = request.get("endDate");
    String endTime = request.get("endTime");
    if (CapString.isEmpty(endTime)) {
      endTime = "00:00:00";
    } else {
      endTime = endTime + ":00";
    }
    request.put("endDate", endDate + " " + endTime);

    CapBeanUtil.map2Bean(request, remind, Remind.class);
    remind.setUpdater(CapSecurityContext.getUserId());
    remind.setUpdTime(CapDate.getCurrentTimestamp());
    remind.setLocale(SimpleContextHolder.get(CapWebUtil.localeKey)
        .toString());

    commonSrv.save(remind);

    result.putAll(new AjaxFormResult(remind.toJSONObject(
        CapEntityUtil.getColumnName(remind), null)));
    return result;
  }
View Full Code Here

   * @throws CapException
   */
  public IResult saveDetail(IRequest request) {
    AjaxFormResult result = new AjaxFormResult();
    String pid = request.get("pid");
    Remind remind = null;

    if (!CapString.isEmpty(pid)) {
      remind = commonSrv.findById(Remind.class, pid);
    }
    if (remind == null) {
      throw new CapMessageException(
          CapAppContext.getMessage("EXCUE_ERROR"),
          RemindHandler.class);
    }
    Reminds reminds = new Reminds();
    reminds.setPid(pid);
    reminds.setScopePid(remind.getScopePid());
    reminds.setStyle(CapMath.getBigDecimal(request.get("style")));
    reminds.setStyleTyp(request.get("styleTyp"));
    reminds.setUnit(CapMath.getBigDecimal(request.get("unit")));
    reminds.setYnFlag("0");

View Full Code Here

    if (CapString.isEmpty(oid)) {
      throw new CapMessageException(
          CapAppContext.getMessage("EXCUE_ERROR"),
          RemindHandler.class);
    }
    Remind remind = commonSrv.findById(Remind.class, oid);
    if (remind != null) {
      commonSrv.delete(remind);
    }
    return result;
  }
View Full Code Here

TOP

Related Classes of com.iisigroup.cap.base.model.Remind

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.