Compare commits

...

17 Commits
V1.0.0 ... main

Author SHA1 Message Date
Frédérik Benoist 51453afcc3 Merge pull request 'release/1.0.2' (#16) from release/1.0.2 into main
Reviewed-on: #16
2024-02-20 21:54:36 +01:00
Frédérik Benoist 2ee98a6240 Merge pull request 'feature/issue-14/chatrct' (#15) from feature/issue-14/chatrct into dev
Reviewed-on: #15
2024-02-20 21:46:43 +01:00
Frédérik Benoist 98df411ea2 feat: chat-rct 2024-02-20 21:41:01 +01:00
Frédérik Benoist ea076d2383 feat: chat-rct 2024-02-20 00:14:11 +01:00
Frédérik Benoist 851a927265 feat: chatRCT 2024-02-12 23:33:21 +01:00
Frédérik Benoist 60b8d222b4 Merge pull request 'feat: add bruno api requests' (#13) from feature/issue-4/bruno into dev
Reviewed-on: #13
2024-01-27 11:42:13 +01:00
Frédérik Benoist 026b288534 feat: add bruno api requests 2024-01-27 11:32:41 +01:00
Frédérik Benoist 3330eee04c Merge pull request 'release/1.0.1' (#11) from release/1.0.1 into main
Reviewed-on: #11
2024-01-27 07:52:15 +01:00
Frédérik Benoist 0d36bb8a1b Merge pull request 'fix: postgres access and bug order day filter' (#10) from release/1.0.1 into dev
Reviewed-on: #10
2024-01-27 07:47:10 +01:00
Frédérik Benoist c0199532d1 fix: postgres access and bug order day filter 2024-01-27 07:43:49 +01:00
Frédérik Benoist ea70d8281c Merge pull request 'feature/issue-7/obi' (#8) from feature/issue-7/obi into dev
Reviewed-on: #8
2024-01-21 20:35:21 +01:00
Frédérik Benoist 2b26a17035 feat: obi visualization 2024-01-21 16:31:52 +01:00
Frédérik Benoist 0065ac650c feat: Order preparation and reception 2024-01-15 00:23:23 +01:00
Frédérik Benoist bac5868b72 fix: preprod, prod xadmin env 2024-01-13 07:09:54 +01:00
Frédérik Benoist 9b97645e53 feat: obi API 2024-01-13 06:48:21 +01:00
Frédérik Benoist 6016ce0dab feat: obi and proximis 2024-01-10 22:06:11 +01:00
Frédérik Benoist 2831d87ab2 feat: add obi order visualization 2024-01-07 21:09:45 +01:00
45 changed files with 2435 additions and 30 deletions

View File

@ -0,0 +1,20 @@
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
}

View File

@ -0,0 +1,20 @@
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
}

View File

@ -0,0 +1,20 @@
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
}

View File

@ -0,0 +1,22 @@
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"
}
}

5
bruno/bruno.json Normal file
View File

@ -0,0 +1,5 @@
{
"version": "1",
"name": "hdpos",
"type": "collection"
}

View File

@ -0,0 +1,16 @@
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
}

View File

@ -0,0 +1,15 @@
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
}

View File

@ -0,0 +1,15 @@
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
}

View File

@ -0,0 +1,18 @@
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
}

View File

@ -0,0 +1,24 @@
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
}

View File

@ -0,0 +1,27 @@
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
}

11
bruno/chatrct/hello.bru Normal file
View File

@ -0,0 +1,11 @@
meta {
name: Hello
type: http
seq: 1
}
get {
url: {{host}}/hdpos/api/chatrct/hello
body: none
auth: none
}

View File

@ -0,0 +1,4 @@
vars {
host: http://v-xsto-a01-iidc.adic.lan:8080
proximisHost: https://ikks.omn.proximis.com
}

View File

@ -0,0 +1,4 @@
vars {
host: http://localhost:8080
proximisHost: https://proximis-ikks-recette.stg.proximis.com
}

View File

@ -0,0 +1,11 @@
meta {
name: not sent
type: http
seq: 1
}
get {
url: {{host}}/hdpos/api/flux/bl/notsent
body: none
auth: none
}

View File

@ -0,0 +1,11 @@
meta {
name: hello 8080
type: http
seq: 1
}
get {
url: {{host}}/hdpos/api/hello
body: none
auth: none
}

15
bruno/items/items.bru Normal file
View File

@ -0,0 +1,15 @@
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
}

View File

@ -0,0 +1,15 @@
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
}

View File

@ -0,0 +1,15 @@
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
}

View File

@ -0,0 +1,15 @@
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
}

View File

@ -0,0 +1,18 @@
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
}

View File

