/** * 修改页面提交表单 action="system/choicenesscontent/save" * * @param yc * @param m * @return * @throws IOException */ @RequestMapping("/save") public String save(YztChoicenesscontent yc, ModelMap m, HttpServletRequest request) { Json json = new Json(); int flag = 0; // 修改之前先判断是否 String introduction = yc.getIntroduction(); if (CommonUtil.notEmpty(yc.getId())) { // 不为空的时候是修改 yc.setModfiytime(new Date()); // 写入流 try { saveHtmlUrl(request, yc); } catch (IOException e) { e.printStackTrace(); } flag = choicenesscontentService.updateNotNull(yc); } else { // 为空的时候添加 try { saveHtmlUrl(request, yc); } catch (IOException e) { e.printStackTrace(); } yc.setId(GUIDGener.getGUID()); yc.setCreatetime(new Date()); yc.setPicCount(0); yc.setViewCount(1); flag = choicenesscontentService.save(yc); } return "redirect:view/" + yc.getId(); }