@Override
  public String updateActivity(Activity activity) {

    String endDate = activity.getEndDate();
    endDate = endDate.replaceAll("-", "").replaceAll(":", "").replaceAll(" ", "") + "00";
    activity.setEndDate(endDate);

    int res = activityDAO.update(activity);
    return res == 1 ? "success" : "fail";
  }
Beispiel #2
0
  /**
   * 发布活动
   *
   * @param activity
   * @return
   */
  @RequestMapping(value = "/admin/pubActivity", method = RequestMethod.POST)
  @ResponseBody
  public String pubActivity(Activity activity, HttpSession session) {
    College college = (College) session.getAttribute("user");
    activity.setCollege(college);

    return activityService.add(activity);
  }
  @Override
  public String add(Activity activity) {
    activity.setPublishTime(DateUtils.getCurrentGaDate());
    activity.setStatus(SysCode.ActivityStatus.WAIT);
    String uuid = UUID.randomUUID().toString();
    activity.setActivityUuid(uuid);

    String endDate = activity.getEndDate();
    endDate = endDate.replaceAll("-", "").replaceAll(":", "").replaceAll(" ", "") + "00";
    activity.setEndDate(endDate);

    int res = activityDAO.add(activity);
    if (res == 1) {
      return uuid;
    } else {
      return "";
    }
  }
Beispiel #4
0
  /**
   * 更新活动
   *
   * @param activity
   * @return
   */
  @RequestMapping(value = "/college/updateActivity", method = RequestMethod.POST)
  @ResponseBody
  public String updateActivity(Activity activity) {
    String res = activityService.updateActivity(activity);
    if ("success" == res) {
      return activity.getActivityUuid();
    }

    return "";
  }