Exemple #1
0
 /**
  * This method populates the <code>PtNotice</code> object along with notice input stream
  *
  * @param basicProperty the <code>BasicProperty</code> object for which the notice is generated
  * @param noticeNo - notice no
  * @param noticeType - type of notice
  * @param fileStream - input stream of generated notice.
  */
 public PtNotice saveNotice(
     String noticeNo, String noticeType, BasicProperty basicProperty, InputStream fileStream) {
   PtNotice ptNotice = new PtNotice();
   Module module = moduleDao.getModuleByName(PTMODULENAME);
   ptNotice.setModuleId(module.getId());
   ptNotice.setNoticeDate(new Date());
   ptNotice.setNoticeNo(noticeNo);
   ptNotice.setNoticeType(noticeType);
   ptNotice.setUserId(EgovThreadLocals.getUserId());
   ptNotice.setBasicProperty(basicProperty);
   String fileName = ptNotice.getNoticeNo() + ".pdf";
   FileStoreMapper fileStore =
       fileStoreService.store(fileStream, fileName, "application/pdf", PTMODULENAME);
   ptNotice.setFileStore(fileStore);
   basicProperty.addNotice(ptNotice);
   basicPropertyService.update(basicProperty);
   return ptNotice;
 }