--- /dev/null
+server:
+ port: 80
+ servlet:
+ context-path: /
+zk:
+ homepage: index
+ zul-view-resolver-enabled: true
+spring:
+ jpa:
+ show-sql: false
+ properties:
+ hibernate:
+ format_sql: true
+ main:
+ banner-mode: off
+ output:
+ ansi:
+ enabled: always
+ datasource:
+ type: com.zaxxer.hikari.HikariDataSource
+ url: jdbc:db2://localhost:50000/lis
+ username: db2admin
+ password: Salabakt3r
+camunda.bpm:
+ generic-properties.properties:
+ telemetry-reporter-activate: false
+ job-executor-acquire-by-priority: true
+ job-execution:
+ core-pool-size: 10
+ #lock-time-in-millis: 600000
+ database:
+ type: db2
+ schema-update: false
+ table-prefix: CAMUNDA.
+ schema-name: CAMUNDA
+ webapp:
+ enabled: true
+ index-redirect-enabled: false
+ admin-user:
+ id: kermit
+ password: password
+ firstName: Kermit
+ filter:
+ create: All tasks
+ job-execution.enabled: true
+logging:
+ config: logback-prod.xml
+ level:
+ org.hibernate.engine.jdbc.spi.SqlExceptionHelper: ERROR
+ org.springframework.web.clientRestTemplate: ERROR
+ logging.level.org.apache.http: ERROR
+ logging.level.httpclient.wire: ERROR
+application:
+ ui:
+ user-name:
+ password:
+ export-temp-path: /tmp
+ disable-profile-save: false
+ workflow:
+ import-invoice:
+ input-path: /temp/invoice-import
+ project-id-pattern: \d{4}-\d{4}
+ old-project-id-pattern: \d{8}
+service:
+ nav:
+ trust:
+ store: classpath:keystore/lis-keystore.jks
+ store.password: password
+ api:
+ url: https://api.onlineszamla.nav.gov.hu/invoiceService/v3
+ user: dufwfvhquolizk4
+ password: Pbd6Mnkt9g
+ sign-key: 05-967b-0e5227e11ca44GF1ZEUBSX8F
+ exchange-key: a5c24GF1ZEUBUGIK
+ sender-tax-number: 13799504
+ sender-company: USER RENDSZERHÁZ Informatikai Korlátolt Felelősségű Társaság
+ sender-country: HU
+ sender-contact: Kovács Géza
+ days-range: 34
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration>
+
+ <property name="LOGS" value="./logs"/>
+
+ <appender name="Console"
+ class="ch.qos.logback.core.ConsoleAppender">
+ <layout class="ch.qos.logback.classic.PatternLayout">
+ <Pattern>
+ %black(%d{ISO8601}) %highlight(%-5level) [%blue(%t)] %yellow(%C{1.}): %msg%n%throwable
+ </Pattern>
+ </layout>
+ </appender>
+
+ <appender name="RollingFile"
+ class="ch.qos.logback.core.rolling.RollingFileAppender">
+ <file>${LOGS}/sly-crm.log</file>
+ <encoder
+ class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
+ <Pattern>%d %p %C{1.} [%t] %m%n</Pattern>
+ </encoder>
+
+ <rollingPolicy
+ class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+ <!-- rollover daily and when the file reaches 10 MegaBytes -->
+ <fileNamePattern>${LOGS}/archived/sly-crm-app-%d{yyyy-MM-dd}.%i.log
+ </fileNamePattern>
+ <timeBasedFileNamingAndTriggeringPolicy
+ class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
+ <maxFileSize>10MB</maxFileSize>
+ </timeBasedFileNamingAndTriggeringPolicy>
+ </rollingPolicy>
+ </appender>
+
+ <root level="info">
+ <appender-ref ref="RollingFile"/>
+ <appender-ref ref="Console"/>
+ </root>
+
+ <logger name="hu.user.lis" level="trace" additivity="false">
+ <appender-ref ref="RollingFile"/>
+ <appender-ref ref="Console"/>
+ </logger>
+
+</configuration>
\ No newline at end of file
#!/bin/bash
-java -DSLY-CRM-APPLICATION -jar /opt/slycrm/sly-crm-app.jar
+java -DSLY-CRM-APPLICATION -Dspring.profiles.active=prod -jar /opt/slycrm/sly-crm-app.jar
type: com.zaxxer.hikari.HikariDataSource
url: jdbc:db2://dvdev.in.useribm.hu:50000/lis
username: db2admin
- password: password
+ password: Salabakt3r
camunda.bpm:
generic-properties.properties:
telemetry-reporter-activate: false
store: classpath:keystore/lis-keystore.jks
store.password: password
api:
- url: https://api-test.onlineszamla.nav.gov.hu/invoiceService/v3
- user: vkvyibj5xgqpbp0
- password: Salabakt3r
- sign-key: fe-9d8b-971c878376204BQEWTHH2HI6
- exchange-key: 3af24BQEWTHH4TSX
- sender-tax-number: 13364937
+ url: https://api.onlineszamla.nav.gov.hu/invoiceService/v3
+ user: dufwfvhquolizk4
+ password: Pbd6Mnkt9g
+ sign-key: 05-967b-0e5227e11ca44GF1ZEUBSX8F
+ exchange-key: a5c24GF1ZEUBUGIK
+ sender-tax-number: 13799504
+ sender-company: USER RENDSZERHÁZ Informatikai Korlátolt Felel?sség? Társaság
+ sender-country: HU
+ sender-contact: Kovács Géza
+ days-range: 34
\ No newline at end of file
package hu.user.lis;
-import hu.user.lis.db.*;
-import hu.user.lis.db.repository.*;
+import hu.user.lis.db.Currency;
+import hu.user.lis.db.IncomingInvoice;
+import hu.user.lis.db.Invoice;
+import hu.user.lis.db.InvoiceImport;
+import hu.user.lis.db.Project;
+import hu.user.lis.db.ServiceRecord;
+import hu.user.lis.db.Treasury;
+import hu.user.lis.db.repository.InvoiceImportRepository;
+import hu.user.lis.db.repository.InvoiceRepository;
+import hu.user.lis.db.repository.ProjectRepository;
+import hu.user.lis.db.repository.ServiceRecordRepository;
+import hu.user.lis.db.repository.TreasuryRepository;
import hu.user.lis.service.data.ProjectService;
import hu.user.lis.service.data.TreasuryService;
import lombok.extern.log4j.Log4j2;
import javax.persistence.EntityNotFoundException;
import java.util.Arrays;
import java.util.List;
+import java.util.Optional;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
@Autowired
private InvoiceRepository invoiceRepository;
+
@Test
public void testRepositoryCapabilities() {
List<ServiceRecord> allItems = serviceRecordRepository.findAll();
invoiceImportRepository.delete(invoiceImport);
}
+
+ @Test
+ public void testImportInvoiceInvoiceCreateDate() {
+ Optional<InvoiceImport> importDate = invoiceImportRepository.findTopByOrderByInvoiceCreateDateDesc();
+ log.info(importDate);
+ }
}
import hu.gov.nav.schemas.ntca._1_0.common.BasicResultType;
import hu.gov.nav.schemas.ntca._1_0.common.FunctionCodeType;
-import hu.gov.nav.schemas.osa._3_0.api.*;
+import hu.gov.nav.schemas.osa._3_0.api.InvoiceDigestResultType;
+import hu.gov.nav.schemas.osa._3_0.api.InvoiceDigestType;
+import hu.gov.nav.schemas.osa._3_0.api.InvoiceDirectionType;
+import hu.gov.nav.schemas.osa._3_0.api.QueryInvoiceDigestRequest;
+import hu.gov.nav.schemas.osa._3_0.api.QueryInvoiceDigestResponse;
import hu.gov.nav.schemas.osa._3_0.data.InvoiceData;
import hu.user.lis.db.IncomingInvoice;
import hu.user.lis.service.nav.TaxOfficeInvoiceService;
@Log4j2
@SpringBootTest
@RunWith(SpringRunner.class)
-@ActiveProfiles("test")
+@ActiveProfiles("dev")
@ComponentScan("hu.user.lis")
//@TestPropertySource("classpath:application-test.yaml")
public class TaxOfficeInvoiceApiIT {
int availablePages = 1;
int currentPage = 1;
while (currentPage <= availablePages) {
- Optional<QueryInvoiceDigestResponse> response = taxOfficeInvoiceService.queryInboundInvoices(currentPage, 5, 34);
+ Optional<QueryInvoiceDigestResponse> response = taxOfficeInvoiceService.queryInboundInvoices(currentPage, 0, 5);
if (!response.isPresent()) {
break;
}
driver=com.ibm.db2.jcc.DB2Driver
url=jdbc:db2://dvdev.in.useribm.hu:50000/lis
username=db2admin
-password=password
+password=Salabakt3r
#
# A NOTE ON STORED PROCEDURES AND DELIMITERS
#
package hu.user.lis.service.nav;
+import org.apache.http.conn.ssl.NoopHostnameVerifier;
import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.ssl.SSLContextBuilder;
+import org.apache.http.ssl.TrustStrategy;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
public RestTemplate restTemplate() throws KeyManagementException, NoSuchAlgorithmException, KeyStoreException,
CertificateException, IOException {
+
SSLContext sslContext = new SSLContextBuilder()
.loadTrustMaterial(trustStore.getURL(), trustStorePassword.toCharArray()).build();
-
-// TrustStrategy acceptingTrustStrategy = (X509Certificate[] chain, String authType) -> true;
-// SSLContext sslContext = org.apache.http.ssl.SSLContexts.custom()
-// .loadTrustMaterial(null, acceptingTrustStrategy)
-// .build();
-
-// SSLConnectionSocketFactory sslConFactory = new SSLConnectionSocketFactory(sslContext,
-// new String[]{"TLSv1.2", "TLSv1.1"}, null,
-// (hostname, session) -> true);
SSLConnectionSocketFactory sslConFactory = new SSLConnectionSocketFactory(sslContext);
CloseableHttpClient httpClient = HttpClients.custom().setSSLSocketFactory(sslConFactory).build();
return new RestTemplate(requestFactory);
}
+
+ @Bean
+ public RestTemplate restTemplate2() throws KeyManagementException, NoSuchAlgorithmException, KeyStoreException,
+ CertificateException, IOException {
+ TrustStrategy acceptingTrustStrategy = (x509Certificates, s) -> true;
+ SSLContext sslContext = org.apache.http.ssl.SSLContexts.custom().loadTrustMaterial(null, acceptingTrustStrategy).build();
+ SSLConnectionSocketFactory csf = new SSLConnectionSocketFactory(sslContext, new NoopHostnameVerifier());
+ CloseableHttpClient httpClient = HttpClients.custom().setSSLSocketFactory(csf).build();
+ HttpComponentsClientHttpRequestFactory requestFactory = new HttpComponentsClientHttpRequestFactory();
+ requestFactory.setHttpClient(httpClient);
+ return new RestTemplate(requestFactory);
+ }
}
\ No newline at end of file
public static final String REMOVE_DESKTOP_REGEX = "/zkau\\?dtid=.*&cmd_0=rmDesktop&.*";
- public static final String[] ZK_RESOURCES = {"/zkau/web/**/js/**", "/zkau/web/**/zul/css/**", "/zkau/web/**/zul/less/**", "/zkau/web/**/img/**", "/zkau/web/**/static/**"};
+ public static final String[] ZK_RESOURCES = {"/zkau/web/**/js/**", "/zkau/web/**/zul/css/**", "/zkau/web/**/zul/less/**", "/zkau/web/**/img/**", "/zkau/web/**/static/**", "/engine-rest/**"};
@Autowired
LocalAuthProvider localAuthProvider;
}
public void cancelInvoiceImportProcess(boolean onlyImport) {
- List<ProcessInstance> processInstances = runtimeService.createProcessInstanceQuery().list();
+ List<ProcessInstance> processInstances;
+ if (onlyImport) {
+ processInstances = runtimeService.createProcessInstanceQuery().processDefinitionKey(IMPORT_INCOMING_INVOICES).active().list();
+ } else {
+ processInstances = runtimeService.createProcessInstanceQuery().active().list();
+ }
+ log.info("Found process instance count {}", (long) processInstances.size());
processInstances.forEach(p -> {
log.info("Found process instance {} {} {}", p.getProcessInstanceId(), p.getProcessDefinitionId(), p.isSuspended());
- if (onlyImport) {
- if (IMPORT_INCOMING_INVOICES.equals(p.getProcessDefinitionId())) {
- killProcess(p);
- }
- } else {
- killProcess(p);
- }
+ killProcess(p);
});
}