Пример #1
0
 @RequestMapping(value = "/edit", method = RequestMethod.POST)
 @ResponseBody
 public Object editPost(
     @ModelAttribute("sysAnnouncement") SysAnnouncement sysAnnouncement,
     BindingResult result,
     MultipartFile uploadfileAdvise,
     MultipartFile uploadfileAdviseExtend)
     throws Exception {
   if (null == sysAnnouncement.getPubDest()) {
     SysAnnouncement s = sysAnnouncementDao.findOne(sysAnnouncement.getId());
     sysAnnouncement.setPubDest(s.getPubDest());
   }
   if (StringUtils.isBlank(sysAnnouncement.getDescription())
       && sysAnnouncement.getPubDest().equals("1")) {
     result.rejectValue("description", "server", "公告内容不能为空");
     return JsonRespWrapper.error(result.getFieldErrors());
   }
   if ("1".equals(sysAnnouncement.getPubDest())) {
     sysAnnouncement.setTitle(sysAnnouncement.getTitle().split(",")[0]);
   }
   if ("3".equals(sysAnnouncement.getPubDest())) {
     sysAnnouncement.setTitle(sysAnnouncement.getTitle().split(",")[1]);
   }
   sysAnnouncement.setEndTime(
       sysAnnouncement.getEndTime().replaceAll("-", "").replaceAll(" ", "").replaceAll(":", ""));
   this.sysAnnouncementService.save(sysAnnouncement, uploadfileAdvise, uploadfileAdviseExtend);
   logUtils.logAdd("编辑公告内容,", "修改成功,公告编号:", +sysAnnouncement.getId());
   return JsonRespWrapper.success("操作成功", "/websys/announcement");
 }
Пример #2
0
  @RequestMapping(value = "/audit", method = RequestMethod.GET)
  public String audit(Long id, Model model) {
    SysAnnouncement sysAnnouncement = sysAnnouncementDao.findOne(id);
    model.addAttribute("sysAnnouncement", sysAnnouncement);
    model.addAttribute("destMap", SysAnnouncement.DEST_MAP);
    model.addAttribute("statusMap", SysAnnouncement.STATUS_MAP);

    if (sysAnnouncement.getPubUser() != null) {
      model.addAttribute("pubUser", userDao.findOne(sysAnnouncement.getPubUser()));
    }

    if (sysAnnouncement.getAuditUser() != null) {
      model.addAttribute("auditUser", userDao.findOne(sysAnnouncement.getAuditUser()));
    }
    SysFileImg advise =
        sysAnnouncementService.findImg(sysAnnouncement.getId(), BsFileService.ADVISE_PIC_KEY);
    if (null != advise) {
      model.addAttribute("advisePath", advise.getFileWebPath());
    }
    SysFileImg adviseExtend =
        sysAnnouncementService.findImg(
            sysAnnouncement.getId(), BsFileService.ADVISE_EXTEND_PIC_KEY);
    if (null != adviseExtend) {
      model.addAttribute("adviseExtendPath", adviseExtend.getFileWebPath());
    }

    model.addAttribute("tp", "audit");
    return "/websys/announcement/view";
  }
Пример #3
0
 @RequestMapping(value = "/edit", method = RequestMethod.GET)
 public String edit(Long id, Model model) {
   SysAnnouncement sysAnnouncement = sysAnnouncementDao.findOne(id);
   model.addAttribute("sysAnnouncement", sysAnnouncement);
   model.addAttribute("destMap", SysAnnouncement.DEST_MAP);
   return "/websys/announcement/edit";
 }