@RequestMapping(value = "/setHistoryEvent", method = RequestMethod.POST) public @ResponseBody Long setHistoryEvent( @RequestParam(value = "nID_Subject", required = false) long nID_Subject, @RequestParam(value = "nID_HistoryEventType", required = false) Long nID_HistoryEventType, @RequestParam(value = "sEventName", required = false) String sEventName_Custom, @RequestParam(value = "sMessage") String sMessage, HttpServletRequest request, HttpServletResponse httpResponse) throws IOException { return historyEventDao.setHistoryEvent( nID_Subject, nID_HistoryEventType, sEventName_Custom, sMessage); }
private void createHistoryEvent( HistoryEventType eventType, Long nID_Subject, String sSubjectName_Upload, Long nID_Document, Document document) { Map<String, String> values = new HashMap<>(); try { Document oDocument = document == null ? documentDao.getDocument(nID_Document) : document; values.put(HistoryEventMessage.DOCUMENT_TYPE, oDocument.getDocumentType().getName()); values.put(HistoryEventMessage.DOCUMENT_NAME, oDocument.getName()); values.put(HistoryEventMessage.ORGANIZATION_NAME, sSubjectName_Upload); } catch (Throwable e) { log.warn("can't get document info!", e); } try { String eventMessage = HistoryEventMessage.createJournalMessage(eventType, values); historyEventDao.setHistoryEvent(nID_Subject, eventType.getnID(), eventMessage, eventMessage); } catch (IOException e) { log.error("error during creating HistoryEvent", e); } }
@RequestMapping(value = "/getHistoryEvents", method = RequestMethod.GET) public @ResponseBody List<HistoryEvent> getHistoryEvents( @RequestParam(value = "nID_Subject") long nID_Subject) { return historyEventDao.getHistoryEvents(nID_Subject); }
@RequestMapping(value = "/getHistoryEvent", method = RequestMethod.GET) public @ResponseBody HistoryEvent getHistoryEvent(@RequestParam(value = "nID") Long id) { return historyEventDao.getHistoryEvent(id); }