@ -0,0 +1,11 @@
meta {
name: GetByOrderId
type: http
seq: 1
}
get {
url: {{host}}/hdpos/api/obi/order/2845
body: none
auth: none
}

View File

@ -0,0 +1,11 @@
meta {
name: getOrderMessage
type: http
seq: 3
}
get {
url: {{host}}/hdpos/api/obi/order/2845/orderMessage
body: none
auth: none
}

View File

@ -0,0 +1,11 @@
meta {
name: projectFulfillment
type: http
seq: 1
}
get {
url: {{host}}/hdpos/api/proximis/project/fulfillment/1382020000066
body: none
auth: none
}

11
bruno/stores/All.bru Normal file
View File

@ -0,0 +1,11 @@
meta {
name: All
type: http
seq: 2
}
get {
url: {{host}}/hdpos/api/stores/
body: none
auth: none
}

16
bruno/stores/Log.bru Normal file
View File

@ -0,0 +1,16 @@
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
}

15
bruno/stores/Sequence.bru Normal file
View File

@ -0,0 +1,15 @@
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
}

View File

@ -0,0 +1,15 @@
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
}

View File

@ -0,0 +1,11 @@
meta {
name: StoreById
type: http
seq: 3
}
get {
url: {{host}}/hdpos/api/stores/4
body: none
auth: none
}

View File

@ -0,0 +1,15 @@
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
}

15
bruno/stores/Version.bru Normal file
View File

@ -0,0 +1,15 @@
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
}

11
bruno/stores/reload.bru Normal file
View File

@ -0,0 +1,11 @@
meta {
name: reload
type: http
seq: 8
}
get {
url: {{host}}/hdpos/api/stores/reload
body: none
auth: none
}

16
bruno/xadmin/Log.bru Normal file
View File

@ -0,0 +1,16 @@
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
View File

@ -19,7 +19,14 @@
<dependency>
<groupId>com.oracle.database.jdbc</groupId>
<artifactId>ojdbc8</artifactId>
<version>18.3.0.0</version> <!-- Assurez-vous d'utiliser la version compatible avec votre Oracle Database -->
<version>18.3.0.0</version>
</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>
<!-- Jersey for JAX-RS (Java API for RESTful Web Services) -->
@ -57,13 +64,18 @@
<dependency>
<groupId>com.fasterxml.jackson.jaxrs</groupId>
<artifactId>jackson-jaxrs-json-provider</artifactId>
<version>2.13.0</version> <!-- Use the latest version here -->
<version>2.13.0</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-json-jackson</artifactId>
<version>2.13</version>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20231013</version>
</dependency>
<!-- LOG dependencies -->
<dependency>

View File

@ -0,0 +1,474 @@
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));
}
}

View File

@ -21,8 +21,8 @@ public class DatabaseConnectDOTSOFT implements AutoCloseable {
try {
Properties dbProperties = loadDatabaseProperties();
String url = dbProperties.getProperty(environment + ".db.url");
String userpassword = dbProperties.getProperty(environment + ".db." + username + ".password");
String url = dbProperties.getProperty(environment + ".dotsoft.db.url");
String userpassword = dbProperties.getProperty(environment + ".dotsoft.db." + username + ".password");
connection = DriverManager.getConnection(url, username, userpassword);

View File

@ -0,0 +1,78 @@
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();
}
}
}

View File

