public ReportData getReportData() { Collection<KDPWListWrapper> data = service .findAll(criteria) .stream() .map( (messageLog) -> { KDPWListWrapper wrapper = new KDPWListWrapper(); wrapper.setFileId(messageLog.getFileId() == null ? "" : messageLog.getFileId()); wrapper.setFileTime( messageLog.getMessageTime() == null ? new Date() : messageLog.getMessageTime()); wrapper.setMessageName( messageLog.getMessageName() == null ? "" : messageLog.getMessageName()); wrapper.setStatus( messageLog.getFileStatus() == null ? "" : BUNDLE.getString(messageLog.getFileStatus().getMsgKey())); wrapper.setUserLogin( messageLog.getUserLogin() == null ? "" : messageLog.getUserLogin()); return wrapper; }) .collect(Collectors.toList()); ParametersWrapper parameters = new ParametersWrapper( "c.dateandtimefile", "c.generateRead", "c.message", "c.status", "c.identificatorFile"); reportData.setParameters(parameters.getParameters()); reportData.setReportData(data); return reportData; }
public ReportData getReportKDPWResponseData(final MessageLog msgLog) { final Collection<KDPWResponseWrapper> data = new ArrayList<>(); ParametersWrapper parameters = new ParametersWrapper( "c.statusMessageFile", "c.dateTimeLoading", "c.login", "c.idMessage", "c.idTransaction", "c.idClient", "c.statusMesasge", "c.codeError", "c.descError"); KDPWResponseWrapper wrapper = new KDPWResponseWrapper(); wrapper.setStatusMessageFile(BeanHelper.getMessage(msgLog.getFileStatus().getMsgKey())); wrapper.setDatatimeLoading(msgLog.getMessageTime()); wrapper.setLogin(msgLog.getUserLogin()); // Dla raportu dotyczącego plików otrzymanych z KDPW: if (CollectionsUtils.isNotEmpty(msgLog.getContentItems())) { for (KdpwMsgItem item : msgLog.getContentItems()) { // parameters = new // ParametersWrapper("c.statusMessageFile","c.dateTimeLoading","c.login","c.idMessage","c.idTransaction","c.idClient"); reportKDPWType = ReportType.KDPW_REQUEST_REPORT; wrapper.setIdMessage(item.getSndrMsgRef()); // Id komunikatu wrapper.setIdTransaction(item.getTransactionId()); // Identyfikator transakcji wrapper.setIdClients(item.getClientId()); // Identyfikator kontrahenta if (MessageDirection.INPUT.equals(msgLog.getDirection())) { reportKDPWType = ReportType.KDPW_RESPONSE_REPORT; wrapper.setStatusMessage( BeanHelper.getMessage(item.getStatus().getMsgKey())); // Status komunikatu wrapper.setErrorCode(item.getResponseDetails().getStatusCode()); // Kod błędu wrapper.setDescriptionError(item.getResponseDetails().getStatusDesc()); // Opis błędu } data.add(wrapper); wrapper = new KDPWResponseWrapper(); } } else { data.add(wrapper); } reportKDPWResponseData.setParameters(parameters.getParameters()); reportKDPWResponseData.setReportData(data); return reportKDPWResponseData; }