/** * 编辑活动跳转 * * @param inv * @param id 活动id activityId * @return * @throws Exception */ @ActOptRequired @Get("edit/{activityId:[0-9]+}") public String edit(final Invocation inv, @Param("activityId") final Integer activityId) throws Exception { ActPintuConf actPintuConf = actPintuConfService.findByActId(activityId); if (actPintuConf != null) { List<PintuAwardsVo> pintuAwardsVoList = actPintuConfService.parseJson(actPintuConf.getAwards().toString()); inv.addModel("awardslist", pintuAwardsVoList); inv.addModel("conf", actPintuConf); } return "pintu/edit"; }
/** * 修改 * * @param inv * @param actPintuConf * @param startTime * @param endTime * @return * @throws Exception */ @Post("edit_do") public String edit_do( final Invocation inv, ActPintuConf actPintuConf, @Param("createTime") final Date createTime, @Param("activityTime") final String activityTime) 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/edit/" + actPintuConf.getActivityId()); 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(createTime); actPintuConfService.update(actPintuConf); actPintuConfService.savePrize( actPintuConf.getActivityId(), actPintuConf.getAwards().toString()); inv.getResponse().sendRedirect(WebApplicationUtils.getBasePath() + "/pc/my/actList"); return null; }