Compare commits
No commits in common. "main" and "feature/issue-1/ws-read-store-detail" have entirely different histories.
main
...
feature/is
|
|
@ -1,20 +0,0 @@
|
||||||
meta {
|
|
||||||
name: A01 Ticket DLQ (DEV)
|
|
||||||
type: http
|
|
||||||
seq: 1
|
|
||||||
}
|
|
||||||
|
|
||||||
get {
|
|
||||||
url: http://v-artm-a01-iddc.adic.lan:8260/rec/mom1/console/jolokia/read/org.apache.activemq.artemis:broker=!%22mom-rec-001!%22,component=addresses,address=!%22XSTO_ASPD_VTEJ_retail_sale_3211.DLQ!%22,subcomponent=queues,routing-type=!%22anycast!%22,queue=!%22XSTO_ASPD_VTEJ_retail_sale_3211.DLQ!%22/MessageCount
|
|
||||||
body: none
|
|
||||||
auth: basic
|
|
||||||
}
|
|
||||||
|
|
||||||
headers {
|
|
||||||
Origin: http://v-artm-a01-iddc.adic.lan:8260
|
|
||||||
}
|
|
||||||
|
|
||||||
auth:basic {
|
|
||||||
username: artemis
|
|
||||||
password: artemis
|
|
||||||
}
|
|
||||||
|
|
@ -1,20 +0,0 @@
|
||||||
meta {
|
|
||||||
name: A01 Ticket DLQ (PROD)
|
|
||||||
type: http
|
|
||||||
seq: 2
|
|
||||||
}
|
|
||||||
|
|
||||||
get {
|
|
||||||
url: http://v-artm-a01-ipdc.tech.ikks.lan:8160/console/jolokia/exec/org.apache.activemq.artemis:broker=!%22mom01-v-artm-a01-ipdc!%22,component=addresses,address=!%22XSTO_ASPD_VTEJ_retail_sale_3211.DLQ!%22,subcomponent=queues,routing-type=!%22anycast!%22,queue=!%22XSTO_ASPD_VTEJ_retail_sale_3211.DLQ!%22/countMessages()
|
|
||||||
body: none
|
|
||||||
auth: basic
|
|
||||||
}
|
|
||||||
|
|
||||||
headers {
|
|
||||||
Origin: http://v-artm-a01-ipdc.tech.ikks.lan:8160
|
|
||||||
}
|
|
||||||
|
|
||||||
auth:basic {
|
|
||||||
username: readonly
|
|
||||||
password: readonly
|
|
||||||
}
|
|
||||||
|
|
@ -1,20 +0,0 @@
|
||||||
meta {
|
|
||||||
name: A02 Ticket DLQ (PROD)
|
|
||||||
type: http
|
|
||||||
seq: 3
|
|
||||||
}
|
|
||||||
|
|
||||||
get {
|
|
||||||
url: http://v-artm-a02-ipdc.tech.ikks.lan:8160/console/jolokia/exec/org.apache.activemq.artemis:broker=!%22mom02-v-artm-a02-ipdc!%22,component=addresses,address=!%22XSTO_ASPD_VTEJ_retail_sale_3211.DLQ!%22,subcomponent=queues,routing-type=!%22anycast!%22,queue=!%22XSTO_ASPD_VTEJ_retail_sale_3211.DLQ!%22/countMessages()
|
|
||||||
body: none
|
|
||||||
auth: basic
|
|
||||||
}
|
|
||||||
|
|
||||||
headers {
|
|
||||||
Origin: http://v-artm-a02-ipdc.tech.ikks.lan:8160
|
|
||||||
}
|
|
||||||
|
|
||||||
auth:basic {
|
|
||||||
username: readonly
|
|
||||||
password: readonly
|
|
||||||
}
|
|
||||||
|
|
@ -1,22 +0,0 @@
|
||||||
meta {
|
|
||||||
name: login
|
|
||||||
type: http
|
|
||||||
seq: 1
|
|
||||||
}
|
|
||||||
|
|
||||||
post {
|
|
||||||
url: {{host}}/hdpos/api/auth/login
|
|
||||||
body: json
|
|
||||||
auth: none
|
|
||||||
}
|
|
||||||
|
|
||||||
headers {
|
|
||||||
Content-Type: application/json
|
|
||||||
}
|
|
||||||
|
|
||||||
body:json {
|
|
||||||
{
|
|
||||||
"username": "fred",
|
|
||||||
"password": "admin123"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
{
|
|
||||||
"version": "1",
|
|
||||||
"name": "hdpos",
|
|
||||||
"type": "collection"
|
|
||||||
}
|
|
||||||
|
|
@ -1,16 +0,0 @@
|
||||||
meta {
|
|
||||||
name: PromptActions
|
|
||||||
type: http
|
|
||||||
seq: 5
|
|
||||||
}
|
|
||||||
|
|
||||||
get {
|
|
||||||
url: {{host}}/hdpos/api/chatrct/actions?itemId=XY10000-08-3A&produitId=3700824
|
|
||||||
body: none
|
|
||||||
auth: none
|
|
||||||
}
|
|
||||||
|
|
||||||
query {
|
|
||||||
itemId: XY10000-08-3A
|
|
||||||
produitId: 3700824
|
|
||||||
}
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
||||||
meta {
|
|
||||||
name: PromptDistributor
|
|
||||||
type: http
|
|
||||||
seq: 3
|
|
||||||
}
|
|
||||||
|
|
||||||
get {
|
|
||||||
url: {{host}}/hdpos/api/chatrct/distributor/1?itemId=XY10000-08-3A
|
|
||||||
body: none
|
|
||||||
auth: none
|
|
||||||
}
|
|
||||||
|
|
||||||
query {
|
|
||||||
itemId: XY10000-08-3A
|
|
||||||
}
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
||||||
meta {
|
|
||||||
name: PromptRCT
|
|
||||||
type: http
|
|
||||||
seq: 2
|
|
||||||
}
|
|
||||||
|
|
||||||
get {
|
|
||||||
url: {{host}}/hdpos/api/chatrct/rct?itemId=XY10000-08-3A
|
|
||||||
body: none
|
|
||||||
auth: none
|
|
||||||
}
|
|
||||||
|
|
||||||
query {
|
|
||||||
itemId: XY10000-08-3A
|
|
||||||
}
|
|
||||||
|
|
@ -1,18 +0,0 @@
|
||||||
meta {
|
|
||||||
name: PromptStore
|
|
||||||
type: http
|
|
||||||
seq: 4
|
|
||||||
}
|
|
||||||
|
|
||||||
get {
|
|
||||||
url: {{host}}/hdpos/api/chatrct/store/4?storeId=4&distributorId=1&itemId=XY10000-08-3A&produitId=3700824
|
|
||||||
body: none
|
|
||||||
auth: none
|
|
||||||
}
|
|
||||||
|
|
||||||
query {
|
|
||||||
storeId: 4
|
|
||||||
distributorId: 1
|
|
||||||
itemId: XY10000-08-3A
|
|
||||||
produitId: 3700824
|
|
||||||
}
|
|
||||||
|
|
@ -1,24 +0,0 @@
|
||||||
meta {
|
|
||||||
name: RctForceCache
|
|
||||||
type: http
|
|
||||||
seq: 6
|
|
||||||
}
|
|
||||||
|
|
||||||
put {
|
|
||||||
url: {{host}}/hdpos/api/chatrct/rct/forceCache
|
|
||||||
body: json
|
|
||||||
auth: none
|
|
||||||
}
|
|
||||||
|
|
||||||
body:json {
|
|
||||||
{
|
|
||||||
"itemId": "XY10000",
|
|
||||||
"comment": "Test FRED"
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
body:form-urlencoded {
|
|
||||||
itemId: 9999999
|
|
||||||
comment: test
|
|
||||||
}
|
|
||||||
|
|
@ -1,27 +0,0 @@
|
||||||
meta {
|
|
||||||
name: RctForceException
|
|
||||||
type: http
|
|
||||||
seq: 7
|
|
||||||
}
|
|
||||||
|
|
||||||
put {
|
|
||||||
url: {{host}}/hdpos/api/chatrct/rct/forceException
|
|
||||||
body: json
|
|
||||||
auth: none
|
|
||||||
}
|
|
||||||
|
|
||||||
body:json {
|
|
||||||
{
|
|
||||||
"id_produit":3700821,
|
|
||||||
"id_distrib":1,
|
|
||||||
"fdate":"20241220",
|
|
||||||
"forcer_cache":1,
|
|
||||||
"modul_trait":"HDPOS"
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
body:form-urlencoded {
|
|
||||||
itemId: 9999999
|
|
||||||
comment: test
|
|
||||||
}
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
meta {
|
|
||||||
name: Hello
|
|
||||||
type: http
|
|
||||||
seq: 1
|
|
||||||
}
|
|
||||||
|
|
||||||
get {
|
|
||||||
url: {{host}}/hdpos/api/chatrct/hello
|
|
||||||
body: none
|
|
||||||
auth: none
|
|
||||||
}
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
vars {
|
|
||||||
host: http://v-xsto-a01-iidc.adic.lan:8080
|
|
||||||
proximisHost: https://ikks.omn.proximis.com
|
|
||||||
}
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
vars {
|
|
||||||
host: http://localhost:8080
|
|
||||||
proximisHost: https://proximis-ikks-recette.stg.proximis.com
|
|
||||||
}
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
meta {
|
|
||||||
name: not sent
|
|
||||||
type: http
|
|
||||||
seq: 1
|
|
||||||
}
|
|
||||||
|
|
||||||
get {
|
|
||||||
url: {{host}}/hdpos/api/flux/bl/notsent
|
|
||||||
body: none
|
|
||||||
auth: none
|
|
||||||
}
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
meta {
|
|
||||||
name: hello 8080
|
|
||||||
type: http
|
|
||||||
seq: 1
|
|
||||||
}
|
|
||||||
|
|
||||||
get {
|
|
||||||
url: {{host}}/hdpos/api/hello
|
|
||||||
body: none
|
|
||||||
auth: none
|
|
||||||
}
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
||||||
meta {
|
|
||||||
name: items
|
|
||||||
type: http
|
|
||||||
seq: 1
|
|
||||||
}
|
|
||||||
|
|
||||||
get {
|
|
||||||
url: {{host}}/hdpos/api/items/BX44145?dbHost=10.100.0.18
|
|
||||||
body: none
|
|
||||||
auth: none
|
|
||||||
}
|
|
||||||
|
|
||||||
query {
|
|
||||||
dbHost: 10.100.0.18
|
|
||||||
}
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
||||||
meta {
|
|
||||||
name: itemsOptions
|
|
||||||
type: http
|
|
||||||
seq: 3
|
|
||||||
}
|
|
||||||
|
|
||||||
get {
|
|
||||||
url: {{host}}/hdpos/api/items/BX44145/options/?dbHost=10.100.0.18
|
|
||||||
body: none
|
|
||||||
auth: none
|
|
||||||
}
|
|
||||||
|
|
||||||
query {
|
|
||||||
dbHost: 10.100.0.18
|
|
||||||
}
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
||||||
meta {
|
|
||||||
name: itemsPrice
|
|
||||||
type: http
|
|
||||||
seq: 4
|
|
||||||
}
|
|
||||||
|
|
||||||
get {
|
|
||||||
url: {{host}}/hdpos/api/items/BX44145/price/?dbHost=10.100.0.18
|
|
||||||
body: none
|
|
||||||
auth: none
|
|
||||||
}
|
|
||||||
|
|
||||||
query {
|
|
||||||
dbHost: 10.100.0.18
|
|
||||||
}
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
||||||
meta {
|
|
||||||
name: itemsStock
|
|
||||||
type: http
|
|
||||||
seq: 5
|
|
||||||
}
|
|
||||||
|
|
||||||
get {
|
|
||||||
url: {{host}}/hdpos/api/items/BX44145/stock/?dbHost=10.100.0.18
|
|
||||||
body: none
|
|
||||||
auth: none
|
|
||||||
}
|
|
||||||
|
|
||||||
query {
|
|
||||||
dbHost: 10.100.0.18
|
|
||||||
}
|
|
||||||
|
|
@ -1,18 +0,0 @@
|
||||||
meta {
|
|
||||||
name: GetAllOrders
|
|
||||||
type: http
|
|
||||||
seq: 2
|
|
||||||
}
|
|
||||||
|
|
||||||
get {
|
|
||||||
url: {{host}}/hdpos/api/obi/order?page=1&itemsPerPage=10&sortBy=order_id&orderBy=desc
|
|
||||||
body: none
|
|
||||||
auth: none
|
|
||||||
}
|
|
||||||
|
|
||||||
query {
|
|
||||||
page: 1
|
|
||||||
itemsPerPage: 10
|
|
||||||
sortBy: order_id
|
|
||||||
orderBy: desc
|
|
||||||
}
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
meta {
|
|
||||||
name: GetByOrderId
|
|
||||||
type: http
|
|
||||||
seq: 1
|
|
||||||
}
|
|
||||||
|
|
||||||
get {
|
|
||||||
url: {{host}}/hdpos/api/obi/order/2845
|
|
||||||
body: none
|
|
||||||
auth: none
|
|
||||||
}
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
meta {
|
|
||||||
name: getOrderMessage
|
|
||||||
type: http
|
|
||||||
seq: 3
|
|
||||||
}
|
|
||||||
|
|
||||||
get {
|
|
||||||
url: {{host}}/hdpos/api/obi/order/2845/orderMessage
|
|
||||||
body: none
|
|
||||||
auth: none
|
|
||||||
}
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
meta {
|
|
||||||
name: projectFulfillment
|
|
||||||
type: http
|
|
||||||
seq: 1
|
|
||||||
}
|
|
||||||
|
|
||||||
get {
|
|
||||||
url: {{host}}/hdpos/api/proximis/project/fulfillment/1382020000066
|
|
||||||
body: none
|
|
||||||
auth: none
|
|
||||||
}
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
meta {
|
|
||||||
name: All
|
|
||||||
type: http
|
|
||||||
seq: 2
|
|
||||||
}
|
|
||||||
|
|
||||||
get {
|
|
||||||
url: {{host}}/hdpos/api/stores/
|
|
||||||
body: none
|
|
||||||
auth: none
|
|
||||||
}
|
|
||||||
|
|
@ -1,16 +0,0 @@
|
||||||
meta {
|
|
||||||
name: Log
|
|
||||||
type: http
|
|
||||||
seq: 9
|
|
||||||
}
|
|
||||||
|
|
||||||
get {
|
|
||||||
url: {{host}}/hdpos/api/stores/4/log?dbHost=10.100.0.18&logDate=20231228
|
|
||||||
body: none
|
|
||||||
auth: none
|
|
||||||
}
|
|
||||||
|
|
||||||
query {
|
|
||||||
dbHost: 10.100.0.18
|
|
||||||
logDate: 20231228
|
|
||||||
}
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
||||||
meta {
|
|
||||||
name: Sequence
|
|
||||||
type: http
|
|
||||||
seq: 1
|
|
||||||
}
|
|
||||||
|
|
||||||
get {
|
|
||||||
url: {{host}}/hdpos/api/stores/4/sequence?dbHost=10.100.0.18
|
|
||||||
body: none
|
|
||||||
auth: none
|
|
||||||
}
|
|
||||||
|
|
||||||
query {
|
|
||||||
dbHost: 10.100.0.18
|
|
||||||
}
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
||||||
meta {
|
|
||||||
name: Signature
|
|
||||||
type: http
|
|
||||||
seq: 7
|
|
||||||
}
|
|
||||||
|
|
||||||
get {
|
|
||||||
url: {{host}}/hdpos/api/stores/4/signature?dbHost=10.100.0.18
|
|
||||||
body: none
|
|
||||||
auth: none
|
|
||||||
}
|
|
||||||
|
|
||||||
query {
|
|
||||||
dbHost: 10.100.0.18
|
|
||||||
}
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
meta {
|
|
||||||
name: StoreById
|
|
||||||
type: http
|
|
||||||
seq: 3
|
|
||||||
}
|
|
||||||
|
|
||||||
get {
|
|
||||||
url: {{host}}/hdpos/api/stores/4
|
|
||||||
body: none
|
|
||||||
auth: none
|
|
||||||
}
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
||||||
meta {
|
|
||||||
name: StoreDetails
|
|
||||||
type: http
|
|
||||||
seq: 4
|
|
||||||
}
|
|
||||||
|
|
||||||
get {
|
|
||||||
url: {{host}}/hdpos/api/stores/4/details?dbHost=10.100.0.18
|
|
||||||
body: none
|
|
||||||
auth: none
|
|
||||||
}
|
|
||||||
|
|
||||||
query {
|
|
||||||
dbHost: 10.100.0.18
|
|
||||||
}
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
||||||
meta {
|
|
||||||
name: Version
|
|
||||||
type: http
|
|
||||||
seq: 6
|
|
||||||
}
|
|
||||||
|
|
||||||
get {
|
|
||||||
url: {{host}}/hdpos/api/stores/4/version?dbHost=10.100.0.18
|
|
||||||
body: none
|
|
||||||
auth: none
|
|
||||||
}
|
|
||||||
|
|
||||||
query {
|
|
||||||
dbHost: 10.100.0.18
|
|
||||||
}
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
meta {
|
|
||||||
name: reload
|
|
||||||
type: http
|
|
||||||
seq: 8
|
|
||||||
}
|
|
||||||
|
|
||||||
get {
|
|
||||||
url: {{host}}/hdpos/api/stores/reload
|
|
||||||
body: none
|
|
||||||
auth: none
|
|
||||||
}
|
|
||||||
|
|
@ -1,16 +0,0 @@
|
||||||
meta {
|
|
||||||
name: Log
|
|
||||||
type: http
|
|
||||||
seq: 1
|
|
||||||
}
|
|
||||||
|
|
||||||
get {
|
|
||||||
url: {{host}}/hdpos/api/xadmin/log?beginDate=20240101&endDate=20240101
|
|
||||||
body: none
|
|
||||||
auth: none
|
|
||||||
}
|
|
||||||
|
|
||||||
query {
|
|
||||||
beginDate: 20240101
|
|
||||||
endDate: 20240101
|
|
||||||
}
|
|
||||||
16
pom.xml
16
pom.xml
|
|
@ -19,14 +19,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.oracle.database.jdbc</groupId>
|
<groupId>com.oracle.database.jdbc</groupId>
|
||||||
<artifactId>ojdbc8</artifactId>
|
<artifactId>ojdbc8</artifactId>
|
||||||
<version>18.3.0.0</version>
|
<version>18.3.0.0</version> <!-- Assurez-vous d'utiliser la version compatible avec votre Oracle Database -->
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- JDBC Driver for postgresql Database https://github.com/pgjdbc/pgjdbc -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.postgresql</groupId>
|
|
||||||
<artifactId>postgresql</artifactId>
|
|
||||||
<version>42.3.1</version>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Jersey for JAX-RS (Java API for RESTful Web Services) -->
|
<!-- Jersey for JAX-RS (Java API for RESTful Web Services) -->
|
||||||
|
|
@ -64,18 +57,13 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.fasterxml.jackson.jaxrs</groupId>
|
<groupId>com.fasterxml.jackson.jaxrs</groupId>
|
||||||
<artifactId>jackson-jaxrs-json-provider</artifactId>
|
<artifactId>jackson-jaxrs-json-provider</artifactId>
|
||||||
<version>2.13.0</version>
|
<version>2.13.0</version> <!-- Use the latest version here -->
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.glassfish.jersey.media</groupId>
|
<groupId>org.glassfish.jersey.media</groupId>
|
||||||
<artifactId>jersey-media-json-jackson</artifactId>
|
<artifactId>jersey-media-json-jackson</artifactId>
|
||||||
<version>2.13</version>
|
<version>2.13</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>org.json</groupId>
|
|
||||||
<artifactId>json</artifactId>
|
|
||||||
<version>20231013</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- LOG dependencies -->
|
<!-- LOG dependencies -->
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|
|
||||||
|
|
@ -1,474 +0,0 @@
|
||||||
package com.example.services;
|
|
||||||
|
|
||||||
import java.sql.CallableStatement;
|
|
||||||
import java.sql.Clob;
|
|
||||||
import java.sql.DriverManager;
|
|
||||||
import java.sql.PreparedStatement;
|
|
||||||
import java.sql.ResultSet;
|
|
||||||
import java.sql.SQLException;
|
|
||||||
import java.sql.Types;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Optional;
|
|
||||||
import java.util.regex.Matcher;
|
|
||||||
import java.util.regex.Pattern;
|
|
||||||
|
|
||||||
import javax.ws.rs.BadRequestException;
|
|
||||||
import javax.ws.rs.Consumes;
|
|
||||||
import javax.ws.rs.GET;
|
|
||||||
import javax.ws.rs.PUT;
|
|
||||||
import javax.ws.rs.Path;
|
|
||||||
import javax.ws.rs.PathParam;
|
|
||||||
import javax.ws.rs.Produces;
|
|
||||||
import javax.ws.rs.QueryParam;
|
|
||||||
import javax.ws.rs.core.MediaType;
|
|
||||||
import javax.ws.rs.core.Response;
|
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
||||||
|
|
||||||
@Path("/chatrct")
|
|
||||||
public class ChatRctService {
|
|
||||||
private static final Logger logger = LoggerFactory.getLogger(ChatRctService.class);
|
|
||||||
|
|
||||||
@GET
|
|
||||||
@Path("/hello")
|
|
||||||
@Produces(MediaType.APPLICATION_JSON)
|
|
||||||
public String getHello() {
|
|
||||||
return "# Bonjour'\\nIndiquez-moi la RCT sur laquelle vous souhaitez faire des recherches ...";
|
|
||||||
}
|
|
||||||
|
|
||||||
@GET
|
|
||||||
@Path("/rct")
|
|
||||||
@Produces(MediaType.APPLICATION_JSON)
|
|
||||||
public Response getRctById(@QueryParam("itemId") String itemId) {
|
|
||||||
|
|
||||||
if (itemId == null) {
|
|
||||||
return Response.status(Response.Status.BAD_REQUEST).entity("{\"error\":\"itemId parameter is required\"}").build();
|
|
||||||
}
|
|
||||||
|
|
||||||
DriverManager.setLoginTimeout(5); // Set timeout to 5 seconds
|
|
||||||
|
|
||||||
try (DatabaseConnectDOTSOFT databaseConnection = new DatabaseConnectDOTSOFT("omni")) {
|
|
||||||
String call = "{ call fbe_hdpos.chatrct_prompt_rct(?, ?) }";
|
|
||||||
|
|
||||||
logger.info(call);
|
|
||||||
|
|
||||||
try (CallableStatement callableStatement = databaseConnection.getConnection().prepareCall(call)) {
|
|
||||||
// Set input parameters
|
|
||||||
callableStatement.setString(1, itemId);
|
|
||||||
|
|
||||||
// Set output parameters
|
|
||||||
callableStatement.registerOutParameter(2, Types.CLOB);
|
|
||||||
|
|
||||||
// Execute the stored procedure
|
|
||||||
callableStatement.execute();
|
|
||||||
|
|
||||||
// Retrieve results
|
|
||||||
Clob resultClob = callableStatement.getClob(2);
|
|
||||||
String result = resultClob.getSubString(1, (int) resultClob.length());
|
|
||||||
|
|
||||||
// Convert Unicode representations to emojis
|
|
||||||
String resultWithEmojis = convertUnicodeStrsToEmojis(result);
|
|
||||||
|
|
||||||
ObjectMapper objectMapper = new ObjectMapper();
|
|
||||||
String jsonResponse = objectMapper.writeValueAsString(resultWithEmojis);
|
|
||||||
|
|
||||||
return Response.ok(jsonResponse).build();
|
|
||||||
}
|
|
||||||
} catch (SQLException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
String errorResponse = "{\"error\":\"" + e.getMessage() + "\"}";
|
|
||||||
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(errorResponse).build();
|
|
||||||
} catch (JsonProcessingException e) {
|
|
||||||
e.printStackTrace(); // Gérer les exceptions correctement dans un environnement de production
|
|
||||||
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity("{\"error\":\"Error processing JSON\"}").build();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@GET
|
|
||||||
@Path("/distributor/{distributorId}")
|
|
||||||
@Produces(MediaType.APPLICATION_JSON)
|
|
||||||
public Response getDistributorById(
|
|
||||||
@PathParam("distributorId") Integer distributorId,
|
|
||||||
@QueryParam("itemId") String itemId,
|
|
||||||
@QueryParam("produitId") Integer produitId) {
|
|
||||||
|
|
||||||
if (distributorId == null) {
|
|
||||||
return Response.status(Response.Status.BAD_REQUEST).entity("{\"error\":\"distributorId parameter is required\"}").build();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (itemId == null) {
|
|
||||||
return Response.status(Response.Status.BAD_REQUEST).entity("{\"error\":\"itemId parameter is required\"}").build();
|
|
||||||
}
|
|
||||||
|
|
||||||
DriverManager.setLoginTimeout(5); // Set timeout to 5 seconds
|
|
||||||
|
|
||||||
try (DatabaseConnectDOTSOFT databaseConnection = new DatabaseConnectDOTSOFT("omni")) {
|
|
||||||
String call = "{ call fbe_hdpos.chatrct_prompt_distributor(?,?,?,?) }";
|
|
||||||
|
|
||||||
logger.info(call);
|
|
||||||
|
|
||||||
try (CallableStatement callableStatement = databaseConnection.getConnection().prepareCall(call)) {
|
|
||||||
// Set input parameters
|
|
||||||
callableStatement.setInt(1, distributorId);
|
|
||||||
callableStatement.setString(2, itemId);
|
|
||||||
callableStatement.setInt(3, produitId);
|
|
||||||
|
|
||||||
// Set output parameters
|
|
||||||
callableStatement.registerOutParameter(4, Types.CLOB);
|
|
||||||
|
|
||||||
// Execute the stored procedure
|
|
||||||
callableStatement.execute();
|
|
||||||
|
|
||||||
// Retrieve results
|
|
||||||
Clob resultClob = callableStatement.getClob(4);
|
|
||||||
String result = resultClob.getSubString(1, (int) resultClob.length());
|
|
||||||
|
|
||||||
// Convert Unicode representations to emojis
|
|
||||||
String resultWithEmojis = convertUnicodeStrsToEmojis(result);
|
|
||||||
|
|
||||||
ObjectMapper objectMapper = new ObjectMapper();
|
|
||||||
String jsonResponse = objectMapper.writeValueAsString(resultWithEmojis);
|
|
||||||
|
|
||||||
return Response.ok(jsonResponse).build();
|
|
||||||
}
|
|
||||||
} catch (SQLException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
String errorResponse = "{\"error\":\"" + e.getMessage() + "\"}";
|
|
||||||
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(errorResponse).build();
|
|
||||||
} catch (JsonProcessingException e) {
|
|
||||||
e.printStackTrace(); // Gérer les exceptions correctement dans un environnement de production
|
|
||||||
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity("{\"error\":\"Error processing JSON\"}").build();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@GET
|
|
||||||
@Path("/store/{storeId}")
|
|
||||||
@Produces(MediaType.APPLICATION_JSON)
|
|
||||||
public Response getStoreById(
|
|
||||||
@PathParam("storeId") Integer storeId,
|
|
||||||
@QueryParam("distributorId") Integer distributorId,
|
|
||||||
@QueryParam("itemId") String itemId,
|
|
||||||
@QueryParam("produitId") Integer produitId) {
|
|
||||||
|
|
||||||
if (storeId == null) {
|
|
||||||
return Response.status(Response.Status.BAD_REQUEST).entity("{\"error\":\"storeId parameter is required\"}").build();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (distributorId == null) {
|
|
||||||
return Response.status(Response.Status.BAD_REQUEST).entity("{\"error\":\"distributorId parameter is required\"}").build();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (itemId == null) {
|
|
||||||
return Response.status(Response.Status.BAD_REQUEST).entity("{\"error\":\"itemId parameter is required\"}").build();
|
|
||||||
}
|
|
||||||
|
|
||||||
String ip = "";
|
|
||||||
String enseigne = "";
|
|
||||||
int vendable = -1; // error by default
|
|
||||||
int gerable = -1; // error by default
|
|
||||||
|
|
||||||
DriverManager.setLoginTimeout(5); // Set timeout to 5 seconds
|
|
||||||
|
|
||||||
try (DatabaseConnectDOTSOFT databaseConnection = new DatabaseConnectDOTSOFT("com02")) {
|
|
||||||
String ipQuery = "SELECT hsc.ip FROM com02.HOTLINE_STRUCTURE_CAISSE hsc WHERE hsc.ID_STRUCTURE = ? AND hsc.ID_CAISSE = 20";
|
|
||||||
logger.info(ipQuery);
|
|
||||||
|
|
||||||
PreparedStatement ipStatement = databaseConnection.getConnection().prepareStatement(ipQuery);
|
|
||||||
ipStatement.setInt(1, storeId);
|
|
||||||
ResultSet ipResultSet = ipStatement.executeQuery();
|
|
||||||
|
|
||||||
if (ipResultSet.next()) {
|
|
||||||
ip = ipResultSet.getString("ip");
|
|
||||||
}
|
|
||||||
|
|
||||||
String enseigneQuery = "SELECT xs.enseigne FROM omni.xst_structure xs WHERE xs.ID_STRUCTURE = ?";
|
|
||||||
logger.info(enseigneQuery);
|
|
||||||
|
|
||||||
PreparedStatement enseigneStatement = databaseConnection.getConnection().prepareStatement(enseigneQuery);
|
|
||||||
enseigneStatement.setInt(1, storeId);
|
|
||||||
ResultSet enseigneResultSet = enseigneStatement.executeQuery();
|
|
||||||
|
|
||||||
if (enseigneResultSet.next()) {
|
|
||||||
enseigne = enseigneResultSet.getString("enseigne");
|
|
||||||
}
|
|
||||||
|
|
||||||
} catch (SQLException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
logger.info("Try to connect on IP :" + ip);
|
|
||||||
|
|
||||||
// if Ip address is not null and enseigne is not null
|
|
||||||
if (ip.length() > 0 && enseigne.length() > 0) {
|
|
||||||
try (DatabaseConnectXSTORE databaseConnection = new DatabaseConnectXSTORE(ip,"dtv")) {
|
|
||||||
String itemQuery = "SELECT COUNT(*) as gerable " +
|
|
||||||
"FROM dtv.ITM_ITEM " +
|
|
||||||
"WHERE ORGANIZATION_ID = 1 AND ITEM_ID = ?";
|
|
||||||
|
|
||||||
logger.info(itemQuery);
|
|
||||||
|
|
||||||
try (PreparedStatement itemStatement = databaseConnection.getConnection().prepareStatement(itemQuery)) {
|
|
||||||
itemStatement.setString(1, itemId);
|
|
||||||
|
|
||||||
ResultSet itemResultSet = itemStatement.executeQuery();
|
|
||||||
|
|
||||||
if (itemResultSet.next()) {
|
|
||||||
if (itemResultSet.getInt("gerable") > 0)
|
|
||||||
gerable = 1;
|
|
||||||
else
|
|
||||||
gerable = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
String optionsQuery = "SELECT COUNT(*) as vendable " +
|
|
||||||
"FROM dtv.ITM_ITEM_OPTIONS " +
|
|
||||||
"WHERE ORGANIZATION_ID = 1 AND ITEM_ID = ? AND LEVEL_CODE = 'ENSEIGNE' AND LEVEL_VALUE = ? AND ITEM_AVAILABILITY_CODE = 'AVAILABLE'";
|
|
||||||
|
|
||||||
logger.info(optionsQuery);
|
|
||||||
|
|
||||||
try (PreparedStatement optionsStatement = databaseConnection.getConnection().prepareStatement(optionsQuery)) {
|
|
||||||
optionsStatement.setString(1, itemId);
|
|
||||||
optionsStatement.setString(2, enseigne);
|
|
||||||
|
|
||||||
ResultSet optionsResultSet = optionsStatement.executeQuery();
|
|
||||||
|
|
||||||
if (optionsResultSet.next()) {
|
|
||||||
if (optionsResultSet.getInt("vendable") > 0)
|
|
||||||
vendable = 1;
|
|
||||||
else
|
|
||||||
vendable = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (SQLException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (vendable == -1) {
|
|
||||||
logger.info("Unable to determine vendable status for store " + storeId);
|
|
||||||
}
|
|
||||||
|
|
||||||
try (DatabaseConnectDOTSOFT databaseConnection = new DatabaseConnectDOTSOFT("omni")) {
|
|
||||||
String call = "{ call fbe_hdpos.chatrct_prompt_store(?,?,?,?,?,?,?,?) }";
|
|
||||||
|
|
||||||
logger.info(call);
|
|
||||||
|
|
||||||
try (CallableStatement callableStatement = databaseConnection.getConnection().prepareCall(call)) {
|
|
||||||
// Set input parameters
|
|
||||||
callableStatement.setInt(1, storeId);
|
|
||||||
callableStatement.setInt(2, distributorId);
|
|
||||||
callableStatement.setString(3, itemId);
|
|
||||||
callableStatement.setInt(4, produitId);
|
|
||||||
callableStatement.setString(5, enseigne);
|
|
||||||
callableStatement.setInt(6, gerable);
|
|
||||||
callableStatement.setInt(7, vendable);
|
|
||||||
|
|
||||||
// Set output parameters
|
|
||||||
callableStatement.registerOutParameter(8, Types.CLOB);
|
|
||||||
|
|
||||||
// Execute the stored procedure
|
|
||||||
callableStatement.execute();
|
|
||||||
|
|
||||||
// Retrieve results
|
|
||||||
Clob resultClob = callableStatement.getClob(8);
|
|
||||||
String result = resultClob.getSubString(1, (int) resultClob.length());
|
|
||||||
|
|
||||||
// Convert Unicode representations to emojis
|
|
||||||
String resultWithEmojis = convertUnicodeStrsToEmojis(result);
|
|
||||||
|
|
||||||
ObjectMapper objectMapper = new ObjectMapper();
|
|
||||||
String jsonResponse = objectMapper.writeValueAsString(resultWithEmojis);
|
|
||||||
|
|
||||||
return Response.ok(jsonResponse).build();
|
|
||||||
}
|
|
||||||
} catch (SQLException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
String errorResponse = "{\"error\":\"" + e.getMessage() + "\"}";
|
|
||||||
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(errorResponse).build();
|
|
||||||
} catch (JsonProcessingException e) {
|
|
||||||
e.printStackTrace(); // Gérer les exceptions correctement dans un environnement de production
|
|
||||||
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity("{\"error\":\"Error processing JSON\"}").build();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@PUT
|
|
||||||
@Path("/rct/forceCache")
|
|
||||||
@Consumes(MediaType.APPLICATION_JSON)
|
|
||||||
public Response putRctForceCache(Map<String, String> request) {
|
|
||||||
String itemId = request.get("itemId");
|
|
||||||
String comment = request.get("comment");
|
|
||||||
|
|
||||||
if (itemId == null) {
|
|
||||||
return Response.status(Response.Status.BAD_REQUEST).entity("{\"error\":\"itemId parameter is required\"}").build();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (comment == null) {
|
|
||||||
return Response.status(Response.Status.BAD_REQUEST).entity("{\"error\":\"comment parameter is required\"}").build();
|
|
||||||
}
|
|
||||||
|
|
||||||
try (DatabaseConnectDOTSOFT databaseConnection = new DatabaseConnectDOTSOFT("omni")) {
|
|
||||||
String enableOutput = "begin dbms_output.enable; end;";
|
|
||||||
try (CallableStatement callableStatement = databaseConnection.getConnection().prepareCall(enableOutput)) {
|
|
||||||
callableStatement.execute();
|
|
||||||
}
|
|
||||||
|
|
||||||
String call = "{ call p_xsto_itm_force_cache(?,?) }";
|
|
||||||
|
|
||||||
logger.info(call);
|
|
||||||
|
|
||||||
try (CallableStatement callableStatement = databaseConnection.getConnection().prepareCall(call)) {
|
|
||||||
// Set input parameters
|
|
||||||
callableStatement.setString(1, itemId);
|
|
||||||
callableStatement.setString(2, comment);
|
|
||||||
|
|
||||||
// Execute the stored procedure
|
|
||||||
callableStatement.execute();
|
|
||||||
|
|
||||||
Map<String, String> result = new HashMap<>();
|
|
||||||
|
|
||||||
// Retrieve DBMS_OUTPUT
|
|
||||||
String getOutput = "begin dbms_output.get_line(?, ?); end;";
|
|
||||||
try (CallableStatement outputCallableStatement = databaseConnection.getConnection().prepareCall(getOutput)) {
|
|
||||||
outputCallableStatement.registerOutParameter(1, Types.VARCHAR);
|
|
||||||
outputCallableStatement.registerOutParameter(2, Types.INTEGER);
|
|
||||||
|
|
||||||
StringBuilder output = new StringBuilder();
|
|
||||||
int status = 0;
|
|
||||||
do {
|
|
||||||
outputCallableStatement.execute();
|
|
||||||
status = outputCallableStatement.getInt(2);
|
|
||||||
if (status == 0) {
|
|
||||||
output.append(outputCallableStatement.getString(1));
|
|
||||||
}
|
|
||||||
} while (status == 0);
|
|
||||||
|
|
||||||
// Add DBMS_OUTPUT to your result
|
|
||||||
result.put("output", output.toString());
|
|
||||||
}
|
|
||||||
|
|
||||||
ObjectMapper objectMapper = new ObjectMapper();
|
|
||||||
String jsonResponse = objectMapper.writeValueAsString(result);
|
|
||||||
|
|
||||||
return Response.ok(jsonResponse).build();
|
|
||||||
}
|
|
||||||
} catch (SQLException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
String errorResponse = "{\"error\":\"" + e.getMessage() + "\"}";
|
|
||||||
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(errorResponse).build();
|
|
||||||
} catch (JsonProcessingException e) {
|
|
||||||
e.printStackTrace(); // Gérer les exceptions correctement dans un environnement de production
|
|
||||||
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity("{\"error\":\"Error processing JSON\"}").build();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@PUT
|
|
||||||
@Path("/rct/forceException")
|
|
||||||
@Consumes(MediaType.APPLICATION_JSON)
|
|
||||||
public Response putRctForceException(Map<String, String> request) {
|
|
||||||
String id_produit_str = request.get("id_produit");
|
|
||||||
String id_distrib_str = request.get("id_distrib");
|
|
||||||
String fdate = request.get("fdate");
|
|
||||||
String forcer_cache_str = request.get("forcer_cache");
|
|
||||||
String modul_trait = request.get("modul_trait");
|
|
||||||
|
|
||||||
Long id_produit = Optional.ofNullable(id_produit_str)
|
|
||||||
.map(Long::parseLong)
|
|
||||||
.orElseThrow(() -> new BadRequestException("id_produit parameter is required"));
|
|
||||||
|
|
||||||
Integer id_distrib = Optional.ofNullable(id_distrib_str)
|
|
||||||
.map(Integer::parseInt)
|
|
||||||
.orElseThrow(() -> new BadRequestException("id_distrib parameter is required"));
|
|
||||||
|
|
||||||
Integer forcer_cache = Optional.ofNullable(forcer_cache_str)
|
|
||||||
.map(Integer::parseInt)
|
|
||||||
.orElseThrow(() -> new BadRequestException("forcer_cache parameter is required"));
|
|
||||||
|
|
||||||
if (fdate == null) {
|
|
||||||
return Response.status(Response.Status.BAD_REQUEST).entity("{\"error\":\"fdate parameter is required\"}").build();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (modul_trait == null) {
|
|
||||||
return Response.status(Response.Status.BAD_REQUEST).entity("{\"error\":\"modul_trait parameter is required\"}").build();
|
|
||||||
}
|
|
||||||
|
|
||||||
try (DatabaseConnectDOTSOFT databaseConnection = new DatabaseConnectDOTSOFT("omni")) {
|
|
||||||
String enableOutput = "begin dbms_output.enable; end;";
|
|
||||||
try (CallableStatement callableStatement = databaseConnection.getConnection().prepareCall(enableOutput)) {
|
|
||||||
callableStatement.execute();
|
|
||||||
}
|
|
||||||
|
|
||||||
String call = "{ call p_xsto_itm_force_exception(?,?,?,?,?) }";
|
|
||||||
|
|
||||||
logger.info(call);
|
|
||||||
|
|
||||||
try (CallableStatement callableStatement = databaseConnection.getConnection().prepareCall(call)) {
|
|
||||||
// Set input parameters
|
|
||||||
callableStatement.setLong(1, id_produit);
|
|
||||||
callableStatement.setInt(2, id_distrib);
|
|
||||||
callableStatement.setString(3, fdate);
|
|
||||||
callableStatement.setInt(4, forcer_cache);
|
|
||||||
callableStatement.setString(5, modul_trait);
|
|
||||||
|
|
||||||
// Execute the stored procedure
|
|
||||||
callableStatement.execute();
|
|
||||||
|
|
||||||
Map<String, String> result = new HashMap<>();
|
|
||||||
|
|
||||||
// Retrieve DBMS_OUTPUT
|
|
||||||
String getOutput = "begin dbms_output.get_line(?, ?); end;";
|
|
||||||
try (CallableStatement outputCallableStatement = databaseConnection.getConnection().prepareCall(getOutput)) {
|
|
||||||
outputCallableStatement.registerOutParameter(1, Types.VARCHAR);
|
|
||||||
outputCallableStatement.registerOutParameter(2, Types.INTEGER);
|
|
||||||
StringBuilder output = new StringBuilder();
|
|
||||||
int status = 0;
|
|
||||||
do {
|
|
||||||
outputCallableStatement.execute();
|
|
||||||
status = outputCallableStatement.getInt(2);
|
|
||||||
if (status == 0) {
|
|
||||||
output.append(outputCallableStatement.getString(1));
|
|
||||||
}
|
|
||||||
} while (status == 0);
|
|
||||||
|
|
||||||
// Add DBMS_OUTPUT to your result
|
|
||||||
result.put("output", output.toString());
|
|
||||||
}
|
|
||||||
|
|
||||||
ObjectMapper objectMapper = new ObjectMapper();
|
|
||||||
String jsonResponse = objectMapper.writeValueAsString(result);
|
|
||||||
|
|
||||||
return Response.ok(jsonResponse).build();
|
|
||||||
}
|
|
||||||
} catch (SQLException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
String errorResponse = "{\"error\":\"" + e.getMessage() + "\"}";
|
|
||||||
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(errorResponse).build();
|
|
||||||
} catch (JsonProcessingException e) {
|
|
||||||
e.printStackTrace(); // Gérer les exceptions correctement dans un environnement de production
|
|
||||||
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity("{\"error\":\"Error processing JSON\"}").build();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String convertUnicodeStrsToEmojis(String str) {
|
|
||||||
Pattern pattern = Pattern.compile("U\\+[0-9A-Fa-f]+");
|
|
||||||
Matcher matcher = pattern.matcher(str);
|
|
||||||
StringBuffer sb = new StringBuffer();
|
|
||||||
while (matcher.find()) {
|
|
||||||
String unicodeStr = matcher.group();
|
|
||||||
String emoji = convertUnicodeStrToEmoji(unicodeStr);
|
|
||||||
matcher.appendReplacement(sb, emoji);
|
|
||||||
}
|
|
||||||
matcher.appendTail(sb);
|
|
||||||
return sb.toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String convertUnicodeStrToEmoji(String unicodeStr) {
|
|
||||||
String[] parts = unicodeStr.split("\\+");
|
|
||||||
int unicodeInt = Integer.parseInt(parts[1], 16);
|
|
||||||
return new String(Character.toChars(unicodeInt));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -21,8 +21,8 @@ public class DatabaseConnectDOTSOFT implements AutoCloseable {
|
||||||
try {
|
try {
|
||||||
Properties dbProperties = loadDatabaseProperties();
|
Properties dbProperties = loadDatabaseProperties();
|
||||||
|
|
||||||
String url = dbProperties.getProperty(environment + ".dotsoft.db.url");
|
String url = dbProperties.getProperty(environment + ".db.url");
|
||||||
String userpassword = dbProperties.getProperty(environment + ".dotsoft.db." + username + ".password");
|
String userpassword = dbProperties.getProperty(environment + ".db." + username + ".password");
|
||||||
|
|
||||||
connection = DriverManager.getConnection(url, username, userpassword);
|
connection = DriverManager.getConnection(url, username, userpassword);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,78 +0,0 @@
|
||||||
package com.example.services;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStream;
|
|
||||||
import java.sql.Connection;
|
|
||||||
import java.sql.DriverManager;
|
|
||||||
import java.sql.SQLException;
|
|
||||||
import java.util.Properties;
|
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
|
|
||||||
public class DatabaseConnectOBI implements AutoCloseable {
|
|
||||||
private static final Logger logger = LoggerFactory.getLogger(DatabaseConnectOBI.class);
|
|
||||||
|
|
||||||
private Connection connection;
|
|
||||||
|
|
||||||
public DatabaseConnectOBI() throws SQLException {
|
|
||||||
String environment = loadEnvironment();
|
|
||||||
|
|
||||||
try {
|
|
||||||
Properties dbProperties = loadDatabaseProperties();
|
|
||||||
|
|
||||||
String url = dbProperties.getProperty(environment + ".obi.db.url");
|
|
||||||
String username = dbProperties.getProperty(environment + ".obi.db.username");
|
|
||||||
String userpassword = dbProperties.getProperty(environment + ".obi.db.password");
|
|
||||||
|
|
||||||
injectClass();
|
|
||||||
connection = DriverManager.getConnection(url, username, userpassword);
|
|
||||||
|
|
||||||
logger.info("OBI Connection OK for user " + username + " on environment " + environment);
|
|
||||||
} catch (SQLException e) {
|
|
||||||
logger.error("Failed to connect to OBI database on environment " + environment, e);
|
|
||||||
throw e; // re-throw the exception
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public Connection getConnection() {
|
|
||||||
return connection;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void close() throws SQLException {
|
|
||||||
if (connection != null && !connection.isClosed()) {
|
|
||||||
connection.close();
|
|
||||||
logger.info("OBI Connection closed");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private String loadEnvironment() {
|
|
||||||
Properties envProperties = loadProperties("env.properties");
|
|
||||||
return envProperties.getProperty("environment");
|
|
||||||
}
|
|
||||||
|
|
||||||
private Properties loadDatabaseProperties() {
|
|
||||||
Properties dbProperties = loadProperties("db.properties");
|
|
||||||
return dbProperties;
|
|
||||||
}
|
|
||||||
|
|
||||||
private Properties loadProperties(String fileName) {
|
|
||||||
Properties properties = new Properties();
|
|
||||||
try (InputStream input = getClass().getClassLoader().getResourceAsStream(fileName)) {
|
|
||||||
properties.load(input);
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
// Handle the exception correctly for your application
|
|
||||||
}
|
|
||||||
return properties;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void injectClass() {
|
|
||||||
try {
|
|
||||||
Class.forName("org.postgresql.Driver");
|
|
||||||
} catch (ClassNotFoundException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -16,19 +16,17 @@ public class DatabaseConnectXADMIN implements AutoCloseable {
|
||||||
private Connection connection;
|
private Connection connection;
|
||||||
|
|
||||||
public DatabaseConnectXADMIN(String username) throws SQLException {
|
public DatabaseConnectXADMIN(String username) throws SQLException {
|
||||||
String environment = loadEnvironment();
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Properties dbProperties = loadDatabaseProperties();
|
Properties dbProperties = loadDatabaseProperties();
|
||||||
|
|
||||||
String url = dbProperties.getProperty(environment + ".xadmin.db.url");
|
String url = dbProperties.getProperty("xadmin.db.url");
|
||||||
String userpassword = dbProperties.getProperty(environment + ".xadmin.db." + username + ".password");
|
String userpassword = dbProperties.getProperty("xadmin.db." + username + ".password");
|
||||||
|
|
||||||
connection = DriverManager.getConnection(url, username, userpassword);
|
connection = DriverManager.getConnection(url, username, userpassword);
|
||||||
|
|
||||||
logger.info("XADMIN Connection OK for user " + username + " on environment " + environment);
|
logger.info("XADMIN Connection OK for user " + username);
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
logger.error("Failed to connect to XADMIN database for user " + username + " on environment " + environment, e);
|
logger.error("Failed to connect to XADMIN database for user " + username, e);
|
||||||
throw e; // re-throw the exception
|
throw e; // re-throw the exception
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -45,11 +43,6 @@ public class DatabaseConnectXADMIN implements AutoCloseable {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private String loadEnvironment() {
|
|
||||||
Properties envProperties = loadProperties("env.properties");
|
|
||||||
return envProperties.getProperty("environment");
|
|
||||||
}
|
|
||||||
|
|
||||||
private Properties loadDatabaseProperties() {
|
private Properties loadDatabaseProperties() {
|
||||||
Properties dbProperties = loadProperties("db.properties");
|
Properties dbProperties = loadProperties("db.properties");
|
||||||
return dbProperties;
|
return dbProperties;
|
||||||
|
|
|
||||||
|
|
@ -53,8 +53,6 @@ public class ItemService {
|
||||||
try (DatabaseConnectXSTORE databaseConnection = new DatabaseConnectXSTORE(dbHost, "dtv")) {
|
try (DatabaseConnectXSTORE databaseConnection = new DatabaseConnectXSTORE(dbHost, "dtv")) {
|
||||||
String query = "SELECT * FROM dtv.ITM_ITEM WHERE ORGANIZATION_ID = 1 AND ITEM_ID LIKE ?";
|
String query = "SELECT * FROM dtv.ITM_ITEM WHERE ORGANIZATION_ID = 1 AND ITEM_ID LIKE ?";
|
||||||
|
|
||||||
logger.info(query);
|
|
||||||
|
|
||||||
try (PreparedStatement statement = databaseConnection.getConnection().prepareStatement(query)) {
|
try (PreparedStatement statement = databaseConnection.getConnection().prepareStatement(query)) {
|
||||||
// Concatenate % to parameter itemId
|
// Concatenate % to parameter itemId
|
||||||
statement.setString(1, itemId + "%");
|
statement.setString(1, itemId + "%");
|
||||||
|
|
@ -107,8 +105,6 @@ public class ItemService {
|
||||||
"FROM dtv.ITM_ITEM_OPTIONS " +
|
"FROM dtv.ITM_ITEM_OPTIONS " +
|
||||||
"WHERE ORGANIZATION_ID = 1 AND ITEM_ID LIKE ?";
|
"WHERE ORGANIZATION_ID = 1 AND ITEM_ID LIKE ?";
|
||||||
|
|
||||||
logger.info(query);
|
|
||||||
|
|
||||||
try (PreparedStatement statement = databaseConnection.getConnection().prepareStatement(query)) {
|
try (PreparedStatement statement = databaseConnection.getConnection().prepareStatement(query)) {
|
||||||
// Concatenate % to parameter itemId
|
// Concatenate % to parameter itemId
|
||||||
statement.setString(1, itemId + "%");
|
statement.setString(1, itemId + "%");
|
||||||
|
|
@ -161,8 +157,6 @@ public class ItemService {
|
||||||
"FROM dtv.itm_item_prices " +
|
"FROM dtv.itm_item_prices " +
|
||||||
"WHERE organization_id = 1 AND item_id LIKE ?";
|
"WHERE organization_id = 1 AND item_id LIKE ?";
|
||||||
|
|
||||||
logger.info(query);
|
|
||||||
|
|
||||||
try (PreparedStatement statement = databaseConnection.getConnection().prepareStatement(query)) {
|
try (PreparedStatement statement = databaseConnection.getConnection().prepareStatement(query)) {
|
||||||
// Concatenate % to parameter itemId
|
// Concatenate % to parameter itemId
|
||||||
statement.setString(1, itemId + "%");
|
statement.setString(1, itemId + "%");
|
||||||
|
|
@ -215,8 +209,6 @@ public class ItemService {
|
||||||
"FROM dtv.inv_stock_ledger_acct " +
|
"FROM dtv.inv_stock_ledger_acct " +
|
||||||
"WHERE organization_id = 1 AND item_id LIKE ?";
|
"WHERE organization_id = 1 AND item_id LIKE ?";
|
||||||
|
|
||||||
logger.info(query);
|
|
||||||
|
|
||||||
try (PreparedStatement statement = databaseConnection.getConnection().prepareStatement(query)) {
|
try (PreparedStatement statement = databaseConnection.getConnection().prepareStatement(query)) {
|
||||||
// Concatenate % to parameter itemId
|
// Concatenate % to parameter itemId
|
||||||
statement.setString(1, itemId + "%");
|
statement.setString(1, itemId + "%");
|
||||||
|
|
|
||||||
|
|
@ -1,693 +0,0 @@
|
||||||
package com.example.services;
|
|
||||||
|
|
||||||
import com.example.services.order.Order;
|
|
||||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
|
||||||
import com.fasterxml.jackson.databind.JsonNode;
|
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
||||||
import com.fasterxml.jackson.databind.node.ArrayNode;
|
|
||||||
import com.fasterxml.jackson.databind.node.ObjectNode;
|
|
||||||
|
|
||||||
import java.sql.DriverManager;
|
|
||||||
import java.sql.PreparedStatement;
|
|
||||||
import java.sql.ResultSet;
|
|
||||||
import java.sql.SQLException;
|
|
||||||
import java.text.ParseException;
|
|
||||||
import java.text.SimpleDateFormat;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import javax.ws.rs.GET;
|
|
||||||
import javax.ws.rs.Path;
|
|
||||||
import javax.ws.rs.PathParam;
|
|
||||||
import javax.ws.rs.Produces;
|
|
||||||
import javax.ws.rs.QueryParam;
|
|
||||||
import javax.ws.rs.core.MediaType;
|
|
||||||
import javax.ws.rs.core.Response;
|
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
|
|
||||||
import org.json.JSONObject;
|
|
||||||
import org.json.XML;
|
|
||||||
|
|
||||||
@Path("/obi")
|
|
||||||
public class OrderService {
|
|
||||||
private static final Logger logger = LoggerFactory.getLogger(OrderService.class);
|
|
||||||
|
|
||||||
@GET
|
|
||||||
@Path("/order")
|
|
||||||
@Produces(MediaType.APPLICATION_JSON)
|
|
||||||
public Response getAllOrders(@QueryParam("q") String q,
|
|
||||||
@QueryParam("page") int page,
|
|
||||||
@QueryParam("itemsPerPage") int itemsPerPage,
|
|
||||||
@QueryParam("sortBy") String sortBy,
|
|
||||||
@QueryParam("orderBy") String orderBy,
|
|
||||||
@QueryParam("status") String status,
|
|
||||||
@QueryParam("type") String type,
|
|
||||||
@QueryParam("minDate") String minDate,
|
|
||||||
@QueryParam("maxDate") String maxDate) {
|
|
||||||
|
|
||||||
DriverManager.setLoginTimeout(5); // Définir le timeout à 5 secondes
|
|
||||||
|
|
||||||
try (DatabaseConnectOBI databaseConnection = new DatabaseConnectOBI()) {
|
|
||||||
String countQuery = "SELECT COUNT(*), "
|
|
||||||
+ "SUM (CASE WHEN oo.status = 'new_order' THEN 1 ELSE 0 END) AS stat_status1, "
|
|
||||||
+ "SUM (CASE WHEN oo.status = 'polled' THEN 1 ELSE 0 END) AS stat_status2, "
|
|
||||||
+ "SUM (CASE WHEN oo.status = 'fulfilled' THEN 1 ELSE 0 END) AS stat_status3, "
|
|
||||||
+ "SUM (CASE WHEN oo.status = 'received' THEN 1 ELSE 0 END) AS stat_status4, "
|
|
||||||
+ "SUM (CASE WHEN oo.status = 'unfulfillable' THEN 1 ELSE 0 END) AS stat_status5, "
|
|
||||||
+ "SUM (CASE WHEN oo.status = 'canceled' THEN 1 ELSE 0 END) AS stat_status6 "
|
|
||||||
+ "FROM obi_order oo "
|
|
||||||
+ "JOIN obi_transaction_type ott on ott.transaction_type_id = oo.transaction_type_id";
|
|
||||||
|
|
||||||
String query =
|
|
||||||
"SELECT oo.request_id, "
|
|
||||||
+ "oo.order_id, "
|
|
||||||
+ "oo.transaction_date, "
|
|
||||||
+ "oo.status as status, "
|
|
||||||
+ "ott.transaction_type_description "
|
|
||||||
+ "FROM obi_order oo "
|
|
||||||
+ "JOIN obi_transaction_type ott on ott.transaction_type_id = oo.transaction_type_id";
|
|
||||||
|
|
||||||
List<String> conditions = new ArrayList<>();
|
|
||||||
if (q != null && !q.isEmpty()) {
|
|
||||||
conditions.add(" oo.order_id LIKE ? ");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (status != null && !status.isEmpty()) {
|
|
||||||
conditions.add(" oo.status = ? ");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (type != null && !type.isEmpty()) {
|
|
||||||
conditions.add(" ott.transaction_type_code = ? ");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (minDate != null && !minDate.isEmpty()) {
|
|
||||||
conditions.add(" DATE_TRUNC('day', oo.transaction_date) >= ? ");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (maxDate != null && !maxDate.isEmpty()) {
|
|
||||||
conditions.add(" DATE_TRUNC('day', oo.transaction_date) <= ? ");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!conditions.isEmpty()) {
|
|
||||||
countQuery += " WHERE " + String.join(" AND ", conditions);
|
|
||||||
query += " WHERE " + String.join(" AND ", conditions);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (sortBy != null && !sortBy.isEmpty()) {
|
|
||||||
query += " ORDER BY " + sortBy;
|
|
||||||
if (orderBy != null && !orderBy.isEmpty()) {
|
|
||||||
query += " " + orderBy;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (page > 0 && itemsPerPage > 0) {
|
|
||||||
query += " LIMIT " + itemsPerPage + " OFFSET " + (page - 1) * itemsPerPage;
|
|
||||||
}
|
|
||||||
|
|
||||||
logger.info(query);
|
|
||||||
|
|
||||||
try (PreparedStatement countStatement = databaseConnection.getConnection().prepareStatement(countQuery);
|
|
||||||
PreparedStatement statement = databaseConnection.getConnection().prepareStatement(query)) {
|
|
||||||
int index = 1;
|
|
||||||
|
|
||||||
if (q != null && !q.isEmpty()) {
|
|
||||||
countStatement.setString(index, "%" + q + "%");
|
|
||||||
statement.setString(index++, "%" + q + "%");
|
|
||||||
}
|
|
||||||
|
|
||||||
if(status != null && !status.isEmpty()) {
|
|
||||||
countStatement.setString(index, status );
|
|
||||||
statement.setString(index++, status );
|
|
||||||
}
|
|
||||||
|
|
||||||
if (type != null && !type.isEmpty()) {
|
|
||||||
countStatement.setString(index, type);
|
|
||||||
statement.setString(index++, type);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
|
|
||||||
|
|
||||||
if (minDate != null && !minDate.isEmpty()) {
|
|
||||||
try {
|
|
||||||
java.util.Date parsedMinDate = dateFormat.parse(minDate);
|
|
||||||
java.sql.Date sqlMinDate = new java.sql.Date(parsedMinDate.getTime());
|
|
||||||
|
|
||||||
countStatement.setDate(index, sqlMinDate);
|
|
||||||
statement.setDate(index++, sqlMinDate);
|
|
||||||
} catch (ParseException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (maxDate != null && !maxDate.isEmpty()) {
|
|
||||||
try {
|
|
||||||
java.util.Date parsedMaxDate = dateFormat.parse(maxDate);
|
|
||||||
java.sql.Date sqlMaxDate = new java.sql.Date(parsedMaxDate.getTime());
|
|
||||||
|
|
||||||
countStatement.setDate(index, sqlMaxDate);
|
|
||||||
statement.setDate(index++, sqlMaxDate);
|
|
||||||
} catch (ParseException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ResultSet countResultSet = countStatement.executeQuery();
|
|
||||||
countResultSet.next();
|
|
||||||
int total = countResultSet.getInt(1);
|
|
||||||
int statStatus1 = countResultSet.getInt(2);
|
|
||||||
int statStatus2 = countResultSet.getInt(3);
|
|
||||||
int statStatus3 = countResultSet.getInt(4);
|
|
||||||
int statStatus4 = countResultSet.getInt(5);
|
|
||||||
int statStatus5 = countResultSet.getInt(6);
|
|
||||||
int statStatus6 = countResultSet.getInt(7);
|
|
||||||
|
|
||||||
ResultSet resultSet = statement.executeQuery(); {
|
|
||||||
List<Order> orderList = new ArrayList<>();
|
|
||||||
|
|
||||||
while (resultSet.next()) {
|
|
||||||
Order order = mapResultSetToOrderList(resultSet);
|
|
||||||
orderList.add(order);
|
|
||||||
}
|
|
||||||
|
|
||||||
ObjectMapper objectMapper = new ObjectMapper();
|
|
||||||
ObjectNode responseNode = objectMapper.createObjectNode();
|
|
||||||
responseNode.put("total", total);
|
|
||||||
|
|
||||||
ArrayNode statisticsArray = objectMapper.createArrayNode();
|
|
||||||
String[] titles = {"new_order", "polled", "fulfilled", "received","unfulfillable","canceled"};
|
|
||||||
String[] icons = {"tabler-calendar-stats", "tabler-progress-check", "tabler-checks", "tabler-checks","tabler-wallet","tabler-circle-x"};
|
|
||||||
int[] counts = {statStatus1, statStatus2, statStatus3, statStatus4, statStatus5, statStatus6};
|
|
||||||
|
|
||||||
for (int i = 0; i < titles.length; i++) {
|
|
||||||
ObjectNode node = objectMapper.createObjectNode();
|
|
||||||
node.put("title", titles[i]);
|
|
||||||
node.put("value", counts[i]);
|
|
||||||
node.put("icon", icons[i]);
|
|
||||||
statisticsArray.add(node);
|
|
||||||
}
|
|
||||||
responseNode.set("statistics", statisticsArray);
|
|
||||||
|
|
||||||
responseNode.set("orders", objectMapper.valueToTree(orderList));
|
|
||||||
|
|
||||||
String jsonResponse;
|
|
||||||
|
|
||||||
try {
|
|
||||||
jsonResponse = objectMapper.writeValueAsString(responseNode);
|
|
||||||
return Response.ok(jsonResponse).build();
|
|
||||||
} catch (JsonProcessingException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity("{\"error\":\"Error processing JSON\"}").build();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (SQLException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
String errorResponse = "{\"error\":\"" + e.getMessage() + "\"}";
|
|
||||||
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(errorResponse).build();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@GET
|
|
||||||
@Path("/order/{requestId}")
|
|
||||||
@Produces(MediaType.APPLICATION_JSON)
|
|
||||||
public Response getOrderById( @PathParam("requestId") Long requestId) throws SQLException {
|
|
||||||
|
|
||||||
DriverManager.setLoginTimeout(5); // Définir le timeout à 5 secondes
|
|
||||||
|
|
||||||
try (DatabaseConnectOBI databaseConnection = new DatabaseConnectOBI()) {
|
|
||||||
// ORDER SECTION ---------------------------------
|
|
||||||
String orderQuery = "SELECT oo.request_id, oo.order_id, oo.requesting_location_cd, oo.requesting_system_cd, "
|
|
||||||
+ "oo.customer_id, oo.transaction_no, oo.transaction_type_id, oo.transaction_date, oo.status, "
|
|
||||||
+ "oo.fdate_creation, oo.consumed, oo.shipforpickup_location_cd, oo.shipforpickup_system_cd, "
|
|
||||||
+ "ott.transaction_type_description "
|
|
||||||
+ "FROM obi_order oo "
|
|
||||||
+ "JOIN obi_transaction_type ott on ott.transaction_type_id = oo.transaction_type_id "
|
|
||||||
+ "WHERE oo.request_id = ?";
|
|
||||||
|
|
||||||
logger.info(orderQuery);
|
|
||||||
|
|
||||||
try (PreparedStatement statement = databaseConnection.getConnection().prepareStatement(orderQuery)) {
|
|
||||||
statement.setLong(1, requestId);
|
|
||||||
|
|
||||||
try (ResultSet resultSet = statement.executeQuery()) {
|
|
||||||
if (resultSet.next()) {
|
|
||||||
Order order = mapResultSetToOrder(resultSet);
|
|
||||||
|
|
||||||
// ORDER LINES SECTION ---------------------------------
|
|
||||||
String orderLinesQuery = "SELECT olo.line_order_id, olo.line_item_no, olo.order_id, olo.request_id, olo.line_item_oms, "
|
|
||||||
+ "olo.item_id, olo.ordered_line_qty, olo.status, olo.transaction_date, olo.shipping_agent, "
|
|
||||||
+ "olo.tracking_number, olo.fulfillment_id, olo.carton_number, olo.fdate_creation, olo.consumed "
|
|
||||||
+ "FROM obi.obi_ln_order olo "
|
|
||||||
+ "WHERE olo.request_id = ? "
|
|
||||||
+ "ORDER BY olo.line_item_no";
|
|
||||||
|
|
||||||
logger.info(orderLinesQuery);
|
|
||||||
|
|
||||||
try (PreparedStatement linesStatement = databaseConnection.getConnection().prepareStatement(orderLinesQuery)) {
|
|
||||||
linesStatement.setLong(1, requestId);
|
|
||||||
|
|
||||||
try (ResultSet linesResultSet = linesStatement.executeQuery()) {
|
|
||||||
List<Order.Lines> orderLinesList = new ArrayList<>();
|
|
||||||
|
|
||||||
while (linesResultSet.next()) {
|
|
||||||
orderLinesList.add(mapResultSetToOrderLine(linesResultSet));
|
|
||||||
|
|
||||||
String orderLinesHistoryQuery = "SELECT ohlo.status_id, ohlo.line_order_id, ohlo.status, ohlo.transaction_date, ohlo.fdate_creation "
|
|
||||||
+ "FROM obi.obi_h_ln_order ohlo "
|
|
||||||
+ "WHERE ohlo.line_order_id = ? "
|
|
||||||
+ "ORDER BY ohlo.status_id DESC";
|
|
||||||
|
|
||||||
logger.info(orderLinesHistoryQuery);
|
|
||||||
|
|
||||||
try (PreparedStatement orderLinesHistoryStatement = databaseConnection.getConnection().prepareStatement(orderLinesHistoryQuery)) {
|
|
||||||
orderLinesHistoryStatement.setLong(1, orderLinesList.get(orderLinesList.size() - 1).getLineOrderId());
|
|
||||||
|
|
||||||
try (ResultSet orderLinesHistoryResultSet = orderLinesHistoryStatement.executeQuery()) {
|
|
||||||
List<Order.History> orderLinesHistoryList = new ArrayList<>();
|
|
||||||
|
|
||||||
while (orderLinesHistoryResultSet.next()) {
|
|
||||||
orderLinesHistoryList.add(mapResultSetToOrderLinesHistory(orderLinesHistoryResultSet));
|
|
||||||
}
|
|
||||||
|
|
||||||
orderLinesList.get(orderLinesList.size() - 1).setHistory(orderLinesHistoryList);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
order.setLines(orderLinesList);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ORDER HISTORY SECTION ---------------------------------
|
|
||||||
String orderHistoryQuery = "SELECT oho.status_id, oho.request_id, oho.status, oho.transaction_date, oho.fdate_creation "
|
|
||||||
+ "FROM obi.obi_h_order oho "
|
|
||||||
+ "WHERE oho.request_id = ? "
|
|
||||||
+ "ORDER BY oho.status_id DESC";
|
|
||||||
|
|
||||||
logger.info(orderHistoryQuery);
|
|
||||||
|
|
||||||
try (PreparedStatement orderHistoryStatement = databaseConnection.getConnection().prepareStatement(orderHistoryQuery)) {
|
|
||||||
orderHistoryStatement.setLong(1, requestId);
|
|
||||||
|
|
||||||
try (ResultSet orderHistoryResultSet = orderHistoryStatement.executeQuery()) {
|
|
||||||
List<Order.History> orderHistoryList = new ArrayList<>();
|
|
||||||
|
|
||||||
while (orderHistoryResultSet.next()) {
|
|
||||||
orderHistoryList.add(mapResultSetToOrderHistory(orderHistoryResultSet));
|
|
||||||
}
|
|
||||||
|
|
||||||
order.setHistory(orderHistoryList);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// PREPARATION SECTION ---------------------------------
|
|
||||||
String preparationQuery = "SELECT oop.prep_int_id, oop.prep_id, oop.order_id, oop.request_id, oop.transaction_date, oop.fulfillment_system_cd, "
|
|
||||||
+ "oop.fulfillment_location_cd, oop.status, oop.date_prepartion, oop.fdate_creation "
|
|
||||||
+ "FROM obi.obi_order_prep oop "
|
|
||||||
+ "WHERE oop.request_id = ? "
|
|
||||||
+ "ORDER BY oop.prep_int_id DESC";
|
|
||||||
|
|
||||||
logger.info(preparationQuery);
|
|
||||||
|
|
||||||
try(PreparedStatement preparationStatement = databaseConnection.getConnection().prepareStatement(preparationQuery)) {
|
|
||||||
preparationStatement.setLong(1, requestId);
|
|
||||||
|
|
||||||
try(ResultSet preparationResultSet = preparationStatement.executeQuery()) {
|
|
||||||
List<Order.Preparation> preparationList = new ArrayList<>();
|
|
||||||
|
|
||||||
while(preparationResultSet.next()) {
|
|
||||||
preparationList.add(mapResultSetToPreparation(preparationResultSet));
|
|
||||||
|
|
||||||
// PREPARATION LINES SECTION ---------------------------------
|
|
||||||
String preparationLinesQuery =
|
|
||||||
"SELECT "
|
|
||||||
+ "olop.line_fulfill_id, "
|
|
||||||
+ "olop.line_order_id, "
|
|
||||||
+ "olop.prep_int_id, "
|
|
||||||
+ "olop.order_id, "
|
|
||||||
+ "olop.request_id, "
|
|
||||||
+ "olop.transaction_date, "
|
|
||||||
+ "olop.line_item_no, "
|
|
||||||
+ "olop.item_id, "
|
|
||||||
+ "olop.line_item_oms, "
|
|
||||||
+ "olop.fulfill_qty, "
|
|
||||||
+ "olop.validated_fulfill_qty, "
|
|
||||||
+ "olop.fulfillment_system_cd, "
|
|
||||||
+ "olop.fulfillment_location_cd, "
|
|
||||||
+ "olop.status, "
|
|
||||||
+ "olop.numero_expedition, "
|
|
||||||
+ "olop.season_code, "
|
|
||||||
+ "olop.finition_speciale, "
|
|
||||||
+ "olop.carrier, "
|
|
||||||
+ "olop.tracking_code, "
|
|
||||||
+ "olop.tracking_url, "
|
|
||||||
+ "olop.fdate_creation, "
|
|
||||||
+ "olop.fdate_modification, "
|
|
||||||
+ "olop.to_orlix_consumed, "
|
|
||||||
+ "null as restocking_code " //"olop.restocking_code "
|
|
||||||
+ "FROM obi.obi_ln_order_prep olop "
|
|
||||||
+ "WHERE olop.prep_int_id = ? "
|
|
||||||
+ "ORDER BY olop.line_item_oms";
|
|
||||||
|
|
||||||
logger.info(preparationLinesQuery);
|
|
||||||
|
|
||||||
try(PreparedStatement preparationLinesStatement = databaseConnection.getConnection().prepareStatement(preparationLinesQuery)) {
|
|
||||||
preparationLinesStatement.setLong(1, preparationList.get(preparationList.size() - 1).getPrepIntId());
|
|
||||||
|
|
||||||
try(ResultSet preparationLinesResultSet = preparationLinesStatement.executeQuery()) {
|
|
||||||
List<Order.Preparation.PreparationLines> preparationLinesList = new ArrayList<>();
|
|
||||||
|
|
||||||
while(preparationLinesResultSet.next()) {
|
|
||||||
preparationLinesList.add(mapResultSetToPreparationLines(preparationLinesResultSet));
|
|
||||||
}
|
|
||||||
|
|
||||||
preparationList.get(preparationList.size() - 1).setLines(preparationLinesList);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
order.setPreparations(preparationList);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// RECEPTION SECTION ---------------------------------
|
|
||||||
String receptionQuery = "SELECT ocr.intransit_int_id, ocr.intransit_id, ocr.prep_int_id, "
|
|
||||||
+ "ocr.order_id, ocr.request_id, ocr.status, ocr.transaction_date, "
|
|
||||||
+ "ocr.intransit_system_cd, ocr.intransit_location_cd, ocr.fdate_receipt, "
|
|
||||||
+ "ocr.fdate_creation "
|
|
||||||
+ "FROM obi.obi_cr_receipt ocr "
|
|
||||||
+ "WHERE ocr.request_id = ? "
|
|
||||||
+ "ORDER BY ocr.intransit_id DESC";
|
|
||||||
|
|
||||||
logger.info(receptionQuery);
|
|
||||||
|
|
||||||
try(PreparedStatement receptionStatement = databaseConnection.getConnection().prepareStatement(receptionQuery)) {
|
|
||||||
receptionStatement.setLong(1, requestId);
|
|
||||||
|
|
||||||
try(ResultSet receptionResultSet = receptionStatement.executeQuery()) {
|
|
||||||
List<Order.Reception> receptionList = new ArrayList<>();
|
|
||||||
|
|
||||||
while(receptionResultSet.next()) {
|
|
||||||
receptionList.add(mapResultSetToReception(receptionResultSet));
|
|
||||||
|
|
||||||
// RECEPTION LINES SECTION ---------------------------------
|
|
||||||
String receptionLinesQuery = "SELECT "
|
|
||||||
+ "olcr.line_intransit_id AS line_intransit_id, "
|
|
||||||
+ "olcr.intransit_int_id AS intransit_int_id, "
|
|
||||||
+ "olcr.line_fulfill_id AS line_fulfill_id, "
|
|
||||||
+ "olcr.transaction_date AS transaction_date, "
|
|
||||||
+ "olcr.line_item_no AS line_item_no, "
|
|
||||||
+ "olcr.item_id AS item_id, "
|
|
||||||
+ "olcr.intransit_qty AS intransit_qty, "
|
|
||||||
+ "olcr.validated_intransit_qty AS validated_intransit_qty, "
|
|
||||||
+ "olcr.intransit_system_cd AS intransit_system_cd, "
|
|
||||||
+ "olcr.intransit_location_cd AS intransit_location_cd, "
|
|
||||||
+ "olcr.status AS status, "
|
|
||||||
+ "olcr.colis_id AS colis_id, "
|
|
||||||
+ "olcr.fdate_creation AS fdate_creation, "
|
|
||||||
+ "olcr.fdate_receipt AS fdate_receipt, "
|
|
||||||
+ "olcr.order_line_ship_weight AS order_line_ship_weight, "
|
|
||||||
+ "olcr.tracking_number AS tracking_number "
|
|
||||||
+ "FROM obi.obi_ln_cr_receipt olcr "
|
|
||||||
+ "WHERE olcr.intransit_int_id = ? "
|
|
||||||
+ "ORDER BY olcr.line_item_no";
|
|
||||||
|
|
||||||
logger.info(receptionLinesQuery);
|
|
||||||
|
|
||||||
try(PreparedStatement receptionLinesStatement = databaseConnection.getConnection().prepareStatement(receptionLinesQuery)) {
|
|
||||||
receptionLinesStatement.setLong(1, receptionList.get(receptionList.size() - 1).getIntransitIntId());
|
|
||||||
|
|
||||||
try(ResultSet receptionLinesResultSet = receptionLinesStatement.executeQuery()) {
|
|
||||||
List<Order.Reception.ReceptionLines> receptionLinesList = new ArrayList<>();
|
|
||||||
|
|
||||||
while(receptionLinesResultSet.next()) {
|
|
||||||
receptionLinesList.add(mapResultSetToReceptionLines(receptionLinesResultSet));
|
|
||||||
}
|
|
||||||
|
|
||||||
receptionList.get(receptionList.size() - 1).setLines(receptionLinesList);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
order.setReceptions(receptionList);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ObjectMapper objectMapper = new ObjectMapper();
|
|
||||||
String jsonResponse = objectMapper.writeValueAsString(order);
|
|
||||||
|
|
||||||
return Response.ok(jsonResponse).build();
|
|
||||||
} else {
|
|
||||||
return Response.status(Response.Status.NOT_FOUND).entity("{\"error\":\"No order found\"}").build();
|
|
||||||
}
|
|
||||||
} catch (JsonProcessingException e) {
|
|
||||||
e.printStackTrace(); // Handle exceptions correctly in a production environment
|
|
||||||
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity("{\"error\":\"Error processing JSON\"}").build();
|
|
||||||
}
|
|
||||||
} catch (SQLException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity("{\"error\":\"" + e.getMessage() + "\"}").build();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@GET
|
|
||||||
@Path("/order/{requestId}/orderMessage")
|
|
||||||
@Produces(MediaType.APPLICATION_JSON)
|
|
||||||
public Response getOrderMessage(@PathParam("requestId") Long requestId) throws SQLException {
|
|
||||||
DriverManager.setLoginTimeout(5); // Définir le timeout à 5 secondes
|
|
||||||
|
|
||||||
try (DatabaseConnectOBI databaseConnection = new DatabaseConnectOBI()) {
|
|
||||||
String orderXmlQuery = "SELECT oo.submit_ord_msg "
|
|
||||||
+ "FROM obi_order oo "
|
|
||||||
+ "WHERE oo.request_id = ?";
|
|
||||||
|
|
||||||
logger.info(orderXmlQuery);
|
|
||||||
|
|
||||||
try (PreparedStatement statement = databaseConnection.getConnection().prepareStatement(orderXmlQuery)) {
|
|
||||||
statement.setLong(1, requestId);
|
|
||||||
|
|
||||||
try (ResultSet resultSet = statement.executeQuery()) {
|
|
||||||
if (resultSet.next()) {
|
|
||||||
String xmlString = resultSet.getString("SUBMIT_ORD_MSG");
|
|
||||||
JSONObject jsonObject = XML.toJSONObject(xmlString);
|
|
||||||
|
|
||||||
ObjectMapper objectMapper = new ObjectMapper();
|
|
||||||
JsonNode jsonNode = objectMapper.readTree(jsonObject.toString());
|
|
||||||
|
|
||||||
return Response.ok(jsonNode).build();
|
|
||||||
} else {
|
|
||||||
return Response.status(Response.Status.NOT_FOUND).entity("{\"error\":\"No transaction found with the provided ID\"}").build();
|
|
||||||
}
|
|
||||||
} catch (SQLException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity("{\"error\":\"" + e.getMessage() + "\"}").build();
|
|
||||||
}
|
|
||||||
} catch (SQLException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity("{\"error\":\"" + e.getMessage() + "\"}").build();
|
|
||||||
}
|
|
||||||
} catch (JsonProcessingException e) {
|
|
||||||
e.printStackTrace(); // Handle exceptions correctly in a production environment
|
|
||||||
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity("{\"error\":\"Error processing JSON\"}").build();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private Order.Preparation.PreparationLines mapResultSetToPreparationLines(ResultSet resultSet) throws SQLException {
|
|
||||||
Order.Preparation.PreparationLines preparationLines = new Order().new Preparation().new PreparationLines();
|
|
||||||
|
|
||||||
preparationLines.setLineFulfillId(resultSet.getInt("LINE_FULFILL_ID"));
|
|
||||||
preparationLines.setLineOrderId(resultSet.getInt("LINE_ORDER_ID"));
|
|
||||||
preparationLines.setPrepIntId(resultSet.getInt("PREP_INT_ID"));
|
|
||||||
preparationLines.setOrderId(resultSet.getString("ORDER_ID"));
|
|
||||||
preparationLines.setRequestId(resultSet.getLong("REQUEST_ID"));
|
|
||||||
preparationLines.setTransactionDate(resultSet.getTimestamp("TRANSACTION_DATE"));
|
|
||||||
preparationLines.setLineItemNo(resultSet.getInt("LINE_ITEM_NO"));
|
|
||||||
preparationLines.setItemId(resultSet.getString("ITEM_ID"));
|
|
||||||
preparationLines.setLineItemOms(resultSet.getString("LINE_ITEM_OMS"));
|
|
||||||
preparationLines.setFulfillQty(resultSet.getInt("FULFILL_QTY"));
|
|
||||||
preparationLines.setValidatedFulfillQty(resultSet.getInt("VALIDATED_FULFILL_QTY"));
|
|
||||||
preparationLines.setFulfillmentSystemCd(resultSet.getString("FULFILLMENT_SYSTEM_CD"));
|
|
||||||
preparationLines.setFulfillmentLocationCd(resultSet.getString("FULFILLMENT_LOCATION_CD"));
|
|
||||||
preparationLines.setStatus(resultSet.getString("STATUS"));
|
|
||||||
preparationLines.setNumeroExpedition(resultSet.getString("NUMERO_EXPEDITION"));
|
|
||||||
preparationLines.setSeasonCode(resultSet.getString("SEASON_CODE"));
|
|
||||||
preparationLines.setFinitionSpeciale(resultSet.getString("FINITION_SPECIALE"));
|
|
||||||
preparationLines.setCarrier(resultSet.getString("CARRIER"));
|
|
||||||
preparationLines.setTrackingCode(resultSet.getString("TRACKING_CODE"));
|
|
||||||
preparationLines.setTrackingUrl(resultSet.getString("TRACKING_URL"));
|
|
||||||
preparationLines.setFdateCreation(resultSet.getTimestamp("FDATE_CREATION"));
|
|
||||||
preparationLines.setFdateModification(resultSet.getTimestamp("FDATE_MODIFICATION"));
|
|
||||||
preparationLines.setToOrlixConsumed(resultSet.getBoolean("TO_ORLIX_CONSUMED"));
|
|
||||||
preparationLines.setRestockingCode(resultSet.getString("RESTOCKING_CODE"));
|
|
||||||
|
|
||||||
return preparationLines;
|
|
||||||
}
|
|
||||||
|
|
||||||
private Order.Preparation mapResultSetToPreparation(ResultSet resultSet) throws SQLException {
|
|
||||||
Order.Preparation preparation = new Order().new Preparation();
|
|
||||||
|
|
||||||
preparation.setPrepIntId(resultSet.getInt("PREP_INT_ID"));
|
|
||||||
preparation.setPrepId(resultSet.getInt("PREP_ID"));
|
|
||||||
preparation.setOrderId(resultSet.getString("ORDER_ID"));
|
|
||||||
preparation.setRequestId(resultSet.getLong("REQUEST_ID"));
|
|
||||||
preparation.setTransactionDate(resultSet.getTimestamp("TRANSACTION_DATE"));
|
|
||||||
preparation.setFulfillmentSystemCd(resultSet.getString("FULFILLMENT_SYSTEM_CD"));
|
|
||||||
preparation.setFulfillmentLocationCd(resultSet.getString("FULFILLMENT_LOCATION_CD"));
|
|
||||||
preparation.setStatus(resultSet.getString("STATUS"));
|
|
||||||
preparation.setDatePreparation(resultSet.getTimestamp("DATE_PREPARTION"));
|
|
||||||
preparation.setFdateCreation(resultSet.getTimestamp("FDATE_CREATION"));
|
|
||||||
|
|
||||||
return preparation;
|
|
||||||
}
|
|
||||||
|
|
||||||
private Order.Reception.ReceptionLines mapResultSetToReceptionLines(ResultSet resultSet) throws SQLException {
|
|
||||||
Order.Reception.ReceptionLines receptionLines = new Order().new Reception().new ReceptionLines();
|
|
||||||
|
|
||||||
receptionLines.setLineIntransitId(resultSet.getInt("LINE_INTRANSIT_ID"));
|
|
||||||
receptionLines.setIntransitIntId(resultSet.getInt("INTRANSIT_INT_ID"));
|
|
||||||
receptionLines.setLineFulfillId(resultSet.getInt("LINE_FULFILL_ID"));
|
|
||||||
receptionLines.setTransactionDate(resultSet.getTimestamp("TRANSACTION_DATE"));
|
|
||||||
receptionLines.setLineItemNo(resultSet.getInt("LINE_ITEM_NO"));
|
|
||||||
receptionLines.setItemId(resultSet.getString("ITEM_ID"));
|
|
||||||
receptionLines.setIntransitQty(resultSet.getInt("INTRANSIT_QTY"));
|
|
||||||
receptionLines.setValidatedIntransitQty(resultSet.getInt("VALIDATED_INTRANSIT_QTY"));
|
|
||||||
receptionLines.setIntransitSystemCd(resultSet.getString("INTRANSIT_SYSTEM_CD"));
|
|
||||||
receptionLines.setIntransitLocationCd(resultSet.getString("INTRANSIT_LOCATION_CD"));
|
|
||||||
receptionLines.setStatus(resultSet.getString("STATUS"));
|
|
||||||
receptionLines.setColisId(resultSet.getString("COLIS_ID"));
|
|
||||||
receptionLines.setFdateCreation(resultSet.getTimestamp("FDATE_CREATION"));
|
|
||||||
receptionLines.setFdateReceipt(resultSet.getTimestamp("FDATE_RECEIPT"));
|
|
||||||
receptionLines.setOrderLineShipWeight(resultSet.getDouble("ORDER_LINE_SHIP_WEIGHT"));
|
|
||||||
receptionLines.setTrackingNumber(resultSet.getString("TRACKING_NUMBER"));
|
|
||||||
|
|
||||||
return receptionLines;
|
|
||||||
}
|
|
||||||
|
|
||||||
private Order.Reception mapResultSetToReception(ResultSet resultSet) throws SQLException {
|
|
||||||
Order.Reception reception = new Order().new Reception();
|
|
||||||
|
|
||||||
reception.setIntransitIntId(resultSet.getInt("INTRANSIT_INT_ID"));
|
|
||||||
reception.setIntransitId(resultSet.getString("INTRANSIT_ID"));
|
|
||||||
reception.setPrepIntId(resultSet.getInt("PREP_INT_ID"));
|
|
||||||
reception.setOrderId(resultSet.getString("ORDER_ID"));
|
|
||||||
reception.setRequestId(resultSet.getLong("REQUEST_ID"));
|
|
||||||
reception.setStatus(resultSet.getString("STATUS"));
|
|
||||||
reception.setTransactionDate(resultSet.getTimestamp("TRANSACTION_DATE"));
|
|
||||||
reception.setIntransitSystemCd(resultSet.getString("INTRANSIT_SYSTEM_CD"));
|
|
||||||
reception.setIntransitLocationCd(resultSet.getString("INTRANSIT_LOCATION_CD"));
|
|
||||||
reception.setFdateReceipt(resultSet.getTimestamp("FDATE_RECEIPT"));
|
|
||||||
reception.setFdateCreation(resultSet.getTimestamp("FDATE_CREATION"));
|
|
||||||
|
|
||||||
return reception;
|
|
||||||
}
|
|
||||||
|
|
||||||
private Order.History mapResultSetToOrderLinesHistory(ResultSet resultSet) throws SQLException {
|
|
||||||
Order.History orderLinesHistory = new Order().new History();
|
|
||||||
|
|
||||||
orderLinesHistory.setStatusId(resultSet.getInt("STATUS_ID"));
|
|
||||||
orderLinesHistory.setId(resultSet.getLong("LINE_ORDER_ID"));
|
|
||||||
orderLinesHistory.setStatus(resultSet.getString("STATUS"));
|
|
||||||
orderLinesHistory.setTransactionDate(resultSet.getTimestamp("TRANSACTION_DATE"));
|
|
||||||
orderLinesHistory.setFdateCreation(resultSet.getTimestamp("FDATE_CREATION"));
|
|
||||||
|
|
||||||
return orderLinesHistory;
|
|
||||||
}
|
|
||||||
|
|
||||||
private Order.History mapResultSetToOrderHistory(ResultSet resultSet) throws SQLException {
|
|
||||||
Order.History orderHistory = new Order().new History();
|
|
||||||
|
|
||||||
orderHistory.setStatusId(resultSet.getInt("STATUS_ID"));
|
|
||||||
orderHistory.setId(resultSet.getLong("REQUEST_ID"));
|
|
||||||
orderHistory.setStatus(resultSet.getString("STATUS"));
|
|
||||||
orderHistory.setTransactionDate(resultSet.getTimestamp("TRANSACTION_DATE"));
|
|
||||||
orderHistory.setFdateCreation(resultSet.getTimestamp("FDATE_CREATION"));
|
|
||||||
|
|
||||||
return orderHistory;
|
|
||||||
}
|
|
||||||
|
|
||||||
private Order.Lines mapResultSetToOrderLine(ResultSet resultSet) throws SQLException {
|
|
||||||
Order.Lines orderLine = new Order().new Lines();
|
|
||||||
|
|
||||||
orderLine.setLineOrderId(resultSet.getLong("LINE_ORDER_ID"));
|
|
||||||
orderLine.setLineItemNo(resultSet.getInt("LINE_ITEM_NO"));
|
|
||||||
orderLine.setLineItemOms(resultSet.getString("LINE_ITEM_OMS"));
|
|
||||||
orderLine.setItemId(resultSet.getString("ITEM_ID"));
|
|
||||||
orderLine.setOrderedLineQty(resultSet.getInt("ORDERED_LINE_QTY"));
|
|
||||||
orderLine.setStatus(resultSet.getString("STATUS"));
|
|
||||||
orderLine.setTransactionDate(resultSet.getTimestamp("TRANSACTION_DATE"));
|
|
||||||
orderLine.setShippingAgent(resultSet.getString("SHIPPING_AGENT"));
|
|
||||||
orderLine.setTrackingNumber(resultSet.getString("TRACKING_NUMBER"));
|
|
||||||
orderLine.setFulfillmentId(resultSet.getString("FULFILLMENT_ID"));
|
|
||||||
orderLine.setCartonNumber(resultSet.getString("CARTON_NUMBER"));
|
|
||||||
orderLine.setFdateCreation(resultSet.getTimestamp("FDATE_CREATION"));
|
|
||||||
orderLine.setConsumed(resultSet.getBoolean("CONSUMED"));
|
|
||||||
|
|
||||||
return orderLine;
|
|
||||||
}
|
|
||||||
|
|
||||||
private Order mapResultSetToOrderList(ResultSet resultSet) throws SQLException {
|
|
||||||
Order order = new Order();
|
|
||||||
Order.Meta meta = new Order.Meta();
|
|
||||||
Order.Common common = order.new Common();
|
|
||||||
Order.Common.StatusData statusData = common.new StatusData();
|
|
||||||
Order.Common.Transaction transaction = common.new Transaction();
|
|
||||||
|
|
||||||
meta.setId(resultSet.getLong("REQUEST_ID"));
|
|
||||||
order.setMeta(meta);
|
|
||||||
|
|
||||||
statusData.setCode(resultSet.getString("STATUS"));
|
|
||||||
statusData.setTitle("TEST"); // TODO A VOIR
|
|
||||||
|
|
||||||
common.setOrderId(resultSet.getString("ORDER_ID"));
|
|
||||||
|
|
||||||
transaction.setTransactionDate(resultSet.getTimestamp("TRANSACTION_DATE"));
|
|
||||||
transaction.setTransactionTypeDescription(resultSet.getString("TRANSACTION_TYPE_DESCRIPTION"));
|
|
||||||
|
|
||||||
common.setStatusData(statusData);
|
|
||||||
common.setTransaction(transaction);
|
|
||||||
|
|
||||||
order.setMeta(meta);
|
|
||||||
order.setCommon(common);
|
|
||||||
|
|
||||||
return order;
|
|
||||||
}
|
|
||||||
|
|
||||||
private Order mapResultSetToOrder(ResultSet resultSet) throws SQLException {
|
|
||||||
Order order = new Order();
|
|
||||||
Order.Meta meta = new Order.Meta();
|
|
||||||
Order.Common common = order.new Common();
|
|
||||||
Order.Common.StatusData statusData = common.new StatusData();
|
|
||||||
Order.Common.Transaction transaction = common.new Transaction();
|
|
||||||
|
|
||||||
meta.setId(resultSet.getLong("REQUEST_ID"));
|
|
||||||
order.setMeta(meta);
|
|
||||||
|
|
||||||
statusData.setCode(resultSet.getString("STATUS"));
|
|
||||||
statusData.setTitle("TEST"); // TODO A VOIR
|
|
||||||
|
|
||||||
common.setOrderId(resultSet.getString("ORDER_ID"));
|
|
||||||
common.setRequestingLocationCd(resultSet.getString("REQUESTING_LOCATION_CD"));
|
|
||||||
common.setRequestingSystemCd(resultSet.getString("REQUESTING_SYSTEM_CD"));
|
|
||||||
common.setCustomerId(resultSet.getString("CUSTOMER_ID"));
|
|
||||||
common.setFdateCreation(resultSet.getTimestamp("FDATE_CREATION"));
|
|
||||||
common.setConsumed(resultSet.getBoolean("CONSUMED"));
|
|
||||||
common.setShipforpickupLocationCd(resultSet.getString("SHIPFORPICKUP_LOCATION_CD"));
|
|
||||||
common.setShipforpickupSystemCd(resultSet.getString("SHIPFORPICKUP_SYSTEM_CD"));
|
|
||||||
|
|
||||||
transaction.setTransactionNo(resultSet.getString("TRANSACTION_NO"));
|
|
||||||
transaction.setTransactionTypeId(resultSet.getInt("TRANSACTION_TYPE_ID"));
|
|
||||||
transaction.setTransactionDate(resultSet.getTimestamp("TRANSACTION_DATE"));
|
|
||||||
transaction.setTransactionTypeDescription(resultSet.getString("TRANSACTION_TYPE_DESCRIPTION"));
|
|
||||||
|
|
||||||
common.setStatusData(statusData);
|
|
||||||
common.setTransaction(transaction);
|
|
||||||
|
|
||||||
order.setMeta(meta);
|
|
||||||
order.setCommon(common);
|
|
||||||
|
|
||||||
return order;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,115 +0,0 @@
|
||||||
package com.example.services;
|
|
||||||
|
|
||||||
import java.sql.DriverManager;
|
|
||||||
import java.sql.PreparedStatement;
|
|
||||||
import java.sql.ResultSet;
|
|
||||||
import java.util.Properties;
|
|
||||||
|
|
||||||
import javax.ws.rs.GET;
|
|
||||||
import javax.ws.rs.Path;
|
|
||||||
import javax.ws.rs.PathParam;
|
|
||||||
import javax.ws.rs.Produces;
|
|
||||||
import javax.ws.rs.core.MediaType;
|
|
||||||
import javax.ws.rs.core.Response;
|
|
||||||
import javax.ws.rs.client.Client;
|
|
||||||
import javax.ws.rs.client.ClientBuilder;
|
|
||||||
import javax.ws.rs.client.WebTarget;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStream;
|
|
||||||
|
|
||||||
import org.json.JSONObject;
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
|
|
||||||
@Path("/proximis")
|
|
||||||
public class ProximisService {
|
|
||||||
private static final Logger logger = LoggerFactory.getLogger(ProximisService.class);
|
|
||||||
|
|
||||||
@GET
|
|
||||||
@Path("/project/fulfillment/{orderCode}")
|
|
||||||
@Produces(MediaType.APPLICATION_JSON)
|
|
||||||
public Response getOrderDetail(@PathParam("orderCode") String orderCode) {
|
|
||||||
if (orderCode == null) {
|
|
||||||
return Response.status(Response.Status.BAD_REQUEST).entity("{\"error\":\"orderCode is required\"}").build();
|
|
||||||
}
|
|
||||||
|
|
||||||
String environment = loadEnvironment();
|
|
||||||
|
|
||||||
try {
|
|
||||||
Properties apiProperties = loadApiProperties();
|
|
||||||
String url = apiProperties.getProperty(environment + ".proximis.api.url");
|
|
||||||
String urlApp = apiProperties.getProperty(environment + ".proximis.app.url");
|
|
||||||
String bearerToken = "";
|
|
||||||
|
|
||||||
DriverManager.setLoginTimeout(5); // Définir le timeout à 5 secondes
|
|
||||||
|
|
||||||
try (DatabaseConnectOBI databaseConnection = new DatabaseConnectOBI()) {
|
|
||||||
String query = "SELECT authorization_value FROM obi.obi_param_access_token WHERE authorization_header = ?"
|
|
||||||
+ " and cloud_type = 'PROXIMIS' AND application = 'OBI_ACCESS_TOKEN' AND version = 'V2'";
|
|
||||||
|
|
||||||
logger.info(query);
|
|
||||||
|
|
||||||
PreparedStatement stmt = databaseConnection.getConnection().prepareStatement(query);
|
|
||||||
|
|
||||||
stmt.setString(1, "Authorization");
|
|
||||||
ResultSet rs = stmt.executeQuery();
|
|
||||||
|
|
||||||
if (rs.next()) {
|
|
||||||
bearerToken = rs.getString(1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (bearerToken == null || bearerToken.isEmpty()) {
|
|
||||||
return Response.status(Response.Status.NOT_FOUND).entity("{\"error\":\"Empty bearer token\"}").build();
|
|
||||||
} else {
|
|
||||||
Client client = ClientBuilder.newClient();
|
|
||||||
WebTarget target = client.target(url + "/project/fulfillment/" + orderCode);
|
|
||||||
Response response = target.request(MediaType.APPLICATION_JSON)
|
|
||||||
.header("Authorization", bearerToken)
|
|
||||||
.get();
|
|
||||||
|
|
||||||
try {
|
|
||||||
if (response.getStatus() == 200) {
|
|
||||||
JSONObject commonObject = new JSONObject();
|
|
||||||
commonObject.put("urlApp", urlApp);
|
|
||||||
|
|
||||||
JSONObject jsonResponse = new JSONObject();
|
|
||||||
jsonResponse.put("common", commonObject);
|
|
||||||
jsonResponse.put("oms", new JSONObject(response.readEntity(String.class)));
|
|
||||||
|
|
||||||
return Response.ok(jsonResponse.toString()).build();
|
|
||||||
} else if (response.getStatus() == 401) {
|
|
||||||
return Response.status(Response.Status.UNAUTHORIZED).entity("{\"error\":\"Invalid token\"}").build();
|
|
||||||
} else {
|
|
||||||
return Response.status(Response.Status.NOT_FOUND).entity("{\"error\":\"Failed to get order detail\"}").build();
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
return Response.serverError().entity("{\"error\":\"Failed to communicate with server\"}").build();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
return Response.status(Response.Status.SERVICE_UNAVAILABLE).entity("{\"error\":\"Unexpected error\"}").build();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private String loadEnvironment() {
|
|
||||||
Properties envProperties = loadProperties("env.properties");
|
|
||||||
return envProperties.getProperty("environment");
|
|
||||||
}
|
|
||||||
|
|
||||||
private Properties loadApiProperties() {
|
|
||||||
Properties apiProperties = loadProperties("api.properties");
|
|
||||||
return apiProperties;
|
|
||||||
}
|
|
||||||
private Properties loadProperties(String fileName) {
|
|
||||||
Properties properties = new Properties();
|
|
||||||
try (InputStream input = getClass().getClassLoader().getResourceAsStream(fileName)) {
|
|
||||||
properties.load(input);
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
// Handle the exception correctly for your application
|
|
||||||
}
|
|
||||||
return properties;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -76,7 +76,6 @@ public class StoreService {
|
||||||
" WHERE st.id_structure = ?";
|
" WHERE st.id_structure = ?";
|
||||||
|
|
||||||
logger.info(query);
|
logger.info(query);
|
||||||
|
|
||||||
try (PreparedStatement statement = databaseConnection.getConnection().prepareStatement(query)) {
|
try (PreparedStatement statement = databaseConnection.getConnection().prepareStatement(query)) {
|
||||||
statement.setString(1, storeId);
|
statement.setString(1, storeId);
|
||||||
|
|
||||||
|
|
@ -179,16 +178,15 @@ public class StoreService {
|
||||||
" AND hsc2.id_caisse BETWEEN 20 AND 39) AS caisses," +
|
" AND hsc2.id_caisse BETWEEN 20 AND 39) AS caisses," +
|
||||||
" REPLACE(REPLACE(TRIM(st.adresse1), chr(10), ''), chr(13), '') AS adresse," +
|
" REPLACE(REPLACE(TRIM(st.adresse1), chr(10), ''), chr(13), '') AS adresse," +
|
||||||
" axs.date_stock as date_migration" +
|
" axs.date_stock as date_migration" +
|
||||||
" FROM com02.STRUCTURE st" +
|
" FROM COM02.structure st" +
|
||||||
" JOIN omni.ASPD_XSTO_STRUCTURE axs ON st.ID_STRUCTURE = axs.ID_STRUCTURE" +
|
|
||||||
" JOIN com02.PARAM_PAYS pp ON pp.id_pays = st.id_pays" +
|
" JOIN com02.PARAM_PAYS pp ON pp.id_pays = st.id_pays" +
|
||||||
" LEFT OUTER JOIN mobretail.mp_etab_param metabp ON metabp.id_etab = st.id_structure" +
|
" LEFT OUTER JOIN mobretail.mp_etab_param metabp ON metabp.id_etab = st.id_structure" +
|
||||||
" LEFT OUTER JOIN mobretail.mr_photo mpprinc ON mpprinc.id_photo = metabp.id_photo_principale" +
|
" LEFT OUTER JOIN mobretail.mr_photo mpprinc ON mpprinc.id_photo = metabp.id_photo_principale" +
|
||||||
" WHERE axs.date_stock is not null AND st.id_niveau=4 AND st.statut=2 AND st.id_canal_distribution = 1" +
|
" LEFT OUTER JOIN omni.ASPD_XSTO_STRUCTURE axs ON st.ID_STRUCTURE = axs.ID_STRUCTURE" +
|
||||||
|
" WHERE axs.date_stock is not null AND st.ID_NIVEAU=4 AND st.STATUT=2 AND st.id_canal_distribution = 1 and st.magasin_demo = 0" +
|
||||||
" ORDER BY st.id_structure";
|
" ORDER BY st.id_structure";
|
||||||
|
|
||||||
logger.info(query);
|
logger.info(query);
|
||||||
|
|
||||||
try (PreparedStatement statement = databaseConnection.getConnection().prepareStatement(query);
|
try (PreparedStatement statement = databaseConnection.getConnection().prepareStatement(query);
|
||||||
ResultSet resultSet = statement.executeQuery()) {
|
ResultSet resultSet = statement.executeQuery()) {
|
||||||
|
|
||||||
|
|
@ -232,7 +230,6 @@ public class StoreService {
|
||||||
"ORDER BY WKSTN_ID, SEQUENCE_ID";
|
"ORDER BY WKSTN_ID, SEQUENCE_ID";
|
||||||
|
|
||||||
logger.info(query);
|
logger.info(query);
|
||||||
|
|
||||||
try (PreparedStatement statement = databaseConnection.getConnection().prepareStatement(query)) {
|
try (PreparedStatement statement = databaseConnection.getConnection().prepareStatement(query)) {
|
||||||
ResultSet resultSet = statement.executeQuery();
|
ResultSet resultSet = statement.executeQuery();
|
||||||
|
|
||||||
|
|
@ -285,7 +282,6 @@ public class StoreService {
|
||||||
"ORDER BY WKSTN_ID";
|
"ORDER BY WKSTN_ID";
|
||||||
|
|
||||||
logger.info(query);
|
logger.info(query);
|
||||||
|
|
||||||
try (PreparedStatement statement = databaseConnection.getConnection().prepareStatement(query)) {
|
try (PreparedStatement statement = databaseConnection.getConnection().prepareStatement(query)) {
|
||||||
ResultSet resultSet = statement.executeQuery();
|
ResultSet resultSet = statement.executeQuery();
|
||||||
|
|
||||||
|
|
@ -339,8 +335,7 @@ public class StoreService {
|
||||||
"WHERE organization_id = 1 AND customer IS NOT NULL " +
|
"WHERE organization_id = 1 AND customer IS NOT NULL " +
|
||||||
"ORDER BY seq DESC";
|
"ORDER BY seq DESC";
|
||||||
|
|
||||||
logger.info(query);
|
logger.info(query);
|
||||||
|
|
||||||
try (PreparedStatement statement = databaseConnection.getConnection().prepareStatement(query)) {
|
try (PreparedStatement statement = databaseConnection.getConnection().prepareStatement(query)) {
|
||||||
ResultSet resultSet = statement.executeQuery();
|
ResultSet resultSet = statement.executeQuery();
|
||||||
|
|
||||||
|
|
@ -454,7 +449,6 @@ public class StoreService {
|
||||||
"ORDER BY cel.CREATE_DATE DESC";
|
"ORDER BY cel.CREATE_DATE DESC";
|
||||||
|
|
||||||
logger.info(query);
|
logger.info(query);
|
||||||
|
|
||||||
try (PreparedStatement statement = databaseConnection.getConnection().prepareStatement(query)) {
|
try (PreparedStatement statement = databaseConnection.getConnection().prepareStatement(query)) {
|
||||||
statement.setString(1, logDate + " 00:00:00");
|
statement.setString(1, logDate + " 00:00:00");
|
||||||
statement.setString(2, logDate + " 23:59:59");
|
statement.setString(2, logDate + " 23:59:59");
|
||||||
|
|
@ -665,7 +659,6 @@ public class StoreService {
|
||||||
" WHERE st.id_structure = ?";
|
" WHERE st.id_structure = ?";
|
||||||
|
|
||||||
logger.info(storeQuery);
|
logger.info(storeQuery);
|
||||||
|
|
||||||
try (PreparedStatement storeStatement = databaseConnectionDS.getConnection().prepareStatement(storeQuery)) {
|
try (PreparedStatement storeStatement = databaseConnectionDS.getConnection().prepareStatement(storeQuery)) {
|
||||||
storeStatement.setInt(1, storeId); // Set the value of the parameter
|
storeStatement.setInt(1, storeId); // Set the value of the parameter
|
||||||
|
|
||||||
|
|
@ -692,7 +685,6 @@ public class StoreService {
|
||||||
|
|
||||||
for (StorePos pos : storeDetails.getPos()) {
|
for (StorePos pos : storeDetails.getPos()) {
|
||||||
logger.info(boTransactionQuery);
|
logger.info(boTransactionQuery);
|
||||||
|
|
||||||
try (PreparedStatement boTransactionStatement = databaseConnectionDS.getConnection().prepareStatement(boTransactionQuery)) {
|
try (PreparedStatement boTransactionStatement = databaseConnectionDS.getConnection().prepareStatement(boTransactionQuery)) {
|
||||||
boTransactionStatement.setInt(1, storeId);
|
boTransactionStatement.setInt(1, storeId);
|
||||||
boTransactionStatement.setInt(2, pos.getWorkstationId());
|
boTransactionStatement.setInt(2, pos.getWorkstationId());
|
||||||
|
|
@ -728,7 +720,6 @@ public class StoreService {
|
||||||
"WHERE crq.organization_id = 1 AND crq.RTL_LOC_ID = ? and crq.WKSTN_ID = ?";
|
"WHERE crq.organization_id = 1 AND crq.RTL_LOC_ID = ? and crq.WKSTN_ID = ?";
|
||||||
|
|
||||||
logger.info(replicationQuery);
|
logger.info(replicationQuery);
|
||||||
|
|
||||||
try (PreparedStatement replicationStatement = databaseConnection.getConnection().prepareStatement(replicationQuery)) {
|
try (PreparedStatement replicationStatement = databaseConnection.getConnection().prepareStatement(replicationQuery)) {
|
||||||
replicationStatement.setInt(1, storeId);
|
replicationStatement.setInt(1, storeId);
|
||||||
replicationStatement.setInt(2, workstationId);
|
replicationStatement.setInt(2, workstationId);
|
||||||
|
|
@ -755,8 +746,7 @@ public class StoreService {
|
||||||
"AND lsj.STRING_VALUE = 'OPEN'";
|
"AND lsj.STRING_VALUE = 'OPEN'";
|
||||||
|
|
||||||
logger.info(openingQuery);
|
logger.info(openingQuery);
|
||||||
|
try (PreparedStatement openingStatement = databaseConnection.getConnection().prepareStatement(openingQuery)) {
|
||||||
try (PreparedStatement openingStatement = databaseConnection.getConnection().prepareStatement(openingQuery)) {
|
|
||||||
openingStatement.setInt(1, storeId);
|
openingStatement.setInt(1, storeId);
|
||||||
openingStatement.setInt(2, workstationId);
|
openingStatement.setInt(2, workstationId);
|
||||||
|
|
||||||
|
|
@ -781,8 +771,7 @@ public class StoreService {
|
||||||
"AND lsj.STRING_VALUE = 'CLOSED'";
|
"AND lsj.STRING_VALUE = 'CLOSED'";
|
||||||
|
|
||||||
logger.info(closingQuery);
|
logger.info(closingQuery);
|
||||||
|
try (PreparedStatement closingStatement = databaseConnection.getConnection().prepareStatement(closingQuery)) {
|
||||||
try (PreparedStatement closingStatement = databaseConnection.getConnection().prepareStatement(closingQuery)) {
|
|
||||||
closingStatement.setInt(1, storeId);
|
closingStatement.setInt(1, storeId);
|
||||||
closingStatement.setInt(2, workstationId);
|
closingStatement.setInt(2, workstationId);
|
||||||
|
|
||||||
|
|
@ -808,8 +797,7 @@ public class StoreService {
|
||||||
"AND tt.trans_TYPCODE = 'RETAIL_SALE' " +
|
"AND tt.trans_TYPCODE = 'RETAIL_SALE' " +
|
||||||
"AND tt.TRANS_STATCODE = 'COMPLETE'";
|
"AND tt.TRANS_STATCODE = 'COMPLETE'";
|
||||||
|
|
||||||
logger.info(saleTransactionQuery);
|
logger.info(saleTransactionQuery);
|
||||||
|
|
||||||
try (PreparedStatement saleTransactionStatement = databaseConnection.getConnection().prepareStatement(saleTransactionQuery)) {
|
try (PreparedStatement saleTransactionStatement = databaseConnection.getConnection().prepareStatement(saleTransactionQuery)) {
|
||||||
saleTransactionStatement.setInt(1, storeId);
|
saleTransactionStatement.setInt(1, storeId);
|
||||||
saleTransactionStatement.setDate(2, pos.getBusinessDate());
|
saleTransactionStatement.setDate(2, pos.getBusinessDate());
|
||||||
|
|
@ -835,7 +823,6 @@ public class StoreService {
|
||||||
"AND cel.LOG_LEVEL = 'FATAL'";
|
"AND cel.LOG_LEVEL = 'FATAL'";
|
||||||
|
|
||||||
logger.info(logQuery);
|
logger.info(logQuery);
|
||||||
|
|
||||||
try (PreparedStatement logStatement = databaseConnection.getConnection().prepareStatement(logQuery)) {
|
try (PreparedStatement logStatement = databaseConnection.getConnection().prepareStatement(logQuery)) {
|
||||||
logStatement.setInt(1, storeId);
|
logStatement.setInt(1, storeId);
|
||||||
logStatement.setInt(2, workstationId);
|
logStatement.setInt(2, workstationId);
|
||||||
|
|
|
||||||
|
|
@ -1,502 +0,0 @@
|
||||||
package com.example.services.order;
|
|
||||||
|
|
||||||
import java.time.ZoneId;
|
|
||||||
import java.time.format.DateTimeFormatter;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
import java.sql.Timestamp;
|
|
||||||
public class Order {
|
|
||||||
private Meta meta;
|
|
||||||
private Common common;
|
|
||||||
private List<Lines> lines = new ArrayList<>();
|
|
||||||
private List<History> history = new ArrayList<>();
|
|
||||||
private List<Preparation> preparations = new ArrayList<>();
|
|
||||||
private List<Reception> receptions = new ArrayList<>();
|
|
||||||
|
|
||||||
// getters and setters for Order
|
|
||||||
public Meta getMeta() { return meta; }
|
|
||||||
public void setMeta(Meta meta) { this.meta = meta; }
|
|
||||||
public Common getCommon() { return common; }
|
|
||||||
public void setCommon(Common common) { this.common = common; }
|
|
||||||
public List<Lines> getLines() { return lines; }
|
|
||||||
public void setLines(List<Lines> lines) { this.lines = lines; }
|
|
||||||
public List<History> getHistory() { return history; }
|
|
||||||
public void setHistory(List<History> history) { this.history = history; }
|
|
||||||
public List<Preparation> getPreparations() { return preparations; }
|
|
||||||
public void setPreparations(List<Preparation> preparation) { this.preparations = preparation; }
|
|
||||||
public List<Reception> getReceptions() { return receptions; }
|
|
||||||
public void setReceptions(List<Reception> reception) { this.receptions = reception; }
|
|
||||||
|
|
||||||
public static class Meta {
|
|
||||||
private long id;
|
|
||||||
|
|
||||||
// getters and setters
|
|
||||||
|
|
||||||
public String getModel() {
|
|
||||||
return "Order";
|
|
||||||
}
|
|
||||||
|
|
||||||
public long getId() {
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setId(long id) {
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public class Common {
|
|
||||||
private String orderId;
|
|
||||||
private String requestingLocationCd;
|
|
||||||
private String requestingSystemCd;
|
|
||||||
private String customerId;
|
|
||||||
private String submitOrdMsg;
|
|
||||||
private Timestamp fdateCreation;
|
|
||||||
private boolean consumed;
|
|
||||||
private String shipforpickupLocationCd;
|
|
||||||
private String shipforpickupSystemCd;
|
|
||||||
private StatusData statusData;
|
|
||||||
private Transaction transaction;
|
|
||||||
|
|
||||||
// getters for Common
|
|
||||||
public String getOrderId() { return orderId; }
|
|
||||||
public String getRequestingLocationCd() { return requestingLocationCd; }
|
|
||||||
public String getRequestingSystemCd() { return requestingSystemCd; }
|
|
||||||
public String getCustomerId() { return customerId; }
|
|
||||||
public String getSubmitOrdMsg() { return submitOrdMsg; }
|
|
||||||
public String getFdateCreation() {
|
|
||||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ssXXX")
|
|
||||||
.withZone(ZoneId.of("Europe/Paris"));
|
|
||||||
|
|
||||||
return fdateCreation != null ? formatter.format(fdateCreation.toInstant()) : "";
|
|
||||||
}
|
|
||||||
public boolean isConsumed() { return consumed; }
|
|
||||||
public String getShipforpickupLocationCd() { return shipforpickupLocationCd; }
|
|
||||||
public String getShipforpickupSystemCd() { return shipforpickupSystemCd; }
|
|
||||||
|
|
||||||
// setters for Common
|
|
||||||
public void setOrderId(String orderId) { this.orderId = orderId; }
|
|
||||||
public void setRequestingLocationCd(String requestingLocationCd) { this.requestingLocationCd = requestingLocationCd; }
|
|
||||||
public void setRequestingSystemCd(String requestingSystemCd) { this.requestingSystemCd = requestingSystemCd; }
|
|
||||||
public void setCustomerId(String customerId) { this.customerId = customerId; }
|
|
||||||
public void setSubmitOrdMsg(String submitOrdMsg) { this.submitOrdMsg = submitOrdMsg; }
|
|
||||||
public void setFdateCreation(Timestamp fdateCreation) { this.fdateCreation = fdateCreation; }
|
|
||||||
public void setConsumed(boolean consumed) { this.consumed = consumed; }
|
|
||||||
public void setShipforpickupLocationCd(String shipforpickupLocationCd) { this.shipforpickupLocationCd = shipforpickupLocationCd; }
|
|
||||||
public void setShipforpickupSystemCd(String shipforpickupSystemCd) { this.shipforpickupSystemCd = shipforpickupSystemCd; }
|
|
||||||
|
|
||||||
public class StatusData {
|
|
||||||
private String code;
|
|
||||||
private String title;
|
|
||||||
|
|
||||||
// getters for StatusData
|
|
||||||
public String getCode() { return code; }
|
|
||||||
public String getTitle() { return title; }
|
|
||||||
|
|
||||||
// setters for StatusData
|
|
||||||
public void setCode(String code) { this.code = code; }
|
|
||||||
public void setTitle(String title) { this.title = title; }
|
|
||||||
}
|
|
||||||
|
|
||||||
// getters for order/statusdata
|
|
||||||
public StatusData getStatusData() { return statusData; }
|
|
||||||
|
|
||||||
// setters for order/statusdata
|
|
||||||
public void setStatusData(StatusData statusData) { this.statusData = statusData; }
|
|
||||||
|
|
||||||
public class Transaction {
|
|
||||||
private Integer transactionTypeId;
|
|
||||||
private Timestamp transactionDate;
|
|
||||||
private String transactionNo;
|
|
||||||
private String transactionTypeDescription;
|
|
||||||
|
|
||||||
// getters for Transaction
|
|
||||||
public Integer getTransactionTypeId() { return transactionTypeId; }
|
|
||||||
public String getTransactionDate() {
|
|
||||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ssXXX")
|
|
||||||
.withZone(ZoneId.of("Europe/Paris"));
|
|
||||||
|
|
||||||
return transactionDate != null ? formatter.format(transactionDate.toInstant()) : "";
|
|
||||||
}
|
|
||||||
public String getTransactionNo() { return transactionNo; }
|
|
||||||
public String getTransactionTypeDescription() { return transactionTypeDescription; }
|
|
||||||
|
|
||||||
// setters for Transaction
|
|
||||||
public void setTransactionTypeId(Integer transactionTypeId) { this.transactionTypeId = transactionTypeId; }
|
|
||||||
public void setTransactionDate(Timestamp transactionDate) { this.transactionDate = transactionDate; }
|
|
||||||
public void setTransactionNo(String transactionNo) { this.transactionNo = transactionNo; }
|
|
||||||
public void setTransactionTypeDescription(String transactionTypeDescription) { this.transactionTypeDescription = transactionTypeDescription; }
|
|
||||||
}
|
|
||||||
|
|
||||||
// getters for order/transaction
|
|
||||||
public Transaction getTransaction() { return transaction; }
|
|
||||||
|
|
||||||
// setters for order/transaction
|
|
||||||
public void setTransaction(Transaction transaction) { this.transaction = transaction; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public class Lines {
|
|
||||||
private Long lineOrderId;
|
|
||||||
private Integer lineItemNo;
|
|
||||||
private String orderId;
|
|
||||||
private Long requestId;
|
|
||||||
private String lineItemOms;
|
|
||||||
private String itemId;
|
|
||||||
private Integer orderedLineQty;
|
|
||||||
private String status;
|
|
||||||
private Timestamp transactionDate;
|
|
||||||
private String shippingAgent;
|
|
||||||
private String trackingNumber;
|
|
||||||
private String fulfillmentId;
|
|
||||||
private String cartonNumber;
|
|
||||||
private Timestamp fdateCreation;
|
|
||||||
private Boolean consumed;
|
|
||||||
private List<History> history = new ArrayList<>();
|
|
||||||
|
|
||||||
// getters
|
|
||||||
public Long getLineOrderId() { return lineOrderId; }
|
|
||||||
public Integer getLineItemNo() { return lineItemNo; }
|
|
||||||
public String getOrderId() { return orderId; }
|
|
||||||
public Long getRequestId() { return requestId; }
|
|
||||||
public String getLineItemOms() { return lineItemOms; }
|
|
||||||
public String getItemId() { return itemId; }
|
|
||||||
public Integer getOrderedLineQty() { return orderedLineQty; }
|
|
||||||
public String getStatus() { return status; }
|
|
||||||
public Timestamp getTransactionDate() { return transactionDate; }
|
|
||||||
public String getShippingAgent() { return shippingAgent; }
|
|
||||||
public String getTrackingNumber() { return trackingNumber; }
|
|
||||||
public String getFulfillmentId() { return fulfillmentId; }
|
|
||||||
public String getCartonNumber() { return cartonNumber; }
|
|
||||||
public Timestamp getFdateCreation() { return fdateCreation; }
|
|
||||||
public Boolean isConsumed() { return consumed; }
|
|
||||||
public List<History> getHistory() { return history; }
|
|
||||||
|
|
||||||
// setters
|
|
||||||
public void setLineOrderId(Long lineOrderId) { this.lineOrderId = lineOrderId; }
|
|
||||||
public void setLineItemNo(Integer lineItemNo) { this.lineItemNo = lineItemNo; }
|
|
||||||
public void setOrderId(String orderId) { this.orderId = orderId; }
|
|
||||||
public void setRequestId(Long requestId) { this.requestId = requestId; }
|
|
||||||
public void setLineItemOms(String lineItemOms) { this.lineItemOms = lineItemOms; }
|
|
||||||
public void setItemId(String itemId) { this.itemId = itemId; }
|
|
||||||
public void setOrderedLineQty(Integer orderedLineQty) { this.orderedLineQty = orderedLineQty; }
|
|
||||||
public void setStatus(String status) { this.status = status; }
|
|
||||||
public void setTransactionDate(Timestamp transactionDate) { this.transactionDate = transactionDate; }
|
|
||||||
public void setShippingAgent(String shippingAgent) { this.shippingAgent = shippingAgent; }
|
|
||||||
public void setTrackingNumber(String trackingNumber) { this.trackingNumber = trackingNumber; }
|
|
||||||
public void setFulfillmentId(String fulfillmentId) { this.fulfillmentId = fulfillmentId; }
|
|
||||||
public void setCartonNumber(String cartonNumber) { this.cartonNumber = cartonNumber; }
|
|
||||||
public void setFdateCreation(Timestamp fdateCreation) { this.fdateCreation = fdateCreation; }
|
|
||||||
public void setConsumed(Boolean consumed) { this.consumed = consumed; }
|
|
||||||
public void setHistory(List<History> history) { this.history = history; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public class History {
|
|
||||||
private Integer statusId;
|
|
||||||
private Long Id;
|
|
||||||
private String status;
|
|
||||||
private Timestamp transactionDate;
|
|
||||||
private Timestamp fdateCreation;
|
|
||||||
|
|
||||||
// Getters
|
|
||||||
public Integer getStatusId() { return statusId; }
|
|
||||||
public Long getId() { return Id; }
|
|
||||||
public String getStatus() { return status; }
|
|
||||||
public String getTransactionDate() {
|
|
||||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ssXXX")
|
|
||||||
.withZone(ZoneId.of("Europe/Paris"));
|
|
||||||
|
|
||||||
return fdateCreation != null ? formatter.format(transactionDate.toInstant()) : "";
|
|
||||||
}
|
|
||||||
public String getFdateCreation() {
|
|
||||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ssXXX")
|
|
||||||
.withZone(ZoneId.of("Europe/Paris"));
|
|
||||||
|
|
||||||
return fdateCreation != null ? formatter.format(fdateCreation.toInstant()) : "";
|
|
||||||
}
|
|
||||||
|
|
||||||
// Setters
|
|
||||||
public void setStatusId(Integer statusId) { this.statusId = statusId; }
|
|
||||||
public void setId(Long Id) { this.Id = Id; }
|
|
||||||
public void setStatus(String status) { this.status = status; }
|
|
||||||
public void setTransactionDate(Timestamp transactionDate) { this.transactionDate = transactionDate; }
|
|
||||||
public void setFdateCreation(Timestamp fdateCreation) { this.fdateCreation = fdateCreation; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public class Preparation {
|
|
||||||
private Integer prepIntId;
|
|
||||||
private Integer prepId;
|
|
||||||
private String orderId;
|
|
||||||
private Long requestId;
|
|
||||||
private Timestamp transactionDate;
|
|
||||||
private String fulfillmentSystemCd;
|
|
||||||
private String fulfillmentLocationCd;
|
|
||||||
private String status;
|
|
||||||
private Timestamp datePreparation;
|
|
||||||
private Timestamp fdateCreation;
|
|
||||||
private List<PreparationLines> lines = new ArrayList<>();
|
|
||||||
|
|
||||||
public List<PreparationLines> getLines() { return lines; }
|
|
||||||
public void setLines(List<PreparationLines> lines) { this.lines = lines; }
|
|
||||||
|
|
||||||
// Getters
|
|
||||||
public Integer getPrepIntId() { return prepIntId; }
|
|
||||||
public Integer getPrepId() { return prepId; }
|
|
||||||
public String getOrderId() { return orderId; }
|
|
||||||
public Long getRequestId() { return requestId; }
|
|
||||||
public String getTransactionDate() {
|
|
||||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ssXXX")
|
|
||||||
.withZone(ZoneId.of("Europe/Paris"));
|
|
||||||
|
|
||||||
return transactionDate != null ? formatter.format(transactionDate.toInstant()) : "";
|
|
||||||
}
|
|
||||||
public String getFulfillmentSystemCd() { return fulfillmentSystemCd; }
|
|
||||||
public String getFulfillmentLocationCd() { return fulfillmentLocationCd; }
|
|
||||||
public String getStatus() { return status; }
|
|
||||||
public String getDatePreparation() {
|
|
||||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ssXXX")
|
|
||||||
.withZone(ZoneId.of("Europe/Paris"));
|
|
||||||
|
|
||||||
return datePreparation != null ? formatter.format(datePreparation.toInstant()) : "";
|
|
||||||
}
|
|
||||||
public String getFdateCreation() {
|
|
||||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ssXXX")
|
|
||||||
.withZone(ZoneId.of("Europe/Paris"));
|
|
||||||
|
|
||||||
return fdateCreation != null ? formatter.format(fdateCreation.toInstant()) : "";
|
|
||||||
}
|
|
||||||
|
|
||||||
// Setters
|
|
||||||
public void setPrepIntId(Integer prepIntId) { this.prepIntId = prepIntId; }
|
|
||||||
public void setPrepId(Integer prepId) { this.prepId = prepId; }
|
|
||||||
public void setOrderId(String orderId) { this.orderId = orderId; }
|
|
||||||
public void setRequestId(Long requestId) { this.requestId = requestId; }
|
|
||||||
public void setTransactionDate(Timestamp transactionDate) { this.transactionDate = transactionDate; }
|
|
||||||
public void setFulfillmentSystemCd(String fulfillmentSystemCd) { this.fulfillmentSystemCd = fulfillmentSystemCd; }
|
|
||||||
public void setFulfillmentLocationCd(String fulfillmentLocationCd) { this.fulfillmentLocationCd = fulfillmentLocationCd; }
|
|
||||||
public void setStatus(String status) { this.status = status; }
|
|
||||||
public void setDatePreparation(Timestamp datePreparation) { this.datePreparation = datePreparation; }
|
|
||||||
public void setFdateCreation(Timestamp fdateCreation) { this.fdateCreation = fdateCreation; }
|
|
||||||
|
|
||||||
public class PreparationLines {
|
|
||||||
private Integer lineFulfillId;
|
|
||||||
private Integer lineOrderId;
|
|
||||||
private Integer prepIntId;
|
|
||||||
private String orderId;
|
|
||||||
private Long requestId;
|
|
||||||
private Timestamp transactionDate;
|
|
||||||
private Integer lineItemNo;
|
|
||||||
private String itemId;
|
|
||||||
private String lineItemOms;
|
|
||||||
private Integer fulfillQty;
|
|
||||||
private Integer validatedFulfillQty;
|
|
||||||
private String fulfillmentSystemCd;
|
|
||||||
private String fulfillmentLocationCd;
|
|
||||||
private String status;
|
|
||||||
private String numeroExpedition;
|
|
||||||
private String seasonCode;
|
|
||||||
private String finitionSpeciale;
|
|
||||||
private String carrier;
|
|
||||||
private String trackingCode;
|
|
||||||
private String trackingUrl;
|
|
||||||
private Timestamp fdateCreation;
|
|
||||||
private Timestamp fdateModification;
|
|
||||||
private Boolean toOrlixConsumed;
|
|
||||||
private String restockingCode;
|
|
||||||
|
|
||||||
// Getters
|
|
||||||
public Integer getLineFulfillId() { return lineFulfillId; }
|
|
||||||
public Integer getLineOrderId() { return lineOrderId; }
|
|
||||||
public Integer getPrepIntId() { return prepIntId; }
|
|
||||||
public String getOrderId() { return orderId; }
|
|
||||||
public Long getRequestId() { return requestId; }
|
|
||||||
|
|
||||||
public String getTransactionDate() {
|
|
||||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ssXXX")
|
|
||||||
.withZone(ZoneId.of("Europe/Paris"));
|
|
||||||
return transactionDate != null ? formatter.format(transactionDate.toInstant()) : "";
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getLineItemNo() { return lineItemNo; }
|
|
||||||
public String getItemId() { return itemId; }
|
|
||||||
public String getLineItemOms() { return lineItemOms; }
|
|
||||||
public Integer getFulfillQty() { return fulfillQty; }
|
|
||||||
public Integer getValidatedFulfillQty() { return validatedFulfillQty; }
|
|
||||||
public String getFulfillmentSystemCd() { return fulfillmentSystemCd; }
|
|
||||||
public String getFulfillmentLocationCd() { return fulfillmentLocationCd; }
|
|
||||||
public String getStatus() { return status; }
|
|
||||||
public String getNumeroExpedition() { return numeroExpedition; }
|
|
||||||
public String getSeasonCode() { return seasonCode; }
|
|
||||||
public String getFinitionSpeciale() { return finitionSpeciale; }
|
|
||||||
public String getCarrier() { return carrier; }
|
|
||||||
public String getTrackingCode() { return trackingCode; }
|
|
||||||
public String getTrackingUrl() { return trackingUrl; }
|
|
||||||
|
|
||||||
public String getFdateCreation() {
|
|
||||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ssXXX")
|
|
||||||
.withZone(ZoneId.of("Europe/Paris"));
|
|
||||||
return fdateCreation != null ? formatter.format(fdateCreation.toInstant()) : "";
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getFdateModification() {
|
|
||||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ssXXX")
|
|
||||||
.withZone(ZoneId.of("Europe/Paris"));
|
|
||||||
return fdateModification != null ? formatter.format(fdateModification.toInstant()) : "";
|
|
||||||
}
|
|
||||||
|
|
||||||
public Boolean getToOrlixConsumed() { return toOrlixConsumed; }
|
|
||||||
public String getRestockingCode() { return restockingCode; }
|
|
||||||
|
|
||||||
// Setters
|
|
||||||
public void setLineFulfillId(Integer lineFulfillId) { this.lineFulfillId = lineFulfillId; }
|
|
||||||
public void setLineOrderId(Integer lineOrderId) { this.lineOrderId = lineOrderId; }
|
|
||||||
public void setPrepIntId(Integer prepIntId) { this.prepIntId = prepIntId; }
|
|
||||||
public void setOrderId(String orderId) { this.orderId = orderId; }
|
|
||||||
public void setRequestId(Long requestId) { this.requestId = requestId; }
|
|
||||||
public void setTransactionDate(Timestamp transactionDate) { this.transactionDate = transactionDate; }
|
|
||||||
public void setLineItemNo(Integer lineItemNo) { this.lineItemNo = lineItemNo; }
|
|
||||||
public void setItemId(String itemId) { this.itemId = itemId; }
|
|
||||||
public void setLineItemOms(String lineItemOms) { this.lineItemOms = lineItemOms; }
|
|
||||||
public void setFulfillQty(Integer fulfillQty) { this.fulfillQty = fulfillQty; }
|
|
||||||
public void setValidatedFulfillQty(Integer validatedFulfillQty) { this.validatedFulfillQty = validatedFulfillQty; }
|
|
||||||
public void setFulfillmentSystemCd(String fulfillmentSystemCd) { this.fulfillmentSystemCd = fulfillmentSystemCd; }
|
|
||||||
public void setFulfillmentLocationCd(String fulfillmentLocationCd) { this.fulfillmentLocationCd = fulfillmentLocationCd; }
|
|
||||||
public void setStatus(String status) { this.status = status; }
|
|
||||||
public void setNumeroExpedition(String numeroExpedition) { this.numeroExpedition = numeroExpedition; }
|
|
||||||
public void setSeasonCode(String seasonCode) { this.seasonCode = seasonCode; }
|
|
||||||
public void setFinitionSpeciale(String finitionSpeciale) { this.finitionSpeciale = finitionSpeciale; }
|
|
||||||
public void setCarrier(String carrier) { this.carrier = carrier; }
|
|
||||||
public void setTrackingCode(String trackingCode) { this.trackingCode = trackingCode; }
|
|
||||||
public void setTrackingUrl(String trackingUrl) { this.trackingUrl = trackingUrl; }
|
|
||||||
public void setFdateCreation(Timestamp fdateCreation) { this.fdateCreation = fdateCreation; }
|
|
||||||
public void setFdateModification(Timestamp fdateModification) { this.fdateModification = fdateModification; }
|
|
||||||
public void setToOrlixConsumed(Boolean toOrlixConsumed) { this.toOrlixConsumed = toOrlixConsumed; }
|
|
||||||
public void setRestockingCode(String restockingCode) { this.restockingCode = restockingCode; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public class Reception {
|
|
||||||
private int intransitIntId;
|
|
||||||
private String intransitId;
|
|
||||||
private int prepIntId;
|
|
||||||
private String orderId;
|
|
||||||
private long requestId;
|
|
||||||
private String status;
|
|
||||||
private Timestamp transactionDate;
|
|
||||||
private String intransitSystemCd;
|
|
||||||
private String intransitLocationCd;
|
|
||||||
private Timestamp fdateReceipt;
|
|
||||||
private Timestamp fdateCreation;
|
|
||||||
private List<ReceptionLines> lines = new ArrayList<>();
|
|
||||||
|
|
||||||
public List<ReceptionLines> getLines() { return lines; }
|
|
||||||
public void setLines(List<ReceptionLines> lines) { this.lines = lines; }
|
|
||||||
|
|
||||||
// Getters
|
|
||||||
public int getIntransitIntId() { return intransitIntId; }
|
|
||||||
public String getIntransitId() { return intransitId; }
|
|
||||||
public int getPrepIntId() { return prepIntId; }
|
|
||||||
public String getOrderId() { return orderId; }
|
|
||||||
public long getRequestId() { return requestId; }
|
|
||||||
public String getStatus() { return status; }
|
|
||||||
public String getTransactionDate() {
|
|
||||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ssXXX")
|
|
||||||
.withZone(ZoneId.of("Europe/Paris"));
|
|
||||||
|
|
||||||
return fdateCreation != null ? formatter.format(transactionDate.toInstant()) : "";
|
|
||||||
}
|
|
||||||
public String getIntransitSystemCd() { return intransitSystemCd; }
|
|
||||||
public String getIntransitLocationCd() { return intransitLocationCd; }
|
|
||||||
public String getFdateReceipt() {
|
|
||||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ssXXX")
|
|
||||||
.withZone(ZoneId.of("Europe/Paris"));
|
|
||||||
|
|
||||||
return fdateReceipt != null ? formatter.format(fdateReceipt.toInstant()) : "";
|
|
||||||
}
|
|
||||||
public String getFdateCreation() {
|
|
||||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ssXXX")
|
|
||||||
.withZone(ZoneId.of("Europe/Paris"));
|
|
||||||
|
|
||||||
return fdateCreation != null ? formatter.format(fdateCreation.toInstant()) : "";
|
|
||||||
}
|
|
||||||
|
|
||||||
// Setters
|
|
||||||
public void setIntransitIntId(int intransitIntId) { this.intransitIntId = intransitIntId; }
|
|
||||||
public void setIntransitId(String intransitId) { this.intransitId = intransitId; }
|
|
||||||
public void setPrepIntId(int prepIntId) { this.prepIntId = prepIntId; }
|
|
||||||
public void setOrderId(String orderId) { this.orderId = orderId; }
|
|
||||||
public void setRequestId(long requestId) { this.requestId = requestId; }
|
|
||||||
public void setStatus(String status) { this.status = status; }
|
|
||||||
public void setTransactionDate(Timestamp transactionDate) { this.transactionDate = transactionDate; }
|
|
||||||
public void setIntransitSystemCd(String intransitSystemCd) { this.intransitSystemCd = intransitSystemCd; }
|
|
||||||
public void setIntransitLocationCd(String intransitLocationCd) { this.intransitLocationCd = intransitLocationCd; }
|
|
||||||
public void setFdateReceipt(Timestamp fdateReceipt) { this.fdateReceipt = fdateReceipt; }
|
|
||||||
public void setFdateCreation(Timestamp fdateCreation) { this.fdateCreation = fdateCreation; }
|
|
||||||
|
|
||||||
public class ReceptionLines {
|
|
||||||
private int lineIntransitId;
|
|
||||||
private int intransitIntId;
|
|
||||||
private int lineFulfillId;
|
|
||||||
private Timestamp transactionDate;
|
|
||||||
private int lineItemNo;
|
|
||||||
private String itemId;
|
|
||||||
private int intransitQty;
|
|
||||||
private int validatedIntransitQty;
|
|
||||||
private String intransitSystemCd;
|
|
||||||
private String intransitLocationCd;
|
|
||||||
private String status;
|
|
||||||
private String colisId;
|
|
||||||
private Timestamp fdateCreation;
|
|
||||||
private Timestamp fdateReceipt;
|
|
||||||
private Double orderLineShipWeight;
|
|
||||||
private String trackingNumber;
|
|
||||||
|
|
||||||
// Getters
|
|
||||||
public int getLineIntransitId() { return lineIntransitId; }
|
|
||||||
public int getIntransitIntId() { return intransitIntId; }
|
|
||||||
public int getLineFulfillId() { return lineFulfillId; }
|
|
||||||
public String getTransactionDate() {
|
|
||||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ssXXX")
|
|
||||||
.withZone(ZoneId.of("Europe/Paris"));
|
|
||||||
return transactionDate != null ? formatter.format(transactionDate.toInstant()) : "";
|
|
||||||
}
|
|
||||||
public int getLineItemNo() { return lineItemNo; }
|
|
||||||
public String getItemId() { return itemId; }
|
|
||||||
public int getIntransitQty() { return intransitQty; }
|
|
||||||
public int getValidatedIntransitQty() { return validatedIntransitQty; }
|
|
||||||
public String getIntransitSystemCd() { return intransitSystemCd; }
|
|
||||||
public String getIntransitLocationCd() { return intransitLocationCd; }
|
|
||||||
public String getStatus() { return status; }
|
|
||||||
public String getColisId() { return colisId; }
|
|
||||||
public String getFdateCreation() {
|
|
||||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ssXXX")
|
|
||||||
.withZone(ZoneId.of("Europe/Paris"));
|
|
||||||
return fdateCreation != null ? formatter.format(fdateCreation.toInstant()) : "";
|
|
||||||
}
|
|
||||||
public String getFdateReceipt() {
|
|
||||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ssXXX")
|
|
||||||
.withZone(ZoneId.of("Europe/Paris"));
|
|
||||||
return fdateReceipt != null ? formatter.format(fdateReceipt.toInstant()) : "";
|
|
||||||
}
|
|
||||||
public Double getOrderLineShipWeight() { return orderLineShipWeight; }
|
|
||||||
public String getTrackingNumber() { return trackingNumber; }
|
|
||||||
|
|
||||||
// Setters
|
|
||||||
public void setLineIntransitId(int lineIntransitId) { this.lineIntransitId = lineIntransitId; }
|
|
||||||
public void setIntransitIntId(int intransitIntId) { this.intransitIntId = intransitIntId; }
|
|
||||||
public void setLineFulfillId(int lineFulfillId) { this.lineFulfillId = lineFulfillId; }
|
|
||||||
public void setTransactionDate(Timestamp transactionDate) { this.transactionDate = transactionDate; }
|
|
||||||
public void setLineItemNo(int lineItemNo) { this.lineItemNo = lineItemNo; }
|
|
||||||
public void setItemId(String itemId) { this.itemId = itemId; }
|
|
||||||
public void setIntransitQty(int intransitQty) { this.intransitQty = intransitQty; }
|
|
||||||
public void setValidatedIntransitQty(int validatedIntransitQty) { this.validatedIntransitQty = validatedIntransitQty; }
|
|
||||||
public void setIntransitSystemCd(String intransitSystemCd) { this.intransitSystemCd = intransitSystemCd; }
|
|
||||||
public void setIntransitLocationCd(String intransitLocationCd) { this.intransitLocationCd = intransitLocationCd; }
|
|
||||||
public void setStatus(String status) { this.status = status; }
|
|
||||||
public void setColisId(String colisId) { this.colisId = colisId; }
|
|
||||||
public void setFdateCreation(Timestamp fdateCreation) { this.fdateCreation = fdateCreation; }
|
|
||||||
public void setFdateReceipt(Timestamp fdateReceipt) { this.fdateReceipt = fdateReceipt; }
|
|
||||||
public void setOrderLineShipWeight(Double orderLineShipWeight) { this.orderLineShipWeight = orderLineShipWeight; }
|
|
||||||
public void setTrackingNumber(String trackingNumber) { this.trackingNumber = trackingNumber; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
||||||
# Pre-production API Proximis
|
|
||||||
preprod.proximis.api.url=https://proximis-ikks-recette.stg.proximis.com/publicAPI.php/V2
|
|
||||||
preprod.proximis.app.url=https://proximis-ikks-recette.stg.proximis.com
|
|
||||||
|
|
||||||
# production API Proximis
|
|
||||||
prod.proximis.api.url=https://ikks.omn.proximis.com/publicAPI.php/V2
|
|
||||||
prod.proximis.app.url=https://ikks.omn.proximis.com
|
|
||||||
|
|
||||||
|
|
@ -1,20 +1,17 @@
|
||||||
# Development DOTSOFT environment settings
|
# Development environment settings (dev)
|
||||||
dev.dotsoft.db.url=jdbc:oracle:thin:@v-aspd-b01-irdc.adic.lan:1521/MASPDI
|
dev.db.url=jdbc:oracle:thin:@v-aspd-b01-irdc.adic.lan:1521/MASPDI
|
||||||
dev.dotsoft.db.oai.password=base
|
dev.db.oai.password=base
|
||||||
dev.dotsoft.db.com02.password=B1Xto9pAbtBCOxuecG7W
|
dev.db.com02.password=B1Xto9pAbtBCOxuecG7W
|
||||||
dev.dotsoft.db.omni.password=k5.Omni.Paspdi
|
|
||||||
|
|
||||||
# Pre-production DOTSOFT environment settings
|
# Pre-production environment settings (preprod)
|
||||||
preprod.dotsoft.db.url=jdbc:oracle:thin:@v-aspd-b01-ii-d.adic.lan:1521/IASPDI
|
preprod.db.url=jdbc:oracle:thin:@v-aspd-b01-ii-d.adic.lan:1521/IASPDI
|
||||||
preprod.dotsoft.db.oai.password=base
|
preprod.db.oai.password=base
|
||||||
preprod.dotsoft.db.com02.password=B1Xto9pAbtBCOxuecG7W
|
preprod.db.com02.password=B1Xto9pAbtBCOxuecG7W
|
||||||
preprod.dotsoft.db.omni.password=k5.Omni.Paspdi
|
|
||||||
|
|
||||||
# Production DOTSOFT environment settings
|
# Production environment settings (prod)
|
||||||
prod.dotsoft.db.url=jdbc:oracle:thin:@v-aspd-b03-ip-d.adic.lan:1521/PASPDI
|
prod.db.url=jdbc:oracle:thin:@v-aspd-b03-ip-d.adic.lan:1521/PASPDI
|
||||||
prod.dotsoft.db.oai.password=base
|
prod.db.oai.password=base
|
||||||
prod.dotsoft.db.com02.password=com20
|
prod.db.com02.password=com20
|
||||||
prod.dotsoft.db.omni.password=k5.Omni.Paspdi
|
|
||||||
|
|
||||||
# XSTORE environment settings
|
# XSTORE environment settings
|
||||||
xstore.db.url=jdbc:oracle:thin:@HOST:1521/XSTORE
|
xstore.db.url=jdbc:oracle:thin:@HOST:1521/XSTORE
|
||||||
|
|
@ -22,18 +19,5 @@ xstore.db.dtv.password=dtv
|
||||||
xstore.db.repqueue.password=repqueue
|
xstore.db.repqueue.password=repqueue
|
||||||
|
|
||||||
# XADMIN environment settings
|
# XADMIN environment settings
|
||||||
preprod.xadmin.db.url=jdbc:oracle:thin:@v-xsto-b01-irdc.adic.lan:1521/RXSTOI
|
xadmin.db.url=jdbc:oracle:thin:@p-ODBG-b01-ipDC.tech.ikks.lan:1522/PXSTOREI
|
||||||
preprod.xadmin.db.dtv.password=Dtv.x#33
|
xadmin.db.dtv.password=oY3poRSprOuqasO
|
||||||
prod.xadmin.db.url=jdbc:oracle:thin:@p-ODBG-b01-ipDC.tech.ikks.lan:1522/PXSTOREI
|
|
||||||
prod.xadmin.db.dtv.password=oY3poRSprOuqasO
|
|
||||||
|
|
||||||
# Pre-production OBI environment settings
|
|
||||||
preprod.obi.db.url=jdbc:postgresql://v-tlnd-b01-iidc.tech.ikks.lan:5432/mirobi
|
|
||||||
preprod.obi.db.username=mobi
|
|
||||||
preprod.obi.db.password=obi
|
|
||||||
|
|
||||||
# production OBI environment settings
|
|
||||||
prod.obi.db.url=jdbc:postgresql://v-tlnd-b01-ipdc.tech.ikks.lan:5432/pirobi
|
|
||||||
prod.obi.db.username=pobi
|
|
||||||
prod.obi.db.password=y!h`AGZjGVa.ae;(N
|
|
||||||
|
|
||||||
Loading…
Reference in New Issue