@ -16,17 +16,19 @@ public class DatabaseConnectXADMIN implements AutoCloseable {
private Connection connection;
public DatabaseConnectXADMIN(String username) throws SQLException {
String environment = loadEnvironment();
try {
Properties dbProperties = loadDatabaseProperties();
String url = dbProperties.getProperty("xadmin.db.url");
String userpassword = dbProperties.getProperty("xadmin.db." + username + ".password");
String url = dbProperties.getProperty(environment + ".xadmin.db.url");
String userpassword = dbProperties.getProperty(environment + ".xadmin.db." + username + ".password");
connection = DriverManager.getConnection(url, username, userpassword);
logger.info("XADMIN Connection OK for user " + username);
logger.info("XADMIN Connection OK for user " + username + " on environment " + environment);
} catch (SQLException e) {
logger.error("Failed to connect to XADMIN database for user " + username, e);
logger.error("Failed to connect to XADMIN database for user " + username + " on environment " + environment, e);
throw e; // re-throw the exception
}
}
@ -43,6 +45,11 @@ public class DatabaseConnectXADMIN implements AutoCloseable {
}
}
private String loadEnvironment() {
Properties envProperties = loadProperties("env.properties");
return envProperties.getProperty("environment");
}
private Properties loadDatabaseProperties() {
Properties dbProperties = loadProperties("db.properties");
return dbProperties;

View File

@ -53,6 +53,8 @@ public class ItemService {
try (DatabaseConnectXSTORE databaseConnection = new DatabaseConnectXSTORE(dbHost, "dtv")) {
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)) {
// Concatenate % to parameter itemId
statement.setString(1, itemId + "%");
@ -105,6 +107,8 @@ public class ItemService {
"FROM dtv.ITM_ITEM_OPTIONS " +
"WHERE ORGANIZATION_ID = 1 AND ITEM_ID LIKE ?";
logger.info(query);
try (PreparedStatement statement = databaseConnection.getConnection().prepareStatement(query)) {
// Concatenate % to parameter itemId
statement.setString(1, itemId + "%");
@ -157,6 +161,8 @@ public class ItemService {
"FROM dtv.itm_item_prices " +
"WHERE organization_id = 1 AND item_id LIKE ?";
logger.info(query);
try (PreparedStatement statement = databaseConnection.getConnection().prepareStatement(query)) {
// Concatenate % to parameter itemId
statement.setString(1, itemId + "%");
@ -209,6 +215,8 @@ public class ItemService {
"FROM dtv.inv_stock_ledger_acct " +
"WHERE organization_id = 1 AND item_id LIKE ?";
logger.info(query);
try (PreparedStatement statement = databaseConnection.getConnection().prepareStatement(query)) {
// Concatenate % to parameter itemId
statement.setString(1, itemId + "%");

View File

@ -0,0 +1,693 @@
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;
}
}

View File

@ -0,0 +1,115 @@
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;
}
}

View File

@ -76,6 +76,7 @@ public class StoreService {
" WHERE st.id_structure = ?";
logger.info(query);
try (PreparedStatement statement = databaseConnection.getConnection().prepareStatement(query)) {
statement.setString(1, storeId);
@ -178,15 +179,16 @@ public class StoreService {
" AND hsc2.id_caisse BETWEEN 20 AND 39) AS caisses," +
" REPLACE(REPLACE(TRIM(st.adresse1), chr(10), ''), chr(13), '') AS adresse," +
" 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" +
" 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 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" +
" WHERE axs.date_stock is not null AND st.id_niveau=4 AND st.statut=2 AND st.id_canal_distribution = 1" +
" ORDER BY st.id_structure";
logger.info(query);
logger.info(query);
try (PreparedStatement statement = databaseConnection.getConnection().prepareStatement(query);
ResultSet resultSet = statement.executeQuery()) {
@ -230,6 +232,7 @@ public class StoreService {
"ORDER BY WKSTN_ID, SEQUENCE_ID";
logger.info(query);
try (PreparedStatement statement = databaseConnection.getConnection().prepareStatement(query)) {
ResultSet resultSet = statement.executeQuery();
@ -282,6 +285,7 @@ public class StoreService {
"ORDER BY WKSTN_ID";
logger.info(query);
try (PreparedStatement statement = databaseConnection.getConnection().prepareStatement(query)) {
ResultSet resultSet = statement.executeQuery();
@ -335,7 +339,8 @@ public class StoreService {
"WHERE organization_id = 1 AND customer IS NOT NULL " +
"ORDER BY seq DESC";
logger.info(query);
logger.info(query);
try (PreparedStatement statement = databaseConnection.getConnection().prepareStatement(query)) {
ResultSet resultSet = statement.executeQuery();
@ -449,6 +454,7 @@ public class StoreService {
"ORDER BY cel.CREATE_DATE DESC";
logger.info(query);
try (PreparedStatement statement = databaseConnection.getConnection().prepareStatement(query)) {
statement.setString(1, logDate + " 00:00:00");
statement.setString(2, logDate + " 23:59:59");
@ -659,6 +665,7 @@ public class StoreService {
" WHERE st.id_structure = ?";
logger.info(storeQuery);
try (PreparedStatement storeStatement = databaseConnectionDS.getConnection().prepareStatement(storeQuery)) {
storeStatement.setInt(1, storeId); // Set the value of the parameter
@ -685,6 +692,7 @@ public class StoreService {
for (StorePos pos : storeDetails.getPos()) {
logger.info(boTransactionQuery);
try (PreparedStatement boTransactionStatement = databaseConnectionDS.getConnection().prepareStatement(boTransactionQuery)) {
boTransactionStatement.setInt(1, storeId);
boTransactionStatement.setInt(2, pos.getWorkstationId());
@ -720,6 +728,7 @@ public class StoreService {
"WHERE crq.organization_id = 1 AND crq.RTL_LOC_ID = ? and crq.WKSTN_ID = ?";
logger.info(replicationQuery);
try (PreparedStatement replicationStatement = databaseConnection.getConnection().prepareStatement(replicationQuery)) {
replicationStatement.setInt(1, storeId);
replicationStatement.setInt(2, workstationId);
@ -746,7 +755,8 @@ public class StoreService {
"AND lsj.STRING_VALUE = 'OPEN'";
logger.info(openingQuery);
try (PreparedStatement openingStatement = databaseConnection.getConnection().prepareStatement(openingQuery)) {
try (PreparedStatement openingStatement = databaseConnection.getConnection().prepareStatement(openingQuery)) {
openingStatement.setInt(1, storeId);
openingStatement.setInt(2, workstationId);
@ -771,7 +781,8 @@ public class StoreService {
"AND lsj.STRING_VALUE = 'CLOSED'";
logger.info(closingQuery);
try (PreparedStatement closingStatement = databaseConnection.getConnection().prepareStatement(closingQuery)) {
try (PreparedStatement closingStatement = databaseConnection.getConnection().prepareStatement(closingQuery)) {
closingStatement.setInt(1, storeId);
closingStatement.setInt(2, workstationId);
@ -797,7 +808,8 @@ public class StoreService {
"AND tt.trans_TYPCODE = 'RETAIL_SALE' " +
"AND tt.TRANS_STATCODE = 'COMPLETE'";
logger.info(saleTransactionQuery);
logger.info(saleTransactionQuery);
try (PreparedStatement saleTransactionStatement = databaseConnection.getConnection().prepareStatement(saleTransactionQuery)) {
saleTransactionStatement.setInt(1, storeId);
saleTransactionStatement.setDate(2, pos.getBusinessDate());
@ -823,6 +835,7 @@ public class StoreService {
"AND cel.LOG_LEVEL = 'FATAL'";
logger.info(logQuery);
try (PreparedStatement logStatement = databaseConnection.getConnection().prepareStatement(logQuery)) {
logStatement.setInt(1, storeId);
logStatement.setInt(2, workstationId);

View File

@ -0,0 +1,502 @@
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; }
}
}
}

View File

@ -0,0 +1,8 @@
# 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

View File

@ -1,17 +1,20 @@
# Development environment settings (dev)
dev.db.url=jdbc:oracle:thin:@v-aspd-b01-irdc.adic.lan:1521/MASPDI
dev.db.oai.password=base
dev.db.com02.password=B1Xto9pAbtBCOxuecG7W
# Development DOTSOFT environment settings
dev.dotsoft.db.url=jdbc:oracle:thin:@v-aspd-b01-irdc.adic.lan:1521/MASPDI
dev.dotsoft.db.oai.password=base
dev.dotsoft.db.com02.password=B1Xto9pAbtBCOxuecG7W
dev.dotsoft.db.omni.password=k5.Omni.Paspdi
# Pre-production environment settings (preprod)
preprod.db.url=jdbc:oracle:thin:@v-aspd-b01-ii-d.adic.lan:1521/IASPDI
preprod.db.oai.password=base
preprod.db.com02.password=B1Xto9pAbtBCOxuecG7W
# Pre-production DOTSOFT environment settings
preprod.dotsoft.db.url=jdbc:oracle:thin:@v-aspd-b01-ii-d.adic.lan:1521/IASPDI
preprod.dotsoft.db.oai.password=base
preprod.dotsoft.db.com02.password=B1Xto9pAbtBCOxuecG7W
preprod.dotsoft.db.omni.password=k5.Omni.Paspdi
# Production environment settings (prod)
prod.db.url=jdbc:oracle:thin:@v-aspd-b03-ip-d.adic.lan:1521/PASPDI
prod.db.oai.password=base
prod.db.com02.password=com20
# Production DOTSOFT environment settings
prod.dotsoft.db.url=jdbc:oracle:thin:@v-aspd-b03-ip-d.adic.lan:1521/PASPDI
prod.dotsoft.db.oai.password=base
prod.dotsoft.db.com02.password=com20
prod.dotsoft.db.omni.password=k5.Omni.Paspdi
# XSTORE environment settings
xstore.db.url=jdbc:oracle:thin:@HOST:1521/XSTORE
@ -19,5 +22,18 @@ xstore.db.dtv.password=dtv
xstore.db.repqueue.password=repqueue
# XADMIN environment settings
xadmin.db.url=jdbc:oracle:thin:@p-ODBG-b01-ipDC.tech.ikks.lan:1522/PXSTOREI
xadmin.db.dtv.password=oY3poRSprOuqasO
preprod.xadmin.db.url=jdbc:oracle:thin:@v-xsto-b01-irdc.adic.lan:1521/RXSTOI
preprod.xadmin.db.dtv.password=Dtv.x#33
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