first commit
This commit is contained in:
commit
cf97b64877
27585 changed files with 3281780 additions and 0 deletions
61
.gitignore
vendored
Normal file
61
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,61 @@
|
||||||
|
# .gitignore for JSP / Java web applications
|
||||||
|
# Ignore compiled classes
|
||||||
|
*.class
|
||||||
|
|
||||||
|
# Build directories (Maven, Gradle, Ant, etc.)
|
||||||
|
/target/
|
||||||
|
/build/
|
||||||
|
/out/
|
||||||
|
/dist/
|
||||||
|
/bin/
|
||||||
|
|
||||||
|
# Webapp build artifacts and generated classes
|
||||||
|
/WEB-INF/classes/
|
||||||
|
*.war
|
||||||
|
*.ear
|
||||||
|
|
||||||
|
# Logs, temp and swap files
|
||||||
|
*.log
|
||||||
|
*.tmp
|
||||||
|
*.swp
|
||||||
|
*.bak
|
||||||
|
|
||||||
|
# Servlet container / Tomcat runtime files
|
||||||
|
logs/
|
||||||
|
temp/
|
||||||
|
work/
|
||||||
|
|
||||||
|
# IDEs and editors
|
||||||
|
/.idea/
|
||||||
|
/.vscode/
|
||||||
|
*.iml
|
||||||
|
/.project
|
||||||
|
/.classpath
|
||||||
|
/.settings/
|
||||||
|
/nbproject/
|
||||||
|
|
||||||
|
# Maven / Gradle caches
|
||||||
|
/.mvn/
|
||||||
|
/.gradle/
|
||||||
|
|
||||||
|
# Node / frontend
|
||||||
|
node_modules/
|
||||||
|
npm-debug.log
|
||||||
|
yarn-error.log
|
||||||
|
|
||||||
|
# OS files
|
||||||
|
.DS_Store
|
||||||
|
Thumbs.db
|
||||||
|
|
||||||
|
# Environment files
|
||||||
|
.env
|
||||||
|
|
||||||
|
# User uploads, caches, and runtime temp data
|
||||||
|
/uploads/
|
||||||
|
/tmp/
|
||||||
|
/cache/
|
||||||
|
|
||||||
|
# Optional: if your project CHECKS IN vendor jars, remove the next line
|
||||||
|
# /WEB-INF/lib/*.jar
|
||||||
|
|
||||||
|
/admin/_V4/**
|
||||||
1026
rus/WEB-INF/ablia.tld
Normal file
1026
rus/WEB-INF/ablia.tld
Normal file
File diff suppressed because it is too large
Load diff
107
rus/WEB-INF/abliaDBCom.tld
Normal file
107
rus/WEB-INF/abliaDBCom.tld
Normal file
|
|
@ -0,0 +1,107 @@
|
||||||
|
<?xml version="1.0" encoding="ISO-8859-1" ?>
|
||||||
|
<!DOCTYPE taglib
|
||||||
|
PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN"
|
||||||
|
"http://java.sun.com/j2ee/dtds/web-jsptaglib_1_1.dtd">
|
||||||
|
|
||||||
|
<!-- a tag library descriptor -->
|
||||||
|
|
||||||
|
<taglib>
|
||||||
|
<!-- after this the default space is
|
||||||
|
"http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd"
|
||||||
|
-->
|
||||||
|
|
||||||
|
<!-- The version number of this tag library -->
|
||||||
|
<tlibversion>0.1</tlibversion>
|
||||||
|
|
||||||
|
<!-- The JSP specification version required to function -->
|
||||||
|
<jspversion>1.1</jspversion>
|
||||||
|
|
||||||
|
<!-- The short name of this tag library -->
|
||||||
|
<shortname>contab</shortname>
|
||||||
|
|
||||||
|
<!-- Public URI that uniquely identifies this version of the tag library
|
||||||
|
<uri>http://jakarta.apache.org/taglibs/utility</uri> -->
|
||||||
|
|
||||||
|
<!-- General information about this tag library -->
|
||||||
|
<info>
|
||||||
|
DBCom tag library
|
||||||
|
V.0.2
|
||||||
|
23-02-16 aggiunto BannerListTag
|
||||||
|
29-06-15 aggiunto imgclass su banner
|
||||||
|
09-10-08 creat contab.tld. Aggiunto documento tag per gestione menu documenti
|
||||||
|
</info>
|
||||||
|
|
||||||
|
<!-- ******************** Defined Custom Tags *************************** -->
|
||||||
|
|
||||||
|
<tag>
|
||||||
|
<name>documento</name>
|
||||||
|
<tagclass>com.ablia.contab.taglib.TipoDocumentoTag</tagclass>
|
||||||
|
<teiclass>com.ablia.contab.taglib.TipoDocumentoTagExtraInfo</teiclass>
|
||||||
|
<info>
|
||||||
|
Elenco ti po docmenti per caricare il menu
|
||||||
|
</info>
|
||||||
|
</tag>
|
||||||
|
|
||||||
|
|
||||||
|
<tag>
|
||||||
|
<name>banner</name>
|
||||||
|
<tagclass>com.ablia.banner.taglib.BannerTag</tagclass>
|
||||||
|
<teiclass>com.ablia.banner.taglib.BannerTagExtraInfo</teiclass>
|
||||||
|
<info>
|
||||||
|
Banner tag
|
||||||
|
</info>
|
||||||
|
<attribute>
|
||||||
|
<name>bannertype</name>
|
||||||
|
<required>true</required>
|
||||||
|
<rtexprvalue>true</rtexprvalue>
|
||||||
|
</attribute>
|
||||||
|
<attribute>
|
||||||
|
<name>id_banner</name>
|
||||||
|
<required>false</required>
|
||||||
|
<rtexprvalue>true</rtexprvalue>
|
||||||
|
</attribute>
|
||||||
|
<attribute>
|
||||||
|
<name>textbanner</name>
|
||||||
|
<required>false</required>
|
||||||
|
<rtexprvalue>true</rtexprvalue>
|
||||||
|
</attribute>
|
||||||
|
<attribute>
|
||||||
|
<name>alt</name>
|
||||||
|
<required>false</required>
|
||||||
|
<rtexprvalue>true</rtexprvalue>
|
||||||
|
</attribute>
|
||||||
|
<attribute>
|
||||||
|
<name>imgclass</name>
|
||||||
|
<required>false</required>
|
||||||
|
<rtexprvalue>true</rtexprvalue>
|
||||||
|
</attribute>
|
||||||
|
</tag>
|
||||||
|
|
||||||
|
|
||||||
|
<tag>
|
||||||
|
<name>bannerlist</name>
|
||||||
|
<tagclass>com.ablia.banner.taglib.BannerListTag</tagclass>
|
||||||
|
<teiclass>com.ablia.banner.taglib.BannerListTagExtraInfo</teiclass>
|
||||||
|
<info>
|
||||||
|
Banner tag
|
||||||
|
</info>
|
||||||
|
<attribute>
|
||||||
|
<name>bannertype</name>
|
||||||
|
<required>true</required>
|
||||||
|
<rtexprvalue>true</rtexprvalue>
|
||||||
|
</attribute>
|
||||||
|
<attribute>
|
||||||
|
<name>num</name>
|
||||||
|
<required>false</required>
|
||||||
|
<rtexprvalue>true</rtexprvalue>
|
||||||
|
</attribute>
|
||||||
|
<attribute>
|
||||||
|
<name>rowbeanname</name>
|
||||||
|
<required>false</required>
|
||||||
|
<rtexprvalue>true</rtexprvalue>
|
||||||
|
</attribute>
|
||||||
|
</tag>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</taglib>
|
||||||
123
rus/WEB-INF/art.tld
Normal file
123
rus/WEB-INF/art.tld
Normal file
|
|
@ -0,0 +1,123 @@
|
||||||
|
<?xml version="1.0" encoding="ISO-8859-1" ?>
|
||||||
|
<!DOCTYPE taglib
|
||||||
|
PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN"
|
||||||
|
"http://java.sun.com/j2ee/dtds/web-jsptaglib_1_1.dtd">
|
||||||
|
|
||||||
|
<!-- a tag library descriptor -->
|
||||||
|
|
||||||
|
<taglib>
|
||||||
|
<!-- after this the default space is
|
||||||
|
"http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd"
|
||||||
|
-->
|
||||||
|
|
||||||
|
<!-- The version number of this tag library -->
|
||||||
|
<tlibversion>0.1</tlibversion>
|
||||||
|
|
||||||
|
<!-- The JSP specification version required to function -->
|
||||||
|
<jspversion>1.1</jspversion>
|
||||||
|
|
||||||
|
<!-- The short name of this tag library -->
|
||||||
|
<shortname>mag</shortname>
|
||||||
|
|
||||||
|
<!-- Public URI that uniquely identifies this version of the tag library
|
||||||
|
<uri>http://jakarta.apache.org/taglibs/utility</uri> -->
|
||||||
|
|
||||||
|
<!-- General information about this tag library -->
|
||||||
|
<info>
|
||||||
|
Ecom tag library
|
||||||
|
V.0.0
|
||||||
|
21-07-08 creat mag.tld. Aggiunto tipolisttag e whiletipo per gestione com.ablia.art.Tipo
|
||||||
|
copiato da ecom
|
||||||
|
</info>
|
||||||
|
|
||||||
|
<!-- ******************** Defined Custom Tags *************************** -->
|
||||||
|
|
||||||
|
<tag>
|
||||||
|
<name>whiletipo</name>
|
||||||
|
<tagclass>com.ablia.art.taglib.WhileTipoTag</tagclass>
|
||||||
|
<teiclass>com.ablia.art.taglib.WhileTipoTagExtraInfo</teiclass>
|
||||||
|
<info>
|
||||||
|
While tipo
|
||||||
|
</info>
|
||||||
|
<attribute>
|
||||||
|
<name>id_tipoPadre</name>
|
||||||
|
<required>true</required>
|
||||||
|
<rtexprvalue>true</rtexprvalue>
|
||||||
|
</attribute>
|
||||||
|
<attribute>
|
||||||
|
<name>id_tipoPadreSelected</name>
|
||||||
|
<required>false</required>
|
||||||
|
<rtexprvalue>true</rtexprvalue>
|
||||||
|
</attribute>
|
||||||
|
<attribute>
|
||||||
|
<name>lang</name>
|
||||||
|
<required>false</required>
|
||||||
|
<rtexprvalue>true</rtexprvalue>
|
||||||
|
</attribute>
|
||||||
|
<attribute>
|
||||||
|
<name>flgWww</name>
|
||||||
|
<required>false</required>
|
||||||
|
<rtexprvalue>true</rtexprvalue>
|
||||||
|
</attribute>
|
||||||
|
<attribute>
|
||||||
|
<name>rowbeanname</name>
|
||||||
|
<required>false</required>
|
||||||
|
<rtexprvalue>true</rtexprvalue>
|
||||||
|
</attribute>
|
||||||
|
</tag>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- TipoListTreeTag tag -->
|
||||||
|
<tag>
|
||||||
|
<name>tipolisttree</name>
|
||||||
|
<tagclass>com.ablia.art.taglib.TipoListTreeTag</tagclass>
|
||||||
|
<attribute>
|
||||||
|
<name>id_tipo</name>
|
||||||
|
<required>true</required>
|
||||||
|
<rtexprvalue>true</rtexprvalue>
|
||||||
|
</attribute>
|
||||||
|
</tag>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!-- TipoListTreeTag tag -->
|
||||||
|
<tag>
|
||||||
|
<name>tipolistjqtree</name>
|
||||||
|
<tagclass>com.ablia.art.taglib.TipoListJQTreeTag</tagclass>
|
||||||
|
<attribute>
|
||||||
|
<name>id_tipo</name>
|
||||||
|
<required>true</required>
|
||||||
|
<rtexprvalue>true</rtexprvalue>
|
||||||
|
</attribute>
|
||||||
|
</tag>
|
||||||
|
<!-- vetrina tag -->
|
||||||
|
|
||||||
|
<tag>
|
||||||
|
<name>vetrina</name>
|
||||||
|
<tagclass>com.ablia.art.taglib.VetrinaTag</tagclass>
|
||||||
|
<teiclass>com.ablia.art.taglib.VetrinaTagExtraInfo</teiclass>
|
||||||
|
<attribute>
|
||||||
|
<name>vetrina</name>
|
||||||
|
<required>true</required>
|
||||||
|
<rtexprvalue>true</rtexprvalue>
|
||||||
|
</attribute>
|
||||||
|
<attribute>
|
||||||
|
<name>num</name>
|
||||||
|
<required>true</required>
|
||||||
|
<rtexprvalue>true</rtexprvalue>
|
||||||
|
</attribute>
|
||||||
|
</tag>
|
||||||
|
<!-- IF vetrina tag -->
|
||||||
|
<tag>
|
||||||
|
<name>if_vetrina</name>
|
||||||
|
<tagclass>com.ablia.art.taglib.IfVetrinaTag</tagclass>
|
||||||
|
<info>
|
||||||
|
Conditional Tag per vetrina
|
||||||
|
</info>
|
||||||
|
<attribute>
|
||||||
|
<name>vetrina</name>
|
||||||
|
<required>true</required>
|
||||||
|
<rtexprvalue>true</rtexprvalue>
|
||||||
|
</attribute>
|
||||||
|
</tag>
|
||||||
|
</taglib>
|
||||||
13
rus/WEB-INF/classes/dbcomuni.properties
Normal file
13
rus/WEB-INF/classes/dbcomuni.properties
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
#####################################################
|
||||||
|
#### D E B U G #####################################
|
||||||
|
#####################################################
|
||||||
|
USE_PARM_HT=true
|
||||||
|
DEBUG=true
|
||||||
|
LOG_FILE=/var/log/tomcat_gr.log
|
||||||
|
DEBUG_LEVEL=1
|
||||||
|
#####################################################
|
||||||
|
######PROPRIETA' UTILIZZATE DALLE SERVLET############
|
||||||
|
#####################################################
|
||||||
|
|
||||||
|
LOCALE=IT
|
||||||
|
|
||||||
13
rus/WEB-INF/classes/rus.properties
Normal file
13
rus/WEB-INF/classes/rus.properties
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
#####################################################
|
||||||
|
#### D E B U G #####################################
|
||||||
|
#####################################################
|
||||||
|
USE_PARM_HT=true
|
||||||
|
DEBUG=true
|
||||||
|
LOG_FILE=/var/log/tomcat_gr.log
|
||||||
|
DEBUG_LEVEL=1
|
||||||
|
#####################################################
|
||||||
|
######PROPRIETA' UTILIZZATE DALLE SERVLET############
|
||||||
|
#####################################################
|
||||||
|
|
||||||
|
LOCALE=IT
|
||||||
|
|
||||||
22
rus/WEB-INF/classes/truckservice.properties
Normal file
22
rus/WEB-INF/classes/truckservice.properties
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
#####################################################
|
||||||
|
#### D E B U G #####################################
|
||||||
|
#####################################################
|
||||||
|
USE_PARM_HT=true
|
||||||
|
DEBUG=true
|
||||||
|
LOG_FILE=/var/log/tomcat_truck.log
|
||||||
|
DEBUG_LEVEL=1
|
||||||
|
#####################################################
|
||||||
|
######PROPRIETA' UTILIZZATE DALLE SERVLET############
|
||||||
|
#####################################################
|
||||||
|
|
||||||
|
LOCALE=IT
|
||||||
|
|
||||||
|
###### DATI PER CONNESSIONE DB #######
|
||||||
|
dbDriver=3
|
||||||
|
dbName=//localhost/truckservice
|
||||||
|
user=root
|
||||||
|
password=root
|
||||||
|
initialCons=1
|
||||||
|
maxCons=1
|
||||||
|
timeout=300
|
||||||
|
|
||||||
46
rus/WEB-INF/contab.tld
Normal file
46
rus/WEB-INF/contab.tld
Normal file
|
|
@ -0,0 +1,46 @@
|
||||||
|
<?xml version="1.0" encoding="ISO-8859-1" ?>
|
||||||
|
<!DOCTYPE taglib
|
||||||
|
PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN"
|
||||||
|
"http://java.sun.com/j2ee/dtds/web-jsptaglib_1_1.dtd">
|
||||||
|
|
||||||
|
<!-- a tag library descriptor -->
|
||||||
|
|
||||||
|
<taglib>
|
||||||
|
<!-- after this the default space is
|
||||||
|
"http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd"
|
||||||
|
-->
|
||||||
|
|
||||||
|
<!-- The version number of this tag library -->
|
||||||
|
<tlibversion>0.1</tlibversion>
|
||||||
|
|
||||||
|
<!-- The JSP specification version required to function -->
|
||||||
|
<jspversion>1.1</jspversion>
|
||||||
|
|
||||||
|
<!-- The short name of this tag library -->
|
||||||
|
<shortname>contab</shortname>
|
||||||
|
|
||||||
|
<!-- Public URI that uniquely identifies this version of the tag library
|
||||||
|
<uri>http://jakarta.apache.org/taglibs/utility</uri> -->
|
||||||
|
|
||||||
|
<!-- General information about this tag library -->
|
||||||
|
<info>
|
||||||
|
Ecom tag library
|
||||||
|
V.0.0
|
||||||
|
09-10-08 creat contab.tld. Aggiunto documento tag per gestione menu documenti
|
||||||
|
</info>
|
||||||
|
|
||||||
|
<!-- ******************** Defined Custom Tags *************************** -->
|
||||||
|
|
||||||
|
<tag>
|
||||||
|
<name>documento</name>
|
||||||
|
<tagclass>com.ablia.contab.taglib.TipoDocumentoTag</tagclass>
|
||||||
|
<teiclass>com.ablia.contab.taglib.TipoDocumentoTagExtraInfo</teiclass>
|
||||||
|
<info>
|
||||||
|
Elenco ti po docmenti per caricare il menu
|
||||||
|
</info>
|
||||||
|
</tag>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</taglib>
|
||||||
153
rus/WEB-INF/ecom.tld
Normal file
153
rus/WEB-INF/ecom.tld
Normal file
|
|
@ -0,0 +1,153 @@
|
||||||
|
<?xml version="1.0" encoding="ISO-8859-1" ?>
|
||||||
|
<!DOCTYPE taglib
|
||||||
|
PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN"
|
||||||
|
"http://java.sun.com/j2ee/dtds/web-jsptaglib_1_1.dtd">
|
||||||
|
|
||||||
|
<!-- a tag library descriptor -->
|
||||||
|
|
||||||
|
<taglib>
|
||||||
|
<!-- after this the default space is
|
||||||
|
"http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd"
|
||||||
|
-->
|
||||||
|
|
||||||
|
<!-- The version number of this tag library -->
|
||||||
|
<tlibversion>0.1</tlibversion>
|
||||||
|
|
||||||
|
<!-- The JSP specification version required to function -->
|
||||||
|
<jspversion>1.1</jspversion>
|
||||||
|
|
||||||
|
<!-- The short name of this tag library -->
|
||||||
|
<shortname>ablia</shortname>
|
||||||
|
|
||||||
|
<!-- Public URI that uniquely identifies this version of the tag library
|
||||||
|
<uri>http://jakarta.apache.org/taglibs/utility</uri> -->
|
||||||
|
|
||||||
|
<!-- General information about this tag library -->
|
||||||
|
<info>
|
||||||
|
Ecom tag library
|
||||||
|
V.0.5
|
||||||
|
30-06-2009 aggiunto vetrina tag da tuttofoto
|
||||||
|
28-06-2009 aggiornato tipolisthv
|
||||||
|
30-4-2009 aggiunto da gf tipolisthv.. andra' poi spostato su ecom
|
||||||
|
06-01-07 spostato tipolisttree e whiletipo da ablia.tld a ecom.tld
|
||||||
|
11-09-07 inserito NazioniTag
|
||||||
|
</info>
|
||||||
|
|
||||||
|
<!-- ******************** Defined Custom Tags *************************** -->
|
||||||
|
<!-- Nazione tag -->
|
||||||
|
<tag>
|
||||||
|
<name>nazione</name>
|
||||||
|
<tagclass>com.ablia.ecom.taglib.NazioniTag</tagclass>
|
||||||
|
<teiclass>com.ablia.ecom.taglib.NazioniTagExtraInfo</teiclass>
|
||||||
|
<attribute>
|
||||||
|
<name>rowbeanname</name>
|
||||||
|
<required>false</required>
|
||||||
|
<rtexprvalue>true</rtexprvalue>
|
||||||
|
</attribute>
|
||||||
|
<attribute>
|
||||||
|
<name>flgAttivo</name>
|
||||||
|
<required>false</required>
|
||||||
|
<rtexprvalue>true</rtexprvalue>
|
||||||
|
</attribute>
|
||||||
|
|
||||||
|
</tag>
|
||||||
|
<!-- Carica Articoli tag -->
|
||||||
|
<!-- rende disponibile listAV e listA -->
|
||||||
|
<tag>
|
||||||
|
<name>caricaarticoli</name>
|
||||||
|
<tagclass>com.ablia.ecom.taglib.CaricaListaArticoliTag</tagclass>
|
||||||
|
<attribute>
|
||||||
|
<name>id_tipo</name>
|
||||||
|
<required>false</required>
|
||||||
|
<rtexprvalue>true</rtexprvalue>
|
||||||
|
</attribute>
|
||||||
|
<attribute>
|
||||||
|
<name>articoloVariante</name>
|
||||||
|
<required>false</required>
|
||||||
|
<rtexprvalue>true</rtexprvalue>
|
||||||
|
</attribute>
|
||||||
|
</tag>
|
||||||
|
|
||||||
|
<tag>
|
||||||
|
<name>whiletipo</name>
|
||||||
|
<tagclass>com.ablia.ecom.taglib.WhileTipoTag</tagclass>
|
||||||
|
<teiclass>com.ablia.ecom.taglib.WhileTipoTagExtraInfo</teiclass>
|
||||||
|
<info>
|
||||||
|
While tipo
|
||||||
|
</info>
|
||||||
|
<attribute>
|
||||||
|
<name>id_tipoPadre</name>
|
||||||
|
<required>true</required>
|
||||||
|
<rtexprvalue>true</rtexprvalue>
|
||||||
|
</attribute>
|
||||||
|
<attribute>
|
||||||
|
<name>id_tipoPadreSelected</name>
|
||||||
|
<required>false</required>
|
||||||
|
<rtexprvalue>true</rtexprvalue>
|
||||||
|
</attribute>
|
||||||
|
<attribute>
|
||||||
|
<name>lang</name>
|
||||||
|
<required>false</required>
|
||||||
|
<rtexprvalue>true</rtexprvalue>
|
||||||
|
</attribute>
|
||||||
|
<attribute>
|
||||||
|
<name>rowbeanname</name>
|
||||||
|
<required>false</required>
|
||||||
|
<rtexprvalue>true</rtexprvalue>
|
||||||
|
</attribute>
|
||||||
|
</tag>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- TipoListTreeTag tag -->
|
||||||
|
<tag>
|
||||||
|
<name>tipolisttree</name>
|
||||||
|
<tagclass>com.ablia.ecom.taglib.TipoListTreeTag</tagclass>
|
||||||
|
<attribute>
|
||||||
|
<name>id_tipo</name>
|
||||||
|
<required>true</required>
|
||||||
|
<rtexprvalue>true</rtexprvalue>
|
||||||
|
</attribute>
|
||||||
|
</tag>
|
||||||
|
<!-- tipolisthv tag -->
|
||||||
|
<tag>
|
||||||
|
<name>tipolisthv</name>
|
||||||
|
<tagclass>com.ablia.gf.taglib.TipoListMenuHVTag</tagclass>
|
||||||
|
<attribute>
|
||||||
|
<name>id_tipo</name>
|
||||||
|
<required>false</required>
|
||||||
|
<rtexprvalue>true</rtexprvalue>
|
||||||
|
</attribute>
|
||||||
|
<attribute>
|
||||||
|
<name>preLink</name>
|
||||||
|
<required>false</required>
|
||||||
|
<rtexprvalue>true</rtexprvalue>
|
||||||
|
</attribute>
|
||||||
|
<attribute>
|
||||||
|
<name>height</name>
|
||||||
|
<required>false</required>
|
||||||
|
<rtexprvalue>true</rtexprvalue>
|
||||||
|
</attribute>
|
||||||
|
<attribute>
|
||||||
|
<name>width</name>
|
||||||
|
<required>false</required>
|
||||||
|
<rtexprvalue>true</rtexprvalue>
|
||||||
|
</attribute>
|
||||||
|
</tag>
|
||||||
|
<!-- vetrina tag -->
|
||||||
|
<tag>
|
||||||
|
<name>vetrina</name>
|
||||||
|
<tagclass>com.ablia.ecom.taglib.VetrinaTag</tagclass>
|
||||||
|
<teiclass>com.ablia.ecom.taglib.VetrinaTagExtraInfo</teiclass>
|
||||||
|
<attribute>
|
||||||
|
<name>vetrina</name>
|
||||||
|
<required>true</required>
|
||||||
|
<rtexprvalue>true</rtexprvalue>
|
||||||
|
</attribute>
|
||||||
|
<attribute>
|
||||||
|
<name>num</name>
|
||||||
|
<required>true</required>
|
||||||
|
<rtexprvalue>true</rtexprvalue>
|
||||||
|
</attribute>
|
||||||
|
</tag>
|
||||||
|
|
||||||
|
</taglib>
|
||||||
BIN
rus/WEB-INF/lib/ablia.jar
Normal file
BIN
rus/WEB-INF/lib/ablia.jar
Normal file
Binary file not shown.
BIN
rus/WEB-INF/lib/abliaBank.jar
Normal file
BIN
rus/WEB-INF/lib/abliaBank.jar
Normal file
Binary file not shown.
3
rus/WEB-INF/lib/abliaBank_src/META-INF/MANIFEST.MF
Normal file
3
rus/WEB-INF/lib/abliaBank_src/META-INF/MANIFEST.MF
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
Manifest-Version: 1.0
|
||||||
|
Sealed: true
|
||||||
|
|
||||||
|
|
@ -0,0 +1,25 @@
|
||||||
|
package com.ablia.bank;
|
||||||
|
|
||||||
|
import com.ablia.common.Parm;
|
||||||
|
import com.ablia.db.ApplParmFull;
|
||||||
|
import com.ablia.util.Debug;
|
||||||
|
|
||||||
|
public abstract class _BankAdapter extends Debug {
|
||||||
|
private ApplParmFull ap;
|
||||||
|
|
||||||
|
public static final String DEFAULT_OK_KO_PAGE = "payRes.jsp";
|
||||||
|
|
||||||
|
public ApplParmFull getApFull() {
|
||||||
|
return this.ap;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAp(ApplParmFull ap) {
|
||||||
|
this.ap = ap;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Parm getParm(String theKey) {
|
||||||
|
if (getApFull() != null)
|
||||||
|
return getApFull().getParm(theKey);
|
||||||
|
return new Parm();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,319 @@
|
||||||
|
package com.ablia.bank.consel;
|
||||||
|
|
||||||
|
import com.ablia.common.Parm;
|
||||||
|
import com.ablia.db.ApplParmFull;
|
||||||
|
|
||||||
|
public class ConselReq {
|
||||||
|
public static final String P_COD_TIPO_PRODOTTO_CONSEL = "COD_TIPO_PRODOTTO_CONSEL";
|
||||||
|
|
||||||
|
private String tipoesec;
|
||||||
|
|
||||||
|
private String tabfin;
|
||||||
|
|
||||||
|
private String cognome;
|
||||||
|
|
||||||
|
private String nome;
|
||||||
|
|
||||||
|
private String indirizzo;
|
||||||
|
|
||||||
|
private String tel_num;
|
||||||
|
|
||||||
|
private String pref_num;
|
||||||
|
|
||||||
|
private String data_nascita;
|
||||||
|
|
||||||
|
private String testomail;
|
||||||
|
|
||||||
|
private ApplParmFull ap;
|
||||||
|
|
||||||
|
private String ordine;
|
||||||
|
|
||||||
|
private String descri1;
|
||||||
|
|
||||||
|
private String parz1;
|
||||||
|
|
||||||
|
private String h_merce;
|
||||||
|
|
||||||
|
private String h_prod;
|
||||||
|
|
||||||
|
private String convenz;
|
||||||
|
|
||||||
|
private String impdafin;
|
||||||
|
|
||||||
|
public static final String CONSEL_TAB_FIN_90 = "WIP";
|
||||||
|
|
||||||
|
private double anticipo;
|
||||||
|
|
||||||
|
private String impspe;
|
||||||
|
|
||||||
|
private String codfisc;
|
||||||
|
|
||||||
|
public static final String P_CONSEL_IMPORTO_MINIMO = "CONSEL_IMPORTO_MINIMO";
|
||||||
|
|
||||||
|
public static final String P_CONSEL_TEST = "CONSEL_TEST";
|
||||||
|
|
||||||
|
public static final String P_CONSEL_OK_PAGE = "CONSEL_OK_PAGE";
|
||||||
|
|
||||||
|
public static final String CONSEL_TAB_FIN_TASSO_0 = "MPF";
|
||||||
|
|
||||||
|
public static final String CONSEL_TAB_FIN_30 = "WIN";
|
||||||
|
|
||||||
|
public static final String CONSEL_REQUEST_SERVER = "https://reserved.e-consel.it/DOL/faces/frmECProntoTuo.jsp";
|
||||||
|
|
||||||
|
public static final String P_COD_TIPO_MERCE_CONSEL = "COD_TIPO_MERCE_CONSEL";
|
||||||
|
|
||||||
|
public static final String P_COD_CONVENZIONE_CONSEL = "COD_CONVENZIONE_CONSEL";
|
||||||
|
|
||||||
|
public static final String P_CONSEL_ERROR_PAGE = "CONSEL_ERROR_PAGE";
|
||||||
|
|
||||||
|
public static final String P_CONSEL_RATA0 = "CONSEL_RATA0";
|
||||||
|
|
||||||
|
public ConselReq(ApplParmFull l_ap) {
|
||||||
|
setAp(l_ap);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ConselReq() {}
|
||||||
|
|
||||||
|
public String getTipoesec() {
|
||||||
|
return "T";
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTipoesec(String tipoesec) {
|
||||||
|
this.tipoesec = tipoesec;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTabfin() {
|
||||||
|
return (this.tabfin == null) ? "" : this.tabfin.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTabfin(String tabfin) {
|
||||||
|
this.tabfin = tabfin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCognome() {
|
||||||
|
return (this.cognome == null) ? "" : this.cognome.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCognome(String cognome) {
|
||||||
|
this.cognome = cognome;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNome() {
|
||||||
|
return (this.nome == null) ? "" : this.nome.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNome(String nome) {
|
||||||
|
this.nome = nome;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIndirizzo() {
|
||||||
|
return (this.indirizzo == null) ? "" : this.indirizzo.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIndirizzo(String indirizzo) {
|
||||||
|
this.indirizzo = indirizzo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTel_num() {
|
||||||
|
return (this.tel_num == null) ? "" : this.tel_num.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTel_num(String tel_num) {
|
||||||
|
this.tel_num = tel_num;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPref_num() {
|
||||||
|
return (this.pref_num == null) ? "" : this.pref_num.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPref_num(String pref_num) {
|
||||||
|
this.pref_num = pref_num;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getData_nascita() {
|
||||||
|
return (this.data_nascita == null) ? "" : this.data_nascita.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setData_nascita(String data_nascita) {
|
||||||
|
this.data_nascita = data_nascita;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTestomail() {
|
||||||
|
return (this.testomail == null) ? "" : this.testomail.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTestomail(String testomail) {
|
||||||
|
this.testomail = testomail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodfisc() {
|
||||||
|
return (this.codfisc == null) ? "" : this.codfisc.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCodfisc(String codfisc) {
|
||||||
|
this.codfisc = codfisc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOrdine() {
|
||||||
|
return (this.ordine == null) ? "" : this.ordine.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOrdine(String ordine) {
|
||||||
|
this.ordine = ordine;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescri1() {
|
||||||
|
return (this.descri1 == null) ? "" : this.descri1.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDescri1(String descri1) {
|
||||||
|
this.descri1 = descri1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getParz1() {
|
||||||
|
return (this.parz1 == null) ? "" : this.parz1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setParz1(String parz1) {
|
||||||
|
this.parz1 = parz1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getH_merce() {
|
||||||
|
if (this.h_merce == null)
|
||||||
|
this.h_merce = getApFull().getParm("COD_TIPO_MERCE_CONSEL").getTesto();
|
||||||
|
return this.h_merce;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setH_merce(String h_merce) {
|
||||||
|
this.h_merce = h_merce;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getH_prod() {
|
||||||
|
if (this.h_prod == null)
|
||||||
|
this.h_prod = getApFull().getParm("COD_TIPO_PRODOTTO_CONSEL").getTesto();
|
||||||
|
return this.h_prod;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setH_prod(String h_prod) {
|
||||||
|
this.h_prod = h_prod;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getConvenz() {
|
||||||
|
if (this.convenz == null)
|
||||||
|
this.convenz = getApFull().getParm("COD_CONVENZIONE_CONSEL").getTesto()
|
||||||
|
.trim();
|
||||||
|
return this.convenz;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setConvenz(String convenz) {
|
||||||
|
this.convenz = convenz;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getImpdafin() {
|
||||||
|
return (this.impdafin == null) ? "" : this.impdafin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setImpdafin(String impdafin) {
|
||||||
|
this.impdafin = impdafin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getAnticipo() {
|
||||||
|
return this.anticipo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAnticipo(double anticipo) {
|
||||||
|
this.anticipo = anticipo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void initApplicationParms(ApplParmFull ap) {
|
||||||
|
if (ap != null) {
|
||||||
|
String l_tipoParm = "";
|
||||||
|
Parm bean = new Parm(ap);
|
||||||
|
l_tipoParm = "CONSEL";
|
||||||
|
bean.findByCodice("COD_CONVENZIONE_CONSEL");
|
||||||
|
bean.setFlgAdmin(0L);
|
||||||
|
bean.setTipoParm(l_tipoParm);
|
||||||
|
bean.setCodice("COD_CONVENZIONE_CONSEL");
|
||||||
|
bean.setDescrizione("COD_CONVENZIONE_CONSEL");
|
||||||
|
bean.setFlgTipo(0L);
|
||||||
|
bean.setNota("CODICE CONVENZIONE CONSEL");
|
||||||
|
bean.save();
|
||||||
|
bean.findByCodice("COD_TIPO_MERCE_CONSEL");
|
||||||
|
bean.setFlgAdmin(0L);
|
||||||
|
bean.setTipoParm(l_tipoParm);
|
||||||
|
bean.setCodice("COD_TIPO_MERCE_CONSEL");
|
||||||
|
bean.setDescrizione("COD_TIPO_MERCE_CONSEL");
|
||||||
|
bean.setFlgTipo(0L);
|
||||||
|
bean.setNota("CODICE INDICATIVO MERCE FINANZIATA ");
|
||||||
|
bean.save();
|
||||||
|
bean.findByCodice("COD_TIPO_PRODOTTO_CONSEL");
|
||||||
|
bean.setFlgAdmin(0L);
|
||||||
|
bean.setTipoParm(l_tipoParm);
|
||||||
|
bean.setCodice("COD_TIPO_PRODOTTO_CONSEL");
|
||||||
|
bean.setDescrizione("COD_TIPO_PRODOTTO_CONSEL");
|
||||||
|
bean.setFlgTipo(0L);
|
||||||
|
bean.setNota("CODICE INDICATIVO PRODOTTO FINANZIATO");
|
||||||
|
bean.save();
|
||||||
|
bean.findByCodice("CONSEL_ERROR_PAGE");
|
||||||
|
bean.setFlgAdmin(0L);
|
||||||
|
bean.setTipoParm(l_tipoParm);
|
||||||
|
bean.setCodice("CONSEL_ERROR_PAGE");
|
||||||
|
bean.setDescrizione("CONSEL_ERROR_PAGE");
|
||||||
|
bean.setFlgTipo(0L);
|
||||||
|
if (bean.getTesto().equals(""))
|
||||||
|
bean.setTesto("conselRes.jsp");
|
||||||
|
bean.setNota("CONSEL_ERROR_PAGE");
|
||||||
|
bean.save();
|
||||||
|
bean.findByCodice("CONSEL_OK_PAGE");
|
||||||
|
bean.setFlgAdmin(0L);
|
||||||
|
bean.setTipoParm(l_tipoParm);
|
||||||
|
bean.setCodice("CONSEL_OK_PAGE");
|
||||||
|
bean.setDescrizione("CONSEL_OK_PAGE");
|
||||||
|
bean.setFlgTipo(0L);
|
||||||
|
if (bean.getTesto().equals(""))
|
||||||
|
bean.setTesto("conselRes.jsp");
|
||||||
|
bean.setNota("CONSEL_OK_PAGE");
|
||||||
|
bean.save();
|
||||||
|
bean.findByCodice("CONSEL_TEST");
|
||||||
|
bean.setFlgAdmin(1L);
|
||||||
|
bean.setTipoParm(l_tipoParm);
|
||||||
|
bean.setCodice("CONSEL_TEST");
|
||||||
|
bean.setDescrizione("CONSEL_TEST");
|
||||||
|
bean.setFlgTipo(1L);
|
||||||
|
bean.setNota("0-->NO 1-->SI");
|
||||||
|
bean.save();
|
||||||
|
bean.findByCodice("CONSEL_IMPORTO_MINIMO");
|
||||||
|
bean.setFlgAdmin(0L);
|
||||||
|
bean.setTipoParm(l_tipoParm);
|
||||||
|
bean.setCodice("CONSEL_IMPORTO_MINIMO");
|
||||||
|
bean.setDescrizione("CONSEL_IMPORTO_MINIMO");
|
||||||
|
bean.setFlgTipo(1L);
|
||||||
|
bean.setNota("CONSEL_IMPORTO_MINIMO");
|
||||||
|
bean.save();
|
||||||
|
bean.findByCodice("CONSEL_RATA0");
|
||||||
|
bean.setFlgAdmin(0L);
|
||||||
|
bean.setTipoParm(l_tipoParm);
|
||||||
|
bean.setCodice("CONSEL_RATA0");
|
||||||
|
bean.setDescrizione("CONSEL_RATA0");
|
||||||
|
bean.setFlgTipo(1L);
|
||||||
|
bean.setNota(" ATTIVA ANCHE RATA 0 SOPRA L'IMPORTO DEFINITO DA CONSEL_IMPORTO_MINIMO<BR>0: RATA 0 NON ATTIVA<br>1: RATA 0 ATTIVA");
|
||||||
|
bean.save();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getImpspe() {
|
||||||
|
return (this.impspe == null) ? "" : this.impspe;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setImpspe(String impspe) {
|
||||||
|
this.impspe = impspe;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ApplParmFull getApFull() {
|
||||||
|
return this.ap;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAp(ApplParmFull ap) {
|
||||||
|
this.ap = ap;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,67 @@
|
||||||
|
package com.ablia.bank.consel;
|
||||||
|
|
||||||
|
import com.ablia.db.ApplParmFull;
|
||||||
|
|
||||||
|
public class ConselResp {
|
||||||
|
private String pratica;
|
||||||
|
|
||||||
|
private ApplParmFull ap;
|
||||||
|
|
||||||
|
private String ordine;
|
||||||
|
|
||||||
|
private String praticabis;
|
||||||
|
|
||||||
|
private String stato;
|
||||||
|
|
||||||
|
public static final String CONSEL_VALUTAZIONE = "WW";
|
||||||
|
|
||||||
|
public static final String CONSEL_KO = "KO";
|
||||||
|
|
||||||
|
public static final String CONSEL_OK = "OK";
|
||||||
|
|
||||||
|
public ConselResp(ApplParmFull l_ap) {
|
||||||
|
setAp(l_ap);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ConselResp() {}
|
||||||
|
|
||||||
|
public String getOrdine() {
|
||||||
|
return (this.ordine == null) ? "" : this.ordine.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOrdine(String ordine) {
|
||||||
|
this.ordine = ordine;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ApplParmFull getApFull() {
|
||||||
|
return this.ap;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAp(ApplParmFull ap) {
|
||||||
|
this.ap = ap;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPratica() {
|
||||||
|
return (this.pratica == null) ? "" : this.pratica.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPratica(String pratica) {
|
||||||
|
this.pratica = pratica;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPraticabis() {
|
||||||
|
return (this.praticabis == null) ? "" : this.praticabis.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPraticabis(String praticabis) {
|
||||||
|
this.praticabis = praticabis;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStato() {
|
||||||
|
return (this.stato == null) ? "" : this.stato.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStato(String stato) {
|
||||||
|
this.stato = stato;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,184 @@
|
||||||
|
package com.ablia.bank.consel;
|
||||||
|
|
||||||
|
import com.ablia.db.ApplParmFull;
|
||||||
|
import com.ablia.db.DBAdapter;
|
||||||
|
import com.ablia.db.ResParm;
|
||||||
|
import com.ablia.db.WcString;
|
||||||
|
import com.ablia.util.Vectumerator;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.sql.PreparedStatement;
|
||||||
|
import java.sql.SQLException;
|
||||||
|
|
||||||
|
public class ConselTabfin extends DBAdapter implements Serializable {
|
||||||
|
public static final double MIN_FIN = 168.0D;
|
||||||
|
|
||||||
|
public static final double MAX_FIN = 7500.0D;
|
||||||
|
|
||||||
|
private long id_conselTabfin;
|
||||||
|
|
||||||
|
private String flgTipo;
|
||||||
|
|
||||||
|
private double valoreBene;
|
||||||
|
|
||||||
|
private long durata;
|
||||||
|
|
||||||
|
private double importoRata;
|
||||||
|
|
||||||
|
private double tan;
|
||||||
|
|
||||||
|
private double taeg;
|
||||||
|
|
||||||
|
private double interessi;
|
||||||
|
|
||||||
|
private double speseGestSingolaRata;
|
||||||
|
|
||||||
|
private double speseGestTotaleRata;
|
||||||
|
|
||||||
|
private double impostaBollo;
|
||||||
|
|
||||||
|
private double importoTotaleDovuto;
|
||||||
|
|
||||||
|
public ConselTabfin(ApplParmFull newApplParmFull) {
|
||||||
|
super(newApplParmFull);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ConselTabfin() {}
|
||||||
|
|
||||||
|
public void setId_conselTabfin(long newId_conselTabfin) {
|
||||||
|
this.id_conselTabfin = newId_conselTabfin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFlgTipo(String newFlgTipo) {
|
||||||
|
this.flgTipo = newFlgTipo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setValoreBene(double newValoreBene) {
|
||||||
|
this.valoreBene = newValoreBene;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDurata(long newDurata) {
|
||||||
|
this.durata = newDurata;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setImportoRata(double newImportoRata) {
|
||||||
|
this.importoRata = newImportoRata;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTan(double newTan) {
|
||||||
|
this.tan = newTan;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTaeg(double newTaeg) {
|
||||||
|
this.taeg = newTaeg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInteressi(double newInteressi) {
|
||||||
|
this.interessi = newInteressi;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSpeseGestSingolaRata(double newSpeseGestSingolaRata) {
|
||||||
|
this.speseGestSingolaRata = newSpeseGestSingolaRata;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSpeseGestTotaleRata(double newSpeseGestTotaleRata) {
|
||||||
|
this.speseGestTotaleRata = newSpeseGestTotaleRata;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setImpostaBollo(double newImpostaBollo) {
|
||||||
|
this.impostaBollo = newImpostaBollo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setImportoTotaleDovuto(double newImportoTotaleDovuto) {
|
||||||
|
this.importoTotaleDovuto = newImportoTotaleDovuto;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getId_conselTabfin() {
|
||||||
|
return this.id_conselTabfin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFlgTipo() {
|
||||||
|
return (this.flgTipo == null) ? "" : this.flgTipo.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getValoreBene() {
|
||||||
|
return this.valoreBene;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getDurata() {
|
||||||
|
return this.durata;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getImportoRata() {
|
||||||
|
return this.importoRata;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getTan() {
|
||||||
|
return this.tan;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getTaeg() {
|
||||||
|
return this.taeg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getInteressi() {
|
||||||
|
return this.interessi;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getSpeseGestSingolaRata() {
|
||||||
|
return this.speseGestSingolaRata;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getSpeseGestTotaleRata() {
|
||||||
|
return this.speseGestTotaleRata;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getImpostaBollo() {
|
||||||
|
return this.impostaBollo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getImportoTotaleDovuto() {
|
||||||
|
return this.importoTotaleDovuto;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected ResParm checkDeleteCascade() {
|
||||||
|
return new ResParm(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void deleteCascade() {}
|
||||||
|
|
||||||
|
public Vectumerator findByCR(ConselTabfinCR CR, int pageNumber, int pageRows) {
|
||||||
|
String s_Sql_Find = "select DISTINCT A.* from CONSEL_TABFIN AS A";
|
||||||
|
String s_Sql_Order = "";
|
||||||
|
WcString wc = new WcString();
|
||||||
|
if (CR.getValoreBene() > 0.0D)
|
||||||
|
wc.addWc("A.valoreBene=" + CR.getValoreBene());
|
||||||
|
if (!CR.getFlgTipo().isEmpty())
|
||||||
|
wc.addWc("A.flgTipo='" + CR.getFlgTipo() + "'");
|
||||||
|
if (CR.getDurata() > 0L)
|
||||||
|
wc.addWc("A.durata=" + CR.getDurata());
|
||||||
|
try {
|
||||||
|
PreparedStatement stmt = getConn().prepareStatement(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||||
|
return findRows(stmt, pageNumber, pageRows);
|
||||||
|
} catch (SQLException e) {
|
||||||
|
removeCPConnection();
|
||||||
|
handleDebug(e);
|
||||||
|
return AB_EMPTY_VECTUMERATOR;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void findByTipoValoreDurata(String l_flgTipo, double l_valore, long l_durata) {
|
||||||
|
String s_Sql_Find = "select DISTINCT A.* from CONSEL_TABFIN AS A";
|
||||||
|
String s_Sql_Order = "";
|
||||||
|
WcString wc = new WcString();
|
||||||
|
wc.addWc("A.valoreBene=" + Math.round(l_valore));
|
||||||
|
wc.addWc("A.flgTipo='" + l_flgTipo + "'");
|
||||||
|
wc.addWc("A.durata=" + l_durata);
|
||||||
|
try {
|
||||||
|
PreparedStatement stmt = getConn().prepareStatement(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||||
|
findFirstRecord(stmt);
|
||||||
|
} catch (SQLException e) {
|
||||||
|
removeCPConnection();
|
||||||
|
handleDebug(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,132 @@
|
||||||
|
package com.ablia.bank.consel;
|
||||||
|
|
||||||
|
import com.ablia.db.ApplParmFull;
|
||||||
|
import com.ablia.db.CRAdapter;
|
||||||
|
|
||||||
|
public class ConselTabfinCR extends CRAdapter {
|
||||||
|
private long id_conselTabfin;
|
||||||
|
|
||||||
|
private String flgTipo;
|
||||||
|
|
||||||
|
private double valoreBene;
|
||||||
|
|
||||||
|
private long durata;
|
||||||
|
|
||||||
|
private double importoRata;
|
||||||
|
|
||||||
|
private double tan;
|
||||||
|
|
||||||
|
private double taeg;
|
||||||
|
|
||||||
|
private double interessi;
|
||||||
|
|
||||||
|
private double speseGestSingolaRata;
|
||||||
|
|
||||||
|
private double speseGestTotaleRata;
|
||||||
|
|
||||||
|
private double impostaBollo;
|
||||||
|
|
||||||
|
private double importoTotaleDovuto;
|
||||||
|
|
||||||
|
public ConselTabfinCR(ApplParmFull newApplParmFull) {
|
||||||
|
super(newApplParmFull);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ConselTabfinCR() {}
|
||||||
|
|
||||||
|
public void setId_conselTabfin(long newId_conselTabfin) {
|
||||||
|
this.id_conselTabfin = newId_conselTabfin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFlgTipo(String newFlgTipo) {
|
||||||
|
this.flgTipo = newFlgTipo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setValoreBene(double newValoreBene) {
|
||||||
|
this.valoreBene = newValoreBene;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDurata(long newDurata) {
|
||||||
|
this.durata = newDurata;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setImportoRata(double newImportoRata) {
|
||||||
|
this.importoRata = newImportoRata;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTan(double newTan) {
|
||||||
|
this.tan = newTan;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTaeg(double newTaeg) {
|
||||||
|
this.taeg = newTaeg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInteressi(double newInteressi) {
|
||||||
|
this.interessi = newInteressi;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSpeseGestSingolaRata(double newSpeseGestSingolaRata) {
|
||||||
|
this.speseGestSingolaRata = newSpeseGestSingolaRata;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSpeseGestTotaleRata(double newSpeseGestTotaleRata) {
|
||||||
|
this.speseGestTotaleRata = newSpeseGestTotaleRata;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setImpostaBollo(double newImpostaBollo) {
|
||||||
|
this.impostaBollo = newImpostaBollo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setImportoTotaleDovuto(double newImportoTotaleDovuto) {
|
||||||
|
this.importoTotaleDovuto = newImportoTotaleDovuto;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getId_conselTabfin() {
|
||||||
|
return this.id_conselTabfin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFlgTipo() {
|
||||||
|
return (this.flgTipo == null) ? "" : this.flgTipo.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getValoreBene() {
|
||||||
|
return this.valoreBene;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getDurata() {
|
||||||
|
return this.durata;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getImportoRata() {
|
||||||
|
return this.importoRata;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getTan() {
|
||||||
|
return this.tan;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getTaeg() {
|
||||||
|
return this.taeg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getInteressi() {
|
||||||
|
return this.interessi;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getSpeseGestSingolaRata() {
|
||||||
|
return this.speseGestSingolaRata;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getSpeseGestTotaleRata() {
|
||||||
|
return this.speseGestTotaleRata;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getImpostaBollo() {
|
||||||
|
return this.impostaBollo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getImportoTotaleDovuto() {
|
||||||
|
return this.importoTotaleDovuto;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,246 @@
|
||||||
|
package com.ablia.bank.infogroup;
|
||||||
|
|
||||||
|
import com.ablia.bank._BankAdapter;
|
||||||
|
import com.ablia.common.Parm;
|
||||||
|
import com.ablia.db.ApplParmFull;
|
||||||
|
import java.text.NumberFormat;
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
|
public class ShopnetReq extends _BankAdapter {
|
||||||
|
public static final String LANG_CODE_IT = "0";
|
||||||
|
|
||||||
|
public static final String LANG_CODE_EN = "1";
|
||||||
|
|
||||||
|
public static final String LANG_CODE_ES = "2";
|
||||||
|
|
||||||
|
public static final String LANG_CODE_DE = "3";
|
||||||
|
|
||||||
|
public static final String DIV_CODE_EURO = "1";
|
||||||
|
|
||||||
|
private static NumberFormat nf2;
|
||||||
|
|
||||||
|
private String f;
|
||||||
|
|
||||||
|
private String l;
|
||||||
|
|
||||||
|
private String m;
|
||||||
|
|
||||||
|
private String o;
|
||||||
|
|
||||||
|
private String i;
|
||||||
|
|
||||||
|
private String d;
|
||||||
|
|
||||||
|
private String p;
|
||||||
|
|
||||||
|
private String c;
|
||||||
|
|
||||||
|
private String u;
|
||||||
|
|
||||||
|
private String n;
|
||||||
|
|
||||||
|
private String e;
|
||||||
|
|
||||||
|
private String action;
|
||||||
|
|
||||||
|
public static final String P_PAYMENT_ERROR_PAGE = "PAY_KO";
|
||||||
|
|
||||||
|
public static final String P_PAYMENT_OK_PAGE = "PAY_OK";
|
||||||
|
|
||||||
|
public static final long CC_DINERS = 2L;
|
||||||
|
|
||||||
|
public static final long CC_MASTERCARD = 1L;
|
||||||
|
|
||||||
|
public static final long CC_AMEX = 3L;
|
||||||
|
|
||||||
|
public static final long CC_VISA = 0L;
|
||||||
|
|
||||||
|
public static final String P_SHOPNET_PID = "SHOPNET_PID";
|
||||||
|
|
||||||
|
public static final String P_SHOPNET_ID = "SHOPNET_ID";
|
||||||
|
|
||||||
|
public static final String DEFAULT_SHOPNET_ACTION = "https://ecommerce.infogroup.it/shopnetplus/do";
|
||||||
|
|
||||||
|
public ShopnetReq() {}
|
||||||
|
|
||||||
|
public ShopnetReq(String lang) {
|
||||||
|
setlang(lang);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setlang(String l_lang) {
|
||||||
|
if (l_lang.toLowerCase().equals("it")) {
|
||||||
|
setL("0");
|
||||||
|
} else if (l_lang.toLowerCase().equals("en")) {
|
||||||
|
setL("1");
|
||||||
|
} else if (l_lang.toLowerCase().equals("es\t")) {
|
||||||
|
setL("2");
|
||||||
|
} else {
|
||||||
|
setL("0");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getF() {
|
||||||
|
return (this.f == null) ? "" : this.f.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setF(String f) {
|
||||||
|
this.f = f;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getL() {
|
||||||
|
return (this.l == null) ? "" : this.l.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setL(String l) {
|
||||||
|
this.l = l;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getM() {
|
||||||
|
return (this.m == null) ? "" : this.m.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setM(String m) {
|
||||||
|
this.m = m;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getO() {
|
||||||
|
return (this.o == null) ? "" : this.o.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setO(String o) {
|
||||||
|
this.o = o;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getI() {
|
||||||
|
return (this.i == null) ? "" : this.i.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setI(String i) {
|
||||||
|
this.i = i;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getD() {
|
||||||
|
return (this.d == null) ? "" : this.d.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setD(String d) {
|
||||||
|
this.d = d;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getP() {
|
||||||
|
return (this.p == null) ? "" : this.p.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setP(String p) {
|
||||||
|
this.p = p;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getC() {
|
||||||
|
return (this.c == null) ? "" : this.c.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setC(String c) {
|
||||||
|
this.c = c;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getU() {
|
||||||
|
return (this.u == null) ? "" : this.u.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setU(String u) {
|
||||||
|
this.u = u;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getN() {
|
||||||
|
return (this.n == null) ? "" : this.n.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setN(String n) {
|
||||||
|
this.n = n;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getE() {
|
||||||
|
return (this.e == null) ? "" : this.e.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setE(String e) {
|
||||||
|
this.e = e;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAction() {
|
||||||
|
return (this.action == null) ? "https://ecommerce.infogroup.it/shopnetplus/do" : this.action.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAction(String action) {
|
||||||
|
this.action = action;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setImporto(double l_importo) {}
|
||||||
|
|
||||||
|
public NumberFormat getNf2() {
|
||||||
|
if (nf2 == null) {
|
||||||
|
nf2 = NumberFormat.getInstance(Locale.ITALIAN);
|
||||||
|
nf2.setMaximumFractionDigits(2);
|
||||||
|
nf2.setMinimumFractionDigits(2);
|
||||||
|
}
|
||||||
|
return nf2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void initApplicationParms(ApplParmFull ap) {
|
||||||
|
if (ap != null) {
|
||||||
|
String l_tipoParm = "SHOPNET";
|
||||||
|
Parm bean = new Parm(ap);
|
||||||
|
l_tipoParm = "SHOPNET";
|
||||||
|
bean.findByCodice("PAY_KO");
|
||||||
|
bean.setFlgAdmin(0L);
|
||||||
|
bean.setTipoParm(l_tipoParm);
|
||||||
|
bean.setCodice("PAY_KO");
|
||||||
|
bean.setDescrizione("PAY_KO");
|
||||||
|
bean.setFlgTipo(0L);
|
||||||
|
if (bean.getTesto().equals(""))
|
||||||
|
bean.setTesto("payRes.jsp");
|
||||||
|
bean.setNota("PAY_KO");
|
||||||
|
bean.save();
|
||||||
|
bean.findByCodice("PAY_OK");
|
||||||
|
bean.setFlgAdmin(0L);
|
||||||
|
bean.setTipoParm(l_tipoParm);
|
||||||
|
bean.setCodice("PAY_OK");
|
||||||
|
bean.setDescrizione("PAY_OK");
|
||||||
|
bean.setFlgTipo(0L);
|
||||||
|
if (bean.getTesto().equals(""))
|
||||||
|
bean.setTesto("payRes.jsp");
|
||||||
|
bean.setNota("PAY_OK");
|
||||||
|
bean.save();
|
||||||
|
bean.findByCodice("SHOPNET_ID");
|
||||||
|
bean.setFlgAdmin(0L);
|
||||||
|
bean.setTipoParm(l_tipoParm);
|
||||||
|
bean.setCodice("SHOPNET_ID");
|
||||||
|
bean.setDescrizione("SHOPNET_ID");
|
||||||
|
bean.setFlgTipo(0L);
|
||||||
|
bean.setNota("SHOPNET_ID");
|
||||||
|
bean.save();
|
||||||
|
bean.findByCodice("SHOPNET_PID");
|
||||||
|
bean.setFlgAdmin(0L);
|
||||||
|
bean.setTipoParm(l_tipoParm);
|
||||||
|
bean.setCodice("SHOPNET_PID");
|
||||||
|
bean.setDescrizione("SHOPNET_PID");
|
||||||
|
bean.setFlgTipo(0L);
|
||||||
|
bean.setNota("SHOPNET_PID");
|
||||||
|
bean.save();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final String getCC(long l_cc) {
|
||||||
|
switch ((int)l_cc) {
|
||||||
|
case 3:
|
||||||
|
return "American Express";
|
||||||
|
case 2:
|
||||||
|
return "Diners";
|
||||||
|
case 1:
|
||||||
|
return "Mastercard";
|
||||||
|
case 0:
|
||||||
|
return "Visa";
|
||||||
|
}
|
||||||
|
return "??";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,79 @@
|
||||||
|
package com.ablia.bank.infogroup;
|
||||||
|
|
||||||
|
import com.ablia.bank._BankAdapter;
|
||||||
|
|
||||||
|
public class ShopnetResp extends _BankAdapter {
|
||||||
|
private long m;
|
||||||
|
|
||||||
|
private long o;
|
||||||
|
|
||||||
|
private long l;
|
||||||
|
|
||||||
|
private String a;
|
||||||
|
|
||||||
|
private long s;
|
||||||
|
|
||||||
|
private long id_ordine;
|
||||||
|
|
||||||
|
public static final long STATO_TRANS_NON_RICH = 1L;
|
||||||
|
|
||||||
|
public static final long STATO_TRANS_GESTITA = 2L;
|
||||||
|
|
||||||
|
public void fillResponse(String bean) {}
|
||||||
|
|
||||||
|
public long getId_ordine() {
|
||||||
|
return this.id_ordine;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getA() {
|
||||||
|
return (this.a == null) ? "" : this.a.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setA(String a) {
|
||||||
|
this.a = a;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getM() {
|
||||||
|
return this.m;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setM(long m) {
|
||||||
|
this.m = m;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getO() {
|
||||||
|
return this.o;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setO(long o) {
|
||||||
|
this.o = o;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getL() {
|
||||||
|
return this.l;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setL(long l) {
|
||||||
|
this.l = l;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getS() {
|
||||||
|
return this.s;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setS(long s) {
|
||||||
|
this.s = s;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getStato() {
|
||||||
|
return getS();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodiceAutorizzazione() {
|
||||||
|
return getA();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId_ordine(long id_ordine) {
|
||||||
|
this.id_ordine = id_ordine;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,349 @@
|
||||||
|
package com.ablia.bank.keyclient;
|
||||||
|
|
||||||
|
import com.ablia.bank._BankAdapter;
|
||||||
|
import com.ablia.common.Parm;
|
||||||
|
import com.ablia.db.ApplParmFull;
|
||||||
|
import com.ablia.reg.EcDc;
|
||||||
|
import java.net.URLEncoder;
|
||||||
|
|
||||||
|
public class KeyClientReq extends _BankAdapter {
|
||||||
|
public static final String LANG_CODE_IT = "ITA";
|
||||||
|
|
||||||
|
public static final String LANG_CODE_EN = "ENG";
|
||||||
|
|
||||||
|
public static final String LANG_CODE_ES = "SPA";
|
||||||
|
|
||||||
|
public static final String LANG_CODE_FR = "FRA";
|
||||||
|
|
||||||
|
public static final String LANG_CODE_DE = "GER";
|
||||||
|
|
||||||
|
public static final String LANG_CODE_ITA_ENG = "ITA-ENG";
|
||||||
|
|
||||||
|
public static final String LANG_CODE_JPN = "JPN";
|
||||||
|
|
||||||
|
public static final String DIV_CODE_LIRA = "18";
|
||||||
|
|
||||||
|
public static final String DIV_CODE_EURO = "242";
|
||||||
|
|
||||||
|
public static final String DIV_CODE_STERLINE = "2";
|
||||||
|
|
||||||
|
public static final String DIV_CODE_YEN = "71";
|
||||||
|
|
||||||
|
public static final String DIV_CODE_DOLLARL_HK = "103";
|
||||||
|
|
||||||
|
public static final String DIV_CODE_REAL = "234";
|
||||||
|
|
||||||
|
private String divisa;
|
||||||
|
|
||||||
|
private String codTrans;
|
||||||
|
|
||||||
|
private String mail;
|
||||||
|
|
||||||
|
private String importo;
|
||||||
|
|
||||||
|
private String languageId;
|
||||||
|
|
||||||
|
private String alias;
|
||||||
|
|
||||||
|
private String key;
|
||||||
|
|
||||||
|
private String url;
|
||||||
|
|
||||||
|
private String url_back;
|
||||||
|
|
||||||
|
public static final String P_KC_KEY = "KC_KEY";
|
||||||
|
|
||||||
|
public static final String P_URL_RESPONSE = "KC_URL_RESPONSE";
|
||||||
|
|
||||||
|
public static final String P_KC_ALIAS = "KC_ALIAS";
|
||||||
|
|
||||||
|
public static final String P_PAYMENT_OK_PAGE = "KC_PAY_OK";
|
||||||
|
|
||||||
|
public static final String P_PAYMENT_ERROR_PAGE = "KC_PAY_KO";
|
||||||
|
|
||||||
|
public static final String P_URL_RESPONSE_NULL = "KC_URL_RESPONSE_NULL";
|
||||||
|
|
||||||
|
public static final String TEST_ALIAS = "payment_testm_urlmac";
|
||||||
|
|
||||||
|
public static final String REQ_URL = "https://ecommerce.cim-italia.it/ecomm/DispatcherServlet";
|
||||||
|
|
||||||
|
public static final String DIV_CODE_DOLLARI = "1";
|
||||||
|
|
||||||
|
public String getCodTrans() {
|
||||||
|
return (this.codTrans == null) ? "" : this.codTrans;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCodTrans(String myamount) {
|
||||||
|
this.codTrans = myamount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getImporto() {
|
||||||
|
return (this.importo == null) ? "" : this.importo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setImporto(String mybuyeremail) {
|
||||||
|
this.importo = mybuyeremail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMail() {
|
||||||
|
return (this.mail == null) ? "" : this.mail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMail(String mybuyername) {
|
||||||
|
this.mail = mybuyername;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDivisa() {
|
||||||
|
return (this.divisa == null) ? "" : this.divisa;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDivisa(String mycurrency) {
|
||||||
|
this.divisa = mycurrency;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAlias() {
|
||||||
|
return (this.alias == null) ? "" : this.alias;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAlias(String mycustominfo) {
|
||||||
|
this.alias = mycustominfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String getMylanguageCode() {
|
||||||
|
if (getLanguageId().toLowerCase().equals("it"))
|
||||||
|
return "ITA";
|
||||||
|
if (getLanguageId().toLowerCase().equals("en"))
|
||||||
|
return "ENG";
|
||||||
|
if (getLanguageId().toLowerCase().equals("es\t"))
|
||||||
|
return "SPA";
|
||||||
|
if (getLanguageId().toLowerCase().equals("fr"))
|
||||||
|
return "FRA";
|
||||||
|
if (getLanguageId().toLowerCase().equals("de"))
|
||||||
|
return "GER";
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMacEsempio() {
|
||||||
|
String temp = "codTrans=" + getCodTrans() + "divisa=" + getDivisa() +
|
||||||
|
"importo=1esempiodicalcolomac";
|
||||||
|
String res = "";
|
||||||
|
try {
|
||||||
|
res = URLEncoder.encode(EcDc.encode64String(EcDc.cryptMD5Plain(temp)),
|
||||||
|
"UTF-8");
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMac() {
|
||||||
|
String temp = "codTrans=" + getCodTrans() + "divisa=" + getDivisa() +
|
||||||
|
"importo=" + getImportoUrl() + getKey();
|
||||||
|
String res = "";
|
||||||
|
try {
|
||||||
|
res = URLEncoder.encode(EcDc.encode64String(EcDc.cryptMD5Plain(temp)),
|
||||||
|
"UTF-8");
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLanguageId() {
|
||||||
|
return (this.languageId == null) ? "" : this.languageId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLanguageId(String lang) {
|
||||||
|
this.languageId = lang;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFullRequestUrl() {
|
||||||
|
StringBuffer theUrl = new StringBuffer("https://ecommerce.cim-italia.it/ecomm/DispatcherServlet");
|
||||||
|
theUrl.append("alias=");
|
||||||
|
theUrl.append(getAlias());
|
||||||
|
theUrl.append("&importo=");
|
||||||
|
theUrl.append(getImporto());
|
||||||
|
theUrl.append("&divisa=");
|
||||||
|
theUrl.append(getDivisa());
|
||||||
|
theUrl.append("&codTrans=");
|
||||||
|
theUrl.append(getCodTrans());
|
||||||
|
theUrl.append("&mail=");
|
||||||
|
theUrl.append(getMail());
|
||||||
|
theUrl.append("&mac=");
|
||||||
|
try {
|
||||||
|
theUrl.append(URLEncoder.encode(getMac(), "UTF-8"));
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
theUrl.append("&languageId=");
|
||||||
|
theUrl.append(getLanguageId());
|
||||||
|
theUrl.append("&url=");
|
||||||
|
theUrl.append(getUrl());
|
||||||
|
if (!getUrl_back().isEmpty()) {
|
||||||
|
theUrl.append("&url_back=");
|
||||||
|
theUrl.append(getUrl_back());
|
||||||
|
}
|
||||||
|
return theUrl.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRequestUrl() {
|
||||||
|
StringBuffer theUrl = new StringBuffer("https://ecommerce.cim-italia.it/ecomm/DispatcherServlet");
|
||||||
|
theUrl.append("?alias=");
|
||||||
|
theUrl.append(getAlias());
|
||||||
|
theUrl.append("&importo=");
|
||||||
|
theUrl.append(getImportoUrl());
|
||||||
|
theUrl.append("&divisa=");
|
||||||
|
theUrl.append(getDivisa());
|
||||||
|
theUrl.append("&codTrans=");
|
||||||
|
theUrl.append(getCodTrans());
|
||||||
|
theUrl.append("&mail=");
|
||||||
|
theUrl.append(getMail());
|
||||||
|
theUrl.append("&mac=");
|
||||||
|
try {
|
||||||
|
theUrl.append(URLEncoder.encode(getMac(), "UTF-8"));
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
theUrl.append("&languageId=");
|
||||||
|
theUrl.append(getLanguageId());
|
||||||
|
theUrl.append("&url=");
|
||||||
|
theUrl.append(getUrl());
|
||||||
|
if (!getUrl_back().isEmpty()) {
|
||||||
|
theUrl.append("&url_back=");
|
||||||
|
theUrl.append(getUrl_back());
|
||||||
|
}
|
||||||
|
return theUrl.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getKey() {
|
||||||
|
return this.key;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setKey(String key) {
|
||||||
|
this.key = key;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getImportoUrl() {
|
||||||
|
if (this.importo == null)
|
||||||
|
return "0000";
|
||||||
|
String temp = this.importo;
|
||||||
|
if (temp.indexOf('.') < 0) {
|
||||||
|
temp = String.valueOf(temp) + "00";
|
||||||
|
} else if (temp.length() - temp.indexOf('.') < 3) {
|
||||||
|
temp = String.valueOf(temp) + "0";
|
||||||
|
}
|
||||||
|
return temp.replace(".", "");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUrl() {
|
||||||
|
return (this.url == null) ? "" : this.url.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUrl(String url) {
|
||||||
|
this.url = url;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUrl_back() {
|
||||||
|
return (this.url_back == null) ? "" : this.url_back.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUrl_back(String url_back) {
|
||||||
|
this.url_back = url_back;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTestRequestUrl() {
|
||||||
|
StringBuffer theUrl = new StringBuffer("https://ecommerce.cim-italia.it/ecomm/DispatcherServlet");
|
||||||
|
theUrl.append("?alias=");
|
||||||
|
theUrl.append("payment_testm_urlmac");
|
||||||
|
theUrl.append("&importo=1");
|
||||||
|
theUrl.append("&divisa=");
|
||||||
|
theUrl.append(getDivisa());
|
||||||
|
theUrl.append("&codTrans=");
|
||||||
|
theUrl.append(getCodTrans());
|
||||||
|
theUrl.append("&mail=");
|
||||||
|
theUrl.append(getMail());
|
||||||
|
theUrl.append("&mac=");
|
||||||
|
try {
|
||||||
|
theUrl.append(URLEncoder.encode(getMacEsempio(), "UTF-8"));
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
theUrl.append("&languageId=");
|
||||||
|
theUrl.append(getLanguageId());
|
||||||
|
theUrl.append("&url=");
|
||||||
|
theUrl.append(getUrl());
|
||||||
|
if (!getUrl_back().isEmpty()) {
|
||||||
|
theUrl.append("&url_back=");
|
||||||
|
theUrl.append(getUrl_back());
|
||||||
|
}
|
||||||
|
return theUrl.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void initApplicationParms(ApplParmFull ap) {
|
||||||
|
if (ap != null) {
|
||||||
|
String l_tipoParm = "PAYPAL";
|
||||||
|
Parm bean = new Parm(ap);
|
||||||
|
l_tipoParm = "KEY CLIENT";
|
||||||
|
bean.findByCodice("KC_PAY_KO");
|
||||||
|
bean.setFlgAdmin(0L);
|
||||||
|
bean.setTipoParm(l_tipoParm);
|
||||||
|
bean.setCodice("KC_PAY_KO");
|
||||||
|
bean.setDescrizione("KC_PAY_KO");
|
||||||
|
bean.setFlgTipo(0L);
|
||||||
|
if (bean.getTesto().equals(""))
|
||||||
|
bean.setTesto("payRes.jsp");
|
||||||
|
bean.setNota("KC_PAY_KO");
|
||||||
|
bean.save();
|
||||||
|
bean.findByCodice("KC_PAY_OK");
|
||||||
|
bean.setFlgAdmin(0L);
|
||||||
|
bean.setTipoParm(l_tipoParm);
|
||||||
|
bean.setCodice("KC_PAY_OK");
|
||||||
|
bean.setDescrizione("KC_PAY_OK");
|
||||||
|
bean.setFlgTipo(0L);
|
||||||
|
if (bean.getTesto().equals(""))
|
||||||
|
bean.setTesto("payRes.jsp");
|
||||||
|
bean.setNota("KC_PAY_OK");
|
||||||
|
bean.save();
|
||||||
|
bean.findByCodice("KC_KEY");
|
||||||
|
bean.setFlgAdmin(0L);
|
||||||
|
bean.setTipoParm(l_tipoParm);
|
||||||
|
bean.setCodice("KC_KEY");
|
||||||
|
bean.setDescrizione("KC_KEY");
|
||||||
|
bean.setFlgTipo(0L);
|
||||||
|
if (bean.getTesto().equals(""))
|
||||||
|
bean.setTesto("esempiodicalcolomac");
|
||||||
|
bean.setNota("KC_KEY. mac di esempio: esempiodicalcolomac");
|
||||||
|
bean.save();
|
||||||
|
bean.findByCodice("KC_ALIAS");
|
||||||
|
bean.setFlgAdmin(0L);
|
||||||
|
bean.setTipoParm(l_tipoParm);
|
||||||
|
bean.setCodice("KC_ALIAS");
|
||||||
|
bean.setDescrizione("KC_ALIAS");
|
||||||
|
bean.setFlgTipo(0L);
|
||||||
|
if (bean.getTesto().equals(""))
|
||||||
|
bean.setTesto("payment_testm_urlmac");
|
||||||
|
bean.setNota("KC_KEY. ALIAS DI TEST: payment_testm_urlmac");
|
||||||
|
bean.save();
|
||||||
|
bean.findByCodice("KC_URL_RESPONSE_NULL");
|
||||||
|
bean.setFlgAdmin(0L);
|
||||||
|
bean.setTipoParm(l_tipoParm);
|
||||||
|
bean.setCodice("KC_URL_RESPONSE_NULL");
|
||||||
|
bean.setDescrizione("KC_URL_RESPONSE_NULL");
|
||||||
|
bean.setFlgTipo(0L);
|
||||||
|
if (bean.getTesto().equals(""))
|
||||||
|
bean.setTesto("http://localhost/td/RicevutaKC.abl");
|
||||||
|
bean.setNota("KC_PAY_OK");
|
||||||
|
bean.save();
|
||||||
|
bean.findByCodice("KC_URL_RESPONSE");
|
||||||
|
bean.setFlgAdmin(0L);
|
||||||
|
bean.setTipoParm(l_tipoParm);
|
||||||
|
bean.setCodice("KC_URL_RESPONSE");
|
||||||
|
bean.setDescrizione("KC_URL_RESPONSE");
|
||||||
|
bean.setFlgTipo(0L);
|
||||||
|
if (bean.getTesto().equals(""))
|
||||||
|
bean.setTesto("http://localhost/td/RicevutaKC.abl");
|
||||||
|
bean.setNota("KC_URL_RESPONSE");
|
||||||
|
bean.save();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,149 @@
|
||||||
|
package com.ablia.bank.keyclient;
|
||||||
|
|
||||||
|
import com.ablia.bank._BankAdapter;
|
||||||
|
|
||||||
|
public class KeyClientResp extends _BankAdapter {
|
||||||
|
private long id_ordine;
|
||||||
|
|
||||||
|
private String importo;
|
||||||
|
|
||||||
|
private String data;
|
||||||
|
|
||||||
|
private String divisa;
|
||||||
|
|
||||||
|
private String session_id;
|
||||||
|
|
||||||
|
private String codTrans;
|
||||||
|
|
||||||
|
private String orario;
|
||||||
|
|
||||||
|
private String esito;
|
||||||
|
|
||||||
|
private String codAut;
|
||||||
|
|
||||||
|
private String BRAND;
|
||||||
|
|
||||||
|
private String nome;
|
||||||
|
|
||||||
|
private String cognome;
|
||||||
|
|
||||||
|
private String email;
|
||||||
|
|
||||||
|
private String mac;
|
||||||
|
|
||||||
|
public static final String ESITO_OK = "OK";
|
||||||
|
|
||||||
|
public static final String ESITO_KO = "KO";
|
||||||
|
|
||||||
|
public long getId_ordine() {
|
||||||
|
return this.id_ordine;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId_ordine(long id_ordine) {
|
||||||
|
this.id_ordine = id_ordine;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getImporto() {
|
||||||
|
return this.importo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setImporto(String importo) {
|
||||||
|
this.importo = importo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getData() {
|
||||||
|
return this.data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setData(String data) {
|
||||||
|
this.data = data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDivisa() {
|
||||||
|
return this.divisa;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDivisa(String divisa) {
|
||||||
|
this.divisa = divisa;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSession_id() {
|
||||||
|
return this.session_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSession_id(String session_id) {
|
||||||
|
this.session_id = session_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodTrans() {
|
||||||
|
return this.codTrans;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCodTrans(String codTrans) {
|
||||||
|
this.codTrans = codTrans;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOrario() {
|
||||||
|
return this.orario;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOrario(String orario) {
|
||||||
|
this.orario = orario;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEsito() {
|
||||||
|
return this.esito;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEsito(String esito) {
|
||||||
|
this.esito = esito;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodAut() {
|
||||||
|
return this.codAut;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCodAut(String codAut) {
|
||||||
|
this.codAut = codAut;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBRAND() {
|
||||||
|
return this.BRAND;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBRAND(String brand) {
|
||||||
|
this.BRAND = brand;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNome() {
|
||||||
|
return this.nome;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNome(String nome) {
|
||||||
|
this.nome = nome;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCognome() {
|
||||||
|
return this.cognome;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCognome(String cognome) {
|
||||||
|
this.cognome = cognome;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEmail() {
|
||||||
|
return this.email;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEmail(String email) {
|
||||||
|
this.email = email;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMac() {
|
||||||
|
return this.mac;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMac(String mac) {
|
||||||
|
this.mac = mac;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,287 @@
|
||||||
|
package com.ablia.bank.paypal;
|
||||||
|
|
||||||
|
import com.ablia.bank._BankAdapter;
|
||||||
|
import com.ablia.common.Parm;
|
||||||
|
import com.ablia.db.ApplParmFull;
|
||||||
|
import java.net.URLEncoder;
|
||||||
|
|
||||||
|
public class PayPalReq extends _BankAdapter {
|
||||||
|
public static final String MTH_SET_EXPRESS_CHECKOUT = "SetExpressCheckout";
|
||||||
|
|
||||||
|
private double amt;
|
||||||
|
|
||||||
|
private long id_ordine;
|
||||||
|
|
||||||
|
private String cancelURL;
|
||||||
|
|
||||||
|
private String returnUrl;
|
||||||
|
|
||||||
|
private String TOKEN;
|
||||||
|
|
||||||
|
private String PAYERID;
|
||||||
|
|
||||||
|
private String SHIPTOCITY;
|
||||||
|
|
||||||
|
private String SHIPTOCOUNTRYCODE;
|
||||||
|
|
||||||
|
private String SHIPTONAME;
|
||||||
|
|
||||||
|
private String SHIPTOSTATE;
|
||||||
|
|
||||||
|
private String SHIPTOSTREET;
|
||||||
|
|
||||||
|
private String SHIPTOZIP;
|
||||||
|
|
||||||
|
private String DESC;
|
||||||
|
|
||||||
|
public static final String P_API_PASSWORD = "PAYPAL_API_PWD";
|
||||||
|
|
||||||
|
public static final String P_API_SIGNATURE = "PAYPAL_API_SIGNATURE";
|
||||||
|
|
||||||
|
public static final String P_API_USE_CERTIFICATE = "PAYPAL_USE_CERTIFICATE";
|
||||||
|
|
||||||
|
public static final String P_API_USERNAME = "PAYPAL_API_USERNAME";
|
||||||
|
|
||||||
|
public static final String P_CANCEL_URL = "PAYPAL_CANCELURL";
|
||||||
|
|
||||||
|
public static final String P_CURRENCY = "PAYPAL_CURRENCY";
|
||||||
|
|
||||||
|
public static final String P_PAGE_STYLE = "PAYPAL_PAGE_STYLE";
|
||||||
|
|
||||||
|
public static final String P_PAYMENT_DETAIL_PAGE = "PAYPAL_DETAIL";
|
||||||
|
|
||||||
|
public static final String P_PAYMENT_ERROR_PAGE = "PAY_PAL_KO";
|
||||||
|
|
||||||
|
public static final String P_PAYMENT_OK_PAGE = "PAYPAL_OK";
|
||||||
|
|
||||||
|
public static final String P_RETURN_URL = "PAYPAL_RETURNURL";
|
||||||
|
|
||||||
|
public static final String MTH_GET_EXPRESS_CHECKOUT_DETAIL = "GetExpressCheckoutDetails";
|
||||||
|
|
||||||
|
public static final String MTH_DO_EXPRESS_CHECKOUT_PAYMENT = "DoExpressCheckoutPayment";
|
||||||
|
|
||||||
|
public static final String CMD_ADDROVERRIDE = "ADDROVVERRIDE=1";
|
||||||
|
|
||||||
|
public static final String CMD_PAGESTILE = "PAGESTYLE";
|
||||||
|
|
||||||
|
public static final String CMD_PAYACT_AUTH = "PAYMENTACTION=Authorization";
|
||||||
|
|
||||||
|
public double getAmt() {
|
||||||
|
return this.amt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAmt(double amt) {
|
||||||
|
this.amt = amt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCancelURL() {
|
||||||
|
return (this.cancelURL == null) ? "" : this.cancelURL;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCancelURL(String cancelURL) {
|
||||||
|
this.cancelURL = cancelURL;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getReturnUrl() {
|
||||||
|
return (this.returnUrl == null) ? "" : this.returnUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setReturnUrl(String returnUrl) {
|
||||||
|
this.returnUrl = returnUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTOKEN() {
|
||||||
|
return (this.TOKEN == null) ? "" : this.TOKEN;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTOKEN(String token) {
|
||||||
|
this.TOKEN = token;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPAYERID() {
|
||||||
|
return this.PAYERID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPAYERID(String payerid) {
|
||||||
|
this.PAYERID = payerid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSHIPTOCITY() {
|
||||||
|
return (this.SHIPTOCITY == null) ? "" : this.SHIPTOCITY;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSHIPTOCOUNTRYCODE() {
|
||||||
|
return (this.SHIPTOCOUNTRYCODE == null) ? "" :
|
||||||
|
this.SHIPTOCOUNTRYCODE;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSHIPTONAME() {
|
||||||
|
return (this.SHIPTONAME == null) ? "" : this.SHIPTONAME;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSHIPTOSTATE() {
|
||||||
|
return (this.SHIPTOSTATE == null) ? "" : this.SHIPTOSTATE;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSHIPTOSTREET() {
|
||||||
|
return (this.SHIPTOSTREET == null) ? "" : this.SHIPTOSTREET;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSHIPTOZIP() {
|
||||||
|
return (this.SHIPTOZIP == null) ? "" : this.SHIPTOZIP;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getId_ordine() {
|
||||||
|
return this.id_ordine;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId_ordine(long id_ordine) {
|
||||||
|
this.id_ordine = id_ordine;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getShippingAddressString() {
|
||||||
|
return "SHIPTONAME=" + URLEncoder.encode(getSHIPTONAME()) + "&DESC=" +
|
||||||
|
URLEncoder.encode(getDESC()) + "&SHIPTOSTREET=" +
|
||||||
|
URLEncoder.encode(getSHIPTOSTREET()) + "&SHIPTOCITY=" +
|
||||||
|
URLEncoder.encode(getSHIPTOCITY()) + "&SHIPTOSTATE=" +
|
||||||
|
URLEncoder.encode(getSHIPTOSTATE()) + "&SHIPTOCOUNTRYCODE=" +
|
||||||
|
URLEncoder.encode(getSHIPTOCOUNTRYCODE()) + "&SHIPTOZIP=" +
|
||||||
|
URLEncoder.encode(getSHIPTOZIP()) + "&ADDROVERRIDE=1";
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSHIPTOCITY(String shiptocity) {
|
||||||
|
this.SHIPTOCITY = shiptocity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSHIPTOCOUNTRYCODE(String shiptocountrycode) {
|
||||||
|
this.SHIPTOCOUNTRYCODE = shiptocountrycode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSHIPTONAME(String shiptoname) {
|
||||||
|
this.SHIPTONAME = shiptoname;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSHIPTOSTATE(String shiptostate) {
|
||||||
|
this.SHIPTOSTATE = shiptostate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSHIPTOSTREET(String shiptostreet) {
|
||||||
|
this.SHIPTOSTREET = shiptostreet;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSHIPTOZIP(String shiptozip) {
|
||||||
|
this.SHIPTOZIP = shiptozip;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void initApplicationParms(ApplParmFull ap) {
|
||||||
|
if (ap != null) {
|
||||||
|
String l_tipoParm = "PAYPAL";
|
||||||
|
Parm bean = new Parm(ap);
|
||||||
|
l_tipoParm = "PAYPAL";
|
||||||
|
bean.findByCodice("PAYPAL_API_PWD");
|
||||||
|
bean.setFlgAdmin(0L);
|
||||||
|
bean.setTipoParm(l_tipoParm);
|
||||||
|
bean.setCodice("PAYPAL_API_PWD");
|
||||||
|
bean.setDescrizione("PAYPAL_API_PWD");
|
||||||
|
bean.setFlgTipo(0L);
|
||||||
|
bean.setNota("PAYPAL_API_PWD");
|
||||||
|
bean.save();
|
||||||
|
bean.findByCodice("PAYPAL_API_SIGNATURE");
|
||||||
|
bean.setFlgAdmin(0L);
|
||||||
|
bean.setTipoParm(l_tipoParm);
|
||||||
|
bean.setCodice("PAYPAL_API_SIGNATURE");
|
||||||
|
bean.setDescrizione("PAYPAL_API_SIGNATURE");
|
||||||
|
bean.setFlgTipo(0L);
|
||||||
|
bean.setNota("PAYPAL_API_SIGNATURE");
|
||||||
|
bean.save();
|
||||||
|
bean.findByCodice("PAYPAL_USE_CERTIFICATE");
|
||||||
|
bean.setFlgAdmin(0L);
|
||||||
|
bean.setTipoParm(l_tipoParm);
|
||||||
|
bean.setCodice("PAYPAL_USE_CERTIFICATE");
|
||||||
|
bean.setDescrizione("PAYPAL_USE_CERTIFICATE");
|
||||||
|
bean.setFlgTipo(0L);
|
||||||
|
bean.setNota("PAYPAL_USE_CERTIFICATE");
|
||||||
|
bean.save();
|
||||||
|
bean.findByCodice("PAYPAL_API_USERNAME");
|
||||||
|
bean.setFlgAdmin(0L);
|
||||||
|
bean.setTipoParm(l_tipoParm);
|
||||||
|
bean.setCodice("PAYPAL_API_USERNAME");
|
||||||
|
bean.setDescrizione("PAYPAL_API_USERNAME");
|
||||||
|
bean.setFlgTipo(0L);
|
||||||
|
bean.setNota("PAYPAL_API_USERNAME");
|
||||||
|
bean.save();
|
||||||
|
bean.findByCodice("PAYPAL_CANCELURL");
|
||||||
|
bean.setFlgAdmin(0L);
|
||||||
|
bean.setTipoParm(l_tipoParm);
|
||||||
|
bean.setCodice("PAYPAL_CANCELURL");
|
||||||
|
bean.setDescrizione("PAYPAL_CANCELURL");
|
||||||
|
bean.setFlgTipo(0L);
|
||||||
|
bean.setNota("PAYPAL_CANCELURL");
|
||||||
|
bean.save();
|
||||||
|
bean.findByCodice("PAYPAL_CURRENCY");
|
||||||
|
bean.setFlgAdmin(0L);
|
||||||
|
bean.setTipoParm(l_tipoParm);
|
||||||
|
bean.setCodice("PAYPAL_CURRENCY");
|
||||||
|
bean.setDescrizione("PAYPAL_CURRENCY");
|
||||||
|
bean.setFlgTipo(0L);
|
||||||
|
if (bean.getTesto().equals(""))
|
||||||
|
bean.setTesto("EUR");
|
||||||
|
bean.setNota("PAYPAL_CURRENCY");
|
||||||
|
bean.save();
|
||||||
|
bean.findByCodice("PAYPAL_PAGE_STYLE");
|
||||||
|
bean.setFlgAdmin(0L);
|
||||||
|
bean.setTipoParm(l_tipoParm);
|
||||||
|
bean.setCodice("PAYPAL_PAGE_STYLE");
|
||||||
|
bean.setDescrizione("PAYPAL_PAGE_STYLE");
|
||||||
|
bean.setFlgTipo(0L);
|
||||||
|
bean.setNota("PAYPAL_PAGE_STYLE");
|
||||||
|
bean.save();
|
||||||
|
bean.findByCodice("PAYPAL_DETAIL");
|
||||||
|
bean.setFlgAdmin(0L);
|
||||||
|
bean.setTipoParm(l_tipoParm);
|
||||||
|
bean.setCodice("PAYPAL_DETAIL");
|
||||||
|
bean.setDescrizione("PAYPAL_DETAIL");
|
||||||
|
bean.setFlgTipo(0L);
|
||||||
|
if (bean.getTesto().equals(""))
|
||||||
|
bean.setTesto("payPalRes.jsp");
|
||||||
|
bean.setNota("PAYPAL_DETAIL");
|
||||||
|
bean.save();
|
||||||
|
bean.findByCodice("PAY_PAL_KO");
|
||||||
|
bean.setFlgAdmin(0L);
|
||||||
|
bean.setTipoParm(l_tipoParm);
|
||||||
|
bean.setCodice("PAY_PAL_KO");
|
||||||
|
bean.setDescrizione("PAY_PAL_KO");
|
||||||
|
bean.setFlgTipo(0L);
|
||||||
|
if (bean.getTesto().equals(""))
|
||||||
|
bean.setTesto("payPalRes.jsp");
|
||||||
|
bean.setNota("PAY_PAL_KO");
|
||||||
|
bean.save();
|
||||||
|
bean.findByCodice("PAYPAL_OK");
|
||||||
|
bean.setFlgAdmin(0L);
|
||||||
|
bean.setTipoParm(l_tipoParm);
|
||||||
|
bean.setCodice("PAYPAL_OK");
|
||||||
|
bean.setDescrizione("PAYPAL_OK");
|
||||||
|
bean.setFlgTipo(0L);
|
||||||
|
if (bean.getTesto().equals(""))
|
||||||
|
bean.setTesto("payPalRes.jsp");
|
||||||
|
bean.setNota("PAYPAL_OK");
|
||||||
|
bean.save();
|
||||||
|
bean.findByCodice("PAYPAL_RETURNURL");
|
||||||
|
bean.setFlgAdmin(0L);
|
||||||
|
bean.setTipoParm(l_tipoParm);
|
||||||
|
bean.setCodice("PAYPAL_RETURNURL");
|
||||||
|
bean.setDescrizione("PAYPAL_RETURNURL");
|
||||||
|
bean.setFlgTipo(0L);
|
||||||
|
bean.setNota("PAYPAL_RETURNURL");
|
||||||
|
bean.save();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDESC() {
|
||||||
|
return (this.DESC == null) ? "" : this.DESC.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDESC(String dESC) {
|
||||||
|
this.DESC = dESC;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,363 @@
|
||||||
|
package com.ablia.bank.paypal;
|
||||||
|
|
||||||
|
import com.ablia.bank._BankAdapter;
|
||||||
|
import java.io.BufferedReader;
|
||||||
|
import java.net.URLDecoder;
|
||||||
|
|
||||||
|
public class PayPalResp extends _BankAdapter {
|
||||||
|
public static final String SESS_TOKEN = "_SESS_TOKEN";
|
||||||
|
|
||||||
|
private String ACK;
|
||||||
|
|
||||||
|
private String TIMESTAMP;
|
||||||
|
|
||||||
|
private String VERSION;
|
||||||
|
|
||||||
|
private String L_ERRORCODE0;
|
||||||
|
|
||||||
|
private String L_SHORTMESSAGE0;
|
||||||
|
|
||||||
|
private String L_SEVERITYCODE0;
|
||||||
|
|
||||||
|
private String L_LONGMESSAGE0;
|
||||||
|
|
||||||
|
private String CORRELATIONID;
|
||||||
|
|
||||||
|
private String BUILD;
|
||||||
|
|
||||||
|
private String AMT;
|
||||||
|
|
||||||
|
private String EMAIL;
|
||||||
|
|
||||||
|
private String PAYERID;
|
||||||
|
|
||||||
|
private String PAYERSTATUS;
|
||||||
|
|
||||||
|
private String FIRSTNAME;
|
||||||
|
|
||||||
|
private String LASTNAME;
|
||||||
|
|
||||||
|
private String SHIPTOSTREET;
|
||||||
|
|
||||||
|
private String COUNTRYCODE;
|
||||||
|
|
||||||
|
private String SHIPTOCITY;
|
||||||
|
|
||||||
|
private String SHIPTOSTATE;
|
||||||
|
|
||||||
|
private String SHIPTOCOUNTRYCODE;
|
||||||
|
|
||||||
|
private String SHIPTOZIP;
|
||||||
|
|
||||||
|
private String ADDRESSID;
|
||||||
|
|
||||||
|
private String ADDRESSSTATUS;
|
||||||
|
|
||||||
|
private String SHIPTONAME;
|
||||||
|
|
||||||
|
private String TRANSACTIONID;
|
||||||
|
|
||||||
|
private String TOKEN;
|
||||||
|
|
||||||
|
private long id_ordine;
|
||||||
|
|
||||||
|
private boolean paymentDone = false;
|
||||||
|
|
||||||
|
private boolean detailBuyer = false;
|
||||||
|
|
||||||
|
public static final String SESS_ID_ORDER = "_SESS_ID_ORDER";
|
||||||
|
|
||||||
|
public String getACK() {
|
||||||
|
return (this.ACK == null) ? "" : this.ACK;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setACK(String ack) {
|
||||||
|
this.ACK = ack;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBUILD() {
|
||||||
|
return (this.BUILD == null) ? "" : this.BUILD;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBUILD(String build) {
|
||||||
|
this.BUILD = build;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCORRELATIONID() {
|
||||||
|
return (this.CORRELATIONID == null) ? "" :
|
||||||
|
this.CORRELATIONID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCORRELATIONID(String correlationid) {
|
||||||
|
this.CORRELATIONID = correlationid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTIMESTAMP() {
|
||||||
|
return (this.TIMESTAMP == null) ? "" : this.TIMESTAMP;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTIMESTAMP(String timestamp) {
|
||||||
|
this.TIMESTAMP = timestamp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getVERSION() {
|
||||||
|
return (this.VERSION == null) ? "" : this.VERSION;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVERSION(String version) {
|
||||||
|
this.VERSION = version;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getL_ERRORCODE0() {
|
||||||
|
return (this.L_ERRORCODE0 == null) ? "" : this.L_ERRORCODE0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setL_ERRORCODE0(String l_errorcode0) {
|
||||||
|
this.L_ERRORCODE0 = l_errorcode0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getL_LONGMESSAGE0() {
|
||||||
|
return (this.L_LONGMESSAGE0 == null) ? "" :
|
||||||
|
this.L_LONGMESSAGE0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setL_LONGMESSAGE0(String l_longmessage0) {
|
||||||
|
this.L_LONGMESSAGE0 = l_longmessage0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getL_SEVERITYCODE0() {
|
||||||
|
return (this.L_SEVERITYCODE0 == null) ? "" :
|
||||||
|
this.L_SEVERITYCODE0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setL_SEVERITYCODE0(String l_severitycode0) {
|
||||||
|
this.L_SEVERITYCODE0 = l_severitycode0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getL_SHORTMESSAGE0() {
|
||||||
|
return (this.L_SHORTMESSAGE0 == null) ? "" :
|
||||||
|
this.L_SHORTMESSAGE0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setL_SHORTMESSAGE0(String l_shortmessage0) {
|
||||||
|
this.L_SHORTMESSAGE0 = l_shortmessage0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTOKEN() {
|
||||||
|
return (this.TOKEN == null) ? "" : this.TOKEN;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTOKEN(String token) {
|
||||||
|
this.TOKEN = token;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getADDRESSID() {
|
||||||
|
return this.ADDRESSID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setADDRESSID(String addressid) {
|
||||||
|
this.ADDRESSID = addressid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getADDRESSSTATUS() {
|
||||||
|
return this.ADDRESSSTATUS;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setADDRESSSTATUS(String addressstatus) {
|
||||||
|
this.ADDRESSSTATUS = addressstatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCOUNTRYCODE() {
|
||||||
|
return this.COUNTRYCODE;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isResponseOk() {
|
||||||
|
return getACK().equals("Success");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCOUNTRYCODE(String countrycode) {
|
||||||
|
this.COUNTRYCODE = countrycode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEMAIL() {
|
||||||
|
return this.EMAIL;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEMAIL(String email) {
|
||||||
|
this.EMAIL = email;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFIRSTNAME() {
|
||||||
|
return this.FIRSTNAME;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void fillResponse(BufferedReader reader) {
|
||||||
|
try {
|
||||||
|
String response = URLDecoder.decode(reader.readLine());
|
||||||
|
setACK("Success");
|
||||||
|
setL_LONGMESSAGE0(response);
|
||||||
|
setAMT(getAttribute(response, "AMT"));
|
||||||
|
setACK(getAttribute(response, "ACK"));
|
||||||
|
setTOKEN(getAttribute(response, "TOKEN"));
|
||||||
|
setADDRESSID(getAttribute(response, "ADDRESSID"));
|
||||||
|
setADDRESSSTATUS(getAttribute(response, "ADDRESSSTATUS"));
|
||||||
|
setBUILD(getAttribute(response, "BUILD"));
|
||||||
|
setCORRELATIONID(getAttribute(response, "CORRELATIONID"));
|
||||||
|
setCOUNTRYCODE(getAttribute(response, "COUNTRYCODE"));
|
||||||
|
setEMAIL(getAttribute(response, "EMAIL"));
|
||||||
|
setFIRSTNAME(getAttribute(response, "FIRSTNAME"));
|
||||||
|
setL_ERRORCODE0(getAttribute(response, "L_ERRORCODE0"));
|
||||||
|
setL_LONGMESSAGE0(getAttribute(response, "L_LONGMESSAGE0"));
|
||||||
|
setL_SEVERITYCODE0(getAttribute(response, "L_SEVERITCODE0"));
|
||||||
|
setLASTNAME(getAttribute(response, "LASTNAME"));
|
||||||
|
setPAYERID(getAttribute(response, "PAYERID"));
|
||||||
|
setPAYERSTATUS(getAttribute(response, "PAYERSTATUS"));
|
||||||
|
setSHIPTOCITY(getAttribute(response, "SHIPTOCITY"));
|
||||||
|
setSHIPTOCOUNTRYCODE(getAttribute(response, "SHIPTOCOUNTRYCODE"));
|
||||||
|
setSHIPTONAME(getAttribute(response, "SHIPTONAME"));
|
||||||
|
setSHIPTOSTREET(getAttribute(response, "SHIPTOSTREET"));
|
||||||
|
setSHIPTOSTATE(getAttribute(response, "SHIPTOSTATE"));
|
||||||
|
setSHIPTOZIP(getAttribute(response, "SHIPTOZIP"));
|
||||||
|
setTIMESTAMP(getAttribute(response, "TIMESTAMP"));
|
||||||
|
setVERSION(getAttribute(response, "VERSION"));
|
||||||
|
setTRANSACTIONID(getAttribute(response, "TRANSACTIONID"));
|
||||||
|
} catch (Exception e) {
|
||||||
|
setACK("Error");
|
||||||
|
setL_LONGMESSAGE0(e.getMessage());
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private String getAttribute(String response, String key) {
|
||||||
|
try {
|
||||||
|
if (response.indexOf(key) >= 0) {
|
||||||
|
int idxStart = response.indexOf(key) + key.length() + 1;
|
||||||
|
int idxStop = response.substring(idxStart).indexOf("&") + idxStart;
|
||||||
|
if (idxStop < idxStart)
|
||||||
|
idxStop = response.length();
|
||||||
|
return response.substring(idxStart, idxStop);
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
} catch (Exception e) {
|
||||||
|
System.out.println(key);
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFIRSTNAME(String firstname) {
|
||||||
|
this.FIRSTNAME = firstname;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLASTNAME() {
|
||||||
|
return this.LASTNAME;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLASTNAME(String lastname) {
|
||||||
|
this.LASTNAME = lastname;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPAYERID() {
|
||||||
|
return this.PAYERID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPAYERID(String payerid) {
|
||||||
|
this.PAYERID = payerid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPAYERSTATUS() {
|
||||||
|
return this.PAYERSTATUS;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPAYERSTATUS(String payerstatus) {
|
||||||
|
this.PAYERSTATUS = payerstatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSHIPTOCITY() {
|
||||||
|
return (this.SHIPTOCITY == null) ? "" : this.SHIPTOCITY;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSHIPTOCITY(String shiptocity) {
|
||||||
|
this.SHIPTOCITY = shiptocity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSHIPTOCOUNTRYCODE() {
|
||||||
|
return (this.SHIPTOCOUNTRYCODE == null) ? "" :
|
||||||
|
this.SHIPTOCOUNTRYCODE;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSHIPTOCOUNTRYCODE(String shiptocountrycode) {
|
||||||
|
this.SHIPTOCOUNTRYCODE = shiptocountrycode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSHIPTONAME() {
|
||||||
|
return (this.SHIPTONAME == null) ? "" : this.SHIPTONAME;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSHIPTONAME(String shiptoname) {
|
||||||
|
this.SHIPTONAME = shiptoname;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSHIPTOSTATE() {
|
||||||
|
return (this.SHIPTOSTATE == null) ? "" : this.SHIPTOSTATE;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSHIPTOSTATE(String shiptostate) {
|
||||||
|
this.SHIPTOSTATE = shiptostate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSHIPTOSTREET() {
|
||||||
|
return (this.SHIPTOSTREET == null) ? "" : this.SHIPTOSTREET;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSHIPTOSTREET(String shiptostreet) {
|
||||||
|
this.SHIPTOSTREET = shiptostreet;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSHIPTOZIP() {
|
||||||
|
return (this.SHIPTOZIP == null) ? "" : this.SHIPTOZIP;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSHIPTOZIP(String shiptozip) {
|
||||||
|
this.SHIPTOZIP = shiptozip;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAMT() {
|
||||||
|
return this.AMT;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAMT(String amt) {
|
||||||
|
this.AMT = amt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getId_ordine() {
|
||||||
|
return this.id_ordine;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId_ordine(long id_ordine) {
|
||||||
|
this.id_ordine = id_ordine;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isDetailBuyer() {
|
||||||
|
return this.detailBuyer;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDetailBuyer(boolean detailBuyer) {
|
||||||
|
this.detailBuyer = detailBuyer;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isPaymentDone() {
|
||||||
|
return this.paymentDone;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPaymentDone(boolean paymentDone) {
|
||||||
|
this.paymentDone = paymentDone;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTRANSACTIONID() {
|
||||||
|
return this.TRANSACTIONID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTRANSACTIONID(String transactionid) {
|
||||||
|
this.TRANSACTIONID = transactionid;
|
||||||
|
}
|
||||||
|
}
|
||||||
304
rus/WEB-INF/lib/abliaBank_src/com/ablia/bank/poste/PeReq.java
Normal file
304
rus/WEB-INF/lib/abliaBank_src/com/ablia/bank/poste/PeReq.java
Normal file
|
|
@ -0,0 +1,304 @@
|
||||||
|
package com.ablia.bank.poste;
|
||||||
|
|
||||||
|
import com.ablia.bank._BankAdapter;
|
||||||
|
import com.ablia.common.Parm;
|
||||||
|
import com.ablia.db.ApplParmFull;
|
||||||
|
|
||||||
|
public class PeReq extends _BankAdapter {
|
||||||
|
public static final String LANG_CODE_USA = "USA";
|
||||||
|
|
||||||
|
public static final String LANG_CODE_ITA = "ITA";
|
||||||
|
|
||||||
|
public static final String DIV_CODE_EURO = "978";
|
||||||
|
|
||||||
|
private String currency;
|
||||||
|
|
||||||
|
private String trackId;
|
||||||
|
|
||||||
|
private String mail;
|
||||||
|
|
||||||
|
private String resourcePath;
|
||||||
|
|
||||||
|
private String language;
|
||||||
|
|
||||||
|
private String alias;
|
||||||
|
|
||||||
|
private String responseURL;
|
||||||
|
|
||||||
|
private String errorURL;
|
||||||
|
|
||||||
|
private String userName;
|
||||||
|
|
||||||
|
private String amt;
|
||||||
|
|
||||||
|
private String action;
|
||||||
|
|
||||||
|
private String flgTipoPagamentoPe;
|
||||||
|
|
||||||
|
private String merchantId;
|
||||||
|
|
||||||
|
private String shopId;
|
||||||
|
|
||||||
|
public static final String P_USE_IGFS = "PE_USE_IGFS";
|
||||||
|
|
||||||
|
public static final String P_NO_CERTIFICATO = "PE_NO_CERTIFICATO";
|
||||||
|
|
||||||
|
public static final String P_RESOURCE_PATH = "PE_RESOURCE_PATH";
|
||||||
|
|
||||||
|
public static final String P_URL_POST_RESPONSE = "PE_URL_POST_RESPONSE";
|
||||||
|
|
||||||
|
public static final String ALIAS_POSTEPAY = "03";
|
||||||
|
|
||||||
|
public static final String ALIAS_BPOPL = "01";
|
||||||
|
|
||||||
|
public static final String ALIAS_CC = "02";
|
||||||
|
|
||||||
|
public static final String ALIAS_BPIOL = "04";
|
||||||
|
|
||||||
|
public static final String ALIAS_POSTEPAY_IMPRESA = "06";
|
||||||
|
|
||||||
|
public static final String P_MERCHANT_ID = "PE_MERCHANT_ID";
|
||||||
|
|
||||||
|
public static final String DEFAULT_OK_KO_PAGE = "payResPe.jsp";
|
||||||
|
|
||||||
|
public static final String P_URL_REDIRECT_RESULT = "PE_URL_REDIRECT_RESULT";
|
||||||
|
|
||||||
|
public static final String P_PAYMENT_OK_PAGE = "PE_PAY_OK";
|
||||||
|
|
||||||
|
public static final String P_PAYMENT_ERROR_PAGE = "PE_PAY_KO";
|
||||||
|
|
||||||
|
public static final String P_URL_POST_RESPONSE_ERROR = "URL_POST_RESPONSE_ERROR";
|
||||||
|
|
||||||
|
public static final String TEST_ALIAS = "payment_testm_urlmac";
|
||||||
|
|
||||||
|
public static final String REQ_URL = "https://ecommerce.cim-italia.it/ecomm/DispatcherServlet";
|
||||||
|
|
||||||
|
public String getTrackId() {
|
||||||
|
return (this.trackId == null) ? "" : this.trackId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTrackId(String myamount) {
|
||||||
|
this.trackId = myamount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAmt() {
|
||||||
|
return (this.amt == null) ? "" : this.amt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAmt(String mybuyeremail) {
|
||||||
|
this.amt = mybuyeremail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMail() {
|
||||||
|
return (this.mail == null) ? "" : this.mail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMail(String mybuyername) {
|
||||||
|
this.mail = mybuyername;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCurrency() {
|
||||||
|
return (this.currency == null) ? "" : this.currency;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCurrency(String mycurrency) {
|
||||||
|
this.currency = mycurrency;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAlias() {
|
||||||
|
return String.valueOf(getMerchantId()) + getFlgTipoPagamentoPe();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAlias(String mycustominfo) {
|
||||||
|
this.alias = mycustominfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLanguage() {
|
||||||
|
return (this.language == null) ? "" : this.language;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLanguage(String lang) {
|
||||||
|
this.language = lang;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getImportoUrl() {
|
||||||
|
return (this.amt == null) ? "" : this.amt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getResponseURL() {
|
||||||
|
return (this.responseURL == null) ? "" :
|
||||||
|
this.responseURL.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setResponseURL(String url) {
|
||||||
|
this.responseURL = url;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getErrorURL() {
|
||||||
|
return (this.errorURL == null) ? "" : this.errorURL.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setErrorURL(String url_back) {
|
||||||
|
this.errorURL = url_back;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void initApplicationParms(ApplParmFull ap) {
|
||||||
|
if (ap != null) {
|
||||||
|
String l_tipoParm = "PAYPAL";
|
||||||
|
Parm bean = new Parm(ap);
|
||||||
|
l_tipoParm = "POST ECOMMERCE";
|
||||||
|
bean.findByCodice("PE_MERCHANT_ID");
|
||||||
|
bean.setFlgAdmin(0L);
|
||||||
|
bean.setTipoParm(l_tipoParm);
|
||||||
|
bean.setCodice("PE_MERCHANT_ID");
|
||||||
|
bean.setDescrizione("PE_MERCHANT_ID");
|
||||||
|
bean.setFlgTipo(0L);
|
||||||
|
if (bean.getTesto().equals(""))
|
||||||
|
bean.setTesto("PE_MERCHANT_ID");
|
||||||
|
bean.setNota("PE_MERCHANT_ID");
|
||||||
|
bean.save();
|
||||||
|
bean.findByCodice("PE_PAY_KO");
|
||||||
|
bean.setFlgAdmin(0L);
|
||||||
|
bean.setTipoParm(l_tipoParm);
|
||||||
|
bean.setCodice("PE_PAY_KO");
|
||||||
|
bean.setDescrizione("PE_PAY_KO");
|
||||||
|
bean.setFlgTipo(0L);
|
||||||
|
if (bean.getTesto().equals(""))
|
||||||
|
bean.setTesto("payResPe.jsp");
|
||||||
|
bean.setNota("PE_PAY_KO");
|
||||||
|
bean.save();
|
||||||
|
bean.findByCodice("PE_PAY_OK");
|
||||||
|
bean.setFlgAdmin(0L);
|
||||||
|
bean.setTipoParm(l_tipoParm);
|
||||||
|
bean.setCodice("PE_PAY_OK");
|
||||||
|
bean.setDescrizione("PE_PAY_OK");
|
||||||
|
bean.setFlgTipo(0L);
|
||||||
|
if (bean.getTesto().equals(""))
|
||||||
|
bean.setTesto("payResPe.jsp");
|
||||||
|
bean.setNota("PE_PAY_OK");
|
||||||
|
bean.save();
|
||||||
|
bean.findByCodice("PE_NO_CERTIFICATO");
|
||||||
|
bean.setFlgAdmin(0L);
|
||||||
|
bean.setTipoParm(l_tipoParm);
|
||||||
|
bean.setCodice("PE_NO_CERTIFICATO");
|
||||||
|
bean.setDescrizione("PE_NO_CERTIFICATO");
|
||||||
|
bean.setFlgTipo(1L);
|
||||||
|
bean.setNota("PE_NO_CERTIFICATOSOLO PER IGFS: 0--> CON CERTIFICATO, PRODUZIONE<br>1 --> SENZA CERTIFICATO, SOLO TEST");
|
||||||
|
bean.save();
|
||||||
|
bean.findByCodice("PE_USE_IGFS");
|
||||||
|
bean.setFlgAdmin(0L);
|
||||||
|
bean.setTipoParm(l_tipoParm);
|
||||||
|
bean.setCodice("PE_USE_IGFS");
|
||||||
|
bean.setDescrizione("PE_USE_IGFS");
|
||||||
|
bean.setFlgTipo(1L);
|
||||||
|
bean.setNota("PE_USE_IGFS: 0--> vecchia versione con resource.cgn<br>1 --> nuova versione con file properties");
|
||||||
|
bean.save();
|
||||||
|
bean.findByCodice("PE_RESOURCE_PATH");
|
||||||
|
bean.setFlgAdmin(0L);
|
||||||
|
bean.setTipoParm(l_tipoParm);
|
||||||
|
bean.setCodice("PE_RESOURCE_PATH");
|
||||||
|
bean.setDescrizione("PE_RESOURCE_PATH");
|
||||||
|
bean.setFlgTipo(0L);
|
||||||
|
if (bean.getTesto().equals(""))
|
||||||
|
bean.setTesto("/home/xxx/xxx/");
|
||||||
|
bean.setNota("PE_RESOURCE_PATH: per la versione vecchia con / finale. Path assoluto dove trovare resource.cgn<br>per la versione nuova il percorso completo del .properties compreso il nome del file.");
|
||||||
|
bean.save();
|
||||||
|
bean.findByCodice("PE_URL_POST_RESPONSE");
|
||||||
|
bean.setFlgAdmin(0L);
|
||||||
|
bean.setTipoParm(l_tipoParm);
|
||||||
|
bean.setCodice("PE_URL_POST_RESPONSE");
|
||||||
|
bean.setDescrizione("PE_URL_POST_RESPONSE");
|
||||||
|
bean.setFlgTipo(0L);
|
||||||
|
if (bean.getTesto().equals(""))
|
||||||
|
bean.setTesto("http://test.ablia.com/tf/GetResponsePe.abl");
|
||||||
|
bean.setNota("PE_URL_POST_RESPONSE: URL HTTP RICHIAMATA TRAMITE POST. DEVE ESSERE VISIBILE SU INTERNET (NO LOCALHOST)");
|
||||||
|
bean.save();
|
||||||
|
bean.findByCodice("URL_POST_RESPONSE_ERROR");
|
||||||
|
bean.setFlgAdmin(0L);
|
||||||
|
bean.setTipoParm(l_tipoParm);
|
||||||
|
bean.setCodice("URL_POST_RESPONSE_ERROR");
|
||||||
|
bean.setDescrizione("URL_POST_RESPONSE_ERROR");
|
||||||
|
bean.setFlgTipo(0L);
|
||||||
|
if (bean.getTesto().equals(""))
|
||||||
|
bean.setTesto("http://test.ablia.com/tf/RicevutaPE.abl");
|
||||||
|
bean.setNota("URL_POST_RESPONSE_ERROR: URL HTTP RICHIAMATA TRAMITE REDIRECT. DEVE ESSERE VISIBILE SU INTERNET (NO LOCALHOST)");
|
||||||
|
bean.save();
|
||||||
|
bean.findByCodice("PE_URL_REDIRECT_RESULT");
|
||||||
|
bean.setFlgAdmin(0L);
|
||||||
|
bean.setTipoParm(l_tipoParm);
|
||||||
|
bean.setCodice("PE_URL_REDIRECT_RESULT");
|
||||||
|
bean.setDescrizione("PE_URL_REDIRECT_RESULT");
|
||||||
|
bean.setFlgTipo(0L);
|
||||||
|
if (bean.getTesto().equals(""))
|
||||||
|
bean.setTesto("http://localhost/tf/RicevutaPE.abl");
|
||||||
|
bean.setNota("PE_URL_REDIRECT_RESULT: URL HTTP RICHIAMATA TRAMITE REDIRECT. PUO' ESSERE LOCALHOST IN FASE DI SVILUPPO");
|
||||||
|
bean.save();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getResourcePath() {
|
||||||
|
return (this.resourcePath == null) ? "" : this.resourcePath;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setResourcePath(String resourcePath) {
|
||||||
|
this.resourcePath = resourcePath;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUserName() {
|
||||||
|
return (this.userName == null) ? "" : this.userName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUserName(String userName) {
|
||||||
|
this.userName = userName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAction() {
|
||||||
|
return "4";
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAction(String action) {
|
||||||
|
this.action = action;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTipoPagamentoPE(String tipoPagamento) {
|
||||||
|
if (tipoPagamento.equals("04"))
|
||||||
|
return "conto bpiol";
|
||||||
|
if (tipoPagamento.equals("01"))
|
||||||
|
return "conto bpiol";
|
||||||
|
if (tipoPagamento.equals("04"))
|
||||||
|
return "conto bpol";
|
||||||
|
if (tipoPagamento.equals("02"))
|
||||||
|
return "carta di credito";
|
||||||
|
if (tipoPagamento.equals("03"))
|
||||||
|
return "carta postepay";
|
||||||
|
if (tipoPagamento.equals("06"))
|
||||||
|
return "carta postepay Impresa";
|
||||||
|
return "??";
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFlgTipoPagamentoPe() {
|
||||||
|
return (this.flgTipoPagamentoPe == null) ? "" :
|
||||||
|
this.flgTipoPagamentoPe.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFlgTipoPagamentoPe(String flgTipoPagamentoPe) {
|
||||||
|
this.flgTipoPagamentoPe = flgTipoPagamentoPe;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMerchantId() {
|
||||||
|
return (this.merchantId == null) ? "" :
|
||||||
|
this.merchantId.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMerchantId(String merchantId) {
|
||||||
|
this.merchantId = merchantId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getShopId() {
|
||||||
|
return (this.shopId == null) ? "" : this.shopId.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setShopId(String shopId) {
|
||||||
|
this.shopId = shopId;
|
||||||
|
}
|
||||||
|
}
|
||||||
118
rus/WEB-INF/lib/abliaBank_src/com/ablia/bank/poste/PeResp.java
Normal file
118
rus/WEB-INF/lib/abliaBank_src/com/ablia/bank/poste/PeResp.java
Normal file
|
|
@ -0,0 +1,118 @@
|
||||||
|
package com.ablia.bank.poste;
|
||||||
|
|
||||||
|
import com.ablia.bank._BankAdapter;
|
||||||
|
|
||||||
|
public class PeResp extends _BankAdapter {
|
||||||
|
private long id_ordine;
|
||||||
|
|
||||||
|
private String errorText;
|
||||||
|
|
||||||
|
private String postdate;
|
||||||
|
|
||||||
|
private String paymentid;
|
||||||
|
|
||||||
|
private String trackid;
|
||||||
|
|
||||||
|
private String result;
|
||||||
|
|
||||||
|
private String tranid;
|
||||||
|
|
||||||
|
private String errorCode;
|
||||||
|
|
||||||
|
private String error;
|
||||||
|
|
||||||
|
private String auth;
|
||||||
|
|
||||||
|
private String errorService;
|
||||||
|
|
||||||
|
public static final String ESITO_OK = "APPROVED";
|
||||||
|
|
||||||
|
public long getId_ordine() {
|
||||||
|
return this.id_ordine;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId_ordine(long id_ordine) {
|
||||||
|
this.id_ordine = id_ordine;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getErrorText() {
|
||||||
|
return (this.errorText == null) ? "" : this.errorText.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setErrorText(String importo) {
|
||||||
|
this.errorText = importo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPostdate() {
|
||||||
|
return (this.postdate == null) ? "" : this.postdate.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPostdate(String data) {
|
||||||
|
this.postdate = data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPaymentid() {
|
||||||
|
return (this.paymentid == null) ? "" : this.paymentid.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPaymentid(String divisa) {
|
||||||
|
this.paymentid = divisa;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTrackid() {
|
||||||
|
return (this.trackid == null) ? "" : this.trackid.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTrackid(String codTrans) {
|
||||||
|
this.trackid = codTrans;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getResult() {
|
||||||
|
return (this.result == null) ? "" : this.result.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setResult(String esito) {
|
||||||
|
this.result = esito;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTranid() {
|
||||||
|
return (this.tranid == null) ? "" : this.tranid.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTranid(String codAut) {
|
||||||
|
this.tranid = codAut;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getErrorCode() {
|
||||||
|
return (this.errorCode == null) ? "" : this.errorCode.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setErrorCode(String nome) {
|
||||||
|
this.errorCode = nome;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getError() {
|
||||||
|
return (this.error == null) ? "" : this.error.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setError(String cognome) {
|
||||||
|
this.error = cognome;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAuth() {
|
||||||
|
return (this.auth == null) ? "" : this.auth.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAuth(String email) {
|
||||||
|
this.auth = email;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getErrorService() {
|
||||||
|
return (this.errorService == null) ? "" :
|
||||||
|
this.errorService.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setErrorService(String errorService) {
|
||||||
|
this.errorService = errorService;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,363 @@
|
||||||
|
package com.ablia.bank.poste2019;
|
||||||
|
|
||||||
|
import com.ablia.bank._BankAdapter;
|
||||||
|
import com.ablia.common.Parm;
|
||||||
|
import com.ablia.db.ApplParmFull;
|
||||||
|
import com.ablia.reg.EcDc;
|
||||||
|
|
||||||
|
public class PosteReq extends _BankAdapter {
|
||||||
|
private String VALUTA;
|
||||||
|
|
||||||
|
private String NUMORD;
|
||||||
|
|
||||||
|
private String IMPORTO;
|
||||||
|
|
||||||
|
private String LINGUA;
|
||||||
|
|
||||||
|
private String EMAILESERC;
|
||||||
|
|
||||||
|
private String EMAIL;
|
||||||
|
|
||||||
|
private String USERID;
|
||||||
|
|
||||||
|
public static final String TCONTAB_DIFFERITA = "D";
|
||||||
|
|
||||||
|
public static final String TCONTAB_IMMEDIATA = "I";
|
||||||
|
|
||||||
|
public static final String LANG_CODE_IT = "ITA";
|
||||||
|
|
||||||
|
public static final String LANG_CODE_EN = "EN";
|
||||||
|
|
||||||
|
public static final String P_POSTE19_MAC_KEY_START = "POSTE19_MAC_KEY_START";
|
||||||
|
|
||||||
|
public static final String P_POSTE19_URL_BACK = "POSTE19_URL_BACK";
|
||||||
|
|
||||||
|
public static final String P_POSTE19_URL_DONE = "POSTE19_URL_DONE";
|
||||||
|
|
||||||
|
public static final String P_POSTE19_URL_MS = "POSTE19_URL_MS";
|
||||||
|
|
||||||
|
public static final String P_POSTE19_EMAILESERC = "POSTE19_EMAILESERC";
|
||||||
|
|
||||||
|
public static final String P_POSTE19_MAC_KEY_ESITO = "POSTE19_MAC_KEY_ESITO";
|
||||||
|
|
||||||
|
public static final String P_POSTE19_IDNEGOZIO = "POSTE19_IDNEGOZIO";
|
||||||
|
|
||||||
|
public static final String P_POSTE19_TCONTAB = "POSTE19_TCONTAB";
|
||||||
|
|
||||||
|
public static final String P_POSTE19_OPTIONS = "POSTE19_OPTIONS";
|
||||||
|
|
||||||
|
public static final String URL_POSTE19_TEST = "https://acquistionlinetest.poste.it/poste/pagamenti/main?PAGE=MASTER";
|
||||||
|
|
||||||
|
public static final String URL_POSTE19_PROD = "https://acquistionline.poste.it/poste/pagamenti/main?PAGE=MASTER";
|
||||||
|
|
||||||
|
public static final String DEFAULT_URL_BACK_AND_DONE = "http://localhost/tf15/RicevutaPoste.abl";
|
||||||
|
|
||||||
|
public static final String DEFAULT_URL_MS = "http://localhost/tf15/RicevutaPoste.abl";
|
||||||
|
|
||||||
|
public static final String TEST_MAC = "CHENESOADESSO";
|
||||||
|
|
||||||
|
public static final String OPTIONS_G_REDIRIZIONE_IMMEDIATA = "G";
|
||||||
|
|
||||||
|
public static final String OPTIONS_L_ORDINE_DUPLICATO_CODE_07_URLMS = "L";
|
||||||
|
|
||||||
|
public static final String OPTIONS_N_NEGATA_SU_RULDONE = "N";
|
||||||
|
|
||||||
|
public static final String OPTIONS_P_SEND_RESPONSE_CODE_AUT = "P";
|
||||||
|
|
||||||
|
public PosteReq() {}
|
||||||
|
|
||||||
|
public PosteReq(ApplParmFull apFull) {
|
||||||
|
setAp(apFull);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNUMORD() {
|
||||||
|
return (this.NUMORD == null) ? "" : this.NUMORD.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNUMORD(String myamount) {
|
||||||
|
this.NUMORD = myamount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIMPORTO() {
|
||||||
|
return (this.IMPORTO == null) ? "" : this.IMPORTO;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIMPORTO(String mybuyeremail) {
|
||||||
|
this.IMPORTO = mybuyeremail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEMAILESERC() {
|
||||||
|
return (this.EMAILESERC == null) ? "" : this.EMAILESERC;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEMAILESERC(String mybuyername) {
|
||||||
|
this.EMAILESERC = mybuyername;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getVALUTA() {
|
||||||
|
return (this.VALUTA == null) ? "" : this.VALUTA;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVALUTA(String mycurrency) {
|
||||||
|
this.VALUTA = mycurrency;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAlias() {
|
||||||
|
return getParm("POSTE19_MAC_KEY_ESITO").getTesto();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMac() {
|
||||||
|
return getMacPagamento();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMacPagamento() {
|
||||||
|
StringBuffer theUrl = new StringBuffer();
|
||||||
|
theUrl.append("&URLMS=");
|
||||||
|
theUrl.append(getURLMS());
|
||||||
|
theUrl.append("&URLDONE=");
|
||||||
|
theUrl.append(getURLDONE());
|
||||||
|
theUrl.append("&NUMORD=");
|
||||||
|
theUrl.append(getNUMORD());
|
||||||
|
theUrl.append("&IDNEGOZIO=");
|
||||||
|
theUrl.append(getIDNEGOZIO());
|
||||||
|
theUrl.append("&IMPORTO=");
|
||||||
|
theUrl.append(getIMPORTO());
|
||||||
|
theUrl.append("&VALUTA=");
|
||||||
|
theUrl.append(getVALUTA());
|
||||||
|
theUrl.append("&TCONTAB=");
|
||||||
|
theUrl.append(getTCONTAB());
|
||||||
|
theUrl.append("&TAUTOR=I");
|
||||||
|
if (!getOPTIONS().isEmpty()) {
|
||||||
|
theUrl.append("&OPTIONS=");
|
||||||
|
theUrl.append(getOPTIONS());
|
||||||
|
}
|
||||||
|
theUrl.append("&USERID=");
|
||||||
|
theUrl.append(getUSERID());
|
||||||
|
String res = "";
|
||||||
|
res = EcDc.encodeHMAC_256(getMAC_KEY_START(), theUrl.toString());
|
||||||
|
System.out.println("stringa mac: " + res);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLINGUA() {
|
||||||
|
return (this.LINGUA == null) ? "" : this.LINGUA;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLINGUA(String lang) {
|
||||||
|
this.LINGUA = lang;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRequestUrl() {
|
||||||
|
return getRequestUrl(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getImportoUrl() {
|
||||||
|
if (this.IMPORTO == null)
|
||||||
|
return "0000";
|
||||||
|
String temp = this.IMPORTO;
|
||||||
|
if (temp.indexOf('.') < 0) {
|
||||||
|
temp = String.valueOf(temp) + "00";
|
||||||
|
} else if (temp.length() - temp.indexOf('.') < 3) {
|
||||||
|
temp = String.valueOf(temp) + "0";
|
||||||
|
}
|
||||||
|
return temp.replace(".", "");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTestRequestUrl() {
|
||||||
|
return getRequestUrl(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void initApplicationParms(ApplParmFull ap) {
|
||||||
|
if (ap != null) {
|
||||||
|
String l_tipoParm = "POSTEPAY 2019";
|
||||||
|
Parm bean = new Parm(ap);
|
||||||
|
bean.findByCodice("POSTE19_URL_BACK");
|
||||||
|
bean.setFlgAdmin(0L);
|
||||||
|
bean.setTipoParm(l_tipoParm);
|
||||||
|
bean.setCodice("POSTE19_URL_BACK");
|
||||||
|
bean.setDescrizione("POSTE19_URL_BACK");
|
||||||
|
bean.setFlgTipo(0L);
|
||||||
|
if (bean.getTesto().equals(""))
|
||||||
|
bean.setTesto("http://localhost/tf15/RicevutaPoste.abl");
|
||||||
|
bean.setNota(
|
||||||
|
"La URL verso la quale mandare l’utente in caso di annullamento del processo di pagamento e ritorno alla modifica del carrello");
|
||||||
|
bean.save();
|
||||||
|
bean.findByCodice("POSTE19_URL_DONE");
|
||||||
|
bean.setFlgAdmin(0L);
|
||||||
|
bean.setTipoParm(l_tipoParm);
|
||||||
|
bean.setCodice("POSTE19_URL_DONE");
|
||||||
|
bean.setDescrizione("POSTE19_URL_DONE");
|
||||||
|
bean.setFlgTipo(0L);
|
||||||
|
if (bean.getTesto().equals(""))
|
||||||
|
bean.setTesto("http://localhost/tf15/RicevutaPoste.abl");
|
||||||
|
bean.setNota("POSTE19_URL_MS");
|
||||||
|
bean.save();
|
||||||
|
bean.findByCodice("POSTE19_URL_MS");
|
||||||
|
bean.setFlgAdmin(0L);
|
||||||
|
bean.setTipoParm(l_tipoParm);
|
||||||
|
bean.setCodice("POSTE19_URL_MS");
|
||||||
|
bean.setDescrizione("POSTE19_URL_MS");
|
||||||
|
bean.setFlgTipo(0L);
|
||||||
|
if (bean.getTesto().equals(""))
|
||||||
|
bean.setTesto("http://localhost/tf15/RicevutaPoste.abl");
|
||||||
|
bean.setNota(
|
||||||
|
"La URL che il sistema deve utilizzare per notificare direttamente al negozio l’esito della transazione compiuta ");
|
||||||
|
bean.save();
|
||||||
|
bean.findByCodice("POSTE19_MAC_KEY_START");
|
||||||
|
bean.setFlgAdmin(0L);
|
||||||
|
bean.setTipoParm(l_tipoParm);
|
||||||
|
bean.setCodice("POSTE19_MAC_KEY_START");
|
||||||
|
bean.setDescrizione("POSTE19_MAC_KEY_START");
|
||||||
|
bean.setFlgTipo(0L);
|
||||||
|
if (bean.getTesto().equals(""))
|
||||||
|
bean.setTesto("CHENESOADESSO");
|
||||||
|
bean.setNota("E' la chiave per il calcolo del MAC nei messaggi di avvio pagamento");
|
||||||
|
bean.save();
|
||||||
|
bean.findByCodice("POSTE19_MAC_KEY_ESITO");
|
||||||
|
bean.setFlgAdmin(0L);
|
||||||
|
bean.setTipoParm(l_tipoParm);
|
||||||
|
bean.setCodice("POSTE19_MAC_KEY_ESITO");
|
||||||
|
bean.setDescrizione("POSTE19_MAC_KEY_ESITO");
|
||||||
|
bean.setFlgTipo(0L);
|
||||||
|
bean.getTesto().equals("");
|
||||||
|
if (bean.getNota().isEmpty())
|
||||||
|
bean.setNota("E' la chiave per la verifica del MAC nei messaggi di esito emessi da Poste e per l’usodelle API.");
|
||||||
|
bean.save();
|
||||||
|
bean.findByCodice("POSTE19_EMAILESERC");
|
||||||
|
bean.setFlgAdmin(0L);
|
||||||
|
bean.setTipoParm(l_tipoParm);
|
||||||
|
bean.setCodice("POSTE19_EMAILESERC");
|
||||||
|
bean.setDescrizione("POSTE19_EMAILESERC");
|
||||||
|
bean.setFlgTipo(0L);
|
||||||
|
bean.getTesto().equals("");
|
||||||
|
if (bean.getNota().isEmpty())
|
||||||
|
bean.setNota(
|
||||||
|
"MAIL ESERCENTE AL QUALE INVIARE L'ESITO DELLA TRANSAZIONE. SE VUOTA VIENE UTILIZZATA QUELLA DELL'ANAGRAFICA DEL NEGOZIO");
|
||||||
|
bean.save();
|
||||||
|
bean.findByCodice("POSTE19_IDNEGOZIO");
|
||||||
|
bean.setFlgAdmin(0L);
|
||||||
|
bean.setTipoParm(l_tipoParm);
|
||||||
|
bean.setCodice("POSTE19_IDNEGOZIO");
|
||||||
|
bean.setDescrizione("POSTE19_IDNEGOZIO");
|
||||||
|
bean.setFlgTipo(0L);
|
||||||
|
bean.getTesto().equals("");
|
||||||
|
if (bean.getNota().isEmpty())
|
||||||
|
bean.setNota("Identificativo del negozio del merchant assegnato da Poste, Merchant ID (MID).");
|
||||||
|
bean.save();
|
||||||
|
bean.findByCodice("POSTE19_TCONTAB");
|
||||||
|
bean.setFlgAdmin(0L);
|
||||||
|
bean.setTipoParm(l_tipoParm);
|
||||||
|
bean.setCodice("POSTE19_TCONTAB");
|
||||||
|
bean.setDescrizione("POSTE19_TCONTAB");
|
||||||
|
bean.setFlgTipo(0L);
|
||||||
|
if (bean.getTesto().equals(""))
|
||||||
|
bean.setTesto("I");
|
||||||
|
if (bean.getNota().isEmpty())
|
||||||
|
bean.setNota(
|
||||||
|
"Tipo di contabilizzazione da utilizzare in questo ordine. Obbligatorio.<br>D --> Differita<br>I --> Immediata");
|
||||||
|
bean.save();
|
||||||
|
bean.findByCodice("POSTE19_OPTIONS");
|
||||||
|
bean.setFlgAdmin(0L);
|
||||||
|
bean.setTipoParm(l_tipoParm);
|
||||||
|
bean.setCodice("POSTE19_OPTIONS");
|
||||||
|
bean.setDescrizione("POSTE19_OPTIONS");
|
||||||
|
bean.setFlgTipo(0L);
|
||||||
|
bean.getTesto().equals("");
|
||||||
|
if (bean.getNota().isEmpty())
|
||||||
|
bean.setNota(
|
||||||
|
"Opzioni aggiuntive per il pagamento in corso.<br>G – In caso di autorizzazione concessa il sistema invece di mostrare l’esito della transazione al consumatore effettua la redirezione immediata presso URLDONE in modo che il negozio virtuale possa mostrare un proprio “scontrino” personalizzato. In caso di autorizzazione negata all’utente viene riproposta la schermata di inserimento carta.<br>L – Nel caso di ordine duplicato il sistema invia una URLMS con codice di esito 07.<br>N – In caso di autorizzazione negata il sistema, invece di mostrare l’esito della transazione alconsumatore, effettua la redirezione immediata verso URLDONE.<br>P – Viene restituito, in URLMS E URDONE, il campo RESPONSE_CODE_AUT che rappresenta il codice di risposta ritornato dal backend autorizzativo.<br>");
|
||||||
|
bean.save();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private String getIDNEGOZIO() {
|
||||||
|
return getParm("POSTE19_IDNEGOZIO").getTesto();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getURLBACK() {
|
||||||
|
return getParm("POSTE19_URL_BACK").getTesto();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getURLDONE() {
|
||||||
|
return getParm("POSTE19_URL_DONE").getTesto();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getURLMS() {
|
||||||
|
return getParm("POSTE19_URL_MS").getTesto();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTCONTAB() {
|
||||||
|
return getParm("POSTE19_TCONTAB").getTesto();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTAUTOR() {
|
||||||
|
return "I";
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOPTIONS() {
|
||||||
|
return getParm("POSTE19_OPTIONS").getTesto();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEMAIL() {
|
||||||
|
return this.EMAIL;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEMAIL(String eMAIL) {
|
||||||
|
this.EMAIL = eMAIL;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUSERID() {
|
||||||
|
return this.USERID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUSERID(String uSERID) {
|
||||||
|
this.USERID = uSERID;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String getMAC_KEY_START() {
|
||||||
|
return getParm("POSTE19_MAC_KEY_START").getTesto();
|
||||||
|
}
|
||||||
|
|
||||||
|
private String getRequestUrl(boolean test) {
|
||||||
|
StringBuilder theUrl = new StringBuilder();
|
||||||
|
if (test) {
|
||||||
|
theUrl.append("https://acquistionlinetest.poste.it/poste/pagamenti/main?PAGE=MASTER");
|
||||||
|
} else {
|
||||||
|
theUrl.append("https://acquistionline.poste.it/poste/pagamenti/main?PAGE=MASTER");
|
||||||
|
}
|
||||||
|
theUrl.append("&IMPORTO=");
|
||||||
|
theUrl.append(getIMPORTO());
|
||||||
|
theUrl.append("&VALUTA=");
|
||||||
|
theUrl.append(getVALUTA());
|
||||||
|
theUrl.append("&NUMORD=");
|
||||||
|
theUrl.append(getNUMORD());
|
||||||
|
theUrl.append("&IDNEGOZIO=");
|
||||||
|
theUrl.append(getIDNEGOZIO());
|
||||||
|
theUrl.append("&URLBACK=");
|
||||||
|
theUrl.append(getURLBACK());
|
||||||
|
theUrl.append("&URLDONE=");
|
||||||
|
theUrl.append(getURLDONE());
|
||||||
|
theUrl.append("&URLMS=");
|
||||||
|
theUrl.append(getURLMS());
|
||||||
|
theUrl.append("&TCONTAB=");
|
||||||
|
theUrl.append(getTCONTAB());
|
||||||
|
theUrl.append("&TAUTOR=I");
|
||||||
|
theUrl.append("&MAC=");
|
||||||
|
theUrl.append(getMacPagamento());
|
||||||
|
theUrl.append("&LINGUA=");
|
||||||
|
theUrl.append(getLINGUA());
|
||||||
|
if (!getEMAILESERC().isEmpty()) {
|
||||||
|
theUrl.append("&EMAILESERC=");
|
||||||
|
theUrl.append(getEMAILESERC());
|
||||||
|
}
|
||||||
|
if (!getOPTIONS().isEmpty()) {
|
||||||
|
theUrl.append("&OPTIONS=");
|
||||||
|
theUrl.append(getOPTIONS());
|
||||||
|
}
|
||||||
|
theUrl.append("&EMAIL=");
|
||||||
|
theUrl.append(getEMAIL());
|
||||||
|
theUrl.append("&USERID=");
|
||||||
|
theUrl.append(getUSERID());
|
||||||
|
return theUrl.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,258 @@
|
||||||
|
package com.ablia.bank.poste2019;
|
||||||
|
|
||||||
|
import com.ablia.bank._BankAdapter;
|
||||||
|
import com.ablia.db.ApplParmFull;
|
||||||
|
import com.ablia.reg.EcDc;
|
||||||
|
|
||||||
|
public class PosteRes extends _BankAdapter {
|
||||||
|
public static final String ESITO_OK = "00";
|
||||||
|
|
||||||
|
public static final String ESITO_KO_01 = "01";
|
||||||
|
|
||||||
|
public static final String ESITO_KO_02 = "02";
|
||||||
|
|
||||||
|
public static final String ESITO_KO_03 = "03";
|
||||||
|
|
||||||
|
public static final String ESITO_KO_04 = "04";
|
||||||
|
|
||||||
|
public static final String ESITO_KO_05 = "05";
|
||||||
|
|
||||||
|
public static final String ESITO_KO_06 = "06";
|
||||||
|
|
||||||
|
public static final String ESITO_KO_07 = "07";
|
||||||
|
|
||||||
|
public static final String ESITO_KO_60 = "60";
|
||||||
|
|
||||||
|
public static final String ESITO_KO_66 = "66";
|
||||||
|
|
||||||
|
private String IMPORTO;
|
||||||
|
|
||||||
|
private String NUMORD;
|
||||||
|
|
||||||
|
private String VALUTA;
|
||||||
|
|
||||||
|
private String ESITO;
|
||||||
|
|
||||||
|
private String AUT;
|
||||||
|
|
||||||
|
private String IDTRANS;
|
||||||
|
|
||||||
|
private String IDNEGOZIO;
|
||||||
|
|
||||||
|
private String MAC;
|
||||||
|
|
||||||
|
private String TCONTAB;
|
||||||
|
|
||||||
|
private String TAUTOR;
|
||||||
|
|
||||||
|
private String BPW_TIPO_TRANSAZIONE;
|
||||||
|
|
||||||
|
private String RESPONSE_CODE_AUT;
|
||||||
|
|
||||||
|
private String ALIASSTR;
|
||||||
|
|
||||||
|
private String EMAILTIT;
|
||||||
|
|
||||||
|
private String CFTIT;
|
||||||
|
|
||||||
|
public PosteRes() {}
|
||||||
|
|
||||||
|
public static final String getEsito(String l_esito) {
|
||||||
|
if (l_esito.equals("01"))
|
||||||
|
return "Negata dal sistema";
|
||||||
|
if (l_esito.equals("02"))
|
||||||
|
return "Negata per problemi sull'anagrafica negozio";
|
||||||
|
if (l_esito.equals("03"))
|
||||||
|
return "Negata per problemi di comunicazione con i circuiti autorizzativi";
|
||||||
|
if (l_esito.equals("04"))
|
||||||
|
return "Negata dall'emittente della carta";
|
||||||
|
if (l_esito.equals("05"))
|
||||||
|
return "Negata per numero carta errato";
|
||||||
|
if (l_esito.equals("06"))
|
||||||
|
return "Errore imprevisto durante l’elaborazione della richiesta";
|
||||||
|
if (l_esito.equals("07"))
|
||||||
|
return "Ordine duplicato";
|
||||||
|
if (l_esito.equals("60"))
|
||||||
|
return "Negata dai controlli antifrode di Poste";
|
||||||
|
if (l_esito.equals("66"))
|
||||||
|
return "Negata per mancata autenticazione dell’utente nelle procedure di verifica (ACS).";
|
||||||
|
if (l_esito.equals("00"))
|
||||||
|
return "Successo";
|
||||||
|
return "??";
|
||||||
|
}
|
||||||
|
|
||||||
|
public PosteRes(ApplParmFull apFull) {
|
||||||
|
setAp(apFull);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isMacRitornoOk() {
|
||||||
|
String macCalcolato = getMacEsito();
|
||||||
|
if (getMAC().equals(macCalcolato))
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getKey() {
|
||||||
|
return getParm("XPAY_MAC_KEY").getTesto();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIMPORTO() {
|
||||||
|
return this.IMPORTO;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIMPORTO(String iMPORTO) {
|
||||||
|
this.IMPORTO = iMPORTO;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNUMORD() {
|
||||||
|
return this.NUMORD;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNUMORD(String nUMORD) {
|
||||||
|
this.NUMORD = nUMORD;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getVALUTA() {
|
||||||
|
return this.VALUTA;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVALUTA(String vALUTA) {
|
||||||
|
this.VALUTA = vALUTA;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getESITO() {
|
||||||
|
return this.ESITO;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setESITO(String eSITO) {
|
||||||
|
this.ESITO = eSITO;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAUT() {
|
||||||
|
return this.AUT;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAUT(String aUT) {
|
||||||
|
this.AUT = aUT;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIDTRANS() {
|
||||||
|
return this.IDTRANS;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIDTRANS(String iDTRANS) {
|
||||||
|
this.IDTRANS = iDTRANS;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIDNEGOZIO() {
|
||||||
|
return this.IDNEGOZIO;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIDNEGOZIO(String iDNEGOZIO) {
|
||||||
|
this.IDNEGOZIO = iDNEGOZIO;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMAC() {
|
||||||
|
return this.MAC;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMAC(String mAC) {
|
||||||
|
this.MAC = mAC;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String getMAC_KEY_ESITO() {
|
||||||
|
return getParm("POSTE19_MAC_KEY_ESITO").getTesto();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMacEsito() {
|
||||||
|
StringBuffer theUrl = new StringBuffer();
|
||||||
|
theUrl.append("&NUMORD=");
|
||||||
|
theUrl.append(getNUMORD());
|
||||||
|
theUrl.append("&IDNEGOZIO=");
|
||||||
|
theUrl.append(getIDNEGOZIO());
|
||||||
|
theUrl.append("&AUT=");
|
||||||
|
theUrl.append(getAUT());
|
||||||
|
theUrl.append("&IMPORTO=");
|
||||||
|
theUrl.append(getIMPORTO());
|
||||||
|
theUrl.append("&VALUTA=");
|
||||||
|
theUrl.append(getVALUTA());
|
||||||
|
theUrl.append("&IDTRANS=");
|
||||||
|
theUrl.append(getIDTRANS());
|
||||||
|
theUrl.append("&TCONTAB=");
|
||||||
|
theUrl.append(getTCONTAB());
|
||||||
|
theUrl.append("&TAUTOR=");
|
||||||
|
theUrl.append(getTAUTOR());
|
||||||
|
theUrl.append("&ESITO=");
|
||||||
|
theUrl.append(getESITO());
|
||||||
|
theUrl.append("&BPW_TIPO_TRANSAZIONE=");
|
||||||
|
theUrl.append(getBPW_TIPO_TRANSAZIONE());
|
||||||
|
if (getOPTIONS().equals("P")) {
|
||||||
|
theUrl.append("&RESPONSE_CODE_AUT=");
|
||||||
|
theUrl.append(getRESPONSE_CODE_AUT());
|
||||||
|
}
|
||||||
|
String res = "";
|
||||||
|
res = EcDc.encodeHMAC_256(getMAC_KEY_ESITO(), theUrl.toString());
|
||||||
|
System.out.println("stringa mac esito: " + res);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTCONTAB() {
|
||||||
|
return this.TCONTAB;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTCONTAB(String tCONTAB) {
|
||||||
|
this.TCONTAB = tCONTAB;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTAUTOR() {
|
||||||
|
return this.TAUTOR;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTAUTOR(String tAUTOR) {
|
||||||
|
this.TAUTOR = tAUTOR;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBPW_TIPO_TRANSAZIONE() {
|
||||||
|
return this.BPW_TIPO_TRANSAZIONE;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBPW_TIPO_TRANSAZIONE(String bPW_TIPO_TRANSAZIONE) {
|
||||||
|
this.BPW_TIPO_TRANSAZIONE = bPW_TIPO_TRANSAZIONE;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRESPONSE_CODE_AUT() {
|
||||||
|
return this.RESPONSE_CODE_AUT;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRESPONSE_CODE_AUT(String rESPONSE_CODE_AUT) {
|
||||||
|
this.RESPONSE_CODE_AUT = rESPONSE_CODE_AUT;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getALIASSTR() {
|
||||||
|
return this.ALIASSTR;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setALIASSTR(String aLIASSTR) {
|
||||||
|
this.ALIASSTR = aLIASSTR;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEMAILTIT() {
|
||||||
|
return this.EMAILTIT;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEMAILTIT(String eMAILTIT) {
|
||||||
|
this.EMAILTIT = eMAILTIT;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCFTIT() {
|
||||||
|
return this.CFTIT;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCFTIT(String cFTIT) {
|
||||||
|
this.CFTIT = cFTIT;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOPTIONS() {
|
||||||
|
return getParm("POSTE19_OPTIONS").getTesto();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,722 @@
|
||||||
|
package com.ablia.bank.sella;
|
||||||
|
|
||||||
|
import java.io.BufferedReader;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStreamReader;
|
||||||
|
import java.net.MalformedURLException;
|
||||||
|
import java.net.URL;
|
||||||
|
import java.net.URLConnection;
|
||||||
|
import java.net.URLEncoder;
|
||||||
|
import java.net.UnknownServiceException;
|
||||||
|
|
||||||
|
public class GestPayCrypt {
|
||||||
|
private String ShopLogin = "";
|
||||||
|
|
||||||
|
private String Currency = "";
|
||||||
|
|
||||||
|
private String Amount = "";
|
||||||
|
|
||||||
|
private String ShopTransactionID = "";
|
||||||
|
|
||||||
|
private String BuyerName = "";
|
||||||
|
|
||||||
|
private String BuyerEmail = "";
|
||||||
|
|
||||||
|
private String Language = "";
|
||||||
|
|
||||||
|
private String CustomInfo = "";
|
||||||
|
|
||||||
|
private String AuthorizationCode = "";
|
||||||
|
|
||||||
|
private String ErrorCode = "";
|
||||||
|
|
||||||
|
private String ErrorDescription = "";
|
||||||
|
|
||||||
|
private String BankTransactionID = "";
|
||||||
|
|
||||||
|
private String AlertCode = "";
|
||||||
|
|
||||||
|
private String AlertDescription = "";
|
||||||
|
|
||||||
|
private String EncryptedString = "";
|
||||||
|
|
||||||
|
private String ToBeEncript = "";
|
||||||
|
|
||||||
|
private String Decripted = "";
|
||||||
|
|
||||||
|
private String TransactionResult = "";
|
||||||
|
|
||||||
|
private String ProtocolAuthServer = "";
|
||||||
|
|
||||||
|
private String DomainName = "";
|
||||||
|
|
||||||
|
private String separator = "";
|
||||||
|
|
||||||
|
private String errDescription = "";
|
||||||
|
|
||||||
|
private String errNumber = "";
|
||||||
|
|
||||||
|
private String Version = "";
|
||||||
|
|
||||||
|
private String Min = "";
|
||||||
|
|
||||||
|
private String CVV = "";
|
||||||
|
|
||||||
|
private String country = "";
|
||||||
|
|
||||||
|
private String vbvrisp = "";
|
||||||
|
|
||||||
|
private String vbv = "";
|
||||||
|
|
||||||
|
private String trans;
|
||||||
|
|
||||||
|
public GestPayCrypt() {
|
||||||
|
this.ShopLogin = "";
|
||||||
|
this.Currency = "";
|
||||||
|
this.Amount = "";
|
||||||
|
this.ShopTransactionID = "";
|
||||||
|
this.BuyerName = "";
|
||||||
|
this.BuyerEmail = "";
|
||||||
|
this.Language = "";
|
||||||
|
this.CustomInfo = "";
|
||||||
|
this.AuthorizationCode = "";
|
||||||
|
this.ErrorCode = "";
|
||||||
|
this.ErrorDescription = "";
|
||||||
|
this.BankTransactionID = "";
|
||||||
|
this.AlertCode = "";
|
||||||
|
this.AlertDescription = "";
|
||||||
|
this.EncryptedString = "";
|
||||||
|
this.ToBeEncript = "";
|
||||||
|
this.Decripted = "";
|
||||||
|
this.ProtocolAuthServer = "http://";
|
||||||
|
this.DomainName = "";
|
||||||
|
this.separator = "*P1*";
|
||||||
|
this.errDescription = "";
|
||||||
|
this.errNumber = "0";
|
||||||
|
this.Version = "3.0";
|
||||||
|
this.Min = "";
|
||||||
|
this.CVV = "";
|
||||||
|
this.country = "";
|
||||||
|
this.vbvrisp = "";
|
||||||
|
this.vbv = "";
|
||||||
|
this.trans = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setShopLogin(String xstr) {
|
||||||
|
this.ShopLogin = xstr;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCurrency(String xstr) {
|
||||||
|
this.Currency = xstr;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAmount(String xstr) {
|
||||||
|
this.Amount = xstr;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setShopTransactionID(String xstr) {
|
||||||
|
this.ShopTransactionID = URLEncoder.encode(xstr.trim());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMIN(String xstr) {
|
||||||
|
this.Min = xstr;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCVV(String xstr) {
|
||||||
|
this.CVV = xstr;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBuyerName(String xstr) {
|
||||||
|
this.BuyerName = URLEncoder.encode(xstr.trim());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBuyerEmail(String xstr) {
|
||||||
|
this.BuyerEmail = xstr.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLanguage(String xstr) {
|
||||||
|
this.Language = xstr.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCustomInfo(String xstr) {
|
||||||
|
this.CustomInfo = URLEncoder.encode(xstr.trim());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEncryptedString(String xstr) {
|
||||||
|
this.EncryptedString = xstr;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProtocolServer(String xstr) {
|
||||||
|
this.ProtocolAuthServer = xstr;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDomainName(String xstr) {
|
||||||
|
this.DomainName = xstr;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getShopLogin() {
|
||||||
|
return this.ShopLogin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCurrency() {
|
||||||
|
return this.Currency;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAmount() {
|
||||||
|
return this.Amount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCountry() {
|
||||||
|
return this.country;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getVBV() {
|
||||||
|
return this.vbv;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getVBVrisp() {
|
||||||
|
return this.vbvrisp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getShopTransactionID() {
|
||||||
|
String app = "";
|
||||||
|
try {
|
||||||
|
app = URLDecode(this.ShopTransactionID);
|
||||||
|
} catch (Exception e) {}
|
||||||
|
return app;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBuyerName() {
|
||||||
|
String appBuyername = "";
|
||||||
|
try {
|
||||||
|
appBuyername = URLDecode(this.BuyerName);
|
||||||
|
} catch (Exception ex) {
|
||||||
|
appBuyername = "errore";
|
||||||
|
}
|
||||||
|
return appBuyername;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBuyerEmail() {
|
||||||
|
return this.BuyerEmail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCustomInfo() {
|
||||||
|
String appCustom = "";
|
||||||
|
try {
|
||||||
|
appCustom = URLDecode(this.CustomInfo);
|
||||||
|
} catch (Exception e) {}
|
||||||
|
return appCustom;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAuthorizationCode() {
|
||||||
|
return this.AuthorizationCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getErrorCode() {
|
||||||
|
return this.ErrorCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getErrorDescription() {
|
||||||
|
return this.ErrorDescription;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBankTransactionID() {
|
||||||
|
return this.BankTransactionID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTransactionResult() {
|
||||||
|
return this.TransactionResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAlertCode() {
|
||||||
|
return this.AlertCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAlertDescription() {
|
||||||
|
return this.AlertDescription;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEncryptedString() {
|
||||||
|
return this.EncryptedString;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getProtocolServer() {
|
||||||
|
return this.ProtocolAuthServer;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDomainName() {
|
||||||
|
return this.DomainName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean Encrypt() {
|
||||||
|
String sErr = "";
|
||||||
|
this.ErrorCode = "0";
|
||||||
|
this.ErrorDescription = "";
|
||||||
|
try {
|
||||||
|
if (this.ShopLogin.length() <= 0) {
|
||||||
|
this.ErrorCode = "546";
|
||||||
|
this.ErrorDescription = "IDshop not valid";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (controlValues(this.ProtocolAuthServer))
|
||||||
|
this.ProtocolAuthServer = "http://";
|
||||||
|
this.trans = this.ShopLogin.substring(0, 6);
|
||||||
|
this.trans = this.trans.toLowerCase();
|
||||||
|
if (controlValues(this.DomainName))
|
||||||
|
if (this.trans.equals("gespay")) {
|
||||||
|
this.DomainName = "testecomm.sella.it/CryptHTTP";
|
||||||
|
} else {
|
||||||
|
this.DomainName = "ecomms2s.sella.it/CryptHTTP";
|
||||||
|
}
|
||||||
|
if (this.Currency.length() <= 0) {
|
||||||
|
this.ErrorCode = "552";
|
||||||
|
this.ErrorDescription = "Currency not valid";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (this.Amount.length() <= 0) {
|
||||||
|
this.ErrorCode = "553";
|
||||||
|
this.ErrorDescription = "Amount not valid";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (this.ShopTransactionID.length() <= 0) {
|
||||||
|
this.ErrorCode = "551";
|
||||||
|
this.ErrorDescription = "Shop Transaction ID not valid";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
this.ToBeEncript = "";
|
||||||
|
if (this.CVV.length() > 0)
|
||||||
|
this.ToBeEncript = String.valueOf(this.ToBeEncript) + this.separator + "PAY1_CVV=" + this.CVV;
|
||||||
|
if (this.Min.length() > 0)
|
||||||
|
this.ToBeEncript = String.valueOf(this.ToBeEncript) + this.separator + "PAY1_MIN=" + this.Min;
|
||||||
|
if (this.Currency.length() > 0)
|
||||||
|
this.ToBeEncript = String.valueOf(this.ToBeEncript) + this.separator + "PAY1_UICCODE=" + this.Currency;
|
||||||
|
if (this.Amount.length() > 0)
|
||||||
|
this.ToBeEncript = String.valueOf(this.ToBeEncript) + this.separator + "PAY1_AMOUNT=" + this.Amount;
|
||||||
|
if (this.ShopTransactionID.length() > 0)
|
||||||
|
this.ToBeEncript = String.valueOf(this.ToBeEncript) + this.separator + "PAY1_SHOPTRANSACTIONID=" + this.ShopTransactionID;
|
||||||
|
if (this.BuyerName.length() > 0)
|
||||||
|
this.ToBeEncript = String.valueOf(this.ToBeEncript) + this.separator + "PAY1_CHNAME=" + this.BuyerName;
|
||||||
|
if (this.BuyerEmail.length() > 0)
|
||||||
|
this.ToBeEncript = String.valueOf(this.ToBeEncript) + this.separator + "PAY1_CHEMAIL=" + this.BuyerEmail;
|
||||||
|
if (this.Language.length() > 0)
|
||||||
|
this.ToBeEncript = String.valueOf(this.ToBeEncript) + this.separator + "PAY1_IDLANGUAGE=" + this.Language;
|
||||||
|
if (this.CustomInfo.length() > 0)
|
||||||
|
this.ToBeEncript = String.valueOf(this.ToBeEncript) + this.separator + this.CustomInfo;
|
||||||
|
String urlString = String.valueOf(this.ProtocolAuthServer) + this.DomainName + "/Encrypt.asp?a=" +
|
||||||
|
this.ShopLogin + "&b=" + this.ToBeEncript.substring(4, this.ToBeEncript.length()) +
|
||||||
|
"&c=" + this.Version;
|
||||||
|
URL url = new URL(urlString);
|
||||||
|
URLConnection connection = url.openConnection();
|
||||||
|
BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
|
||||||
|
int nStart = 0;
|
||||||
|
int nEnd = 0;
|
||||||
|
String line = "";
|
||||||
|
while (line != null) {
|
||||||
|
line = in.readLine();
|
||||||
|
if (line != null) {
|
||||||
|
nStart = line.indexOf("#cryptstring#");
|
||||||
|
nEnd = line.lastIndexOf("#/cryptstring#");
|
||||||
|
if (((nStart != -1) ? true : false) & ((nEnd > nStart + 14) ? true : false))
|
||||||
|
this.EncryptedString = line.substring(nStart + 13, nEnd);
|
||||||
|
nStart = line.indexOf("#error#");
|
||||||
|
nEnd = line.lastIndexOf("#/error#");
|
||||||
|
if (((nStart != -1) ? true : false) & ((nEnd > nStart + 8) ? true : false)) {
|
||||||
|
sErr = line.substring(nStart + 7, nEnd);
|
||||||
|
int intsep = sErr.indexOf("-");
|
||||||
|
this.ErrorCode = sErr.substring(0, intsep);
|
||||||
|
this.ErrorDescription = sErr.substring(intsep + 1, sErr.length());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
in.close();
|
||||||
|
return true;
|
||||||
|
} catch (MalformedURLException ex) {
|
||||||
|
this.ErrorCode = "9999";
|
||||||
|
this.ErrorDescription = "Bad URL";
|
||||||
|
return false;
|
||||||
|
} catch (UnknownServiceException ex) {
|
||||||
|
this.ErrorCode = "9999";
|
||||||
|
this.ErrorDescription = "ServiceException occurred.";
|
||||||
|
return false;
|
||||||
|
} catch (IOException ex) {
|
||||||
|
this.ErrorCode = "9999";
|
||||||
|
this.ErrorDescription = "Bad URL Request";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean Decrypt() {
|
||||||
|
this.ErrorCode = "0";
|
||||||
|
this.ErrorDescription = "";
|
||||||
|
String strdaelim = "";
|
||||||
|
if (this.ShopLogin.length() <= 0) {
|
||||||
|
this.ErrorCode = "546";
|
||||||
|
this.ErrorDescription = "IDshop not valid";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (controlValues(this.ProtocolAuthServer))
|
||||||
|
this.ProtocolAuthServer = "http://";
|
||||||
|
this.trans = this.ShopLogin.substring(0, 6);
|
||||||
|
this.trans = this.trans.toLowerCase();
|
||||||
|
if (controlValues(this.DomainName))
|
||||||
|
if (this.trans.equals("gespay")) {
|
||||||
|
this.DomainName = "testecomm.sella.it/CryptHTTP";
|
||||||
|
} else {
|
||||||
|
this.DomainName = "ecomms2s.sella.it/CryptHTTP";
|
||||||
|
}
|
||||||
|
if (this.EncryptedString.length() <= 0) {
|
||||||
|
this.ErrorCode = "1009";
|
||||||
|
this.ErrorDescription = "String to Decrypt not valid";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
String urlString = String.valueOf(this.ProtocolAuthServer) + this.DomainName + "/Decrypt.asp?a=" + this.ShopLogin + "&b=" + this.EncryptedString + "&c=" + this.Version;
|
||||||
|
URL url = new URL(urlString);
|
||||||
|
URLConnection connection = url.openConnection();
|
||||||
|
BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
|
||||||
|
int nStart = 0;
|
||||||
|
int nEnd = 0;
|
||||||
|
String line = "";
|
||||||
|
while (line != null) {
|
||||||
|
line = in.readLine();
|
||||||
|
if (line != null) {
|
||||||
|
nStart = line.indexOf("#decryptstring#");
|
||||||
|
nEnd = line.lastIndexOf("#/decryptstring#");
|
||||||
|
if (((nStart != -1) ? true : false) & ((nEnd > nStart + 16) ? true : false))
|
||||||
|
this.Decripted = line.substring(nStart + 15, nEnd);
|
||||||
|
nStart = line.indexOf("#error#");
|
||||||
|
nEnd = line.lastIndexOf("#/error#");
|
||||||
|
if (((nStart != -1) ? true : false) & ((nEnd > nStart + 8) ? true : false)) {
|
||||||
|
String sErr = line.substring(nStart + 7, nEnd);
|
||||||
|
int intsep = sErr.indexOf("-");
|
||||||
|
this.ErrorCode = sErr.substring(0, intsep);
|
||||||
|
this.ErrorDescription = sErr.substring(intsep + 1, sErr.length());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
in.close();
|
||||||
|
if (this.Decripted.trim() == "") {
|
||||||
|
this.ErrorCode = "9999";
|
||||||
|
this.ErrorDescription = "Void String";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!Parsing(this.Decripted))
|
||||||
|
return false;
|
||||||
|
return true;
|
||||||
|
} catch (MalformedURLException ex) {
|
||||||
|
this.ErrorCode = "9999";
|
||||||
|
this.ErrorDescription = "Bad URL";
|
||||||
|
return false;
|
||||||
|
} catch (UnknownServiceException ex) {
|
||||||
|
this.ErrorCode = "9999";
|
||||||
|
this.ErrorDescription = "Service Exception occurred.";
|
||||||
|
return false;
|
||||||
|
} catch (IOException ex) {
|
||||||
|
this.ErrorCode = "9999";
|
||||||
|
this.ErrorDescription = "Bad URL Request";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean Parsing(String StringToBeParsed) {
|
||||||
|
int nStart = 0;
|
||||||
|
int nEnd = 0;
|
||||||
|
this.ErrorCode = "";
|
||||||
|
this.ErrorDescription = "";
|
||||||
|
try {
|
||||||
|
nStart = StringToBeParsed.indexOf("PAY1_UICCODE");
|
||||||
|
if (nStart != -1) {
|
||||||
|
nEnd = StringToBeParsed.indexOf(this.separator, nStart);
|
||||||
|
if (nEnd == -1) {
|
||||||
|
nEnd = StringToBeParsed.length();
|
||||||
|
this.Currency = StringToBeParsed.substring(nStart + 13, nEnd);
|
||||||
|
if (nStart >= 4) {
|
||||||
|
StringToBeParsed = StringToBeParsed.substring(0, nStart - 4);
|
||||||
|
} else {
|
||||||
|
StringToBeParsed = StringToBeParsed.substring(0, nStart);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.Currency = StringToBeParsed.substring(nStart + 13, nEnd);
|
||||||
|
StringToBeParsed = String.valueOf(StringToBeParsed.substring(0, nStart)) + StringToBeParsed.substring(nEnd + 4, StringToBeParsed.length());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
nStart = StringToBeParsed.indexOf("PAY1_AMOUNT");
|
||||||
|
if (nStart != -1) {
|
||||||
|
nEnd = StringToBeParsed.indexOf(this.separator, nStart);
|
||||||
|
if (nEnd == -1) {
|
||||||
|
nEnd = StringToBeParsed.length();
|
||||||
|
this.Amount = StringToBeParsed.substring(nStart + 12, nEnd);
|
||||||
|
if (nStart >= 4) {
|
||||||
|
StringToBeParsed = StringToBeParsed.substring(0, nStart - 4);
|
||||||
|
} else {
|
||||||
|
StringToBeParsed = StringToBeParsed.substring(0, nStart);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.Amount = StringToBeParsed.substring(nStart + 12, nEnd);
|
||||||
|
StringToBeParsed = String.valueOf(StringToBeParsed.substring(0, nStart)) + StringToBeParsed.substring(nEnd + 4, StringToBeParsed.length());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
nStart = StringToBeParsed.indexOf("PAY1_SHOPTRANSACTIONID");
|
||||||
|
if (nStart != -1) {
|
||||||
|
nEnd = StringToBeParsed.indexOf(this.separator, nStart);
|
||||||
|
if (nEnd == -1) {
|
||||||
|
nEnd = StringToBeParsed.length();
|
||||||
|
this.ShopTransactionID = StringToBeParsed.substring(nStart + 23, nEnd);
|
||||||
|
if (nStart >= 4) {
|
||||||
|
StringToBeParsed = StringToBeParsed.substring(0, nStart - 4);
|
||||||
|
} else {
|
||||||
|
StringToBeParsed = StringToBeParsed.substring(0, nStart);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.ShopTransactionID = StringToBeParsed.substring(nStart + 23, nEnd);
|
||||||
|
StringToBeParsed = String.valueOf(StringToBeParsed.substring(0, nStart)) + StringToBeParsed.substring(nEnd + 4, StringToBeParsed.length());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
nStart = StringToBeParsed.indexOf("PAY1_CHNAME");
|
||||||
|
if (nStart != -1) {
|
||||||
|
nEnd = StringToBeParsed.indexOf(this.separator, nStart);
|
||||||
|
if (nEnd == -1) {
|
||||||
|
nEnd = StringToBeParsed.length();
|
||||||
|
this.BuyerName = StringToBeParsed.substring(nStart + 12, nEnd);
|
||||||
|
if (nStart >= 4) {
|
||||||
|
StringToBeParsed = StringToBeParsed.substring(0, nStart - 4);
|
||||||
|
} else {
|
||||||
|
StringToBeParsed = StringToBeParsed.substring(0, nStart);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.BuyerName = StringToBeParsed.substring(nStart + 12, nEnd);
|
||||||
|
StringToBeParsed = String.valueOf(StringToBeParsed.substring(0, nStart)) + StringToBeParsed.substring(nEnd + 4, StringToBeParsed.length());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
nStart = StringToBeParsed.indexOf("PAY1_CHEMAIL");
|
||||||
|
if (nStart != -1) {
|
||||||
|
nEnd = StringToBeParsed.indexOf(this.separator, nStart);
|
||||||
|
if (nEnd == -1) {
|
||||||
|
nEnd = StringToBeParsed.length();
|
||||||
|
this.BuyerEmail = StringToBeParsed.substring(nStart + 13, nEnd);
|
||||||
|
if (nStart >= 4) {
|
||||||
|
StringToBeParsed = StringToBeParsed.substring(0, nStart - 4);
|
||||||
|
} else {
|
||||||
|
StringToBeParsed = StringToBeParsed.substring(0, nStart);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.BuyerEmail = StringToBeParsed.substring(nStart + 13, nEnd);
|
||||||
|
StringToBeParsed = String.valueOf(StringToBeParsed.substring(0, nStart)) + StringToBeParsed.substring(nEnd + 4, StringToBeParsed.length());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
nStart = StringToBeParsed.indexOf("PAY1_AUTHORIZATIONCODE");
|
||||||
|
if (nStart != -1) {
|
||||||
|
nEnd = StringToBeParsed.indexOf(this.separator, nStart);
|
||||||
|
if (nEnd == -1) {
|
||||||
|
nEnd = StringToBeParsed.length();
|
||||||
|
this.AuthorizationCode = StringToBeParsed.substring(nStart + 23, nEnd);
|
||||||
|
if (nStart >= 4) {
|
||||||
|
StringToBeParsed = StringToBeParsed.substring(0, nStart - 4);
|
||||||
|
} else {
|
||||||
|
StringToBeParsed = StringToBeParsed.substring(0, nStart);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.AuthorizationCode = StringToBeParsed.substring(nStart + 23, nEnd);
|
||||||
|
StringToBeParsed = String.valueOf(StringToBeParsed.substring(0, nStart)) + StringToBeParsed.substring(nEnd + 4, StringToBeParsed.length());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
nStart = StringToBeParsed.indexOf("PAY1_ERRORCODE");
|
||||||
|
if (nStart != -1) {
|
||||||
|
nEnd = StringToBeParsed.indexOf(this.separator, nStart);
|
||||||
|
if (nEnd == -1) {
|
||||||
|
nEnd = StringToBeParsed.length();
|
||||||
|
this.ErrorCode = StringToBeParsed.substring(nStart + 15, nEnd);
|
||||||
|
if (nStart >= 4) {
|
||||||
|
StringToBeParsed = StringToBeParsed.substring(0, nStart - 4);
|
||||||
|
} else {
|
||||||
|
StringToBeParsed = StringToBeParsed.substring(0, nStart);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.ErrorCode = StringToBeParsed.substring(nStart + 15, nEnd);
|
||||||
|
StringToBeParsed = String.valueOf(StringToBeParsed.substring(0, nStart)) + StringToBeParsed.substring(nEnd + 4, StringToBeParsed.length());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
nStart = StringToBeParsed.indexOf("PAY1_ERRORDESCRIPTION");
|
||||||
|
if (nStart != -1) {
|
||||||
|
nEnd = StringToBeParsed.indexOf(this.separator, nStart);
|
||||||
|
if (nEnd == -1) {
|
||||||
|
nEnd = StringToBeParsed.length();
|
||||||
|
this.ErrorDescription = StringToBeParsed.substring(nStart + 22, nEnd);
|
||||||
|
if (nStart >= 4) {
|
||||||
|
StringToBeParsed = StringToBeParsed.substring(0, nStart - 4);
|
||||||
|
} else {
|
||||||
|
StringToBeParsed = StringToBeParsed.substring(0, nStart);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.ErrorDescription = StringToBeParsed.substring(nStart + 22, nEnd);
|
||||||
|
StringToBeParsed = String.valueOf(StringToBeParsed.substring(0, nStart)) + StringToBeParsed.substring(nEnd + 4, StringToBeParsed.length());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
nStart = StringToBeParsed.indexOf("PAY1_BANKTRANSACTIONID");
|
||||||
|
if (nStart != -1) {
|
||||||
|
nEnd = StringToBeParsed.indexOf(this.separator, nStart);
|
||||||
|
if (nEnd == -1) {
|
||||||
|
nEnd = StringToBeParsed.length();
|
||||||
|
this.BankTransactionID = StringToBeParsed.substring(nStart + 23, nEnd);
|
||||||
|
if (nStart >= 4) {
|
||||||
|
StringToBeParsed = StringToBeParsed.substring(0, nStart - 4);
|
||||||
|
} else {
|
||||||
|
StringToBeParsed = StringToBeParsed.substring(0, nStart);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.BankTransactionID = StringToBeParsed.substring(nStart + 23, nEnd);
|
||||||
|
StringToBeParsed = String.valueOf(StringToBeParsed.substring(0, nStart)) + StringToBeParsed.substring(nEnd + 4, StringToBeParsed.length());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
nStart = StringToBeParsed.indexOf("PAY1_ALERTCODE");
|
||||||
|
if (nStart != -1) {
|
||||||
|
nEnd = StringToBeParsed.indexOf(this.separator, nStart);
|
||||||
|
if (nEnd == -1) {
|
||||||
|
nEnd = StringToBeParsed.length();
|
||||||
|
this.AlertCode = StringToBeParsed.substring(nStart + 15, nEnd);
|
||||||
|
if (nStart >= 4) {
|
||||||
|
StringToBeParsed = StringToBeParsed.substring(0, nStart - 4);
|
||||||
|
} else {
|
||||||
|
StringToBeParsed = StringToBeParsed.substring(0, nStart);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.AlertCode = StringToBeParsed.substring(nStart + 15, nEnd);
|
||||||
|
StringToBeParsed = String.valueOf(StringToBeParsed.substring(0, nStart)) + StringToBeParsed.substring(nEnd + 4, StringToBeParsed.length());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
nStart = StringToBeParsed.indexOf("PAY1_ALERTDESCRIPTION");
|
||||||
|
if (nStart != -1) {
|
||||||
|
nEnd = StringToBeParsed.indexOf(this.separator, nStart);
|
||||||
|
if (nEnd == -1) {
|
||||||
|
nEnd = StringToBeParsed.length();
|
||||||
|
this.AlertDescription = StringToBeParsed.substring(nStart + 22, nEnd);
|
||||||
|
if (nStart >= 4) {
|
||||||
|
StringToBeParsed = StringToBeParsed.substring(0, nStart - 4);
|
||||||
|
} else {
|
||||||
|
StringToBeParsed = StringToBeParsed.substring(0, nStart);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.AlertDescription = StringToBeParsed.substring(nStart + 22, nEnd);
|
||||||
|
StringToBeParsed = String.valueOf(StringToBeParsed.substring(0, nStart)) + StringToBeParsed.substring(nEnd + 4, StringToBeParsed.length());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
nStart = StringToBeParsed.indexOf("PAY1_COUNTRY");
|
||||||
|
if (nStart != -1) {
|
||||||
|
nEnd = StringToBeParsed.indexOf(this.separator, nStart);
|
||||||
|
if (nEnd == -1) {
|
||||||
|
nEnd = StringToBeParsed.length();
|
||||||
|
this.country = StringToBeParsed.substring(nStart + 13, nEnd);
|
||||||
|
if (nStart >= 4) {
|
||||||
|
StringToBeParsed = StringToBeParsed.substring(0, nStart - 4);
|
||||||
|
} else {
|
||||||
|
StringToBeParsed = StringToBeParsed.substring(0, nStart);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.country = StringToBeParsed.substring(nStart + 13, nEnd);
|
||||||
|
StringToBeParsed = String.valueOf(StringToBeParsed.substring(0, nStart)) + StringToBeParsed.substring(nEnd + 4, StringToBeParsed.length());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
nStart = StringToBeParsed.indexOf("PAY1_VBVRISP");
|
||||||
|
if (nStart != -1) {
|
||||||
|
nEnd = StringToBeParsed.indexOf(this.separator, nStart);
|
||||||
|
if (nEnd == -1) {
|
||||||
|
nEnd = StringToBeParsed.length();
|
||||||
|
this.vbvrisp = StringToBeParsed.substring(nStart + 13, nEnd);
|
||||||
|
if (nStart >= 4) {
|
||||||
|
StringToBeParsed = StringToBeParsed.substring(0, nStart - 4);
|
||||||
|
} else {
|
||||||
|
StringToBeParsed = StringToBeParsed.substring(0, nStart);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.vbvrisp = StringToBeParsed.substring(nStart + 13, nEnd);
|
||||||
|
StringToBeParsed = String.valueOf(StringToBeParsed.substring(0, nStart)) + StringToBeParsed.substring(nEnd + 4, StringToBeParsed.length());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
nStart = StringToBeParsed.indexOf("PAY1_VBV");
|
||||||
|
if (nStart != -1) {
|
||||||
|
nEnd = StringToBeParsed.indexOf(this.separator, nStart);
|
||||||
|
if (nEnd == -1) {
|
||||||
|
nEnd = StringToBeParsed.length();
|
||||||
|
this.vbv = StringToBeParsed.substring(nStart + 9, nEnd);
|
||||||
|
if (nStart >= 4) {
|
||||||
|
StringToBeParsed = StringToBeParsed.substring(0, nStart - 4);
|
||||||
|
} else {
|
||||||
|
StringToBeParsed = StringToBeParsed.substring(0, nStart);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.vbv = StringToBeParsed.substring(nStart + 9, nEnd);
|
||||||
|
StringToBeParsed = String.valueOf(StringToBeParsed.substring(0, nStart)) + StringToBeParsed.substring(nEnd + 4, StringToBeParsed.length());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
nStart = StringToBeParsed.indexOf("PAY1_IDLANGUAGE");
|
||||||
|
if (nStart != -1) {
|
||||||
|
nEnd = StringToBeParsed.indexOf(this.separator, nStart);
|
||||||
|
if (nEnd == -1) {
|
||||||
|
nEnd = StringToBeParsed.length();
|
||||||
|
this.Language = StringToBeParsed.substring(nStart + 16, nEnd);
|
||||||
|
if (nStart >= 4) {
|
||||||
|
StringToBeParsed = StringToBeParsed.substring(0, nStart - 4);
|
||||||
|
} else {
|
||||||
|
StringToBeParsed = StringToBeParsed.substring(0, nStart);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.Language = StringToBeParsed.substring(nStart + 16, nEnd);
|
||||||
|
StringToBeParsed = String.valueOf(StringToBeParsed.substring(0, nStart)) + StringToBeParsed.substring(nEnd + 4, StringToBeParsed.length());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
nStart = StringToBeParsed.indexOf("PAY1_TRANSACTIONRESULT");
|
||||||
|
if (nStart != -1) {
|
||||||
|
nEnd = StringToBeParsed.indexOf(this.separator, nStart);
|
||||||
|
if (nEnd == -1) {
|
||||||
|
nEnd = StringToBeParsed.length();
|
||||||
|
this.TransactionResult = StringToBeParsed.substring(nStart + 23, nEnd);
|
||||||
|
if (nStart >= 4) {
|
||||||
|
StringToBeParsed = StringToBeParsed.substring(0, nStart - 4);
|
||||||
|
} else {
|
||||||
|
StringToBeParsed = StringToBeParsed.substring(0, nStart);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.TransactionResult = StringToBeParsed.substring(nStart + 23, nEnd);
|
||||||
|
StringToBeParsed = String.valueOf(StringToBeParsed.substring(0, nStart)) + StringToBeParsed.substring(nEnd + 4, StringToBeParsed.length());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.CustomInfo = StringToBeParsed.trim();
|
||||||
|
} catch (Exception e) {
|
||||||
|
this.ErrorCode = "9999";
|
||||||
|
this.ErrorDescription = "Error parsing String";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String URLDecode(String str) throws Exception {
|
||||||
|
if (str == null)
|
||||||
|
return null;
|
||||||
|
char[] res = new char[str.length()];
|
||||||
|
int didx = 0;
|
||||||
|
for (int sidx = 0; sidx < str.length(); sidx++) {
|
||||||
|
char ch = str.charAt(sidx);
|
||||||
|
if (ch == '+') {
|
||||||
|
res[didx++] = ' ';
|
||||||
|
} else if (ch == '%') {
|
||||||
|
try {
|
||||||
|
res[didx++] =
|
||||||
|
(char)Integer.parseInt(str.substring(sidx + 1, sidx + 3), 16);
|
||||||
|
sidx += 2;
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
didx--;
|
||||||
|
res[didx++] = ch;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
res[didx++] = ch;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return String.valueOf(res, 0, didx);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected boolean controlValues(String str) {
|
||||||
|
return !(str != null && str.length() != 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,676 @@
|
||||||
|
package com.ablia.bank.sella;
|
||||||
|
|
||||||
|
import java.io.BufferedReader;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStreamReader;
|
||||||
|
import java.net.MalformedURLException;
|
||||||
|
import java.net.URL;
|
||||||
|
import java.net.URLConnection;
|
||||||
|
import java.net.URLEncoder;
|
||||||
|
import java.net.UnknownServiceException;
|
||||||
|
|
||||||
|
public class GestPayCrypt20 {
|
||||||
|
private String ShopLogin;
|
||||||
|
|
||||||
|
private String Currency;
|
||||||
|
|
||||||
|
private String Amount;
|
||||||
|
|
||||||
|
private String ShopTransactionID;
|
||||||
|
|
||||||
|
private String BuyerName;
|
||||||
|
|
||||||
|
private String BuyerEmail;
|
||||||
|
|
||||||
|
private String Language;
|
||||||
|
|
||||||
|
private String CustomInfo;
|
||||||
|
|
||||||
|
private String AuthorizationCode;
|
||||||
|
|
||||||
|
private String ErrorCode;
|
||||||
|
|
||||||
|
private String ErrorDescription;
|
||||||
|
|
||||||
|
private String BankTransactionID;
|
||||||
|
|
||||||
|
private String AlertCode;
|
||||||
|
|
||||||
|
private String AlertDescription;
|
||||||
|
|
||||||
|
private String EncryptedString;
|
||||||
|
|
||||||
|
private String ToBeEncript;
|
||||||
|
|
||||||
|
private String Decripted;
|
||||||
|
|
||||||
|
private String TransactionResult;
|
||||||
|
|
||||||
|
private String ProtocolAuthServer = "";
|
||||||
|
|
||||||
|
private String DomainName = "";
|
||||||
|
|
||||||
|
private String separator;
|
||||||
|
|
||||||
|
private String errDescription;
|
||||||
|
|
||||||
|
private String errNumber;
|
||||||
|
|
||||||
|
private String Version = "2.0";
|
||||||
|
|
||||||
|
private String Min = "";
|
||||||
|
|
||||||
|
private String CVV = "";
|
||||||
|
|
||||||
|
private String country = "";
|
||||||
|
|
||||||
|
private String vbvrisp = "";
|
||||||
|
|
||||||
|
private String vbv = "";
|
||||||
|
|
||||||
|
public GestPayCrypt20() {
|
||||||
|
this.ShopLogin = "";
|
||||||
|
this.Currency = "";
|
||||||
|
this.Amount = "";
|
||||||
|
this.ShopTransactionID = "";
|
||||||
|
this.BuyerName = "";
|
||||||
|
this.BuyerEmail = "";
|
||||||
|
this.Language = "";
|
||||||
|
this.CustomInfo = "";
|
||||||
|
this.AuthorizationCode = "";
|
||||||
|
this.ErrorCode = "";
|
||||||
|
this.ErrorDescription = "";
|
||||||
|
this.BankTransactionID = "";
|
||||||
|
this.AlertCode = "";
|
||||||
|
this.AlertDescription = "";
|
||||||
|
this.EncryptedString = "";
|
||||||
|
this.ToBeEncript = "";
|
||||||
|
this.Decripted = "";
|
||||||
|
this.ProtocolAuthServer = "http://";
|
||||||
|
this.DomainName = "ecomm.sella.it/CryptHTTP";
|
||||||
|
this.separator = "*P1*";
|
||||||
|
this.errDescription = "";
|
||||||
|
this.errNumber = "0";
|
||||||
|
this.Min = "";
|
||||||
|
this.CVV = "";
|
||||||
|
this.country = "";
|
||||||
|
this.vbvrisp = "";
|
||||||
|
this.vbv = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetShopLogin(String xstr) {
|
||||||
|
this.ShopLogin = xstr;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetCurrency(String xstr) {
|
||||||
|
this.Currency = xstr;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetAmount(String xstr) {
|
||||||
|
this.Amount = xstr;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetShopTransactionID(String xstr) {
|
||||||
|
this.ShopTransactionID = URLEncoder.encode(xstr.trim());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetMIN(String xstr) {
|
||||||
|
this.Min = xstr;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetCVV(String xstr) {
|
||||||
|
this.CVV = xstr;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetBuyerName(String xstr) {
|
||||||
|
this.BuyerName = URLEncoder.encode(xstr.trim());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetBuyerEmail(String xstr) {
|
||||||
|
this.BuyerEmail = xstr.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetLanguage(String xstr) {
|
||||||
|
this.Language = xstr.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetCustomInfo(String xstr) {
|
||||||
|
this.CustomInfo = URLEncoder.encode(xstr.trim());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetEncryptedString(String xstr) {
|
||||||
|
this.EncryptedString = xstr;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String GetShopLogin() {
|
||||||
|
return this.ShopLogin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String GetCurrency() {
|
||||||
|
return this.Currency;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String GetAmount() {
|
||||||
|
return this.Amount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String GetCountry() {
|
||||||
|
return this.country;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String GetVBV() {
|
||||||
|
return this.vbv;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String GetVBVrisp() {
|
||||||
|
return this.vbvrisp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String GetShopTransactionID() {
|
||||||
|
String app = "";
|
||||||
|
try {
|
||||||
|
app = URLDecode(this.ShopTransactionID);
|
||||||
|
} catch (Exception e) {}
|
||||||
|
return app;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String GetBuyerName() {
|
||||||
|
String appBuyername = "";
|
||||||
|
try {
|
||||||
|
appBuyername = URLDecode(this.BuyerName);
|
||||||
|
} catch (Exception ex) {
|
||||||
|
appBuyername = "errore";
|
||||||
|
}
|
||||||
|
return appBuyername;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String GetBuyerEmail() {
|
||||||
|
return this.BuyerEmail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String GetCustomInfo() {
|
||||||
|
String appCustom = "";
|
||||||
|
try {
|
||||||
|
appCustom = URLDecode(this.CustomInfo);
|
||||||
|
} catch (Exception e) {}
|
||||||
|
return appCustom;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String GetAuthorizationCode() {
|
||||||
|
return this.AuthorizationCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String GetErrorCode() {
|
||||||
|
return this.ErrorCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String GetErrorDescription() {
|
||||||
|
return this.ErrorDescription;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String GetBankTransactionID() {
|
||||||
|
return this.BankTransactionID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String GetTransactionResult() {
|
||||||
|
return this.TransactionResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String GetAlertCode() {
|
||||||
|
return this.AlertCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String GetAlertDescription() {
|
||||||
|
return this.AlertDescription;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String GetEncryptedString() {
|
||||||
|
return this.EncryptedString;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean Encrypt() {
|
||||||
|
String sErr = "";
|
||||||
|
this.ErrorCode = "0";
|
||||||
|
this.ErrorDescription = "";
|
||||||
|
try {
|
||||||
|
if (this.ShopLogin.length() <= 0) {
|
||||||
|
this.ErrorCode = "546";
|
||||||
|
this.ErrorDescription = "IDshop not valid";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (this.Currency.length() <= 0) {
|
||||||
|
this.ErrorCode = "552";
|
||||||
|
this.ErrorDescription = "Currency not valid";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (this.Amount.length() <= 0) {
|
||||||
|
this.ErrorCode = "553";
|
||||||
|
this.ErrorDescription = "Amount not valid";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (this.ShopTransactionID.length() <= 0) {
|
||||||
|
this.ErrorCode = "551";
|
||||||
|
this.ErrorDescription = "Shop Transaction ID not valid";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
this.ToBeEncript = "";
|
||||||
|
if (this.CVV.length() > 0)
|
||||||
|
this.ToBeEncript = String.valueOf(this.ToBeEncript) + this.separator + "PAY1_CVV=" + this.CVV;
|
||||||
|
if (this.Min.length() > 0)
|
||||||
|
this.ToBeEncript = String.valueOf(this.ToBeEncript) + this.separator + "PAY1_MIN=" + this.Min;
|
||||||
|
if (this.Currency.length() > 0)
|
||||||
|
this.ToBeEncript = String.valueOf(this.ToBeEncript) + this.separator + "PAY1_UICCODE=" + this.Currency;
|
||||||
|
if (this.Amount.length() > 0)
|
||||||
|
this.ToBeEncript = String.valueOf(this.ToBeEncript) + this.separator + "PAY1_AMOUNT=" + this.Amount;
|
||||||
|
if (this.ShopTransactionID.length() > 0)
|
||||||
|
this.ToBeEncript = String.valueOf(this.ToBeEncript) + this.separator + "PAY1_SHOPTRANSACTIONID=" + this.ShopTransactionID;
|
||||||
|
if (this.BuyerName.length() > 0)
|
||||||
|
this.ToBeEncript = String.valueOf(this.ToBeEncript) + this.separator + "PAY1_CHNAME=" + this.BuyerName;
|
||||||
|
if (this.BuyerEmail.length() > 0)
|
||||||
|
this.ToBeEncript = String.valueOf(this.ToBeEncript) + this.separator + "PAY1_CHEMAIL=" + this.BuyerEmail;
|
||||||
|
if (this.Language.length() > 0)
|
||||||
|
this.ToBeEncript = String.valueOf(this.ToBeEncript) + this.separator + "PAY1_IDLANGUAGE=" + this.Language;
|
||||||
|
if (this.CustomInfo.length() > 0)
|
||||||
|
this.ToBeEncript = String.valueOf(this.ToBeEncript) + this.separator + this.CustomInfo;
|
||||||
|
String urlString = String.valueOf(this.ProtocolAuthServer) + this.DomainName + "/Encrypt.asp?a=" + this.ShopLogin + "&b=" + this.ToBeEncript.substring(4, this.ToBeEncript.length()) + "&c=" + this.Version;
|
||||||
|
URL url = new URL(urlString);
|
||||||
|
URLConnection connection = url.openConnection();
|
||||||
|
BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
|
||||||
|
int nStart = 0;
|
||||||
|
int nEnd = 0;
|
||||||
|
String line = "";
|
||||||
|
while (line != null) {
|
||||||
|
line = in.readLine();
|
||||||
|
if (line != null) {
|
||||||
|
nStart = line.indexOf("#cryptstring#");
|
||||||
|
nEnd = line.lastIndexOf("#/cryptstring#");
|
||||||
|
if (((nStart != -1) ? true : false) & ((nEnd > nStart + 14) ? true : false))
|
||||||
|
this.EncryptedString = line.substring(nStart + 13, nEnd);
|
||||||
|
nStart = line.indexOf("#error#");
|
||||||
|
nEnd = line.lastIndexOf("#/error#");
|
||||||
|
if (((nStart != -1) ? true : false) & ((nEnd > nStart + 8) ? true : false)) {
|
||||||
|
sErr = line.substring(nStart + 7, nEnd);
|
||||||
|
int intsep = sErr.indexOf("-");
|
||||||
|
this.ErrorCode = sErr.substring(0, intsep);
|
||||||
|
this.ErrorDescription = sErr.substring(intsep + 1, sErr.length());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
in.close();
|
||||||
|
return true;
|
||||||
|
} catch (MalformedURLException ex) {
|
||||||
|
this.ErrorCode = "9999";
|
||||||
|
this.ErrorDescription = "Bad URL";
|
||||||
|
return false;
|
||||||
|
} catch (UnknownServiceException ex) {
|
||||||
|
this.ErrorCode = "9999";
|
||||||
|
this.ErrorDescription = "ServiceException occurred.";
|
||||||
|
return false;
|
||||||
|
} catch (IOException ex) {
|
||||||
|
this.ErrorCode = "9999";
|
||||||
|
this.ErrorDescription = "Bad URL Request";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean Decrypt() {
|
||||||
|
this.ErrorCode = "0";
|
||||||
|
this.ErrorDescription = "";
|
||||||
|
String strdaelim = "";
|
||||||
|
if (this.ShopLogin.length() <= 0) {
|
||||||
|
this.ErrorCode = "546";
|
||||||
|
this.ErrorDescription = "IDshop not valid";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (this.EncryptedString.length() <= 0) {
|
||||||
|
this.ErrorCode = "1009";
|
||||||
|
this.ErrorDescription = "String to Decrypt not valid";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
String urlString = String.valueOf(this.ProtocolAuthServer) + this.DomainName + "/Decrypt.asp?a=" + this.ShopLogin + "&b=" + this.EncryptedString + "&c=" + this.Version;
|
||||||
|
URL url = new URL(urlString);
|
||||||
|
URLConnection connection = url.openConnection();
|
||||||
|
BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
|
||||||
|
int nStart = 0;
|
||||||
|
int nEnd = 0;
|
||||||
|
String line = "";
|
||||||
|
while (line != null) {
|
||||||
|
line = in.readLine();
|
||||||
|
if (line != null) {
|
||||||
|
nStart = line.indexOf("#decryptstring#");
|
||||||
|
nEnd = line.lastIndexOf("#/decryptstring#");
|
||||||
|
if (((nStart != -1) ? true : false) & ((nEnd > nStart + 16) ? true : false))
|
||||||
|
this.Decripted = line.substring(nStart + 15, nEnd);
|
||||||
|
nStart = line.indexOf("#error#");
|
||||||
|
nEnd = line.lastIndexOf("#/error#");
|
||||||
|
if (((nStart != -1) ? true : false) & ((nEnd > nStart + 8) ? true : false)) {
|
||||||
|
String sErr = line.substring(nStart + 7, nEnd);
|
||||||
|
int intsep = sErr.indexOf("-");
|
||||||
|
this.ErrorCode = sErr.substring(0, intsep);
|
||||||
|
this.ErrorDescription = sErr.substring(intsep + 1, sErr.length());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
in.close();
|
||||||
|
if (this.Decripted.trim() == "") {
|
||||||
|
this.ErrorCode = "9999";
|
||||||
|
this.ErrorDescription = "Void String";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!Parsing(this.Decripted))
|
||||||
|
return false;
|
||||||
|
return true;
|
||||||
|
} catch (MalformedURLException ex) {
|
||||||
|
this.ErrorCode = "9999";
|
||||||
|
this.ErrorDescription = "Bad URL";
|
||||||
|
return false;
|
||||||
|
} catch (UnknownServiceException ex) {
|
||||||
|
this.ErrorCode = "9999";
|
||||||
|
this.ErrorDescription = "Service Exception occurred.";
|
||||||
|
return false;
|
||||||
|
} catch (IOException ex) {
|
||||||
|
this.ErrorCode = "9999";
|
||||||
|
this.ErrorDescription = "Bad URL Request";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean Parsing(String StringToBeParsed) {
|
||||||
|
int nStart = 0;
|
||||||
|
int nEnd = 0;
|
||||||
|
this.ErrorCode = "";
|
||||||
|
this.ErrorDescription = "";
|
||||||
|
try {
|
||||||
|
nStart = StringToBeParsed.indexOf("PAY1_UICCODE");
|
||||||
|
if (nStart != -1) {
|
||||||
|
nEnd = StringToBeParsed.indexOf(this.separator, nStart);
|
||||||
|
if (nEnd == -1) {
|
||||||
|
nEnd = StringToBeParsed.length();
|
||||||
|
this.Currency = StringToBeParsed.substring(nStart + 13, nEnd);
|
||||||
|
if (nStart >= 4) {
|
||||||
|
StringToBeParsed = StringToBeParsed.substring(0, nStart - 4);
|
||||||
|
} else {
|
||||||
|
StringToBeParsed = StringToBeParsed.substring(0, nStart);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.Currency = StringToBeParsed.substring(nStart + 13, nEnd);
|
||||||
|
StringToBeParsed = String.valueOf(StringToBeParsed.substring(0, nStart)) + StringToBeParsed.substring(nEnd + 4, StringToBeParsed.length());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
nStart = StringToBeParsed.indexOf("PAY1_AMOUNT");
|
||||||
|
if (nStart != -1) {
|
||||||
|
nEnd = StringToBeParsed.indexOf(this.separator, nStart);
|
||||||
|
if (nEnd == -1) {
|
||||||
|
nEnd = StringToBeParsed.length();
|
||||||
|
this.Amount = StringToBeParsed.substring(nStart + 12, nEnd);
|
||||||
|
if (nStart >= 4) {
|
||||||
|
StringToBeParsed = StringToBeParsed.substring(0, nStart - 4);
|
||||||
|
} else {
|
||||||
|
StringToBeParsed = StringToBeParsed.substring(0, nStart);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.Amount = StringToBeParsed.substring(nStart + 12, nEnd);
|
||||||
|
StringToBeParsed = String.valueOf(StringToBeParsed.substring(0, nStart)) + StringToBeParsed.substring(nEnd + 4, StringToBeParsed.length());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
nStart = StringToBeParsed.indexOf("PAY1_SHOPTRANSACTIONID");
|
||||||
|
if (nStart != -1) {
|
||||||
|
nEnd = StringToBeParsed.indexOf(this.separator, nStart);
|
||||||
|
if (nEnd == -1) {
|
||||||
|
nEnd = StringToBeParsed.length();
|
||||||
|
this.ShopTransactionID = StringToBeParsed.substring(nStart + 23, nEnd);
|
||||||
|
if (nStart >= 4) {
|
||||||
|
StringToBeParsed = StringToBeParsed.substring(0, nStart - 4);
|
||||||
|
} else {
|
||||||
|
StringToBeParsed = StringToBeParsed.substring(0, nStart);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.ShopTransactionID = StringToBeParsed.substring(nStart + 23, nEnd);
|
||||||
|
StringToBeParsed = String.valueOf(StringToBeParsed.substring(0, nStart)) + StringToBeParsed.substring(nEnd + 4, StringToBeParsed.length());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
nStart = StringToBeParsed.indexOf("PAY1_CHNAME");
|
||||||
|
if (nStart != -1) {
|
||||||
|
nEnd = StringToBeParsed.indexOf(this.separator, nStart);
|
||||||
|
if (nEnd == -1) {
|
||||||
|
nEnd = StringToBeParsed.length();
|
||||||
|
this.BuyerName = StringToBeParsed.substring(nStart + 12, nEnd);
|
||||||
|
if (nStart >= 4) {
|
||||||
|
StringToBeParsed = StringToBeParsed.substring(0, nStart - 4);
|
||||||
|
} else {
|
||||||
|
StringToBeParsed = StringToBeParsed.substring(0, nStart);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.BuyerName = StringToBeParsed.substring(nStart + 12, nEnd);
|
||||||
|
StringToBeParsed = String.valueOf(StringToBeParsed.substring(0, nStart)) + StringToBeParsed.substring(nEnd + 4, StringToBeParsed.length());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
nStart = StringToBeParsed.indexOf("PAY1_CHEMAIL");
|
||||||
|
if (nStart != -1) {
|
||||||
|
nEnd = StringToBeParsed.indexOf(this.separator, nStart);
|
||||||
|
if (nEnd == -1) {
|
||||||
|
nEnd = StringToBeParsed.length();
|
||||||
|
this.BuyerEmail = StringToBeParsed.substring(nStart + 13, nEnd);
|
||||||
|
if (nStart >= 4) {
|
||||||
|
StringToBeParsed = StringToBeParsed.substring(0, nStart - 4);
|
||||||
|
} else {
|
||||||
|
StringToBeParsed = StringToBeParsed.substring(0, nStart);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.BuyerEmail = StringToBeParsed.substring(nStart + 13, nEnd);
|
||||||
|
StringToBeParsed = String.valueOf(StringToBeParsed.substring(0, nStart)) + StringToBeParsed.substring(nEnd + 4, StringToBeParsed.length());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
nStart = StringToBeParsed.indexOf("PAY1_AUTHORIZATIONCODE");
|
||||||
|
if (nStart != -1) {
|
||||||
|
nEnd = StringToBeParsed.indexOf(this.separator, nStart);
|
||||||
|
if (nEnd == -1) {
|
||||||
|
nEnd = StringToBeParsed.length();
|
||||||
|
this.AuthorizationCode = StringToBeParsed.substring(nStart + 23, nEnd);
|
||||||
|
if (nStart >= 4) {
|
||||||
|
StringToBeParsed = StringToBeParsed.substring(0, nStart - 4);
|
||||||
|
} else {
|
||||||
|
StringToBeParsed = StringToBeParsed.substring(0, nStart);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.AuthorizationCode = StringToBeParsed.substring(nStart + 23, nEnd);
|
||||||
|
StringToBeParsed = String.valueOf(StringToBeParsed.substring(0, nStart)) + StringToBeParsed.substring(nEnd + 4, StringToBeParsed.length());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
nStart = StringToBeParsed.indexOf("PAY1_ERRORCODE");
|
||||||
|
if (nStart != -1) {
|
||||||
|
nEnd = StringToBeParsed.indexOf(this.separator, nStart);
|
||||||
|
if (nEnd == -1) {
|
||||||
|
nEnd = StringToBeParsed.length();
|
||||||
|
this.ErrorCode = StringToBeParsed.substring(nStart + 15, nEnd);
|
||||||
|
if (nStart >= 4) {
|
||||||
|
StringToBeParsed = StringToBeParsed.substring(0, nStart - 4);
|
||||||
|
} else {
|
||||||
|
StringToBeParsed = StringToBeParsed.substring(0, nStart);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.ErrorCode = StringToBeParsed.substring(nStart + 15, nEnd);
|
||||||
|
StringToBeParsed = String.valueOf(StringToBeParsed.substring(0, nStart)) + StringToBeParsed.substring(nEnd + 4, StringToBeParsed.length());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
nStart = StringToBeParsed.indexOf("PAY1_ERRORDESCRIPTION");
|
||||||
|
if (nStart != -1) {
|
||||||
|
nEnd = StringToBeParsed.indexOf(this.separator, nStart);
|
||||||
|
if (nEnd == -1) {
|
||||||
|
nEnd = StringToBeParsed.length();
|
||||||
|
this.ErrorDescription = StringToBeParsed.substring(nStart + 22, nEnd);
|
||||||
|
if (nStart >= 4) {
|
||||||
|
StringToBeParsed = StringToBeParsed.substring(0, nStart - 4);
|
||||||
|
} else {
|
||||||
|
StringToBeParsed = StringToBeParsed.substring(0, nStart);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.ErrorDescription = StringToBeParsed.substring(nStart + 22, nEnd);
|
||||||
|
StringToBeParsed = String.valueOf(StringToBeParsed.substring(0, nStart)) + StringToBeParsed.substring(nEnd + 4, StringToBeParsed.length());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
nStart = StringToBeParsed.indexOf("PAY1_BANKTRANSACTIONID");
|
||||||
|
if (nStart != -1) {
|
||||||
|
nEnd = StringToBeParsed.indexOf(this.separator, nStart);
|
||||||
|
if (nEnd == -1) {
|
||||||
|
nEnd = StringToBeParsed.length();
|
||||||
|
this.BankTransactionID = StringToBeParsed.substring(nStart + 23, nEnd);
|
||||||
|
if (nStart >= 4) {
|
||||||
|
StringToBeParsed = StringToBeParsed.substring(0, nStart - 4);
|
||||||
|
} else {
|
||||||
|
StringToBeParsed = StringToBeParsed.substring(0, nStart);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.BankTransactionID = StringToBeParsed.substring(nStart + 23, nEnd);
|
||||||
|
StringToBeParsed = String.valueOf(StringToBeParsed.substring(0, nStart)) + StringToBeParsed.substring(nEnd + 4, StringToBeParsed.length());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
nStart = StringToBeParsed.indexOf("PAY1_ALERTCODE");
|
||||||
|
if (nStart != -1) {
|
||||||
|
nEnd = StringToBeParsed.indexOf(this.separator, nStart);
|
||||||
|
if (nEnd == -1) {
|
||||||
|
nEnd = StringToBeParsed.length();
|
||||||
|
this.AlertCode = StringToBeParsed.substring(nStart + 15, nEnd);
|
||||||
|
if (nStart >= 4) {
|
||||||
|
StringToBeParsed = StringToBeParsed.substring(0, nStart - 4);
|
||||||
|
} else {
|
||||||
|
StringToBeParsed = StringToBeParsed.substring(0, nStart);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.AlertCode = StringToBeParsed.substring(nStart + 15, nEnd);
|
||||||
|
StringToBeParsed = String.valueOf(StringToBeParsed.substring(0, nStart)) + StringToBeParsed.substring(nEnd + 4, StringToBeParsed.length());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
nStart = StringToBeParsed.indexOf("PAY1_ALERTDESCRIPTION");
|
||||||
|
if (nStart != -1) {
|
||||||
|
nEnd = StringToBeParsed.indexOf(this.separator, nStart);
|
||||||
|
if (nEnd == -1) {
|
||||||
|
nEnd = StringToBeParsed.length();
|
||||||
|
this.AlertDescription = StringToBeParsed.substring(nStart + 22, nEnd);
|
||||||
|
if (nStart >= 4) {
|
||||||
|
StringToBeParsed = StringToBeParsed.substring(0, nStart - 4);
|
||||||
|
} else {
|
||||||
|
StringToBeParsed = StringToBeParsed.substring(0, nStart);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.AlertDescription = StringToBeParsed.substring(nStart + 22, nEnd);
|
||||||
|
StringToBeParsed = String.valueOf(StringToBeParsed.substring(0, nStart)) + StringToBeParsed.substring(nEnd + 4, StringToBeParsed.length());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
nStart = StringToBeParsed.indexOf("PAY1_COUNTRY");
|
||||||
|
if (nStart != -1) {
|
||||||
|
nEnd = StringToBeParsed.indexOf(this.separator, nStart);
|
||||||
|
if (nEnd == -1) {
|
||||||
|
nEnd = StringToBeParsed.length();
|
||||||
|
this.country = StringToBeParsed.substring(nStart + 13, nEnd);
|
||||||
|
if (nStart >= 4) {
|
||||||
|
StringToBeParsed = StringToBeParsed.substring(0, nStart - 4);
|
||||||
|
} else {
|
||||||
|
StringToBeParsed = StringToBeParsed.substring(0, nStart);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.country = StringToBeParsed.substring(nStart + 13, nEnd);
|
||||||
|
StringToBeParsed = String.valueOf(StringToBeParsed.substring(0, nStart)) + StringToBeParsed.substring(nEnd + 4, StringToBeParsed.length());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
nStart = StringToBeParsed.indexOf("PAY1_VBVRISP");
|
||||||
|
if (nStart != -1) {
|
||||||
|
nEnd = StringToBeParsed.indexOf(this.separator, nStart);
|
||||||
|
if (nEnd == -1) {
|
||||||
|
nEnd = StringToBeParsed.length();
|
||||||
|
this.vbvrisp = StringToBeParsed.substring(nStart + 13, nEnd);
|
||||||
|
if (nStart >= 4) {
|
||||||
|
StringToBeParsed = StringToBeParsed.substring(0, nStart - 4);
|
||||||
|
} else {
|
||||||
|
StringToBeParsed = StringToBeParsed.substring(0, nStart);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.vbvrisp = StringToBeParsed.substring(nStart + 13, nEnd);
|
||||||
|
StringToBeParsed = String.valueOf(StringToBeParsed.substring(0, nStart)) + StringToBeParsed.substring(nEnd + 4, StringToBeParsed.length());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
nStart = StringToBeParsed.indexOf("PAY1_VBV");
|
||||||
|
if (nStart != -1) {
|
||||||
|
nEnd = StringToBeParsed.indexOf(this.separator, nStart);
|
||||||
|
if (nEnd == -1) {
|
||||||
|
nEnd = StringToBeParsed.length();
|
||||||
|
this.vbv = StringToBeParsed.substring(nStart + 9, nEnd);
|
||||||
|
if (nStart >= 4) {
|
||||||
|
StringToBeParsed = StringToBeParsed.substring(0, nStart - 4);
|
||||||
|
} else {
|
||||||
|
StringToBeParsed = StringToBeParsed.substring(0, nStart);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.vbv = StringToBeParsed.substring(nStart + 9, nEnd);
|
||||||
|
StringToBeParsed = String.valueOf(StringToBeParsed.substring(0, nStart)) + StringToBeParsed.substring(nEnd + 4, StringToBeParsed.length());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
nStart = StringToBeParsed.indexOf("PAY1_IDLANGUAGE");
|
||||||
|
if (nStart != -1) {
|
||||||
|
nEnd = StringToBeParsed.indexOf(this.separator, nStart);
|
||||||
|
if (nEnd == -1) {
|
||||||
|
nEnd = StringToBeParsed.length();
|
||||||
|
this.Language = StringToBeParsed.substring(nStart + 16, nEnd);
|
||||||
|
if (nStart >= 4) {
|
||||||
|
StringToBeParsed = StringToBeParsed.substring(0, nStart - 4);
|
||||||
|
} else {
|
||||||
|
StringToBeParsed = StringToBeParsed.substring(0, nStart);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.Language = StringToBeParsed.substring(nStart + 16, nEnd);
|
||||||
|
StringToBeParsed = String.valueOf(StringToBeParsed.substring(0, nStart)) + StringToBeParsed.substring(nEnd + 4, StringToBeParsed.length());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
nStart = StringToBeParsed.indexOf("PAY1_TRANSACTIONRESULT");
|
||||||
|
if (nStart != -1) {
|
||||||
|
nEnd = StringToBeParsed.indexOf(this.separator, nStart);
|
||||||
|
if (nEnd == -1) {
|
||||||
|
nEnd = StringToBeParsed.length();
|
||||||
|
this.TransactionResult = StringToBeParsed.substring(nStart + 23, nEnd);
|
||||||
|
if (nStart >= 4) {
|
||||||
|
StringToBeParsed = StringToBeParsed.substring(0, nStart - 4);
|
||||||
|
} else {
|
||||||
|
StringToBeParsed = StringToBeParsed.substring(0, nStart);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.TransactionResult = StringToBeParsed.substring(nStart + 23, nEnd);
|
||||||
|
StringToBeParsed = String.valueOf(StringToBeParsed.substring(0, nStart)) + StringToBeParsed.substring(nEnd + 4, StringToBeParsed.length());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.CustomInfo = StringToBeParsed.trim();
|
||||||
|
} catch (Exception e) {
|
||||||
|
this.ErrorCode = "9999";
|
||||||
|
this.ErrorDescription = "Error parsing String";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String URLDecode(String str) throws Exception {
|
||||||
|
if (str == null)
|
||||||
|
return null;
|
||||||
|
char[] res = new char[str.length()];
|
||||||
|
int didx = 0;
|
||||||
|
for (int sidx = 0; sidx < str.length(); sidx++) {
|
||||||
|
char ch = str.charAt(sidx);
|
||||||
|
if (ch == '+') {
|
||||||
|
res[didx++] = ' ';
|
||||||
|
} else if (ch == '%') {
|
||||||
|
try {
|
||||||
|
res[didx++] =
|
||||||
|
(char)Integer.parseInt(str.substring(sidx + 1, sidx + 3), 16);
|
||||||
|
sidx += 2;
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
didx--;
|
||||||
|
res[didx++] = ch;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
res[didx++] = ch;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return String.valueOf(res, 0, didx);
|
||||||
|
}
|
||||||
|
}
|
||||||
189
rus/WEB-INF/lib/abliaBank_src/com/ablia/bank/sella/SellaReq.java
Normal file
189
rus/WEB-INF/lib/abliaBank_src/com/ablia/bank/sella/SellaReq.java
Normal file
|
|
@ -0,0 +1,189 @@
|
||||||
|
package com.ablia.bank.sella;
|
||||||
|
|
||||||
|
import com.ablia.bank._BankAdapter;
|
||||||
|
import com.ablia.common.Parm;
|
||||||
|
import com.ablia.db.ApplParmFull;
|
||||||
|
|
||||||
|
public class SellaReq extends _BankAdapter {
|
||||||
|
public static final String LANG_CODE_IT = "1";
|
||||||
|
|
||||||
|
public static final String LANG_CODE_EN = "2";
|
||||||
|
|
||||||
|
public static final String LANG_CODE_ES = "3";
|
||||||
|
|
||||||
|
public static final String LANG_CODE_FR = "4";
|
||||||
|
|
||||||
|
public static final String LANG_CODE_DE = "5";
|
||||||
|
|
||||||
|
public static final String DIV_CODE_LIRA = "18";
|
||||||
|
|
||||||
|
public static final String DIV_CODE_EURO = "242";
|
||||||
|
|
||||||
|
public static final String P_COD_ESER_SELLA = "COD_ESER_SELLA";
|
||||||
|
|
||||||
|
public static final String P_SELLA_FULL = "SELLA_FULL";
|
||||||
|
|
||||||
|
public static final String DIV_CODE_STERLINE = "2";
|
||||||
|
|
||||||
|
public static final String DIV_CODE_YEN = "71";
|
||||||
|
|
||||||
|
public static final String DIV_CODE_DOLLARL_HK = "103";
|
||||||
|
|
||||||
|
public static final String DIV_CODE_REAL = "234";
|
||||||
|
|
||||||
|
private String myshoplogin;
|
||||||
|
|
||||||
|
private String mycurrency;
|
||||||
|
|
||||||
|
private String myamount;
|
||||||
|
|
||||||
|
private String myshoptransactionID;
|
||||||
|
|
||||||
|
private String mybuyername;
|
||||||
|
|
||||||
|
private String mybuyeremail;
|
||||||
|
|
||||||
|
private String mylanguage;
|
||||||
|
|
||||||
|
private String lang;
|
||||||
|
|
||||||
|
private String mycustominfo;
|
||||||
|
|
||||||
|
public static final String P_PAYMENT_OK_PAGE = "SELLA_OK";
|
||||||
|
|
||||||
|
public static final String P_PAYMENT_ERROR_PAGE = "SELLA_KO";
|
||||||
|
|
||||||
|
public static final String DIV_CODE_DOLLARI = "1";
|
||||||
|
|
||||||
|
public String getMyamount() {
|
||||||
|
return (this.myamount == null) ? "" : this.myamount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMyamount(String myamount) {
|
||||||
|
this.myamount = myamount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMybuyeremail() {
|
||||||
|
return (this.mybuyeremail == null) ? "" : this.mybuyeremail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMybuyeremail(String mybuyeremail) {
|
||||||
|
this.mybuyeremail = mybuyeremail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMybuyername() {
|
||||||
|
return (this.mybuyername == null) ? "" : this.mybuyername;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMybuyername(String mybuyername) {
|
||||||
|
this.mybuyername = mybuyername;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMycurrency() {
|
||||||
|
return (this.mycurrency == null) ? "" : this.mycurrency;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMycurrency(String mycurrency) {
|
||||||
|
this.mycurrency = mycurrency;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMycustominfo() {
|
||||||
|
return (this.mycustominfo == null) ? "" : this.mycustominfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMycustominfo(String mycustominfo) {
|
||||||
|
this.mycustominfo = mycustominfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMylanguage() {
|
||||||
|
if (this.mylanguage == null || this.mylanguage.isEmpty())
|
||||||
|
this.mylanguage = getMylanguageCode();
|
||||||
|
return this.mylanguage;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String getMylanguageCode() {
|
||||||
|
if (getLang().toLowerCase().equals("it"))
|
||||||
|
return "1";
|
||||||
|
if (getLang().toLowerCase().equals("en"))
|
||||||
|
return "2";
|
||||||
|
if (getLang().toLowerCase().equals("es"))
|
||||||
|
return "3";
|
||||||
|
if (getLang().toLowerCase().equals("fr"))
|
||||||
|
return "4";
|
||||||
|
if (getLang().toLowerCase().equals("de"))
|
||||||
|
return "5";
|
||||||
|
return "2";
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMyshoplogin() {
|
||||||
|
return (this.myshoplogin == null) ? "" : this.myshoplogin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMyshoplogin(String myshoplogin) {
|
||||||
|
this.myshoplogin = myshoplogin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMyshoptransactionID() {
|
||||||
|
return (this.myshoptransactionID == null) ? "" : this.myshoptransactionID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMyshoptransactionID(String myshoptransactionID) {
|
||||||
|
this.myshoptransactionID = myshoptransactionID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMylanguage(String mylanguage) {
|
||||||
|
this.mylanguage = mylanguage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLang() {
|
||||||
|
return (this.lang == null) ? "" : this.lang;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLang(String lang) {
|
||||||
|
this.lang = lang;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void initApplicationParms(ApplParmFull ap) {
|
||||||
|
if (ap != null) {
|
||||||
|
String l_tipoParm = "PAYPAL";
|
||||||
|
Parm bean = new Parm(ap);
|
||||||
|
l_tipoParm = "SELLA";
|
||||||
|
bean.findByCodice("COD_ESER_SELLA");
|
||||||
|
bean.setFlgAdmin(0L);
|
||||||
|
bean.setTipoParm(l_tipoParm);
|
||||||
|
bean.setCodice("COD_ESER_SELLA");
|
||||||
|
bean.setDescrizione("COD_ESER_SELLA");
|
||||||
|
bean.setFlgTipo(0L);
|
||||||
|
bean.setNota("CODICE ESERCENTE BANCA SELLA");
|
||||||
|
bean.save();
|
||||||
|
bean.findByCodice("SELLA_FULL");
|
||||||
|
bean.setFlgAdmin(0L);
|
||||||
|
bean.setTipoParm(l_tipoParm);
|
||||||
|
bean.setCodice("SELLA_FULL");
|
||||||
|
bean.setDescrizione("SELLA_FULL");
|
||||||
|
bean.setFlgTipo(5L);
|
||||||
|
bean.setNota("SPECIFICA SE IL CONTRATTO CON SELLA E' DI TIPO FULL");
|
||||||
|
bean.save();
|
||||||
|
bean.findByCodice("SELLA_KO");
|
||||||
|
bean.setFlgAdmin(0L);
|
||||||
|
bean.setTipoParm(l_tipoParm);
|
||||||
|
bean.setCodice("SELLA_KO");
|
||||||
|
bean.setDescrizione("SELLA_KO");
|
||||||
|
bean.setFlgTipo(0L);
|
||||||
|
if (bean.getTesto().equals(""))
|
||||||
|
bean.setTesto("payRes.jsp");
|
||||||
|
bean.setNota("SELLA_KO");
|
||||||
|
bean.save();
|
||||||
|
bean.findByCodice("SELLA_OK");
|
||||||
|
bean.setFlgAdmin(0L);
|
||||||
|
bean.setTipoParm(l_tipoParm);
|
||||||
|
bean.setCodice("SELLA_OK");
|
||||||
|
bean.setDescrizione("SELLA_OK");
|
||||||
|
bean.setFlgTipo(0L);
|
||||||
|
if (bean.getTesto().equals(""))
|
||||||
|
bean.setTesto("payRes.jsp");
|
||||||
|
bean.setNota("SELLA_OK");
|
||||||
|
bean.save();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,185 @@
|
||||||
|
package com.ablia.bank.sella;
|
||||||
|
|
||||||
|
import com.ablia.bank._BankAdapter;
|
||||||
|
|
||||||
|
public class SellaResp extends _BankAdapter {
|
||||||
|
private String myshoplogin;
|
||||||
|
|
||||||
|
private int mycurrency;
|
||||||
|
|
||||||
|
private float myamount;
|
||||||
|
|
||||||
|
private String myshoptrxID;
|
||||||
|
|
||||||
|
private String mybuyername;
|
||||||
|
|
||||||
|
private String mybuyeremail;
|
||||||
|
|
||||||
|
private String mytrxresult;
|
||||||
|
|
||||||
|
private String myauthcode;
|
||||||
|
|
||||||
|
private String myerrorcode;
|
||||||
|
|
||||||
|
private String myerrordescription;
|
||||||
|
|
||||||
|
private String myerrorbanktrxid;
|
||||||
|
|
||||||
|
private long id_ordine;
|
||||||
|
|
||||||
|
private String myalertcode;
|
||||||
|
|
||||||
|
private String myalertdescription;
|
||||||
|
|
||||||
|
private String mycustominfo;
|
||||||
|
|
||||||
|
public SellaResp() {}
|
||||||
|
|
||||||
|
public SellaResp(GestPayCrypt bean) {
|
||||||
|
fillResponse(bean);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMyalertcode() {
|
||||||
|
return (this.myalertcode == null) ? "" : this.myalertcode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void fillResponse(GestPayCrypt bean) {
|
||||||
|
setMyshoplogin(bean.getShopLogin().trim());
|
||||||
|
if (!bean.getCurrency().isEmpty())
|
||||||
|
setMycurrency(Integer.parseInt(bean.getCurrency()));
|
||||||
|
if (!bean.getAmount().isEmpty())
|
||||||
|
setMyamount(Float.parseFloat(bean.getAmount()));
|
||||||
|
setMyshoptrxID(bean.getShopTransactionID().trim());
|
||||||
|
setMybuyername(bean.getBuyerName().trim());
|
||||||
|
setMybuyeremail(bean.getBuyerEmail().trim());
|
||||||
|
setMytrxresult(bean.getTransactionResult().trim());
|
||||||
|
setMyauthcode(bean.getAuthorizationCode());
|
||||||
|
setMyerrorcode(bean.getErrorCode());
|
||||||
|
setMyerrordescription(bean.getErrorDescription().trim());
|
||||||
|
setMyerrorbanktrxid(bean.getBankTransactionID().trim());
|
||||||
|
setMyalertcode(bean.getAlertCode().trim());
|
||||||
|
setMyalertdescription(bean.getAlertDescription().trim());
|
||||||
|
setMycustominfo(bean.getCustomInfo().trim());
|
||||||
|
if (!bean.getShopTransactionID().isEmpty())
|
||||||
|
setId_ordine(Long.parseLong(bean.getShopTransactionID()));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMyalertcode(String myalertcode) {
|
||||||
|
this.myalertcode = myalertcode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMyalertdescription() {
|
||||||
|
return (this.myalertdescription == null) ? "" :
|
||||||
|
this.myalertdescription;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMyalertdescription(String myalertdescription) {
|
||||||
|
this.myalertdescription = myalertdescription;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getMyamount() {
|
||||||
|
return this.myamount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMyamount(float myamount) {
|
||||||
|
this.myamount = myamount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMyauthcode() {
|
||||||
|
return (this.myauthcode == null) ? "" : this.myauthcode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMyauthcode(String myauthcode) {
|
||||||
|
this.myauthcode = myauthcode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMybuyeremail() {
|
||||||
|
return (this.mybuyeremail == null) ? "" : this.mybuyeremail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMybuyeremail(String mybuyeremail) {
|
||||||
|
this.mybuyeremail = mybuyeremail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMybuyername() {
|
||||||
|
return (this.mybuyername == null) ? "" : this.mybuyername;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMybuyername(String mybuyername) {
|
||||||
|
this.mybuyername = mybuyername;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getMycurrency() {
|
||||||
|
return this.mycurrency;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMycurrency(int mycurrency) {
|
||||||
|
this.mycurrency = mycurrency;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMycustominfo() {
|
||||||
|
return (this.mycustominfo == null) ? "" : this.mycustominfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMycustominfo(String mycustominfo) {
|
||||||
|
this.mycustominfo = mycustominfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMyerrorbanktrxid() {
|
||||||
|
return (this.myerrorbanktrxid == null) ? "" :
|
||||||
|
this.myerrorbanktrxid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMyerrorbanktrxid(String myerrorbanktrxid) {
|
||||||
|
this.myerrorbanktrxid = myerrorbanktrxid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMyerrorcode() {
|
||||||
|
return (this.myerrorcode == null) ? "" : this.myerrorcode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMyerrorcode(String myerrorcode) {
|
||||||
|
this.myerrorcode = myerrorcode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMyerrordescription() {
|
||||||
|
return (this.myerrordescription == null) ? "" :
|
||||||
|
this.myerrordescription;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMyerrordescription(String myerrordescription) {
|
||||||
|
this.myerrordescription = myerrordescription;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMyshoplogin() {
|
||||||
|
return (this.myshoplogin == null) ? "" : this.myshoplogin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMyshoplogin(String myshoplogin) {
|
||||||
|
this.myshoplogin = myshoplogin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMyshoptrxID() {
|
||||||
|
return (this.myshoptrxID == null) ? "" : this.myshoptrxID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMyshoptrxID(String myshoptrxID) {
|
||||||
|
this.myshoptrxID = myshoptrxID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMytrxresult() {
|
||||||
|
return (this.mytrxresult == null) ? "" : this.mytrxresult;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMytrxresult(String mytrxresult) {
|
||||||
|
this.mytrxresult = mytrxresult;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getId_ordine() {
|
||||||
|
return this.id_ordine;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId_ordine(long id_ordine) {
|
||||||
|
this.id_ordine = id_ordine;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,121 @@
|
||||||
|
package com.ablia.bank.servlet.consel;
|
||||||
|
|
||||||
|
import com.ablia.bank.consel.ConselReq;
|
||||||
|
import java.io.BufferedReader;
|
||||||
|
import java.io.InputStreamReader;
|
||||||
|
import java.io.OutputStreamWriter;
|
||||||
|
import java.net.URL;
|
||||||
|
import java.net.URLConnection;
|
||||||
|
import java.net.URLEncoder;
|
||||||
|
import javax.servlet.RequestDispatcher;
|
||||||
|
import javax.servlet.ServletOutputStream;
|
||||||
|
import javax.servlet.ServletRequest;
|
||||||
|
import javax.servlet.ServletResponse;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
public abstract class ConselReqSvlt extends ConselSvlt {
|
||||||
|
protected void sendRequest(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
try {
|
||||||
|
String conselSite = "https://reserved.e-consel.it/DOL/faces/frmECProntoTuo.jsp";
|
||||||
|
ConselReq conselReq = new ConselReq(getApFull());
|
||||||
|
fillObject(req, conselReq);
|
||||||
|
caricaConselRequest(req, conselReq);
|
||||||
|
if (getParm("CONSEL_TEST").getNumeroLong() == 1L)
|
||||||
|
caricaDemoRequest(req, conselReq);
|
||||||
|
req.setAttribute("conselReq", conselReq);
|
||||||
|
RequestDispatcher rd = getServletContext()
|
||||||
|
.getRequestDispatcher("/conselReq.jsp");
|
||||||
|
rd.forward((ServletRequest)req, (ServletResponse)res);
|
||||||
|
} catch (Exception e) {
|
||||||
|
handleDebug(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void processRequest(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
try {
|
||||||
|
sendRequest(req, res);
|
||||||
|
} catch (Exception e) {
|
||||||
|
handleDebug(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected abstract void caricaConselRequest(HttpServletRequest paramHttpServletRequest, ConselReq paramConselReq);
|
||||||
|
|
||||||
|
private void caricaDemoRequest(HttpServletRequest req, ConselReq conselReq) {
|
||||||
|
conselReq.setCodfisc("CLMCST80A01D969I");
|
||||||
|
conselReq.setCognome("COLOMBO");
|
||||||
|
conselReq.setNome("CRISTOFORO");
|
||||||
|
conselReq.setData_nascita("01/01/1980");
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void sendRequestOld(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
try {
|
||||||
|
String conselSite = "https://reserved.e-consel.it/DOL/faces/frmECProntoTuo.jsp";
|
||||||
|
ConselReq conselReq = new ConselReq(getApFull());
|
||||||
|
fillObject(req, conselReq);
|
||||||
|
caricaConselRequest(req, conselReq);
|
||||||
|
if (getParm("TEST").getNumeroLong() == 1L)
|
||||||
|
caricaDemoRequest(req, conselReq);
|
||||||
|
StringBuffer data = new StringBuffer(String.valueOf(URLEncoder.encode("tiposec",
|
||||||
|
"UTF-8")) +
|
||||||
|
"=" +
|
||||||
|
URLEncoder.encode(conselReq.getTipoesec(), "UTF-8"));
|
||||||
|
data.append("&" + URLEncoder.encode("tabfin", "UTF-8") + "=" +
|
||||||
|
URLEncoder.encode(conselReq.getTabfin(), "UTF-8"));
|
||||||
|
data.append("&" + URLEncoder.encode("convenz", "UTF-8") + "=" +
|
||||||
|
URLEncoder.encode(conselReq.getConvenz(), "UTF-8"));
|
||||||
|
data.append("&" + URLEncoder.encode("h_merce", "UTF-8") + "=" +
|
||||||
|
URLEncoder.encode(conselReq.getH_merce(), "UTF-8"));
|
||||||
|
data.append("&" + URLEncoder.encode("h_prod", "UTF-8") + "=" +
|
||||||
|
URLEncoder.encode(conselReq.getH_prod(), "UTF-8"));
|
||||||
|
data.append("&" + URLEncoder.encode("cognome", "UTF-8") + "=" +
|
||||||
|
URLEncoder.encode(conselReq.getCognome(), "UTF-8"));
|
||||||
|
data.append("&" + URLEncoder.encode("nome", "UTF-8") + "=" +
|
||||||
|
URLEncoder.encode(conselReq.getNome(), "UTF-8"));
|
||||||
|
data.append("&" + URLEncoder.encode("ordine", "UTF-8") + "=" +
|
||||||
|
URLEncoder.encode(conselReq.getOrdine(), "UTF-8"));
|
||||||
|
data.append("&" + URLEncoder.encode("anticipo", "UTF-8") + "=" +
|
||||||
|
conselReq.getAnticipo());
|
||||||
|
data.append("&" + URLEncoder.encode("descr1", "UTF-8") + "=" +
|
||||||
|
URLEncoder.encode(conselReq.getDescri1(), "UTF-8"));
|
||||||
|
data.append("&" + URLEncoder.encode("parz1", "UTF-8") + "=" +
|
||||||
|
conselReq.getParz1());
|
||||||
|
data.append("&" + URLEncoder.encode("tel_num", "UTF-8") + "=" +
|
||||||
|
URLEncoder.encode(conselReq.getTel_num(), "UTF-8"));
|
||||||
|
data.append("&" + URLEncoder.encode("pref_num", "UTF-8") + "=" +
|
||||||
|
URLEncoder.encode(conselReq.getPref_num(), "UTF-8"));
|
||||||
|
data.append("&" + URLEncoder.encode("impspe", "UTF-8") + "=" +
|
||||||
|
conselReq.getImpspe());
|
||||||
|
data.append("&" + URLEncoder.encode("impdafin", "UTF-8") + "=" +
|
||||||
|
conselReq.getImpdafin());
|
||||||
|
data.append("&" + URLEncoder.encode("data_nascita", "UTF-8") + "=" +
|
||||||
|
URLEncoder.encode(conselReq.getData_nascita(), "UTF-8"));
|
||||||
|
data.append("&" + URLEncoder.encode("indirizzo", "UTF-8") + "=" +
|
||||||
|
URLEncoder.encode(conselReq.getIndirizzo(), "UTF-8"));
|
||||||
|
data.append("&" + URLEncoder.encode("testomail", "UTF-8") + "=" +
|
||||||
|
URLEncoder.encode(conselReq.getTestomail(), "UTF-8"));
|
||||||
|
data.append("&" + URLEncoder.encode("codifisc", "UTF-8") + "=" +
|
||||||
|
URLEncoder.encode(conselReq.getCodfisc(), "UTF-8"));
|
||||||
|
URL url = new URL(conselSite);
|
||||||
|
URLConnection conn = url.openConnection();
|
||||||
|
conn.setDoOutput(true);
|
||||||
|
OutputStreamWriter wr = new OutputStreamWriter(
|
||||||
|
conn.getOutputStream());
|
||||||
|
wr.write(data.toString());
|
||||||
|
wr.flush();
|
||||||
|
BufferedReader rd = new BufferedReader(new InputStreamReader(
|
||||||
|
conn.getInputStream()));
|
||||||
|
ServletOutputStream sos = res.getOutputStream();
|
||||||
|
String line;
|
||||||
|
while ((line = rd.readLine()) != null)
|
||||||
|
sos.write(line.getBytes(), 0, line.length());
|
||||||
|
wr.close();
|
||||||
|
sos.flush();
|
||||||
|
sos.close();
|
||||||
|
rd.close();
|
||||||
|
} catch (Exception e) {
|
||||||
|
handleDebug(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,39 @@
|
||||||
|
package com.ablia.bank.servlet.consel;
|
||||||
|
|
||||||
|
import com.ablia.bank.consel.ConselResp;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
public abstract class ConselRespSvlt extends ConselSvlt {
|
||||||
|
protected void processRequest(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
try {
|
||||||
|
manageResponse(req, res);
|
||||||
|
} catch (Exception e) {
|
||||||
|
handleDebug(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void manageResponse(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
try {
|
||||||
|
ConselResp conselResp = new ConselResp(getApFull());
|
||||||
|
fillObject(req, conselResp);
|
||||||
|
if (conselResp.getStato().toLowerCase()
|
||||||
|
.equals("OK".toLowerCase()) ||
|
||||||
|
|
||||||
|
conselResp.getStato()
|
||||||
|
.toLowerCase()
|
||||||
|
.equals("WW".toLowerCase())) {
|
||||||
|
setJspPageRelative(getJspOkPage(req, res), req);
|
||||||
|
} else {
|
||||||
|
setJspPageRelative(getJspKoPage(req, res), req);
|
||||||
|
}
|
||||||
|
manageConselResponse(req, conselResp);
|
||||||
|
req.setAttribute("/conselReq.jsp", conselResp);
|
||||||
|
callJsp(req, res);
|
||||||
|
} catch (Exception e) {
|
||||||
|
handleDebug(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected abstract void manageConselResponse(HttpServletRequest paramHttpServletRequest, ConselResp paramConselResp);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,69 @@
|
||||||
|
package com.ablia.bank.servlet.consel;
|
||||||
|
|
||||||
|
import com.ablia.bank.consel.ConselTabfin;
|
||||||
|
import com.ablia.bank.consel.ConselTabfinCR;
|
||||||
|
import com.ablia.servlet.AcServlet;
|
||||||
|
import javax.servlet.RequestDispatcher;
|
||||||
|
import javax.servlet.ServletRequest;
|
||||||
|
import javax.servlet.ServletResponse;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
public class ConselSvlt extends AcServlet {
|
||||||
|
protected static final String CONSEL_REQ_JSP = "/conselReq.jsp";
|
||||||
|
|
||||||
|
protected static final String BEAN_CONSEL_REQ = "conselReq";
|
||||||
|
|
||||||
|
protected static final String BEAN_CONSEL_RESP = "/conselReq.jsp";
|
||||||
|
|
||||||
|
protected final void callJsp(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
setJspPageRelative(getJspOkPage(req, res), req);
|
||||||
|
try {
|
||||||
|
RequestDispatcher rd = getServletContext()
|
||||||
|
.getRequestDispatcher(getJspPage(req));
|
||||||
|
rd.forward((ServletRequest)req, (ServletResponse)res);
|
||||||
|
} catch (Exception e) {
|
||||||
|
handleDebug(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected String getCodiceConvenzione(HttpServletRequest req) {
|
||||||
|
return getParm("COD_CONVENZIONE_CONSEL").getTesto();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected String getJspErrorPage(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
String temp = getParm("CONSEL_ERROR_PAGE").getTesto();
|
||||||
|
if (temp.isEmpty())
|
||||||
|
return getJspKoPage(req, res);
|
||||||
|
return temp;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected String getJspOkPage(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
String temp = getParm("CONSEL_OK_PAGE").getTesto();
|
||||||
|
if (temp.isEmpty())
|
||||||
|
return "conselRes.jsp";
|
||||||
|
return temp;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected String getJspKoPage(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
String temp = getParm("CONSEL_OK_PAGE").getTesto();
|
||||||
|
if (temp.isEmpty())
|
||||||
|
return "conselRes.jsp";
|
||||||
|
return temp;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void processRequest(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
ConselTabfin ct = new ConselTabfin(getApFull());
|
||||||
|
ConselTabfinCR CR = new ConselTabfinCR();
|
||||||
|
fillObject(req, CR);
|
||||||
|
req.setAttribute("list", ct.findByCR(CR, 0, 0));
|
||||||
|
req.setAttribute("CR", CR);
|
||||||
|
req.setAttribute("nf3", getNf3());
|
||||||
|
setJspPageRelative("tabfin" + CR.getFlgTipo() + getAct(req) + ".jsp", req);
|
||||||
|
callJsp(req, res);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected boolean isSecureServlet(HttpServletRequest req) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
package com.ablia.bank.servlet.infogroup;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
public abstract class GetShopnetResponseSvlt extends ShopNetSvlt {
|
||||||
|
protected void processRequest(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
getResponse(req, res);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,91 @@
|
||||||
|
package com.ablia.bank.servlet.infogroup;
|
||||||
|
|
||||||
|
import com.ablia.bank.infogroup.ShopnetResp;
|
||||||
|
import com.ablia.servlet.AcServlet;
|
||||||
|
import javax.servlet.RequestDispatcher;
|
||||||
|
import javax.servlet.ServletRequest;
|
||||||
|
import javax.servlet.ServletResponse;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
public abstract class ShopNetSvlt extends AcServlet {
|
||||||
|
protected static final String BEAN_SHOPNETRES = "shopnetResp";
|
||||||
|
|
||||||
|
protected final void callJsp(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
setJspPageRelative(getJspOkPage(req, res), req);
|
||||||
|
try {
|
||||||
|
RequestDispatcher rd = getServletContext()
|
||||||
|
.getRequestDispatcher(getJspPage(req));
|
||||||
|
rd.forward((ServletRequest)req, (ServletResponse)res);
|
||||||
|
} catch (Exception e) {
|
||||||
|
handleDebug(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected abstract void fillIdOrdineByShopnetRes(HttpServletRequest paramHttpServletRequest, HttpServletResponse paramHttpServletResponse, ShopnetResp paramShopnetResp);
|
||||||
|
|
||||||
|
protected void getResponse(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
try {
|
||||||
|
ShopnetResp snRes = new ShopnetResp();
|
||||||
|
fillObject(req, snRes);
|
||||||
|
fillIdOrdineByShopnetRes(req, res, snRes);
|
||||||
|
if (snRes.getStato() == 2L) {
|
||||||
|
setJspPageRelative(getJspOkPage(req, res), req);
|
||||||
|
recordOrder(req, res, snRes);
|
||||||
|
} else {
|
||||||
|
sendMessage(req, "Errore! Transazione annullata.");
|
||||||
|
payKoUpdateOrder(req, res, snRes);
|
||||||
|
setJspPageRelative(getJspKoPage(req, res), req);
|
||||||
|
}
|
||||||
|
req.setAttribute("shopnetResp", snRes);
|
||||||
|
preparePaymenResPage(req, res, snRes);
|
||||||
|
callJsp(req, res);
|
||||||
|
} catch (Exception e) {
|
||||||
|
setJspPageRelative(getJspErrorPage(req, res), req);
|
||||||
|
String temp = "ERRORE!!Shopnet! Risposta non valida: ";
|
||||||
|
sendMessage(req, temp);
|
||||||
|
handleDebug(temp, 2);
|
||||||
|
preparePaymenResPage(req, res, null);
|
||||||
|
callJsp(req, res);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected String getJspErrorPage(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
String temp = getParm("PAY_OK").getTesto();
|
||||||
|
if (temp.isEmpty())
|
||||||
|
return getJspKoPage(req, res);
|
||||||
|
return temp;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected String getJspOkPage(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
String temp = getParm("PAY_OK").getTesto();
|
||||||
|
if (temp.isEmpty())
|
||||||
|
return "payRes.jsp";
|
||||||
|
return temp;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected String getJspKoPage(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
String temp = getParm("PAY_OK").getTesto();
|
||||||
|
if (temp.isEmpty())
|
||||||
|
return "payRes.jsp";
|
||||||
|
return temp;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void processRequest(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
try {
|
||||||
|
getResponse(req, res);
|
||||||
|
} catch (Exception e) {
|
||||||
|
handleDebug(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected boolean isSecureServlet(HttpServletRequest req) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected abstract void recordOrder(HttpServletRequest paramHttpServletRequest, HttpServletResponse paramHttpServletResponse, ShopnetResp paramShopnetResp);
|
||||||
|
|
||||||
|
protected void preparePaymenResPage(HttpServletRequest req, HttpServletResponse res, ShopnetResp snRes) {}
|
||||||
|
|
||||||
|
protected abstract void payKoUpdateOrder(HttpServletRequest paramHttpServletRequest, HttpServletResponse paramHttpServletResponse, ShopnetResp paramShopnetResp);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,39 @@
|
||||||
|
package com.ablia.bank.servlet.keyclient;
|
||||||
|
|
||||||
|
import com.ablia.bank.keyclient.KeyClientResp;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
public abstract class GetKeyClientResponseSvlt extends KeyClientSvlt {
|
||||||
|
protected abstract void preparePaymenResPage(HttpServletRequest paramHttpServletRequest, HttpServletResponse paramHttpServletResponse, KeyClientResp paramKeyClientResp);
|
||||||
|
|
||||||
|
protected abstract void recordOrder(HttpServletRequest paramHttpServletRequest, HttpServletResponse paramHttpServletResponse, KeyClientResp paramKeyClientResp);
|
||||||
|
|
||||||
|
protected void getResponse(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
try {
|
||||||
|
KeyClientResp kcRes = new KeyClientResp();
|
||||||
|
fillObject(req, kcRes);
|
||||||
|
kcRes.setBRAND(getRequestParameter(req, "$BRAND"));
|
||||||
|
if (kcRes.getEsito().equals("OK")) {
|
||||||
|
setJspPageRelative(getJspOkPage(req, res), req);
|
||||||
|
recordOrder(req, res, kcRes);
|
||||||
|
} else {
|
||||||
|
setJspPageRelative(getJspKoPage(req, res), req);
|
||||||
|
}
|
||||||
|
req.setAttribute("KCResp", kcRes);
|
||||||
|
preparePaymenResPage(req, res, kcRes);
|
||||||
|
callJsp(req, res);
|
||||||
|
} catch (Exception e) {
|
||||||
|
setJspPageRelative(getJspErrorPage(req, res), req);
|
||||||
|
String temp = "ERRORE!!Key Client! Risposta non valida: ";
|
||||||
|
sendMessage(req, temp);
|
||||||
|
handleDebug(temp, 2);
|
||||||
|
preparePaymenResPage(req, res, null);
|
||||||
|
callJsp(req, res);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void processRequest(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
getResponse(req, res);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,119 @@
|
||||||
|
package com.ablia.bank.servlet.keyclient;
|
||||||
|
|
||||||
|
import com.ablia.bank.infogroup.ShopnetResp;
|
||||||
|
import com.ablia.bank.keyclient.KeyClientReq;
|
||||||
|
import com.ablia.servlet.AcServlet;
|
||||||
|
import javax.servlet.RequestDispatcher;
|
||||||
|
import javax.servlet.ServletRequest;
|
||||||
|
import javax.servlet.ServletResponse;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
public class KeyClientSvlt extends AcServlet {
|
||||||
|
protected static final String BEAN_KC_RES = "KCResp";
|
||||||
|
|
||||||
|
protected static final String CMD_GET_RES = "res";
|
||||||
|
|
||||||
|
protected static final String CMD_SEND_REQ = "send";
|
||||||
|
|
||||||
|
protected final void callJsp(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
setJspPageRelative(getJspOkPage(req, res), req);
|
||||||
|
try {
|
||||||
|
RequestDispatcher rd = getServletContext()
|
||||||
|
.getRequestDispatcher(getJspPage(req));
|
||||||
|
rd.forward((ServletRequest)req, (ServletResponse)res);
|
||||||
|
} catch (Exception e) {
|
||||||
|
handleDebug(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void getResponse(HttpServletRequest req, HttpServletResponse res) {}
|
||||||
|
|
||||||
|
protected String getJspErrorPage(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
String temp = getParm("KC_PAY_OK").getTesto();
|
||||||
|
if (temp.isEmpty())
|
||||||
|
return getJspKoPage(req, res);
|
||||||
|
return temp;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected String getJspOkPage(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
String temp = getParm("KC_PAY_OK").getTesto();
|
||||||
|
if (temp.isEmpty())
|
||||||
|
return "payRes.jsp";
|
||||||
|
return temp;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected String getJspKoPage(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
String temp = getParm("KC_PAY_OK").getTesto();
|
||||||
|
if (temp.isEmpty())
|
||||||
|
return "payRes.jsp";
|
||||||
|
return temp;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void processRequest(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
String cmd = getCmd(req).toLowerCase();
|
||||||
|
try {
|
||||||
|
if (cmd.equals("send")) {
|
||||||
|
sendRequest(req, res);
|
||||||
|
} else if (cmd.equals("res")) {
|
||||||
|
getResponse(req, res);
|
||||||
|
} else {
|
||||||
|
sendRequest(req, res);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
handleDebug(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected boolean isSecureServlet(HttpServletRequest req) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void payKoUpdateOrder(HttpServletRequest req, HttpServletResponse res, ShopnetResp snRes) {}
|
||||||
|
|
||||||
|
protected void sendRequest(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
try {
|
||||||
|
String theUrl;
|
||||||
|
KeyClientReq kcReq = new KeyClientReq();
|
||||||
|
fillObject(req, kcReq);
|
||||||
|
kcReq.setKey(getParm("KC_KEY").getTesto());
|
||||||
|
kcReq.setAlias(getParm("KC_ALIAS").getTesto());
|
||||||
|
kcReq.setUrl(getParm("KC_URL_RESPONSE").getTesto());
|
||||||
|
kcReq.setUrl_back(getParm("KC_URL_RESPONSE_NULL")
|
||||||
|
.getTesto());
|
||||||
|
if (getParm("TEST").getNumeroLong() == 1L) {
|
||||||
|
theUrl = kcReq.getTestRequestUrl();
|
||||||
|
} else {
|
||||||
|
theUrl = kcReq.getRequestUrl();
|
||||||
|
System.out.println(theUrl);
|
||||||
|
System.out.println(kcReq.getTestRequestUrl());
|
||||||
|
}
|
||||||
|
if (!theUrl.equals("")) {
|
||||||
|
res.sendRedirect(theUrl);
|
||||||
|
} else {
|
||||||
|
setJspPageRelative(getJspErrorPage(req, res), req);
|
||||||
|
String temp = "ERRORE!!KeyClient Svlt! Impossibile creare url di richiesta!";
|
||||||
|
sendMessage(req, temp);
|
||||||
|
getResponse(req, res);
|
||||||
|
handleDebug(temp, 2);
|
||||||
|
callJsp(req, res);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
handleDebug(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected String getUrlResponse(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
String temp = getParm("KC_URL_RESPONSE").getTesto();
|
||||||
|
if (temp.isEmpty())
|
||||||
|
return "RicevutaKC.abl";
|
||||||
|
return temp;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected String getUrlResponseNull(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
String temp = getParm("KC_URL_RESPONSE_NULL").getTesto();
|
||||||
|
if (temp.isEmpty())
|
||||||
|
return "RicevutaKC.abl";
|
||||||
|
return temp;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
package com.ablia.bank.servlet.paypal;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
public class GetPayPalResponseSvlt extends PayPalSvlt {
|
||||||
|
protected void processRequest(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
getPayerDatails(req, res);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,290 @@
|
||||||
|
package com.ablia.bank.servlet.paypal;
|
||||||
|
|
||||||
|
import com.ablia.bank.paypal.PayPalReq;
|
||||||
|
import com.ablia.bank.paypal.PayPalResp;
|
||||||
|
import com.ablia.servlet.AcServlet;
|
||||||
|
import java.io.BufferedReader;
|
||||||
|
import java.io.InputStreamReader;
|
||||||
|
import java.net.URL;
|
||||||
|
import java.net.URLConnection;
|
||||||
|
import java.net.URLEncoder;
|
||||||
|
import javax.servlet.RequestDispatcher;
|
||||||
|
import javax.servlet.ServletRequest;
|
||||||
|
import javax.servlet.ServletResponse;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
public class PayPalSvlt extends AcServlet {
|
||||||
|
public static final String CMD_SET_EXPRESS_CEHCKOUT = "start";
|
||||||
|
|
||||||
|
public static final String CMD_DO_EXPRESS_CEHCKOUT = "dopayment";
|
||||||
|
|
||||||
|
protected static final String CMD_GET_RES = "res";
|
||||||
|
|
||||||
|
protected static final String BEAN_PAYPALRES = "payPalResp";
|
||||||
|
|
||||||
|
private String payPalHttpServer;
|
||||||
|
|
||||||
|
private static final boolean debug = false;
|
||||||
|
|
||||||
|
private String API_VERSION = "98";
|
||||||
|
|
||||||
|
protected final void callJsp(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
setJspPageRelative(getJspOkPage(req, res), req);
|
||||||
|
try {
|
||||||
|
RequestDispatcher rd = getServletContext().getRequestDispatcher(getJspPage(req));
|
||||||
|
rd.forward((ServletRequest)req, (ServletResponse)res);
|
||||||
|
} catch (Exception e) {
|
||||||
|
handleDebug(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void doSetExpressCheckout(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
try {
|
||||||
|
PayPalReq ppReq = new PayPalReq();
|
||||||
|
fillObject(req, ppReq);
|
||||||
|
String sec = String.valueOf(getRequiredParameterstring()) + "&CURRENCYCODE=" + getCurrency() + "&METHOD=" + "SetExpressCheckout" +
|
||||||
|
"&AMT=" + URLEncoder.encode(String.valueOf(ppReq.getAmt())) + "&RETURNURL=" +
|
||||||
|
URLEncoder.encode(getReturnURL(req, res)) + "&CANCELURL=" + URLEncoder.encode(getCancelURL(req, res)) + "&" +
|
||||||
|
ppReq.getShippingAddressString();
|
||||||
|
String pageStyle = getPageStyle();
|
||||||
|
if (!pageStyle.equals(""))
|
||||||
|
sec = String.valueOf(sec) + "&PAGESTYLE=" + URLEncoder.encode(pageStyle);
|
||||||
|
String urlString = String.valueOf(getPayPalHttpServer(req)) + "?" + sec;
|
||||||
|
URL url = new URL(urlString);
|
||||||
|
URLConnection connection = url.openConnection();
|
||||||
|
BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
|
||||||
|
PayPalResp ppResponse = new PayPalResp();
|
||||||
|
ppResponse.fillResponse(in);
|
||||||
|
ppResponse.setId_ordine(ppReq.getId_ordine());
|
||||||
|
req.getSession().setAttribute("_SESS_ID_ORDER", new Long(ppReq.getId_ordine()));
|
||||||
|
if (ppResponse.isResponseOk()) {
|
||||||
|
String rediretUrl;
|
||||||
|
if (getParm("TEST").getNumeroLong() == 1L) {
|
||||||
|
rediretUrl = "https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=" + ppResponse.getTOKEN();
|
||||||
|
} else {
|
||||||
|
rediretUrl = "https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=" + ppResponse.getTOKEN();
|
||||||
|
}
|
||||||
|
req.getSession().setAttribute("_SESS_TOKEN", ppResponse.getTOKEN());
|
||||||
|
res.sendRedirect(rediretUrl);
|
||||||
|
} else {
|
||||||
|
req.setAttribute("payPalResp", ppResponse);
|
||||||
|
setJspPageRelative(getJspErrorPage(req, res), req);
|
||||||
|
String temp = "ERRORE!!PayPal Error! Code: " + ppResponse.getL_ERRORCODE0() + ": " + ppResponse.getL_SHORTMESSAGE0() + " " +
|
||||||
|
ppResponse.getL_LONGMESSAGE0();
|
||||||
|
sendMessage(req, temp);
|
||||||
|
preparePaymenResPage(req, res, ppResponse);
|
||||||
|
handleDebug(temp, 2);
|
||||||
|
callJsp(req, res);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
handleDebug(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void getPayerDatails(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
try {
|
||||||
|
String token = (String)req.getSession().getAttribute("_SESS_TOKEN");
|
||||||
|
String sec = String.valueOf(getRequiredParameterstring()) + "&METHOD=" + "GetExpressCheckoutDetails" + "&TOKEN=" + token;
|
||||||
|
String urlString = String.valueOf(getPayPalHttpServer(req)) + "?" + sec;
|
||||||
|
URL url = new URL(urlString);
|
||||||
|
URLConnection connection = url.openConnection();
|
||||||
|
BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
|
||||||
|
PayPalResp ppResponse = new PayPalResp();
|
||||||
|
ppResponse.fillResponse(in);
|
||||||
|
long l_id_ordine = (Long)req.getSession().getAttribute("_SESS_ID_ORDER");
|
||||||
|
ppResponse.setId_ordine(l_id_ordine);
|
||||||
|
fillObject(req, ppResponse);
|
||||||
|
if (ppResponse.isResponseOk() && !ppResponse.getPAYERID().isEmpty()) {
|
||||||
|
ppResponse.setDetailBuyer(true);
|
||||||
|
setJspPageRelative(getJspPayerDetailsPage(req, res), req);
|
||||||
|
} else {
|
||||||
|
if (ppResponse.isResponseOk())
|
||||||
|
sendMessage(req, "Transazione Abbandonata!");
|
||||||
|
ppResponse.setDetailBuyer(false);
|
||||||
|
setJspPageRelative(getJspKoPage(req, res), req);
|
||||||
|
}
|
||||||
|
req.setAttribute("payPalResp", ppResponse);
|
||||||
|
preparePaymenResPage(req, res, ppResponse);
|
||||||
|
callJsp(req, res);
|
||||||
|
} catch (Exception e) {
|
||||||
|
setJspPageRelative(getJspErrorPage(req, res), req);
|
||||||
|
String temp = "ERRORE!!PayPal Error! getPayerDetail: ";
|
||||||
|
sendMessage(req, temp);
|
||||||
|
handleDebug(temp, 2);
|
||||||
|
preparePaymenResPage(req, res, null);
|
||||||
|
callJsp(req, res);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void doExpresssCheckout(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
try {
|
||||||
|
PayPalReq ppReq = new PayPalReq();
|
||||||
|
fillObject(req, ppReq);
|
||||||
|
long l_id_ordine = (Long)req.getSession().getAttribute("_SESS_ID_ORDER");
|
||||||
|
String sec = String.valueOf(getRequiredParameterstring()) + "&CURRENCYCODE=" + getCurrency() + "&METHOD=" +
|
||||||
|
"DoExpressCheckoutPayment" + "&TOKEN=" + ppReq.getTOKEN() + "&AMT=" + ppReq.getAmt() + "&PAYERID=" +
|
||||||
|
ppReq.getPAYERID() + "&PAYMENTACTION=Sale";
|
||||||
|
String urlString = String.valueOf(getPayPalHttpServer(req)) + "?" + sec;
|
||||||
|
URL url = new URL(urlString);
|
||||||
|
URLConnection connection = url.openConnection();
|
||||||
|
BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
|
||||||
|
PayPalResp ppResponse = new PayPalResp();
|
||||||
|
ppResponse.fillResponse(in);
|
||||||
|
ppResponse.setId_ordine(l_id_ordine);
|
||||||
|
fillObject(req, ppResponse);
|
||||||
|
if (ppResponse.isResponseOk()) {
|
||||||
|
ppResponse.setPaymentDone(true);
|
||||||
|
ppResponse.setDetailBuyer(true);
|
||||||
|
setJspPageRelative(getJspOkPage(req, res), req);
|
||||||
|
recordOrder(req, res, ppResponse);
|
||||||
|
} else {
|
||||||
|
ppResponse.setDetailBuyer(false);
|
||||||
|
setJspPageRelative(getJspKoPage(req, res), req);
|
||||||
|
}
|
||||||
|
req.setAttribute("payPalResp", ppResponse);
|
||||||
|
preparePaymenResPage(req, res, ppResponse);
|
||||||
|
callJsp(req, res);
|
||||||
|
} catch (Exception e) {
|
||||||
|
setJspPageRelative(getJspErrorPage(req, res), req);
|
||||||
|
String temp = "ERRORE!!PayPal Error! getPayerDetail: ";
|
||||||
|
sendMessage(req, temp);
|
||||||
|
handleDebug(temp, 2);
|
||||||
|
preparePaymenResPage(req, res, null);
|
||||||
|
callJsp(req, res);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected String getJspErrorPage(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
String temp = getParm("PAYPAL_OK").getTesto();
|
||||||
|
if (temp.isEmpty())
|
||||||
|
return "payPalRes.jsp";
|
||||||
|
return temp;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected String getJspOkPage(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
String temp = getParm("PAYPAL_OK").getTesto();
|
||||||
|
if (temp.isEmpty())
|
||||||
|
return "payPalRes.jsp";
|
||||||
|
return temp;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected String getJspPayerDetailsPage(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
String temp = getParm("PAYPAL_DETAIL").getTesto();
|
||||||
|
if (temp.isEmpty())
|
||||||
|
return "payPalRes.jsp";
|
||||||
|
return temp;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected String getReturnURL(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
String temp = getParm("PAYPAL_RETURNURL").getTesto();
|
||||||
|
if (temp.isEmpty())
|
||||||
|
return "http://localhost:8080/mrcocci/PayPalResp.abl";
|
||||||
|
return temp;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected String getCancelURL(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
String temp = getParm("PAYPAL_CANCELURL").getTesto();
|
||||||
|
if (temp.isEmpty())
|
||||||
|
return "http://localhost:8080/mrcocci/PayPalResp.abl";
|
||||||
|
return temp;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected String getJspKoPage(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
String temp = getParm("PAYPAL_OK").getTesto();
|
||||||
|
if (temp.isEmpty())
|
||||||
|
return "payPalRes.jsp";
|
||||||
|
return temp;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void processRequest(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
try {
|
||||||
|
String cmd = getCmd(req).toLowerCase();
|
||||||
|
if (cmd.equals("start")) {
|
||||||
|
doSetExpressCheckout(req, res);
|
||||||
|
} else if (cmd.equals("res")) {
|
||||||
|
getPayerDatails(req, res);
|
||||||
|
} else if (cmd.equals("dopayment")) {
|
||||||
|
doExpresssCheckout(req, res);
|
||||||
|
} else {
|
||||||
|
doSetExpressCheckout(req, res);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
handleDebug(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected boolean isSecureServlet(HttpServletRequest req) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected boolean isApiCertificate(HttpServletRequest req) {
|
||||||
|
long temp = getParm("PAYPAL_USE_CERTIFICATE").getNumeroLong();
|
||||||
|
if (temp == 1L)
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void recordOrder(HttpServletRequest req, HttpServletResponse res, PayPalResp ppResponse) {}
|
||||||
|
|
||||||
|
protected void preparePaymenResPage(HttpServletRequest req, HttpServletResponse res, PayPalResp ppResponse) {}
|
||||||
|
|
||||||
|
private String getPayPalHttpServer(HttpServletRequest req) {
|
||||||
|
if (getParm("TEST").getNumeroLong() == 1L) {
|
||||||
|
System.out.println("PAYPAL TEST!!!! USING SANDBOX");
|
||||||
|
if (isApiCertificate(req)) {
|
||||||
|
this.payPalHttpServer = "https://api.sandbox.paypal.com/nvp";
|
||||||
|
} else {
|
||||||
|
this.payPalHttpServer = "https://api-aa-3t.sandbox.paypal.com/nvp";
|
||||||
|
}
|
||||||
|
} else if (isApiCertificate(req)) {
|
||||||
|
this.payPalHttpServer = "https://api.paypal.com/nvp";
|
||||||
|
} else {
|
||||||
|
this.payPalHttpServer = "https://api-3t.paypal.com/nvp";
|
||||||
|
}
|
||||||
|
return this.payPalHttpServer;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPayPalHttpServer(String payPalHttpServer) {
|
||||||
|
this.payPalHttpServer = payPalHttpServer;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String getRequiredParameterstring() {
|
||||||
|
return "USER=" + getApiUsername() + "&PWD=" + getApiPassword() + "&SIGNATURE=" + getApiSignature() + "&VERSION=" + this.API_VERSION;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected String getApiPassword() {
|
||||||
|
String temp = getParm("PAYPAL_API_PWD").getTesto();
|
||||||
|
if (temp.isEmpty())
|
||||||
|
return "1196089261";
|
||||||
|
return temp;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected String getApiSignature() {
|
||||||
|
String temp = getParm("PAYPAL_API_SIGNATURE").getTesto();
|
||||||
|
if (temp.isEmpty())
|
||||||
|
return "AGAgVmHK8-QsvPbEGnNP6SiFg7qvADQfsLa6GrW8G43-yqX46vNyyZzG";
|
||||||
|
return temp;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String getPageStyle() {
|
||||||
|
String temp = getParm("PAYPAL_PAGE_STYLE").getTesto();
|
||||||
|
if (temp.isEmpty())
|
||||||
|
return "";
|
||||||
|
return temp;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected String getApiUsername() {
|
||||||
|
String temp = getParm("PAYPAL_API_USERNAME").getTesto();
|
||||||
|
if (temp.isEmpty())
|
||||||
|
return "acolzi_1196089239_biz_api1.ablia.com";
|
||||||
|
return temp;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected String getCurrency() {
|
||||||
|
String temp = getParm("PAYPAL_CURRENCY").getTesto();
|
||||||
|
if (temp.isEmpty())
|
||||||
|
return "EUR";
|
||||||
|
return temp;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,64 @@
|
||||||
|
package com.ablia.bank.servlet.poste;
|
||||||
|
|
||||||
|
import com.ablia.bank.poste.PeResp;
|
||||||
|
import javax.servlet.ServletOutputStream;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
public abstract class GetPeResponseSvlt extends PeSvlt {
|
||||||
|
protected void processRequest(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
getResponse(req, res);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void getResponse(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
try {
|
||||||
|
ServletOutputStream sout = res.getOutputStream();
|
||||||
|
PeResp peResp = new PeResp();
|
||||||
|
fillObject(req, peResp);
|
||||||
|
peResp.setError(req.getParameter("Error"));
|
||||||
|
peResp.setErrorText(req.getParameter("ErrorText"));
|
||||||
|
peResp.setId_ordine(Long.valueOf(peResp.getTrackid()).longValue());
|
||||||
|
String resultUrl = "REDIRECT=" +
|
||||||
|
getParm("PE_URL_REDIRECT_RESULT").getTesto();
|
||||||
|
if ((peResp.getError() == null || peResp.getError().equals("")) && (
|
||||||
|
peResp.getErrorCode() == null || peResp.getErrorCode()
|
||||||
|
.equals("")) &&
|
||||||
|
peResp.getTranid() != null &&
|
||||||
|
!peResp.getTranid().equals("") &&
|
||||||
|
peResp.getResult() != null && peResp.getResult()
|
||||||
|
.equals("APPROVED")) {
|
||||||
|
recordOrder(req, res, peResp);
|
||||||
|
resultUrl = String.valueOf(resultUrl) + "?result=" +
|
||||||
|
peResp.getResult() + "&paymentid=" +
|
||||||
|
peResp.getPaymentid() + "&trackid=" +
|
||||||
|
peResp.getTrackid() + "&tranid=" + peResp.getTranid() +
|
||||||
|
"&error=" + peResp.getError() + "&errorText=" +
|
||||||
|
peResp.getErrorText() + "&errorCode=" +
|
||||||
|
peResp.getErrorCode() + "&errorService=" +
|
||||||
|
peResp.getErrorService();
|
||||||
|
} else {
|
||||||
|
resultUrl = String.valueOf(resultUrl) + "?result=" +
|
||||||
|
peResp.getResult() + "&paymentid=" +
|
||||||
|
peResp.getPaymentid() + "&trackid=" +
|
||||||
|
peResp.getTrackid() + "&tranid=" + peResp.getTranid() +
|
||||||
|
"&error=" + peResp.getError() + "&errorText=" +
|
||||||
|
peResp.getErrorText() + "&errorCode=" +
|
||||||
|
peResp.getErrorCode() + "&errorService=" +
|
||||||
|
peResp.getErrorService();
|
||||||
|
}
|
||||||
|
sout.print(resultUrl);
|
||||||
|
sout.flush();
|
||||||
|
sout.close();
|
||||||
|
} catch (Exception e) {
|
||||||
|
setJspPageRelative(getJspErrorPage(req, res), req);
|
||||||
|
String temp = "ERRORE!!Post Ecommerce! Risposta non valida: ";
|
||||||
|
sendMessage(req, temp);
|
||||||
|
handleDebug(temp, 2);
|
||||||
|
setJspPageRelative(getParm("PE_PAY_KO").getTesto(),
|
||||||
|
req);
|
||||||
|
callJsp(req, res);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected abstract void recordOrder(HttpServletRequest paramHttpServletRequest, HttpServletResponse paramHttpServletResponse, PeResp paramPeResp);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,160 @@
|
||||||
|
package com.ablia.bank.servlet.poste;
|
||||||
|
|
||||||
|
import com.ablia.bank.poste.PeReq;
|
||||||
|
import com.ablia.servlet.AcServlet;
|
||||||
|
import com.aciworldwide.commerce.gateway.plugins.e24PaymentPipe;
|
||||||
|
import it.netsw.apps.igfs.cg.coms.plugins.IGFSInit;
|
||||||
|
import java.net.URLEncoder;
|
||||||
|
import javax.servlet.RequestDispatcher;
|
||||||
|
import javax.servlet.ServletRequest;
|
||||||
|
import javax.servlet.ServletResponse;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
public class PeSvlt extends AcServlet {
|
||||||
|
protected static final String BEAN_PE_RES = "peResp";
|
||||||
|
|
||||||
|
protected final void callJsp(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
setJspPageRelative(getJspOkPage(req, res), req);
|
||||||
|
try {
|
||||||
|
RequestDispatcher rd = getServletContext()
|
||||||
|
.getRequestDispatcher(getJspPage(req));
|
||||||
|
rd.forward((ServletRequest)req, (ServletResponse)res);
|
||||||
|
} catch (Exception e) {
|
||||||
|
handleDebug(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void sendRequest(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
if (getParm("PE_USE_IGFS").getNumeroLong() == 1L) {
|
||||||
|
sendRequestIGFS(req, res);
|
||||||
|
} else {
|
||||||
|
try {
|
||||||
|
e24PaymentPipe pipe = new e24PaymentPipe();
|
||||||
|
PeReq peReq = new PeReq();
|
||||||
|
fillObject(req, peReq);
|
||||||
|
peReq.setResponseURL(getParm("PE_URL_POST_RESPONSE")
|
||||||
|
.getTesto());
|
||||||
|
peReq.setErrorURL(getParm("URL_POST_RESPONSE_ERROR")
|
||||||
|
.getTesto());
|
||||||
|
peReq.setMerchantId(getParm("PE_MERCHANT_ID").getTesto());
|
||||||
|
peReq.setResourcePath(getParm("PE_RESOURCE_PATH").getTesto());
|
||||||
|
String temp = getRequestParameter(req, "flgTipoPagamentoPe");
|
||||||
|
if (temp.isEmpty()) {
|
||||||
|
peReq.setFlgTipoPagamentoPe("03");
|
||||||
|
} else {
|
||||||
|
peReq.setFlgTipoPagamentoPe(temp);
|
||||||
|
}
|
||||||
|
pipe.setAlias(peReq.getAlias());
|
||||||
|
pipe.setResourcePath(peReq.getResourcePath());
|
||||||
|
pipe.setAction(peReq.getAction());
|
||||||
|
pipe.setCurrency(peReq.getCurrency());
|
||||||
|
pipe.setAmt(peReq.getAmt());
|
||||||
|
pipe.setLanguage(peReq.getLanguage());
|
||||||
|
pipe.setResponseURL(URLEncoder.encode(peReq.getResponseURL(),
|
||||||
|
"UTF-8"));
|
||||||
|
pipe.setErrorURL(URLEncoder.encode(peReq.getErrorURL(), "UTF-8"));
|
||||||
|
pipe.setTrackId(peReq.getTrackId());
|
||||||
|
if (pipe.performPaymentInitialization() != 0) {
|
||||||
|
setJspPageRelative(getJspErrorPage(req, res), req);
|
||||||
|
temp = "ERRORE!!e24PaymentPipe Error! Code: " +
|
||||||
|
pipe.getErrorMsg();
|
||||||
|
sendMessage(req, temp);
|
||||||
|
handleDebug(temp, 2);
|
||||||
|
callJsp(req, res);
|
||||||
|
} else {
|
||||||
|
String payID = pipe.getPaymentId();
|
||||||
|
String payURL = pipe.getPaymentPage();
|
||||||
|
String userid = URLEncoder.encode(peReq.getUserName(),
|
||||||
|
"UTF-8");
|
||||||
|
res.sendRedirect(String.valueOf(payURL) + "?PaymentID=" + payID +
|
||||||
|
"&hppUserName=" + userid);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
handleDebug(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected String getCodiceEsercente(HttpServletRequest req) {
|
||||||
|
return getParm("PE_RESOURCE_PATH").getTesto();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected String getJspErrorPage(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
String temp = getParm("PE_PAY_OK").getTesto();
|
||||||
|
if (temp.isEmpty())
|
||||||
|
return getJspKoPage(req, res);
|
||||||
|
return temp;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected String getJspOkPage(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
String temp = getParm("PE_PAY_OK").getTesto();
|
||||||
|
if (temp.isEmpty())
|
||||||
|
return "payRes.jsp";
|
||||||
|
return temp;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected String getJspKoPage(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
String temp = getParm("PE_PAY_OK").getTesto();
|
||||||
|
if (temp.isEmpty())
|
||||||
|
return "payRes.jsp";
|
||||||
|
return temp;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void processRequest(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
try {
|
||||||
|
sendRequest(req, res);
|
||||||
|
} catch (Exception e) {
|
||||||
|
handleDebug(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected boolean isSecureServlet(HttpServletRequest req) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void sendRequestIGFS(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
try {
|
||||||
|
IGFSInit pipe = new IGFSInit();
|
||||||
|
PeReq peReq = new PeReq();
|
||||||
|
fillObject(req, peReq);
|
||||||
|
peReq.setResponseURL(getParm("PE_URL_POST_RESPONSE").getTesto());
|
||||||
|
peReq.setErrorURL(getParm("URL_POST_RESPONSE_ERROR")
|
||||||
|
.getTesto());
|
||||||
|
peReq.setMerchantId(getParm("PE_MERCHANT_ID").getTesto());
|
||||||
|
peReq.setResourcePath(getParm("PE_RESOURCE_PATH").getTesto());
|
||||||
|
String temp = getRequestParameter(req, "flgTipoPagamentoPe");
|
||||||
|
if (temp.isEmpty()) {
|
||||||
|
peReq.setFlgTipoPagamentoPe("03");
|
||||||
|
} else {
|
||||||
|
peReq.setFlgTipoPagamentoPe(temp);
|
||||||
|
}
|
||||||
|
pipe.setResourcePath(peReq.getResourcePath());
|
||||||
|
pipe.setAlias(peReq.getAlias());
|
||||||
|
pipe.setAction(peReq.getAction());
|
||||||
|
pipe.setCurrency(peReq.getCurrency());
|
||||||
|
pipe.setAmt(peReq.getAmt());
|
||||||
|
pipe.setLanguage("ITA");
|
||||||
|
pipe.setLanguage(peReq.getLanguage());
|
||||||
|
pipe.setResponseURL(peReq.getResponseURL());
|
||||||
|
pipe.setErrorURL(peReq.getErrorURL());
|
||||||
|
pipe.setTrackId(peReq.getTrackId());
|
||||||
|
pipe.setShopUserRef(peReq.getTrackId());
|
||||||
|
if (getParm("PE_NO_CERTIFICATO").getNumeroLong() == 1L)
|
||||||
|
pipe.disableCheckSSLCert();
|
||||||
|
if (!pipe.execute()) {
|
||||||
|
setJspPageRelative(getJspErrorPage(req, res), req);
|
||||||
|
temp = "ERRORE!!IGFSInit Error! Code: " + pipe.getErrorMsg();
|
||||||
|
sendMessage(req, temp);
|
||||||
|
handleDebug(temp, 2);
|
||||||
|
callJsp(req, res);
|
||||||
|
}
|
||||||
|
String payURL = pipe.getPaymentURL();
|
||||||
|
String payID = pipe.getPaymentId();
|
||||||
|
String userid = URLEncoder.encode(peReq.getUserName(), "UTF-8");
|
||||||
|
res.sendRedirect(payURL);
|
||||||
|
} catch (Exception e) {
|
||||||
|
handleDebug(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,75 @@
|
||||||
|
package com.ablia.bank.servlet.poste;
|
||||||
|
|
||||||
|
import com.ablia.bank.poste.PeResp;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
public abstract class PrepareOutPeSvlt extends PeSvlt {
|
||||||
|
protected static final String CMD_LAST_STEP = "res";
|
||||||
|
|
||||||
|
protected void processRequest(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
prepareOutput(req, res);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected abstract void preparePaymenResPage(HttpServletRequest paramHttpServletRequest, HttpServletResponse paramHttpServletResponse, PeResp paramPeResp);
|
||||||
|
|
||||||
|
protected void prepareOutput(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
if (getParm("PE_USE_IGFS").getNumeroLong() == 1L) {
|
||||||
|
prepareOutputIGFS(req, res);
|
||||||
|
} else {
|
||||||
|
try {
|
||||||
|
PeResp peResp = new PeResp();
|
||||||
|
fillObject(req, peResp);
|
||||||
|
if (peResp.getResult().equals("APPROVED")) {
|
||||||
|
setJspPageRelative(getJspOkPage(req, res), req);
|
||||||
|
forceMessage(req, "L'ordine è stato pagato regolarmente.");
|
||||||
|
} else {
|
||||||
|
forceMessage(req,
|
||||||
|
"ERRORE POSTECOMMERCE!. Il pagamento non è andato a buon fine.");
|
||||||
|
setJspPageRelative(getJspKoPage(req, res), req);
|
||||||
|
}
|
||||||
|
if (!peResp.getTrackid().isEmpty())
|
||||||
|
peResp.setId_ordine(Long.valueOf(peResp.getTrackid())
|
||||||
|
.longValue());
|
||||||
|
req.setAttribute("peResp", peResp);
|
||||||
|
preparePaymenResPage(req, res, peResp);
|
||||||
|
callJsp(req, res);
|
||||||
|
} catch (Exception e) {
|
||||||
|
setJspPageRelative(getJspErrorPage(req, res), req);
|
||||||
|
String temp = "ERRORE!!Post Ecommerce! Risposta non valida: ";
|
||||||
|
sendMessage(req, temp);
|
||||||
|
handleDebug(temp, 2);
|
||||||
|
preparePaymenResPage(req, res, null);
|
||||||
|
callJsp(req, res);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void prepareOutputIGFS(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
try {
|
||||||
|
PeResp peResp = new PeResp();
|
||||||
|
fillObject(req, peResp);
|
||||||
|
if (peResp.getResult().equals("APPROVED")) {
|
||||||
|
setJspPageRelative(getJspOkPage(req, res), req);
|
||||||
|
forceMessage(req, "L'ordine è stato pagato regolarmente.");
|
||||||
|
} else {
|
||||||
|
forceMessage(req,
|
||||||
|
"ERRORE POSTECOMMERCE!. Il pagamento non è andato a buon fine.");
|
||||||
|
setJspPageRelative(getJspKoPage(req, res), req);
|
||||||
|
}
|
||||||
|
if (!peResp.getTrackid().isEmpty())
|
||||||
|
peResp.setId_ordine(Long.valueOf(peResp.getTrackid())
|
||||||
|
.longValue());
|
||||||
|
req.setAttribute("peResp", peResp);
|
||||||
|
preparePaymenResPage(req, res, peResp);
|
||||||
|
callJsp(req, res);
|
||||||
|
} catch (Exception e) {
|
||||||
|
setJspPageRelative(getJspErrorPage(req, res), req);
|
||||||
|
String temp = "ERRORE!!Post Ecommerce! Risposta non valida: ";
|
||||||
|
sendMessage(req, temp);
|
||||||
|
handleDebug(temp, 2);
|
||||||
|
preparePaymenResPage(req, res, null);
|
||||||
|
callJsp(req, res);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,38 @@
|
||||||
|
package com.ablia.bank.servlet.poste2019;
|
||||||
|
|
||||||
|
import com.ablia.bank.poste2019.PosteRes;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
public abstract class GetPosteResponseMESvlt extends PosteSvlt {
|
||||||
|
protected abstract void preparePaymenResPage(HttpServletRequest paramHttpServletRequest, HttpServletResponse paramHttpServletResponse, PosteRes paramPosteRes);
|
||||||
|
|
||||||
|
protected abstract void recordOrder(HttpServletRequest paramHttpServletRequest, HttpServletResponse paramHttpServletResponse, PosteRes paramPosteRes);
|
||||||
|
|
||||||
|
protected void getResponse(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
try {
|
||||||
|
PosteRes posteRes = new PosteRes();
|
||||||
|
fillObject(req, posteRes);
|
||||||
|
if (posteRes.getESITO().equals("00")) {
|
||||||
|
setJspPageRelative(getJspOkPage(req, res), req);
|
||||||
|
recordOrder(req, res, posteRes);
|
||||||
|
} else {
|
||||||
|
setJspPageRelative(getJspKoPage(req, res), req);
|
||||||
|
}
|
||||||
|
req.setAttribute("KCResp", posteRes);
|
||||||
|
preparePaymenResPage(req, res, posteRes);
|
||||||
|
callJsp(req, res);
|
||||||
|
} catch (Exception e) {
|
||||||
|
setJspPageRelative(getJspErrorPage(req, res), req);
|
||||||
|
String temp = "ERRORE!!Key Client! Risposta non valida: ";
|
||||||
|
sendMessage(req, temp);
|
||||||
|
handleDebug(temp, 2);
|
||||||
|
preparePaymenResPage(req, res, null);
|
||||||
|
callJsp(req, res);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void processRequest(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
getResponse(req, res);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,38 @@
|
||||||
|
package com.ablia.bank.servlet.poste2019;
|
||||||
|
|
||||||
|
import com.ablia.bank.poste2019.PosteRes;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
public abstract class GetPosteResponseSvlt extends PosteSvlt {
|
||||||
|
protected abstract void preparePaymenResPage(HttpServletRequest paramHttpServletRequest, HttpServletResponse paramHttpServletResponse, PosteRes paramPosteRes);
|
||||||
|
|
||||||
|
protected abstract void recordOrder(HttpServletRequest paramHttpServletRequest, HttpServletResponse paramHttpServletResponse, PosteRes paramPosteRes);
|
||||||
|
|
||||||
|
protected void getResponse(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
try {
|
||||||
|
PosteRes posteRes = new PosteRes();
|
||||||
|
fillObject(req, posteRes);
|
||||||
|
if (posteRes.getESITO().equals("00")) {
|
||||||
|
setJspPageRelative(getJspOkPage(req, res), req);
|
||||||
|
recordOrder(req, res, posteRes);
|
||||||
|
} else {
|
||||||
|
setJspPageRelative(getJspKoPage(req, res), req);
|
||||||
|
}
|
||||||
|
req.setAttribute("KCResp", posteRes);
|
||||||
|
preparePaymenResPage(req, res, posteRes);
|
||||||
|
callJsp(req, res);
|
||||||
|
} catch (Exception e) {
|
||||||
|
setJspPageRelative(getJspErrorPage(req, res), req);
|
||||||
|
String temp = "ERRORE!!Key Client! Risposta non valida: ";
|
||||||
|
sendMessage(req, temp);
|
||||||
|
handleDebug(temp, 2);
|
||||||
|
preparePaymenResPage(req, res, null);
|
||||||
|
callJsp(req, res);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void processRequest(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
getResponse(req, res);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,113 @@
|
||||||
|
package com.ablia.bank.servlet.poste2019;
|
||||||
|
|
||||||
|
import com.ablia.bank.infogroup.ShopnetResp;
|
||||||
|
import com.ablia.bank.poste2019.PosteReq;
|
||||||
|
import com.ablia.db.ApplParmFull;
|
||||||
|
import com.ablia.servlet.AcServlet;
|
||||||
|
import javax.servlet.RequestDispatcher;
|
||||||
|
import javax.servlet.ServletRequest;
|
||||||
|
import javax.servlet.ServletResponse;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
public class PosteSvlt extends AcServlet {
|
||||||
|
protected static final String BEAN_KC_RES = "KCResp";
|
||||||
|
|
||||||
|
protected static final String CMD_GET_RES = "res";
|
||||||
|
|
||||||
|
protected static final String CMD_SEND_REQ = "send";
|
||||||
|
|
||||||
|
protected final void callJsp(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
setJspPageRelative(getJspOkPage(req, res), req);
|
||||||
|
try {
|
||||||
|
RequestDispatcher rd = getServletContext().getRequestDispatcher(getJspPage(req));
|
||||||
|
rd.forward((ServletRequest)req, (ServletResponse)res);
|
||||||
|
} catch (Exception e) {
|
||||||
|
handleDebug(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void getResponse(HttpServletRequest req, HttpServletResponse res) {}
|
||||||
|
|
||||||
|
protected String getJspErrorPage(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
String temp = getParm("KC_PAY_OK").getTesto();
|
||||||
|
if (temp.isEmpty())
|
||||||
|
return getJspKoPage(req, res);
|
||||||
|
return temp;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected String getJspOkPage(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
String temp = getParm("KC_PAY_OK").getTesto();
|
||||||
|
if (temp.isEmpty())
|
||||||
|
return "payRes.jsp";
|
||||||
|
return temp;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected String getJspKoPage(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
String temp = getParm("KC_PAY_OK").getTesto();
|
||||||
|
if (temp.isEmpty())
|
||||||
|
return "payRes.jsp";
|
||||||
|
return temp;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void processRequest(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
String cmd = getCmd(req).toLowerCase();
|
||||||
|
try {
|
||||||
|
if (cmd.equals("send")) {
|
||||||
|
sendRequest(req, res);
|
||||||
|
} else if (cmd.equals("res")) {
|
||||||
|
getResponse(req, res);
|
||||||
|
} else {
|
||||||
|
sendRequest(req, res);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
handleDebug(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected boolean isSecureServlet(HttpServletRequest req) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void payKoUpdateOrder(HttpServletRequest req, HttpServletResponse res, ShopnetResp snRes) {}
|
||||||
|
|
||||||
|
protected void sendRequest(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
try {
|
||||||
|
String theUrl;
|
||||||
|
ApplParmFull apFull = getApFull(req);
|
||||||
|
PosteReq sendReq = new PosteReq(apFull);
|
||||||
|
fillObject(req, sendReq);
|
||||||
|
if (getParm("TEST").getNumeroLong() == 1L) {
|
||||||
|
theUrl = sendReq.getTestRequestUrl();
|
||||||
|
} else {
|
||||||
|
theUrl = sendReq.getTestRequestUrl();
|
||||||
|
}
|
||||||
|
if (!theUrl.equals("")) {
|
||||||
|
res.sendRedirect(theUrl);
|
||||||
|
} else {
|
||||||
|
setJspPageRelative(getJspErrorPage(req, res), req);
|
||||||
|
String temp = "ERRORE!!POSTE Svlt! Impossibile creare url di richiesta!";
|
||||||
|
sendMessage(req, temp);
|
||||||
|
getResponse(req, res);
|
||||||
|
handleDebug(temp, 2);
|
||||||
|
callJsp(req, res);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
handleDebug(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected String getUrlResponse(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
String temp = getParm("KC_URL_RESPONSE").getTesto();
|
||||||
|
if (temp.isEmpty())
|
||||||
|
return "RicevutaKC.abl";
|
||||||
|
return temp;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected String getUrlResponseNull(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
String temp = getParm("KC_URL_RESPONSE_NULL").getTesto();
|
||||||
|
if (temp.isEmpty())
|
||||||
|
return "RicevutaKC.abl";
|
||||||
|
return temp;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,47 @@
|
||||||
|
package com.ablia.bank.servlet.sella;
|
||||||
|
|
||||||
|
import com.ablia.bank.sella.GestPayCrypt;
|
||||||
|
import com.ablia.bank.sella.SellaResp;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
public abstract class GetSellaResponseSvlt extends SellaSvlt {
|
||||||
|
protected void processRequest(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
getResponse(req, res);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void getResponse(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
try {
|
||||||
|
GestPayCrypt objCrypt = new GestPayCrypt();
|
||||||
|
String a = req.getParameter("a");
|
||||||
|
String b = req.getParameter("b");
|
||||||
|
a = a.trim();
|
||||||
|
b = b.trim();
|
||||||
|
GestPayCrypt objdeCrypt = new GestPayCrypt();
|
||||||
|
objdeCrypt.setShopLogin(a);
|
||||||
|
objdeCrypt.setEncryptedString(b);
|
||||||
|
objdeCrypt.Decrypt();
|
||||||
|
SellaResp sellaRes = new SellaResp(objdeCrypt);
|
||||||
|
if (sellaRes.getMyerrorcode().equals("0")) {
|
||||||
|
setJspPageRelative(getJspOkPage(req, res), req);
|
||||||
|
recordOrder(req, res, sellaRes);
|
||||||
|
} else {
|
||||||
|
setJspPageRelative(getJspKoPage(req, res), req);
|
||||||
|
}
|
||||||
|
req.setAttribute("sellaResp", sellaRes);
|
||||||
|
preparePaymenResPage(req, res, sellaRes);
|
||||||
|
callJsp(req, res);
|
||||||
|
} catch (Exception e) {
|
||||||
|
setJspPageRelative(getJspErrorPage(req, res), req);
|
||||||
|
String temp = "ERRORE!!GestPay Error! Risposta non valida: ";
|
||||||
|
sendMessage(req, temp);
|
||||||
|
handleDebug(temp, 2);
|
||||||
|
preparePaymenResPage(req, res, null);
|
||||||
|
callJsp(req, res);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected abstract void preparePaymenResPage(HttpServletRequest paramHttpServletRequest, HttpServletResponse paramHttpServletResponse, SellaResp paramSellaResp);
|
||||||
|
|
||||||
|
protected abstract void recordOrder(HttpServletRequest paramHttpServletRequest, HttpServletResponse paramHttpServletResponse, SellaResp paramSellaResp);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,118 @@
|
||||||
|
package com.ablia.bank.servlet.sella;
|
||||||
|
|
||||||
|
import com.ablia.bank.sella.GestPayCrypt;
|
||||||
|
import com.ablia.bank.sella.SellaReq;
|
||||||
|
import com.ablia.servlet.AcServlet;
|
||||||
|
import javax.servlet.RequestDispatcher;
|
||||||
|
import javax.servlet.ServletRequest;
|
||||||
|
import javax.servlet.ServletResponse;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
public class SellaSvlt extends AcServlet {
|
||||||
|
protected static final String CMD_SEND_REQ = "send";
|
||||||
|
|
||||||
|
protected static final String CMD_GET_RES = "res";
|
||||||
|
|
||||||
|
protected static final String BEAN_SELLA_RES = "sellaResp";
|
||||||
|
|
||||||
|
protected final void callJsp(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
setJspPageRelative(getJspOkPage(req, res), req);
|
||||||
|
try {
|
||||||
|
RequestDispatcher rd = getServletContext().getRequestDispatcher(getJspPage(req));
|
||||||
|
rd.forward((ServletRequest)req, (ServletResponse)res);
|
||||||
|
} catch (Exception e) {
|
||||||
|
handleDebug(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void sendRequest(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
try {
|
||||||
|
GestPayCrypt objCrypt = new GestPayCrypt();
|
||||||
|
SellaReq sellareq = new SellaReq();
|
||||||
|
fillObject(req, sellareq);
|
||||||
|
objCrypt.setShopLogin(getCodiceEsercente(req));
|
||||||
|
objCrypt.setCurrency(sellareq.getMycurrency());
|
||||||
|
if (getParm("TEST").getNumeroLong() == 1L) {
|
||||||
|
objCrypt.setAmount("0.12");
|
||||||
|
} else {
|
||||||
|
objCrypt.setAmount(sellareq.getMyamount());
|
||||||
|
}
|
||||||
|
objCrypt.setShopTransactionID(sellareq.getMyshoptransactionID());
|
||||||
|
if (getParm("SELLA_FULL").isTrue()) {
|
||||||
|
if (!sellareq.getMybuyername().isEmpty())
|
||||||
|
objCrypt.setBuyerName(sellareq.getMybuyername());
|
||||||
|
if (!sellareq.getMybuyeremail().isEmpty())
|
||||||
|
objCrypt.setBuyerEmail(sellareq.getMybuyeremail());
|
||||||
|
if (!sellareq.getMylanguage().isEmpty())
|
||||||
|
objCrypt.setLanguage(sellareq.getMylanguage());
|
||||||
|
if (!sellareq.getMycustominfo().isEmpty())
|
||||||
|
objCrypt.setCustomInfo(sellareq.getMycustominfo());
|
||||||
|
}
|
||||||
|
String tempX = "cod eserc.: " + objCrypt.getShopLogin() + " curr:" + objCrypt.getCurrency() + " amount:" + objCrypt.getAmount() +
|
||||||
|
" shoptranid:" + objCrypt.getShopTransactionID() + " buyername:" + objCrypt.getBuyerName() + " buyeremail:" +
|
||||||
|
objCrypt.getBuyerEmail() + " lang:" + sellareq.getMylanguage() + " custinfo:" + objCrypt.getCustomInfo();
|
||||||
|
System.out.println("SELLA:SENDREQUEST ENCRYPT: " + tempX);
|
||||||
|
objCrypt.Encrypt();
|
||||||
|
String b = "";
|
||||||
|
String a = "";
|
||||||
|
if (objCrypt.getErrorCode().equals("0")) {
|
||||||
|
String sellaSite;
|
||||||
|
b = objCrypt.getEncryptedString();
|
||||||
|
a = objCrypt.getShopLogin();
|
||||||
|
if (getParm("TEST").getNumeroLong() == 1L) {
|
||||||
|
sellaSite = "testecomm.sella.it";
|
||||||
|
} else {
|
||||||
|
sellaSite = "ecomm.sella.it";
|
||||||
|
}
|
||||||
|
String requestPage = "https://" + sellaSite + "/gestpay/pagam.asp?a=" + a + "&b=" + b;
|
||||||
|
res.sendRedirect(requestPage);
|
||||||
|
} else {
|
||||||
|
setJspPageRelative(getJspErrorPage(req, res), req);
|
||||||
|
String temp = "ERRORE!!GestPay Error! Code: " + objCrypt.getErrorCode() + ": " + objCrypt.getErrorDescription();
|
||||||
|
sendMessage(req, temp);
|
||||||
|
handleDebug(temp, 2);
|
||||||
|
callJsp(req, res);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
handleDebug(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected String getCodiceEsercente(HttpServletRequest req) {
|
||||||
|
return getParm("COD_ESER_SELLA").getTesto();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected String getJspErrorPage(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
String temp = getParm("SELLA_OK").getTesto();
|
||||||
|
if (temp.isEmpty())
|
||||||
|
return getJspKoPage(req, res);
|
||||||
|
return temp;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected String getJspOkPage(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
String temp = getParm("SELLA_OK").getTesto();
|
||||||
|
if (temp.isEmpty())
|
||||||
|
return "payRes.jsp";
|
||||||
|
return temp;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected String getJspKoPage(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
String temp = getParm("SELLA_OK").getTesto();
|
||||||
|
if (temp.isEmpty())
|
||||||
|
return "payRes.jsp";
|
||||||
|
return temp;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void processRequest(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
try {
|
||||||
|
sendRequest(req, res);
|
||||||
|
} catch (Exception e) {
|
||||||
|
handleDebug(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected boolean isSecureServlet(HttpServletRequest req) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,176 @@
|
||||||
|
package com.ablia.bank.servlet.setefi;
|
||||||
|
|
||||||
|
import com.ablia.bank.setefi.SetefiReq;
|
||||||
|
import com.ablia.bank.setefi.SetefiResp;
|
||||||
|
import com.ablia.db.ResParm;
|
||||||
|
import com.ablia.servlet.AcServlet;
|
||||||
|
import java.io.BufferedReader;
|
||||||
|
import java.io.DataOutputStream;
|
||||||
|
import java.io.InputStreamReader;
|
||||||
|
import java.net.HttpURLConnection;
|
||||||
|
import java.net.URL;
|
||||||
|
import javax.servlet.RequestDispatcher;
|
||||||
|
import javax.servlet.ServletRequest;
|
||||||
|
import javax.servlet.ServletResponse;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
public abstract class MonetaOnlineSvlt extends AcServlet {
|
||||||
|
protected static final String CMD_GET_RES = "res";
|
||||||
|
|
||||||
|
protected static final String CMD_SEND_REQ = "send";
|
||||||
|
|
||||||
|
protected final void callJsp(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
setJspPageRelative(getResponsePage(req, res), req);
|
||||||
|
try {
|
||||||
|
RequestDispatcher rd = getServletContext()
|
||||||
|
.getRequestDispatcher(getJspPage(req));
|
||||||
|
rd.forward((ServletRequest)req, (ServletResponse)res);
|
||||||
|
} catch (Exception e) {
|
||||||
|
handleDebug(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected String getResponsePage(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
String temp = getParm("MONETAONLINE_RESPONSE_PAGE")
|
||||||
|
.getTesto();
|
||||||
|
if (temp.isEmpty())
|
||||||
|
return "http://www.miodominio.it/xxx_response-#-@.html";
|
||||||
|
return temp;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void processRequest(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
String cmd = getCmd(req).toLowerCase();
|
||||||
|
if (cmd.equals("send")) {
|
||||||
|
sendRequest(req, res);
|
||||||
|
} else if (getCmd(req).equals("risultato") ||
|
||||||
|
getCmd(req).equals("result")) {
|
||||||
|
preparePaymentResultPage(req, res);
|
||||||
|
setJspPage(getResponseJsp(req, res), req);
|
||||||
|
callJsp(req, res);
|
||||||
|
} else {
|
||||||
|
getResponse(req, res);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected boolean isSecureServlet(HttpServletRequest req) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void sendRequest(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
try {
|
||||||
|
boolean testMode = (getParm("TEST").getNumeroInt() == 1);
|
||||||
|
SetefiReq setefiReq = new SetefiReq();
|
||||||
|
fillObject(req, setefiReq);
|
||||||
|
String theUrl = "https://test.monetaonline.it/monetaweb/hosted/init/http";
|
||||||
|
if (testMode) {
|
||||||
|
theUrl = "https://test.monetaonline.it/monetaweb/hosted/init/http";
|
||||||
|
setefiReq.setId(getParm("MONETAONLINE_ID").getTesto());
|
||||||
|
setefiReq.setPassword(getParm("MONETAONLINE_PASSWORD")
|
||||||
|
.getTesto());
|
||||||
|
} else {
|
||||||
|
setefiReq.setId("99999999");
|
||||||
|
setefiReq.setPassword("99999999");
|
||||||
|
}
|
||||||
|
setefiReq.setResponseurl(getResponseUrl(req, res));
|
||||||
|
String rawData = setefiReq.getRawdata();
|
||||||
|
if (!rawData.equals("")) {
|
||||||
|
String type = "application/x-www-form-urlencoded";
|
||||||
|
String encodedData = rawData;
|
||||||
|
URL u = new URL("https://test.monetaonline.it/monetaweb/hosted/init/http");
|
||||||
|
HttpURLConnection conn = (HttpURLConnection)u.openConnection();
|
||||||
|
conn.setDoInput(true);
|
||||||
|
conn.setDoOutput(true);
|
||||||
|
conn.setUseCaches(false);
|
||||||
|
conn.setRequestMethod("POST");
|
||||||
|
conn.setRequestProperty("Content-Type", type);
|
||||||
|
conn.setRequestProperty("Content-Length",
|
||||||
|
String.valueOf(encodedData.length()));
|
||||||
|
conn.connect();
|
||||||
|
DataOutputStream os = new DataOutputStream(
|
||||||
|
conn.getOutputStream());
|
||||||
|
os.writeBytes(encodedData);
|
||||||
|
os.flush();
|
||||||
|
os.close();
|
||||||
|
BufferedReader read = new BufferedReader(new InputStreamReader(
|
||||||
|
conn.getInputStream()));
|
||||||
|
String line = read.readLine();
|
||||||
|
String html = "";
|
||||||
|
while (line != null) {
|
||||||
|
html = String.valueOf(html) + line;
|
||||||
|
line = read.readLine();
|
||||||
|
}
|
||||||
|
int idx2dot = html.indexOf(":");
|
||||||
|
String paymentId = html.substring(0, html.indexOf(":"));
|
||||||
|
String url = html.substring(idx2dot + 1, html.length());
|
||||||
|
String paymentUrl = String.valueOf(url) + "?paymentid=" + paymentId;
|
||||||
|
System.out.println(paymentUrl);
|
||||||
|
ResParm rp = recordPaymentId(req, res, paymentId);
|
||||||
|
if (rp.getStatus()) {
|
||||||
|
res.sendRedirect(paymentUrl);
|
||||||
|
} else {
|
||||||
|
setJspPageRelative(getResponsePage(req, res), req);
|
||||||
|
sendMessage(req, rp.getErrMsg());
|
||||||
|
getResponse(req, res);
|
||||||
|
callJsp(req, res);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
setJspPageRelative(getResponsePage(req, res), req);
|
||||||
|
String temp = "ERRORE!!MonetaOnline Svlt! Impossibile creare url di richiesta!";
|
||||||
|
sendMessage(req, temp);
|
||||||
|
getResponse(req, res);
|
||||||
|
handleDebug(temp, 2);
|
||||||
|
callJsp(req, res);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
handleDebug(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected String getResponseJsp(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
String temp = getParm("MONETAONLINE_RESPONSE_JSP").getTesto();
|
||||||
|
if (temp.isEmpty())
|
||||||
|
return "/payResMO.jsp";
|
||||||
|
return temp;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected abstract ResParm recordPaymentId(HttpServletRequest paramHttpServletRequest, HttpServletResponse paramHttpServletResponse, String paramString);
|
||||||
|
|
||||||
|
protected String getResponseUrl(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
String temp = getParm("MONETAONLINE_RESPONSE_URL").getTesto();
|
||||||
|
if (temp.isEmpty())
|
||||||
|
return "http://www.miodoninio.it/RicevutaMO.abl";
|
||||||
|
return temp;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected abstract void preparePaymentResultPage(HttpServletRequest paramHttpServletRequest, HttpServletResponse paramHttpServletResponse);
|
||||||
|
|
||||||
|
protected abstract void checkPaymentId(HttpServletRequest paramHttpServletRequest, HttpServletResponse paramHttpServletResponse, SetefiResp paramSetefiResp);
|
||||||
|
|
||||||
|
protected void getResponse(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
try {
|
||||||
|
req.setAttribute("responsecode", "000");
|
||||||
|
req.setAttribute("result", "Accepted");
|
||||||
|
req.setAttribute("trackid", "6");
|
||||||
|
req.setAttribute("paymentid", "316061656072333389");
|
||||||
|
req.setAttribute("tranid", "316061656072333389");
|
||||||
|
SetefiResp setefiResp = new SetefiResp();
|
||||||
|
fillObject(req, setefiResp);
|
||||||
|
checkPaymentId(req, res, setefiResp);
|
||||||
|
String theUrl = getResponsePage(req, res).replace("#",
|
||||||
|
setefiResp.getTrackid());
|
||||||
|
theUrl = theUrl.replace("@",
|
||||||
|
String.valueOf(setefiResp.getPaymentid()));
|
||||||
|
System.out.println("redirect url :" + theUrl);
|
||||||
|
sendHtmlMsgResponse(req, res, "redirect=" + theUrl);
|
||||||
|
} catch (Exception e) {
|
||||||
|
setJspPageRelative(getResponsePage(req, res), req);
|
||||||
|
String temp = "ERRORE!!MONETAONLINE ! Risposta non valida: ";
|
||||||
|
sendMessage(req, temp);
|
||||||
|
handleDebug(temp, 2);
|
||||||
|
setJspPage(getResponsePage(req, res), req);
|
||||||
|
callJsp(req, res);
|
||||||
|
callJsp(req, res);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,55 @@
|
||||||
|
package com.ablia.bank.servlet.xpay;
|
||||||
|
|
||||||
|
import com.ablia.bank.xpay.XpayResp;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
public abstract class GetXpayResponseSvlt extends XpaySvlt {
|
||||||
|
protected abstract void preparePaymenResPage(HttpServletRequest paramHttpServletRequest, HttpServletResponse paramHttpServletResponse, XpayResp paramXpayResp);
|
||||||
|
|
||||||
|
protected abstract void recordOrder(HttpServletRequest paramHttpServletRequest, HttpServletResponse paramHttpServletResponse, XpayResp paramXpayResp);
|
||||||
|
|
||||||
|
protected void getResponse(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
try {
|
||||||
|
XpayResp xpRes = new XpayResp(getApFull(req));
|
||||||
|
fillObject(req, xpRes);
|
||||||
|
xpRes.setBRAND(getRequestParameter(req, "$BRAND"));
|
||||||
|
if (xpRes.isMacRitornoOk()) {
|
||||||
|
if (xpRes.getEsito() != null && xpRes.getEsito().equals("OK")) {
|
||||||
|
setJspPageRelative(getJspOkPage(req, res), req);
|
||||||
|
recordOrder(req, res, xpRes);
|
||||||
|
req.setAttribute("XPAYResp", xpRes);
|
||||||
|
preparePaymenResPage(req, res, xpRes);
|
||||||
|
} else {
|
||||||
|
preparePaymenResPage(req, res, xpRes);
|
||||||
|
resetId_documentoXpay(req, res, xpRes);
|
||||||
|
setJspPageRelative(getJspKoPage(req, res), req);
|
||||||
|
}
|
||||||
|
callJsp(req, res);
|
||||||
|
} else {
|
||||||
|
xpRes.setEsito("KO");
|
||||||
|
preparePaymenResPage(req, res, xpRes);
|
||||||
|
resetId_documentoXpay(req, res, xpRes);
|
||||||
|
setJspPageRelative(getJspKoPage(req, res), req);
|
||||||
|
sendMessage(req, "ATTENZIONE!! Codice mac di controllo errato.");
|
||||||
|
req.setAttribute("XPAYResp", xpRes);
|
||||||
|
callJsp(req, res);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
setJspPageRelative(getJspErrorPage(req, res), req);
|
||||||
|
String temp = "ERRORE!!XPAY ! Risposta non valida: ";
|
||||||
|
sendMessage(req, temp);
|
||||||
|
handleDebug(temp, 2);
|
||||||
|
preparePaymenResPage(req, res, null);
|
||||||
|
callJsp(req, res);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void processRequest(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
getResponse(req, res);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void prepareSendRequest(HttpServletRequest req, HttpServletResponse res) {}
|
||||||
|
|
||||||
|
protected abstract void resetId_documentoXpay(HttpServletRequest paramHttpServletRequest, HttpServletResponse paramHttpServletResponse, XpayResp paramXpayResp);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,115 @@
|
||||||
|
package com.ablia.bank.servlet.xpay;
|
||||||
|
|
||||||
|
import com.ablia.bank.infogroup.ShopnetResp;
|
||||||
|
import com.ablia.bank.xpay.XpayReq;
|
||||||
|
import com.ablia.servlet.AcServlet;
|
||||||
|
import javax.servlet.RequestDispatcher;
|
||||||
|
import javax.servlet.ServletRequest;
|
||||||
|
import javax.servlet.ServletResponse;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
public abstract class XpaySvlt extends AcServlet {
|
||||||
|
protected static final String BEAN_XPAY_RES = "XPAYResp";
|
||||||
|
|
||||||
|
protected static final String CMD_GET_RES = "res";
|
||||||
|
|
||||||
|
protected static final String CMD_SEND_REQ = "send";
|
||||||
|
|
||||||
|
protected final void callJsp(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
setJspPageRelative(getJspOkPage(req, res), req);
|
||||||
|
try {
|
||||||
|
RequestDispatcher rd = getServletContext().getRequestDispatcher(getJspPage(req));
|
||||||
|
rd.forward((ServletRequest)req, (ServletResponse)res);
|
||||||
|
} catch (Exception e) {
|
||||||
|
handleDebug(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void getResponse(HttpServletRequest req, HttpServletResponse res) {}
|
||||||
|
|
||||||
|
protected String getJspErrorPage(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
String temp = getParm("XPAY_PAY_OK").getTesto();
|
||||||
|
if (temp.isEmpty())
|
||||||
|
return getJspKoPage(req, res);
|
||||||
|
return temp;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected String getJspOkPage(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
String temp = getParm("XPAY_PAY_OK").getTesto();
|
||||||
|
if (temp.isEmpty())
|
||||||
|
return "payRes.jsp";
|
||||||
|
return temp;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected String getJspKoPage(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
String temp = getParm("XPAY_PAY_OK").getTesto();
|
||||||
|
if (temp.isEmpty())
|
||||||
|
return "payRes.jsp";
|
||||||
|
return temp;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void processRequest(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
String cmd = getCmd(req).toLowerCase();
|
||||||
|
try {
|
||||||
|
if (cmd.equals("send")) {
|
||||||
|
sendRequest(req, res);
|
||||||
|
} else if (cmd.equals("res")) {
|
||||||
|
getResponse(req, res);
|
||||||
|
} else {
|
||||||
|
sendRequest(req, res);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
handleDebug(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected boolean isSecureServlet(HttpServletRequest req) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void payKoUpdateOrder(HttpServletRequest req, HttpServletResponse res, ShopnetResp snRes) {}
|
||||||
|
|
||||||
|
protected void sendRequest(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
try {
|
||||||
|
String theUrl;
|
||||||
|
prepareSendRequest(req, res);
|
||||||
|
XpayReq xpayReq = new XpayReq(getApFull(req));
|
||||||
|
fillObject(req, xpayReq);
|
||||||
|
if (getParm("TEST").isTrue()) {
|
||||||
|
theUrl = xpayReq.getTestRequestUrl();
|
||||||
|
} else {
|
||||||
|
theUrl = xpayReq.getRequestUrl();
|
||||||
|
}
|
||||||
|
System.out.println(theUrl);
|
||||||
|
if (!theUrl.equals("")) {
|
||||||
|
res.sendRedirect(theUrl);
|
||||||
|
} else {
|
||||||
|
setJspPageRelative(getJspErrorPage(req, res), req);
|
||||||
|
String temp = "ERRORE!!XPAY Svlt! Impossibile creare url di richiesta!";
|
||||||
|
sendMessage(req, temp);
|
||||||
|
getResponse(req, res);
|
||||||
|
handleDebug(temp, 2);
|
||||||
|
callJsp(req, res);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
handleDebug(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected String getUrlResponse(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
String temp = getParm("XPAY_URL_RESPONSE").getTesto();
|
||||||
|
if (temp.isEmpty())
|
||||||
|
return "RicevutaKC.abl";
|
||||||
|
return temp;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected String getUrlResponseNull(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
String temp = getParm("XPAY_URL_RESPONSE_NULL").getTesto();
|
||||||
|
if (temp.isEmpty())
|
||||||
|
return "RicevutaKC.abl";
|
||||||
|
return temp;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected abstract void prepareSendRequest(HttpServletRequest paramHttpServletRequest, HttpServletResponse paramHttpServletResponse);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,256 @@
|
||||||
|
package com.ablia.bank.setefi;
|
||||||
|
|
||||||
|
import com.ablia.bank._BankAdapter;
|
||||||
|
import com.ablia.common.Parm;
|
||||||
|
import com.ablia.db.ApplParmFull;
|
||||||
|
|
||||||
|
public class SetefiReq extends _BankAdapter {
|
||||||
|
public static final String LANG_CODE_IT = "ITA";
|
||||||
|
|
||||||
|
public static final String LANG_CODE_EN = "USA";
|
||||||
|
|
||||||
|
public static final String LANG_CODE_ES = "SPA";
|
||||||
|
|
||||||
|
public static final String LANG_CODE_FR = "FRA";
|
||||||
|
|
||||||
|
public static final String LANG_CODE_DE = "DEU";
|
||||||
|
|
||||||
|
public static final String DIV_CODE_EURO = "978";
|
||||||
|
|
||||||
|
public static final String P_MONETAONLINE_ID = "MONETAONLINE_ID";
|
||||||
|
|
||||||
|
public static final String DEFAULT_RESPONSE_URL = "MONETAONLINE_ID";
|
||||||
|
|
||||||
|
public static final String DEFAULT_RESPONSE_PAGE = "payResMO.jsp";
|
||||||
|
|
||||||
|
public static final String DIV_CODE_DOLLARL_HK = "103";
|
||||||
|
|
||||||
|
public static final String TEST_URL = "https://test.monetaonline.it/monetaweb/hosted/init/http";
|
||||||
|
|
||||||
|
public static final String REQ_URL = "https://test.monetaonline.it/monetaweb/hosted/init/http";
|
||||||
|
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
private String trackid;
|
||||||
|
|
||||||
|
private String titolareCarta;
|
||||||
|
|
||||||
|
private String email;
|
||||||
|
|
||||||
|
private String lang;
|
||||||
|
|
||||||
|
private String responseurl;
|
||||||
|
|
||||||
|
private double amt;
|
||||||
|
|
||||||
|
private String password;
|
||||||
|
|
||||||
|
private String descPagamento;
|
||||||
|
|
||||||
|
private String divisa;
|
||||||
|
|
||||||
|
public static final String BEAN_MO_RES = "MOResp";
|
||||||
|
|
||||||
|
public static final String P_MONETAONLINE_RESPONSE_JSP = "MONETAONLINE_RESPONSE_JSP";
|
||||||
|
|
||||||
|
public static final String TEST_PASSWORD = "99999999";
|
||||||
|
|
||||||
|
public static final String TEST_ID = "99999999";
|
||||||
|
|
||||||
|
public static final String P_MONETAONLINE_RESPONSE_URL = "MONETAONLINE_RESPONSE_URL";
|
||||||
|
|
||||||
|
public static final String P_MONETAONLINE_PASSWORD = "MONETAONLINE_PASSWORD";
|
||||||
|
|
||||||
|
public static final String P_MONETAONLINE_RESPONSE_PAGE = "MONETAONLINE_RESPONSE_PAGE";
|
||||||
|
|
||||||
|
public static final String DIV_CODE_DOLLARI = "1";
|
||||||
|
|
||||||
|
public double getAmt() {
|
||||||
|
return this.amt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAmt(double myamount) {
|
||||||
|
this.amt = myamount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEmail() {
|
||||||
|
return (this.email == null) ? "" : this.email;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEmail(String mybuyeremail) {
|
||||||
|
this.email = mybuyeremail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTitolareCarta() {
|
||||||
|
return (this.titolareCarta == null) ? "" : this.titolareCarta;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTitolareCarta(String mybuyername) {
|
||||||
|
this.titolareCarta = mybuyername;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCurrencycode() {
|
||||||
|
if (getDivisa().toLowerCase().equals("eu"))
|
||||||
|
return "978";
|
||||||
|
return "978";
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescPagamento() {
|
||||||
|
return (this.descPagamento == null) ? "" : this.descPagamento;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDescPagamento(String mycustominfo) {
|
||||||
|
this.descPagamento = mycustominfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String getMylanguageCode() {
|
||||||
|
if (getLang().toLowerCase().equals("it"))
|
||||||
|
return "ITA";
|
||||||
|
if (getLang().toLowerCase().equals("en"))
|
||||||
|
return "USA";
|
||||||
|
if (getLang().toLowerCase().equals("es\t"))
|
||||||
|
return "SPA";
|
||||||
|
if (getLang().toLowerCase().equals("fr"))
|
||||||
|
return "FRA";
|
||||||
|
if (getLang().toLowerCase().equals("de"))
|
||||||
|
return "DEU";
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTrackid() {
|
||||||
|
return (this.trackid == null) ? "" : this.trackid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTrackid(String myshoptransactionID) {
|
||||||
|
this.trackid = myshoptransactionID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLang() {
|
||||||
|
return (this.lang == null) ? "" : this.lang;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLang(String lang) {
|
||||||
|
this.lang = lang;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void initApplicationParms(ApplParmFull ap) {
|
||||||
|
if (ap != null) {
|
||||||
|
String l_tipoParm = "MONETAONLINE";
|
||||||
|
Parm bean = new Parm(ap);
|
||||||
|
bean.findByCodice("MONETAONLINE_ID");
|
||||||
|
bean.setFlgAdmin(0L);
|
||||||
|
bean.setTipoParm(l_tipoParm);
|
||||||
|
bean.setCodice("MONETAONLINE_ID");
|
||||||
|
bean.setDescrizione("MONETAONLINE_ID");
|
||||||
|
bean.setFlgTipo(0L);
|
||||||
|
if (bean.getTesto().equals(""))
|
||||||
|
bean.setTesto("99999999");
|
||||||
|
bean.setNota("ID MONETAONLINE<BR>CODICE DI PROVA: 99999999");
|
||||||
|
bean.save();
|
||||||
|
bean.findByCodice("MONETAONLINE_PASSWORD");
|
||||||
|
bean.setFlgAdmin(0L);
|
||||||
|
bean.setTipoParm(l_tipoParm);
|
||||||
|
bean.setCodice("MONETAONLINE_PASSWORD");
|
||||||
|
bean.setDescrizione("MONETAONLINE_PASSWORD");
|
||||||
|
bean.setFlgTipo(0L);
|
||||||
|
if (bean.getTesto().equals(""))
|
||||||
|
bean.setTesto("99999999");
|
||||||
|
bean.setNota("PASSWORD MONETAONLINE<BR> PASSWORD DI PROVA: 99999999");
|
||||||
|
bean.save();
|
||||||
|
bean.findByCodice("MONETAONLINE_RESPONSE_URL");
|
||||||
|
bean.setFlgAdmin(0L);
|
||||||
|
bean.setTipoParm(l_tipoParm);
|
||||||
|
bean.setCodice("MONETAONLINE_RESPONSE_URL");
|
||||||
|
bean.setDescrizione("MONETAONLINE_RESPONSE_URL");
|
||||||
|
bean.setFlgTipo(0L);
|
||||||
|
if (bean.getTesto().equals(""))
|
||||||
|
bean.setTesto("http://www.nomedominio.it/PayMO.abl");
|
||||||
|
bean.setNota(
|
||||||
|
"QUALCOSA DEL TIPO http://www.nomedominio.it/PayMO.abl<br>E' l'url chiamata da setefi. Su moneta Online è sempre la stessa servlet!!");
|
||||||
|
bean.save();
|
||||||
|
bean.findByCodice("MONETAONLINE_RESPONSE_JSP");
|
||||||
|
bean.setFlgAdmin(0L);
|
||||||
|
bean.setTipoParm(l_tipoParm);
|
||||||
|
bean.setCodice("MONETAONLINE_RESPONSE_JSP");
|
||||||
|
bean.setDescrizione("MONETAONLINE_RESPONSE_JSP");
|
||||||
|
bean.setFlgTipo(0L);
|
||||||
|
if (bean.getTesto().equals(""))
|
||||||
|
bean.setTesto("/payResMO.jsp");
|
||||||
|
bean.setNota("QUALCOSA DEL TIPO <br>/payResMO.jsp.<br> E' la pagina jsp dove visualizziamo il risultato.");
|
||||||
|
bean.save();
|
||||||
|
bean.findByCodice("MONETAONLINE_RESPONSE_PAGE");
|
||||||
|
bean.setFlgAdmin(0L);
|
||||||
|
bean.setTipoParm(l_tipoParm);
|
||||||
|
bean.setCodice("MONETAONLINE_RESPONSE_PAGE");
|
||||||
|
bean.setDescrizione("MONETAONLINE_RESPONSE_PAGE");
|
||||||
|
bean.setFlgTipo(0L);
|
||||||
|
if (bean.getTesto().equals(""))
|
||||||
|
bean.setTesto("http://www.nomedominio.it/transazione_result-#-@.html");
|
||||||
|
bean.setNota(
|
||||||
|
"QUALCOSA DEL TIPO <br>http://www.nomedominio.it/xxx_result-#-@.html.<br> si userà una regola di rewrite rule dove # è il trackid mentre @ +è il paymentid<br>Esempio rewrite rule:<br>result,PayMO.abl,result,,@id_astaUtente@paymentid");
|
||||||
|
bean.save();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getId() {
|
||||||
|
return (this.id == null) ? "" : this.id.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(String id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPassword() {
|
||||||
|
return (this.password == null) ? "" : this.password.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPassword(String password) {
|
||||||
|
this.password = password;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getResponseurl() {
|
||||||
|
return (this.responseurl == null) ? "" : this.responseurl.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setResponseurl(String responseurl) {
|
||||||
|
this.responseurl = responseurl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRawdata() {
|
||||||
|
StringBuffer theUrl = new StringBuffer();
|
||||||
|
theUrl.append("id=");
|
||||||
|
theUrl.append(getId());
|
||||||
|
theUrl.append("&password=");
|
||||||
|
theUrl.append(getPassword());
|
||||||
|
theUrl.append("&action=4");
|
||||||
|
theUrl.append("&amt=");
|
||||||
|
theUrl.append(getAmt());
|
||||||
|
theUrl.append("¤cycode=");
|
||||||
|
theUrl.append(getCurrencycode());
|
||||||
|
theUrl.append("&langid=");
|
||||||
|
theUrl.append(getMylanguageCode());
|
||||||
|
theUrl.append("&responseurl=");
|
||||||
|
theUrl.append(getResponseurl());
|
||||||
|
theUrl.append("&errorurl=");
|
||||||
|
theUrl.append(getResponseurl());
|
||||||
|
theUrl.append("&trackid=");
|
||||||
|
theUrl.append(getTrackid());
|
||||||
|
if (!getDescPagamento().trim().isEmpty()) {
|
||||||
|
theUrl.append("&udf1=");
|
||||||
|
theUrl.append(getDescPagamento());
|
||||||
|
}
|
||||||
|
if (!getTitolareCarta().trim().isEmpty()) {
|
||||||
|
theUrl.append("&udf2=");
|
||||||
|
theUrl.append(String.valueOf(getTitolareCarta()) + ";" + getEmail());
|
||||||
|
}
|
||||||
|
return theUrl.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDivisa() {
|
||||||
|
return (this.divisa == null) ? "" : this.divisa.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDivisa(String divisa) {
|
||||||
|
this.divisa = divisa;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,115 @@
|
||||||
|
package com.ablia.bank.setefi;
|
||||||
|
|
||||||
|
import com.ablia.bank._BankAdapter;
|
||||||
|
|
||||||
|
public class SetefiResp extends _BankAdapter {
|
||||||
|
private String trackid;
|
||||||
|
|
||||||
|
private String paymentid;
|
||||||
|
|
||||||
|
private String udf3;
|
||||||
|
|
||||||
|
private String udf1;
|
||||||
|
|
||||||
|
private String result;
|
||||||
|
|
||||||
|
private String auth;
|
||||||
|
|
||||||
|
private long id_ordine;
|
||||||
|
|
||||||
|
private String responsecode;
|
||||||
|
|
||||||
|
private String tranid;
|
||||||
|
|
||||||
|
private String udf4;
|
||||||
|
|
||||||
|
private String udf2;
|
||||||
|
|
||||||
|
public String getResponsecode() {
|
||||||
|
return (this.responsecode == null) ? "" : this.responsecode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setResponsecode(String myalertcode) {
|
||||||
|
this.responsecode = myalertcode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTranid() {
|
||||||
|
return (this.tranid == null) ? "" : this.tranid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTranid(String myalertdescription) {
|
||||||
|
this.tranid = myalertdescription;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAuth() {
|
||||||
|
return (this.auth == null) ? "" : this.auth;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAuth(String myauthcode) {
|
||||||
|
this.auth = myauthcode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUdf2() {
|
||||||
|
return (this.udf2 == null) ? "" : this.udf2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUdf2(String mybuyeremail) {
|
||||||
|
this.udf2 = mybuyeremail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUdf3() {
|
||||||
|
return (this.udf3 == null) ? "" : this.udf3;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUdf3(String mybuyername) {
|
||||||
|
this.udf3 = mybuyername;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTrackid() {
|
||||||
|
return (this.trackid == null) ? "" : this.trackid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTrackid(String myshoplogin) {
|
||||||
|
this.trackid = myshoplogin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPaymentid() {
|
||||||
|
return this.paymentid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPaymentid(String myshoptrxID) {
|
||||||
|
this.paymentid = myshoptrxID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getResult() {
|
||||||
|
return (this.result == null) ? "" : this.result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setResult(String mytrxresult) {
|
||||||
|
this.result = mytrxresult;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getId_ordine() {
|
||||||
|
return this.id_ordine;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId_ordine(long id_ordine) {
|
||||||
|
this.id_ordine = id_ordine;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUdf1() {
|
||||||
|
return (this.udf1 == null) ? "" : this.udf1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUdf1(String udf1) {
|
||||||
|
this.udf1 = udf1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUdf4() {
|
||||||
|
return (this.udf4 == null) ? "" : this.udf4;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUdf4(String udf4) {
|
||||||
|
this.udf4 = udf4;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
Bank_02_00_121213
|
||||||
|
12-12-2013 aggiustato paypal. Ultima versione su iperaste
|
||||||
|
26-11-2013 aggiunto setefi
|
||||||
|
13-05-2013 aggiunto rate0 su consel
|
||||||
|
26-03-2013 aggiunto DESC su paypalreq
|
||||||
|
24-01-2013 xpay\n
|
||||||
|
14-12-2012 nuovo form consel\n
|
||||||
334
rus/WEB-INF/lib/abliaBank_src/com/ablia/bank/xpay/XpayReq.java
Normal file
334
rus/WEB-INF/lib/abliaBank_src/com/ablia/bank/xpay/XpayReq.java
Normal file
|
|
@ -0,0 +1,334 @@
|
||||||
|
package com.ablia.bank.xpay;
|
||||||
|
|
||||||
|
import com.ablia.bank._BankAdapter;
|
||||||
|
import com.ablia.common.Parm;
|
||||||
|
import com.ablia.db.ApplParmFull;
|
||||||
|
import com.ablia.reg.EcDc;
|
||||||
|
import java.net.URLEncoder;
|
||||||
|
|
||||||
|
public class XpayReq extends _BankAdapter {
|
||||||
|
public static final String LANG_CODE_IT = "ITA";
|
||||||
|
|
||||||
|
public static final String LANG_CODE_EN = "ENG";
|
||||||
|
|
||||||
|
public static final String LANG_CODE_ES = "SPA";
|
||||||
|
|
||||||
|
public static final String LANG_CODE_FR = "FRA";
|
||||||
|
|
||||||
|
public static final String LANG_CODE_DE = "GER";
|
||||||
|
|
||||||
|
public static final String LANG_CODE_ITA_ENG = "ITA-ENG";
|
||||||
|
|
||||||
|
public static final String LANG_CODE_JPN = "JPN";
|
||||||
|
|
||||||
|
public static final String DIV_CODE_LIRA = "18";
|
||||||
|
|
||||||
|
public static final String DIV_CODE_EURO = "242";
|
||||||
|
|
||||||
|
public static final String DIV_CODE_STERLINE = "2";
|
||||||
|
|
||||||
|
public static final String DIV_CODE_YEN = "71";
|
||||||
|
|
||||||
|
public static final String DIV_CODE_DOLLARL_HK = "103";
|
||||||
|
|
||||||
|
public static final String DIV_CODE_REAL = "234";
|
||||||
|
|
||||||
|
private String divisa;
|
||||||
|
|
||||||
|
private String codTrans;
|
||||||
|
|
||||||
|
private String mail;
|
||||||
|
|
||||||
|
private String importo;
|
||||||
|
|
||||||
|
private String languageId;
|
||||||
|
|
||||||
|
public static final String TEST_ALIAS = "payment_3444153";
|
||||||
|
|
||||||
|
public static final String P_XPAY_MAC_KEY = "XPAY_MAC_KEY";
|
||||||
|
|
||||||
|
public static final String P_XPAY_URL_RESPONSE = "XPAY_URL_RESPONSE";
|
||||||
|
|
||||||
|
public static final String P_XPAY_ALIAS = "XPAY_ALIAS";
|
||||||
|
|
||||||
|
public static final String P_XPAY_PAYMENT_OK_PAGE = "XPAY_PAY_OK";
|
||||||
|
|
||||||
|
public static final String P_XPAY_PAYMENT_ERROR_PAGE = "XPAY_PAY_KO";
|
||||||
|
|
||||||
|
public static final String P_XPAY_URL_RESPONSE_NULL = "XPAY_URL_RESPONSE_NULL";
|
||||||
|
|
||||||
|
public static final String TEST_MAC = "TLGHTOWIZXQPTIZRALWKG";
|
||||||
|
|
||||||
|
public static final String REQ_URL = "https://ecommerce.keyclient.it/ecomm/ecomm/DispatcherServlet";
|
||||||
|
|
||||||
|
public static final String TEST_REQ_URL = "https://coll-ecommerce.keyclient.it/ecomm/ecomm/DispatcherServlet";
|
||||||
|
|
||||||
|
public static final String DIV_CODE_DOLLARI = "1";
|
||||||
|
|
||||||
|
public XpayReq() {}
|
||||||
|
|
||||||
|
public XpayReq(ApplParmFull apFull) {
|
||||||
|
setAp(apFull);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodTrans() {
|
||||||
|
return (this.codTrans == null) ? "" : this.codTrans;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCodTrans(String myamount) {
|
||||||
|
this.codTrans = myamount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getImporto() {
|
||||||
|
return (this.importo == null) ? "" : this.importo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setImporto(String mybuyeremail) {
|
||||||
|
this.importo = mybuyeremail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMail() {
|
||||||
|
return (this.mail == null) ? "" : this.mail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMail(String mybuyername) {
|
||||||
|
this.mail = mybuyername;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDivisa() {
|
||||||
|
return (this.divisa == null) ? "" : this.divisa;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDivisa(String mycurrency) {
|
||||||
|
this.divisa = mycurrency;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAlias() {
|
||||||
|
return getParm("XPAY_ALIAS").getTesto();
|
||||||
|
}
|
||||||
|
|
||||||
|
private String getMylanguageCode() {
|
||||||
|
if (getLanguageId().toLowerCase().equals("it"))
|
||||||
|
return "ITA";
|
||||||
|
if (getLanguageId().toLowerCase().equals("en"))
|
||||||
|
return "ENG";
|
||||||
|
if (getLanguageId().toLowerCase().equals("es\t"))
|
||||||
|
return "SPA";
|
||||||
|
if (getLanguageId().toLowerCase().equals("fr"))
|
||||||
|
return "FRA";
|
||||||
|
if (getLanguageId().toLowerCase().equals("de"))
|
||||||
|
return "GER";
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMacEsempio() {
|
||||||
|
String temp = "codTrans=" + getCodTrans() + "divisa=" + getDivisa() + "importo=1" + getKey();
|
||||||
|
System.out.println("stringa mac: " + temp);
|
||||||
|
String res = "";
|
||||||
|
try {
|
||||||
|
res = EcDc.cryptSHA1Plain(temp);
|
||||||
|
System.out.println(res);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMac() {
|
||||||
|
String temp = "codTrans=" + getCodTrans() + "divisa=" + getDivisa() + "importo=" + getImportoUrl() + getKey();
|
||||||
|
String res = "";
|
||||||
|
try {
|
||||||
|
res = EcDc.cryptSHA1Plain(temp);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLanguageId() {
|
||||||
|
return (this.languageId == null) ? "" : this.languageId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLanguageId(String lang) {
|
||||||
|
this.languageId = lang;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFullRequestUrl() {
|
||||||
|
StringBuffer theUrl = new StringBuffer("https://ecommerce.keyclient.it/ecomm/ecomm/DispatcherServlet");
|
||||||
|
theUrl.append("alias=");
|
||||||
|
theUrl.append(getAlias());
|
||||||
|
theUrl.append("&importo=");
|
||||||
|
theUrl.append(getImporto());
|
||||||
|
theUrl.append("&divisa=");
|
||||||
|
theUrl.append(getDivisa());
|
||||||
|
theUrl.append("&codTrans=");
|
||||||
|
theUrl.append(getCodTrans());
|
||||||
|
theUrl.append("&mail=");
|
||||||
|
theUrl.append(getMail());
|
||||||
|
theUrl.append("&mac=");
|
||||||
|
try {
|
||||||
|
theUrl.append(URLEncoder.encode(getMac(), "UTF-8"));
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
theUrl.append("&languageId=");
|
||||||
|
theUrl.append(getLanguageId());
|
||||||
|
theUrl.append("&url=");
|
||||||
|
theUrl.append(getUrl());
|
||||||
|
if (!getUrl_back().isEmpty()) {
|
||||||
|
theUrl.append("&url_back=");
|
||||||
|
theUrl.append(getUrl_back());
|
||||||
|
}
|
||||||
|
return theUrl.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRequestUrl() {
|
||||||
|
StringBuffer theUrl = new StringBuffer("https://ecommerce.keyclient.it/ecomm/ecomm/DispatcherServlet");
|
||||||
|
theUrl.append("?alias=");
|
||||||
|
theUrl.append(getAlias());
|
||||||
|
theUrl.append("&importo=");
|
||||||
|
theUrl.append(getImportoUrl());
|
||||||
|
theUrl.append("&divisa=");
|
||||||
|
theUrl.append(getDivisa());
|
||||||
|
theUrl.append("&codTrans=");
|
||||||
|
theUrl.append(getCodTrans());
|
||||||
|
theUrl.append("&mail=");
|
||||||
|
theUrl.append(getMail());
|
||||||
|
theUrl.append("&mac=");
|
||||||
|
try {
|
||||||
|
theUrl.append(URLEncoder.encode(getMac(), "UTF-8"));
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
theUrl.append("&languageId=");
|
||||||
|
theUrl.append(getLanguageId());
|
||||||
|
theUrl.append("&url=");
|
||||||
|
theUrl.append(getUrl());
|
||||||
|
if (!getUrl_back().isEmpty()) {
|
||||||
|
theUrl.append("&url_back=");
|
||||||
|
theUrl.append(getUrl_back());
|
||||||
|
}
|
||||||
|
return theUrl.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getKey() {
|
||||||
|
return getParm("XPAY_MAC_KEY").getTesto();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getImportoUrl() {
|
||||||
|
if (this.importo == null)
|
||||||
|
return "0000";
|
||||||
|
String temp = this.importo;
|
||||||
|
if (temp.indexOf('.') < 0) {
|
||||||
|
temp = String.valueOf(temp) + "00";
|
||||||
|
} else if (temp.length() - temp.indexOf('.') < 3) {
|
||||||
|
temp = String.valueOf(temp) + "0";
|
||||||
|
}
|
||||||
|
return temp.replace(".", "");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUrl() {
|
||||||
|
return getParm("XPAY_URL_RESPONSE").getTesto();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUrl_back() {
|
||||||
|
return getParm("XPAY_URL_RESPONSE_NULL").getTesto();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTestRequestUrl() {
|
||||||
|
StringBuffer theUrl = new StringBuffer("https://coll-ecommerce.keyclient.it/ecomm/ecomm/DispatcherServlet");
|
||||||
|
theUrl.append("?alias=");
|
||||||
|
theUrl.append("payment_3444153");
|
||||||
|
theUrl.append("&importo=1");
|
||||||
|
theUrl.append("&divisa=");
|
||||||
|
theUrl.append(getDivisa());
|
||||||
|
theUrl.append("&codTrans=");
|
||||||
|
theUrl.append(getCodTrans());
|
||||||
|
theUrl.append("&mail=");
|
||||||
|
theUrl.append(getMail());
|
||||||
|
theUrl.append("&mac=");
|
||||||
|
try {
|
||||||
|
theUrl.append(URLEncoder.encode(getMacEsempio(), "UTF-8"));
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
theUrl.append("&languageId=");
|
||||||
|
theUrl.append(getLanguageId());
|
||||||
|
theUrl.append("&url=");
|
||||||
|
theUrl.append(getUrl());
|
||||||
|
if (!getUrl_back().isEmpty()) {
|
||||||
|
theUrl.append("&url_back=");
|
||||||
|
theUrl.append(getUrl_back());
|
||||||
|
}
|
||||||
|
return theUrl.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void initApplicationParms(ApplParmFull ap) {
|
||||||
|
if (ap != null) {
|
||||||
|
String l_tipoParm = "XPAY";
|
||||||
|
Parm bean = new Parm(ap);
|
||||||
|
bean.findByCodice("XPAY_PAY_KO");
|
||||||
|
bean.setFlgAdmin(0L);
|
||||||
|
bean.setTipoParm(l_tipoParm);
|
||||||
|
bean.setCodice("XPAY_PAY_KO");
|
||||||
|
bean.setDescrizione("XPAY_PAY_KO");
|
||||||
|
bean.setFlgTipo(0L);
|
||||||
|
if (bean.getTesto().equals(""))
|
||||||
|
bean.setTesto("payRes.jsp");
|
||||||
|
bean.setNota("XPAY_PAY_KO");
|
||||||
|
bean.save();
|
||||||
|
bean.findByCodice("XPAY_PAY_OK");
|
||||||
|
bean.setFlgAdmin(0L);
|
||||||
|
bean.setTipoParm(l_tipoParm);
|
||||||
|
bean.setCodice("XPAY_PAY_OK");
|
||||||
|
bean.setDescrizione("XPAY_PAY_OK");
|
||||||
|
bean.setFlgTipo(0L);
|
||||||
|
if (bean.getTesto().equals(""))
|
||||||
|
bean.setTesto("payRes.jsp");
|
||||||
|
bean.setNota("XPAY_PAY_OK");
|
||||||
|
bean.save();
|
||||||
|
bean.findByCodice("XPAY_MAC_KEY");
|
||||||
|
bean.setFlgAdmin(0L);
|
||||||
|
bean.setTipoParm(l_tipoParm);
|
||||||
|
bean.setCodice("XPAY_MAC_KEY");
|
||||||
|
bean.setDescrizione("XPAY_MAC_KEY");
|
||||||
|
bean.setFlgTipo(0L);
|
||||||
|
if (bean.getTesto().equals(""))
|
||||||
|
bean.setTesto("TLGHTOWIZXQPTIZRALWKG");
|
||||||
|
if (bean.getNota().isEmpty())
|
||||||
|
bean.setNota("XPAY_MAC_KEY. mac di esempio: TLGHTOWIZXQPTIZRALWKG");
|
||||||
|
bean.save();
|
||||||
|
bean.findByCodice("XPAY_ALIAS");
|
||||||
|
bean.setFlgAdmin(0L);
|
||||||
|
bean.setTipoParm(l_tipoParm);
|
||||||
|
bean.setCodice("XPAY_ALIAS");
|
||||||
|
bean.setDescrizione("XPAY_ALIAS");
|
||||||
|
bean.setFlgTipo(0L);
|
||||||
|
if (bean.getTesto().equals(""))
|
||||||
|
bean.setTesto("payment_3444153");
|
||||||
|
if (bean.getNota().isEmpty())
|
||||||
|
bean.setNota("XPAY_MAC_KEY. ALIAS DI TEST: payment_3444153");
|
||||||
|
bean.save();
|
||||||
|
bean.findByCodice("XPAY_URL_RESPONSE_NULL");
|
||||||
|
bean.setFlgAdmin(0L);
|
||||||
|
bean.setTipoParm(l_tipoParm);
|
||||||
|
bean.setCodice("XPAY_URL_RESPONSE_NULL");
|
||||||
|
bean.setDescrizione("XPAY_URL_RESPONSE_NULL");
|
||||||
|
bean.setFlgTipo(0L);
|
||||||
|
if (bean.getTesto().equals(""))
|
||||||
|
bean.setTesto("http://localhost/td/RicevutaXPAY.abl");
|
||||||
|
bean.setNota("XPAY_PAY_OK");
|
||||||
|
bean.save();
|
||||||
|
bean.findByCodice("XPAY_URL_RESPONSE");
|
||||||
|
bean.setFlgAdmin(0L);
|
||||||
|
bean.setTipoParm(l_tipoParm);
|
||||||
|
bean.setCodice("XPAY_URL_RESPONSE");
|
||||||
|
bean.setDescrizione("XPAY_URL_RESPONSE");
|
||||||
|
bean.setFlgTipo(0L);
|
||||||
|
if (bean.getTesto().equals(""))
|
||||||
|
bean.setTesto("http://localhost/td/RicevutaXPAY.abl");
|
||||||
|
bean.setNota("XPAY_URL_RESPONSE");
|
||||||
|
bean.save();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
186
rus/WEB-INF/lib/abliaBank_src/com/ablia/bank/xpay/XpayResp.java
Normal file
186
rus/WEB-INF/lib/abliaBank_src/com/ablia/bank/xpay/XpayResp.java
Normal file
|
|
@ -0,0 +1,186 @@
|
||||||
|
package com.ablia.bank.xpay;
|
||||||
|
|
||||||
|
import com.ablia.bank._BankAdapter;
|
||||||
|
import com.ablia.db.ApplParmFull;
|
||||||
|
import com.ablia.reg.EcDc;
|
||||||
|
|
||||||
|
public class XpayResp extends _BankAdapter {
|
||||||
|
private long id_ordine;
|
||||||
|
|
||||||
|
private String importo;
|
||||||
|
|
||||||
|
private String data;
|
||||||
|
|
||||||
|
private String divisa;
|
||||||
|
|
||||||
|
private String session_id;
|
||||||
|
|
||||||
|
private String codTrans;
|
||||||
|
|
||||||
|
private String orario;
|
||||||
|
|
||||||
|
private String esito;
|
||||||
|
|
||||||
|
private String codAut;
|
||||||
|
|
||||||
|
private String BRAND;
|
||||||
|
|
||||||
|
private String nome;
|
||||||
|
|
||||||
|
private String cognome;
|
||||||
|
|
||||||
|
private String email;
|
||||||
|
|
||||||
|
private String mac;
|
||||||
|
|
||||||
|
private String messaggio;
|
||||||
|
|
||||||
|
public static final String ESITO_OK = "OK";
|
||||||
|
|
||||||
|
public static final String ESITO_KO = "KO";
|
||||||
|
|
||||||
|
public XpayResp() {}
|
||||||
|
|
||||||
|
public XpayResp(ApplParmFull apFull) {
|
||||||
|
setAp(apFull);
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getId_ordine() {
|
||||||
|
return this.id_ordine;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId_ordine(long id_ordine) {
|
||||||
|
this.id_ordine = id_ordine;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getImporto() {
|
||||||
|
return (this.importo == null) ? "" : this.importo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setImporto(String importo) {
|
||||||
|
this.importo = importo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getData() {
|
||||||
|
return (this.data == null) ? "" : this.data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setData(String data) {
|
||||||
|
this.data = data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDivisa() {
|
||||||
|
return (this.divisa == null) ? "" : this.divisa;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDivisa(String divisa) {
|
||||||
|
this.divisa = divisa;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSession_id() {
|
||||||
|
return (this.session_id == null) ? "" : this.session_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSession_id(String session_id) {
|
||||||
|
this.session_id = session_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodTrans() {
|
||||||
|
return (this.codTrans == null) ? "" : this.codTrans;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCodTrans(String codTrans) {
|
||||||
|
this.codTrans = codTrans;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOrario() {
|
||||||
|
return (this.orario == null) ? "" : this.orario;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOrario(String orario) {
|
||||||
|
this.orario = orario;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEsito() {
|
||||||
|
return (this.esito == null) ? "" : this.esito;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEsito(String esito) {
|
||||||
|
this.esito = esito;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodAut() {
|
||||||
|
return (this.codAut == null) ? "" : this.codAut;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCodAut(String codAut) {
|
||||||
|
this.codAut = codAut;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBRAND() {
|
||||||
|
return (this.BRAND == null) ? "" : this.BRAND;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBRAND(String brand) {
|
||||||
|
this.BRAND = brand;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNome() {
|
||||||
|
return (this.nome == null) ? "" : this.nome;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNome(String nome) {
|
||||||
|
this.nome = nome;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCognome() {
|
||||||
|
return (this.cognome == null) ? "" : this.cognome;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCognome(String cognome) {
|
||||||
|
this.cognome = cognome;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEmail() {
|
||||||
|
return (this.email == null) ? "" : this.email;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEmail(String email) {
|
||||||
|
this.email = email;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMac() {
|
||||||
|
return (this.mac == null) ? "" : this.mac;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMac(String mac) {
|
||||||
|
this.mac = mac;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMessaggio() {
|
||||||
|
return (this.messaggio == null) ? "" : this.messaggio.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMessaggio(String messaggio) {
|
||||||
|
this.messaggio = messaggio;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isMacRitornoOk() {
|
||||||
|
String temp = "codTrans=" + getCodTrans() + "esito=" + getEsito() + "importo=" + getImporto() + "divisa=" + getDivisa() + "data=" +
|
||||||
|
getData() + "orario=" + getOrario() + "codAut=" + getCodAut() + getKey();
|
||||||
|
String res = "";
|
||||||
|
try {
|
||||||
|
res = EcDc.cryptSHA1Plain(temp);
|
||||||
|
if (res.equals(getMac()))
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getKey() {
|
||||||
|
return getParm("XPAY_MAC_KEY").getTesto();
|
||||||
|
}
|
||||||
|
}
|
||||||
134
rus/WEB-INF/lib/abliaBank_src/com/ablia/gtbill/GTBillReq.java
Normal file
134
rus/WEB-INF/lib/abliaBank_src/com/ablia/gtbill/GTBillReq.java
Normal file
|
|
@ -0,0 +1,134 @@
|
||||||
|
package com.ablia.gtbill;
|
||||||
|
|
||||||
|
import com.ablia.bank._BankAdapter;
|
||||||
|
import com.ablia.common.Parm;
|
||||||
|
import com.ablia.db.ApplParmFull;
|
||||||
|
|
||||||
|
public class GTBillReq extends _BankAdapter {
|
||||||
|
public static final String P_GTBILL_MERCHANT_ID = "GTBILL_MERCHANT_ID";
|
||||||
|
|
||||||
|
public static final String P_GTBILL_SITE_ID = "GTBILL_SITE_ID";
|
||||||
|
|
||||||
|
public static final String P_GTBILL_RETURN_URL = "GTBILL_RETURN_URL";
|
||||||
|
|
||||||
|
public static final String DIV_CODE_EURO = "EUR";
|
||||||
|
|
||||||
|
public static final String DIV_CODE_DOLLARI = "USD";
|
||||||
|
|
||||||
|
public static final String DIV_CODE_STERLINE = "GBP";
|
||||||
|
|
||||||
|
public static final String DIV_CODE_CAN = "CAD";
|
||||||
|
|
||||||
|
public static final String DIV_CODE_REAL = "234";
|
||||||
|
|
||||||
|
private String mycurrencyid;
|
||||||
|
|
||||||
|
private String myamounttotal;
|
||||||
|
|
||||||
|
private String myamountshipping;
|
||||||
|
|
||||||
|
private String myitemname;
|
||||||
|
|
||||||
|
private String myitemquantity;
|
||||||
|
|
||||||
|
private String myitemamount;
|
||||||
|
|
||||||
|
private String myitemdesc;
|
||||||
|
|
||||||
|
public static final String FORM_URL_POST = "https://sale.GTBill.com/quickpay.aspx";
|
||||||
|
|
||||||
|
public static final String PROG_LANG_URL_POST = "https://sale.GTBill.com/quickpay2.aspx";
|
||||||
|
|
||||||
|
public static final String PROG_LANG_URL_POST_REDIRECT = "https://sale.GTBill.com/quickpay.aspx?refid=";
|
||||||
|
|
||||||
|
public static void initApplicationParms(ApplParmFull ap) {
|
||||||
|
if (ap != null) {
|
||||||
|
Parm bean = new Parm(ap);
|
||||||
|
String l_tipoParm = "GTBILL";
|
||||||
|
bean.findByCodice("GTBILL_MERCHANT_ID");
|
||||||
|
bean.setFlgAdmin(1L);
|
||||||
|
bean.setTipoParm(l_tipoParm);
|
||||||
|
bean.setCodice("GTBILL_MERCHANT_ID");
|
||||||
|
bean.setDescrizione("GTBILL_MERCHANT_ID");
|
||||||
|
bean.setFlgTipo(0L);
|
||||||
|
bean.setNota("MERCHANT ID ASSEGNATO DALLA BANCA");
|
||||||
|
bean.save();
|
||||||
|
bean.findByCodice("GTBILL_SITE_ID");
|
||||||
|
bean.setFlgAdmin(1L);
|
||||||
|
bean.setTipoParm(l_tipoParm);
|
||||||
|
bean.setCodice("GTBILL_SITE_ID");
|
||||||
|
bean.setDescrizione("GTBILL_SITE_ID");
|
||||||
|
bean.setFlgTipo(0L);
|
||||||
|
bean.setNota("SITE ID ASSEGNATO DALLA BANCA");
|
||||||
|
bean.save();
|
||||||
|
bean.findByCodice("GTBILL_RETURN_URL");
|
||||||
|
bean.setFlgAdmin(1L);
|
||||||
|
bean.setTipoParm(l_tipoParm);
|
||||||
|
bean.setCodice("GTBILL_RETURN_URL");
|
||||||
|
bean.setDescrizione("GTBILL_RETURN_URL");
|
||||||
|
bean.setFlgTipo(0L);
|
||||||
|
bean.setNota("URL AL QUALE SI DEVE RITORNARE DOPO IL PAGAMENTO");
|
||||||
|
bean.save();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMyamounttotal() {
|
||||||
|
return (this.myamounttotal == null) ? "" :
|
||||||
|
this.myamounttotal.replace(".", ",").replace(",", ".");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMyamounttotal(String myamount) {
|
||||||
|
this.myamounttotal = myamount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMycurrencyid() {
|
||||||
|
return (this.mycurrencyid == null) ? "" : this.mycurrencyid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMycurrencyid(String mycurrency) {
|
||||||
|
this.mycurrencyid = mycurrency;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMyamountshipping() {
|
||||||
|
return (this.myamountshipping == null) ? "" :
|
||||||
|
this.myamountshipping;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMyamountshipping(String myamountshipping) {
|
||||||
|
this.myamountshipping = myamountshipping;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMyitemname() {
|
||||||
|
return (this.myitemname == null) ? "" : this.myitemname;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMyitemname(String myitemname) {
|
||||||
|
this.myitemname = myitemname;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMyitemquantity() {
|
||||||
|
return (this.myitemquantity == null) ? "" :
|
||||||
|
this.myitemquantity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMyitemquantity(String myitemquantity) {
|
||||||
|
this.myitemquantity = myitemquantity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMyitemamount() {
|
||||||
|
return (this.myitemamount == null) ? "" :
|
||||||
|
this.myitemamount.replace(".", ",").replace(",", ".");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMyitemamount(String myitemamount) {
|
||||||
|
this.myitemamount = myitemamount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMyitemdesc() {
|
||||||
|
return (this.myitemdesc == null) ? "" : this.myitemdesc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMyitemdesc(String myitemdesc) {
|
||||||
|
this.myitemdesc = myitemdesc;
|
||||||
|
}
|
||||||
|
}
|
||||||
158
rus/WEB-INF/lib/abliaBank_src/com/ablia/gtbill/GTBillRes.java
Normal file
158
rus/WEB-INF/lib/abliaBank_src/com/ablia/gtbill/GTBillRes.java
Normal file
|
|
@ -0,0 +1,158 @@
|
||||||
|
package com.ablia.gtbill;
|
||||||
|
|
||||||
|
import com.ablia.bank._BankAdapter;
|
||||||
|
|
||||||
|
public class GTBillRes extends _BankAdapter {
|
||||||
|
private String myshoplogin;
|
||||||
|
|
||||||
|
private int mycurrency;
|
||||||
|
|
||||||
|
private float myamount;
|
||||||
|
|
||||||
|
private String myshoptrxID;
|
||||||
|
|
||||||
|
private String mybuyername;
|
||||||
|
|
||||||
|
private String mybuyeremail;
|
||||||
|
|
||||||
|
private String mytrxresult;
|
||||||
|
|
||||||
|
private String myauthcode;
|
||||||
|
|
||||||
|
private String myerrorcode;
|
||||||
|
|
||||||
|
private String myerrordescription;
|
||||||
|
|
||||||
|
private String myerrorbanktrxid;
|
||||||
|
|
||||||
|
private long id_ordine;
|
||||||
|
|
||||||
|
private String myalertcode;
|
||||||
|
|
||||||
|
private String myalertdescription;
|
||||||
|
|
||||||
|
private String mycustominfo;
|
||||||
|
|
||||||
|
public String getMyalertcode() {
|
||||||
|
return (this.myalertcode == null) ? "" : this.myalertcode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMyalertcode(String myalertcode) {
|
||||||
|
this.myalertcode = myalertcode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMyalertdescription() {
|
||||||
|
return (this.myalertdescription == null) ? "" :
|
||||||
|
this.myalertdescription;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMyalertdescription(String myalertdescription) {
|
||||||
|
this.myalertdescription = myalertdescription;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getMyamount() {
|
||||||
|
return this.myamount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMyamount(float myamount) {
|
||||||
|
this.myamount = myamount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMyauthcode() {
|
||||||
|
return (this.myauthcode == null) ? "" : this.myauthcode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMyauthcode(String myauthcode) {
|
||||||
|
this.myauthcode = myauthcode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMybuyeremail() {
|
||||||
|
return (this.mybuyeremail == null) ? "" : this.mybuyeremail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMybuyeremail(String mybuyeremail) {
|
||||||
|
this.mybuyeremail = mybuyeremail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMybuyername() {
|
||||||
|
return (this.mybuyername == null) ? "" : this.mybuyername;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMybuyername(String mybuyername) {
|
||||||
|
this.mybuyername = mybuyername;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getMycurrency() {
|
||||||
|
return this.mycurrency;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMycurrency(int mycurrency) {
|
||||||
|
this.mycurrency = mycurrency;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMycustominfo() {
|
||||||
|
return (this.mycustominfo == null) ? "" : this.mycustominfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMycustominfo(String mycustominfo) {
|
||||||
|
this.mycustominfo = mycustominfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMyerrorbanktrxid() {
|
||||||
|
return (this.myerrorbanktrxid == null) ? "" :
|
||||||
|
this.myerrorbanktrxid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMyerrorbanktrxid(String myerrorbanktrxid) {
|
||||||
|
this.myerrorbanktrxid = myerrorbanktrxid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMyerrorcode() {
|
||||||
|
return (this.myerrorcode == null) ? "" : this.myerrorcode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMyerrorcode(String myerrorcode) {
|
||||||
|
this.myerrorcode = myerrorcode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMyerrordescription() {
|
||||||
|
return (this.myerrordescription == null) ? "" :
|
||||||
|
this.myerrordescription;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMyerrordescription(String myerrordescription) {
|
||||||
|
this.myerrordescription = myerrordescription;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMyshoplogin() {
|
||||||
|
return (this.myshoplogin == null) ? "" : this.myshoplogin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMyshoplogin(String myshoplogin) {
|
||||||
|
this.myshoplogin = myshoplogin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMyshoptrxID() {
|
||||||
|
return (this.myshoptrxID == null) ? "" : this.myshoptrxID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMyshoptrxID(String myshoptrxID) {
|
||||||
|
this.myshoptrxID = myshoptrxID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMytrxresult() {
|
||||||
|
return (this.mytrxresult == null) ? "" : this.mytrxresult;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMytrxresult(String mytrxresult) {
|
||||||
|
this.mytrxresult = mytrxresult;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getId_ordine() {
|
||||||
|
return this.id_ordine;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId_ordine(long id_ordine) {
|
||||||
|
this.id_ordine = id_ordine;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,114 @@
|
||||||
|
package com.ablia.gtbill.servlet;
|
||||||
|
|
||||||
|
import com.ablia.gtbill.GTBillReq;
|
||||||
|
import java.io.BufferedReader;
|
||||||
|
import java.io.InputStreamReader;
|
||||||
|
import java.net.HttpURLConnection;
|
||||||
|
import java.net.URL;
|
||||||
|
import javax.servlet.RequestDispatcher;
|
||||||
|
import javax.servlet.ServletRequest;
|
||||||
|
import javax.servlet.ServletResponse;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
public class GTBillSvlt extends Object {
|
||||||
|
private static final long serialVersionUID = 6201212373211424420L;
|
||||||
|
|
||||||
|
protected static final String CMD_SEND_REQ = "send";
|
||||||
|
|
||||||
|
protected static final String CMD_GET_RES = "res";
|
||||||
|
|
||||||
|
protected static final String BEAN_SELLA_RES = "sellaResp";
|
||||||
|
|
||||||
|
protected final void callJsp(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
setJspPageRelative(getJspOkPage(req, res), req);
|
||||||
|
try {
|
||||||
|
RequestDispatcher rd = getServletContext()
|
||||||
|
.getRequestDispatcher(getJspPage(req));
|
||||||
|
rd.forward((ServletRequest)req, (ServletResponse)res);
|
||||||
|
} catch (Exception e) {
|
||||||
|
handleDebug(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void sendRequest(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
try {
|
||||||
|
GTBillReq gtbillreq = new GTBillReq();
|
||||||
|
fillObject(req, gtbillreq);
|
||||||
|
String theUrl = "https://sale.GTBill.com/quickpay2.aspx";
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.append("?MerchantID=");
|
||||||
|
sb.append(getApFull().getParm("GTBILL_MERCHANT_ID"));
|
||||||
|
sb.append("&SiteID=");
|
||||||
|
sb.append(getApFull().getParm("GTBILL_SITE_ID"));
|
||||||
|
sb.append("&AmountTotal=");
|
||||||
|
sb.append(gtbillreq.getMyamounttotal());
|
||||||
|
sb.append("&CurrencyID=");
|
||||||
|
sb.append("EUR");
|
||||||
|
sb.append("&AmountShipping=");
|
||||||
|
sb.append(gtbillreq.getMyamountshipping());
|
||||||
|
sb.append("&ReturnURL=");
|
||||||
|
sb.append(getApFull().getParm("GTBILL_RETURN_URL"));
|
||||||
|
sb.append("&ItemAmount[0]=");
|
||||||
|
sb.append(gtbillreq.getMyitemamount());
|
||||||
|
sb.append("&ItemDesc[0]=");
|
||||||
|
sb.append(gtbillreq.getMyitemdesc());
|
||||||
|
sb.append("&ItemName[0]=");
|
||||||
|
sb.append(gtbillreq.getMyitemname());
|
||||||
|
sb.append("&ItemQuantity[0]=");
|
||||||
|
sb.append(gtbillreq.getMyitemquantity());
|
||||||
|
URL url = new URL(String.valueOf(theUrl) + sb.toString());
|
||||||
|
System.out.println("startremotecmd: chiamata a " + theUrl +
|
||||||
|
sb.toString());
|
||||||
|
HttpURLConnection connection = (HttpURLConnection)
|
||||||
|
url.openConnection();
|
||||||
|
BufferedReader read = new BufferedReader(new InputStreamReader(
|
||||||
|
connection.getInputStream()));
|
||||||
|
String line = read.readLine();
|
||||||
|
String html = "";
|
||||||
|
while (line != null) {
|
||||||
|
html = String.valueOf(html) + line;
|
||||||
|
line = read.readLine();
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
handleDebug(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected String getCodiceEsercente(HttpServletRequest req) {
|
||||||
|
return getParm("COD_ESER_SELLA").getTesto();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected String getJspErrorPage(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
String temp = getParm("SELLA_OK").getTesto();
|
||||||
|
if (temp.isEmpty())
|
||||||
|
return getJspKoPage(req, res);
|
||||||
|
return temp;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected String getJspOkPage(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
String temp = getParm("SELLA_OK").getTesto();
|
||||||
|
if (temp.isEmpty())
|
||||||
|
return "payRes.jsp";
|
||||||
|
return temp;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected String getJspKoPage(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
String temp = getParm("SELLA_OK").getTesto();
|
||||||
|
if (temp.isEmpty())
|
||||||
|
return "payRes.jsp";
|
||||||
|
return temp;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void processRequest(HttpServletRequest req, HttpServletResponse res) {
|
||||||
|
try {
|
||||||
|
sendRequest(req, res);
|
||||||
|
} catch (Exception e) {
|
||||||
|
handleDebug(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected boolean isSecureServlet(HttpServletRequest req) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
101
rus/WEB-INF/lib/abliaBank_src/com/ablia/taglib/SellaObjTag.java
Normal file
101
rus/WEB-INF/lib/abliaBank_src/com/ablia/taglib/SellaObjTag.java
Normal file
|
|
@ -0,0 +1,101 @@
|
||||||
|
package com.ablia.taglib;
|
||||||
|
|
||||||
|
import com.ablia.common.Parm;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.Writer;
|
||||||
|
import javax.servlet.jsp.JspException;
|
||||||
|
import javax.servlet.jsp.JspTagException;
|
||||||
|
|
||||||
|
public class SellaObjTag extends AbstractDbTag {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
private String value;
|
||||||
|
|
||||||
|
private boolean condition = true;
|
||||||
|
|
||||||
|
protected int currentNestedValue;
|
||||||
|
|
||||||
|
private String codice;
|
||||||
|
|
||||||
|
private Parm parm;
|
||||||
|
|
||||||
|
protected static final String _WC = "_WC";
|
||||||
|
|
||||||
|
protected static final String _NESTVAL = "_WCNESTVAL";
|
||||||
|
|
||||||
|
public int doAfterBody() throws JspException {
|
||||||
|
try {
|
||||||
|
this.bodyContent.writeOut((Writer)this.bodyContent.getEnclosingWriter());
|
||||||
|
setNestedValue();
|
||||||
|
return 0;
|
||||||
|
} catch (IOException ex) {
|
||||||
|
throw new JspTagException(ex.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public int doStartTag() {
|
||||||
|
this.currentNestedValue = getNestedValue();
|
||||||
|
this.pageContext.setAttribute("_WC" + this.currentNestedValue, new Boolean(
|
||||||
|
getWherecondition()));
|
||||||
|
if (getWherecondition())
|
||||||
|
return 2;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected int getNestedValue() {
|
||||||
|
if (this.pageContext.getAttribute("_WCNESTVAL") == null) {
|
||||||
|
this.pageContext.setAttribute("_WCNESTVAL", "1");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
int nv = Integer.parseInt((String)
|
||||||
|
this.pageContext.getAttribute("_WCNESTVAL"));
|
||||||
|
nv++;
|
||||||
|
this.pageContext.setAttribute("_WCNESTVAL", String.valueOf(nv));
|
||||||
|
return nv;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getWherecondition() {
|
||||||
|
getParm().findByCodice(getCodice());
|
||||||
|
if (this.parm.getDBState() == 1) {
|
||||||
|
if ((getParm().getValore().equals(getValue()) && getCondition()) || (
|
||||||
|
!getParm().getValore().equals(getValue()) && !getCondition()))
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void setNestedValue() {
|
||||||
|
this.pageContext.setAttribute("_WCNESTVAL", String.valueOf(this.currentNestedValue));
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodice() {
|
||||||
|
return this.codice;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Parm getParm() {
|
||||||
|
if (this.parm == null)
|
||||||
|
this.parm = new Parm(getApFull());
|
||||||
|
return this.parm;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCodice(String code) {
|
||||||
|
this.codice = code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getValue() {
|
||||||
|
return (this.value == null) ? "" : this.value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setValue(String value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getCondition() {
|
||||||
|
return this.condition;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCondition(boolean condition) {
|
||||||
|
this.condition = condition;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
-----BEGIN CERTIFICATE-----
|
||||||
|
MIID6zCCA1SgAwIBAgIBADANBgkqhkiG9w0BAQQFADCBsDELMAkGA1UEBhMCSVQx
|
||||||
|
CzAJBgNVBAgTAlJNMQ0wCwYDVQQHEwRSb21hMR4wHAYDVQQKExVQb3N0ZSBJdGFs
|
||||||
|
aWFuZSBTLnAuQS4xGDAWBgNVBAsTD1Bvc3RlY29tIFMucC5BLjEnMCUGA1UEAxMe
|
||||||
|
cG9zdGVjb21tZXJjZS5zdi5iYW5jb3Bvc3RhLml0MSIwIAYJKoZIhvcNAQkBFhNn
|
||||||
|
YXN0YWZmQHBvc3RlY29tLml0MB4XDTA2MDIyNzE0MjcyMloXDTExMDIyNjE0Mjcy
|
||||||
|
MlowgbAxCzAJBgNVBAYTAklUMQswCQYDVQQIEwJSTTENMAsGA1UEBxMEUm9tYTEe
|
||||||
|
MBwGA1UEChMVUG9zdGUgSXRhbGlhbmUgUy5wLkEuMRgwFgYDVQQLEw9Qb3N0ZWNv
|
||||||
|
bSBTLnAuQS4xJzAlBgNVBAMTHnBvc3RlY29tbWVyY2Uuc3YuYmFuY29wb3N0YS5p
|
||||||
|
dDEiMCAGCSqGSIb3DQEJARYTZ2FzdGFmZkBwb3N0ZWNvbS5pdDCBnzANBgkqhkiG
|
||||||
|
9w0BAQEFAAOBjQAwgYkCgYEAnfTsSZwATlmgDjFZO0f8wLeZIWgp1xitnq069DPe
|
||||||
|
PcKmvJPGu/7k71WuWTHwZo6MnNZE9IC4GR98CxhrcgmM0zpWsPwQUJ3AgPSXHNWR
|
||||||
|
lWu2ucRIjJ3bJQB7pi3rjzaHOrGDhY5yaW+6gr0LPHcVgPOSvobCD6L1fM4dWZ5b
|
||||||
|
/DECAwEAAaOCAREwggENMB0GA1UdDgQWBBRlSFJ8jcu7PvdBNd82OHKdDn0bAzCB
|
||||||
|
3QYDVR0jBIHVMIHSgBRlSFJ8jcu7PvdBNd82OHKdDn0bA6GBtqSBszCBsDELMAkG
|
||||||
|
A1UEBhMCSVQxCzAJBgNVBAgTAlJNMQ0wCwYDVQQHEwRSb21hMR4wHAYDVQQKExVQ
|
||||||
|
b3N0ZSBJdGFsaWFuZSBTLnAuQS4xGDAWBgNVBAsTD1Bvc3RlY29tIFMucC5BLjEn
|
||||||
|
MCUGA1UEAxMecG9zdGVjb21tZXJjZS5zdi5iYW5jb3Bvc3RhLml0MSIwIAYJKoZI
|
||||||
|
hvcNAQkBFhNnYXN0YWZmQHBvc3RlY29tLml0ggEAMAwGA1UdEwQFMAMBAf8wDQYJ
|
||||||
|
KoZIhvcNAQEEBQADgYEAhmSgvtnG0IGF7jO4GgkWODaDtBWiIBJ+P+NYSdv1/CKm
|
||||||
|
eOjrmagRdWCPrVO6E2T0CBkRHeFpreWxsynfnZLPWCeBRvgN+RuzQlkdcKSIyWi0
|
||||||
|
Q07v1MMW4cYcsdhUjB6giU8//2nl+DNunKAlzbKgC6YBkf2wOAm1Uwth/bt7S2s=
|
||||||
|
-----END CERTIFICATE-----
|
||||||
BIN
rus/WEB-INF/lib/abliaBank_src/postepayhpp_sv_poste_it.cer
Normal file
BIN
rus/WEB-INF/lib/abliaBank_src/postepayhpp_sv_poste_it.cer
Normal file
Binary file not shown.
BIN
rus/WEB-INF/lib/abliaDbCom.jar
Normal file
BIN
rus/WEB-INF/lib/abliaDbCom.jar
Normal file
Binary file not shown.
32
rus/WEB-INF/lib/abliaDbCom_src/AggAbiCab.java
Normal file
32
rus/WEB-INF/lib/abliaDbCom_src/AggAbiCab.java
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
import com.ablia.anag.AbiCab;
|
||||||
|
import com.ablia.db.ApplParm;
|
||||||
|
import com.ablia.db.ApplParmFull;
|
||||||
|
import com.ablia.db.ResParm;
|
||||||
|
import com.ablia.util.DbConsole;
|
||||||
|
|
||||||
|
public class AggAbiCab extends DbConsole {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
AggAbiCab bean = new AggAbiCab();
|
||||||
|
bean.doImport();
|
||||||
|
System.exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void doImport() {
|
||||||
|
String db = "ctexpress";
|
||||||
|
int i = 0;
|
||||||
|
int se1 = 10;
|
||||||
|
int se2 = 100;
|
||||||
|
String hostname = "localhost";
|
||||||
|
String temp = getCi().readLine("Hostname (" + hostname + "):");
|
||||||
|
if (!temp.isEmpty())
|
||||||
|
hostname = temp;
|
||||||
|
temp = getCi().readLine("Database name (" + db + "):");
|
||||||
|
if (!temp.isEmpty())
|
||||||
|
db = temp;
|
||||||
|
System.out.println("Db: " + db);
|
||||||
|
ApplParmFull apTarget = new ApplParmFull(new ApplParm(3, "//" + hostname + "/" + db, "root", "root", 1, 10, 300));
|
||||||
|
apTarget.setDebug(false);
|
||||||
|
ResParm rp = new AbiCab(apTarget).importAbiCab("/Users/acolzi/Downloads/banche.csv");
|
||||||
|
System.out.println(rp.getMsg());
|
||||||
|
}
|
||||||
|
}
|
||||||
50
rus/WEB-INF/lib/abliaDbCom_src/AggDocFiglio.java
Normal file
50
rus/WEB-INF/lib/abliaDbCom_src/AggDocFiglio.java
Normal file
|
|
@ -0,0 +1,50 @@
|
||||||
|
import com.ablia.contab.Documento;
|
||||||
|
import com.ablia.db.ApplParm;
|
||||||
|
import com.ablia.db.ApplParmFull;
|
||||||
|
import com.ablia.util.DbConsole;
|
||||||
|
import com.ablia.util.Vectumerator;
|
||||||
|
|
||||||
|
public class AggDocFiglio extends DbConsole {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
AggDocFiglio bean = new AggDocFiglio();
|
||||||
|
bean.doImport();
|
||||||
|
System.exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void doImport() {
|
||||||
|
String db = "guidoreni";
|
||||||
|
int i = 0;
|
||||||
|
int se1 = 10;
|
||||||
|
int se2 = 100;
|
||||||
|
String hostname = "localhost";
|
||||||
|
String temp = getCi().readLine("Hostname (" + hostname + "):");
|
||||||
|
if (!temp.isEmpty())
|
||||||
|
hostname = temp;
|
||||||
|
temp = getCi().readLine("Database name (" + db + "):");
|
||||||
|
if (!temp.isEmpty())
|
||||||
|
db = temp;
|
||||||
|
System.out.println("Db: " + db);
|
||||||
|
ApplParmFull apTarget = new ApplParmFull(new ApplParm(3, "//" + hostname + "/" + db, "root", "root", 1, 10, 300));
|
||||||
|
apTarget.setDebug(false);
|
||||||
|
StringBuffer msg = new StringBuffer();
|
||||||
|
try {
|
||||||
|
System.out.println("calcolo tot record....");
|
||||||
|
Vectumerator vec = new Documento(apTarget).findAll();
|
||||||
|
System.out.println("Tot Record: " + vec.getTotNumberOfRecords());
|
||||||
|
int updRec = 0;
|
||||||
|
while (vec.hasMoreElements()) {
|
||||||
|
Documento row = (Documento)vec.nextElement();
|
||||||
|
if (row.getId_documentoFiglio() != 0L)
|
||||||
|
updRec++;
|
||||||
|
i++;
|
||||||
|
if (se1 > 0 && i % se1 == 0)
|
||||||
|
System.out.print(".");
|
||||||
|
if (se2 > 0 && i % se2 == 0)
|
||||||
|
System.out.println(String.valueOf(i) + " " + updRec);
|
||||||
|
}
|
||||||
|
System.out.println("--- fine ---");
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
189
rus/WEB-INF/lib/abliaDbCom_src/AggiornaMagMovimento.java
Normal file
189
rus/WEB-INF/lib/abliaDbCom_src/AggiornaMagMovimento.java
Normal file
|
|
@ -0,0 +1,189 @@
|
||||||
|
import com.ablia.anag.MagFisico;
|
||||||
|
import com.ablia.art.Articolo;
|
||||||
|
import com.ablia.art.ArticoloCR;
|
||||||
|
import com.ablia.art.ArticoloVariante;
|
||||||
|
import com.ablia.contab.Movimento;
|
||||||
|
import com.ablia.contab.RigaDocumento;
|
||||||
|
import com.ablia.contab.RigaDocumentoP;
|
||||||
|
import com.ablia.contab.RigaDocumentoPCR;
|
||||||
|
import com.ablia.db.ApplParm;
|
||||||
|
import com.ablia.db.ApplParmFull;
|
||||||
|
import com.ablia.db.ResParm;
|
||||||
|
import com.ablia.util.DbConsole;
|
||||||
|
import com.ablia.util.Vectumerator;
|
||||||
|
import java.sql.Timestamp;
|
||||||
|
import java.util.Calendar;
|
||||||
|
|
||||||
|
public class AggiornaMagMovimento extends DbConsole {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
AggiornaMagMovimento bean = new AggiornaMagMovimento();
|
||||||
|
bean.doImport();
|
||||||
|
System.exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void doImport() {
|
||||||
|
int i = 0, j = 0;
|
||||||
|
int se1 = 10;
|
||||||
|
int se2 = 100;
|
||||||
|
String hostname = "localhost";
|
||||||
|
String db = "guidoreni";
|
||||||
|
boolean step1 = true, step2 = true, step3 = true, step4 = true, step5 = true;
|
||||||
|
System.out.println("Db: " + db);
|
||||||
|
ApplParmFull apTarget = new ApplParmFull(new ApplParm(3, "//" + hostname + "/" + db, "root", "root", 1, 10, 60));
|
||||||
|
apTarget.setDebug(false);
|
||||||
|
StringBuffer msg = new StringBuffer();
|
||||||
|
try {
|
||||||
|
long l_id_articolo = 0L;
|
||||||
|
ResParm rp = new ResParm(true);
|
||||||
|
int pagerow = 1000;
|
||||||
|
Timestamp start = new Timestamp(Calendar.getInstance().getTimeInMillis());
|
||||||
|
System.out.println("START: " + start.toString());
|
||||||
|
if (step1) {
|
||||||
|
System.out.println("Delete All Movimento");
|
||||||
|
Movimento mov = new Movimento(apTarget);
|
||||||
|
String sqlDeleteMov = "delete from MOVIMENTO ";
|
||||||
|
if (l_id_articolo > 0L)
|
||||||
|
sqlDeleteMov = String.valueOf(sqlDeleteMov) + " where id_articolo=" + l_id_articolo;
|
||||||
|
mov.delete(sqlDeleteMov);
|
||||||
|
i = 0;
|
||||||
|
System.out.println("Import All Movimento");
|
||||||
|
RigaDocumento rd = new RigaDocumento(apTarget);
|
||||||
|
long tot = rd.findAllPerRiordinoMagazzinoTot(l_id_articolo);
|
||||||
|
System.out.println("tot record: " + tot);
|
||||||
|
while ((long)j < tot / (long)pagerow + 1L) {
|
||||||
|
j++;
|
||||||
|
Vectumerator vec = rd.findAllPerRiordinoMagazzino(l_id_articolo, j, pagerow);
|
||||||
|
while (vec.hasMoreElements()) {
|
||||||
|
rd = (RigaDocumento)vec.nextElement();
|
||||||
|
rp = RigaDocumento.aggiornaMovimento(rd);
|
||||||
|
i++;
|
||||||
|
if (se1 > 0 && i % se1 == 0)
|
||||||
|
System.out.print(".");
|
||||||
|
if (se2 > 0 && i % se2 == 0)
|
||||||
|
System.out.println(i);
|
||||||
|
}
|
||||||
|
System.out.print("Tot: " + tot + " - Pag: " + j + " - Pag. Lette: " + (j * pagerow));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Timestamp stop = new Timestamp(Calendar.getInstance().getTimeInMillis());
|
||||||
|
System.out.println("start 2: " + stop.toString());
|
||||||
|
if (step2) {
|
||||||
|
i = 0;
|
||||||
|
j = 0;
|
||||||
|
RigaDocumentoP rdp = new RigaDocumentoP(apTarget);
|
||||||
|
Vectumerator vec = rdp.findAll();
|
||||||
|
long tot = (long)vec.getTotNumberOfRecords();
|
||||||
|
System.out.println("Riga documento P: tot record: " + vec.getTotNumberOfRecords());
|
||||||
|
while ((long)j < tot / (long)pagerow + 1L) {
|
||||||
|
j++;
|
||||||
|
vec = rdp.findByCR(new RigaDocumentoPCR(), j, pagerow);
|
||||||
|
while (vec.hasMoreElements()) {
|
||||||
|
RigaDocumentoP row = (RigaDocumentoP)vec.nextElement();
|
||||||
|
if (row.getRigaDocumentoPrelevata().getDocumento().getTipoDocumento()
|
||||||
|
.getFlgTipologia() == 3L) {
|
||||||
|
Movimento mov = new Movimento(apTarget);
|
||||||
|
rp = mov.deleteP(row.getId_rigaDocumentoPrelevata());
|
||||||
|
mov.setId_articolo(row.getRigaDocumentoPrelevata().getId_articolo());
|
||||||
|
mov.setId_articoloVariante(row.getRigaDocumentoPrelevata().getId_articoloVariante());
|
||||||
|
mov.setId_articoloTaglia(row.getRigaDocumentoPrelevata().getId_articoloTaglia());
|
||||||
|
mov.setId_clifor(row.getRigaDocumentoPrelevata().getDocumento().getId_clifor());
|
||||||
|
MagFisico mf = new MagFisico(apTarget);
|
||||||
|
mf.findMagazzinoOrdinato();
|
||||||
|
mov.setId_magFisico(mf.getId_magFisico());
|
||||||
|
mov.setId_rigaDocumento(row.getId_rigaDocumento());
|
||||||
|
mov.setNr(-1.0D * row.getQuantitaPrelevata());
|
||||||
|
rp = mov.save();
|
||||||
|
} else {
|
||||||
|
System.out.println("!!! " + row.getRigaDocumentoPrelevata().getDocumento().getNumeroDocumentoCompleto());
|
||||||
|
row.superDelete();
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
if (se1 > 0 && i % se1 == 0)
|
||||||
|
System.out.print(".");
|
||||||
|
if (se2 > 0 && i % se2 == 0)
|
||||||
|
System.out.println(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stop = new Timestamp(Calendar.getInstance().getTimeInMillis());
|
||||||
|
System.out.println("start 3: " + stop.toString());
|
||||||
|
if (step3) {
|
||||||
|
i = 0;
|
||||||
|
j = 0;
|
||||||
|
Articolo art = new Articolo(apTarget);
|
||||||
|
ArticoloCR CR = new ArticoloCR();
|
||||||
|
CR.setFlgQta(1L);
|
||||||
|
CR.setQtaDa(1L);
|
||||||
|
CR.setQtaA(99999999L);
|
||||||
|
Vectumerator vec = art.findByCR(CR, 0, 0);
|
||||||
|
long tot = (long)vec.getTotNumberOfRecords();
|
||||||
|
Movimento mov = new Movimento(apTarget);
|
||||||
|
System.out.println("Articolio: tot record: " + vec.getTotNumberOfRecords());
|
||||||
|
while (vec.hasMoreElements()) {
|
||||||
|
Articolo row = (Articolo)vec.nextElement();
|
||||||
|
System.out.println(row.getNome());
|
||||||
|
if (row.getFlgUsaVarianti() == 1L) {
|
||||||
|
ArticoloVariante av = new ArticoloVariante(apTarget);
|
||||||
|
Vectumerator vecAv = av.findById_articolo(row.getId_articolo(), 0, 0, -1L, -1L);
|
||||||
|
while (vecAv.hasMoreElements()) {
|
||||||
|
ArticoloVariante rowAV = (ArticoloVariante)vecAv.nextElement();
|
||||||
|
Movimento.aggiornaDispo(apTarget, rowAV.getId_articolo(), rowAV.getId_articoloVariante(), 0L, 1L);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Movimento.aggiornaDispo(apTarget, row.getId_articolo(), 0L, 0L, 1L);
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
if (se1 > 0 && i % se1 == 0)
|
||||||
|
System.out.print(".");
|
||||||
|
if (se2 > 0 && i % se2 == 0)
|
||||||
|
System.out.println(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stop = new Timestamp(Calendar.getInstance().getTimeInMillis());
|
||||||
|
System.out.println("start 4: " + stop.toString());
|
||||||
|
if (step4) {
|
||||||
|
i = 0;
|
||||||
|
j = 0;
|
||||||
|
RigaDocumento rd = new RigaDocumento(apTarget);
|
||||||
|
Vectumerator vec = rd.findRigheDocumentoPrelevateDaStornare();
|
||||||
|
long tot = (long)vec.getTotNumberOfRecords();
|
||||||
|
Movimento mov = new Movimento(apTarget);
|
||||||
|
System.out.println("Righe documento ordine da stornare: tot record: " + vec.getTotNumberOfRecords());
|
||||||
|
while (vec.hasMoreElements()) {
|
||||||
|
RigaDocumento row = (RigaDocumento)vec.nextElement();
|
||||||
|
row.aggiornaMovimentoPareggioRigaPrelevata();
|
||||||
|
i++;
|
||||||
|
if (se1 > 0 && i % se1 == 0)
|
||||||
|
System.out.print(".");
|
||||||
|
if (se2 > 0 && i % se2 == 0)
|
||||||
|
System.out.println(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (step5) {
|
||||||
|
i = 0;
|
||||||
|
j = 0;
|
||||||
|
RigaDocumento rd = new RigaDocumento(apTarget);
|
||||||
|
Vectumerator vec = rd.findRigheDocumentoPrelevateDaStornare();
|
||||||
|
long tot = (long)vec.getTotNumberOfRecords();
|
||||||
|
Movimento mov = new Movimento(apTarget);
|
||||||
|
System.out.println("Righe documento ordine da stornare: tot record: " + vec.getTotNumberOfRecords());
|
||||||
|
while (vec.hasMoreElements()) {
|
||||||
|
RigaDocumento row = (RigaDocumento)vec.nextElement();
|
||||||
|
row.aggiornaMovimentoPareggioRigaPrelevata();
|
||||||
|
i++;
|
||||||
|
if (se1 > 0 && i % se1 == 0)
|
||||||
|
System.out.print(".");
|
||||||
|
if (se2 > 0 && i % se2 == 0)
|
||||||
|
System.out.println(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stop = new Timestamp(Calendar.getInstance().getTimeInMillis());
|
||||||
|
System.out.println("STOP: " + start.toString());
|
||||||
|
System.out.println("DURATA: " + ((double)(stop.getTime() - start.getTime()) / 60000.0D) + " minuti");
|
||||||
|
System.out.println("Fine");
|
||||||
|
System.out.println(rp.getMsg());
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
70
rus/WEB-INF/lib/abliaDbCom_src/AggiornaMagRigaDocumento.java
Normal file
70
rus/WEB-INF/lib/abliaDbCom_src/AggiornaMagRigaDocumento.java
Normal file
|
|
@ -0,0 +1,70 @@
|
||||||
|
import com.ablia.contab.Documento;
|
||||||
|
import com.ablia.contab.RigaDocumento;
|
||||||
|
import com.ablia.db.ApplParm;
|
||||||
|
import com.ablia.db.ApplParmFull;
|
||||||
|
import com.ablia.db.ResParm;
|
||||||
|
import com.ablia.util.DbConsole;
|
||||||
|
import com.ablia.util.Vectumerator;
|
||||||
|
import java.sql.Timestamp;
|
||||||
|
import java.util.Calendar;
|
||||||
|
|
||||||
|
public class AggiornaMagRigaDocumento extends DbConsole {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
AggiornaMagRigaDocumento bean = new AggiornaMagRigaDocumento();
|
||||||
|
bean.doImport();
|
||||||
|
System.exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void doImport() {
|
||||||
|
int i = 0, j = 0;
|
||||||
|
int se1 = 10;
|
||||||
|
int se2 = 100;
|
||||||
|
String hostname = "localhost";
|
||||||
|
String db = "ravinale";
|
||||||
|
boolean step1 = true, step2 = true, step3 = true, step4 = true, step5 = true;
|
||||||
|
System.out.println("Db: " + db);
|
||||||
|
ApplParmFull apTarget = new ApplParmFull(new ApplParm(3, "//" + hostname + "/" + db, "root", "root", 1, 10, 60));
|
||||||
|
apTarget.setDebug(false);
|
||||||
|
StringBuffer msg = new StringBuffer();
|
||||||
|
try {
|
||||||
|
long l_id_articolo = 0L;
|
||||||
|
ResParm rp = new ResParm(true);
|
||||||
|
int pagerow = 1000;
|
||||||
|
Timestamp start = new Timestamp(Calendar.getInstance().getTimeInMillis());
|
||||||
|
System.out.println("START: " + start.toString());
|
||||||
|
if (step1) {
|
||||||
|
i = 0;
|
||||||
|
System.out.println("Import All Movimento");
|
||||||
|
RigaDocumento rd = new RigaDocumento(apTarget);
|
||||||
|
Vectumerator<RigaDocumento> vec = rd.findByDocumento(51L, -1L, "", 0, 0, 0);
|
||||||
|
Documento documento = new Documento(apTarget);
|
||||||
|
documento.findByPrimaryKey(51L);
|
||||||
|
System.out.println("tot record: " + vec.getTotNumberOfRecords());
|
||||||
|
while (vec.hasMoreElements()) {
|
||||||
|
rd = (RigaDocumento)vec.nextElement();
|
||||||
|
System.out.println(String.valueOf(rd.getArticoloVariante().getCodiceVariante()) + " " + rd.getArticoloVariante().getQuantitaEffettivaAv() +
|
||||||
|
" " + rd.getArticoloVariante().getQuantitaMagazzinoMovimentoHtml());
|
||||||
|
if (rd.getArticoloVariante().getQuantitaEffettivaAv() == 0.0D) {
|
||||||
|
rp = Documento.addRigaDocumento(documento, rd);
|
||||||
|
if (rd.getArticoloVariante().getQuantitaEffettivaAv() == 0.0D)
|
||||||
|
System.out.println(
|
||||||
|
String.valueOf(rd.getArticoloVariante().getQuantitaEffettivaAv()) + " " + rd.getArticoloVariante().getCodiceVariante());
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
if (se1 > 0 && i % se1 == 0)
|
||||||
|
System.out.print(".");
|
||||||
|
if (se2 > 0 && i % se2 == 0)
|
||||||
|
System.out.println(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Timestamp stop = new Timestamp(Calendar.getInstance().getTimeInMillis());
|
||||||
|
stop = new Timestamp(Calendar.getInstance().getTimeInMillis());
|
||||||
|
System.out.println("STOP: " + start.toString());
|
||||||
|
System.out.println("DURATA: " + ((double)(stop.getTime() - start.getTime()) / 60000.0D) + " minuti");
|
||||||
|
System.out.println("Fine");
|
||||||
|
System.out.println(rp.getMsg());
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
77
rus/WEB-INF/lib/abliaDbCom_src/AggiornaRDMOV.java
Normal file
77
rus/WEB-INF/lib/abliaDbCom_src/AggiornaRDMOV.java
Normal file
|
|
@ -0,0 +1,77 @@
|
||||||
|
import com.ablia.contab.RigaDocumento;
|
||||||
|
import com.ablia.contab.RigaDocumentoCR;
|
||||||
|
import com.ablia.contab.RigaDocumentoP;
|
||||||
|
import com.ablia.db.ApplParm;
|
||||||
|
import com.ablia.db.ApplParmFull;
|
||||||
|
import com.ablia.db.ResParm;
|
||||||
|
import com.ablia.util.DbConsole;
|
||||||
|
import com.ablia.util.Vectumerator;
|
||||||
|
import java.sql.Timestamp;
|
||||||
|
import java.util.Calendar;
|
||||||
|
|
||||||
|
public class AggiornaRDMOV extends DbConsole {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
AggiornaRDMOV bean = new AggiornaRDMOV();
|
||||||
|
bean.doImport();
|
||||||
|
System.exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void doImport() {
|
||||||
|
int i = 0, j = 0;
|
||||||
|
int se1 = 10;
|
||||||
|
int se2 = 100;
|
||||||
|
String hostname = "localhost";
|
||||||
|
String db = "guidoreni14";
|
||||||
|
boolean step1 = false, step2 = true, step3 = true, step4 = true, step5 = true;
|
||||||
|
System.out.println("Db: " + db);
|
||||||
|
ApplParmFull apTarget = new ApplParmFull(new ApplParm(3, "//" + hostname + "/" + db, "root", "root", 1, 10, 60));
|
||||||
|
apTarget.setDebug(false);
|
||||||
|
StringBuffer msg = new StringBuffer();
|
||||||
|
try {
|
||||||
|
long l_id_articolo = 0L;
|
||||||
|
ResParm rp = new ResParm(true);
|
||||||
|
int pagerow = 1000;
|
||||||
|
Timestamp start = new Timestamp(Calendar.getInstance().getTimeInMillis());
|
||||||
|
System.out.println("START: " + start.toString());
|
||||||
|
if (step1) {
|
||||||
|
System.out.println("CICLO RIGA DOCUMENTO");
|
||||||
|
i = 0;
|
||||||
|
RigaDocumento rd = new RigaDocumento(apTarget);
|
||||||
|
RigaDocumentoCR CR = new RigaDocumentoCR(apTarget);
|
||||||
|
int nrighe = 100000;
|
||||||
|
int recordCancellati = 0;
|
||||||
|
int npag = 1;
|
||||||
|
Vectumerator<RigaDocumento> vec;
|
||||||
|
while ((vec = rd.findByCR(CR, npag, nrighe)).hasMoreElements()) {
|
||||||
|
npag++;
|
||||||
|
while (vec.hasMoreElements()) {
|
||||||
|
RigaDocumento row = (RigaDocumento)vec.nextElement();
|
||||||
|
rp = row.saveMagSuRIgaDocumento();
|
||||||
|
if (!rp.getStatus())
|
||||||
|
System.out.println(rp.getMsg());
|
||||||
|
i++;
|
||||||
|
if (se1 > 0 && i % se1 == 0)
|
||||||
|
System.out.print(".");
|
||||||
|
if (se2 > 0 && i % se2 == 0)
|
||||||
|
System.out.println(String.valueOf(i) + " PAG. " + npag + " / " + nrighe);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Timestamp stop = new Timestamp(Calendar.getInstance().getTimeInMillis());
|
||||||
|
System.out.println("STOP: " + start.toString());
|
||||||
|
System.out.println("DURATA: " + ((double)(stop.getTime() - start.getTime()) / 60000.0D) + " minuti");
|
||||||
|
start = stop;
|
||||||
|
if (step2) {
|
||||||
|
RigaDocumentoP rdp = new RigaDocumentoP(apTarget);
|
||||||
|
rdp.aggiustaOrdiniSuRD();
|
||||||
|
}
|
||||||
|
stop = new Timestamp(Calendar.getInstance().getTimeInMillis());
|
||||||
|
System.out.println("STOP: " + start.toString());
|
||||||
|
System.out.println("DURATA: " + ((double)(stop.getTime() - start.getTime()) / 60000.0D) + " minuti");
|
||||||
|
System.out.println("Fine");
|
||||||
|
System.out.println(rp.getMsg());
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
84
rus/WEB-INF/lib/abliaDbCom_src/ArrotondaArticoli.java
Normal file
84
rus/WEB-INF/lib/abliaDbCom_src/ArrotondaArticoli.java
Normal file
|
|
@ -0,0 +1,84 @@
|
||||||
|
import com.ablia.art.Articolo;
|
||||||
|
import com.ablia.art.ArticoloCR;
|
||||||
|
import com.ablia.db.ApplParm;
|
||||||
|
import com.ablia.db.ApplParmFull;
|
||||||
|
import com.ablia.util.DbConsole;
|
||||||
|
import com.ablia.util.Vectumerator;
|
||||||
|
import java.sql.Time;
|
||||||
|
import java.util.StringTokenizer;
|
||||||
|
|
||||||
|
public class ArrotondaArticoli extends DbConsole {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
ArrotondaArticoli bean = new ArrotondaArticoli();
|
||||||
|
bean.doImport();
|
||||||
|
System.exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void doImport() {
|
||||||
|
String db = "guidoreni";
|
||||||
|
int i = 0;
|
||||||
|
int se1 = 10;
|
||||||
|
int se2 = 100;
|
||||||
|
String hostname = "localhost";
|
||||||
|
String temp = getCi().readLine("Hostname (" + hostname + "):");
|
||||||
|
if (!temp.isEmpty())
|
||||||
|
hostname = temp;
|
||||||
|
temp = getCi().readLine("Database name (" + db + "):");
|
||||||
|
if (!temp.isEmpty())
|
||||||
|
db = temp;
|
||||||
|
System.out.println("Db: " + db);
|
||||||
|
ApplParmFull apTarget = new ApplParmFull(new ApplParm(3, "//" + hostname + "/" + db, "root",
|
||||||
|
"root", 1, 10, 300));
|
||||||
|
apTarget.setDebug(false);
|
||||||
|
StringBuffer msg = new StringBuffer();
|
||||||
|
try {
|
||||||
|
Articolo bean = new Articolo(apTarget);
|
||||||
|
ArticoloCR CR = new ArticoloCR();
|
||||||
|
CR.setId_iva((long)bean.getParm("CODICE_IVA_STD_VEND").getNumeroInt());
|
||||||
|
Vectumerator vec = bean.findByCR(CR, 0, 0);
|
||||||
|
System.out.println("ciclo articoli");
|
||||||
|
System.out.println("Tot Record: " + vec.getTotNumberOfRecords());
|
||||||
|
while (vec.hasMoreElements()) {
|
||||||
|
Articolo row = (Articolo)vec.nextElement();
|
||||||
|
row.arrotondaPrezzoPubblicoConIva();
|
||||||
|
i++;
|
||||||
|
if (se1 > 0 && i % se1 == 0)
|
||||||
|
System.out.print(".");
|
||||||
|
if (se2 > 0 && i % se2 == 0)
|
||||||
|
System.out.println(i);
|
||||||
|
}
|
||||||
|
System.out.println("fine ciclo \n" + msg.toString());
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected Time getTimeFromString(String theTime) {
|
||||||
|
try {
|
||||||
|
if (theTime.matches("[0-9][0-9][0-9][0-9]"))
|
||||||
|
theTime = String.valueOf(theTime.substring(0, 2)) + ":" +
|
||||||
|
theTime.substring(2, 4);
|
||||||
|
if (theTime.matches("[0-9]{1,2}+:[0-9]{1,2}+")) {
|
||||||
|
StringTokenizer st = new StringTokenizer(theTime, ":");
|
||||||
|
int hour = Integer.parseInt(st.nextToken());
|
||||||
|
int min = Integer.parseInt(st.nextToken());
|
||||||
|
int sec = st.hasMoreElements() ? Integer.parseInt(
|
||||||
|
st.nextToken()) : 0;
|
||||||
|
return new Time(
|
||||||
|
(long)((hour - 1) * 3600000 + min * 60000 + sec * 1000));
|
||||||
|
}
|
||||||
|
if (theTime.matches("[0-9]{1,2}+:[0-9]{1,2}+:[0-9]{1,2}+")) {
|
||||||
|
StringTokenizer st = new StringTokenizer(theTime, ":");
|
||||||
|
int hour = Integer.parseInt(st.nextToken());
|
||||||
|
int min = Integer.parseInt(st.nextToken());
|
||||||
|
int sec = st.hasMoreElements() ? Integer.parseInt(
|
||||||
|
st.nextToken()) : 0;
|
||||||
|
return new Time(
|
||||||
|
(long)((hour - 1) * 3600000 + min * 60000 + sec * 1000));
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
} catch (Exception e) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
96
rus/WEB-INF/lib/abliaDbCom_src/ArticoliTipoAcc.java
Normal file
96
rus/WEB-INF/lib/abliaDbCom_src/ArticoliTipoAcc.java
Normal file
|
|
@ -0,0 +1,96 @@
|
||||||
|
import com.ablia.art.Articolo;
|
||||||
|
import com.ablia.art.ArticoloCR;
|
||||||
|
import com.ablia.db.ApplParm;
|
||||||
|
import com.ablia.db.ApplParmFull;
|
||||||
|
import com.ablia.util.DbConsole;
|
||||||
|
import com.ablia.util.Vectumerator;
|
||||||
|
import java.sql.Time;
|
||||||
|
import java.util.StringTokenizer;
|
||||||
|
|
||||||
|
public class ArticoliTipoAcc extends DbConsole {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
ArticoliTipoAcc bean = new ArticoliTipoAcc();
|
||||||
|
bean.doImport();
|
||||||
|
System.exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void doImport() {
|
||||||
|
String db = "guidoreni";
|
||||||
|
int i = 0;
|
||||||
|
int se1 = 10;
|
||||||
|
int se2 = 100;
|
||||||
|
String hostname = "localhost";
|
||||||
|
String temp = getCi().readLine("Hostname (" + hostname + "):");
|
||||||
|
if (!temp.isEmpty())
|
||||||
|
hostname = temp;
|
||||||
|
temp = getCi().readLine("Database name (" + db + "):");
|
||||||
|
if (!temp.isEmpty())
|
||||||
|
db = temp;
|
||||||
|
System.out.println("Db: " + db);
|
||||||
|
ApplParmFull apTarget = new ApplParmFull(new ApplParm(3, "//" + hostname + "/" + db, "root",
|
||||||
|
"root", 1, 10, 300));
|
||||||
|
long l_id_tipoAcc = 196L;
|
||||||
|
long l_id_tipoAccOrig = 214L;
|
||||||
|
long l_id_tipoAccCompat = 229L;
|
||||||
|
temp = getCi().readLine(
|
||||||
|
"id_tipo accessorio root (" + l_id_tipoAcc + "):");
|
||||||
|
if (!temp.isEmpty())
|
||||||
|
l_id_tipoAcc = Long.valueOf(temp);
|
||||||
|
apTarget.setDebug(false);
|
||||||
|
StringBuffer msg = new StringBuffer();
|
||||||
|
try {
|
||||||
|
Articolo bean = new Articolo(apTarget);
|
||||||
|
System.out.println("ciclo articoli");
|
||||||
|
ArticoloCR CR = new ArticoloCR(apTarget);
|
||||||
|
CR.setId_tipo(l_id_tipoAcc);
|
||||||
|
Vectumerator vec = bean.findByCR(CR, 0, 0);
|
||||||
|
System.out.println("Tot Record: " + vec.getTotNumberOfRecords());
|
||||||
|
while (vec.hasMoreElements()) {
|
||||||
|
Articolo row = (Articolo)vec.nextElement();
|
||||||
|
if (row.getTipo().getId_tipoPadre() == l_id_tipoAccCompat) {
|
||||||
|
row.setId_tipoAccessorio(2L);
|
||||||
|
} else {
|
||||||
|
row.setId_tipoAccessorio(5L);
|
||||||
|
}
|
||||||
|
row.save();
|
||||||
|
i++;
|
||||||
|
if (se1 > 0 && i % se1 == 0)
|
||||||
|
System.out.print(".");
|
||||||
|
if (se2 > 0 && i % se2 == 0)
|
||||||
|
System.out.println(i);
|
||||||
|
}
|
||||||
|
System.out.println("fine ciclo \n" + msg.toString());
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected Time getTimeFromString(String theTime) {
|
||||||
|
try {
|
||||||
|
if (theTime.matches("[0-9][0-9][0-9][0-9]"))
|
||||||
|
theTime = String.valueOf(theTime.substring(0, 2)) + ":" +
|
||||||
|
theTime.substring(2, 4);
|
||||||
|
if (theTime.matches("[0-9]{1,2}+:[0-9]{1,2}+")) {
|
||||||
|
StringTokenizer st = new StringTokenizer(theTime, ":");
|
||||||
|
int hour = Integer.parseInt(st.nextToken());
|
||||||
|
int min = Integer.parseInt(st.nextToken());
|
||||||
|
int sec = st.hasMoreElements() ? Integer.parseInt(
|
||||||
|
st.nextToken()) : 0;
|
||||||
|
return new Time(
|
||||||
|
(long)((hour - 1) * 3600000 + min * 60000 + sec * 1000));
|
||||||
|
}
|
||||||
|
if (theTime.matches("[0-9]{1,2}+:[0-9]{1,2}+:[0-9]{1,2}+")) {
|
||||||
|
StringTokenizer st = new StringTokenizer(theTime, ":");
|
||||||
|
int hour = Integer.parseInt(st.nextToken());
|
||||||
|
int min = Integer.parseInt(st.nextToken());
|
||||||
|
int sec = st.hasMoreElements() ? Integer.parseInt(
|
||||||
|
st.nextToken()) : 0;
|
||||||
|
return new Time(
|
||||||
|
(long)((hour - 1) * 3600000 + min * 60000 + sec * 1000));
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
} catch (Exception e) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
31
rus/WEB-INF/lib/abliaDbCom_src/CrontabDbcomune.java
Normal file
31
rus/WEB-INF/lib/abliaDbCom_src/CrontabDbcomune.java
Normal file
|
|
@ -0,0 +1,31 @@
|
||||||
|
import com.ablia.common.CrontabInterface;
|
||||||
|
import com.ablia.common.Parm;
|
||||||
|
import com.ablia.db.ApplParm;
|
||||||
|
import com.ablia.db.ApplParmFull;
|
||||||
|
import com.ablia.db.DBAdapter;
|
||||||
|
import com.ablia.db.ResParm;
|
||||||
|
|
||||||
|
public class CrontabDbcomune implements CrontabInterface {
|
||||||
|
public ResParm crontabJob(ApplParmFull ap) {
|
||||||
|
ResParm rp = new ResParm(true);
|
||||||
|
StringBuffer msg = new StringBuffer(
|
||||||
|
"\n################# Inizio crontab Giornaliera ABLIADBCOMUNE (" + DBAdapter.getNow().toString() + ")\n#################");
|
||||||
|
long t0 = System.currentTimeMillis();
|
||||||
|
Parm parm = new Parm(ap);
|
||||||
|
rp = parm.svuotaCartellaTmp();
|
||||||
|
msg.append(rp.getMsg());
|
||||||
|
msg.append("\n################# Fine crontab Giornaliera ABLIADBCOMUNE (" + DBAdapter.getNow().toString() + ")\n#################");
|
||||||
|
long tn = System.currentTimeMillis();
|
||||||
|
long duration = (tn - t0) / 60000L;
|
||||||
|
msg.append("Durata aggiornamento: " + duration + " minuti.");
|
||||||
|
rp.setMsg(msg.toString());
|
||||||
|
return rp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
ApplParm ap = new ApplParm(3, "//localhost/coavedb2", "root", "root");
|
||||||
|
ResParm rp = new CrontabDbcomune().crontabJob(new ApplParmFull(ap));
|
||||||
|
System.out.println(rp.getMsg());
|
||||||
|
System.exit(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
68
rus/WEB-INF/lib/abliaDbCom_src/ExportCliforCsv.java
Normal file
68
rus/WEB-INF/lib/abliaDbCom_src/ExportCliforCsv.java
Normal file
|
|
@ -0,0 +1,68 @@
|
||||||
|
import com.ablia.anag.Clifor;
|
||||||
|
import com.ablia.anag.CliforCR;
|
||||||
|
import com.ablia.db.ApplParm;
|
||||||
|
import com.ablia.db.ApplParmFull;
|
||||||
|
import com.ablia.util.DbConsole;
|
||||||
|
import java.sql.Time;
|
||||||
|
import java.util.StringTokenizer;
|
||||||
|
|
||||||
|
public class ExportCliforCsv extends DbConsole {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
ExportCliforCsv bean = new ExportCliforCsv();
|
||||||
|
bean.doImport();
|
||||||
|
System.exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void doImport() {
|
||||||
|
String db = "guidoreni14";
|
||||||
|
int i = 0;
|
||||||
|
int se1 = 10;
|
||||||
|
int se2 = 100;
|
||||||
|
String hostname = "localhost";
|
||||||
|
String temp = getCi().readLine("Hostname (" + hostname + "):");
|
||||||
|
if (!temp.isEmpty())
|
||||||
|
hostname = temp;
|
||||||
|
temp = getCi().readLine("Database name (" + db + "):");
|
||||||
|
if (!temp.isEmpty())
|
||||||
|
db = temp;
|
||||||
|
System.out.println("Db: " + db);
|
||||||
|
ApplParmFull apTarget = new ApplParmFull(new ApplParm(3, "//" + hostname + "/" + db, "root", "root", 1, 10, 300));
|
||||||
|
apTarget.setDebug(false);
|
||||||
|
Clifor clifor = new Clifor(apTarget);
|
||||||
|
CliforCR CR = new CliforCR(apTarget);
|
||||||
|
CR.setFlgTipo("C");
|
||||||
|
System.out.println("creo csv cliente");
|
||||||
|
clifor.creaFileCvs(CR);
|
||||||
|
System.out.println("Creato file " + CR.getFileName());
|
||||||
|
System.out.println("creo csv fornitore");
|
||||||
|
CR.setFlgTipo("F");
|
||||||
|
clifor.creaFileCvs(CR);
|
||||||
|
System.out.println("Creato file " + CR.getFileName());
|
||||||
|
System.out.println("fine");
|
||||||
|
System.exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected Time getTimeFromString(String theTime) {
|
||||||
|
try {
|
||||||
|
if (theTime.matches("[0-9][0-9][0-9][0-9]"))
|
||||||
|
theTime = String.valueOf(theTime.substring(0, 2)) + ":" + theTime.substring(2, 4);
|
||||||
|
if (theTime.matches("[0-9]{1,2}+:[0-9]{1,2}+")) {
|
||||||
|
StringTokenizer st = new StringTokenizer(theTime, ":");
|
||||||
|
int hour = Integer.parseInt(st.nextToken());
|
||||||
|
int min = Integer.parseInt(st.nextToken());
|
||||||
|
int sec = st.hasMoreElements() ? Integer.parseInt(st.nextToken()) : 0;
|
||||||
|
return new Time((long)((hour - 1) * 3600000 + min * 60000 + sec * 1000));
|
||||||
|
}
|
||||||
|
if (theTime.matches("[0-9]{1,2}+:[0-9]{1,2}+:[0-9]{1,2}+")) {
|
||||||
|
StringTokenizer st = new StringTokenizer(theTime, ":");
|
||||||
|
int hour = Integer.parseInt(st.nextToken());
|
||||||
|
int min = Integer.parseInt(st.nextToken());
|
||||||
|
int sec = st.hasMoreElements() ? Integer.parseInt(st.nextToken()) : 0;
|
||||||
|
return new Time((long)((hour - 1) * 3600000 + min * 60000 + sec * 1000));
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
} catch (Exception e) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
104
rus/WEB-INF/lib/abliaDbCom_src/ImportArticoliXls.java
Normal file
104
rus/WEB-INF/lib/abliaDbCom_src/ImportArticoliXls.java
Normal file
|
|
@ -0,0 +1,104 @@
|
||||||
|
import com.ablia.anag.Iva;
|
||||||
|
import com.ablia.anag.ListinoArticolo;
|
||||||
|
import com.ablia.art.Articolo;
|
||||||
|
import com.ablia.db.ApplParm;
|
||||||
|
import com.ablia.db.ApplParmFull;
|
||||||
|
import com.ablia.db.ResParm;
|
||||||
|
import com.ablia.util.DbConsole;
|
||||||
|
import com.ablia.util.StringTokenizer;
|
||||||
|
import java.io.BufferedReader;
|
||||||
|
import java.io.FileReader;
|
||||||
|
|
||||||
|
public class ImportArticoliXls extends DbConsole {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
ImportArticoliXls bean = new ImportArticoliXls();
|
||||||
|
bean.doImport();
|
||||||
|
System.exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void doImport() {
|
||||||
|
int i = 0;
|
||||||
|
int se1 = 10;
|
||||||
|
int se2 = 100;
|
||||||
|
String currentLine = "";
|
||||||
|
String hostname = "83.149.159.155";
|
||||||
|
String db = "guidoreni14";
|
||||||
|
String fileCsv = "/Users/acolzi/Documents/_ablia/work/guidoreni/importArticoliXls/4464-DT.csv";
|
||||||
|
boolean importArticoli = false;
|
||||||
|
String temp = "";
|
||||||
|
temp = getCi().readLine("importArticoli(" + importArticoli + "):");
|
||||||
|
if (!temp.isEmpty())
|
||||||
|
importArticoli = temp.equals("y");
|
||||||
|
ApplParmFull ap = new ApplParmFull(new ApplParm(3, "//" + hostname + "/" + db, "root", "root", 1, 10, 300));
|
||||||
|
ap.setDebug(false);
|
||||||
|
StringBuffer msg = new StringBuffer();
|
||||||
|
try {
|
||||||
|
int numBanche = 0, numClienti = 0;
|
||||||
|
if (importArticoli) {
|
||||||
|
i = 0;
|
||||||
|
System.out.println("\nimportArticoli");
|
||||||
|
Articolo articolo = new Articolo(ap);
|
||||||
|
BufferedReader reader = new BufferedReader(new FileReader(fileCsv));
|
||||||
|
if (reader != null) {
|
||||||
|
int numbToken = 0;
|
||||||
|
int colcodice = 0, coldescrizione = 1, colid_tipo = 8, colprice = 6, colmarca = 9, coldescTecnica = 5;
|
||||||
|
StringBuffer currentArticolo = new StringBuffer();
|
||||||
|
for (int j = 0; j < 1; j++)
|
||||||
|
reader.readLine();
|
||||||
|
while ((currentLine = reader.readLine()) != null) {
|
||||||
|
StringTokenizer st = new StringTokenizer(currentLine, ";");
|
||||||
|
String codice = st.getToken(colcodice);
|
||||||
|
String descrizione = st.getToken(coldescrizione);
|
||||||
|
String id_tipo = st.getToken(colid_tipo);
|
||||||
|
String price = st.getToken(colprice);
|
||||||
|
String marca = st.getToken(colmarca);
|
||||||
|
String descTecnica = st.getToken(coldescTecnica);
|
||||||
|
articolo = new Articolo(ap);
|
||||||
|
articolo.findArticoloByCodice(codice);
|
||||||
|
if (articolo.getDBState() == 0) {
|
||||||
|
articolo.setCodice(codice);
|
||||||
|
articolo.setNome(descrizione);
|
||||||
|
articolo.setId_tipo(Long.valueOf(id_tipo).longValue());
|
||||||
|
articolo.setId_marca(Long.valueOf(marca).longValue());
|
||||||
|
articolo.setId_tipoAccessorio(5L);
|
||||||
|
articolo.setId_iva(6L);
|
||||||
|
articolo.setDescTxtLang("descrizione", "it", descrizione);
|
||||||
|
articolo.setDescTxtLang("descrizioneTecnica", "it", descTecnica);
|
||||||
|
ResParm rp = articolo.superSave();
|
||||||
|
if (rp.getStatus()) {
|
||||||
|
ListinoArticolo listinoArticoloBase = articolo.getListinoArticoloBase();
|
||||||
|
listinoArticoloBase.setId_articolo(articolo.getId_articolo());
|
||||||
|
listinoArticoloBase.setId_listino(articolo.getListinoBase().getId_listino());
|
||||||
|
listinoArticoloBase.setPrezzoLA(Iva.scorporaIva(Double.parseDouble(price.replaceAll(",", ".")), 22.0D));
|
||||||
|
rp = listinoArticoloBase.save();
|
||||||
|
} else {
|
||||||
|
System.out.println(rp.getMsg());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
ResParm rp = new ResParm(true);
|
||||||
|
System.out.println(codice);
|
||||||
|
if (rp.getStatus()) {
|
||||||
|
ListinoArticolo listinoArticoloBase = articolo.getListinoArticoloBase();
|
||||||
|
listinoArticoloBase.setId_articolo(articolo.getId_articolo());
|
||||||
|
listinoArticoloBase.setId_listino(articolo.getListinoBase().getId_listino());
|
||||||
|
listinoArticoloBase.setPrezzoLA(Iva.scorporaIva(Double.parseDouble(price.replaceAll(",", ".")), 22.0D));
|
||||||
|
rp = listinoArticoloBase.save();
|
||||||
|
} else {
|
||||||
|
System.out.println(rp.getMsg());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
if (se1 > 0 && i % se1 == 0)
|
||||||
|
System.out.print(".");
|
||||||
|
if (se2 > 0 && i % se2 == 0)
|
||||||
|
System.out.println(String.valueOf(i) + " / ");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
System.out.println("fine ciclo \n\n\n\n\n\n\n\n\n\n\n" + msg.toString());
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
System.out.println(currentLine);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
164
rus/WEB-INF/lib/abliaDbCom_src/ImportRubrica.java
Normal file
164
rus/WEB-INF/lib/abliaDbCom_src/ImportRubrica.java
Normal file
|
|
@ -0,0 +1,164 @@
|
||||||
|
import com.ablia.db.ApplParm;
|
||||||
|
import com.ablia.db.ApplParmFull;
|
||||||
|
import com.ablia.rubrica.Articolo;
|
||||||
|
import com.ablia.rubrica.Filato;
|
||||||
|
import com.ablia.tex.anag.ArticoloFilato;
|
||||||
|
import com.ablia.tex.anag.ArticoloFilatoColore;
|
||||||
|
import com.ablia.tex.anag.ArticoloTessuto;
|
||||||
|
import com.ablia.tex.anag.ArticoloTessutoAccoppiato;
|
||||||
|
import com.ablia.tex.anag.ColoreFilato;
|
||||||
|
import com.ablia.util.DbConsole;
|
||||||
|
import com.ablia.util.Vectumerator;
|
||||||
|
|
||||||
|
public class ImportRubrica extends DbConsole {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
ImportRubrica bean = new ImportRubrica();
|
||||||
|
bean.doImport();
|
||||||
|
System.exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void doImport() {
|
||||||
|
int i = 0;
|
||||||
|
int se1 = 10;
|
||||||
|
int se2 = 100;
|
||||||
|
String hostname = "localhost";
|
||||||
|
String db = "tex";
|
||||||
|
String dbSoutce = "rubrica";
|
||||||
|
boolean importColore = false, importFilati = false, importTessuti = false, importFornitore = true;
|
||||||
|
String temp = "";
|
||||||
|
temp = getCi().readLine("importColore(" + importColore + "):");
|
||||||
|
if (!temp.isEmpty())
|
||||||
|
importColore = temp.equals("y");
|
||||||
|
temp = getCi().readLine("importFilati(" + importFilati + "):");
|
||||||
|
if (!temp.isEmpty())
|
||||||
|
importFilati = temp.equals("y");
|
||||||
|
temp = getCi().readLine("importTessuti(" + importTessuti + "):");
|
||||||
|
if (!temp.isEmpty())
|
||||||
|
importTessuti = temp.equals("y");
|
||||||
|
temp = getCi().readLine("importFornitore(" + importFornitore + "):");
|
||||||
|
if (!temp.isEmpty())
|
||||||
|
importFornitore = temp.equals("y");
|
||||||
|
ApplParmFull ap = new ApplParmFull(new ApplParm(3, "//" + hostname + "/" + db, "root", "root", 1, 10, 300));
|
||||||
|
ap.setDebug(false);
|
||||||
|
ApplParmFull apSource = new ApplParmFull(new ApplParm(3, "//" + hostname + "/" + dbSoutce, "root", "root", 1, 10, 300));
|
||||||
|
ap.setDebug(false);
|
||||||
|
StringBuffer msg = new StringBuffer();
|
||||||
|
try {
|
||||||
|
int numColori = 0, numClienti = 0;
|
||||||
|
if (importColore) {
|
||||||
|
System.out.println("\nimportColore");
|
||||||
|
Filato filatoS = new Filato(apSource);
|
||||||
|
Vectumerator vecColori = filatoS.findColori();
|
||||||
|
while (vecColori.hasMoreElements()) {
|
||||||
|
Filato f = (Filato)vecColori.nextElement();
|
||||||
|
if (!f.getColore().isEmpty()) {
|
||||||
|
ColoreFilato cf = new ColoreFilato(ap);
|
||||||
|
cf.setDescrizione(f.getColore());
|
||||||
|
cf.save();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (importFilati) {
|
||||||
|
ColoreFilato colore = new ColoreFilato(ap);
|
||||||
|
i = 0;
|
||||||
|
System.out.println("\nimportFilati");
|
||||||
|
Filato filatoS = new Filato(apSource);
|
||||||
|
Vectumerator vecFilati = filatoS.findAll();
|
||||||
|
while (vecFilati.hasMoreElements()) {
|
||||||
|
Filato f = (Filato)vecFilati.nextElement();
|
||||||
|
ArticoloFilato af = new ArticoloFilato(ap);
|
||||||
|
af.setCodiceAF(f.getId_filato());
|
||||||
|
af.setDescrizione(f.getDescrizione());
|
||||||
|
af.setId_tipo(1L);
|
||||||
|
af.setId_iva(1L);
|
||||||
|
af.save();
|
||||||
|
colore.findByDescrizione(f.getColore());
|
||||||
|
if (colore.getId_coloreFilato() > 0L) {
|
||||||
|
ArticoloFilatoColore afc = new ArticoloFilatoColore(ap);
|
||||||
|
afc.setId_articoloFilato(af.getId_articoloFilato());
|
||||||
|
afc.setId_coloreFilato(colore.getId_coloreFilato());
|
||||||
|
afc.save();
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
if (se1 > 0 && i % se1 == 0)
|
||||||
|
System.out.print(".");
|
||||||
|
if (se2 > 0 && i % se2 == 0)
|
||||||
|
System.out.println(String.valueOf(i) + " / ");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (importTessuti) {
|
||||||
|
ColoreFilato colore = new ColoreFilato(ap);
|
||||||
|
System.out.println("\nimportTessuti");
|
||||||
|
Articolo articoloS = new Articolo(apSource);
|
||||||
|
i = 0;
|
||||||
|
Vectumerator vecArticoli = articoloS.findAll();
|
||||||
|
while (vecArticoli.hasMoreElements()) {
|
||||||
|
Articolo a = (Articolo)vecArticoli.nextElement();
|
||||||
|
ArticoloTessuto articoloTessuto = new ArticoloTessuto(ap);
|
||||||
|
articoloTessuto.setCodiceAT(a.getId_articolo());
|
||||||
|
if (a.getFlgTipoArticolo().equals("G")) {
|
||||||
|
articoloTessuto.setFlgTipoTessutoM(0L);
|
||||||
|
} else if (a.getFlgTipoArticolo().equals("F")) {
|
||||||
|
articoloTessuto.setFlgTipoTessutoM(1L);
|
||||||
|
} else if (a.getFlgTipoArticolo().equals("A")) {
|
||||||
|
articoloTessuto.setFlgTipoTessutoM(2L);
|
||||||
|
} else if (a.getFlgTipoArticolo().equals("L")) {
|
||||||
|
articoloTessuto.setFlgTipoTessutoM(3L);
|
||||||
|
}
|
||||||
|
articoloTessuto.setDescrizione(a.getDescrizione());
|
||||||
|
articoloTessuto.setDescLavorazione(a.getLavorazione());
|
||||||
|
articoloTessuto.setId_tipo(3L);
|
||||||
|
articoloTessuto.setId_iva(1L);
|
||||||
|
articoloTessuto.save();
|
||||||
|
i++;
|
||||||
|
if (se1 > 0 && i % se1 == 0)
|
||||||
|
System.out.print(".");
|
||||||
|
if (se2 > 0 && i % se2 == 0)
|
||||||
|
System.out.println(String.valueOf(i) + " / ");
|
||||||
|
}
|
||||||
|
System.out.println("\nimportTessuti: padre e accoppiati");
|
||||||
|
i = 0;
|
||||||
|
vecArticoli = articoloS.findAll();
|
||||||
|
ArticoloTessuto at = new ArticoloTessuto(ap);
|
||||||
|
ArticoloTessuto at2 = new ArticoloTessuto(ap);
|
||||||
|
while (vecArticoli.hasMoreElements()) {
|
||||||
|
Articolo a = (Articolo)vecArticoli.nextElement();
|
||||||
|
at.findByCodice(a.getId_articolo());
|
||||||
|
if (!a.getId_articoloGreggio().isEmpty()) {
|
||||||
|
at2.findByCodice(a.getId_articoloGreggio());
|
||||||
|
if (at2.getDBState() == 1) {
|
||||||
|
at.setId_articoloTessutoPadre(at2.getId_articoloTessuto());
|
||||||
|
at.save();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!a.getId_articoloXAccoppiatura1().isEmpty()) {
|
||||||
|
at2.findByCodice(a.getId_articoloXAccoppiatura1());
|
||||||
|
if (at2.getDBState() == 1) {
|
||||||
|
ArticoloTessutoAccoppiato ata = new ArticoloTessutoAccoppiato(ap);
|
||||||
|
ata.setId_articoloTessuto(at.getId_articoloTessuto());
|
||||||
|
ata.setId_articoloTessutoComponente(at2.getId_articoloTessuto());
|
||||||
|
ata.save();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!a.getId_articoloXAccoppiatura2().isEmpty()) {
|
||||||
|
at2.findByCodice(a.getId_articoloXAccoppiatura2());
|
||||||
|
if (at2.getDBState() == 1) {
|
||||||
|
ArticoloTessutoAccoppiato ata = new ArticoloTessutoAccoppiato(ap);
|
||||||
|
ata.setId_articoloTessuto(at.getId_articoloTessuto());
|
||||||
|
ata.setId_articoloTessutoComponente(at2.getId_articoloTessuto());
|
||||||
|
ata.save();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
if (se1 > 0 && i % se1 == 0)
|
||||||
|
System.out.print(".");
|
||||||
|
if (se2 > 0 && i % se2 == 0)
|
||||||
|
System.out.println(String.valueOf(i) + " / ");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
System.out.println("fine ciclo \n" + msg.toString());
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
3
rus/WEB-INF/lib/abliaDbCom_src/META-INF/MANIFEST.MF
Normal file
3
rus/WEB-INF/lib/abliaDbCom_src/META-INF/MANIFEST.MF
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
Manifest-Version: 1.0
|
||||||
|
Sealed: true
|
||||||
|
|
||||||
75
rus/WEB-INF/lib/abliaDbCom_src/SalvaArticoli.java
Normal file
75
rus/WEB-INF/lib/abliaDbCom_src/SalvaArticoli.java
Normal file
|
|
@ -0,0 +1,75 @@
|
||||||
|
import com.ablia.art.Articolo;
|
||||||
|
import com.ablia.db.ApplParm;
|
||||||
|
import com.ablia.db.ApplParmFull;
|
||||||
|
import com.ablia.util.DbConsole;
|
||||||
|
import com.ablia.util.Vectumerator;
|
||||||
|
import java.sql.Time;
|
||||||
|
import java.util.StringTokenizer;
|
||||||
|
|
||||||
|
public class SalvaArticoli extends DbConsole {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
SalvaArticoli bean = new SalvaArticoli();
|
||||||
|
bean.doImport();
|
||||||
|
System.exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void doImport() {
|
||||||
|
String db = "tf19";
|
||||||
|
int i = 0;
|
||||||
|
int se1 = 10;
|
||||||
|
int se2 = 100;
|
||||||
|
String hostname = "localhost";
|
||||||
|
String temp = getCi().readLine("Hostname (" + hostname + "):");
|
||||||
|
if (!temp.isEmpty())
|
||||||
|
hostname = temp;
|
||||||
|
temp = getCi().readLine("Database name (" + db + "):");
|
||||||
|
if (!temp.isEmpty())
|
||||||
|
db = temp;
|
||||||
|
System.out.println("Db: " + db);
|
||||||
|
ApplParmFull apTarget = new ApplParmFull(new ApplParm(3, "//" + hostname + "/" + db, "root", "root", 1, 10, 300));
|
||||||
|
apTarget.setDebug(false);
|
||||||
|
StringBuffer msg = new StringBuffer();
|
||||||
|
try {
|
||||||
|
Articolo bean = new Articolo(apTarget);
|
||||||
|
System.out.println("ciclo articoli");
|
||||||
|
Vectumerator vec = bean.findAll();
|
||||||
|
System.out.println("Tot Record: " + vec.getTotNumberOfRecords());
|
||||||
|
while (vec.hasMoreElements()) {
|
||||||
|
Articolo row = (Articolo)vec.nextElement();
|
||||||
|
row.save();
|
||||||
|
i++;
|
||||||
|
if (se1 > 0 && i % se1 == 0)
|
||||||
|
System.out.print(".");
|
||||||
|
if (se2 > 0 && i % se2 == 0)
|
||||||
|
System.out.println(i);
|
||||||
|
}
|
||||||
|
System.out.println("fine ciclo \n" + msg.toString());
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected Time getTimeFromString(String theTime) {
|
||||||
|
try {
|
||||||
|
if (theTime.matches("[0-9][0-9][0-9][0-9]"))
|
||||||
|
theTime = String.valueOf(theTime.substring(0, 2)) + ":" + theTime.substring(2, 4);
|
||||||
|
if (theTime.matches("[0-9]{1,2}+:[0-9]{1,2}+")) {
|
||||||
|
StringTokenizer st = new StringTokenizer(theTime, ":");
|
||||||
|
int hour = Integer.parseInt(st.nextToken());
|
||||||
|
int min = Integer.parseInt(st.nextToken());
|
||||||
|
int sec = st.hasMoreElements() ? Integer.parseInt(st.nextToken()) : 0;
|
||||||
|
return new Time((long)((hour - 1) * 3600000 + min * 60000 + sec * 1000));
|
||||||
|
}
|
||||||
|
if (theTime.matches("[0-9]{1,2}+:[0-9]{1,2}+:[0-9]{1,2}+")) {
|
||||||
|
StringTokenizer st = new StringTokenizer(theTime, ":");
|
||||||
|
int hour = Integer.parseInt(st.nextToken());
|
||||||
|
int min = Integer.parseInt(st.nextToken());
|
||||||
|
int sec = st.hasMoreElements() ? Integer.parseInt(st.nextToken()) : 0;
|
||||||
|
return new Time((long)((hour - 1) * 3600000 + min * 60000 + sec * 1000));
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
} catch (Exception e) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
89
rus/WEB-INF/lib/abliaDbCom_src/SalvaArticoliPerListino.java
Normal file
89
rus/WEB-INF/lib/abliaDbCom_src/SalvaArticoliPerListino.java
Normal file
|
|
@ -0,0 +1,89 @@
|
||||||
|
import com.ablia.anag.Listino;
|
||||||
|
import com.ablia.anag.ListinoArticolo;
|
||||||
|
import com.ablia.art.Articolo;
|
||||||
|
import com.ablia.db.ApplParm;
|
||||||
|
import com.ablia.db.ApplParmFull;
|
||||||
|
import com.ablia.util.DbConsole;
|
||||||
|
import com.ablia.util.Vectumerator;
|
||||||
|
import java.sql.Time;
|
||||||
|
import java.util.StringTokenizer;
|
||||||
|
|
||||||
|
public class SalvaArticoliPerListino extends DbConsole {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
SalvaArticoliPerListino bean = new SalvaArticoliPerListino();
|
||||||
|
bean.doImport();
|
||||||
|
System.exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void doImport() {
|
||||||
|
String db = "guidoreni";
|
||||||
|
int i = 0;
|
||||||
|
int se1 = 10;
|
||||||
|
int se2 = 100;
|
||||||
|
String hostname = "www.lanificiozanieri.eu";
|
||||||
|
String temp = getCi().readLine("Hostname (" + hostname + "):");
|
||||||
|
if (!temp.isEmpty())
|
||||||
|
hostname = temp;
|
||||||
|
temp = getCi().readLine("Database name (" + db + "):");
|
||||||
|
if (!temp.isEmpty())
|
||||||
|
db = temp;
|
||||||
|
System.out.println("Db: " + db);
|
||||||
|
ApplParmFull apTarget = new ApplParmFull(new ApplParm(3, "//" + hostname + "/" + db, "root", "root", 1, 10, 300));
|
||||||
|
apTarget.setDebug(false);
|
||||||
|
StringBuffer msg = new StringBuffer();
|
||||||
|
try {
|
||||||
|
Articolo bean = new Articolo(apTarget);
|
||||||
|
System.out.println("ciclo articoli");
|
||||||
|
Vectumerator<Articolo> vec = bean.findAll();
|
||||||
|
Listino lis = Listino.dammiListinoBase(apTarget);
|
||||||
|
System.out.println("Tot Record: " + vec.getTotNumberOfRecords());
|
||||||
|
while (vec.hasMoreElements()) {
|
||||||
|
Articolo row = (Articolo)vec.nextElement();
|
||||||
|
ListinoArticolo la = new ListinoArticolo(apTarget);
|
||||||
|
la.findByArticoloListino(row.getId_articolo(), lis.getId_listino());
|
||||||
|
la.setId_articolo(row.getId_articolo());
|
||||||
|
la.setId_listino(lis.getId_listino());
|
||||||
|
la.setPrezzoLA(row.getImportListinoPrezzoPubblico());
|
||||||
|
la.setPrezzoOffertaLA(row.getImportListinoPrezzoOfferta());
|
||||||
|
la.setDataScadenzaOffertaLA(row.getImportListinoDataScadenzaOfferta());
|
||||||
|
la.setAbbuonoPrezzoPubblicoLA(row.getImportListinoAbbuonoPrezzoPubblico());
|
||||||
|
la.setPercLA(row.getImportListinoPercSconto());
|
||||||
|
la.setDataCambiamentoPrezzoLA(row.getImportListinoDataCambiamentoPrezzo());
|
||||||
|
la.setAbbuonoPrezzoPubblicoLA(row.getImportAbbuonoPrezzoPubblico());
|
||||||
|
la.save();
|
||||||
|
i++;
|
||||||
|
if (se1 > 0 && i % se1 == 0)
|
||||||
|
System.out.print(".");
|
||||||
|
if (se2 > 0 && i % se2 == 0)
|
||||||
|
System.out.println(i);
|
||||||
|
}
|
||||||
|
System.out.println("fine ciclo \n" + msg.toString());
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected Time getTimeFromString(String theTime) {
|
||||||
|
try {
|
||||||
|
if (theTime.matches("[0-9][0-9][0-9][0-9]"))
|
||||||
|
theTime = String.valueOf(theTime.substring(0, 2)) + ":" + theTime.substring(2, 4);
|
||||||
|
if (theTime.matches("[0-9]{1,2}+:[0-9]{1,2}+")) {
|
||||||
|
StringTokenizer st = new StringTokenizer(theTime, ":");
|
||||||
|
int hour = Integer.parseInt(st.nextToken());
|
||||||
|
int min = Integer.parseInt(st.nextToken());
|
||||||
|
int sec = st.hasMoreElements() ? Integer.parseInt(st.nextToken()) : 0;
|
||||||
|
return new Time((long)((hour - 1) * 3600000 + min * 60000 + sec * 1000));
|
||||||
|
}
|
||||||
|
if (theTime.matches("[0-9]{1,2}+:[0-9]{1,2}+:[0-9]{1,2}+")) {
|
||||||
|
StringTokenizer st = new StringTokenizer(theTime, ":");
|
||||||
|
int hour = Integer.parseInt(st.nextToken());
|
||||||
|
int min = Integer.parseInt(st.nextToken());
|
||||||
|
int sec = st.hasMoreElements() ? Integer.parseInt(st.nextToken()) : 0;
|
||||||
|
return new Time((long)((hour - 1) * 3600000 + min * 60000 + sec * 1000));
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
} catch (Exception e) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
79
rus/WEB-INF/lib/abliaDbCom_src/SalvaTessuti.java
Normal file
79
rus/WEB-INF/lib/abliaDbCom_src/SalvaTessuti.java
Normal file
|
|
@ -0,0 +1,79 @@
|
||||||
|
import com.ablia.db.ApplParm;
|
||||||
|
import com.ablia.db.ApplParmFull;
|
||||||
|
import com.ablia.db.DBAdapter;
|
||||||
|
import com.ablia.tex.anag.ArticoloTessuto;
|
||||||
|
import com.ablia.util.DbConsole;
|
||||||
|
import com.ablia.util.Vectumerator;
|
||||||
|
import java.sql.Time;
|
||||||
|
import java.util.StringTokenizer;
|
||||||
|
|
||||||
|
public class SalvaTessuti extends DbConsole {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
SalvaTessuti bean = new SalvaTessuti();
|
||||||
|
bean.doImport();
|
||||||
|
System.exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void doImport() {
|
||||||
|
String db = "tf19";
|
||||||
|
int i = 0;
|
||||||
|
int se1 = 10;
|
||||||
|
int se2 = 100;
|
||||||
|
String hostname = "localhost";
|
||||||
|
String temp = getCi().readLine("Hostname (" + hostname + "):");
|
||||||
|
if (!temp.isEmpty())
|
||||||
|
hostname = temp;
|
||||||
|
temp = getCi().readLine("Database name (" + db + "):");
|
||||||
|
if (!temp.isEmpty())
|
||||||
|
db = temp;
|
||||||
|
System.out.println("Db: " + db);
|
||||||
|
ApplParmFull apTarget = new ApplParmFull(new ApplParm(3, "//" + hostname + "/" + db, "root", "root", 1, 10, 300));
|
||||||
|
apTarget.setDebug(false);
|
||||||
|
StringBuffer msg = new StringBuffer();
|
||||||
|
try {
|
||||||
|
ArticoloTessuto bean = new ArticoloTessuto(apTarget);
|
||||||
|
System.out.println("ciclo tessuti");
|
||||||
|
Vectumerator vec = bean.findAll();
|
||||||
|
System.out.println("Tot Record: " + vec.getTotNumberOfRecords());
|
||||||
|
while (vec.hasMoreElements()) {
|
||||||
|
ArticoloTessuto row = (ArticoloTessuto)vec.nextElement();
|
||||||
|
if (row.getCodiceAT().length() < 4) {
|
||||||
|
row.setCodiceAT(DBAdapter.zeroLeft(row.getCodiceAT(), 4));
|
||||||
|
row.superSave();
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
if (se1 > 0 && i % se1 == 0)
|
||||||
|
System.out.print(".");
|
||||||
|
if (se2 > 0 && i % se2 == 0)
|
||||||
|
System.out.println(i);
|
||||||
|
}
|
||||||
|
System.out.println("fine ciclo \n" + msg.toString());
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected Time getTimeFromString(String theTime) {
|
||||||
|
try {
|
||||||
|
if (theTime.matches("[0-9][0-9][0-9][0-9]"))
|
||||||
|
theTime = String.valueOf(theTime.substring(0, 2)) + ":" + theTime.substring(2, 4);
|
||||||
|
if (theTime.matches("[0-9]{1,2}+:[0-9]{1,2}+")) {
|
||||||
|
StringTokenizer st = new StringTokenizer(theTime, ":");
|
||||||
|
int hour = Integer.parseInt(st.nextToken());
|
||||||
|
int min = Integer.parseInt(st.nextToken());
|
||||||
|
int sec = st.hasMoreElements() ? Integer.parseInt(st.nextToken()) : 0;
|
||||||
|
return new Time((long)((hour - 1) * 3600000 + min * 60000 + sec * 1000));
|
||||||
|
}
|
||||||
|
if (theTime.matches("[0-9]{1,2}+:[0-9]{1,2}+:[0-9]{1,2}+")) {
|
||||||
|
StringTokenizer st = new StringTokenizer(theTime, ":");
|
||||||
|
int hour = Integer.parseInt(st.nextToken());
|
||||||
|
int min = Integer.parseInt(st.nextToken());
|
||||||
|
int sec = st.hasMoreElements() ? Integer.parseInt(st.nextToken()) : 0;
|
||||||
|
return new Time((long)((hour - 1) * 3600000 + min * 60000 + sec * 1000));
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
} catch (Exception e) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
84
rus/WEB-INF/lib/abliaDbCom_src/SalvaTipi.java
Normal file
84
rus/WEB-INF/lib/abliaDbCom_src/SalvaTipi.java
Normal file
|
|
@ -0,0 +1,84 @@
|
||||||
|
import com.ablia.art.Tipo;
|
||||||
|
import com.ablia.db.ApplParm;
|
||||||
|
import com.ablia.db.ApplParmFull;
|
||||||
|
import com.ablia.util.DbConsole;
|
||||||
|
import com.ablia.util.Vectumerator;
|
||||||
|
import java.net.URLEncoder;
|
||||||
|
import java.sql.Time;
|
||||||
|
import java.util.StringTokenizer;
|
||||||
|
|
||||||
|
public class SalvaTipi extends DbConsole {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
SalvaTipi bean = new SalvaTipi();
|
||||||
|
System.out.println(URLEncoder.encode("e:/public"));
|
||||||
|
bean.doImport();
|
||||||
|
System.exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void doImport() {
|
||||||
|
String db = "guidoreni";
|
||||||
|
int i = 0;
|
||||||
|
int se1 = 10;
|
||||||
|
int se2 = 100;
|
||||||
|
String hostname = "localhost";
|
||||||
|
String temp = getCi().readLine("Hostname (" + hostname + "):");
|
||||||
|
if (!temp.isEmpty())
|
||||||
|
hostname = temp;
|
||||||
|
temp = getCi().readLine("Database name (" + db + "):");
|
||||||
|
if (!temp.isEmpty())
|
||||||
|
db = temp;
|
||||||
|
System.out.println("Db: " + db);
|
||||||
|
ApplParmFull apTarget = new ApplParmFull(new ApplParm(3, "//" + hostname + "/" + db, "root",
|
||||||
|
"root", 1, 10, 300));
|
||||||
|
apTarget.setDebug(false);
|
||||||
|
StringBuffer msg = new StringBuffer();
|
||||||
|
try {
|
||||||
|
Tipo bean = new Tipo(apTarget);
|
||||||
|
bean.update("UPDATE ARTICOLO SET flgEscludiWebArt=-1");
|
||||||
|
System.out.println("ciclo tipi ");
|
||||||
|
Vectumerator vec = bean.findAll();
|
||||||
|
System.out.println("Tot Record: " + vec.getTotNumberOfRecords());
|
||||||
|
while (vec.hasMoreElements()) {
|
||||||
|
Tipo row = (Tipo)vec.nextElement();
|
||||||
|
row.save();
|
||||||
|
i++;
|
||||||
|
if (se1 > 0 && i % se1 == 0)
|
||||||
|
System.out.print(".");
|
||||||
|
if (se2 > 0 && i % se2 == 0)
|
||||||
|
System.out.println(i);
|
||||||
|
}
|
||||||
|
System.out.println("\n" + msg.toString());
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected Time getTimeFromString(String theTime) {
|
||||||
|
try {
|
||||||
|
if (theTime.matches("[0-9][0-9][0-9][0-9]"))
|
||||||
|
theTime = String.valueOf(theTime.substring(0, 2)) + ":" +
|
||||||
|
theTime.substring(2, 4);
|
||||||
|
if (theTime.matches("[0-9]{1,2}+:[0-9]{1,2}+")) {
|
||||||
|
StringTokenizer st = new StringTokenizer(theTime, ":");
|
||||||
|
int hour = Integer.parseInt(st.nextToken());
|
||||||
|
int min = Integer.parseInt(st.nextToken());
|
||||||
|
int sec = st.hasMoreElements() ? Integer.parseInt(
|
||||||
|
st.nextToken()) : 0;
|
||||||
|
return new Time(
|
||||||
|
(long)((hour - 1) * 3600000 + min * 60000 + sec * 1000));
|
||||||
|
}
|
||||||
|
if (theTime.matches("[0-9]{1,2}+:[0-9]{1,2}+:[0-9]{1,2}+")) {
|
||||||
|
StringTokenizer st = new StringTokenizer(theTime, ":");
|
||||||
|
int hour = Integer.parseInt(st.nextToken());
|
||||||
|
int min = Integer.parseInt(st.nextToken());
|
||||||
|
int sec = st.hasMoreElements() ? Integer.parseInt(
|
||||||
|
st.nextToken()) : 0;
|
||||||
|
return new Time(
|
||||||
|
(long)((hour - 1) * 3600000 + min * 60000 + sec * 1000));
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
} catch (Exception e) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
50
rus/WEB-INF/lib/abliaDbCom_src/SaveDocumento.java
Normal file
50
rus/WEB-INF/lib/abliaDbCom_src/SaveDocumento.java
Normal file
|
|
@ -0,0 +1,50 @@
|
||||||
|
import com.ablia.contab.Documento;
|
||||||
|
import com.ablia.contab.DocumentoCR;
|
||||||
|
import com.ablia.db.ApplParm;
|
||||||
|
import com.ablia.db.ApplParmFull;
|
||||||
|
import com.ablia.util.DbConsole;
|
||||||
|
import com.ablia.util.Vectumerator;
|
||||||
|
|
||||||
|
public class SaveDocumento extends DbConsole {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
SaveDocumento bean = new SaveDocumento();
|
||||||
|
bean.doImport();
|
||||||
|
System.exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void doImport() {
|
||||||
|
String db = "tf19";
|
||||||
|
int i = 0;
|
||||||
|
int se1 = 10;
|
||||||
|
int se2 = 100;
|
||||||
|
String hostname = "www.tuttofoto.com";
|
||||||
|
String temp = getCi().readLine("Hostname (" + hostname + "):");
|
||||||
|
if (!temp.isEmpty())
|
||||||
|
hostname = temp;
|
||||||
|
temp = getCi().readLine("Database name (" + db + "):");
|
||||||
|
if (!temp.isEmpty())
|
||||||
|
db = temp;
|
||||||
|
System.out.println("Db: " + db);
|
||||||
|
ApplParmFull apTarget = new ApplParmFull(new ApplParm(3, "//" + hostname + "/" + db, "root", "root", 1, 10, 300));
|
||||||
|
apTarget.setDebug(false);
|
||||||
|
StringBuffer msg = new StringBuffer();
|
||||||
|
try {
|
||||||
|
DocumentoCR CR = new DocumentoCR();
|
||||||
|
CR.setId_tipoDocumento(21L);
|
||||||
|
Vectumerator<Documento> vec = new Documento(apTarget).findByCR(CR, 0, 0);
|
||||||
|
System.out.println("TOT RECORD: " + vec.getTotNumberOfRecords());
|
||||||
|
while (vec.hasMoreElements()) {
|
||||||
|
Documento row = (Documento)vec.nextElement();
|
||||||
|
row.save();
|
||||||
|
i++;
|
||||||
|
if (se1 > 0 && i % se1 == 0)
|
||||||
|
System.out.print(".");
|
||||||
|
if (se2 > 0 && i % se2 == 0)
|
||||||
|
System.out.println(i);
|
||||||
|
}
|
||||||
|
System.out.println("\n\n ------------- Fine ----------------");
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
74
rus/WEB-INF/lib/abliaDbCom_src/TestExport.java
Normal file
74
rus/WEB-INF/lib/abliaDbCom_src/TestExport.java
Normal file
|
|
@ -0,0 +1,74 @@
|
||||||
|
import com.ablia.common.DescTxtLang;
|
||||||
|
import com.ablia.db.ApplParm;
|
||||||
|
import com.ablia.db.ApplParmFull;
|
||||||
|
import com.ablia.db.ResParm;
|
||||||
|
import com.ablia.util.DbConsole;
|
||||||
|
import java.sql.Time;
|
||||||
|
import java.util.StringTokenizer;
|
||||||
|
|
||||||
|
public class TestExport extends DbConsole {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
TestExport bean = new TestExport();
|
||||||
|
bean.doImport();
|
||||||
|
System.exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void doImport() {
|
||||||
|
String db = "guidoreni";
|
||||||
|
int i = 0;
|
||||||
|
int se1 = 10;
|
||||||
|
int se2 = 100;
|
||||||
|
String hostname = "localhost";
|
||||||
|
String temp = getCi().readLine("Hostname (" + hostname + "):");
|
||||||
|
if (!temp.isEmpty())
|
||||||
|
hostname = temp;
|
||||||
|
temp = getCi().readLine("Database name (" + db + "):");
|
||||||
|
if (!temp.isEmpty())
|
||||||
|
db = temp;
|
||||||
|
String dbTarget = "gaias";
|
||||||
|
System.out.println("Db: " + db);
|
||||||
|
ApplParmFull apSource = new ApplParmFull(new ApplParm(3, "//" + hostname + "/" + db, "root",
|
||||||
|
"root", 1, 10, 300));
|
||||||
|
apSource.setDebug(false);
|
||||||
|
ApplParmFull apTarget = new ApplParmFull(new ApplParm(3, "//" + hostname + "/" + dbTarget,
|
||||||
|
"root", "root", 1, 10, 300));
|
||||||
|
apSource.setDebug(false);
|
||||||
|
try {
|
||||||
|
DescTxtLang bean = new DescTxtLang(apSource);
|
||||||
|
DescTxtLang beant = new DescTxtLang(apTarget);
|
||||||
|
ResParm rp = beant.xmlImport("/Users/acolzi/test.xml");
|
||||||
|
System.out.println(rp.getMsg());
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected Time getTimeFromString(String theTime) {
|
||||||
|
try {
|
||||||
|
if (theTime.matches("[0-9][0-9][0-9][0-9]"))
|
||||||
|
theTime = String.valueOf(theTime.substring(0, 2)) + ":" +
|
||||||
|
theTime.substring(2, 4);
|
||||||
|
if (theTime.matches("[0-9]{1,2}+:[0-9]{1,2}+")) {
|
||||||
|
StringTokenizer st = new StringTokenizer(theTime, ":");
|
||||||
|
int hour = Integer.parseInt(st.nextToken());
|
||||||
|
int min = Integer.parseInt(st.nextToken());
|
||||||
|
int sec = st.hasMoreElements() ? Integer.parseInt(
|
||||||
|
st.nextToken()) : 0;
|
||||||
|
return new Time(
|
||||||
|
(long)((hour - 1) * 3600000 + min * 60000 + sec * 1000));
|
||||||
|
}
|
||||||
|
if (theTime.matches("[0-9]{1,2}+:[0-9]{1,2}+:[0-9]{1,2}+")) {
|
||||||
|
StringTokenizer st = new StringTokenizer(theTime, ":");
|
||||||
|
int hour = Integer.parseInt(st.nextToken());
|
||||||
|
int min = Integer.parseInt(st.nextToken());
|
||||||
|
int sec = st.hasMoreElements() ? Integer.parseInt(
|
||||||
|
st.nextToken()) : 0;
|
||||||
|
return new Time(
|
||||||
|
(long)((hour - 1) * 3600000 + min * 60000 + sec * 1000));
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
} catch (Exception e) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
84
rus/WEB-INF/lib/abliaDbCom_src/TestReflection.java
Normal file
84
rus/WEB-INF/lib/abliaDbCom_src/TestReflection.java
Normal file
|
|
@ -0,0 +1,84 @@
|
||||||
|
import com.ablia.contab.DocumentoCR;
|
||||||
|
import com.ablia.db.CRAdapter;
|
||||||
|
import java.lang.reflect.Field;
|
||||||
|
import java.lang.reflect.InvocationTargetException;
|
||||||
|
import java.lang.reflect.Method;
|
||||||
|
import java.sql.Date;
|
||||||
|
import java.sql.Time;
|
||||||
|
|
||||||
|
public class TestReflection {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
DocumentoCR CR = new DocumentoCR();
|
||||||
|
CR.setFlgClienteFornitore("99");
|
||||||
|
CR.setDataChiusuraA(new Date(0L));
|
||||||
|
Field[] ff1 = CR.getClass().getDeclaredFields();
|
||||||
|
for (int i = 0; i < ff1.length; i++) {
|
||||||
|
String name = ff1[i].getName();
|
||||||
|
String functionName = "get" + name.substring(0, 1).toUpperCase() + name.substring(1);
|
||||||
|
Object valueUpd = getFunctionName(functionName, ff1[i].getType(), CR);
|
||||||
|
if (isNotEmpty(valueUpd, ff1[i].getType())) {
|
||||||
|
System.out.print(String.valueOf(ff1[i].getName()) + ": ");
|
||||||
|
System.out.println(valueUpd);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static boolean isNotEmpty(Object valueUpd, Class<?> tipo) {
|
||||||
|
boolean ret = false;
|
||||||
|
if (valueUpd != null) {
|
||||||
|
String sclass = valueUpd.getClass().getName();
|
||||||
|
if (sclass.indexOf("Long") > 0 || sclass.indexOf("Double") > 0 || sclass.indexOf("String") > 0 || sclass.indexOf("Date") > 0 ||
|
||||||
|
sclass.indexOf("Time") > 0)
|
||||||
|
if (tipo.getName() == "long") {
|
||||||
|
if ((Long)valueUpd == 0L || (Long)valueUpd == -1L) {
|
||||||
|
ret = false;
|
||||||
|
} else {
|
||||||
|
ret = true;
|
||||||
|
}
|
||||||
|
} else if (tipo.getName() == "double") {
|
||||||
|
if ((Double)valueUpd == 0.0D) {
|
||||||
|
ret = false;
|
||||||
|
} else {
|
||||||
|
ret = true;
|
||||||
|
}
|
||||||
|
} else if (tipo.getName().indexOf("String") > 0) {
|
||||||
|
if (((String)valueUpd).equals("") || ((String)valueUpd).isEmpty()) {
|
||||||
|
ret = false;
|
||||||
|
} else {
|
||||||
|
ret = true;
|
||||||
|
}
|
||||||
|
} else if (tipo.getName().indexOf("Date") > 0) {
|
||||||
|
Date data = (Date)valueUpd;
|
||||||
|
if (data == null) {
|
||||||
|
ret = false;
|
||||||
|
} else {
|
||||||
|
ret = true;
|
||||||
|
}
|
||||||
|
} else if (tipo.getName().indexOf("Time") > 0) {
|
||||||
|
if ((Time)valueUpd == null) {
|
||||||
|
ret = false;
|
||||||
|
} else {
|
||||||
|
ret = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static Object getFunctionName(String functionName, Class<?> tipo, CRAdapter thiss) {
|
||||||
|
Object value = null;
|
||||||
|
try {
|
||||||
|
Method method = thiss.getClass().getMethod(functionName);
|
||||||
|
value = method.invoke(thiss);
|
||||||
|
} catch (SecurityException e) {
|
||||||
|
|
||||||
|
} catch (NoSuchMethodException e) {
|
||||||
|
|
||||||
|
} catch (IllegalArgumentException e) {
|
||||||
|
|
||||||
|
} catch (IllegalAccessException e) {
|
||||||
|
|
||||||
|
} catch (InvocationTargetException e) {}
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
}
|
||||||
233
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/AbiCab.java
Normal file
233
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/AbiCab.java
Normal file
|
|
@ -0,0 +1,233 @@
|
||||||
|
package com.ablia.anag;
|
||||||
|
|
||||||
|
import com.ablia.db.ApplParmFull;
|
||||||
|
import com.ablia.db.DBAdapter;
|
||||||
|
import com.ablia.db.ResParm;
|
||||||
|
import com.ablia.db.WcString;
|
||||||
|
import com.ablia.util.StringTokenizer;
|
||||||
|
import com.ablia.util.Vectumerator;
|
||||||
|
import java.io.BufferedReader;
|
||||||
|
import java.io.FileReader;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.sql.PreparedStatement;
|
||||||
|
import java.sql.SQLException;
|
||||||
|
|
||||||
|
public class AbiCab extends DBAdapter implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1460974609869L;
|
||||||
|
|
||||||
|
private long id_abiCab;
|
||||||
|
|
||||||
|
private String descrizione;
|
||||||
|
|
||||||
|
private String agenzia;
|
||||||
|
|
||||||
|
private String indirizzo;
|
||||||
|
|
||||||
|
private String cap;
|
||||||
|
|
||||||
|
private String abi;
|
||||||
|
|
||||||
|
private String cab;
|
||||||
|
|
||||||
|
private String bic;
|
||||||
|
|
||||||
|
private String codiceAlt;
|
||||||
|
|
||||||
|
private String localita;
|
||||||
|
|
||||||
|
private String provincia;
|
||||||
|
|
||||||
|
public AbiCab(ApplParmFull newApplParmFull) {
|
||||||
|
super(newApplParmFull);
|
||||||
|
}
|
||||||
|
|
||||||
|
public AbiCab() {}
|
||||||
|
|
||||||
|
public void setId_abiCab(long newId_abiCab) {
|
||||||
|
this.id_abiCab = newId_abiCab;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDescrizione(String newDescrizione) {
|
||||||
|
this.descrizione = newDescrizione;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAgenzia(String newAgenzia) {
|
||||||
|
this.agenzia = newAgenzia;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIndirizzo(String newIndirizzo) {
|
||||||
|
this.indirizzo = newIndirizzo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCap(String newCapZona) {
|
||||||
|
this.cap = newCapZona;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAbi(String newAbi) {
|
||||||
|
this.abi = newAbi;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCab(String newCab) {
|
||||||
|
this.cab = newCab;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBic(String newBic) {
|
||||||
|
this.bic = newBic;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCodiceAlt(String newCodiceAlt) {
|
||||||
|
this.codiceAlt = newCodiceAlt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getId_abiCab() {
|
||||||
|
return this.id_abiCab;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescrizione() {
|
||||||
|
return (this.descrizione == null) ? "" : this.descrizione.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAgenzia() {
|
||||||
|
return (this.agenzia == null) ? "" : this.agenzia.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIndirizzo() {
|
||||||
|
return (this.indirizzo == null) ? "" : this.indirizzo.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCap() {
|
||||||
|
return (this.cap == null) ? "" : this.cap.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAbi() {
|
||||||
|
return (this.abi == null) ? "" : this.abi.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCab() {
|
||||||
|
return (this.cab == null) ? "" : this.cab.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBic() {
|
||||||
|
return (this.bic == null) ? "" : this.bic.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodiceAlt() {
|
||||||
|
return (this.codiceAlt == null) ? "" : this.codiceAlt.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected ResParm checkDeleteCascade() {
|
||||||
|
return new ResParm(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void deleteCascade() {}
|
||||||
|
|
||||||
|
public Vectumerator<AbiCab> findByCR(AbiCabCR CR, int pageNumber, int pageRows) {
|
||||||
|
String s_Sql_Find = "select DISTINCT A.* from ABI_CAB AS A";
|
||||||
|
String s_Sql_Order = "";
|
||||||
|
WcString wc = new WcString();
|
||||||
|
if (!CR.getSearchTxt().trim().isEmpty()) {
|
||||||
|
StringTokenizer st = new StringTokenizer(CR.getSearchTxt().trim(), " ");
|
||||||
|
StringBuffer txt = new StringBuffer("(");
|
||||||
|
while (st.hasMoreTokens()) {
|
||||||
|
String token = st.nextToken();
|
||||||
|
txt.append("(A.Cognome like '%" + token + "%' or A.Nome like '%" + token + "%')");
|
||||||
|
if (st.hasMoreTokens())
|
||||||
|
txt.append(" and ");
|
||||||
|
}
|
||||||
|
txt.append(")");
|
||||||
|
wc.addWc(txt.toString());
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
PreparedStatement stmt = getConn().prepareStatement(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||||
|
return findRows(stmt, pageNumber, pageRows);
|
||||||
|
} catch (SQLException e) {
|
||||||
|
removeCPConnection();
|
||||||
|
handleDebug(e);
|
||||||
|
return AB_EMPTY_VECTUMERATOR;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void findByAbiCab(String l_abi, String l_cab) {
|
||||||
|
String s_Sql_Find = "select DISTINCT A.* from ABI_CAB AS A";
|
||||||
|
String s_Sql_Order = "";
|
||||||
|
WcString wc = new WcString();
|
||||||
|
wc.addWc("A.abi='" + l_abi + "'");
|
||||||
|
wc.addWc("A.cab='" + l_cab + "'");
|
||||||
|
try {
|
||||||
|
PreparedStatement stmt = getConn().prepareStatement(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||||
|
findFirstRecord(stmt);
|
||||||
|
} catch (SQLException e) {
|
||||||
|
removeCPConnection();
|
||||||
|
handleDebug(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public ResParm importAbiCab(String fileName) {
|
||||||
|
ResParm rp = new ResParm(true);
|
||||||
|
int i = 0;
|
||||||
|
int se1 = 10;
|
||||||
|
int se2 = 100;
|
||||||
|
StringBuffer msg = new StringBuffer();
|
||||||
|
try {
|
||||||
|
BufferedReader reader = new BufferedReader(new FileReader(fileName));
|
||||||
|
if (reader != null) {
|
||||||
|
reader.readLine();
|
||||||
|
String currentLine;
|
||||||
|
while ((currentLine = reader.readLine()) != null) {
|
||||||
|
StringTokenizer st = new StringTokenizer(currentLine, ";", '"');
|
||||||
|
String abi = st.getToken(0);
|
||||||
|
String cab = st.getToken(1);
|
||||||
|
String istituto = st.getToken(2);
|
||||||
|
String sportello = st.getToken(3);
|
||||||
|
String indirizzo = st.getToken(4);
|
||||||
|
String localita = st.getToken(5);
|
||||||
|
String cap = st.getToken(6);
|
||||||
|
String prov = st.getToken(7);
|
||||||
|
AbiCab bean = new AbiCab(getApFull());
|
||||||
|
bean.findByAbiCab(abi, cab);
|
||||||
|
bean.setAbi(abi);
|
||||||
|
bean.setCab(cab);
|
||||||
|
bean.setDescrizione(istituto);
|
||||||
|
bean.setAgenzia(sportello);
|
||||||
|
bean.setIndirizzo(indirizzo);
|
||||||
|
bean.setLocalita(localita);
|
||||||
|
bean.setCap(cap);
|
||||||
|
bean.setProvincia(prov);
|
||||||
|
rp = bean.save();
|
||||||
|
if (!rp.getStatus())
|
||||||
|
break;
|
||||||
|
i++;
|
||||||
|
if (se1 > 0 && i % se1 == 0)
|
||||||
|
System.out.print(".");
|
||||||
|
if (se2 > 0 && i % se2 == 0)
|
||||||
|
System.out.println(i);
|
||||||
|
}
|
||||||
|
if (rp.getStatus()) {
|
||||||
|
rp.setMsg("Inserite o aggiornate " + i + " records.");
|
||||||
|
} else {
|
||||||
|
rp.setMsg("ERRORE! " + rp.getMsg() + "\nRecord numero " + i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
rp.setStatus(false);
|
||||||
|
rp.setMsg(e);
|
||||||
|
}
|
||||||
|
return rp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLocalita() {
|
||||||
|
return (this.localita == null) ? "" : this.localita.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLocalita(String localita) {
|
||||||
|
this.localita = localita;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getProvincia() {
|
||||||
|
return (this.provincia == null) ? "" : this.provincia.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProvincia(String provincia) {
|
||||||
|
this.provincia = provincia;
|
||||||
|
}
|
||||||
|
}
|
||||||
102
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/AbiCabCR.java
Normal file
102
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/AbiCabCR.java
Normal file
|
|
@ -0,0 +1,102 @@
|
||||||
|
package com.ablia.anag;
|
||||||
|
|
||||||
|
import com.ablia.db.ApplParmFull;
|
||||||
|
import com.ablia.db.CRAdapter;
|
||||||
|
|
||||||
|
public class AbiCabCR extends CRAdapter {
|
||||||
|
private long id_abiCab;
|
||||||
|
|
||||||
|
private String descrizione;
|
||||||
|
|
||||||
|
private String agenzia;
|
||||||
|
|
||||||
|
private String indirizzo;
|
||||||
|
|
||||||
|
private String capZona;
|
||||||
|
|
||||||
|
private String abi;
|
||||||
|
|
||||||
|
private String cab;
|
||||||
|
|
||||||
|
private String bic;
|
||||||
|
|
||||||
|
private String codiceAlt;
|
||||||
|
|
||||||
|
public AbiCabCR(ApplParmFull newApplParmFull) {
|
||||||
|
super(newApplParmFull);
|
||||||
|
}
|
||||||
|
|
||||||
|
public AbiCabCR() {}
|
||||||
|
|
||||||
|
public void setId_abiCab(long newId_abiCab) {
|
||||||
|
this.id_abiCab = newId_abiCab;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDescrizione(String newDescrizione) {
|
||||||
|
this.descrizione = newDescrizione;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAgenzia(String newAgenzia) {
|
||||||
|
this.agenzia = newAgenzia;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIndirizzo(String newIndirizzo) {
|
||||||
|
this.indirizzo = newIndirizzo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCapZona(String newCapZona) {
|
||||||
|
this.capZona = newCapZona;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAbi(String newAbi) {
|
||||||
|
this.abi = newAbi;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCab(String newCab) {
|
||||||
|
this.cab = newCab;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBic(String newBic) {
|
||||||
|
this.bic = newBic;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCodiceAlt(String newCodiceAlt) {
|
||||||
|
this.codiceAlt = newCodiceAlt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getId_abiCab() {
|
||||||
|
return this.id_abiCab;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescrizione() {
|
||||||
|
return (this.descrizione == null) ? "" : this.descrizione.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAgenzia() {
|
||||||
|
return (this.agenzia == null) ? "" : this.agenzia.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIndirizzo() {
|
||||||
|
return (this.indirizzo == null) ? "" : this.indirizzo.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCapZona() {
|
||||||
|
return (this.capZona == null) ? "" : this.capZona.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAbi() {
|
||||||
|
return (this.abi == null) ? "" : this.abi.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCab() {
|
||||||
|
return (this.cab == null) ? "" : this.cab.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBic() {
|
||||||
|
return (this.bic == null) ? "" : this.bic.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodiceAlt() {
|
||||||
|
return (this.codiceAlt == null) ? "" : this.codiceAlt.trim();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,201 @@
|
||||||
|
package com.ablia.anag;
|
||||||
|
|
||||||
|
import com.ablia.db.ApplParmFull;
|
||||||
|
import com.ablia.db.WcString;
|
||||||
|
import com.ablia.util.StringTokenizer;
|
||||||
|
import com.ablia.util.Vectumerator;
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.sql.PreparedStatement;
|
||||||
|
import java.sql.SQLException;
|
||||||
|
|
||||||
|
public class AllegatoClifor extends _AnagAdapter implements Serializable {
|
||||||
|
private static final long serialVersionUID = 8911811275285647807L;
|
||||||
|
|
||||||
|
private long id_allegatoClifor;
|
||||||
|
|
||||||
|
private long id_clifor;
|
||||||
|
|
||||||
|
private long id_tipoAllegatoClifor;
|
||||||
|
|
||||||
|
private String nomeFile;
|
||||||
|
|
||||||
|
private Clifor clifor;
|
||||||
|
|
||||||
|
private TipoAllegatoClifor tipoAllegatoClifor;
|
||||||
|
|
||||||
|
private String descrizioneAllegato;
|
||||||
|
|
||||||
|
private long flgDefault;
|
||||||
|
|
||||||
|
public AllegatoClifor(ApplParmFull newApplParmFull) {
|
||||||
|
super(newApplParmFull);
|
||||||
|
}
|
||||||
|
|
||||||
|
public AllegatoClifor() {}
|
||||||
|
|
||||||
|
public void setId_allegatoClifor(long newId_allegatoClifor) {
|
||||||
|
this.id_allegatoClifor = newId_allegatoClifor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId_clifor(long newId_clifor) {
|
||||||
|
this.id_clifor = newId_clifor;
|
||||||
|
setClifor(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId_tipoAllegatoClifor(long newId_tipoAllegatoClifor) {
|
||||||
|
this.id_tipoAllegatoClifor = newId_tipoAllegatoClifor;
|
||||||
|
setTipoAllegatoClifor(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNomeFile(String newNomeFile) {
|
||||||
|
this.nomeFile = newNomeFile;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getId_allegatoClifor() {
|
||||||
|
return this.id_allegatoClifor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getId_clifor() {
|
||||||
|
return this.id_clifor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getId_tipoAllegatoClifor() {
|
||||||
|
return this.id_tipoAllegatoClifor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNomeFile() {
|
||||||
|
return (this.nomeFile == null) ? "" : this.nomeFile.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setClifor(Clifor newClifor) {
|
||||||
|
this.clifor = newClifor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Clifor getClifor() {
|
||||||
|
this.clifor = (Clifor)getSecondaryObject(this.clifor, Clifor.class, getId_clifor());
|
||||||
|
return this.clifor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTipoAllegatoClifor(TipoAllegatoClifor newTipoAllegatoClifor) {
|
||||||
|
this.tipoAllegatoClifor = newTipoAllegatoClifor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public TipoAllegatoClifor getTipoAllegatoClifor() {
|
||||||
|
this.tipoAllegatoClifor = (TipoAllegatoClifor)getSecondaryObject(this.tipoAllegatoClifor, TipoAllegatoClifor.class,
|
||||||
|
getId_tipoAllegatoClifor());
|
||||||
|
return this.tipoAllegatoClifor;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void deleteCascade() {
|
||||||
|
new File(String.valueOf(getPathAllegato()) + getNomeFileSuDisco()).delete();
|
||||||
|
}
|
||||||
|
|
||||||
|
public Vectumerator findByCR(AllegatoCliforCR CR, int pageNumber, int pageRows) {
|
||||||
|
String s_Sql_Find = "select DISTINCT A.* from ALLEGATO_CLIFOR AS A";
|
||||||
|
String s_Sql_Order = "";
|
||||||
|
WcString wc = new WcString();
|
||||||
|
if (!CR.getSearchTxt().trim().isEmpty()) {
|
||||||
|
StringTokenizer st = new StringTokenizer(CR.getSearchTxt().trim(), " ");
|
||||||
|
StringBuffer txt = new StringBuffer("(");
|
||||||
|
while (st.hasMoreTokens()) {
|
||||||
|
String token = st.nextToken();
|
||||||
|
txt.append("(A.Cognome like '%" + token + "%' or A.Nome like '%" + token + "%')");
|
||||||
|
if (st.hasMoreTokens())
|
||||||
|
txt.append(" and ");
|
||||||
|
}
|
||||||
|
txt.append(")");
|
||||||
|
wc.addWc(txt.toString());
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
PreparedStatement stmt = getConn().prepareStatement(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||||
|
return findRows(stmt, pageNumber, pageRows);
|
||||||
|
} catch (SQLException e) {
|
||||||
|
removeCPConnection();
|
||||||
|
handleDebug(e);
|
||||||
|
return AB_EMPTY_VECTUMERATOR;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void findByCliforNomeFile(long l_id_clifor, String l_id_nomeFile) {
|
||||||
|
String s_Sql_Find = "select DISTINCT A.* from ALLEGATO_CLIFOR AS A";
|
||||||
|
String s_Sql_Order = "";
|
||||||
|
WcString wc = new WcString();
|
||||||
|
wc.addWc("A.id_clifor=" + l_id_clifor);
|
||||||
|
wc.addWc("A.nomeFile='" + l_id_nomeFile + "'");
|
||||||
|
try {
|
||||||
|
PreparedStatement stmt = getConn().prepareStatement(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||||
|
findFirstRecord(stmt);
|
||||||
|
} catch (SQLException e) {
|
||||||
|
handleDebug(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public Vectumerator findByCliforTipo(long l_id_clifor, long l_id_tipoAllegatoClifor, int pageNumber, int pageRows) {
|
||||||
|
String s_Sql_Find = "select DISTINCT A.* from ALLEGATO_CLIFOR AS A";
|
||||||
|
String s_Sql_Order = " order by A.nomeFile";
|
||||||
|
WcString wc = new WcString();
|
||||||
|
wc.addWc("A.id_clifor=" + l_id_clifor);
|
||||||
|
if (l_id_tipoAllegatoClifor > 0L)
|
||||||
|
wc.addWc("A.id_tipoAllegatoClifor=" + l_id_tipoAllegatoClifor);
|
||||||
|
try {
|
||||||
|
PreparedStatement stmt = getConn().prepareStatement(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||||
|
return findRows(stmt, pageNumber, pageRows);
|
||||||
|
} catch (SQLException e) {
|
||||||
|
handleDebug(e);
|
||||||
|
return AB_EMPTY_VECTUMERATOR;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNomeFileSuDisco() {
|
||||||
|
return String.valueOf(getId_clifor()) + "_" + getNomeFile();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescrizioneAllegato() {
|
||||||
|
return (this.descrizioneAllegato == null) ? "" : this.descrizioneAllegato;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDescrizioneAllegato(String descrizioneAllegato) {
|
||||||
|
this.descrizioneAllegato = descrizioneAllegato;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected int getStringValueCase(String l_colomnName) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getFlgDefault() {
|
||||||
|
return this.flgDefault;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFlgDefault(long flgDefault) {
|
||||||
|
this.flgDefault = flgDefault;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void findByCliforDefault(long l_id_clifor) {
|
||||||
|
String s_Sql_Find = "select DISTINCT A.* from ALLEGATO_CLIFOR AS A";
|
||||||
|
String s_Sql_Order = " order by A.nomeFile";
|
||||||
|
WcString wc = new WcString();
|
||||||
|
wc.addWc("A.id_clifor = " + l_id_clifor);
|
||||||
|
wc.addWc("A.flgDefault = 1");
|
||||||
|
try {
|
||||||
|
PreparedStatement stmt = getConn().prepareStatement(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||||
|
findFirstRecord(stmt);
|
||||||
|
} catch (SQLException e) {
|
||||||
|
handleDebug(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void prepareSave(PreparedStatement ps) throws Exception {
|
||||||
|
if (getFlgDefault() == 1L) {
|
||||||
|
AllegatoClifor ac = new AllegatoClifor(getApFull());
|
||||||
|
Vectumerator<AllegatoClifor> vec = new Vectumerator();
|
||||||
|
vec = ac.findByCliforTipo(getId_clifor(), 0L, 0, 0);
|
||||||
|
while (vec.hasMoreElements()) {
|
||||||
|
ac = (AllegatoClifor)vec.nextElement();
|
||||||
|
ac.setFlgDefault(0L);
|
||||||
|
ac.save();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
super.prepareSave(ps);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,80 @@
|
||||||
|
package com.ablia.anag;
|
||||||
|
|
||||||
|
import com.ablia.db.ApplParmFull;
|
||||||
|
import com.ablia.db.CRAdapter;
|
||||||
|
|
||||||
|
public class AllegatoCliforCR extends CRAdapter {
|
||||||
|
private long id_allegatoClifor;
|
||||||
|
|
||||||
|
private long id_clifor;
|
||||||
|
|
||||||
|
private long id_tipoAllegatoClifor;
|
||||||
|
|
||||||
|
private String nomeFile;
|
||||||
|
|
||||||
|
private Clifor clifor;
|
||||||
|
|
||||||
|
private TipoAllegatoClifor tipoAllegatoClifor;
|
||||||
|
|
||||||
|
public AllegatoCliforCR(ApplParmFull newApplParmFull) {
|
||||||
|
super(newApplParmFull);
|
||||||
|
}
|
||||||
|
|
||||||
|
public AllegatoCliforCR() {}
|
||||||
|
|
||||||
|
public void setId_allegatoClifor(long newId_allegatoClifor) {
|
||||||
|
this.id_allegatoClifor = newId_allegatoClifor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId_clifor(long newId_clifor) {
|
||||||
|
this.id_clifor = newId_clifor;
|
||||||
|
setClifor(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId_tipoAllegatoClifor(long newId_tipoAllegatoClifor) {
|
||||||
|
this.id_tipoAllegatoClifor = newId_tipoAllegatoClifor;
|
||||||
|
setTipoAllegatoClifor(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNomeFile(String newNomeFile) {
|
||||||
|
this.nomeFile = newNomeFile;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getId_allegatoClifor() {
|
||||||
|
return this.id_allegatoClifor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getId_clifor() {
|
||||||
|
return this.id_clifor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getId_tipoAllegatoClifor() {
|
||||||
|
return this.id_tipoAllegatoClifor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNomeFile() {
|
||||||
|
return (this.nomeFile == null) ? "" : this.nomeFile.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setClifor(Clifor newClifor) {
|
||||||
|
this.clifor = newClifor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Clifor getClifor() {
|
||||||
|
this.clifor = (Clifor)getSecondaryObject(
|
||||||
|
this.clifor,
|
||||||
|
Clifor.class, getId_clifor());
|
||||||
|
return this.clifor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTipoAllegatoClifor(TipoAllegatoClifor newTipoAllegatoClifor) {
|
||||||
|
this.tipoAllegatoClifor = newTipoAllegatoClifor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public TipoAllegatoClifor getTipoAllegatoClifor() {
|
||||||
|
this.tipoAllegatoClifor = (TipoAllegatoClifor)getSecondaryObject(
|
||||||
|
this.tipoAllegatoClifor,
|
||||||
|
TipoAllegatoClifor.class, getId_tipoAllegatoClifor());
|
||||||
|
return this.tipoAllegatoClifor;
|
||||||
|
}
|
||||||
|
}
|
||||||
64
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/Aspetto.java
Normal file
64
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/Aspetto.java
Normal file
|
|
@ -0,0 +1,64 @@
|
||||||
|
package com.ablia.anag;
|
||||||
|
|
||||||
|
import com.ablia.db.ApplParmFull;
|
||||||
|
import com.ablia.db.WcString;
|
||||||
|
import com.ablia.util.StringTokenizer;
|
||||||
|
import com.ablia.util.Vectumerator;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.sql.PreparedStatement;
|
||||||
|
import java.sql.SQLException;
|
||||||
|
|
||||||
|
public class Aspetto extends _AnagAdapter implements Serializable {
|
||||||
|
private long id_aspetto;
|
||||||
|
|
||||||
|
private String descrizione;
|
||||||
|
|
||||||
|
public Aspetto(ApplParmFull newApplParmFull) {
|
||||||
|
super(newApplParmFull);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Aspetto() {}
|
||||||
|
|
||||||
|
public void setId_aspetto(long newId_aspetto) {
|
||||||
|
this.id_aspetto = newId_aspetto;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDescrizione(String newDescrizione) {
|
||||||
|
this.descrizione = newDescrizione;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getId_aspetto() {
|
||||||
|
return this.id_aspetto;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescrizione() {
|
||||||
|
return (this.descrizione == null) ? "" : this.descrizione.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void deleteCascade() {}
|
||||||
|
|
||||||
|
public Vectumerator findByCR(AspettoCR CR, int pageNumber, int pageRows) {
|
||||||
|
String s_Sql_Find = "select DISTINCT A.* from ASPETTO AS A";
|
||||||
|
String s_Sql_Order = "";
|
||||||
|
WcString wc = new WcString();
|
||||||
|
if (!CR.getSearchTxt().trim().isEmpty()) {
|
||||||
|
StringTokenizer st = new StringTokenizer(CR.getSearchTxt().trim(), " ");
|
||||||
|
StringBuffer txt = new StringBuffer("(");
|
||||||
|
while (st.hasMoreTokens()) {
|
||||||
|
String token = st.nextToken();
|
||||||
|
txt.append("(A.Cognome like '%" + token + "%' or A.Nome like '%" + token + "%')");
|
||||||
|
if (st.hasMoreTokens())
|
||||||
|
txt.append(" and ");
|
||||||
|
}
|
||||||
|
txt.append(")");
|
||||||
|
wc.addWc(txt.toString());
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
PreparedStatement stmt = getConn().prepareStatement(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||||
|
return findRows(stmt, pageNumber, pageRows);
|
||||||
|
} catch (SQLException e) {
|
||||||
|
handleDebug(e);
|
||||||
|
return AB_EMPTY_VECTUMERATOR;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
32
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/AspettoCR.java
Normal file
32
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/AspettoCR.java
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
package com.ablia.anag;
|
||||||
|
|
||||||
|
import com.ablia.db.ApplParmFull;
|
||||||
|
import com.ablia.db.CRAdapter;
|
||||||
|
|
||||||
|
public class AspettoCR extends CRAdapter {
|
||||||
|
private long id_aspetto;
|
||||||
|
|
||||||
|
private String descrizione;
|
||||||
|
|
||||||
|
public AspettoCR(ApplParmFull newApplParmFull) {
|
||||||
|
super(newApplParmFull);
|
||||||
|
}
|
||||||
|
|
||||||
|
public AspettoCR() {}
|
||||||
|
|
||||||
|
public void setId_aspetto(long newId_aspetto) {
|
||||||
|
this.id_aspetto = newId_aspetto;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDescrizione(String newDescrizione) {
|
||||||
|
this.descrizione = newDescrizione;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getId_aspetto() {
|
||||||
|
return this.id_aspetto;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescrizione() {
|
||||||
|
return (this.descrizione == null) ? "" : this.descrizione.trim();
|
||||||
|
}
|
||||||
|
}
|
||||||
460
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/Banca.java
Normal file
460
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/Banca.java
Normal file
|
|
@ -0,0 +1,460 @@
|
||||||
|
package com.ablia.anag;
|
||||||
|
|
||||||
|
import com.ablia.db.ApplParmFull;
|
||||||
|
import com.ablia.db.DBAdapter;
|
||||||
|
import com.ablia.db.ResParm;
|
||||||
|
import com.ablia.db.WcString;
|
||||||
|
import com.ablia.util.StringTokenizer;
|
||||||
|
import com.ablia.util.Vectumerator;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.sql.PreparedStatement;
|
||||||
|
import java.sql.SQLException;
|
||||||
|
|
||||||
|
public class Banca extends DBAdapter implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1423651664351L;
|
||||||
|
|
||||||
|
private long id_banca;
|
||||||
|
|
||||||
|
private long id_comune;
|
||||||
|
|
||||||
|
private String descrizione;
|
||||||
|
|
||||||
|
private String iban;
|
||||||
|
|
||||||
|
private String indirizzo;
|
||||||
|
|
||||||
|
private String telefono;
|
||||||
|
|
||||||
|
private String email;
|
||||||
|
|
||||||
|
private String abi;
|
||||||
|
|
||||||
|
private String capZona;
|
||||||
|
|
||||||
|
private double importoRiba;
|
||||||
|
|
||||||
|
private Comune comune;
|
||||||
|
|
||||||
|
private String codiceAlt;
|
||||||
|
|
||||||
|
private String agenzia;
|
||||||
|
|
||||||
|
private String cab;
|
||||||
|
|
||||||
|
private String bic;
|
||||||
|
|
||||||
|
private String numeroConto;
|
||||||
|
|
||||||
|
private long ordine;
|
||||||
|
|
||||||
|
private long flgDefaultBonifico;
|
||||||
|
|
||||||
|
private long flgVisualizzaPresentazione;
|
||||||
|
|
||||||
|
public Banca(ApplParmFull newApplParmFull) {
|
||||||
|
super(newApplParmFull);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Banca() {}
|
||||||
|
|
||||||
|
public void setId_banca(long newId_banca) {
|
||||||
|
this.id_banca = newId_banca;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId_comune(long newId_comune) {
|
||||||
|
this.id_comune = newId_comune;
|
||||||
|
setComune(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDescrizione(String newDescrizione) {
|
||||||
|
this.descrizione = newDescrizione;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIban(String newIban) {
|
||||||
|
this.iban = newIban;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIndirizzo(String newIndirizzo) {
|
||||||
|
this.indirizzo = newIndirizzo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTelefono(String newTelefono) {
|
||||||
|
this.telefono = newTelefono;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEmail(String newEmail) {
|
||||||
|
this.email = newEmail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBic(String newBic) {
|
||||||
|
this.bic = newBic;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCapZona(String newCapZona) {
|
||||||
|
this.capZona = newCapZona;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getId_banca() {
|
||||||
|
return this.id_banca;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getId_comune() {
|
||||||
|
return this.id_comune;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescrizione() {
|
||||||
|
return (this.descrizione == null) ? "" : this.descrizione.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIban() {
|
||||||
|
return (this.iban == null) ? "" : this.iban.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIndirizzo() {
|
||||||
|
return (this.indirizzo == null) ? "" : this.indirizzo.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTelefono() {
|
||||||
|
return (this.telefono == null) ? "" : this.telefono.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEmail() {
|
||||||
|
return (this.email == null) ? "" : this.email.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBic() {
|
||||||
|
return (this.bic == null) ? "" : this.bic.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCapZona() {
|
||||||
|
return (this.capZona == null) ? "" : this.capZona.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setComune(Comune newComune) {
|
||||||
|
this.comune = newComune;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Comune getComune() {
|
||||||
|
this.comune = (Comune)getSecondaryObject(this.comune, Comune.class, getId_comune());
|
||||||
|
return this.comune;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected ResParm checkDeleteCascade() {
|
||||||
|
return new ResParm(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void deleteCascade() {}
|
||||||
|
|
||||||
|
public Vectumerator<Banca> findByCR(BancaCR CR, int pageNumber, int pageRows) {
|
||||||
|
String s_Sql_Find = "select DISTINCT A.* from BANCA AS A";
|
||||||
|
String s_Sql_Order = "";
|
||||||
|
WcString wc = new WcString();
|
||||||
|
if (!CR.getSearchTxt().trim().isEmpty()) {
|
||||||
|
StringTokenizer st = new StringTokenizer(CR.getSearchTxt().trim(), " ");
|
||||||
|
StringBuffer txt = new StringBuffer("(");
|
||||||
|
while (st.hasMoreTokens()) {
|
||||||
|
String token = st.nextToken();
|
||||||
|
txt.append("(A.Cognome like '%" + token + "%' or A.Nome like '%" + token + "%')");
|
||||||
|
if (st.hasMoreTokens())
|
||||||
|
txt.append(" and ");
|
||||||
|
}
|
||||||
|
txt.append(")");
|
||||||
|
wc.addWc(txt.toString());
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
PreparedStatement stmt = getConn().prepareStatement(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||||
|
return findRows(stmt, pageNumber, pageRows);
|
||||||
|
} catch (SQLException e) {
|
||||||
|
removeCPConnection();
|
||||||
|
handleDebug(e);
|
||||||
|
return AB_EMPTY_VECTUMERATOR;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodiceAlt() {
|
||||||
|
return (this.codiceAlt == null) ? "" : this.codiceAlt.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCodiceAlt(String codieAlt) {
|
||||||
|
this.codiceAlt = codieAlt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAgenzia() {
|
||||||
|
return (this.agenzia == null) ? "" : this.agenzia.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAgenzia(String agenzia) {
|
||||||
|
this.agenzia = agenzia;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAbi() {
|
||||||
|
if (this.abi == null &&
|
||||||
|
getIban().length() >= 11)
|
||||||
|
this.abi = getIban().substring(6, 11);
|
||||||
|
return (this.abi == null) ? "" : this.abi.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAbi(String abi) {
|
||||||
|
this.abi = abi;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCab() {
|
||||||
|
if (this.cab == null &&
|
||||||
|
getIban().length() >= 15)
|
||||||
|
this.cab = getIban().substring(11, 15);
|
||||||
|
return (this.cab == null) ? "" : this.cab.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCab(String cab) {
|
||||||
|
this.cab = cab;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNumeroConto() {
|
||||||
|
return (this.numeroConto == null) ? "" : this.numeroConto.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNumeroConto(String numeroConto) {
|
||||||
|
this.numeroConto = numeroConto;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void findByCodiceAlt(String codiceAlt) {
|
||||||
|
String s_Sql_Find = "select DISTINCT A.* from BANCA AS A";
|
||||||
|
String s_Sql_Order = "";
|
||||||
|
WcString wc = new WcString();
|
||||||
|
wc.addWc("A.codiceAlt='" + codiceAlt + "'");
|
||||||
|
try {
|
||||||
|
PreparedStatement stmt = getConn().prepareStatement(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||||
|
findFirstRecord(stmt);
|
||||||
|
} catch (SQLException e) {
|
||||||
|
removeCPConnection();
|
||||||
|
handleDebug(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getConto() {
|
||||||
|
if (getIban().length() > 16)
|
||||||
|
return getIban().substring(16, getIban().length());
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getOrdine() {
|
||||||
|
return this.ordine;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOrdine(long ordine) {
|
||||||
|
this.ordine = ordine;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Vectumerator<Banca> findByOrdine() {
|
||||||
|
String s_Sql_Find = "select DISTINCT A.* from BANCA AS A";
|
||||||
|
String s_Sql_Order = " ORDER BY ordine";
|
||||||
|
WcString wc = new WcString();
|
||||||
|
try {
|
||||||
|
PreparedStatement stmt = getConn().prepareStatement(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||||
|
return findRows(stmt);
|
||||||
|
} catch (SQLException e) {
|
||||||
|
removeCPConnection();
|
||||||
|
handleDebug(e);
|
||||||
|
return AB_EMPTY_VECTUMERATOR;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public ResParm settaOrdineMeno() {
|
||||||
|
ResParm rp = new ResParm(true);
|
||||||
|
Banca banca = new Banca(getApFull());
|
||||||
|
banca.findPrecedenteByOrdine(getOrdine());
|
||||||
|
if (banca.getDBState() == 1) {
|
||||||
|
long l_ordine = banca.getOrdine();
|
||||||
|
banca.setOrdine(getOrdine());
|
||||||
|
rp = banca.save();
|
||||||
|
setOrdine(l_ordine);
|
||||||
|
rp.append(save());
|
||||||
|
}
|
||||||
|
return rp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ResParm settaOrdinePiu() {
|
||||||
|
ResParm rp = new ResParm(true);
|
||||||
|
Banca banca = new Banca(getApFull());
|
||||||
|
banca.findSuccessivoByOrdine(getOrdine());
|
||||||
|
if (banca.getDBState() == 1) {
|
||||||
|
long l_ordine = banca.getOrdine();
|
||||||
|
banca.setOrdine(getOrdine());
|
||||||
|
rp = banca.save();
|
||||||
|
setOrdine(l_ordine);
|
||||||
|
rp.append(save());
|
||||||
|
}
|
||||||
|
return rp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getImportoRiba() {
|
||||||
|
return this.importoRiba;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setImportoRiba(double importoRiba) {
|
||||||
|
this.importoRiba = importoRiba;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void findPrecedenteByOrdine(long l_ordine) {
|
||||||
|
String s_Sql_Find = "select DISTINCT A.* from BANCA AS A";
|
||||||
|
String s_Sql_Order = " ORDER BY ordine desc";
|
||||||
|
WcString wc = new WcString();
|
||||||
|
wc.addWc("A.ordine<" + l_ordine);
|
||||||
|
try {
|
||||||
|
PreparedStatement stmt = getConn().prepareStatement(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||||
|
findFirstRecord(stmt);
|
||||||
|
} catch (SQLException e) {
|
||||||
|
removeCPConnection();
|
||||||
|
handleDebug(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void findSuccessivoByOrdine(long l_ordine) {
|
||||||
|
String s_Sql_Find = "select DISTINCT A.* from BANCA AS A";
|
||||||
|
String s_Sql_Order = " ORDER BY ordine asc";
|
||||||
|
WcString wc = new WcString();
|
||||||
|
wc.addWc("A.ordine>" + l_ordine);
|
||||||
|
try {
|
||||||
|
PreparedStatement stmt = getConn().prepareStatement(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||||
|
findFirstRecord(stmt);
|
||||||
|
} catch (SQLException e) {
|
||||||
|
removeCPConnection();
|
||||||
|
handleDebug(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getFlgDefaultBonifico() {
|
||||||
|
return this.flgDefaultBonifico;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFlgDefaultBonifico(long flgDefaultBonifico) {
|
||||||
|
this.flgDefaultBonifico = flgDefaultBonifico;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ResParm save() {
|
||||||
|
getFlgDefaultBonifico();
|
||||||
|
return super.save();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void findBancaDefault() {
|
||||||
|
String s_Sql_Find = "select DISTINCT A.* from BANCA AS A";
|
||||||
|
String s_Sql_Order = " ORDER BY ordine";
|
||||||
|
WcString wc = new WcString();
|
||||||
|
wc.addWc("A.flgDefaultBonifico=1");
|
||||||
|
try {
|
||||||
|
PreparedStatement stmt = getConn().prepareStatement(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||||
|
findFirstRecord(stmt);
|
||||||
|
} catch (SQLException e) {
|
||||||
|
removeCPConnection();
|
||||||
|
handleDebug(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected ResParm resetDefaultBancaBonifico() {
|
||||||
|
String sql = "update BANCA set flgDefaultBonifico = null";
|
||||||
|
return update(sql);
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getFlgVisualizzaPresentazione() {
|
||||||
|
return this.flgVisualizzaPresentazione;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFlgVisualizzaPresentazione(long flgVisualizzaPresentazione) {
|
||||||
|
this.flgVisualizzaPresentazione = flgVisualizzaPresentazione;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ResParm resetPresentazioneRibaAuto() {
|
||||||
|
String sql = "update BANCA set flgVisualizzaPresentazione = 0,ordine = 0";
|
||||||
|
return update(sql);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Vectumerator<Banca> findByOrdineVisibili() {
|
||||||
|
String s_Sql_Find = "select DISTINCT A.* from BANCA AS A";
|
||||||
|
String s_Sql_Order = " ORDER BY ordine";
|
||||||
|
WcString wc = new WcString();
|
||||||
|
wc.addWc("A.flgVisualizzaPresentazione=1");
|
||||||
|
try {
|
||||||
|
PreparedStatement stmt = getConn().prepareStatement(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||||
|
return findRows(stmt);
|
||||||
|
} catch (SQLException e) {
|
||||||
|
removeCPConnection();
|
||||||
|
handleDebug(e);
|
||||||
|
return AB_EMPTY_VECTUMERATOR;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public Vectumerator<Banca> findNonVisibili() {
|
||||||
|
String s_Sql_Find = "select DISTINCT A.* from BANCA AS A";
|
||||||
|
String s_Sql_Order = " ORDER BY A.descrizione";
|
||||||
|
WcString wc = new WcString();
|
||||||
|
wc.addWc("(A.flgVisualizzaPresentazione is null or A.flgVisualizzaPresentazione =0)");
|
||||||
|
try {
|
||||||
|
PreparedStatement stmt = getConn().prepareStatement(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||||
|
return findRows(stmt);
|
||||||
|
} catch (SQLException e) {
|
||||||
|
removeCPConnection();
|
||||||
|
handleDebug(e);
|
||||||
|
return AB_EMPTY_VECTUMERATOR;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public ResParm addBancaAPresentazioneRibaAuto() {
|
||||||
|
if (getId_banca() > 0L) {
|
||||||
|
setFlgVisualizzaPresentazione(1L);
|
||||||
|
setOrdine(getMaxOrdine() + 1L);
|
||||||
|
return save();
|
||||||
|
}
|
||||||
|
return new ResParm(false, "ERRORE! Non puoi aggiungere una banca nulla alla presentazione riba!");
|
||||||
|
}
|
||||||
|
|
||||||
|
public ResParm rimuoviBancaAPresentazioneRibaAuto() {
|
||||||
|
if (getId_banca() > 0L) {
|
||||||
|
setFlgVisualizzaPresentazione(0L);
|
||||||
|
setOrdine(0L);
|
||||||
|
return save();
|
||||||
|
}
|
||||||
|
return new ResParm(false, "ERRORE! Non puoi togliere una banca nulla alla presentazione riba!");
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getMaxOrdine() {
|
||||||
|
String s_Sql_Find = "select max(A.ordine) as _max from BANCA AS A";
|
||||||
|
String s_Sql_Order = " ORDER BY ordine asc";
|
||||||
|
WcString wc = new WcString();
|
||||||
|
try {
|
||||||
|
PreparedStatement stmt = getConn().prepareStatement(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||||
|
return (long)getMax(stmt);
|
||||||
|
} catch (SQLException e) {
|
||||||
|
removeCPConnection();
|
||||||
|
handleDebug(e);
|
||||||
|
return -1L;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescrizioneScript() {
|
||||||
|
return DBAdapter.prepareScriptString(getDescrizione());
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBancheDefaultBonificoDesc() {
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
String s_Sql_Find = "select DISTINCT A.* from BANCA AS A";
|
||||||
|
String s_Sql_Order = " ORDER BY ordine";
|
||||||
|
WcString wc = new WcString();
|
||||||
|
wc.addWc("A.flgDefaultBonifico=1");
|
||||||
|
try {
|
||||||
|
PreparedStatement stmt = getConn().prepareStatement(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||||
|
Vectumerator<Banca> vec = findRows(stmt);
|
||||||
|
while (vec.hasMoreElements()) {
|
||||||
|
Banca row = (Banca)vec.nextElement();
|
||||||
|
sb.append(row.getDescrizione());
|
||||||
|
sb.append(" ");
|
||||||
|
sb.append(row.getIban());
|
||||||
|
if (vec.hasMoreElements())
|
||||||
|
sb.append(" - ");
|
||||||
|
}
|
||||||
|
} catch (SQLException e) {
|
||||||
|
removeCPConnection();
|
||||||
|
handleDebug(e);
|
||||||
|
}
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
116
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/BancaCR.java
Normal file
116
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/BancaCR.java
Normal file
|
|
@ -0,0 +1,116 @@
|
||||||
|
package com.ablia.anag;
|
||||||
|
|
||||||
|
import com.ablia.db.ApplParmFull;
|
||||||
|
import com.ablia.db.CRAdapter;
|
||||||
|
|
||||||
|
public class BancaCR extends CRAdapter {
|
||||||
|
private long id_banca;
|
||||||
|
|
||||||
|
private long id_comune;
|
||||||
|
|
||||||
|
private String descrizione;
|
||||||
|
|
||||||
|
private String iban;
|
||||||
|
|
||||||
|
private String indirizzo;
|
||||||
|
|
||||||
|
private String telefono;
|
||||||
|
|
||||||
|
private String email;
|
||||||
|
|
||||||
|
private String bic;
|
||||||
|
|
||||||
|
private String capZona;
|
||||||
|
|
||||||
|
private Comune comune;
|
||||||
|
|
||||||
|
public BancaCR(ApplParmFull newApplParmFull) {
|
||||||
|
super(newApplParmFull);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BancaCR() {}
|
||||||
|
|
||||||
|
public void setId_banca(long newId_banca) {
|
||||||
|
this.id_banca = newId_banca;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId_comune(long newId_comune) {
|
||||||
|
this.id_comune = newId_comune;
|
||||||
|
setComune(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDescrizione(String newDescrizione) {
|
||||||
|
this.descrizione = newDescrizione;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIban(String newIban) {
|
||||||
|
this.iban = newIban;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIndirizzo(String newIndirizzo) {
|
||||||
|
this.indirizzo = newIndirizzo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTelefono(String newTelefono) {
|
||||||
|
this.telefono = newTelefono;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEmail(String newEmail) {
|
||||||
|
this.email = newEmail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBic(String newBic) {
|
||||||
|
this.bic = newBic;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCapZona(String newCapZona) {
|
||||||
|
this.capZona = newCapZona;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getId_banca() {
|
||||||
|
return this.id_banca;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getId_comune() {
|
||||||
|
return this.id_comune;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescrizione() {
|
||||||
|
return (this.descrizione == null) ? "" : this.descrizione.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIban() {
|
||||||
|
return (this.iban == null) ? "" : this.iban.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIndirizzo() {
|
||||||
|
return (this.indirizzo == null) ? "" : this.indirizzo.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTelefono() {
|
||||||
|
return (this.telefono == null) ? "" : this.telefono.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEmail() {
|
||||||
|
return (this.email == null) ? "" : this.email.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBic() {
|
||||||
|
return (this.bic == null) ? "" : this.bic.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCapZona() {
|
||||||
|
return (this.capZona == null) ? "" : this.capZona.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setComune(Comune newComune) {
|
||||||
|
this.comune = newComune;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Comune getComune() {
|
||||||
|
this.comune = (Comune)getSecondaryObject(
|
||||||
|
this.comune,
|
||||||
|
Comune.class, getId_comune());
|
||||||
|
return this.comune;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,68 @@
|
||||||
|
package com.ablia.anag;
|
||||||
|
|
||||||
|
import com.ablia.db.ApplParmFull;
|
||||||
|
import com.ablia.db.WcString;
|
||||||
|
import com.ablia.util.StringTokenizer;
|
||||||
|
import com.ablia.util.Vectumerator;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.sql.PreparedStatement;
|
||||||
|
import java.sql.SQLException;
|
||||||
|
|
||||||
|
public class CausaleTrasporto extends _AnagAdapter implements Serializable {
|
||||||
|
private long id_causaleTrasporto;
|
||||||
|
|
||||||
|
private String descrizione;
|
||||||
|
|
||||||
|
public CausaleTrasporto(ApplParmFull newApplParmFull) {
|
||||||
|
super(newApplParmFull);
|
||||||
|
}
|
||||||
|
|
||||||
|
public CausaleTrasporto() {}
|
||||||
|
|
||||||
|
public void setId_causaleTrasporto(long newId_causaleMagazzino) {
|
||||||
|
this.id_causaleTrasporto = newId_causaleMagazzino;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDescrizione(String newDescrizione) {
|
||||||
|
this.descrizione = newDescrizione;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getId_causaleTrasporto() {
|
||||||
|
return this.id_causaleTrasporto;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescrizione() {
|
||||||
|
return (this.descrizione == null) ? "" :
|
||||||
|
this.descrizione.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void deleteCascade() {}
|
||||||
|
|
||||||
|
public Vectumerator findByCR(CausaleTrasportoCR CR, int pageNumber, int pageRows) {
|
||||||
|
String s_Sql_Find = "select DISTINCT A.* from CAUSALE_TRASPORTO AS A";
|
||||||
|
String s_Sql_Order = " order by A.descrizione";
|
||||||
|
WcString wc = new WcString();
|
||||||
|
if (!CR.getSearchTxt().trim().isEmpty()) {
|
||||||
|
StringTokenizer st = new StringTokenizer(CR.getSearchTxt().trim(),
|
||||||
|
" ");
|
||||||
|
StringBuffer txt = new StringBuffer("(");
|
||||||
|
while (st.hasMoreTokens()) {
|
||||||
|
String token = st.nextToken();
|
||||||
|
txt.append("(A.Cognome like '%" + token +
|
||||||
|
"%' or A.Nome like '%" + token + "%')");
|
||||||
|
if (st.hasMoreTokens())
|
||||||
|
txt.append(" and ");
|
||||||
|
}
|
||||||
|
txt.append(")");
|
||||||
|
wc.addWc(txt.toString());
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
PreparedStatement stmt = getConn().prepareStatement(
|
||||||
|
String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||||
|
return findRows(stmt, pageNumber, pageRows);
|
||||||
|
} catch (SQLException e) {
|
||||||
|
handleDebug(e);
|
||||||
|
return AB_EMPTY_VECTUMERATOR;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,32 @@
|
||||||
|
package com.ablia.anag;
|
||||||
|
|
||||||
|
import com.ablia.db.ApplParmFull;
|
||||||
|
import com.ablia.db.CRAdapter;
|
||||||
|
|
||||||
|
public class CausaleTrasportoCR extends CRAdapter {
|
||||||
|
private long id_causaleTrasporto;
|
||||||
|
|
||||||
|
private String descrizione;
|
||||||
|
|
||||||
|
public CausaleTrasportoCR(ApplParmFull newApplParmFull) {
|
||||||
|
super(newApplParmFull);
|
||||||
|
}
|
||||||
|
|
||||||
|
public CausaleTrasportoCR() {}
|
||||||
|
|
||||||
|
public void setId_causaleTrasporto(long newId_causaleMagazzino) {
|
||||||
|
this.id_causaleTrasporto = newId_causaleMagazzino;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDescrizione(String newDescrizione) {
|
||||||
|
this.descrizione = newDescrizione;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getId_causaleTrasporto() {
|
||||||
|
return this.id_causaleTrasporto;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescrizione() {
|
||||||
|
return (this.descrizione == null) ? "" : this.descrizione.trim();
|
||||||
|
}
|
||||||
|
}
|
||||||
40
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/Cliente.java
Normal file
40
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/Cliente.java
Normal file
|
|
@ -0,0 +1,40 @@
|
||||||
|
package com.ablia.anag;
|
||||||
|
|
||||||
|
import com.ablia.db.ApplParmFull;
|
||||||
|
import com.ablia.util.Vectumerator;
|
||||||
|
|
||||||
|
public class Cliente extends Clifor {
|
||||||
|
private static final long serialVersionUID = 486912705000890691L;
|
||||||
|
|
||||||
|
private long id_cliente;
|
||||||
|
|
||||||
|
public Cliente() {}
|
||||||
|
|
||||||
|
public Cliente(ApplParmFull newApplParmFull) {
|
||||||
|
super(newApplParmFull);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTableBeanName() {
|
||||||
|
return "CLIFOR";
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFlgTipo() {
|
||||||
|
return "C";
|
||||||
|
}
|
||||||
|
|
||||||
|
public Vectumerator findByCR(ClienteCR CR, int pageNumber, int pageRows) {
|
||||||
|
return findByCR(CR, pageNumber, pageRows);
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getId_cliente() {
|
||||||
|
return getId_clifor();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId_cliente(long id_cliente) {
|
||||||
|
setId_clifor(id_cliente);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected String sqlStringfindAll() {
|
||||||
|
return "select * from CLIFOR where id_clifor>1 and flgTipo='C' order by cognome, nome";
|
||||||
|
}
|
||||||
|
}
|
||||||
25
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/ClienteCR.java
Normal file
25
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/ClienteCR.java
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
package com.ablia.anag;
|
||||||
|
|
||||||
|
import com.ablia.db.ApplParmFull;
|
||||||
|
|
||||||
|
public class ClienteCR extends CliforCR {
|
||||||
|
private long id_cliente;
|
||||||
|
|
||||||
|
public ClienteCR() {}
|
||||||
|
|
||||||
|
public ClienteCR(ApplParmFull newApplParmFull) {
|
||||||
|
super(newApplParmFull);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFlgTipo() {
|
||||||
|
return "C";
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getId_cliente() {
|
||||||
|
return getId_clifor();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId_cliente(long id_cliente) {
|
||||||
|
setId_clifor(id_cliente);
|
||||||
|
}
|
||||||
|
}
|
||||||
2220
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/Clifor.java
Normal file
2220
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/Clifor.java
Normal file
File diff suppressed because it is too large
Load diff
654
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/CliforCR.java
Normal file
654
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/CliforCR.java
Normal file
|
|
@ -0,0 +1,654 @@
|
||||||
|
package com.ablia.anag;
|
||||||
|
|
||||||
|
import com.ablia.db.ApplParmFull;
|
||||||
|
import com.ablia.db.CRAdapter;
|
||||||
|
import java.sql.Date;
|
||||||
|
|
||||||
|
public class CliforCR extends CRAdapter {
|
||||||
|
private long id_clifor;
|
||||||
|
|
||||||
|
private long id_tipoPagamento;
|
||||||
|
|
||||||
|
private String codiceAlt;
|
||||||
|
|
||||||
|
private long flgValido;
|
||||||
|
|
||||||
|
private String flgTipo;
|
||||||
|
|
||||||
|
private long flgAzienda = -1L;
|
||||||
|
|
||||||
|
private String cognome;
|
||||||
|
|
||||||
|
private String contatto;
|
||||||
|
|
||||||
|
private String nome;
|
||||||
|
|
||||||
|
private String testoMessaggio;
|
||||||
|
|
||||||
|
private String numeroCivico;
|
||||||
|
|
||||||
|
private long id_comune;
|
||||||
|
|
||||||
|
private long id_nazione;
|
||||||
|
|
||||||
|
private Date dataNascita;
|
||||||
|
|
||||||
|
private String codFisc;
|
||||||
|
|
||||||
|
private String pIva;
|
||||||
|
|
||||||
|
private String eMail;
|
||||||
|
|
||||||
|
private String fax;
|
||||||
|
|
||||||
|
private String telefono;
|
||||||
|
|
||||||
|
private String nota;
|
||||||
|
|
||||||
|
private String imgTmst;
|
||||||
|
|
||||||
|
private long flgPrivComunicazione;
|
||||||
|
|
||||||
|
private long flgPrivSensibili;
|
||||||
|
|
||||||
|
private long flgPrivTrattamento;
|
||||||
|
|
||||||
|
private long flgSesso;
|
||||||
|
|
||||||
|
private String indirizzoSped;
|
||||||
|
|
||||||
|
private String numeroCivicoSped;
|
||||||
|
|
||||||
|
private String presso;
|
||||||
|
|
||||||
|
private long id_nazioneSped;
|
||||||
|
|
||||||
|
private long id_comuneSped;
|
||||||
|
|
||||||
|
private Date dataRegistrazioneDI;
|
||||||
|
|
||||||
|
private String dichiarazioneIntento;
|
||||||
|
|
||||||
|
private String flgCF;
|
||||||
|
|
||||||
|
private long flgArt8;
|
||||||
|
|
||||||
|
private long flgTipologiaClifor;
|
||||||
|
|
||||||
|
private TipoPagamento tipoPagamento;
|
||||||
|
|
||||||
|
private Comune comune;
|
||||||
|
|
||||||
|
private Nazione nazione;
|
||||||
|
|
||||||
|
private Nazione nazioneSped;
|
||||||
|
|
||||||
|
private Comune comuneSped;
|
||||||
|
|
||||||
|
private long id_cliforEscludi;
|
||||||
|
|
||||||
|
private String indirizzo;
|
||||||
|
|
||||||
|
private long flgMlCreata = 0L;
|
||||||
|
|
||||||
|
private String mailingListEmail;
|
||||||
|
|
||||||
|
private long flgMl = -1L;
|
||||||
|
|
||||||
|
private String searchTxt2;
|
||||||
|
|
||||||
|
private String numeroDocumento;
|
||||||
|
|
||||||
|
private Date DataScadenzaDocumento;
|
||||||
|
|
||||||
|
private double percProvvigione;
|
||||||
|
|
||||||
|
private long flgNascondiWeb = -1L;
|
||||||
|
|
||||||
|
private String fileName;
|
||||||
|
|
||||||
|
private String descrizioneComune;
|
||||||
|
|
||||||
|
private String provinciaComune;
|
||||||
|
|
||||||
|
private Clifor agente;
|
||||||
|
|
||||||
|
private long id_agente;
|
||||||
|
|
||||||
|
private long id_respCommerciale;
|
||||||
|
|
||||||
|
private Clifor respCommerciale;
|
||||||
|
|
||||||
|
private long id_tipoClifor;
|
||||||
|
|
||||||
|
private long flgPA = -1L;
|
||||||
|
|
||||||
|
private long flgSplitPayment = -1L;
|
||||||
|
|
||||||
|
public CliforCR(ApplParmFull newApplParmFull) {
|
||||||
|
super(newApplParmFull);
|
||||||
|
}
|
||||||
|
|
||||||
|
public CliforCR() {}
|
||||||
|
|
||||||
|
public void setId_clifor(long newId_cliFor) {
|
||||||
|
this.id_clifor = newId_cliFor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId_tipoPagamento(long newId_tipoPagamento) {
|
||||||
|
this.id_tipoPagamento = newId_tipoPagamento;
|
||||||
|
setTipoPagamento(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCodiceAlt(String newCodiceAlt) {
|
||||||
|
this.codiceAlt = newCodiceAlt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFlgValido(long newFlgValido) {
|
||||||
|
this.flgValido = newFlgValido;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFlgTipo(String newFlgTipo) {
|
||||||
|
this.flgTipo = newFlgTipo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFlgAzienda(long newFlgAzienda) {
|
||||||
|
this.flgAzienda = newFlgAzienda;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCognome(String newCognome) {
|
||||||
|
this.cognome = newCognome;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setContatto(String newContatto) {
|
||||||
|
this.contatto = newContatto;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNome(String newNome) {
|
||||||
|
this.nome = newNome;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIndirizzo(String newIndirizzo) {
|
||||||
|
this.indirizzo = newIndirizzo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNumeroCivico(String newNumeroCivico) {
|
||||||
|
this.numeroCivico = newNumeroCivico;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId_comune(long newId_comune) {
|
||||||
|
this.id_comune = newId_comune;
|
||||||
|
setComune(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId_nazione(long newId_nazione) {
|
||||||
|
this.id_nazione = newId_nazione;
|
||||||
|
setNazione(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDataNascita(Date newDataNascita) {
|
||||||
|
this.dataNascita = newDataNascita;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCodFisc(String newCodFisc) {
|
||||||
|
this.codFisc = newCodFisc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPIva(String newPIva) {
|
||||||
|
this.pIva = newPIva;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEMail(String newEMail) {
|
||||||
|
this.eMail = newEMail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFax(String newFax) {
|
||||||
|
this.fax = newFax;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTelefono(String newTelefono) {
|
||||||
|
this.telefono = newTelefono;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNota(String newNota) {
|
||||||
|
this.nota = newNota;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setImgTmst(String newImgTmst) {
|
||||||
|
this.imgTmst = newImgTmst;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFlgPrivComunicazione(long newFlgPrivComunicazione) {
|
||||||
|
this.flgPrivComunicazione = newFlgPrivComunicazione;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFlgPrivSensibili(long newFlgPrivSensibili) {
|
||||||
|
this.flgPrivSensibili = newFlgPrivSensibili;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFlgPrivTrattamento(long newFlgPrivTrattamento) {
|
||||||
|
this.flgPrivTrattamento = newFlgPrivTrattamento;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFlgSesso(long newFlgSesso) {
|
||||||
|
this.flgSesso = newFlgSesso;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIndirizzoSped(String newIndirizzoSped) {
|
||||||
|
this.indirizzoSped = newIndirizzoSped;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNumeroCivicoSped(String newNumeroCivicoSped) {
|
||||||
|
this.numeroCivicoSped = newNumeroCivicoSped;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPresso(String newPresso) {
|
||||||
|
this.presso = newPresso;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId_nazioneSped(long newId_nazioneSped) {
|
||||||
|
this.id_nazioneSped = newId_nazioneSped;
|
||||||
|
setNazione(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId_comuneSped(long newId_comuneSped) {
|
||||||
|
this.id_comuneSped = newId_comuneSped;
|
||||||
|
setComune(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDataRegistrazioneDI(Date newDataRegistrazioneDI) {
|
||||||
|
this.dataRegistrazioneDI = newDataRegistrazioneDI;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDichiarazioneIntento(String newDichiarazioneIntento) {
|
||||||
|
this.dichiarazioneIntento = newDichiarazioneIntento;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFlgArt8(long newFlgArt8) {
|
||||||
|
this.flgArt8 = newFlgArt8;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getId_clifor() {
|
||||||
|
return this.id_clifor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getId_tipoPagamento() {
|
||||||
|
return this.id_tipoPagamento;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodiceAlt() {
|
||||||
|
return (this.codiceAlt == null) ? "" : this.codiceAlt.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getFlgValido() {
|
||||||
|
return this.flgValido;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFlgTipo() {
|
||||||
|
return (this.flgTipo == null) ? "" : this.flgTipo.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTipo() {
|
||||||
|
return Clifor.getTipo(getFlgTipo());
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getFlgAzienda() {
|
||||||
|
return this.flgAzienda;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCognome() {
|
||||||
|
return (this.cognome == null) ? "" : this.cognome.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getContatto() {
|
||||||
|
return (this.contatto == null) ? "" : this.contatto.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNome() {
|
||||||
|
return (this.nome == null) ? "" : this.nome.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIndirizzo() {
|
||||||
|
return (this.indirizzo == null) ? "" : this.indirizzo.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNumeroCivico() {
|
||||||
|
return (this.numeroCivico == null) ? "" : this.numeroCivico.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getId_comune() {
|
||||||
|
return this.id_comune;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getId_nazione() {
|
||||||
|
return this.id_nazione;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getDataNascita() {
|
||||||
|
return this.dataNascita;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodFisc() {
|
||||||
|
return (this.codFisc == null) ? "" : this.codFisc.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPIva() {
|
||||||
|
return (this.pIva == null) ? "" : this.pIva.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEMail() {
|
||||||
|
return (this.eMail == null) ? "" : this.eMail.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFax() {
|
||||||
|
return (this.fax == null) ? "" : this.fax.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTelefono() {
|
||||||
|
return (this.telefono == null) ? "" : this.telefono.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNota() {
|
||||||
|
return (this.nota == null) ? "" : this.nota.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getImgTmst() {
|
||||||
|
return (this.imgTmst == null) ? "" : this.imgTmst.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getFlgPrivComunicazione() {
|
||||||
|
return this.flgPrivComunicazione;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getFlgPrivSensibili() {
|
||||||
|
return this.flgPrivSensibili;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getFlgPrivTrattamento() {
|
||||||
|
return this.flgPrivTrattamento;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getFlgSesso() {
|
||||||
|
return this.flgSesso;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIndirizzoSped() {
|
||||||
|
return (this.indirizzoSped == null) ? "" : this.indirizzoSped.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNumeroCivicoSped() {
|
||||||
|
return (this.numeroCivicoSped == null) ? "" : this.numeroCivicoSped.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPresso() {
|
||||||
|
return (this.presso == null) ? "" : this.presso.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getId_nazioneSped() {
|
||||||
|
return this.id_nazioneSped;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getId_comuneSped() {
|
||||||
|
return this.id_comuneSped;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getDataRegistrazioneDI() {
|
||||||
|
return this.dataRegistrazioneDI;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDichiarazioneIntento() {
|
||||||
|
return (this.dichiarazioneIntento == null) ? "" : this.dichiarazioneIntento.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getFlgArt8() {
|
||||||
|
return this.flgArt8;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTipoPagamento(TipoPagamento newTipoPagamento) {
|
||||||
|
this.tipoPagamento = newTipoPagamento;
|
||||||
|
}
|
||||||
|
|
||||||
|
public TipoPagamento getTipoPagamento() {
|
||||||
|
this.tipoPagamento = (TipoPagamento)getSecondaryObject(this.tipoPagamento, TipoPagamento.class, getId_tipoPagamento());
|
||||||
|
return this.tipoPagamento;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setComune(Comune newComune) {
|
||||||
|
this.comune = newComune;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Comune getComune() {
|
||||||
|
this.comune = (Comune)getSecondaryObject(this.comune, Comune.class, getId_comune());
|
||||||
|
return this.comune;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNazione(Nazione newNazione) {
|
||||||
|
this.nazione = newNazione;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Nazione getNazione() {
|
||||||
|
this.nazione = (Nazione)getSecondaryObject(this.nazione, Nazione.class, getId_nazione());
|
||||||
|
return this.nazione;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNazioneSped(Nazione newNazione) {
|
||||||
|
this.nazioneSped = newNazione;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Nazione getNazioneSped() {
|
||||||
|
this.nazioneSped = (Nazione)getSecondaryObject(this.nazioneSped, Nazione.class, getId_nazioneSped());
|
||||||
|
return this.nazioneSped;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setComuneSped(Comune newComune) {
|
||||||
|
this.comuneSped = newComune;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Comune getComuneSped() {
|
||||||
|
this.comuneSped = (Comune)getSecondaryObject(this.comuneSped, Comune.class, getId_comuneSped());
|
||||||
|
return this.comuneSped;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFlgCF() {
|
||||||
|
return (this.flgCF == null) ? "" : this.flgCF;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCF() {
|
||||||
|
if (getFlgCF().equals("C"))
|
||||||
|
return "Cliente";
|
||||||
|
if (getFlgCF().equals("F"))
|
||||||
|
return "Fornitore";
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFlgCF(String flgCF) {
|
||||||
|
this.flgCF = flgCF;
|
||||||
|
setFlgTipo(flgCF);
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getId_cliforEscludi() {
|
||||||
|
return this.id_cliforEscludi;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId_cliforEscludi(long id_cliforEscludi) {
|
||||||
|
this.id_cliforEscludi = id_cliforEscludi;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTestoMessaggio() {
|
||||||
|
return (this.testoMessaggio == null) ? "" : this.testoMessaggio.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTestoMessaggio(String testoMessaggio) {
|
||||||
|
this.testoMessaggio = testoMessaggio;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getFlgMlCreata() {
|
||||||
|
return this.flgMlCreata;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFlgMlCreata(long flgMlCreata) {
|
||||||
|
this.flgMlCreata = flgMlCreata;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMailingListEmail() {
|
||||||
|
return this.mailingListEmail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMailingListEmail(String mailingListEmail) {
|
||||||
|
this.mailingListEmail = mailingListEmail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getFlgMl() {
|
||||||
|
return this.flgMl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFlgMl(long flgMl) {
|
||||||
|
this.flgMl = flgMl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSearchTxt2() {
|
||||||
|
return (this.searchTxt2 == null) ? "" : this.searchTxt2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSearchTxt2(String searchText2) {
|
||||||
|
this.searchTxt2 = searchText2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNumeroDocumento() {
|
||||||
|
return this.numeroDocumento;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNumeroDocumento(String numeroDocumento) {
|
||||||
|
this.numeroDocumento = numeroDocumento;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getDataScadenzaDocumento() {
|
||||||
|
return this.DataScadenzaDocumento;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDataScadenzaDocumento(Date dataScadenzaDocumento) {
|
||||||
|
this.DataScadenzaDocumento = dataScadenzaDocumento;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getPercProvvigione() {
|
||||||
|
return this.percProvvigione;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPercProvvigione(double percProvvigione) {
|
||||||
|
this.percProvvigione = percProvvigione;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getFlgNascondiWeb() {
|
||||||
|
return this.flgNascondiWeb;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFlgNascondiWeb(long flgVisibileWeb) {
|
||||||
|
this.flgNascondiWeb = flgVisibileWeb;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getFlgTipologiaClifor() {
|
||||||
|
return this.flgTipologiaClifor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFlgTipologiaClifor(long flgTipologiaClifor) {
|
||||||
|
this.flgTipologiaClifor = flgTipologiaClifor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFileName() {
|
||||||
|
return (this.fileName == null) ? "" : this.fileName.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFileName(String fileName) {
|
||||||
|
this.fileName = fileName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getpIva() {
|
||||||
|
return this.pIva;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setpIva(String pIva) {
|
||||||
|
this.pIva = pIva;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String geteMail() {
|
||||||
|
return this.eMail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void seteMail(String eMail) {
|
||||||
|
this.eMail = eMail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescrizioneComune() {
|
||||||
|
return (this.descrizioneComune == null) ? "" : this.descrizioneComune;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDescrizioneComune(String descrizioneComune) {
|
||||||
|
this.descrizioneComune = descrizioneComune;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getProvinciaComune() {
|
||||||
|
return (this.provinciaComune == null) ? "" : this.provinciaComune;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProvinciaComune(String provinciaComune) {
|
||||||
|
this.provinciaComune = provinciaComune;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Clifor getAgente() {
|
||||||
|
this.agente = (Clifor)getSecondaryObject(this.agente, Clifor.class, getId_agente());
|
||||||
|
return this.agente;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getId_agente() {
|
||||||
|
return this.id_agente;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getId_respCommerciale() {
|
||||||
|
return this.id_respCommerciale;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Clifor getRespCommerciale() {
|
||||||
|
this.respCommerciale = (Clifor)getSecondaryObject(this.respCommerciale, Clifor.class, getId_respCommerciale());
|
||||||
|
return this.respCommerciale;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAgente(Clifor agente) {
|
||||||
|
this.agente = agente;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId_agente(long id_agente) {
|
||||||
|
this.id_agente = id_agente;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId_respCommerciale(long id_respCommerciale) {
|
||||||
|
this.id_respCommerciale = id_respCommerciale;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRespCommerciale(Clifor respCommerciale) {
|
||||||
|
this.respCommerciale = respCommerciale;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getId_tipoClifor() {
|
||||||
|
return this.id_tipoClifor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId_tipoClifor(long id_tipoClifor) {
|
||||||
|
this.id_tipoClifor = id_tipoClifor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getFlgPA() {
|
||||||
|
return this.flgPA;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFlgPA(long flgPA) {
|
||||||
|
this.flgPA = flgPA;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getFlgSplitPayment() {
|
||||||
|
return this.flgSplitPayment;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFlgSplitPayment(long flgSplitPayment) {
|
||||||
|
this.flgSplitPayment = flgSplitPayment;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,267 @@
|
||||||
|
package com.ablia.anag;
|
||||||
|
|
||||||
|
import com.ablia.db.ResParm;
|
||||||
|
import com.ablia.util.Vectumerator;
|
||||||
|
import java.sql.Date;
|
||||||
|
|
||||||
|
public interface CliforInterface {
|
||||||
|
void setId_clifor(long paramLong);
|
||||||
|
|
||||||
|
void setId_tipoPagamento(long paramLong);
|
||||||
|
|
||||||
|
void setCodiceAlt(String paramString);
|
||||||
|
|
||||||
|
void setFlgValido(long paramLong);
|
||||||
|
|
||||||
|
void setFlgTipo(String paramString);
|
||||||
|
|
||||||
|
void setFlgAzienda(long paramLong);
|
||||||
|
|
||||||
|
void setCognome(String paramString);
|
||||||
|
|
||||||
|
void setContatto(String paramString);
|
||||||
|
|
||||||
|
void setNome(String paramString);
|
||||||
|
|
||||||
|
void setIndirizzo(String paramString);
|
||||||
|
|
||||||
|
void setNumeroCivico(String paramString);
|
||||||
|
|
||||||
|
void setId_comune(long paramLong);
|
||||||
|
|
||||||
|
void setId_nazione(String paramString);
|
||||||
|
|
||||||
|
void setDataNascita(Date paramDate);
|
||||||
|
|
||||||
|
void setCodFisc(String paramString);
|
||||||
|
|
||||||
|
void setPIva(String paramString);
|
||||||
|
|
||||||
|
void setEMail(String paramString);
|
||||||
|
|
||||||
|
void setFax(String paramString);
|
||||||
|
|
||||||
|
void setTelefono(String paramString);
|
||||||
|
|
||||||
|
void setNota(String paramString);
|
||||||
|
|
||||||
|
void setImgTmst(String paramString);
|
||||||
|
|
||||||
|
void setFlgPrivComunicazione(long paramLong);
|
||||||
|
|
||||||
|
void setFlgPrivSensibili(long paramLong);
|
||||||
|
|
||||||
|
void setFlgPrivTrattamento(long paramLong);
|
||||||
|
|
||||||
|
void setFlgSesso(long paramLong);
|
||||||
|
|
||||||
|
void setWww(String paramString);
|
||||||
|
|
||||||
|
void setDataRegistrazioneDI(Date paramDate);
|
||||||
|
|
||||||
|
void setDichiarazioneIntento(String paramString);
|
||||||
|
|
||||||
|
void setFlgArt8(long paramLong);
|
||||||
|
|
||||||
|
long getId_clifor();
|
||||||
|
|
||||||
|
long getId_tipoPagamento();
|
||||||
|
|
||||||
|
String getCodiceAlt();
|
||||||
|
|
||||||
|
long getFlgValido();
|
||||||
|
|
||||||
|
String getFlgTipo();
|
||||||
|
|
||||||
|
String getTipo();
|
||||||
|
|
||||||
|
long getFlgAzienda();
|
||||||
|
|
||||||
|
String getDescrizioneCompleta();
|
||||||
|
|
||||||
|
String getCognomeNome();
|
||||||
|
|
||||||
|
String getContatto();
|
||||||
|
|
||||||
|
String getNome();
|
||||||
|
|
||||||
|
String getIndirizzo();
|
||||||
|
|
||||||
|
String getIndirizzoCompleto();
|
||||||
|
|
||||||
|
String getIndirizzoCompletoHtml();
|
||||||
|
|
||||||
|
String getNumeroCivico();
|
||||||
|
|
||||||
|
long getId_comune();
|
||||||
|
|
||||||
|
String getId_nazione();
|
||||||
|
|
||||||
|
Date getDataNascita();
|
||||||
|
|
||||||
|
String getCodFisc();
|
||||||
|
|
||||||
|
String getPIva();
|
||||||
|
|
||||||
|
String getEMail();
|
||||||
|
|
||||||
|
String getFax();
|
||||||
|
|
||||||
|
String getTelefono();
|
||||||
|
|
||||||
|
String getNota();
|
||||||
|
|
||||||
|
String getImgTmst();
|
||||||
|
|
||||||
|
long getFlgPrivComunicazione();
|
||||||
|
|
||||||
|
long getFlgPrivSensibili();
|
||||||
|
|
||||||
|
long getFlgPrivTrattamento();
|
||||||
|
|
||||||
|
long getFlgSesso();
|
||||||
|
|
||||||
|
String getWww();
|
||||||
|
|
||||||
|
Date getDataRegistrazioneDI();
|
||||||
|
|
||||||
|
String getDichiarazioneIntento();
|
||||||
|
|
||||||
|
long getFlgArt8();
|
||||||
|
|
||||||
|
void setTipoPagamento(TipoPagamento paramTipoPagamento);
|
||||||
|
|
||||||
|
TipoPagamento getTipoPagamento();
|
||||||
|
|
||||||
|
void setComune(Comune paramComune);
|
||||||
|
|
||||||
|
Comune getComune();
|
||||||
|
|
||||||
|
void setNazione(Nazione paramNazione);
|
||||||
|
|
||||||
|
Nazione getNazione();
|
||||||
|
|
||||||
|
void findByCF(String paramString1, String paramString2);
|
||||||
|
|
||||||
|
void findByPIva(String paramString1, String paramString2);
|
||||||
|
|
||||||
|
String getCodFiscCalc();
|
||||||
|
|
||||||
|
boolean isCodFiscDuplicated();
|
||||||
|
|
||||||
|
boolean isPIvaDuplicated();
|
||||||
|
|
||||||
|
boolean isPIvaCodfiscDuplicated();
|
||||||
|
|
||||||
|
boolean isCodFiscOk();
|
||||||
|
|
||||||
|
long getId_comuneNascita();
|
||||||
|
|
||||||
|
void setId_comuneNascita(long paramLong);
|
||||||
|
|
||||||
|
Comune getComuneNascita();
|
||||||
|
|
||||||
|
void setComuneNascita(Comune paramComune);
|
||||||
|
|
||||||
|
String getSesso();
|
||||||
|
|
||||||
|
Vectumerator findUsers(int paramInt1, int paramInt2);
|
||||||
|
|
||||||
|
String getCognome();
|
||||||
|
|
||||||
|
String getIban();
|
||||||
|
|
||||||
|
void setIban(String paramString);
|
||||||
|
|
||||||
|
String getAbi();
|
||||||
|
|
||||||
|
String getCab();
|
||||||
|
|
||||||
|
String getConto();
|
||||||
|
|
||||||
|
String getCapZona();
|
||||||
|
|
||||||
|
void setCapZona(String paramString);
|
||||||
|
|
||||||
|
Vectumerator getDestinazioniDiverse();
|
||||||
|
|
||||||
|
ResParm addDestinazioneDiversa(DestinazioneDiversa paramDestinazioneDiversa);
|
||||||
|
|
||||||
|
ResParm delDestinazioneDiversa(DestinazioneDiversa paramDestinazioneDiversa);
|
||||||
|
|
||||||
|
String getCellulare();
|
||||||
|
|
||||||
|
void setCellulare(String paramString);
|
||||||
|
|
||||||
|
String getBancaDesc();
|
||||||
|
|
||||||
|
void setBancaDesc(String paramString);
|
||||||
|
|
||||||
|
String getBancaCompleto();
|
||||||
|
|
||||||
|
long getId_listino();
|
||||||
|
|
||||||
|
void setId_listino(long paramLong);
|
||||||
|
|
||||||
|
Listino getListino();
|
||||||
|
|
||||||
|
void setListino(Listino paramListino);
|
||||||
|
|
||||||
|
long getCloseCommand();
|
||||||
|
|
||||||
|
void setCloseCommand(long paramLong);
|
||||||
|
|
||||||
|
Clifor getCliforDup();
|
||||||
|
|
||||||
|
void setId_cliforDup(long paramLong);
|
||||||
|
|
||||||
|
long getId_cliforDup();
|
||||||
|
|
||||||
|
void setCliforDup(Clifor paramClifor);
|
||||||
|
|
||||||
|
Vectumerator getContratti();
|
||||||
|
|
||||||
|
ResParm addContratto(Contratto paramContratto);
|
||||||
|
|
||||||
|
ResParm delContratto(Contratto paramContratto);
|
||||||
|
|
||||||
|
ResParm creaMailingListCR(CliforCR paramCliforCR);
|
||||||
|
|
||||||
|
void resetMailingListFileCR();
|
||||||
|
|
||||||
|
boolean addToMailingListFileCR();
|
||||||
|
|
||||||
|
String getMailingMailCR();
|
||||||
|
|
||||||
|
long getFlgMl();
|
||||||
|
|
||||||
|
void setFlgMl(long paramLong);
|
||||||
|
|
||||||
|
Vectumerator findByCR(CliforCR paramCliforCR, int paramInt1, int paramInt2);
|
||||||
|
|
||||||
|
String getDescrizioneComune();
|
||||||
|
|
||||||
|
void setDescrizioneComune(String paramString);
|
||||||
|
|
||||||
|
String getProvinciaComune();
|
||||||
|
|
||||||
|
void setProvinciaComune(String paramString);
|
||||||
|
|
||||||
|
String getCapComune();
|
||||||
|
|
||||||
|
void setCapComune(String paramString);
|
||||||
|
|
||||||
|
String getPathAllegato();
|
||||||
|
|
||||||
|
Vectumerator getAllegati(long paramLong);
|
||||||
|
|
||||||
|
ResParm addAllegato(AllegatoClifor paramAllegatoClifor);
|
||||||
|
|
||||||
|
ResParm delAllegato(AllegatoClifor paramAllegatoClifor);
|
||||||
|
|
||||||
|
void creaCodaMessaggi(CliforCR paramCliforCR, long paramLong);
|
||||||
|
|
||||||
|
long getFlgRC();
|
||||||
|
|
||||||
|
void setFlgRC(long paramLong);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,190 @@
|
||||||
|
package com.ablia.anag;
|
||||||
|
|
||||||
|
import com.ablia.db.ApplParmFull;
|
||||||
|
import com.ablia.db.WcString;
|
||||||
|
import com.ablia.util.Vectumerator;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.sql.PreparedStatement;
|
||||||
|
import java.sql.SQLException;
|
||||||
|
|
||||||
|
public class CliforTipoClifor extends _AnagAdapter implements Serializable {
|
||||||
|
private static final long serialVersionUID = -2647000200627619105L;
|
||||||
|
|
||||||
|
private long id_cliforTipoClifor;
|
||||||
|
|
||||||
|
private long id_clifor;
|
||||||
|
|
||||||
|
private long id_tipoClifor;
|
||||||
|
|
||||||
|
private Clifor clifor;
|
||||||
|
|
||||||
|
private TipoClifor tipoClifor;
|
||||||
|
|
||||||
|
private double percProvvigione;
|
||||||
|
|
||||||
|
public CliforTipoClifor(ApplParmFull newApplParmFull) {
|
||||||
|
super(newApplParmFull);
|
||||||
|
}
|
||||||
|
|
||||||
|
public CliforTipoClifor() {}
|
||||||
|
|
||||||
|
public void setId_tipoClifor(long newId_tipoClifor) {
|
||||||
|
this.id_tipoClifor = newId_tipoClifor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getId_tipoClifor() {
|
||||||
|
return this.id_tipoClifor;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void deleteCascade() {}
|
||||||
|
|
||||||
|
public Vectumerator findByCR(CliforTipoCliforCR CR, int pageNumber, int pageRows) {
|
||||||
|
String s_Sql_Find = "select DISTINCT A.* from CLIFOR_TIPO_CLIFOR AS A INNER JOIN TIPO_CLIFOR AS B ON A.id_tipoClifor = B.id_tipoClifor ";
|
||||||
|
String s_Sql_Order = " ";
|
||||||
|
WcString wc = new WcString();
|
||||||
|
if (CR.getId_clifor() != 0L)
|
||||||
|
wc.addWc("A.id_clifor=" + CR.getId_clifor());
|
||||||
|
if (!CR.getFlgTipoClifor().isEmpty())
|
||||||
|
wc.addWc("B.flgTipo='" + CR.getFlgTipoClifor() + "' ");
|
||||||
|
try {
|
||||||
|
PreparedStatement stmt = getConn().prepareStatement(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||||
|
return findRows(stmt, pageNumber, pageRows);
|
||||||
|
} catch (SQLException e) {
|
||||||
|
handleDebug(e);
|
||||||
|
return AB_EMPTY_VECTUMERATOR;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getId_cliforTipoClifor() {
|
||||||
|
return this.id_cliforTipoClifor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId_cliforTipoClifor(long id_cliforTipoClifor) {
|
||||||
|
this.id_cliforTipoClifor = id_cliforTipoClifor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getId_clifor() {
|
||||||
|
return this.id_clifor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId_clifor(long id_clifor) {
|
||||||
|
this.id_clifor = id_clifor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Clifor getClifor() {
|
||||||
|
this.clifor = (Clifor)getSecondaryObject(this.clifor, Clifor.class, getId_clifor());
|
||||||
|
return this.clifor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setClifor(Clifor clifor) {
|
||||||
|
this.clifor = clifor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public TipoClifor getTipoClifor() {
|
||||||
|
this.tipoClifor = (TipoClifor)getSecondaryObject(this.tipoClifor, TipoClifor.class, getId_tipoClifor());
|
||||||
|
return this.tipoClifor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTipoClifor(TipoClifor tipoClifor) {
|
||||||
|
this.tipoClifor = tipoClifor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isRespondabileCommercialeByClifor(long l_id_clifor) {
|
||||||
|
String s_Sql_Find = "select DISTINCT A.* from CLIFOR_TIPO_CLIFOR AS A, TIPO_CLIFOR AS B";
|
||||||
|
String s_Sql_Order = " ";
|
||||||
|
WcString wc = new WcString();
|
||||||
|
wc.addWc("A.id_tipoClifor=B.id_tipoClifor");
|
||||||
|
wc.addWc("A.id_clifor=" + l_id_clifor);
|
||||||
|
wc.addWc("( B.flgTipologia=3)");
|
||||||
|
try {
|
||||||
|
PreparedStatement stmt = getConn().prepareStatement(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||||
|
Vectumerator vec = findRows(stmt, 1, 1);
|
||||||
|
if (vec.getTotNumberOfRecords() > 0)
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
|
} catch (SQLException e) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getPercProvvigione() {
|
||||||
|
return this.percProvvigione;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPercProvvigione(double percProvvigione) {
|
||||||
|
this.percProvvigione = percProvvigione;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void findByCliforTipologia(long l_id_clifor, long l_flgTipologiaClifor) {
|
||||||
|
String s_Sql_Find = "select DISTINCT A.* from CLIFOR_TIPO_CLIFOR AS A, TIPO_CLIFOR AS B";
|
||||||
|
String s_Sql_Order = " ";
|
||||||
|
WcString wc = new WcString();
|
||||||
|
wc.addWc("A.id_tipoClifor=B.id_tipoClifor");
|
||||||
|
wc.addWc("A.id_clifor=" + l_id_clifor);
|
||||||
|
if (l_flgTipologiaClifor == 0L) {
|
||||||
|
wc.addWc("(B.flgTipologia is null or B.flgTipologia=0)");
|
||||||
|
} else if (l_flgTipologiaClifor > 0L) {
|
||||||
|
wc.addWc("B.flgTipologia=" + l_flgTipologiaClifor);
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
PreparedStatement stmt = getConn().prepareStatement(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||||
|
findFirstRecord(stmt);
|
||||||
|
} catch (SQLException e) {
|
||||||
|
handleDebug(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isAgenteByClifor(long l_id_clifor) {
|
||||||
|
String s_Sql_Find = "select DISTINCT A.* from CLIFOR_TIPO_CLIFOR AS A, TIPO_CLIFOR AS B";
|
||||||
|
String s_Sql_Order = " ";
|
||||||
|
WcString wc = new WcString();
|
||||||
|
wc.addWc("A.id_tipoClifor=B.id_tipoClifor");
|
||||||
|
wc.addWc("A.id_clifor=" + l_id_clifor);
|
||||||
|
wc.addWc("(B.flgTipologia=1)");
|
||||||
|
try {
|
||||||
|
PreparedStatement stmt = getConn().prepareStatement(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||||
|
Vectumerator vec = findRows(stmt, 1, 1);
|
||||||
|
if (vec.getTotNumberOfRecords() > 0)
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
|
} catch (SQLException e) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isProgettistaByClifor(long l_id_clifor) {
|
||||||
|
String s_Sql_Find = "select DISTINCT A.* from CLIFOR_TIPO_CLIFOR AS A, TIPO_CLIFOR AS B";
|
||||||
|
String s_Sql_Order = " ";
|
||||||
|
WcString wc = new WcString();
|
||||||
|
wc.addWc("A.id_tipoClifor=B.id_tipoClifor");
|
||||||
|
wc.addWc("A.id_clifor=" + l_id_clifor);
|
||||||
|
wc.addWc("(B.flgTipologia=2)");
|
||||||
|
try {
|
||||||
|
PreparedStatement stmt = getConn().prepareStatement(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||||
|
Vectumerator vec = findRows(stmt, 1, 1);
|
||||||
|
if (vec.getTotNumberOfRecords() > 0)
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
|
} catch (SQLException e) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isAgenteORespondabileCommercialeByClifor(long l_id_clifor) {
|
||||||
|
String s_Sql_Find = "select DISTINCT A.* from CLIFOR_TIPO_CLIFOR AS A, TIPO_CLIFOR AS B";
|
||||||
|
String s_Sql_Order = " ";
|
||||||
|
WcString wc = new WcString();
|
||||||
|
wc.addWc("A.id_tipoClifor=B.id_tipoClifor");
|
||||||
|
wc.addWc("A.id_clifor=" + l_id_clifor);
|
||||||
|
wc.addWc("(B.flgTipologia=1 or B.flgTipologia=3)");
|
||||||
|
try {
|
||||||
|
PreparedStatement stmt = getConn().prepareStatement(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||||
|
Vectumerator vec = findRows(stmt, 1, 1);
|
||||||
|
if (vec.getTotNumberOfRecords() > 0)
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
|
} catch (SQLException e) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,77 @@
|
||||||
|
package com.ablia.anag;
|
||||||
|
|
||||||
|
import com.ablia.db.ApplParmFull;
|
||||||
|
import com.ablia.db.CRAdapter;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
public class CliforTipoCliforCR extends CRAdapter implements Serializable {
|
||||||
|
private long id_cliforTipoClifor;
|
||||||
|
|
||||||
|
private long id_clifor;
|
||||||
|
|
||||||
|
private long id_tipoClifor;
|
||||||
|
|
||||||
|
private Clifor clifor;
|
||||||
|
|
||||||
|
private TipoClifor tipoClifor;
|
||||||
|
|
||||||
|
private String flgTipoClifor;
|
||||||
|
|
||||||
|
public CliforTipoCliforCR(ApplParmFull newApplParmFull) {
|
||||||
|
super(newApplParmFull);
|
||||||
|
}
|
||||||
|
|
||||||
|
public CliforTipoCliforCR() {}
|
||||||
|
|
||||||
|
public void setId_tipoClifor(long newId_causaleMagazzino) {
|
||||||
|
this.id_tipoClifor = newId_causaleMagazzino;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getId_tipoClifor() {
|
||||||
|
return this.id_tipoClifor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getId_cliforTipoClifor() {
|
||||||
|
return this.id_cliforTipoClifor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId_cliforTipoClifor(long id_cliforTipoClifor) {
|
||||||
|
this.id_cliforTipoClifor = id_cliforTipoClifor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getId_clifor() {
|
||||||
|
return this.id_clifor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId_clifor(long id_clifor) {
|
||||||
|
this.id_clifor = id_clifor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Clifor getClifor() {
|
||||||
|
this.clifor = (Clifor)getSecondaryObject(this.clifor, Clifor.class,
|
||||||
|
getId_clifor());
|
||||||
|
return this.clifor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setClifor(Clifor clifor) {
|
||||||
|
this.clifor = clifor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public TipoClifor getTipoClifor() {
|
||||||
|
this.tipoClifor = (TipoClifor)getSecondaryObject(this.tipoClifor, TipoClifor.class,
|
||||||
|
getId_tipoClifor());
|
||||||
|
return this.tipoClifor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTipoClifor(TipoClifor tipoClifor) {
|
||||||
|
this.tipoClifor = tipoClifor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFlgTipoClifor() {
|
||||||
|
return this.flgTipoClifor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFlgTipoClifor(String flgTipoClifor) {
|
||||||
|
this.flgTipoClifor = flgTipoClifor;
|
||||||
|
}
|
||||||
|
}
|
||||||
103
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/CliforUsers.java
Normal file
103
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/anag/CliforUsers.java
Normal file
|
|
@ -0,0 +1,103 @@
|
||||||
|
package com.ablia.anag;
|
||||||
|
|
||||||
|
import com.ablia.db.ApplParmFull;
|
||||||
|
import com.ablia.db.DBAdapter;
|
||||||
|
import com.ablia.db.WcString;
|
||||||
|
import com.ablia.util.StringTokenizer;
|
||||||
|
import com.ablia.util.Vectumerator;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.sql.PreparedStatement;
|
||||||
|
import java.sql.SQLException;
|
||||||
|
|
||||||
|
public class CliforUsers extends _AnagAdapter implements Serializable {
|
||||||
|
private long id_cliforUsers;
|
||||||
|
|
||||||
|
private long id_cliFor;
|
||||||
|
|
||||||
|
private long id_users;
|
||||||
|
|
||||||
|
private Clifor cliFor;
|
||||||
|
|
||||||
|
private com.ablia.common.Users users;
|
||||||
|
|
||||||
|
public CliforUsers(ApplParmFull newApplParmFull) {
|
||||||
|
super(newApplParmFull);
|
||||||
|
}
|
||||||
|
|
||||||
|
public CliforUsers() {}
|
||||||
|
|
||||||
|
public void setId_cliforUsers(long newId_cliforUsers) {
|
||||||
|
this.id_cliforUsers = newId_cliforUsers;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId_cliFor(long newId_cliFor) {
|
||||||
|
this.id_cliFor = newId_cliFor;
|
||||||
|
setCliFor(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId_users(long newId_users) {
|
||||||
|
this.id_users = newId_users;
|
||||||
|
setUsers(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getId_cliforUsers() {
|
||||||
|
return this.id_cliforUsers;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getId_cliFor() {
|
||||||
|
return this.id_cliFor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getId_users() {
|
||||||
|
return this.id_users;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCliFor(Clifor newCliFor) {
|
||||||
|
this.cliFor = newCliFor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Clifor getCliFor() {
|
||||||
|
this.cliFor = (Clifor)getSecondaryObject(
|
||||||
|
this.cliFor,
|
||||||
|
Clifor.class, getId_cliFor());
|
||||||
|
return this.cliFor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUsers(com.ablia.common.Users newUsers) {
|
||||||
|
this.users = newUsers;
|
||||||
|
}
|
||||||
|
|
||||||
|
public com.ablia.common.Users getUsers() {
|
||||||
|
this.users = (com.ablia.common.Users)getSecondaryObject(
|
||||||
|
(DBAdapter)this.users,
|
||||||
|
com.ablia.common.Users.class, getId_users());
|
||||||
|
return this.users;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void deleteCascade() {}
|
||||||
|
|
||||||
|
public Vectumerator findByCR(CliforUsersCR CR, int pageNumber, int pageRows) {
|
||||||
|
String s_Sql_Find = "select DISTINCT A.* from CLIFOR_USERS AS A";
|
||||||
|
String s_Sql_Order = "";
|
||||||
|
WcString wc = new WcString();
|
||||||
|
if (!CR.getSearchTxt().trim().isEmpty()) {
|
||||||
|
StringTokenizer st = new StringTokenizer(CR.getSearchTxt().trim(), " ");
|
||||||
|
StringBuffer txt = new StringBuffer("(");
|
||||||
|
while (st.hasMoreTokens()) {
|
||||||
|
String token = st.nextToken();
|
||||||
|
txt.append("(A.Cognome like '%" + token + "%' or A.Nome like '%" + token + "%')");
|
||||||
|
if (st.hasMoreTokens())
|
||||||
|
txt.append(" and ");
|
||||||
|
}
|
||||||
|
txt.append(")");
|
||||||
|
wc.addWc(txt.toString());
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
PreparedStatement stmt = getConn().prepareStatement(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||||
|
return findRows(stmt, pageNumber, pageRows);
|
||||||
|
} catch (SQLException e) {
|
||||||
|
handleDebug(e);
|
||||||
|
return AB_EMPTY_VECTUMERATOR;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue