Esempio n. 1
0
 /**
  * 添加
  *
  * @param inv
  * @param actPintuConf
  * @param startTime
  * @param endTime
  * @param userPluginId
  * @return
  * @throws Exception
  */
 @Post("add_do")
 public String add_do(
     final Invocation inv,
     ActPintuConf actPintuConf,
     @Param("activityTime") final String activityTime,
     @Param("userPluginId") final Integer userPluginId)
     throws Exception {
   if (activityTime == null
       || activityTime.length() == 0
       || actPintuConf.getAwards() == null
       || actPintuConf.getAwards().toString().length() == 0) {
     inv.addModel("tip", "非法操作,请重试");
     inv.addModel(
         "backUrl", ReadProperties.getPara("httpPath") + "/pluginadmin/pintu/add/" + userPluginId);
     return "../pc/tip.jsp";
   }
   if (activityTime.length() != 0) {
     String[] time = activityTime.split(" - ");
     actPintuConf.setStartTime(DateUtils.converDate(time[0]));
     actPintuConf.setEndTime(DateUtils.converDate(time[1]));
   }
   actPintuConf.setCreateTime(new Date());
   actPintuConfService.save(actPintuConf, userPluginId);
   actPintuConfService.savePrize(
       actPintuConf.getActivityId(), actPintuConf.getAwards().toString());
   inv.getResponse().sendRedirect(WebApplicationUtils.getBasePath() + "/pc/my/actList");
   return null;
 }