Umstellung auf constantValues

This commit is contained in:
2024-07-03 12:00:07 +02:00
parent 8f46acf97f
commit 40ceecd7fc
3 changed files with 49 additions and 38 deletions

View File

@@ -17,7 +17,7 @@ import com.dvelop.d3.server.ValueSetTranslation
// Special libraries -----------------------------------------------------------------------------
import groovy.sql.Sql;
import java.lang.annotation.*;
import constantValues;
public class D3ValueSets {
@@ -25,10 +25,9 @@ public class D3ValueSets {
def getClient(D3Interface d3, RepositoryField reposField, User d3User, DocumentType docTypeShort, int row_no, int validate, Document docObj) {
d3.log.info( "[DBS] START getClient");
def sqlQuery = """SELECT kuliname + ' | ' + strasse + ' | ' + plz + ' | ' + ort + ' | ' + land + ' | ' + kulinr
FROM [D3ServiceT].[dbo].[dv_kulistamm] order by kuliname""";
def sqlQuery = "SELECT kuliname + ' | ' + strasse + ' | ' + plz + ' | ' + ort + ' | ' + land + ' | ' + kulinr FROM [" + constantValues.DatabaseName + "].[dbo].[dv_kulistamm] order by kuliname";
def sql = groovy.sql.Sql.newInstance( "jdbc:sqlserver://d3sql;databaseName=D3ServiceT", 'd3DBAdminT', 'Dvelop1!', 'com.microsoft.sqlserver.jdbc.SQLServerDriver' );
def sql = groovy.sql.Sql.newInstance( "jdbc:sqlserver://d3sql;databaseName=" + constantValues.DatabaseName, constantValues.DatabaseUser, constantValues.DatabasePassword, 'com.microsoft.sqlserver.jdbc.SQLServerDriver' );
def resultRows = sql.rows( sqlQuery );
def clientIDPList = [];
@@ -57,10 +56,9 @@ public class D3ValueSets {
def getClientNr(D3Interface d3, RepositoryField reposField, User d3User, DocumentType docTypeShort, int row_no, int validate, Document docObj) {
d3.log.info( "[DBS] START getClientNr");
def sqlQuery = """SELECT kuliname + ' | ' + strasse + ' | ' + plz + ' | ' + ort + ' | ' + land + ' | ' + kulinr
FROM [D3ServiceT].[dbo].[dv_kulistamm] order by kulinr""";
def sqlQuery = "SELECT kuliname + ' | ' + strasse + ' | ' + plz + ' | ' + ort + ' | ' + land + ' | ' + kulinr FROM [" + constantValues.DatabaseName + "].[dbo].[dv_kulistamm] order by kulinr";
def sql = groovy.sql.Sql.newInstance( "jdbc:sqlserver://d3sql;databaseName=D3ServiceT", 'd3DBAdminT', 'Dvelop1!', 'com.microsoft.sqlserver.jdbc.SQLServerDriver' );
def sql = groovy.sql.Sql.newInstance( "jdbc:sqlserver://d3sql;databaseName=" + constantValues.DatabaseName, constantValues.DatabaseUser, constantValues.DatabasePassword, 'com.microsoft.sqlserver.jdbc.SQLServerDriver' );
def resultRows = sql.rows( sqlQuery );
def clientIDPList = [];
@@ -89,10 +87,9 @@ public class D3ValueSets {
def getMaterialNr(D3Interface d3, RepositoryField reposField, User d3User, DocumentType docTypeShort, int row_no, int validate, Document docObj) {
d3.log.info( "[DBS] START getMaterialNr");
def sqlQuery = """SELECT matnr + ' | ' + bez + ' | ' + fremdart + ' | ' + mat_such
FROM [D3ServiceT].[dbo].[dv_artikelstamm] order by matnr""";
def sqlQuery = "SELECT matnr + ' | ' + bez + ' | ' + fremdart + ' | ' + mat_such FROM [" + constantValues.DatabaseName + "].[dbo].[dv_artikelstamm] order by matnr";
def sql = groovy.sql.Sql.newInstance( "jdbc:sqlserver://d3sql;databaseName=D3ServiceT", 'd3DBAdminT', 'Dvelop1!', 'com.microsoft.sqlserver.jdbc.SQLServerDriver' );
def sql = groovy.sql.Sql.newInstance( "jdbc:sqlserver://d3sql;databaseName=" + constantValues.DatabaseName, constantValues.DatabaseUser, constantValues.DatabasePassword, 'com.microsoft.sqlserver.jdbc.SQLServerDriver' );
def resultRows = sql.rows( sqlQuery );
def clientIDPList = [];
@@ -107,10 +104,9 @@ public class D3ValueSets {
def getMandantName(D3Interface d3, RepositoryField reposField, User d3User, DocumentType docTypeShort, int row_no, int validate, Document docObj) {
d3.log.info( "[DBS] START getMandantName");
def sqlQuery = """SELECT mandant_nr + ' | ' + mandant_name
FROM [D3ServiceT].[dbo].[dv_mandant] order by mandant_nr""";
def sqlQuery = "SELECT mandant_nr + ' | ' + mandant_name FROM [" + constantValues.DatabaseName + "].[dbo].[dv_mandant] order by mandant_nr";
def sql = groovy.sql.Sql.newInstance( "jdbc:sqlserver://d3sql;databaseName=D3ServiceT", 'd3DBAdminT', 'Dvelop1!', 'com.microsoft.sqlserver.jdbc.SQLServerDriver' );
def sql = groovy.sql.Sql.newInstance( "jdbc:sqlserver://d3sql;databaseName=" + constantValues.DatabaseName, constantValues.DatabaseUser, constantValues.DatabasePassword, 'com.microsoft.sqlserver.jdbc.SQLServerDriver' );
def resultRows = sql.rows( sqlQuery );
def clientIDPList = [];
@@ -126,10 +122,9 @@ public class D3ValueSets {
def getMandantNr(D3Interface d3, RepositoryField reposField, User d3User, DocumentType docTypeShort, int row_no, int validate, Document docObj) {
d3.log.info( "[DBS] START getMandantNr");
def sqlQuery = """SELECT mandant_nr + ' | ' + mandant_name
FROM [D3ServiceT].[dbo].[dv_mandant] order by mandant_nr""";
def sqlQuery = "SELECT mandant_nr + ' | ' + mandant_name FROM [" + constantValues.DatabaseName + "].[dbo].[dv_mandant] order by mandant_nr";
def sql = groovy.sql.Sql.newInstance( "jdbc:sqlserver://d3sql;databaseName=D3ServiceT", 'd3DBAdminT', 'Dvelop1!', 'com.microsoft.sqlserver.jdbc.SQLServerDriver' );
def sql = groovy.sql.Sql.newInstance( "jdbc:sqlserver://d3sql;databaseName=" + constantValues.DatabaseName, constantValues.DatabaseUser, constantValues.DatabasePassword, 'com.microsoft.sqlserver.jdbc.SQLServerDriver' );
def resultRows = sql.rows( sqlQuery );
def clientIDPList = [];